Stringifying EventTarget throws

RESOLVED FIXED in Firefox 14

Status

()

Core
DOM
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: bz, Assigned: peterv)

Tracking

({regression})

Trunk
mozilla15
x86
Mac OS X
regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox14+ fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Testcase:

  javascript:alert(EventTarget)

the issue is we're calling Function.prototype.toString.  We never added an own toString on our interface objects....
tracking-firefox14: --- → ?
(Assignee)

Comment 1

6 years ago
Created attachment 612126 [details] [diff] [review]
v1

This is causing orange on the Jetpack tests.
Assignee: nobody → peterv
Status: NEW → ASSIGNED

Comment 2

5 years ago
(In reply to Peter Van der Beken [:peterv] from comment #1)
> Created attachment 612126 [details] [diff] [review]
> v1
> 
> This is causing orange on the Jetpack tests.

Tracking for release to prevent issues hiding behind these orange tests. Let's go with the simplest fix (test or code change) to get this working again.

If that's not the only reason to track this bug for release, please clarify. Thanks!
tracking-firefox14: ? → +
Blocks: 741390
(Assignee)

Comment 3

5 years ago
Created attachment 620287 [details] [diff] [review]
v1.1
Attachment #612126 - Attachment is obsolete: true
Attachment #620287 - Flags: review?(bzbarsky)
Comment on attachment 620287 [details] [diff] [review]
v1.1

>+++ b/dom/bindings/Utils.cpp
>+// passed a non-Function object we als need to provide our own toString method

s/als/also/

>+InterfaceObjectToString(JSContext* cx, unsigned argc, JS::Value *vp)

>+  JS::Value thisv = JS_THIS(cx, vp);

You could use JS_THIS_OBJECT and then just null-check it; then no need for thisv.

Note that JS_THIS always returns either JSVAL_NULL or an ObjectValue(), so the "undefined" case can't even be hit here.

r=me with those fixed.
Attachment #620287 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 5

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/efa51cd286ee
Target Milestone: --- → mozilla15

Comment 6

5 years ago
https://hg.mozilla.org/mozilla-central/rev/efa51cd286ee
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
(Assignee)

Comment 7

5 years ago
Comment on attachment 620287 [details] [diff] [review]
v1.1

[Approval Request Comment]
Regression caused by (bug #): bug 740069
User impact if declined: seems to break Jetpack tests, not sure if it affects addons. Could cause website breakage due to unexpected exceptions.
Testing completed (on m-c, etc.): landed on m-c (and has a testcase)
Risk to taking this patch (and alternatives if risky): low-risk
String changes made by this patch: None
Attachment #620287 - Flags: approval-mozilla-aurora?

Comment 8

5 years ago
Comment on attachment 620287 [details] [diff] [review]
v1.1

[Triage Comment]
Approving for Aurora 14.
Attachment #620287 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(Assignee)

Comment 9

5 years ago
https://hg.mozilla.org/releases/mozilla-aurora/rev/b486a6c98abe
status-firefox14: --- → fixed
You need to log in before you can comment on or make changes to this bug.