Contents

JSObjectGetPropertyForKey(_:_:_:_:)

Gets a property from an object using a JavaScript value as the property key.

Declaration

func JSObjectGetPropertyForKey(_ ctx: JSContextRef!, _ object: JSObjectRef!, _ propertyKey: JSValueRef!, _ exception: UnsafeMutablePointer<JSValueRef?>!) -> JSValueRef!

Parameters

  • ctx:

    The execution context to use.

  • object:

    The Jsobjectref with the property you want to get.

  • propertyKey:

    A Jsvalueref that contains the property key to use when looking up the property.

  • exception:

    A pointer to a Jsvalueref to store an exception in, if any. Pass NULL to discard any exception.

Return Value

The property’s value if object has the property key; otherwise, the undefined value.

Discussion

This function is the same as performing object[propertyKey] from JavaScript.

See Also

Working with Objects