Subj : Re: JS_InitClass returns JSObject*, but do I need it? To : Thomas Sondergaard From : Brendan Eich Date : Thu Jul 28 2005 01:44 pm Thomas Sondergaard wrote: > JS_InitClass returns a JSObject* that I can use e.g. with > JS_ConstructObject, but I was wondering if there is another way to get > my hand on the JSObject*. The engine obviously has it in there somewhere > as I can do a "new MyClass" in the script. Is there no API to get a > JSObject * from a class name string? > > regards, Given a class constructor function C, C.prototype is the class prototype object returned by JS_InitClass. So you could do two JS_GetProperty calls to reach the prototype given the class name and the global object. /be .