VMContext class
A runtime context of the VM.
Any code executed inside the VM has a context, that holds blocks variables, functions and classes instances.
- Implementers
- Available Extensions
Constructors
- VMContext(ASTBlock block, {VMContext? parent, VMTypeResolver? typeResolver})
Properties
- block → ASTBlock
-
The runtime block of this context.
final
- externalFunctionMapper ↔ ApolloExternalFunctionMapper?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- parent → VMContext?
-
The parent context.
final
- root → VMContext?
-
The root context.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- typeResolver → VMTypeResolver
-
The type resolver. If not defined for this instance will get from parent.
no setter
Methods
-
declareVariable(
ASTTypedVariable variable) → bool -
Declares a variable of
type
andname
without a initial value. -
declareVariableWithValue(
ASTType type, String name, ASTValue? value) → bool -
Declares a variable of
type
andname
with an optionalvalue
in this context. -
getClassInstance(
) → ASTValue? - The visible object class instance from this context.
-
getField(
String name) → ASTVariable? -
Returns an ASTVariable of field
name
. -
getFunction(
String name, ASTFunctionSignature parametersSignature) → ASTFunctionDeclaration? -
Returns a function of
name
andparametersSignature
-
getMappedExternalFunction<
R> (String fName, [ASTFunctionSignature? parametersSignature]) → ASTExternalFunction< R> ? -
Returns an ASTExternalFunction of
fName
andparametersSignature
. -
getVariable(
String name, bool allowClassFields) → FutureOr< ASTVariable?> -
Returns an
ASTVariable
ofname
in this context. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setVariable(
String name, ASTValue value, bool allowField) → bool -
Sets an already declared variable of
name
withvalue
in this context. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getCurrent(
) → VMContext? - Static access for the current VMContext.
-
setCurrent(
VMContext? context) → VMContext? - Static setter for the current VMContext.