C# Class Jurassic.Compiler.ObjectScope

Represents a scope which is backed by the properties of an object.
Inheritance: Scope
显示文件 Open project: paulbartrum/jurassic

Private Properties

Property Type Description
CreateGlobalScope ObjectScope
CreateWithScope ObjectScope
GenerateScopeCreation void
ObjectScope System

Public Methods

Method Description
CreateRuntimeScope ( Scope parentScope, Library scopeObject, bool providesImplicitThisValue, bool canDeclareVariables ) : ObjectScope

Creates a new object scope for use inside a with statement.

Creates a new object 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.

Private Methods

Method Description
CreateGlobalScope ( Library globalObject ) : ObjectScope

Creates a new global object scope.

CreateWithScope ( Scope parentScope, Jurassic.Compiler.Expression scopeObject ) : ObjectScope

Creates a new object scope for use inside a with statement.

GenerateScopeCreation ( ILGenerator generator, OptimizationInfo optimizationInfo ) : void

Generates code that creates a new scope.

ObjectScope ( Scope parentScope ) : System

Creates a new ObjectScope instance.

Method Details

CreateRuntimeScope() public static method

Creates a new object scope for use inside a with statement. Creates a new object scope for use at runtime.
public static CreateRuntimeScope ( Scope parentScope, Library scopeObject, bool providesImplicitThisValue, bool canDeclareVariables ) : ObjectScope
parentScope Scope A reference to the parent scope. Can not be null.
scopeObject Library An expression that evaluates to the object to use.
providesImplicitThisValue bool Indicates whether an implicit "this" value is /// supplied to function calls in this scope.
canDeclareVariables bool Indicates whether variables can be declared within /// the scope.
return ObjectScope

Delete() public method

Deletes the variable from the scope.
public Delete ( string variableName ) : bool
variableName string The name of the variable.
return bool

GetValue() public method

Returns the value of the given variable.
public GetValue ( string variableName ) : object
variableName string The name of the variable.
return object

HasValue() public method

Returns true if the given variable exists in this scope.
public HasValue ( string variableName ) : bool
variableName string The name of the variable to check.
return bool

SetValue() public method

Sets the value of the given variable.
public SetValue ( string variableName, object value ) : void
variableName string The name of the variable.
value object The new value of the variable.
return void