JSValue.makeFromJSONString constructor

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

Creates a JavaScript value from a JSON formatted string. string The JSString containing the JSON string to be parsed.

Implementation

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