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

VERIFIED FIXED in mozilla1.8beta4

Status

()

Core
JavaScript Engine
P1
minor
VERIFIED FIXED
13 years ago
12 years ago

People

(Reporter: Wladimir Palant (for Adblock Plus info Cc bugzilla@adblockplus.org), Assigned: brendan)

Tracking

({js1.5})

Trunk
mozilla1.8beta4
js1.5
Points:
---
Bug Flags:
blocking1.8b5 +
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

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.
Created attachment 190011 [details]
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)

Updated

13 years ago
Assignee: general → brendan
(Assignee)

Comment 2

13 years ago
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
(Assignee)

Comment 3

13 years ago
Created attachment 190060 [details] [diff] [review]
never perpetrate a silent failure

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+
(Assignee)

Comment 5

13 years ago
Fixed.

/be
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED

Updated

13 years ago
Flags: testcase?

Comment 6

13 years ago
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+

Comment 7

12 years ago
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.