JavaScript class abstract interface

Represents a connection to an environment where JavaScript code can be evaluated.

Each JavaScript instance has its own isolated state, and cannot interact with other JavaScript instances.

There is no guarantee of security boundary between JavaScript instances in a single application. If the code in one JavaScript instance is able to compromise the security, then it may be able to observe or manipulate other JavaScript instances

Properties

engineId String
The id of the javascript environment.
no setter
hashCode int
The hash code for this object.
no setterinherited
instanceId String
The id of the javascript instance.
no setter
isFunctional bool
Whether the javascript instance is functional.
no setter
platform JavaScriptPlatform
The platform that is used to control the underlying javascript environment.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unavailableReason Object?
The reason why the javascript instance is not functional.
no setter

Methods

addJavaScriptChannel(JavaScriptChannelParams javaScriptChannelParams) Future<void>
Adds a new JavaScript channel to the set of enabled channels for the context of the current JavaScript instance.
dispose() Future<void>
Disposes of the underlying javascript environment.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeJavaScriptChannel(String javaScriptChannelName) Future<void>
Removes the JavaScript channel with the matching name from the set of enabled channels for the context of the current JavaScript instance.
runJavaScriptFromFileReturningResult(String javaScriptFilePath) Future<Object?>
Loads the content of of file from javaScriptFilePath and evaluates it as javascript code in the context of the current JavaScript instance, and returns the result.
runJavaScriptReturningResult(String javaScript) Future<Object?>
Evaluates the given JavaScript code javaScript in the context of the current JavaScript instance, and returns the result.
setIsInspectable(bool isInspectable) Future<void>
Sets whether the underlying javascript environment is inspectable.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

createNew({JavaScriptPlatform? platform}) Future<JavaScript>
Creates & returns a new JavaScript instance by the JavaScriptPlatform.