JavascriptRuntime class abstract
- Implementers
- Available extensions
Constructors
Properties
-
dartContext
↔ Map<
String, dynamic> -
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
localContext
↔ Map<
String, dynamic> -
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
callFunction(
Pointer< NativeType> fn, Pointer<NativeType> obj) → JsEvalResult -
compile(
String code, String fileName) → Uint8List -
convertValue<
T> (JsEvalResult jsValue) → T? -
dispose(
) → void -
disposeChannelFunctions(
) → void - Removes channel registrations for this engine (call from dispose).
-
enableHandlePromises(
) → void -
Available on JavascriptRuntime, provided by the HandlePromises extension
Optional no-op friendly setup for callers that still invoke this. -
evaluate(
String code, {String? sourceUrl}) → JsEvalResult -
evaluateAsync(
String code, {String? sourceUrl}) → Future< JsEvalResult> -
evaluateAsyncBytecode(
Uint8List bytecode) → Future< JsEvalResult> -
evaluateBytecode(
Uint8List bytecode) → JsEvalResult -
evaluateJson(
String code, {String? sourceUrl}) → dynamic -
evaluateJsonBatch(
Iterable< String> expressions, {String? sourceUrl}) → List - Evaluate multiple JavaScript expressions and decode the results through one JSON round-trip. Expressions must be JSON-serializable and are evaluated in order in the same runtime.
-
executePendingJob(
) → int -
executePendingJobs(
{int maxJobs = 10000}) → int -
Drain the QuickJS job queue until empty or
maxJobsjobs run. Returns the number of jobs executed, or stops early on error (-1job). -
getEngineInstanceId(
) → String -
getMemoryUsage(
) → JsMemoryUsage? -
QuickJS heap usage snapshot, or
nullif unavailable. -
handlePromise(
JsEvalResult value, {Duration? timeout}) → Future< JsEvalResult> -
Available on JavascriptRuntime, provided by the HandlePromises extension
-
init(
) → JavascriptRuntime -
initChannelFunctions(
) → void -
jsonStringify(
JsEvalResult jsValue) → String -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onMessage(
String channelName, dynamic fn(dynamic args)) → void -
reinitialize(
) → void - Drop native heap and re-run channel / console / setTimeout setup. Used by JsEnginePool when resetting a leased engine. Default is no-op.
-
releaseHostCaches(
) → void -
Free Dart-side JS refs that must not outlive
close; call before native free. -
runGC(
) → void - Force a QuickJS GC pass. No-op if the engine is not ready / disposed.
-
sendMessage(
{required String channelName, required List< String> args, String? uuid}) → void -
Dart → JS message helper. Prefer not to inject untrusted strings into
evaluate; use registered bridges +
sendMessagefrom JS instead. -
setInspectable(
bool inspectable) → void -
setupBridge(
String channelName, void fn(dynamic args)) → bool -
softReset(
) → void - Clear tenant state without destroying the native QuickJS engine.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
channelFunctionsRegistered
→ Map<
String, Map< String, dynamic Function(dynamic args)> > -
no setter
- debugEnabled ↔ bool
-
getter/setter pair