Re: Object creation in SpiderMonkey 45

Mihai Dobrescu <[email protected]>
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
On Thursday, May 5, 2016 at 8:57:54 PM UTC+3, Boris Zbarsky wrote:
> On 5/5/16 1:47 PM, Mihai Dobrescu wrote:
> > My mind just blown up. What is the status now in 45? Is it a bug, or should I do things differently? If so, how?
> 
> You should do things differently.  You need to pass the correct proto to 
> the JS_NewObject call, as I said two or three times already.
> 
> -Boris

If I understand well, should I replace the call to JS_NewObject by JS_NewObjectWithGivenProto?

JSObject *
JS_NewObject(JSContext *cx, const JSClass *clasp);

by

bool
JS_NewObjectWithGivenProto(JSContext *cx, const JSClass *clasp, JS::Handle<JSObject*> proto);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.