Re: Removing JS_CallOnce

Mihai Dobrescu <[email protected]> Tue, 23 Aug 2016 13:12:25 -0700 (PDT)
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
On Tuesday, August 23, 2016 at 4:28:00 PM UTC+3, Ms2ger wrote:
> Hey all,
> 
> JSAPI contains a JS_CallOnce function, documented as follows:
> 
> > The first call to JS_CallOnce by any thread in a process will call
> > 'func'. Later calls to JS_CallOnce with the same JSCallOnceType
> > object will be suppressed.
> > 
> > Equivalently: each distinct JSCallOnceType object will allow one
> > JS_CallOnce to invoke its JSInitCallback.
> 
> I believe the implementation of this function is now the only code in
> SpiderMonkey that depends on NSPR.
> 
> As jandem said:
> 
> > It's a pretty weird API for something that has little to do with JS
> > (embedders have other ways to do it), and it's not used in Firefox.
> 
> Any objections to removing the API, and dropping the dependency on NSPR
> once and for all?
> 
> Thanks
> Ms2ger

I love you!