toNumber method

double toNumber({
  1. JSValuePointer? exception,
})

Converts a JavaScript value to number and returns the resulting number. 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

double toNumber({
  JSValuePointer? exception,
}) {
  return JSValueRef.jSValueToNumber(context.pointer, pointer,
      (exception ?? JSValuePointer(nullptr)).pointer);
}