Closed
Bug 398109
Opened 17 years ago
Closed 17 years ago
toString() on XOW is very odd
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
People
(Reporter: bzbarsky, Assigned: mrbkap)
References
Details
Attachments
(1 file)
900 bytes,
patch
|
jst
:
review+
bzbarsky
:
superreview+
beltzner
:
approvalM9-
beltzner
:
approval1.9+
|
Details | Diff | Splinter Review |
STEPS TO REPRODUCE: 1) javascript:alert(window) 2) javascript:alert(window + "") 3) Write a mochitest in which you have a test like: is(null, window, "Should be null, for some reason") EXPECTED RESULTS: All three give the same string for the window ACTUAL RESULTS: 1) Gives "[object XPCCrossOriginWrapper [object Window]]" 2) Gives "[object Window]" 3) Gives "[]" This last particularly bothers me, since I can't tell why that's happening.
Flags: blocking1.9?
Assignee | ||
Comment 1•17 years ago
|
||
#3 happens due to a bug in MochiKit's repr (specifically, its isArrayLike function returns true for window objects, which is incorrect). I'll file that in a second. I have a patch for cases 1 and 2.
Assignee | ||
Comment 2•17 years ago
|
||
If only hg allowed me to give more context to the diff... The only tricky bit here is that this code is shared by both XPCNativeWrapper whose toString I wanted to leave alone. With this patch, to verify that you have a XOW from JS, you must do Object.prototype.toString.call(obj).
Assignee: nobody → mrbkap
Status: NEW → ASSIGNED
Attachment #282965 -
Flags: superreview?(bzbarsky)
Attachment #282965 -
Flags: review?(jst)
Reporter | ||
Comment 3•17 years ago
|
||
Comment on attachment 282965 [details] [diff] [review] Fix sr=bzbarsky
Attachment #282965 -
Flags: superreview?(bzbarsky) → superreview+
Assignee | ||
Comment 4•17 years ago
|
||
I filed bug 398118 on the MochiKit issue.
Updated•17 years ago
|
Attachment #282965 -
Flags: review?(jst) → review+
Assignee | ||
Comment 5•17 years ago
|
||
Comment on attachment 282965 [details] [diff] [review] Fix This fixes a XOW inconsistency and makes alert(window) and alert(window + '') do the same thing.
Attachment #282965 -
Flags: approval1.9?
Not a blocker maybe, but since there's a patch, it'd be great to get it in.
Flags: blocking1.9? → blocking1.9-
Whiteboard: [wanted-1.9]
Assignee | ||
Comment 7•17 years ago
|
||
Comment on attachment 282965 [details] [diff] [review] Fix This will help ease confusion about XOWs and will make us consistent again.
Attachment #282965 -
Flags: approvalM9?
Comment 8•17 years ago
|
||
Comment on attachment 282965 [details] [diff] [review] Fix a=endgame drivers for after M9 freeze
Attachment #282965 -
Flags: approvalM9?
Attachment #282965 -
Flags: approvalM9-
Attachment #282965 -
Flags: approval1.9?
Attachment #282965 -
Flags: approval1.9+
Assignee | ||
Comment 10•17 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Flags: in-testsuite?
Updated•17 years ago
|
Flags: wanted1.9+
Whiteboard: [wanted-1.9]
You need to log in
before you can comment on or make changes to this bug.
Description
•