binding/JSObjectRef library

Classes

JSClassAttributesRef
JSClassDefinition_
struct JSStaticFunction This structure contains properties and callbacks that define a type of object. All fields other than the version field are optional. Any pointer may be NULL. The staticValues and staticFunctions arrays are the simplest and most efficient means for vending custom properties. Statically declared properties autmatically service requests like getProperty, setProperty, and getPropertyNames. Property access callbacks are required only to implement unusual properties, like array indexes, whose names are not known at compile-time.
JSPropertyAttributesRef
JSStaticFunction_
struct JSStaticFunction This structure describes a statically declared function property.
JSStaticValue_
struct JSStaticValue This structure describes a statically declared value property.

Properties

JSClassCreate JSClassRef Function(Pointer<JSClassDefinition_> definition)
Creates a JavaScript class suitable for use with JSObjectMake. definition (JSClassDefinition*) A JSClassDefinition that defines the class. @result (JSClassRef) A JSClass with the given definition. Ownership follows the Create Rule.
final
JSClassRelease → void Function(JSClassRef jsClass)
Releases a JavaScript class. jsClass (JSClassRef) The JSClass to release.
final
JSClassReleaseAddress Pointer<NativeFunction<Void Function(JSClassRef)>>
final
JSClassRetain JSClassRef Function(JSClassRef jsClass)
Retains a JavaScript class. jsClass (JSClassRef) The JSClass to retain. @result (JSClassRef) A JSClass that is the same as jsClass.
final
JSObjectCallAsConstructor JSObjectRef Function(JSContextRef ctx, JSObjectRef object, int argumentCount, Pointer<JSValueRef> arguments, Pointer<JSValueRef> exception)
Calls an object as a constructor. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The JSObject to call as a constructor. argumentCount (size_t) An integer count of the number of arguments in arguments. arguments (JSValueRef[]) A JSValue array of arguments to pass to the constructor. Pass NULL if argumentCount is 0. 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. @result (JSObjectRef) The JSObject that results from calling object as a constructor, or NULL if an exception is thrown or object is not a constructor.
final
JSObjectCallAsFunction JSValueRef Function(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, int argumentCount, Pointer<JSValueRef> arguments, Pointer<JSValueRef> exception)
Calls an object as a function. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The JSObject to call as a function. thisObject (JSObjectRef) The object to use as "this," or NULL to use the global object as "this." argumentCount (size_t) An integer count of the number of arguments in arguments. arguments (JSValueRef[]) A JSValue array of arguments to pass to the function. Pass NULL if argumentCount is 0. 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. @result (JSValueRef) The JSValue that results from calling object as a function, or NULL if an exception is thrown or object is not a function.
final
JSObjectCopyPropertyNames JSPropertyNameArrayRef Function(JSContextRef ctx, JSObjectRef object)
Gets the names of an object's enumerable properties. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The object whose property names you want to get. @result (JSPropertyNameArrayRef) A JSPropertyNameArray containing the names object's enumerable properties. Ownership follows the Create Rule.
final
JSObjectDeleteProperty bool Function(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, Pointer<JSValueRef> exception)
Deletes a property from an object. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The JSObject whose property you want to delete. 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. @result (bool) true if the delete operation succeeds, otherwise false (for example, if the property has the kJSPropertyAttributeDontDelete attribute set).
final
JSObjectDeletePropertyForKey bool Function(JSContextRef ctx, JSObjectRef object, JSValueRef propertyKey, Pointer<JSValueRef> exception)
Deletes a property from an object using a JSValueRef as the property key. This function is the same as performing "delete objectpropertyKey" from JavaScript. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The JSObject whose property you want to delete. propertyKey (JSValueRef) 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. @result (bool) true if the delete operation succeeds, otherwise false (for example, if the property has the kJSPropertyAttributeDontDelete attribute set).
final
JSObjectGetPrivate Pointer<Void> Function(JSObjectRef object)
Gets an object's private data. object (JSObjectRef) A JSObject whose private data you want to get. @result (void*) A void* that is the object's private data, if the object has private data, otherwise NULL.
final
JSObjectGetProperty JSValueRef Function(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, Pointer<JSValueRef> exception)
Gets a property from an object. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The JSObject whose property you want to get. 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. @result (JSValueRef) The property's value if object has the property, otherwise the undefined value.
final
JSObjectGetPropertyAtIndex JSValueRef Function(JSContextRef ctx, JSObjectRef object, int propertyIndex, Pointer<JSValueRef> exception)
Gets a property from an object by numeric index. Calling JSObjectGetPropertyAtIndex is equivalent to calling JSObjectGetProperty with a string containing propertyIndex, but JSObjectGetPropertyAtIndex provides optimized access to numeric properties. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The JSObject whose property you want to get. propertyIndex (unsigned) An integer value that is 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. @result (JSValueRef) The property's value if object has the property, otherwise the undefined value.
final
JSObjectGetPropertyForKey JSValueRef Function(JSContextRef ctx, JSObjectRef object, JSValueRef propertyKey, Pointer<JSValueRef> exception)
Gets a property from an object using a JSValueRef as the property key. This function is the same as performing "objectpropertyKey" from JavaScript. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The JSObject whose property you want to get. propertyKey (JSValueRef) 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. @result (JSValueRef) The property's value if object has the property key, otherwise the undefined value.
final
JSObjectGetPrototype JSValueRef Function(JSContextRef ctx, JSObjectRef object)
Gets an object's prototype. ctx (JSContextRef) The execution context to use. object (JSObjectRef) A JSObject whose prototype you want to get. @result (JSValueRef) A JSValue that is the object's prototype.
final
JSObjectHasProperty bool Function(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName)
Tests whether an object has a given property. ctx (JSContextRef) object (JSObjectRef) The JSObject to test. propertyName (JSStringRef) A JSString containing the property's name. @result (bool) true if the object has a property whose name matches propertyName, otherwise false.
final
JSObjectHasPropertyForKey bool Function(JSContextRef ctx, JSObjectRef object, JSValueRef propertyKey, Pointer<JSValueRef> exception)
Tests whether an object has a given property using a JSValueRef as the property key. This function is the same as performing "propertyKey in object" from JavaScript. ctx (JSContextRef) object (JSObjectRef) The JSObject to test. propertyKey (JSValueRef) 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. @result (bool) true if the object has a property whose name matches propertyKey, otherwise false.
final
JSObjectIsConstructor bool Function(JSContextRef ctx, JSObjectRef object)
Tests whether an object can be called as a constructor. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The JSObject to test. @result (bool) true if the object can be called as a constructor, otherwise false.
final
JSObjectIsFunction bool Function(JSContextRef ctx, JSObjectRef object)
Tests whether an object can be called as a function. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The JSObject to test. @result (bool) true if the object can be called as a function, otherwise false.
final
JSObjectMake JSObjectRef Function(JSContextRef ctx, JSClassRef jsClass, Pointer<Void> data)
Creates a JavaScript object. The default object class does not allocate storage for private data, so you must provide a non-NULL jsClass to JSObjectMake if you want your object to be able to store private data.
final
JSObjectMakeArray JSObjectRef Function(JSContextRef ctx, int argumentCount, Pointer<JSValueRef> arguments, Pointer<JSValueRef> exception)
Creates a JavaScript Array object. The behavior of this function does not exactly match the behavior of the built-in Array constructor. Specifically, if one argument is supplied, this function returns an array with one element. ctx (JSContextRef) The execution context to use. argumentCount (size_t) An integer count of the number of arguments in arguments. arguments (JSValueRef[]) A JSValue array of data to populate the Array with. Pass NULL if argumentCount is 0. 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. @result (JSObjectRef) A JSObject that is an Array.
final
JSObjectMakeConstructor JSObjectRef Function(JSContextRef ctx, JSClassRef jsClass, Pointer<NativeFunction<JSObjectCallAsConstructorCallback_>> callAsConstructor)
Convenience method for creating a JavaScript constructor. The default object constructor takes no arguments and constructs an object of class jsClass with no private data. ctx (JSContextRef) The execution context to use. jsClass (JSClassRef) A JSClass that is the class your constructor will assign to the objects its constructs. jsClass will be used to set the constructor's .prototype property, and to evaluate 'instanceof' expressions. Pass NULL to use the default object class. callAsConstructor (JSObjectCallAsConstructorCallback) A JSObjectCallAsConstructorCallback to invoke when your constructor is used in a 'new' expression. Pass NULL to use the default object constructor. @result (JSObjectRef) A JSObject that is a constructor. The object's prototype will be the default object prototype.
final
JSObjectMakeDate JSObjectRef Function(JSContextRef ctx, int argumentCount, Pointer<JSValueRef> arguments, Pointer<JSValueRef> exception)
Creates a JavaScript Date object, as if by invoking the built-in Date constructor. ctx (JSContextRef) The execution context to use. argumentCount (size_t) An integer count of the number of arguments in arguments. arguments (JSValueRef[]) A JSValue array of arguments to pass to the Date Constructor. Pass NULL if argumentCount is 0. 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. @result (JSObjectRef) A JSObject that is a Date.
final
JSObjectMakeDeferredPromise JSObjectRef Function(JSContextRef ctx, Pointer<JSObjectRef> resolve, Pointer<JSObjectRef> reject, Pointer<JSValueRef> exception)
Creates a JavaScript promise object by invoking the provided executor. ctx (JSContextRef) The execution context to use. resolve (JSObjectRef*) A pointer to a JSObjectRef in which to store the resolve function for the new promise. Pass NULL if you do not care to store the resolve callback. reject (JSObjectRef*) A pointer to a JSObjectRef in which to store the reject function for the new promise. Pass NULL if you do not care to store the reject callback. 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. @result (JSObjectRef) A JSObject that is a promise or NULL if an exception occurred.
final
JSObjectMakeError JSObjectRef Function(JSContextRef ctx, int argumentCount, Pointer<JSValueRef> arguments, Pointer<JSValueRef> exception)
Creates a JavaScript Error object, as if by invoking the built-in Error constructor. ctx (JSContextRef) The execution context to use. argumentCount (size_t) An integer count of the number of arguments in arguments. arguments (JSValueRef[]) A JSValue array of arguments to pass to the Error Constructor. Pass NULL if argumentCount is 0. 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. @result (JSObjectRef) A JSObject that is a Error.
final
JSObjectMakeFunction JSObjectRef Function(JSContextRef ctx, JSStringRef name, int parameterCount, Pointer<JSStringRef> parameterNames, JSStringRef body, JSStringRef sourceURL, int startingLineNumber, Pointer<JSValueRef> exception)
Creates a function with a given script as its body. Use this method when you want to execute a script repeatedly, to avoid the cost of re-parsing the script before each execution. ctx (JSContextRef) The execution context to use. name (JSStringRef) A JSString containing the function's name. This will be used when converting the function to string. Pass NULL to create an anonymous function. parameterCount (unsigned) An integer count of the number of parameter names in parameterNames. parameterNames (JSStringRef[]) A JSString array containing the names of the function's parameters. Pass NULL if parameterCount is 0. body (JSStringRef) A JSString containing the script to use as the function's body. sourceURL (JSStringRef) A JSString containing a URL for the script's source file. This is only used when reporting exceptions. Pass NULL if you do not care to include source file information in exceptions. startingLineNumber (int) An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. The value is one-based, so the first line is line 1 and invalid values are clamped to 1. exception (JSValueRef*) A pointer to a JSValueRef in which to store a syntax error exception, if any. Pass NULL if you do not care to store a syntax error exception. @result (JSObjectRef) A JSObject that is a function, or NULL if either body or parameterNames contains a syntax error. The object's prototype will be the default function prototype.
final
JSObjectMakeFunctionWithCallback JSObjectRef Function(JSContextRef ctx, JSStringRef name, Pointer<NativeFunction<JSObjectCallAsFunctionCallback_>> callAsFunction)
Convenience method for creating a JavaScript function with a given callback as its implementation. ctx (JSContextRef) The execution context to use. name (JSStringRef) A JSString containing the function's name. This will be used when converting the function to string. Pass NULL to create an anonymous function. callAsFunction (JSObjectCallAsFunctionCallback) The JSObjectCallAsFunctionCallback to invoke when the function is called. @result (JSObjectRef) A JSObject that is a function. The object's prototype will be the default function prototype.
final
JSObjectMakeRegExp JSObjectRef Function(JSContextRef ctx, int argumentCount, Pointer<JSValueRef> arguments, Pointer<JSValueRef> exception)
Creates a JavaScript RegExp object, as if by invoking the built-in RegExp constructor. ctx (JSContextRef) The execution context to use. argumentCount (size_t) An integer count of the number of arguments in arguments. arguments (JSValueRef[]) A JSValue array of arguments to pass to the RegExp Constructor. Pass NULL if argumentCount is 0. 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. @result (JSObjectRef) A JSObject that is a RegExp.
final
JSObjectSetPrivate bool Function(JSObjectRef object, Pointer<Void> data)
Sets a pointer to private data on an object. The default object class does not allocate storage for private data. Only objects created with a non-NULL JSClass can store private data. object (JSObjectRef) The JSObject whose private data you want to set. data (void*) A void* to set as the object's private data. @result (bool) true if object can store private data, otherwise false.
final
JSObjectSetProperty → void Function(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, int attributes, Pointer<JSValueRef> exception)
Sets a property on an object. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The JSObject whose property you want to set. propertyName (JSStringRef) A JSString containing the property's name. value (JSValueRef) A JSValueRef to use as the property's value. attributes (JSPropertyAttributes) A logically ORed set of JSPropertyAttributes to give to 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.
final
JSObjectSetPropertyAtIndex → void Function(JSContextRef ctx, JSObjectRef object, int propertyIndex, JSValueRef value, Pointer<JSValueRef> exception)
Sets a property on an object by numeric index. Calling JSObjectSetPropertyAtIndex is equivalent to calling JSObjectSetProperty with a string containing propertyIndex, but JSObjectSetPropertyAtIndex provides optimized access to numeric properties. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The JSObject whose property you want to set. propertyIndex (unsigned) The property's name as a number. value (JSValueRef) A JSValue to use as the property's value. 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.
final
JSObjectSetPropertyForKey → void Function(JSContextRef ctx, JSObjectRef object, JSValueRef propertyKey, JSValueRef value, int attributes, Pointer<JSValueRef> exception)
Sets a property on an object using a JSValueRef as the property key. This function is the same as performing "objectpropertyKey = value" from JavaScript. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The JSObject whose property you want to set. propertyKey (JSValueRef) A JSValueRef containing the property key to use when looking up the property. value (JSValueRef) A JSValueRef to use as the property's value. attributes (JSPropertyAttributes) A logically ORed set of JSPropertyAttributes to give to 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.
final
JSObjectSetPrototype → void Function(JSContextRef ctx, JSObjectRef object, JSValueRef value)
Sets an object's prototype. ctx (JSContextRef) The execution context to use. object (JSObjectRef) The JSObject whose prototype you want to set. value (JSValueRef) A JSValue to set as the object's prototype.
final
JSPropertyNameAccumulatorAddName → void Function(JSPropertyNameAccumulatorRef accumulator, JSStringRef propertyName)
Adds a property name to a JavaScript property name accumulator. accumulator (JSPropertyNameAccumulatorRef) The accumulator object to which to add the property name. propertyName (JSStringRef) The property name to add.
final
JSPropertyNameArrayGetCount int Function(JSPropertyNameArrayRef array)
Gets a count of the number of items in a JavaScript property name array. array (JSPropertyNameArrayRef) The array from which to retrieve the count. @result (size_t) An integer count of the number of names in array.
final
JSPropertyNameArrayGetNameAtIndex JSStringRef Function(JSPropertyNameArrayRef array, int index)
Gets a property name at a given index in a JavaScript property name array. array (JSPropertyNameArrayRef) The array from which to retrieve the property name. index (size_t) The index of the property name to retrieve. @result (JSStringRef) A JSStringRef containing the property name.
final
JSPropertyNameArrayRelease → void Function(JSPropertyNameArrayRef array)
Releases a JavaScript property name array. array (JSPropertyNameArrayRef) The JSPropetyNameArray to release.
final
JSPropertyNameArrayReleaseAddress Pointer<NativeFunction<Void Function(JSPropertyNameArrayRef)>>
final
JSPropertyNameArrayRetain JSPropertyNameArrayRef Function(JSPropertyNameArrayRef array)
Retains a JavaScript property name array. array (JSPropertyNameArrayRef) The JSPropertyNameArray to retain. @result (JSPropertyNameArrayRef) A JSPropertyNameArray that is the same as array.
final

Typedefs

JSClassDefinitionRef = Pointer<JSClassDefinition_>
JSObjectCallAsConstructorCallback_ = JSObjectRef Function(JSContextRef ctx, JSObjectRef constructor, Size argumentCount, Pointer<JSValueRef> arguments, Pointer<JSValueRef> exception)
typedef JSObjectCallAsConstructorCallback The callback invoked when an object is used as a constructor in a 'new' expression. ctx The execution context to use. constructor A JSObject that is the constructor being called. argumentCount An integer count of the number of arguments in arguments. arguments A JSValue array of the arguments passed to the function. exception A pointer to a JSValueRef in which to return an exception, if any. @result A JSObject that is the constructor's return value. If you named your function CallAsConstructor, you would declare it like this:
JSObjectCallAsFunctionCallback_ = JSValueRef Function(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, Size argumentCount, Pointer<JSValueRef> arguments, Pointer<JSValueRef> exception)
typedef JSObjectCallAsFunctionCallback The callback invoked when an object is called as a function. ctx The execution context to use. function A JSObject that is the function being called. thisObject A JSObject that is the 'this' variable in the function's scope. argumentCount An integer count of the number of arguments in arguments. arguments A JSValue array of the arguments passed to the function. exception A pointer to a JSValueRef in which to return an exception, if any. @result A JSValue that is the function's return value. If you named your function CallAsFunction, you would declare it like this:
JSObjectConvertToTypeCallback_ = JSValueRef Function(JSContextRef ctx, JSObjectRef object, Int8 type, Pointer<JSValueRef> exception)
typedef JSObjectConvertToTypeCallback The callback invoked when converting an object to a particular JavaScript type. ctx The execution context to use. object The JSObject to convert. type A JSType specifying the JavaScript type to convert to. exception A pointer to a JSValueRef in which to return an exception, if any. @result The objects's converted value, or NULL if the object was not converted. If you named your function ConvertToType, you would declare it like this:
JSObjectDeletePropertyCallback_ = Bool Function(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, Pointer<JSValueRef> exception)
typedef JSObjectDeletePropertyCallback The callback invoked when deleting a property. ctx The execution context to use. object The JSObject in which to delete the property. propertyName A JSString containing the name of the property to delete. exception A pointer to a JSValueRef in which to return an exception, if any. @result true if propertyName was successfully deleted, otherwise false. If you named your function DeleteProperty, you would declare it like this:
JSObjectFinalizeCallback_ = Void Function(JSObjectRef object)
typedef JSObjectFinalizeCallback The callback invoked when an object is finalized (prepared for garbage collection). An object may be finalized on any thread. object The JSObject being finalized. If you named your function Finalize, you would declare it like this:
JSObjectGetPropertyCallback_ = JSValueRef Function(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, Pointer<JSValueRef> exception)
typedef JSObjectGetPropertyCallback The callback invoked when getting a property's value. ctx The execution context to use. object The JSObject to search for the property. propertyName A JSString containing the name of the property to get. exception A pointer to a JSValueRef in which to return an exception, if any. @result The property's value if object has the property, otherwise NULL. If you named your function GetProperty, you would declare it like this:
JSObjectGetPropertyNamesCallback_ = Void Function(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames)
typedef JSObjectGetPropertyNamesCallback The callback invoked when collecting the names of an object's properties. ctx The execution context to use. object The JSObject whose property names are being collected. propertyNames A JavaScript property name accumulator in which to accumulate the names of object's properties. If you named your function GetPropertyNames, you would declare it like this:
JSObjectHasInstanceCallback_ = Bool Function(JSContextRef ctx, JSObjectRef constructor, JSValueRef possibleInstance, Pointer<JSValueRef> exception)
typedef JSObjectHasInstanceCallback hasInstance The callback invoked when an object is used as the target of an 'instanceof' expression. ctx The execution context to use. constructor The JSObject that is the target of the 'instanceof' expression. possibleInstance The JSValue being tested to determine if it is an instance of constructor. exception A pointer to a JSValueRef in which to return an exception, if any. @result true if possibleInstance is an instance of constructor, otherwise false. If you named your function HasInstance, you would declare it like this:
JSObjectHasPropertyCallback_ = Bool Function(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName)
typedef JSObjectHasPropertyCallback The callback invoked when determining whether an object has a property. ctx The execution context to use. object The JSObject to search for the property. propertyName A JSString containing the name of the property look up. @result true if object has the property, otherwise false. If you named your function HasProperty, you would declare it like this:
JSObjectInitializeCallback_ = Void Function(JSContextRef ctx, JSObjectRef object)
typedef JSObjectInitializeCallback The callback invoked when an object is first created. ctx The execution context to use. object The JSObject being created. If you named your function Initialize, you would declare it like this:
JSObjectSetPropertyCallback_ = Bool Function(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, Pointer<JSValueRef> exception)
typedef JSObjectSetPropertyCallback The callback invoked when setting a property's value. ctx The execution context to use. object The JSObject on which to set the property's value. propertyName A JSString containing the name of the property to set. value A JSValue to use as the property's value. exception A pointer to a JSValueRef in which to return an exception, if any. @result true if the property was set, otherwise false. If you named your function SetProperty, you would declare it like this:
JSStaticFunctionRef = Pointer<JSStaticFunction_>
JSStaticValueRef = Pointer<JSStaticValue_>