Re: Uncatchable exceptions
Bobby Holley <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.jseng |
|---|---|
| Message-ID | <CAKBxTcK-M2ZQ5hUiT=mS0nO2mFRJAv1GOm_58PsmBLgzF5h=zA@mail.gmail.com> |
Historically, returning false without setting a pending exception was considered uncatchable, and was the way to signal OOM, terminate slow scripts, etc. The idea is that callers are always supposed to propagate |false| return values, and if there wasn't any associated exception state, there was nothing they could do but propagate it upward. Recently, OOMs were converted to use some kind of pseudo-exception on the JSContext. There is some related discussion at [1]. I think that the slow script dialog / interrupt callback mechanism still uses plain |return false|, but I haven't checked. [1] https://groups.google.com/d/msg/mozilla.dev.tech.js-engine.internals/6icIj0U0wDo/T70QBToLBwAJ On Mon, May 2, 2016 at 2:15 PM, Ehsan Akhgari <[email protected]> wrote: > AFAIK there is some notion of uncatchable exceptions in SpiderMonkey in > case a JSNative returns false, which is used in Gecko. Are there other > similar cases in SpiderMonkey? There doesn't seem to be any way to > raise/detect such exceptions through the JS API. > > Also, is there any notion of terminating the execution of JS through other > means? > > Thanks, > -- > Ehsan > _______________________________________________ > dev-tech-js-engine mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-tech-js-engine >