-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annex B.3.3 use cases have a universally-shared bullet with imprecise language #676
base: main
Are you sure you want to change the base?
Conversation
593b6a0
to
1fab9ae
Compare
… and use more precise language to specify an antecedent within one of the requirements.
1fab9ae
to
fc6f098
Compare
LGTM, @bterlson ? |
@@ -36405,18 +36405,19 @@ | |||
<!-- es6num="B.3.3" --> | |||
<emu-annex id="sec-block-level-function-declarations-web-legacy-compatibility-semantics"> | |||
<h1>Block-Level Function Declarations Web Legacy Compatibility Semantics</h1> | |||
<p>Prior to ECMAScript 2015, the ECMAScript specification did not define the occurrence of a |FunctionDeclaration| as an element of a |Block| statement's |StatementList|. However, support for that form of |FunctionDeclaration| was an allowable extension and most browser-hosted ECMAScript implementations permitted them. Unfortunately, the semantics of such declarations differ among those implementations. Because of these semantic differences, existing web ECMAScript code that uses |Block| level function declarations is only portable among browser implementation if the usage only depends upon the semantic intersection of all of the browser implementations for such declarations. The following are the use cases that fall within that intersection semantics:</p> | |||
<p>Prior to ECMAScript 2015, the ECMAScript specification did not define the occurrence of a |FunctionDeclaration| as an element of a |Block| statement's |StatementList|. However, support for that form of |FunctionDeclaration| was an allowable extension and most browser-hosted ECMAScript implementations permitted them. Unfortunately, the semantics of such declarations differ among those implementations. Because of these semantic differences, existing web ECMAScript code that uses |Block| level function declarations is only portable among browser implementation if the usage only depends upon the semantic intersection of all of the browser implementations for such declarations.</p> | |||
<p>These are the threshold requirements for the semantic intersection to potentially occur:</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this language complex to parse and understand. What was wrong with the old language?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NM I see what you're doing here.
Pretty sure this is saying the same thing. @allenwb can you confirm? |
After discussion with @allenwb, we're pretty agreed that this non-normative prose is inadequate to describe the intersection semantics (which are precisely defined by B.3.3.1-B.3.3.5). A better fix here would be to just give some illustrative examples rather than trying to proseify complex algorithm steps. I can work on this. |
3d0c24c
to
7a79833
Compare
All three use cases in Annex B.3.3 have the same first bullet point: "One or more FunctionDeclarations whose BindingIdentifier is the name f occur within the function code of an enclosing function g and that declaration is nested within a Block."
And within that bullet point, "that declaration" is somewhat ambiguous as to whether it refer to function
g
or to thoseFunctionDeclaration
s.Make the spec text apply to all three use cases, and use more-precise language to refer to those
FunctionDeclaration
s as antecedent.