Skip to content

Commit 2d6fa43

Browse files
committed
Specification updates for a number of missing pieces
1 parent 2142c2e commit 2d6fa43

22 files changed

+1364
-85
lines changed

docs/index.html

Lines changed: 644 additions & 80 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"license": "SEE LICENSE IN https://tc39.github.io/ecma262/#sec-copyright-and-software-license",
2020
"devDependencies": {
2121
"del": "^5.1.0",
22-
"ecmarkup": "^4.1.1",
22+
"ecmarkup": "^4.1.2",
2323
"gulp": "^4.0.2",
2424
"gulp-emu": "^1.3.2",
2525
"gulp-live-server": "0.0.31"

spec/index.html

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,28 @@ <h1>Object Initializer</h1>
4848

4949
<emu-clause id="sec-ecmascript-language-functions-and-classes">
5050
<h1>ECMAScript Language: Functions and Classes</h1>
51+
<emu-clause id="sec-function-definitions">
52+
<h1>Function Definitions</h1>
53+
<emu-import href="sec-function-definitions-static-semantics-early-errors-patch.html"></emu-import>
54+
</emu-clause>
55+
<emu-clause id="sec-arrow-function-definitions">
56+
<h1>Arrow Function Definitions</h1>
57+
<emu-import href="sec-arrow-function-definitions-static-semantics-contains-patch.html"></emu-import>
58+
<emu-import href="sec-arrow-function-definitions-runtime-semantics-namedevaluation-patch.html"></emu-import>
59+
</emu-clause>
5160
<emu-clause id="sec-method-definitions">
5261
<h1>Method Definitions</h1>
5362
<emu-import href="sec-runtime-semantics-definemethod-patch.html"></emu-import>
5463
<emu-import href="sec-method-definitions-runtime-semantics-propertydefinitionevaluation-patch.html"></emu-import>
5564
</emu-clause>
5665
<emu-clause id="sec-generator-function-definitions">
5766
<h1>Generator Function Definitions</h1>
67+
<emu-import href="sec-generator-function-definitions-static-semantics-early-errors-patch.html"></emu-import>
5868
<emu-import href="sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation-patch.html"></emu-import>
5969
</emu-clause>
6070
<emu-clause id="sec-asyncgenerator-function-definitions">
6171
<h1>Async Generator Function Definitions</h1>
72+
<emu-import href="sec-async-generator-function-definitions-static-semantics-early-errors-patch.html"></emu-import>
6273
<emu-import href="sec-asyncgenerator-definitions-propertydefinitionevaluation-patch.html"></emu-import>
6374
</emu-clause>
6475
<emu-clause id="sec-class-definitions">
@@ -67,6 +78,58 @@ <h1>Class Definitions</h1>
6778
</emu-clause>
6879
<emu-clause id="sec-async-function-definitions">
6980
<h1>Async Function Definitions</h1>
81+
<emu-import href="sec-async-function-definitions-static-semantics-early-errors-patch.html"></emu-import>
7082
<emu-import href="sec-async-function-definitions-PropertyDefinitionEvaluation-patch.html"></emu-import>
7183
</emu-clause>
84+
<emu-clause id="sec-async-arrow-function-definitions">
85+
<h1>Async Arrow Function Definitions</h1>
86+
<emu-import href="sec-async-arrow-function-definitions-static-semantics-Contains-patch.html"></emu-import>
87+
</emu-clause>
88+
<emu-clause id="sec-tail-position-calls">
89+
<h1>Tail Position Calls</h1>
90+
<emu-clause id="sec-static-semantics-hascallintailposition">
91+
<h1>Static Semantics: HasCallInTailPosition</h1>
92+
<emu-import href="sec-expression-rules-patch.html"></emu-import>
93+
</emu-clause>
94+
</emu-clause>
95+
</emu-clause>
96+
97+
<emu-clause id="sec-ecmascript-language-scripts-and-modules">
98+
<h1>ECMAScript Language: Scripts and Modules</h1>
99+
<emu-clause id="sec-scripts">
100+
<h1>Scripts</h1>
101+
<emu-import href="sec-scripts-static-semantics-early-errors-patch.html"></emu-import>
102+
</emu-clause>
103+
<emu-clause id="sec-modules">
104+
<h1>modules</h1>
105+
<emu-clause id="sec-module-semantics">
106+
<h1>Module Semantics</h1>
107+
<emu-import href="sec-module-semantics-static-semantics-early-errors-patch.html"></emu-import>
108+
</emu-clause>
109+
</emu-clause>
110+
</emu-clause>
111+
112+
<emu-clause id="sec-global-object">
113+
<h1>The Global Object</h1>
114+
<emu-clause id="sec-function-properties-of-the-global-object">
115+
<h1>Function Properties of the Global Object</h1>
116+
<emu-clause id="sec-eval-x">
117+
<h1>eval ( _x_ )</h1>
118+
<emu-import href="sec-performeval-patch.html"></emu-import>
119+
</emu-clause>
120+
</emu-clause>
121+
</emu-clause>
122+
123+
<emu-clause id="sec-fundamental-objects">
124+
<h1>Fundamental Objects</h1>
125+
<emu-clause id="sec-function-objects">
126+
<h1>Function Objects</h1>
127+
<emu-clause id="sec-function-constructor">
128+
<h1>The Function Constructor</h1>
129+
<emu-clause id="sec-function-p1-p2-pn-body">
130+
<h1>Function ( _p1_, _p2_, ..., _pn_, _body_ )</h1>
131+
<emu-import href="sec-createdynamicfunction-patch.html"></emu-import>
132+
</emu-clause>
133+
</emu-clause>
134+
</emu-clause>
72135
</emu-clause>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<emu-clause id="sec-arrow-function-definitions-runtime-semantics-namedevaluation">
2+
<h1>Runtime Semantics: NamedEvaluation</h1>
3+
<p>With parameter _name_.</p>
4+
<emu-grammar>ArrowFunction : ArrowParameters `=&gt;` ConciseBody</emu-grammar>
5+
<emu-alg>
6+
1. Let _scope_ be the LexicalEnvironment of the running execution context.
7+
1. Let _sourceText_ be the source text matched by |ArrowFunction|.
8+
1. Let _parameters_ be CoveredFormalsList of |ArrowParameters|.
9+
1. [id="step-arrowfunction-evaluation-functioncreate"] Let _closure_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, _parameters_, |ConciseBody|, ~lexical-this~, _scope_).
10+
1. Perform SetFunctionName(_closure_, _name_).
11+
1. Return _closure_.
12+
</emu-alg>
13+
<emu-note>
14+
<p>An |ArrowFunction| does not define local bindings for `arguments`, `super`<ins>, `class`</ins>, `this`, or `new.target`. Any reference to `arguments`, `super`<ins>, `class`</ins>, `this`, or `new.target` within an |ArrowFunction| must resolve to a binding in a lexically enclosing environment. Typically this will be the Function Environment of an immediately enclosing function. Even though an |ArrowFunction| may contain references to `super`, the function object created in step <emu-xref href="#step-arrowfunction-evaluation-functioncreate"></emu-xref> is not made into a method by performing MakeMethod. An |ArrowFunction| that references `super`<ins> or `class`</ins> is always contained within a non-|ArrowFunction| and the necessary state to implement `super`<ins> or `class`</ins> is accessible via the _scope_ that is captured by the function object of the |ArrowFunction|.</p>
15+
</emu-note>
16+
</emu-clause>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<emu-clause id="sec-arrow-function-definitions-static-semantics-contains">
2+
<h1>Static Semantics: Contains</h1>
3+
<p>With parameter _symbol_.</p>
4+
<emu-see-also-para op="Contains"></emu-see-also-para>
5+
<emu-grammar>ArrowFunction : ArrowParameters `=&gt;` ConciseBody</emu-grammar>
6+
<emu-alg>
7+
1. If _symbol_ is not one of |NewTarget|, |SuperProperty|, |SuperCall|<ins>, |ClassProperty|</ins>, `super`<ins>, `class`</ins> or `this`, return *false*.
8+
1. If |ArrowParameters| Contains _symbol_ is *true*, return *true*.
9+
1. Return |ConciseBody| Contains _symbol_.
10+
</emu-alg>
11+
<emu-note>
12+
<p>Normally, Contains does not look inside most function forms. However, Contains is used to detect `new.target`, `this`, <del>and `super`</del><ins>, `super` and `class`-property</ins> usage within an |ArrowFunction|.</p>
13+
</emu-note>
14+
</emu-clause>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<emu-clause id="sec-async-arrow-function-definitions-static-semantics-Contains">
2+
<h1>Static Semantics: Contains</h1>
3+
<p>With parameter _symbol_.</p>
4+
<emu-grammar>
5+
AsyncArrowFunction : `async` AsyncArrowBindingIdentifier `=>` AsyncConciseBody
6+
</emu-grammar>
7+
<emu-alg>
8+
1. If _symbol_ is not one of |NewTarget|, |SuperProperty|, |SuperCall|<ins>, |ClassProperty|</ins>, `super`<ins>, `class`</ins>, or `this`, return *false*.
9+
1. Return |AsyncConciseBody| Contains _symbol_.
10+
</emu-alg>
11+
<emu-grammar>
12+
AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead `=>` AsyncConciseBody
13+
</emu-grammar>
14+
<emu-alg>
15+
1. If _symbol_ is not one of |NewTarget|, |SuperProperty|, |SuperCall|<ins>, |ClassProperty|</ins>, `super`<ins>, `class`</ins>, or `this`, return *false*.
16+
1. Let _head_ be CoveredAsyncArrowHead of |CoverCallExpressionAndAsyncArrowHead|.
17+
1. If _head_ Contains _symbol_ is *true*, return *true*.
18+
1. Return |AsyncConciseBody| Contains _symbol_.
19+
</emu-alg>
20+
<emu-note>Normally, Contains does not look inside most function forms. However, Contains is used to detect `new.target`, `this`, <del>and `super`</del><ins>, `super`, and `class`-property</ins> usage within an AsyncArrowFunction.</emu-note>
21+
</emu-clause>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<emu-clause id="sec-async-function-definitions-static-semantics-early-errors">
2+
<h1>Static Semantics: Early Errors</h1>
3+
<emu-grammar>
4+
AsyncFunctionDeclaration : `async` `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}`
5+
6+
AsyncFunctionDeclaration : `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`
7+
8+
AsyncFunctionExpression : `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`
9+
10+
AsyncFunctionExpression : `async` `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}`
11+
</emu-grammar>
12+
<ul>
13+
<li>It is a Syntax Error if ContainsUseStrict of |AsyncFunctionBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.</li>
14+
<li>It is a Syntax Error if |FormalParameters| Contains |AwaitExpression| is *true*.</li>
15+
<li>If the source code matching |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.</li>
16+
<li>If |BindingIdentifier| is present and the source code matching |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.</li>
17+
<li>It is a Syntax Error if any element of the BoundNames of |FormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncFunctionBody|.</li>
18+
<li>It is a Syntax Error if |FormalParameters| Contains |SuperProperty| is *true*.</li>
19+
<li>It is a Syntax Error if |AsyncFunctionBody| Contains |SuperProperty| is *true*.</li>
20+
<li>It is a Syntax Error if |FormalParameters| Contains |SuperCall| is *true*.</li>
21+
<li>It is a Syntax Error if |AsyncFunctionBody| Contains |SuperCall| is *true*.</li>
22+
<li><ins>It is a Syntax Error if |FormalParameters| Contains |ClassProperty| is *true*.</ins></li>
23+
<li><ins>It is a Syntax Error if |AsyncFunctionBody| Contains |ClassProperty| is *true*.</ins></li>
24+
</ul>
25+
</emu-clause>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<emu-clause id="sec-async-generator-function-definitions-static-semantics-early-errors">
2+
<h1>Static Semantics: Early Errors</h1>
3+
<emu-grammar>
4+
AsyncGeneratorDeclaration : `async` `function` `*` BindingIdentifier `(` FormalParameters `)` `{` AsyncGeneratorBody `}`
5+
6+
AsyncGeneratorDeclaration : `async` `function` `*` `(` FormalParameters `)` `{` AsyncGeneratorBody `}`
7+
8+
AsyncGeneratorExpression : `async` `function` `*` BindingIdentifier? `(` FormalParameters `)` `{` AsyncGeneratorBody `}`
9+
</emu-grammar>
10+
<ul>
11+
<li>If the source code matching |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.</li>
12+
<li>If |BindingIdentifier| is present and the source code matching |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.</li>
13+
<li>It is a Syntax Error if ContainsUseStrict of |AsyncGeneratorBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.</li>
14+
<li>It is a Syntax Error if any element of the BoundNames of |FormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncGeneratorBody|.</li>
15+
<li>It is a Syntax Error if |FormalParameters| Contains |YieldExpression| is *true*.</li>
16+
<li>It is a Syntax Error if |FormalParameters| Contains |AwaitExpression| is *true*.</li>
17+
<li>It is a Syntax Error if |FormalParameters| Contains |SuperProperty| is *true*.</li>
18+
<li>It is a Syntax Error if |AsyncGeneratorBody| Contains |SuperProperty| is *true*.</li>
19+
<li>It is a Syntax Error if |FormalParameters| Contains |SuperCall| is *true*.</li>
20+
<li>It is a Syntax Error if |AsyncGeneratorBody| Contains |SuperCall| is *true*.</li>
21+
<li><ins>It is a Syntax Error if |FormalParameters| Contains |ClassProperty| is *true*.</ins></li>
22+
<li><ins>It is a Syntax Error if |AsyncGeneratorBody| Contains |ClassProperty| is *true*.</ins></li>
23+
</ul>
24+
</emu-clause>

0 commit comments

Comments
 (0)