Skip to content

Commit 92212e2

Browse files
committed
Editorial: clarify things
1 parent 4121440 commit 92212e2

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

index.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,10 @@ <h2>Syntax</h2>
478478
<span class="hljs-attr">default</span>: <span class="hljs-literal">false</span>
479479
};</code></pre>
480480
</div></emu-note>
481+
<emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents">
482+
We may need to use a non-<emu-xref href="#sec-keywords-and-reserved-words"><a href="https://tc39.es/ecma262/#sec-keywords-and-reserved-words">contextual keyword</a></emu-xref> like <code>~=</code> instead of a <emu-xref href="#sec-keywords-and-reserved-words"><a href="https://tc39.es/ecma262/#sec-keywords-and-reserved-words">contextual keyword</a></emu-xref> like <code>is</code>. See <a href="https://github.com/waldemarhorwat/syntax/blob/main/contextual-keywords.md?rgh-link-date=2024-09-06T16%3A43%3A25Z" data-print-href="">waldemarhorwat/syntax@main/contextual-keywords.md</a>
483+
and <a href="https://github.com/tc39/proposal-pattern-matching/issues/323" data-print-href="">Syntax effects on rest of the language</a>.
484+
</div></emu-note>
481485
482486
<emu-clause id="sec-relational-operators-runtime-semantics-evaluation" number="1">
483487
<h1><span class="secnum">13.10.1</span> Runtime Semantics: Evaluation</h1>
@@ -1250,6 +1254,9 @@ <h2>Syntax</h2>
12501254
<p>
12511255
This production will be added by <a target="_blank" href="https://github.com/tc39/proposal-discard-binding" data-print-href="">discard bindings proposal</a>.
12521256
</p>
1257+
<p>
1258+
Some of the committe members prefer <code>_</code> as the discard binding identifier.
1259+
</p>
12531260
<pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (expr is [<span class="hljs-keyword">let</span> x, <span class="hljs-keyword">void</span>, <span class="hljs-keyword">void</span>]) {}
12541261
<span class="hljs-comment">// can be written as:</span>
12551262
<span class="hljs-keyword">if</span> (expr is [<span class="hljs-keyword">let</span> x,,,]) {}
@@ -2674,7 +2681,7 @@ <h1><span class="secnum">30.2.3</span> Runtime Semantics: MatchExpressionClauses
26742681
</emu-rhs>
26752682
</emu-production>
26762683
</emu-grammar>
2677-
<emu-alg><ol><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="MatchExpressionClausesEvaluation" id="_ref_153"><a href="#sec-match-expression-clauses-runtime-semantics-evaluation" class="e-user-code">MatchExpressionClausesEvaluation</a></emu-xref> of <emu-nt id="_ref_464"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li><li>If <var>result</var> is an <emu-xref href="#sec-ecmascript-language-types" id="_ref_154"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>, return <var>result</var>.</li><li>Return ?&nbsp;<emu-xref aoid="MatchExpressionClauseEvaluation" id="_ref_155"><a href="#sec-match-expression-clause-runtime-semantics-evaluation" class="e-user-code">MatchExpressionClauseEvaluation</a></emu-xref> of <emu-nt id="_ref_465"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li></ol></emu-alg>
2684+
<emu-alg><ol><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="MatchExpressionClausesEvaluation" id="_ref_153"><a href="#sec-match-expression-clauses-runtime-semantics-evaluation" class="e-user-code">MatchExpressionClausesEvaluation</a></emu-xref> of <emu-nt id="_ref_464"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li><li>If <var>result</var> is an <emu-xref href="#sec-ecmascript-language-types" id="_ref_154"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>, return <var>result</var>.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>result</var> is <emu-const>not-matched</emu-const>.</li><li>Return ?&nbsp;<emu-xref aoid="MatchExpressionClauseEvaluation" id="_ref_155"><a href="#sec-match-expression-clause-runtime-semantics-evaluation" class="e-user-code">MatchExpressionClauseEvaluation</a></emu-xref> of <emu-nt id="_ref_465"><a href="#prod-MatchExpressionClause">MatchExpressionClause</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li></ol></emu-alg>
26782685
<emu-grammar><emu-production name="MatchExpressionClauses" collapsed="">
26792686
<emu-nt><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="g1pmaudo" id="prod--Nw1hDs1">
26802687
<emu-nt id="_ref_466"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt>
@@ -2685,7 +2692,7 @@ <h1><span class="secnum">30.2.3</span> Runtime Semantics: MatchExpressionClauses
26852692
</emu-rhs>
26862693
</emu-production>
26872694
</emu-grammar>
2688-
<emu-alg><ol><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="MatchExpressionClausesEvaluation" id="_ref_156"><a href="#sec-match-expression-clauses-runtime-semantics-evaluation" class="e-user-code">MatchExpressionClausesEvaluation</a></emu-xref> of <emu-nt id="_ref_467"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li><li>If <var>result</var> is an <emu-xref href="#sec-ecmascript-language-types" id="_ref_157"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>, return <var>result</var>.</li><li>Return ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>.</li></ol></emu-alg>
2695+
<emu-alg><ol><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="MatchExpressionClausesEvaluation" id="_ref_156"><a href="#sec-match-expression-clauses-runtime-semantics-evaluation" class="e-user-code">MatchExpressionClausesEvaluation</a></emu-xref> of <emu-nt id="_ref_467"><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> with arguments <var>subject</var> and <var>cacheGroup</var>.</li><li>If <var>result</var> is an <emu-xref href="#sec-ecmascript-language-types" id="_ref_157"><a href="#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>, return <var>result</var>.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>result</var> is <emu-const>not-matched</emu-const>.</li><li>Return ?&nbsp;<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt><a href="https://tc39.es/ecma262/#prod-Expression">Expression</a></emu-nt>.</li></ol></emu-alg>
26892696
<emu-grammar><emu-production name="MatchExpressionClauses" collapsed="">
26902697
<emu-nt><a href="#prod-MatchExpressionClauses">MatchExpressionClauses</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="xhzralk2" id="prod-QDysejGw">
26912698
<emu-t>default</emu-t>

spec.emu

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,11 @@ contributors:
456456
};
457457
</code></pre>
458458
</emu-note>
459+
<emu-note type="editor">
460+
We may need to use a non-contextual keyword like `~=` instead of a contextual keyword like `is`. See <a
461+
href="https://github.com/waldemarhorwat/syntax/blob/main/contextual-keywords.md?rgh-link-date=2024-09-06T16%3A43%3A25Z">waldemarhorwat/syntax@main/contextual-keywords.md</a>
462+
and <a href="https://github.com/tc39/proposal-pattern-matching/issues/323">Syntax effects on rest of the language</a>.
463+
</emu-note>
459464

460465
<emu-clause id="sec-relational-operators-runtime-semantics-evaluation" number="1">
461466
<h1>Runtime Semantics: Evaluation</h1>
@@ -1391,6 +1396,9 @@ contributors:
13911396
<p>
13921397
This production will be added by <a target="_blank" href="https://github.com/tc39/proposal-discard-binding">discard bindings proposal</a>.
13931398
</p>
1399+
<p>
1400+
Some of the committe members prefer `_` as the discard binding identifier.
1401+
</p>
13941402
<pre><code class="javascript">
13951403
if (expr is [let x, void, void]) {}
13961404
// can be written as:
@@ -2723,6 +2731,7 @@ contributors:
27232731
<emu-alg>
27242732
1. Let _result_ be ? MatchExpressionClausesEvaluation of |MatchExpressionClauses| with arguments _subject_ and _cacheGroup_.
27252733
1. If _result_ is an ECMAScript language value, return _result_.
2734+
1. Assert: _result_ is ~not-matched~.
27262735
1. Return ? MatchExpressionClauseEvaluation of |MatchExpressionClause| with arguments _subject_ and _cacheGroup_.
27272736
</emu-alg>
27282737
<emu-grammar>
@@ -2731,6 +2740,7 @@ contributors:
27312740
<emu-alg>
27322741
1. Let _result_ be ? MatchExpressionClausesEvaluation of |MatchExpressionClauses| with arguments _subject_ and _cacheGroup_.
27332742
1. If _result_ is an ECMAScript language value, return _result_.
2743+
1. Assert: _result_ is ~not-matched~.
27342744
1. Return ? Evaluation of |Expression|.
27352745
</emu-alg>
27362746
<emu-grammar>

0 commit comments

Comments
 (0)