|
Ultralight C++ API 1.4.0
|
Functions | |
| bool | JSObjectSetPrivateProperty (JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value) |
| Sets a private property on an object. This private property cannot be accessed from within JavaScript. | |
| JSValueRef | JSObjectGetPrivateProperty (JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) |
| Gets a private property from an object. | |
| bool | JSObjectDeletePrivateProperty (JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) |
| Deletes a private property from an object. | |
| JSObjectRef | JSObjectGetProxyTarget (JSObjectRef) |
| JSGlobalContextRef | JSObjectGetGlobalContext (JSObjectRef object) |
| bool JSObjectDeletePrivateProperty | ( | JSContextRef | ctx, |
| JSObjectRef | object, | ||
| JSStringRef | propertyName ) |
Deletes a private property from an object.
| ctx | The execution context to use. |
| object | The JSObject whose private property you want to delete. |
| propertyName | A JSString containing the property's name. |
| JSGlobalContextRef JSObjectGetGlobalContext | ( | JSObjectRef | object | ) |
| JSValueRef JSObjectGetPrivateProperty | ( | JSContextRef | ctx, |
| JSObjectRef | object, | ||
| JSStringRef | propertyName ) |
Gets a private property from an object.
| ctx | The execution context to use. |
| object | The JSObject whose private property you want to get. |
| propertyName | A JSString containing the property's name. |
| JSObjectRef JSObjectGetProxyTarget | ( | JSObjectRef | ) |
| bool JSObjectSetPrivateProperty | ( | JSContextRef | ctx, |
| JSObjectRef | object, | ||
| JSStringRef | propertyName, | ||
| JSValueRef | value ) |
Sets a private property on an object. This private property cannot be accessed from within JavaScript.
| ctx | The execution context to use. |
| object | The JSObject whose private property you want to set. |
| propertyName | A JSString containing the property's name. |
| value | A JSValue to use as the property's value. This may be NULL. |
This API allows you to store JS values directly an object in a way that will be ensure that they are kept alive without exposing them to JavaScript code and without introducing the reference cycles that may occur when using JSValueProtect.
The default object class does not allocate storage for private data. Only objects created with a non-NULL JSClass can store private properties.