Conflicts between W3C specs and ES5?
Maciej Stachowiak
mjs at apple.com
Wed Nov 18 16:39:29 PST 2009
On Nov 18, 2009, at 3:25 PM, David-Sarah Hopwood wrote:
> Brendan Eich wrote:
>> On Nov 17, 2009, at 6:41 PM, Maciej Stachowiak wrote:
>>
>>>>> otherWindow.copyOfEvalFromYetAnotherWindow("...") throws
> [...]
>>>>
>>>> What is the rationale for throwing in this last case, rather than
>>>> using the explicit base object (otherWindow) as |this|?
> [...]
>> The standard ECMA-262 semantics want otherWindow -- "bound method"
>> exceptions prove the rule.
>
> There are bound methods in ES implementations? I'm all ears.
>
>
> (One thing I've never understood is why ES implementors add features
> or exceptional behaviour that users of the language could only find,
> or even know to look for, by reverse engineering or guesswork. What's
> the point? Doesn't it take more work to add all this stuff?)
In the case of the original topic (eval), in JavaScriptCore it is only
"bound" enough to reject being called with the wrong "this" object; it
does not do anything else with its stored original global object. We
did this solely to match the ES4 "reformed eval" proposal at the time,
as I mentioned on the public-script-coord list.
Regards,
Maciej
More information about the es-discuss
mailing list