Closed Bug 299741 Opened 19 years ago Closed 19 years ago

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

Categories

(Core :: XBL, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8beta3

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(2 files)

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
Attached patch Proposed fix (deleted) — Splinter Review
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+
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 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
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: