Closed
Bug 600943
Opened 15 years ago
Closed 15 years ago
Date.prototype.toJSON computes 'this' incorrectly
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jimb, Unassigned)
References
Details
(Whiteboard: [fixed-in-tracemonkey])
Attachments
(1 file)
398 bytes,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
ES5 15.9.5.44 step 1 says that Date.prototype.toJSON must apply ToObject to the given |this| value. However, jsdate.cpp:date_toJSON calls ComputeThisFromVp, which does null->global and other sorts of transitions.
With the strict |this| patch applied, this causes regressions in ecma_5/Date/toJSON-01.js (but only in the browser, as the real global and the XPCCrossOriginWrapper seem to respond to DefaultValue differently, leading the shell to spuriously throw the correct error).
Attachment #479882 -
Flags: review?(jwalden+bmo)
Comment 1•15 years ago
|
||
Comment on attachment 479882 [details] [diff] [review]
Correctly compute |this| in Date.prototype.toJSON.
I had completely forgotten about toJSON-01.js conditionally testing strict-this behavior!
Let's remove the if-strict-mode-this-is-supported guard around these tests since we know we support it now, same as with the function bind test changes.
Attachment #479882 -
Flags: review?(jwalden+bmo) → review+
Comment 2•15 years ago
|
||
...in the strict-this bug, of course, after this patch lands as-is.
OS: Linux → Windows CE
Reporter | ||
Comment 3•15 years ago
|
||
Status: NEW → ASSIGNED
Whiteboard: [fixed-in-tracemonkey]
Comment 4•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•