call and apply

raul mihaila raul.mihaila at
Fri May 3 05:33:05 PDT 2013


In section Function.prototype.apply (thisArg, argArray) (page 119
of Ecma-262, Edition 5.1) there's this 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.' From this I understand that this is
happening in both non-strict mode and strict mode.

But in Annex C, one of the bullets says (page 235):
'If this is evaluated within strict mode code, then the this value is not
coerced to an object. A this value of null or undefined is not converted to
the global object and primitive values are not converted to wrapper
objects. The this value passed via a function call (including calls made
using Function.prototype.apply and do not coerce
the passed this value to an object (10.4.3, 11.1.1,,'
>From this I understand that the coercion occurs only in non-strict mode
(like in Firefox).

Is it possible to make this clearer in the next edition, please?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list