Convert PAC code to autoJSAPIOwnsErrorReporting

RESOLVED FIXED in Firefox 49

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: jandem, Assigned: jandem)

Tracking

unspecified
mozilla49
Points:
---

Firefox Tracking Flags

(firefox49 fixed)

Details

(Whiteboard: [necko-would-take])

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Created attachment 8758751 [details] [diff] [review]
Patch

Here's a patch. It was pretty straight-forward for the most part.

I made one minor improvement: warnings now have "PAC Execution Warning" prefix instead of "PAC Execution Error".

I manually verified errors and warnings still appear in the browser console as before.
Comment on attachment 8758751 [details] [diff] [review]
Patch

>+    JS::ContextOptionsRef(mContext).setDontReportUncaught(true);

Not needed: all the places that check that option also check autoJSAPIOwnsErrorReporting.

>   nsresult Init()

While you're here, can you change the JS_InitStandardClasses callsite to check the return value?

Also, don't you need to put the AutoPACErrorReporter before the JS_NewGlobalObject call?  I'd expect that JS_NewGlobalObject can throw OOM...  Alternately, we could just JS_ClearPendingException if JS_NewGlobalObject fails.  That might be simpler, because it's not clear what AutoPACErrorReporter would do if we're in the null compartment.

> ProxyAutoConfig::GC

Do you really need AutoPACErrorReporter here?  JS_MaybeGC can't exactly throw or report an exception.

r=me with the above fixed.
(Assignee)

Updated

3 years ago
Blocks: 1277278

Comment 2

3 years ago
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c6667fa95dff
Convert PAC runtime to autoJSAPIOwnsErrorReporting. r=bz
Whiteboard: [necko-would-take]

Comment 3

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/c6667fa95dff
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox49: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.