isInstanceOfConstructor method

bool isInstanceOfConstructor(
  1. JSObject constructor, {
  2. JSValuePointer? exception,
})

Tests whether a JavaScript value is an object constructed by a given constructor, as compared by the JS instanceof operator.

Implementation

bool isInstanceOfConstructor(
  JSObject constructor, {
  JSValuePointer? exception,
}) {
  return JSValueRef.jSValueIsInstanceOfConstructor(
          context.pointer,
          pointer,
          constructor.pointer,
          (exception ?? JSValuePointer(nullptr)).pointer) ==
      1;
}