Status: Unconfirmed
Owner: ----
Labels: Type-Bug Pri-2 OS-All Area-Misc

New issue 25926 by kangax: `call` fails to coerce `null` (and `undefined`)  
to Global Object in some cases
http://code.google.com/p/chromium/issues/detail?id=25926

Chrome Version: 4.0.223.11 (Official Build 29902)

   Add OK or FAIL after other browsers where you have tested this issue:
      Safari 4: OK
   Firefox 3.x: OK
          IE 7: OK
          IE 8: OK

What steps will reproduce the problem?

var GlobalObject = (function(){ return this; })();

Object.prototype.toString.call(null) ===
Object.prototype.toString.call(GlobalObject);

What is the expected result?
`true`

What happens instead?
`false`

Please provide any additional information below. Attach a screenshot if
possible.

As per 15.3.4.4 (ECMA-262, 3rd ed.) when `call` is given `null` (or
`undefined`), it should invoke function with Global Object as `this` value.
However, Chrome seems to fail this step when calling
`Object.prototype.toString`. We can observe this by passing Global Object
to the same expression explicitly and comparing result (as shown above).

Is this a bug or intended behavior?

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to