Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jswalden
Copy link
Contributor

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 those FunctionDeclarations.

Make the spec text apply to all three use cases, and use more-precise language to refer to those FunctionDeclarations as antecedent.

… and use more precise language to specify an antecedent within one of the requirements.
@littledan
Copy link
Member

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>
Copy link
Member

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?

Copy link
Member

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.

@bterlson
Copy link
Member

Pretty sure this is saying the same thing. @allenwb can you confirm?

@bterlson
Copy link
Member

bterlson commented Sep 7, 2016

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.

@ljharb ljharb force-pushed the master branch 3 times, most recently from 3d0c24c to 7a79833 Compare June 29, 2021 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants