QuickJsContext class

QuickJS 上下文封装 提供代码执行和环境管理能力

Implemented types

Constructors

QuickJsContext(QuickJsFFI _ffi, Pointer<Void> _runtimeHandle)

Properties

ffi QuickJsFFI
no setter
global JSObject
latefinal
handle Pointer<Void>
no setter
handleAddress int
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isDisposed bool
no setter
onCallNative FutureOr Function(String method, dynamic args)?
Callback to handle sync native calls from JS
no getteroverride
onCallNativeAsync FutureOr Function(String method, dynamic args)?
Callback to handle async native calls from JS
no getteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
override
eval(String code) Future
override
evalBinary(Uint8List bytecode) Future
override
evalBinaryFile(String path) Future
override
evalFile(String path) Future
override
evalToString(String code) String
invoke(String? objectName, String methodName, List args) → dynamic
在全局对象上调用方法 (由具体实现决定如何处理)
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerObject(JSObjectToken token) → void
runJobs() Future<int>
手动触发任务执行
override
toString() String
A string representation of this object.
inherited
unregisterObject(JSObjectToken token) → void

Operators

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

Static Properties

instances Map<int, QuickJsContext>
final