Which spec did you have in mind? I'd like to read it.

Essentially, the ECMAScript spec requires this.  In spec-land, these
objects are all created at the beginning of time.  The fact that we
create them lazily is what leads to this bug.  Depending on who
touches them first, they end up with different prototype chains, which
doesn't make sense to ECMAScript.

I agree that it's strange for an object's behavior to change based on which global object accesses it first, but I don't think the ECMA spec is a good guide here, since, according to ECMA 262, the very notion of more than one global object is invalid.

That's correct.  Other browser's get this case right.  Here are a
couple test cases you might find interesting:

http://webblaze.org/abarth/tests/protoconfused/test1.html
http://webblaze.org/abarth/tests/protoconfused/test2.html

I tried these tests, with mixed results:

IE8: Exception thrown during load.
Firefox 3.0: mixture of passes and fails on test1.html. Exception thrown during load of test2.html.
Chrome 2.0: Mixture of passes and fails.

Geoff
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to