getPropertyForKey method

JSValue getPropertyForKey(
  1. String propertyKey, {
  2. JSValuePointer? exception,
})

Gets a property from an object using a JSValueRef as the property key. This function is the same as performing "objectpropertyKey" from JavaScript. propertyKey A JSValueRef containing the property key to use when looking up the property. 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 getPropertyForKey(
  String propertyKey, {
  JSValuePointer? exception,
}) {
  return JSValue(
      context,
      JSObjectRef.jSObjectGetPropertyForKey(
          context.pointer,
          pointer,
          JSString.fromString(propertyKey).pointer,
          (exception ?? JSValuePointer(nullptr)).pointer));
}