JSValue.newString constructor
JS_NewString
Implementation
JSValue.newString(this._ctx, String str, {bool autoDispose = true}) {
_str = str.toNativeUtf8();
_ref = calloc.call<JSValue_>(sizeOf<JSValue_>())
..ref = JS_NewStringLen(
_ctx.ref,
_str!,
utf8
.encode(str)
.length); // fix qjs-0.8.0 传递长 json string to dart 字符串被截断
attach(Q_JS_FreeValueAddress.cast(), _ref.cast(), autoDispose: autoDispose);
}