JSObject constructor

JSObject(
  1. QuickJsContext context,
  2. Pointer<QjsResult> _handle
)

Implementation

JSObject(this.context, this._handle)
  : _token = JSObjectToken(_handle, context) {
  context.registerObject(_token);
  // Increase context reference count to ensure it stays alive until this object is finalized
  context.ffi.contextIncref(context.handle);
  _finalizer.attach(this, _token, detach: this);
}