It is probably worth mentioning the relevant paragraphs in the ES spec.

15.3.4.3 (Function.prototype.apply)
15.3.4.4 (Function.prototype.call)

have changed between ES3 and ES5.

In ES3:
If thisArg is null or undefined, the called function is passed the global object
as the this value.
Otherwise, the called function is passed ToObject(thisArg) as the this value.

In ES5 the algorithm changed to not apply ToObject nor to substitute global
object for null or undefined. The note from the ES5 spec (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.


http://codereview.chromium.org/6087011/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to