You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Editorial: Be consistent about the sense of "match" (#2572)
Given 'prod' (a nonterminal, production, or Parse Node)
and 'text' (some source text, source code, or code points),
the spec has occurrences of both:
- prod matches text / text is matched by prod
and
- text matches prod / prod is matched by text
This PR changes the latter into the former.
Copy file name to clipboardExpand all lines: spec.html
+24-24Lines changed: 24 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -11870,7 +11870,7 @@ <h1>
11870
11870
1. If _env_ is not present or if _env_ is *undefined*, then
11871
11871
1. Set _env_ to the running execution context's LexicalEnvironment.
11872
11872
1. Assert: _env_ is an Environment Record.
11873
-
1. If the code matching the syntactic production that is being evaluated is contained in strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
11873
+
1. If the code matched by the syntactic production that is being evaluated is contained in strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
It is a Syntax Error if any source text matches this rule.
22645
+
It is a Syntax Error if any source text is matched by this rule.
22646
22646
</li>
22647
22647
</ul>
22648
22648
<emu-note>
@@ -23222,10 +23222,10 @@ <h1>Static Semantics: Early Errors</h1>
23222
23222
</emu-grammar>
23223
23223
<ul>
23224
23224
<li>
23225
-
If the source code matching |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.
23225
+
If the source code matched by |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.
23226
23226
</li>
23227
23227
<li>
23228
-
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"*.
23228
+
If |BindingIdentifier| is present and the source code matched by |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.
23229
23229
</li>
23230
23230
<li>
23231
23231
It is a Syntax Error if FunctionBodyContainsUseStrict of |FunctionBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.
@@ -23800,10 +23800,10 @@ <h1>Static Semantics: Early Errors</h1>
23800
23800
</emu-grammar>
23801
23801
<ul>
23802
23802
<li>
23803
-
If the source code matching |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.
23803
+
If the source code matched by |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.
23804
23804
</li>
23805
23805
<li>
23806
-
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"*.
23806
+
If |BindingIdentifier| is present and the source code matched by |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.
23807
23807
</li>
23808
23808
<li>
23809
23809
It is a Syntax Error if FunctionBodyContainsUseStrict of |GeneratorBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.
@@ -24039,8 +24039,8 @@ <h1>Static Semantics: Early Errors</h1>
<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>
24043
-
<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>
24042
+
<li>If the source code matched by |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.</li>
24043
+
<li>If |BindingIdentifier| is present and the source code matched by |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.</li>
24044
24044
<li>It is a Syntax Error if FunctionBodyContainsUseStrict of |AsyncGeneratorBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.</li>
24045
24045
<li>It is a Syntax Error if any element of the BoundNames of |FormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncGeneratorBody|.</li>
24046
24046
<li>It is a Syntax Error if |FormalParameters| Contains |YieldExpression| is *true*.</li>
@@ -24985,8 +24985,8 @@ <h1>Static Semantics: Early Errors</h1>
24985
24985
<ul>
24986
24986
<li>It is a Syntax Error if FunctionBodyContainsUseStrict of |AsyncFunctionBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.</li>
24987
24987
<li>It is a Syntax Error if |FormalParameters| Contains |AwaitExpression| is *true*.</li>
24988
-
<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>
24989
-
<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>
24988
+
<li>If the source code matched by |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.</li>
24989
+
<li>If |BindingIdentifier| is present and the source code matched by |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.</li>
24990
24990
<li>It is a Syntax Error if any element of the BoundNames of |FormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncFunctionBody|.</li>
24991
24991
<li>It is a Syntax Error if |FormalParameters| Contains |SuperProperty| is *true*.</li>
24992
24992
<li>It is a Syntax Error if |AsyncFunctionBody| Contains |SuperProperty| is *true*.</li>
@@ -25259,7 +25259,7 @@ <h1>
25259
25259
<dl class="header">
25260
25260
</dl>
25261
25261
<emu-alg>
25262
-
1. If the source code matching _call_ is non-strict code, return *false*.
25262
+
1. If the source code matched by _call_ is non-strict code, return *false*.
25263
25263
1. If _call_ is not contained within a |FunctionBody|, |ConciseBody|, or |AsyncConciseBody|, return *false*.
25264
25264
1. Let _body_ be the |FunctionBody|, |ConciseBody|, or |AsyncConciseBody| that most closely contains _call_.
25265
25265
1. If _body_ is the |FunctionBody| of a |GeneratorBody|, return *false*.
The RegExp pattern grammars in <emu-xref href="#sec-patterns"></emu-xref> and <emu-xref href="#sec-regular-expressions-patterns"></emu-xref> must not be extended to recognize any of the source characters A-Z or a-z as |IdentityEscape[+UnicodeMode]| when the <sub>[UnicodeMode]</sub> grammar parameter is present.
28504
28504
</li>
28505
28505
<li>
28506
-
The Syntactic Grammar must not be extended in any manner that allows the token `:` to immediately follow source text that matches the |BindingIdentifier| nonterminal symbol.
28506
+
The Syntactic Grammar must not be extended in any manner that allows the token `:` to immediately follow source text that is matched by the |BindingIdentifier| nonterminal symbol.
28507
28507
</li>
28508
28508
<li>
28509
28509
When processing strict mode code, an implementation must not relax the early error rules of <emu-xref href="#sec-numeric-literals-early-errors"></emu-xref>.
@@ -29949,7 +29949,7 @@ <h1>
29949
29949
1. Let _body_ be ParseText(! StringToCodePoints(_bodyString_), _bodySym_).
29950
29950
1. If _body_ is a List of errors, throw a *SyntaxError* exception.
29951
29951
1. NOTE: The parameters and body are parsed separately to ensure that each is valid alone. For example, `new Function("/*", "*/ ) {")` is not legal.
29952
-
1. NOTE: If this step is reached, _sourceText_ must match _exprSym_ (although the reverse implication does not hold). The purpose of the next two steps is to enforce any Early Error rules which apply to _exprSym_ directly.
29952
+
1. NOTE: If this step is reached, _sourceText_ must have the syntax of _exprSym_ (although the reverse implication does not hold). The purpose of the next two steps is to enforce any Early Error rules which apply to _exprSym_ directly.
29953
29953
1. Let _expr_ be ParseText(_sourceText_, _exprSym_).
29954
29954
1. If _expr_ is a List of errors, throw a *SyntaxError* exception.
29955
29955
1. Let _proto_ be ? GetPrototypeFromConstructor(_newTarget_, _fallbackProto_).
@@ -46797,7 +46797,7 @@ <h1>Static Semantics: Early Errors</h1>
It is a Syntax Error if the LexicallyDeclaredNames of |StatementList| contains any duplicate entries<ins>, unless the source code matching this production is not strict mode code and the duplicate entries are only bound by FunctionDeclarations</ins>.
47493
+
It is a Syntax Error if the LexicallyDeclaredNames of |StatementList| contains any duplicate entries<ins>, unless the source code matched by this production is not strict mode code and the duplicate entries are only bound by FunctionDeclarations</ins>.
47494
47494
</li>
47495
47495
<li>
47496
47496
It is a Syntax Error if any element of the LexicallyDeclaredNames of |StatementList| also occurs in the VarDeclaredNames of |StatementList|.
@@ -47504,7 +47504,7 @@ <h1>Changes to `switch` Statement Static Semantics: Early Errors</h1>
It is a Syntax Error if the LexicallyDeclaredNames of |CaseBlock| contains any duplicate entries<ins>, unless the source code matching this production is not strict mode code and the duplicate entries are only bound by FunctionDeclarations</ins>.
47507
+
It is a Syntax Error if the LexicallyDeclaredNames of |CaseBlock| contains any duplicate entries<ins>, unless the source code matched by this production is not strict mode code and the duplicate entries are only bound by FunctionDeclarations</ins>.
47508
47508
</li>
47509
47509
<li>
47510
47510
It is a Syntax Error if any element of the LexicallyDeclaredNames of |CaseBlock| also occurs in the VarDeclaredNames of |CaseBlock|.
@@ -47540,7 +47540,7 @@ <h1>FunctionDeclarations in IfStatement Statement Clauses</h1>
<p>This production only applies when parsing non-strict code. Code matching this production is processed as if each matching occurrence of |FunctionDeclaration[?Yield, ?Await, ~Default]| was the sole |StatementListItem| of a |BlockStatement| occupying that position in the source code. The semantics of such a synthetic |BlockStatement| includes the web legacy compatibility semantics specified in <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics"></emu-xref>.</p>
47543
+
<p>This production only applies when parsing non-strict code. Code matched by this production is processed as if each matching occurrence of |FunctionDeclaration[?Yield, ?Await, ~Default]| was the sole |StatementListItem| of a |BlockStatement| occupying that position in the source code. The semantics of such a synthetic |BlockStatement| includes the web legacy compatibility semantics specified in <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics"></emu-xref>.</p>
0 commit comments