Closed Bug 327697 Opened 18 years ago Closed 18 years ago

Make XPConnect refuse to wrap E4X (was: HTMLSelectElement.add hangs if second parameter is E4X)

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9alpha1

People

(Reporter: jruderman, Assigned: mrbkap)

References

Details

(4 keywords, Whiteboard: [rft-dl])

Attachments

(3 files)

 
Attached file testcase
E4X interacts badly with XPConnect and the way it does wrapping. In this case we're trying to walk up the parent chain of an E4X object, which (similarly to bug     326615) is causing us to think there's always a parent element. The best way to fix this for now is to make XPConnect simply refuse to wrap E4X objects.
OS: MacOS X → All
Priority: -- → P1
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.9alpha
Attached patch Hack-fixSplinter Review
We should be able to remove this hack when the DOM <-> E4X bindings are in place.
Assignee: general → mrbkap
Status: NEW → ASSIGNED
Attachment #212688 - Flags: superreview?(shaver)
Attachment #212688 - Flags: review?(brendan)
Blocks: 326615
Comment on attachment 212688 [details] [diff] [review]
Hack-fix

Throw an exception, please!

/be
Attachment #212688 - Flags: review?(brendan) → review-
Comment on attachment 212688 [details] [diff] [review]
Hack-fix

Curse me for not reading the (missing) context!

All's well, this method is supposed to return true or false and its caller is responsible for throwing in the latter case -- mrbkap kindly pointed that out in person.

/be
Attachment #212688 - Flags: review- → review+
And file a followup (depending on whatever bugs it depends on) to undo this?
I've added a reference to bug 270553 in the comment above the early return.
Comment on attachment 212688 [details] [diff] [review]
Hack-fix

sr=shaver
Attachment #212688 - Flags: superreview?(shaver) → superreview+
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Verified fixed.  The error message I now see looks reasonable:

Error: [Exception... "Could not convert JavaScript argument arg 1 [nsIDOMHTMLSelectElement.add]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: https://bugzilla.mozilla.org/attachment.cgi?id=212294 :: init :: line 9"  data: no]
Status: RESOLVED → VERIFIED
Summary: HTMLSelectElement.add hangs if second parameter is E4X → Make XPConnect refuse to wrap E4X (was: HTMLSelectElement.add hangs if second parameter is E4X)
Checking in regress-327697.js;
/cvsroot/mozilla/js/tests/e4x/Regress/regress-327697.js,v  <--  regress-327697.js
initial revision: 1.1
done
Flags: testcase+
approving for 1.8.0 and 1.8 branches to fix hang after fix for bug 326615, a=dveditz
Flags: blocking1.8.1+
Flags: blocking1.8.0.2+
Attachment #212688 - Flags: approval1.8.0.2+
Attachment #212688 - Flags: approval-branch-1.8.1+
Checked into the 1.8 branches.
Whiteboard: [rft-dl]
v 1.8.0.2, 1.8, 1.9 20060308 win/linux/mac
Keywords: fixed1.8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: