getProperty method

JSValue getProperty(
  1. String propertyName, {
  2. JSValuePointer? exception,
})

Tests whether an object has a given property. propertyName (JSStringRef) A JSString containing the property's name. exception (JSValueRef*) 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

JSValue getProperty(
  String propertyName, {
  JSValuePointer? exception,
}) {
  return JSValue(
      context,
      JSObjectRef.jSObjectGetProperty(
          context.pointer,
          pointer,
          JSString.fromString(propertyName).pointer,
          (exception ?? JSValuePointer(nullptr)).pointer));
}