Closed Bug 301553 Opened 20 years ago Closed 20 years ago

Object.toString() fails silently on XML objects (E4X)

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.8beta4

People

(Reporter: jwkbugzilla, Assigned: brendan)

Details

(Keywords: js1.5)

Attachments

(2 files)

The following code results in execution being aborted without any message on the JS console: var x = <xml/>; Object.toString.apply(x); A try ... catch block doesn't change anything. The method should produce something meaningful instead or at least produce an exception.
Attached file Testcase
This testcase should show a message box before and after calling Object.toString(). Instead, only the alert box before the call is displayed, despite the try ... catch block around the call.
Assignee: general → brendan
Another ancient bug exposed by E4X's anti-traditional method hiding. /be
Status: NEW → ASSIGNED
Flags: blocking1.8b4+
Keywords: js1.5
Priority: -- → P1
Target Milestone: --- → mozilla1.8beta4
js_TryMethod and js_TryValueOf are all about being infallible predicates that suppress exceptions. This is a very old bug. /be
Attachment #190060 - Flags: review?(shaver)
Attachment #190060 - Flags: approval1.8b4+
Comment on attachment 190060 [details] [diff] [review] never perpetrate a silent failure r=shaver. That's an old bug!
Attachment #190060 - Flags: review?(shaver) → review+
Fixed. /be
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Flags: testcase?
Checking in regress-301553.js; /cvsroot/mozilla/js/tests/e4x/Regress/regress-301553.js,v <-- regress-301553.js initial revision: 1.1
Flags: testcase? → testcase+
verified fixed 1.9 20060818 windows/mac*/linux
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: