JsContext class

Represents the state of a Javascript runtime.

  • Tracks which variables are defined.
  • Decodes evaluated results that the type are assumed as JSON always.
  • Loads Js file properly.

Constructors

JsContext()

Properties

hashCode int
The hash code for this object.
no setterinherited
key String
The unique key.
getter/setter pair
runtime ↔ JavascriptRuntime
The JavaScript runtime this context using.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stateVarName String
no setter

Methods

evaluate(String code) → dynamic
Evaluates the string in JavaScript engine and returns decoded result.
evaluateAsync(String code) → dynamic
Same as evaluate but executes asynchronously.
isVarDefined(String name) bool
Returns true if the name is defined in JavaScript runtime.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
nsToJsCode(String ns) String
require(String fname, List namespaces) → void
Requires a js file.
toString() String
A string representation of this object.
inherited

Operators

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