toObject method

JSObject toObject({
  1. JSValuePointer? exception,
})

Converts a JavaScript value to object and returns the resulting object. exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.

Implementation

JSObject toObject({
  JSValuePointer? exception,
}) {
  return JSObject(
      context,
      JSValueRef.jSValueToObject(context.pointer, pointer,
          (exception ?? JSValuePointer(nullptr)).pointer));
}