[FIXr]JS exceptions in XBL constructors not always reported immediately

RESOLVED FIXED in mozilla1.8beta3

Status

()

Core
XBL
P1
normal
RESOLVED FIXED
13 years ago
13 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

Trunk
mozilla1.8beta3
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

If we're inside some JS and call into frame construction and fire XBL
constructors, errors won't get reported immediately because the XBL constructor
code doesn't notify XPConnect about the pending exception.
The testcase, by the way, is in bug 299231 -- the exception thrown by the
constructor for the surroundContents case doesn't show up until later (eg until
the page is reloaded).
Priority: -- → P1
Target Milestone: --- → mozilla1.8beta3
Created attachment 188329 [details] [diff] [review]
Proposed fix

The other option is to move NotifyXPCIfExceptionPending from being a static
method in nsJSEnvironment to being a class static in nsContentUtils and use it
here.  jst, let me know if you'd prefer that?
Attachment #188329 - Flags: superreview?(jst)
Attachment #188329 - Flags: review?(jst)
Comment on attachment 188329 [details] [diff] [review]
Proposed fix

r+sr=jst, but yeah, I'd rather see this code shared in nsContentUtils (r+sr
still applies if you move NotifyXPCIfExceptionPending()).
Attachment #188329 - Flags: superreview?(jst)
Attachment #188329 - Flags: superreview+
Attachment #188329 - Flags: review?(jst)
Attachment #188329 - Flags: review+
Created attachment 188398 [details] [diff] [review]
With the code moved to nsContentUtils

Requesting approval.  This is a very safe patch that makes us actually report
JS exceptions in XBL constructors/destructors when they happen.
Attachment #188398 - Flags: approval1.8b3?
Summary: [FIX]JS exceptions in XBL constructors not always reported immediately → [FIXr]JS exceptions in XBL constructors not always reported immediately

Comment 5

13 years ago
Comment on attachment 188398 [details] [diff] [review]
With the code moved to nsContentUtils

a=chofmann
Attachment #188398 - Flags: approval1.8b3? → approval1.8b3+
Fixed for 1.8b3
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.