On 2/3/14 1:15 PM, Domenic Denicola wrote:
From: Boris Zbarsky <[email protected]>
I'm saying that the algorithm in the [[Call]] of those objects (or rather of the 
functions being bound in this case) explicitly references a part of the environment 
called the "script settings object stack" and expects whoever plans to invoke 
that [[Call]] to maintain it as needed.

This expectation seems untenable.

It's completely tenable in today's world where all JS is run to completion any anything async is happening via the browser event loop and WebIDL; those maintain the stack in question across async invocations, and the behavior of the stack across synchronous calls is defined in the whatwg specification. To the extent that the latter is true, you could argue that it did fork [[Call]] on scripted functions in ES, I guess...

As we add an event loop to ES, we will need to maintain that stack in ES, presumably, or some equivalent. But right now we don't.

It should be the job of a function that depends on global state to specify how 
that dependency on global state works.

It's defined.  The global state just needs to be there.

What I am understanding from this is that DOM specs have forked the ES spec's definition 
of [[Call]] to include a hidden "script settings object stack" parameter, which 
ES is not aware of.

You can view it that way if you want, I suppose. Or you can view implementations as having implicit things like that already, for postMessage and the like.

But again, you're ratholing on this particular example. My point was that there are lots of edge cases like this in the web platform that we shouldn't force every single spec author to think about. Some of them are due to DOM things, some are due to ES things. To the extent possible, we should make it possible to write correct and readable specifications that do the right thing in these edge cases even if the specification author wasn't aware of the complications.

-Boris
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to