Created attachment 479882 [details] [diff] [review] Correctly compute |this| in Date.prototype.toJSON. ES5 220.127.116.11 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 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+
...in the strict-this bug, of course, after this patch lands as-is.
OS: Linux → Windows CE
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.