JSValue.makeString constructor

JSValue.makeString(
  1. JSContext context,
  2. String string, {
  3. bool autoDispose = true,
})

Creates a JavaScript value of the string type. string The double to assign to the newly created JSValue.

Implementation

factory JSValue.makeString(
  JSContext context,
  String string, {
  bool autoDispose = true,
}) {
  final jstring = JSString.fromString(string);
  return JSValue(
    context,
    JSValueMakeString(context.ref, jstring.ref),
    autoDispose: autoDispose,
  );
}