Closed Bug 575535 Opened 11 years ago Closed 10 years ago

ES5 Function.prototype.{apply,call} do not coerce |this| to object

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0
Tracking Status
blocking2.0 --- -
status2.0 --- wanted

People

(Reporter: brendan, Assigned: Waldo)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

From 15.3.4.3 and 15.3.4.4:

NOTE The thisArg value is passed without modification as the this value. This is a change from Edition 3, where a undefined or null thisArg is replaced with the global object and ToObject is applied to all other values and that result is passed as the this value.

/be
Blocks: 575522
Target Milestone: mozilla1.9.3 → mozilla2.0
Assignee: general → jwalden+bmo
blocking2.0: --- → beta5+
blocking2.0: beta5+ → beta6+
Depends on: strictThis
blocking2.0: beta6+ → betaN+
Bug 514570's patches fixed this, but we don't have targeted tests specifically exercising .call and .apply in this manner.  At a skim it looks like tests there used .call in passing to check primitive this, but none (or few) used .apply; in any case I'm leery of depending on the details of tests not directly on-point for what needs to be tested, so I think we need some.

The apply tests should fit nicely in the already-existing, reasonably exhaustive ecma_5/Function/15.3.4.3-01.js.  (Mea culpa for not including anticipatory tests when I wrote that, although don't expect me to feel too guilty for the omission.  :-) )
Long since ripe for closure...
Attachment #496070 - Flags: review?(jorendorff)
we want these tests, but we're not going to block.
blocking2.0: betaN+ → -
status2.0: --- → wanted
Comment on attachment 496070 [details] [diff] [review]
Awesomeify the tests

Seriously, just check in passing tests.
Attachment #496070 - Flags: review?(jorendorff) → review+
http://hg.mozilla.org/tracemonkey/rev/ae8b6e7b0cd1
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/ae8b6e7b0cd1
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.