JS PropertyStub
From MDC
Default implementations of the required callbacks in JSClass.
[edit] Syntax
JSBool JS_PropertyStub(JSContext *cx, JSObject *obj, jsval id, jsval *vp); JSBool JS_EnumerateStub(JSContext *cx, JSObject *obj); JSBool JS_ResolveStub(JSContext *cx, JSObject *obj, jsval id); JSBool JS_ConvertStub(JSContext *cx, JSObject *obj, JSType type, jsval *vp); JSBool JS_FinalizeStub(JSContext *cx, JSObject *obj);
[edit] Description
The stub functions are not designed to be called directly by a JSAPI application. Rather, they are convenient stand-ins anywhere the JSAPI requires callbacks of certain types. Examples at JSClass illustrate how stub functions can be used.
JS_PropertyStub is of type JSPropertyOp, the type of getter and setter callbacks. It can be used in JSClass.addProperty, JSClass.getProperty, JSClass.setProperty, JSClass.delProperty, JSPropertySpec.getter and setter, JS_DefineProperty, JS_DefinePropertyWithTinyId, and JS_DefineElement. It behaves exactly like a property callback that accepts the default property behavior: it does nothing and returns JS_TRUE.
JS_EnumerateStub is a stub for JSClass.enumerate. It does nothing and returns JS_TRUE.
JS_ResolveStub is a stub for JSClass.resolve. It does nothing and returns JS_TRUE.
JS_ConvertStub is a stub for JSClass.convert. Its behavior is the same as the default conversion behavior for Objects. It attempts to call the object's valueOf function, passing an argument specifying the desired type. If the object does not have a valueOf property, JS_ConvertStub produces the original object.
JS_FinalizeStub is a stub for JSClass.finalize. It does nothing and returns JS_TRUE.
LXR ID Search for JS_PropertyStub
LXR ID Search for JS_EnumerateStub
LXR ID Search for JS_ResolveStub
LXR ID Search for JS_ConvertStub
LXR ID Search for JS_FinalizeStub