Search completed in 1.16 seconds.
5 results for "js_setreservedslot":
JS_GetReservedSlot
Mozilla › Projects › SpiderMonkey › JSAPI reference › JS GetReservedSlot
Access an object's reserved slots. Syntax // Added in SpiderMonkey 42 JS::Value JS_GetReservedSlot(JSObject *obj, uint32_t index); void JS_SetReservedSlot(JSObject *obj, uint32_t index, JS::Value v); // Obsolete since SpiderMonkey 42 jsval JS_GetReservedSlot(JSObject *obj, uint32_t index); void JS_SetReservedSlot(JSObject *obj, uint32_t index, jsval v); Name Type Description obj JSObject * An object that has reserved slots. index uint32_t Index of the reserved slot to access. v JS::Value (in JS_SetReservedSlot) The value to store. Description If a JSClass has JSCLASS_HAS_RESERVED_SLOTS(n) in its flags, with n > 0, or has a non-null JSClass.reserveSlots callback, then objects of that class have n reserved slots in which the applica...
...alues when it sees them. ...
JSAPI User Guide
Mozilla › Projects › SpiderMonkey › JSAPI User Guide
is no longer reachable. The JSAPI provides this feature via the JS_NewScriptObject function. The life cycle of a script using this feature is like this: The application compiles some JavaScript code. To protect the compiled script from garbage collection, the application creates a compiled script object by calling JS_NewScriptObject and makes that object GC-reachable using JS_SetProperty, JS_SetReservedSlot, JS_Add*Root, or some other function. The application executes the compiled script any number of times. As the application progresses, eventually it doesn't need the compiled script anymore, and the compiled script object becomes unreachable. The garbage collector then eventually collects the unreachable script and its components. Here is example code demonstrating the technique--bu...
JSClass.flags
Mozilla › Projects › SpiderMonkey › JSAPI reference › JSClass.flags
. Strict equality (=== and !==) comparisons are also unaffected by this flag. MXR ID Search for JSCLASS_EMULATES_UNDEFINED JSCLASS_HAS_RESERVED_SLOTS(n) Indicates that instances of this class have n reserved slots. n is an integer in the range [0..255]. The slots initially contain unspecified valid jsval values. They can be accessed using JS_GetReservedSlot and JS_SetReservedSlot. (The JSClass.reserveSlots hook also allocates reserved slots to objects.) MXR ID Search for JSCLASS_HAS_RESERVED_SLOTS JSCLASS_GLOBAL_FLAGS This flag is only relevant for the class of an object that is used as a global object. (ECMAScript specifies a single global object, but in SpiderMonkey the global object is the last object in the scope chain, which ca...
JSObjectOps.getRequiredSlot
Mozilla › Projects › SpiderMonkey › JSAPI reference › JSObjectOps.getRequiredSlot
infallible, so required slots must be pre-allocated, or implementations must suppress out-of-memory errors. The native ops (js_ObjectOps, see js/src/jsobj.cpp) access slots reserved by including a call to the JSCLASS_HAS_RESERVED_SLOTS(n) macro in the JSClass.flags initializer. Note: The slot parameter is a zero-based index into obj slots, unlike the index parameter to the JS_GetReservedSlot and JS_SetReservedSlot API entry points, which is a zero-based index into the JSCLASS_RESERVED_SLOTS(clasp) reserved slots that come after the initial well-known slots: proto, parent, class, and optionally, the private data slot. ...
JSAPI reference
Mozilla › Projects › SpiderMonkey › JSAPI reference
avaScript. ...