Scope class

Constructors

Scope({Scope? parent, LuaObject? context})
Generic constructor sets depth to parent's depth + 1.

Properties

context LuaObject?
The object context bound to this scope.
final
depth int
What level this scope is.
final
hasContext bool
Returns true if context is not null. Otherwise returns false.
no setter
hashCode int
The hash code for this object.
no setterinherited
parent Scope?
Optional parent. See findVar. Can be changed when closures need to point back to the state of the scope before the closure.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
vars Map<String, LuaObject>
Entries of all lua object variables. id -> lua object.
final

Methods

defVar(String id, Object? value) LuaObject
Define a variable id with value. If the value is a LuaObject then its contents are copied. If a value is a lua function given by LuaObject.isFunc, then a FuncExpr definition must be present on that object. Otherwise an exception is thrown.
dump() → void
Print the variable entries in this scope.
findVar(String id) LuaObject?
Tries to find the variable by id, If no variable is found in this scope, it searches parent. This continues until the variable of the same id is found or returns null.
findVarArgs() List<LuaObject>
Find the hidden variable "arg" if the function parameter list includes the special identifier "...".
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

randId() String
Can be used to generate a random variable id.