Removing JS_CallOnce

Ms2ger <[email protected]> Tue, 23 Aug 2016 15:27:50 +0200
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
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