JSObjectSetPropertyAtIndex(_:_:_:_:_:)
Sets a property on an object by numeric index.
Declaration
func JSObjectSetPropertyAtIndex(_ ctx: JSContextRef!, _ object: JSObjectRef!, _ propertyIndex: UInt32, _ value: JSValueRef!, _ exception: UnsafeMutablePointer<JSValueRef?>!)Parameters
- ctx:
The execution context to use.
- object:
The Jsobjectref with the property you want to set.
- propertyIndex:
The property’s name as a number.
- value:
A Jsvalueref to use as the property’s value.
- exception:
A pointer to a Jsvalueref to store an exception in, if any. Pass
NULLto discard any exception.
Discussion
Calling JSObjectSetPropertyAtIndex(_:_:_:_:_:) is equivalent to calling JSObjectSetProperty(_:_:_:_:_:_:) with a string that contain propertyIndex, but JSObjectSetPropertyAtIndex(_:_:_:_:_:) provides optimized access to numeric properties.
See Also
Working with Objects
JSObjectCallAsConstructor(_:_:_:_:_:)JSObjectCallAsFunction(_:_:_:_:_:_:)JSObjectCopyPropertyNames(_:_:)JSObjectDeleteProperty(_:_:_:_:)JSObjectGetPrivate(_:)JSObjectGetProperty(_:_:_:_:)JSObjectGetPropertyAtIndex(_:_:_:_:)JSObjectGetPrototype(_:_:)JSObjectHasProperty(_:_:_:)JSObjectIsConstructor(_:_:)JSObjectIsFunction(_:_:)JSObjectMake(_:_:_:)JSObjectMakeArray(_:_:_:_:)JSObjectMakeConstructor(_:_:_:)JSObjectMakeDate(_:_:_:_:)