This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
JSObjectOps is not a supported API. Details of the API may change from one release to the next. This documentation should be considered SpiderMonkey internals documentation, not API documentation. See bug 408416 for details.
typedef JSObjectMap * (*JSNewObjectMapOp)(JSContext *cx, jsrefcount nrefs, JSObjectOps *ops, JSClass *clasp, JSObject *obj);
||Pointer to the JS context in which the new object is being created.|
||The initial reference count for the new
||The new object.|
Note: The JSAPI does not expose the data structure that would be necessary to develop new
JSObjectMap subclasses. An application that implements
JSObjectOps must therefore either implement the
newObjectMap by including the non-public header
jsobj.h, or obtain the default
NewObjectMapOp by calling the
JSClass.getObjectOps callback of a standard
Create a new instance of (a concrete subclass of)
JSObjectMap (see jsobj.h), with the
ops members initialized from the same-named parameters, and with the
freeslot members initialized according to
clasp. Return null on error, non-null on success.
JSObjectMaps are reference-counted by generic code in the engine. Usually, the
nrefs parameter to
JSObjectOps.newObjectMap will be
1, to count the ref returned to the caller on success. After a successful construction, some number of
js_DropObjectMap calls ensue. When
0 due to a
JSObjectOps.destroyObjectMap will be called to dispose of the map.