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

Editorial: Define template literal bad-escape syntax errors at top level #3220

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 11 additions & 37 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -18635,18 +18635,18 @@ <h2>Syntax</h2>
<emu-grammar type="definition">
TemplateLiteral[Yield, Await, Tagged] :
NoSubstitutionTemplate
SubstitutionTemplate[?Yield, ?Await, ?Tagged]
SubstitutionTemplate[?Yield, ?Await]

SubstitutionTemplate[Yield, Await, Tagged] :
TemplateHead Expression[+In, ?Yield, ?Await] TemplateSpans[?Yield, ?Await, ?Tagged]
SubstitutionTemplate[Yield, Await] :
TemplateHead Expression[+In, ?Yield, ?Await] TemplateSpans[?Yield, ?Await]

TemplateSpans[Yield, Await, Tagged] :
TemplateSpans[Yield, Await] :
TemplateTail
TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateTail
TemplateMiddleList[?Yield, ?Await] TemplateTail

TemplateMiddleList[Yield, Await, Tagged] :
TemplateMiddleList[Yield, Await] :
TemplateMiddle Expression[+In, ?Yield, ?Await]
TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateMiddle Expression[+In, ?Yield, ?Await]
TemplateMiddleList[?Yield, ?Await] TemplateMiddle Expression[+In, ?Yield, ?Await]
</emu-grammar>

<emu-clause id="sec-static-semantics-template-early-errors" oldids="sec-primary-expression-template-literals-static-semantics-early-errors">
Expand All @@ -18656,45 +18656,19 @@ <h1>Static Semantics: Early Errors</h1>
</emu-grammar>
<ul>
<li>
It is a Syntax Error if the <sub>[Tagged]</sub> parameter was not set and |NoSubstitutionTemplate| Contains |NotEscapeSequence|.
It is a Syntax Error if the <sub>[Tagged]</sub> parameter was not set and the result of TemplateStrings of |TemplateLiteral| with argument *false* contains *undefined*.
</li>
</ul>

<emu-grammar>
TemplateLiteral[Yield, Await, Tagged] : SubstitutionTemplate[?Yield, ?Await, ?Tagged]
TemplateLiteral[Yield, Await, Tagged] : SubstitutionTemplate[?Yield, ?Await]
</emu-grammar>
<ul>
<li>
It is a Syntax Error if the number of elements in the result of TemplateStrings of |TemplateLiteral| with argument *false* is greater than or equal to 2<sup>32</sup>.
It is a Syntax Error if the <sub>[Tagged]</sub> parameter was not set and the result of TemplateStrings of |TemplateLiteral| with argument *false* contains *undefined*.
</li>
</ul>

<emu-grammar>
SubstitutionTemplate[Yield, Await, Tagged] : TemplateHead Expression[+In, ?Yield, ?Await] TemplateSpans[?Yield, ?Await, ?Tagged]
</emu-grammar>
<ul>
<li>
It is a Syntax Error if the <sub>[Tagged]</sub> parameter was not set and |TemplateHead| Contains |NotEscapeSequence|.
</li>
</ul>

<emu-grammar>
TemplateSpans[Yield, Await, Tagged] : TemplateTail
</emu-grammar>
<ul>
<li>
It is a Syntax Error if the <sub>[Tagged]</sub> parameter was not set and |TemplateTail| Contains |NotEscapeSequence|.
</li>
</ul>

<emu-grammar>
TemplateMiddleList[Yield, Await, Tagged] :
TemplateMiddle Expression[+In, ?Yield, ?Await]
TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateMiddle Expression[+In, ?Yield, ?Await]
</emu-grammar>
<ul>
<li>
It is a Syntax Error if the <sub>[Tagged]</sub> parameter was not set and |TemplateMiddle| Contains |NotEscapeSequence|.
It is a Syntax Error if the number of elements in the result of TemplateStrings of |TemplateLiteral| with argument *false* is greater than or equal to 2<sup>32</sup>.
</li>
</ul>
</emu-clause>
Expand Down