Subj : Re: Creating objects with parameters from C/C++ To : Andreas Podgurski From : Brendan Eich Date : Tue Jul 29 2003 01:49 pm Andreas Podgurski wrote: >>Use JS_ConstructObjectWithArguments. > > Thanks for answer, but I can't find that in the docs, neither in my pdf > version nor in the online one. When was it introduced and what is the usage? It was added on 14-Feb-2002, rev 3.122 of jsapi.c. It has therefore been in JS 1.5 RC4a, RC5, and RC5a. Sorry for the lack of doc update. It's easy to use, if you know the rest of the API. See http://lxr.mozilla.org/mozilla/source/js/src/jsapi.h#911 (or a permalink: http://lxr.mozilla.org/mozilla/search?string=JS_ConstructObjectWithArg): JS_ConstructObjectWithArguments(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent, uintN argc, jsval *argv); The first four arguments are the same as those to JS_ConstructObject. The argc and argv params are familiar from the native method (JSNative) and JS_CallFunction* APIs. /be .