JSValue.newAtomStr constructor

JSValue.newAtomStr(
  1. JSContext _ctx,
  2. String str, {
  3. bool autoDispose = true,
})

JS_NewAtom

Implementation

JSValue.newAtomStr(this._ctx, String str, {bool autoDispose = true}) {
  _str = str.toNativeUtf8();
  _ref = nullptr;
  _atom = JS_NewAtom(_ctx.ref, _str!);
  attach(Q_JS_FreeValueAddress.cast(), _ref.cast(), autoDispose: autoDispose);
}