C# Класс Jurassic.Compiler.DeclarativeScope

Represents a scope where the variables are statically known.
Наследование: Scope
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CreateRuntimeScope ( Scope parentScope, string declaredVariableNames ) : DeclarativeScope

Creates a new declarative scope for use at runtime.

Delete ( string variableName ) : bool

Deletes the variable from the scope.

GetValue ( string variableName ) : object

Returns the value of the given variable.

HasValue ( string variableName ) : bool

Returns true if the given variable exists in this scope.

SetValue ( string variableName, object value ) : void

Sets the value of the given variable.

Приватные методы

Метод Описание
CreateCatchScope ( Scope parentScope, string catchVariableName ) : DeclarativeScope

Creates a new declarative scope for use inside a catch statement.

CreateEvalScope ( Scope parentScope ) : DeclarativeScope

Creates a new declarative scope for use inside a strict mode eval statement.

CreateFunctionScope ( Scope parentScope, string functionName, IEnumerable argumentNames ) : DeclarativeScope

Creates a new declarative scope for use inside a function body (and within function argument default values).

DeclarativeScope ( Scope parentScope, int declaredVariableCount ) : System

Creates a new DeclarativeScope instance.

DeclareVariable ( string name, Jurassic.Compiler.Expression valueAtTopOfScope = null, bool writable = true, bool deletable = false ) : DeclaredVariable

Declares a variable or function in this scope. This will be initialized with the value of the given expression.

GenerateScopeCreation ( ILGenerator generator, OptimizationInfo optimizationInfo ) : void

Generates code that creates a new scope.

Описание методов

CreateRuntimeScope() публичный статический Метод

Creates a new declarative scope for use at runtime.
public static CreateRuntimeScope ( Scope parentScope, string declaredVariableNames ) : DeclarativeScope
parentScope Scope A reference to the parent scope. Can not be null.
declaredVariableNames string The names of variables that were declared in this scope.
Результат DeclarativeScope

Delete() публичный Метод

Deletes the variable from the scope.
public Delete ( string variableName ) : bool
variableName string The name of the variable.
Результат bool

GetValue() публичный Метод

Returns the value of the given variable.
The scope was not created using /// CreateRuntimeScope().
public GetValue ( string variableName ) : object
variableName string The name of the variable.
Результат object

HasValue() публичный Метод

Returns true if the given variable exists in this scope.
public HasValue ( string variableName ) : bool
variableName string The name of the variable to check.
Результат bool

SetValue() публичный Метод

Sets the value of the given variable.
The scope was not created using /// CreateRuntimeScope().
public SetValue ( string variableName, object value ) : void
variableName string The name of the variable.
value object The new value of the variable.
Результат void