Search completed in 1.41 seconds.
5 results for "js_constructobjectwitharguments":
JS_ConstructObject
Mozilla › Projects › SpiderMonkey › JSAPI reference › JS ConstructObject
The preferred alternative is to save a copy of the constructor function for the class, then to call it using JS_New. ...
...ation of the method, but note that this reimplementation is not guaranteed to continue working across SpiderMonkey releases. Create a new object of the specified class, with the specified prototype and parent, then invokes a constructor function to initialize the new object. Syntax JSObject * JS_ConstructObject(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent); JSObject * JS_ConstructObjectWithArguments(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent, unsigned int argc, jsval *argv); Name Type Description cx JSContext * The context in which to create the new object. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext. clasp JSClass * Pointer to the class to use for the new object. If thi...
...st be in a request on this JSContext. clasp JSClass * Pointer to the class to use for the new object. If this is NULL, an ordinary JavaScript Object is created. proto JSObject * The object to serve as the new object's prototype, or NULL. parent JSObject * The object to serve as the new object's parent, or NULL. argc unsigned int (only in JS_ConstructObjectWithArguments) The number of arguments to pass to the constructor. argv jsval * (only in JS_ConstructObjectWithArguments) The array of arguments to pass to the constructor. This may be null if argc is zero. Otherwise, the first argc elements of this array must be populated with valid jsval values. The caller does not need to ensure that the array elements are rooted. Description JS_Const...
... specified prototype and parent, then invokes a constructor function to initialize the new object. cx is a pointer to a context associated with the runtime in which to create the new object. clasp is a pointer to the class of object to create. proto and parent may specify objects to be used as the new object's prototype and parent. If either is NULL, the engine tries to find reasonable defaults. JS_ConstructObjectWithArguments is the same but additionally passes zero or more arguments to the constructor. Neither of these functions is quite like the JavaScript new keyword. For details on how we find the appropriate constructor and default prototype, see JS_NewObject: Choosing a Default Prototype. Roughly speaking, we use parent or cx to find a global object, and then find clasp's constructor in that global object. I...
JS_DefineObject
Mozilla › Projects › SpiderMonkey › JSAPI reference › JS DefineObject
itialization of the new object is up to the caller. On success, JS_DefineObject returns a pointer to the new object. On error or exception (if the object cannot be created, the property already exists, or the property cannot be created), JS_DefineObject returns NULL. This function combines two operations: creating an object and storing it in a property of another object. Use JS_ConstructObject, JS_ConstructObjectWithArguments, or JS_NewObject to create a new object without storing it in a property of another object. Use JS_DefineProperty or JS_DefineElement to create a property without creating a new object. See also MXR ID Search for JS_DefineObject bug 1127494 ...
JSAPI reference
Mozilla › Projects › SpiderMonkey › JSAPI reference
in SpiderMonkey 6 Obsolete since JSAPI 13 Objects typedef JSObject JS_DefineObject JS_NewObject JS_NewPlainObject Added in SpiderMonkey 38 JS_NewObjectForConstructor Added in SpiderMonkey 1.8.5 JS_NewGlobalObject Added in SpiderMonkey 1.8 JS_NewObjectWithGivenProto JS_New Added in SpiderMonkey 1.8 JS_IsGlobalObject Added in JSAPI 24 JS_ConstructObject Obsolete since JSAPI 16 JS_ConstructObjectWithArguments Obsolete since JSAPI 16 JS_GetClass JS_GetObjectPrototype Added in JSAPI 17 JS_GetFunctionPrototype Added in SpiderMonkey 17 JS_GetArrayPrototype Added in SpiderMonkey 24 JS_GetConstructor JS_GetGlobalForObject JS_GetInstancePrivate JS_GetPrototype JS_SetPrototype JS_GetPrivate JS_SetPrivate JS_FreezeObject Added in SpiderMonkey 1.8.5 JS_DeepFreezeObject Added in SpiderMonkey 1.8.
SpiderMonkey 1.8.8
Mozilla › Projects › SpiderMonkey › Releases › 1.8.8
JSAPI remains a C API, the engine is now implemented in C++. Some C++ helpers have been introduced into the API, to help embedders writing C++ projects. Please note that SpiderMonkey reserves the JS:: namespace for itself. ...list new C++ helpers here... Obsolete APIs ...list obsolete methods/structs/APIs here... Deleted APIs JS_GET_CLASS (use JS_GetClass instead) JS_ConstructObject and JS_ConstructObjectWithArguments (preferably use JS_New instead, or use this reimplementation as a short-term fix) JS_NewCompartmentAndGlobalObject (Use JS_NewGlobalObject instead.) JSPD_ARGUMENT JSVAL_IS_OBJECT() (use !JSVAL_IS_PRIMITIVE(v) to detect objects and JSVAL_IS_NULL(v) to detect null). JS_IsScriptFrame JSCLASS_NEW_RESOLVE_GETS_START flag JS_NewNumberValue API changes Break out and discuss all API changes here..
SpiderMonkey 17
Mozilla › Projects › SpiderMonkey › Releases › 17
JSAPI remains a C API, the engine is now implemented in C++. Some C++ helpers have been introduced into the API, to help embedders writing C++ projects. Please note that SpiderMonkey reserves the JS:: namespace for itself. ...list new C++ helpers here... Obsolete APIs ...list obsolete methods/structs/APIs here... Deleted APIs JS_GET_CLASS (use JS_GetClass instead) JS_ConstructObject and JS_ConstructObjectWithArguments (preferably use JS_New instead, or use this reimplementation as a short-term fix) JS_NewCompartmentAndGlobalObject (Use JS_NewGlobalObject instead.) JSPD_ARGUMENT JSVAL_IS_OBJECT() (use !JSVAL_IS_PRIMITIVE(v) to detect objects and JSVAL_IS_NULL(v) to detect null). JS_IsScriptFrame JSCLASS_NEW_RESOLVE_GETS_START flag JS_NewNumberValue JS_FinalizeStub JS_ClearNewbornRoots JSCLASS_MARK_IS_T...