Continuing woes in reading the ES6 spec language
allen at wirfs-brock.com
Tue Sep 10 18:09:56 PDT 2013
On Sep 10, 2013, at 5:38 PM, Oliver Hunt wrote:
> Okay, I'm having a really hard time navigating and following the current spec layout. The many different places that behavior is specified for the same productions, and the absence of direct links between makes extraordinarily hard to read and understand.
> In my current reading I was attempting to determine in what scope default initializers are evaluated, but from reading the spec (starting at #14.1) I could not find initialization of any environment record, and while there was reference to various places in which we determine the expected argument count, or whether there are initializers, i could not find anything that handle default initializers. I'm sure it's there but it I have spent many hours following random names from place to place in the spec (again, this is hard as the same productions are described repeatedly for the many different semantic modes that they're in), and I still do not know what the expected results of evaluation are.
Try starting with http://people.mozilla.org/~jorendorff/es6-draft.html#sec-22.214.171.124
This is the [[Call]] behavior of an ordinary function object (one whose body is defined using ES code)
You will see it set the environment record for the invoked functions and in step 13 you can fall the link to Function Declaration Instantiation http://people.mozilla.org/~jorendorff/es6-draft.html#sec-126.96.36.199
step 21 calls Binding Initialisation for formals, which is the syntactic productions for the actual formal parameters of the function.
> The current spec layout seems to be a substantial regression in terms of usability vs. the old spec. Some of this would be helped if we were using html and links, but a lot of it seems controlled by the decision to remove the step-by-step evaluation ordering of the ES5 spec.
Not sure what you think was removed. There a variety of of runtime evaluation algorithms (such as Binding Initialisation) mentioned above rather than simply calling them by the catch all name "evaluation". But everything is still step-by-step.
But yes, we now have a more complex language and it talks a more complex specification to describe it.
Suggestions for improving navigation are appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss