createJSONString method

JSString createJSONString({
  1. int indent = 2,
})

Implementation

JSString createJSONString({
  int indent = 2,
}) {
  final JSException exception = JSException.create(_context);
  try {
    final JSStringRef stringRef = js_bd.JSValueCreateJSONString(_context.ref, _ref, indent, exception.ref);
    if (exception.shouldThrow) {
      throw exception.error;
    }
    return JSString(stringRef);
  } finally {
    exception.release();
  }
}