mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
3190 lines
288 KiB
HTML
3190 lines
288 KiB
HTML
<!DOCTYPE html><html lang="en-GB-oxendict"><head><meta name="viewport" content="width=device-width, initial-scale=1"><meta charset="utf-8"><meta property="og:image" content="https://tc39.es/ecmarkup/ecma-logo.png"><meta property="og:title" content="ECMAScript® 2026 Language Specification"><meta property="og:description" content="Introduction
|
||
This Ecma Standard defines the ECMAScript 2026 Language. It is the seventeenth edition of the ECMAScript Language Specification. ECMAScript is based on several originating technologies, the most well-known being JavaScript (Netscape) and JScript (Microsoft). The language was invent">
|
||
<link rel="icon" href="../img/favicon.ico">
|
||
<link rel="stylesheet" href="../assets/css/ecmarkup.css"><link rel="stylesheet" href="../assets/css/print.css" media="print">
|
||
|
||
<title>ECMAScript® 2026 Language Specification</title><script src="../assets/js/multipage.js?cache=Wu2V1pj2" defer=""></script><script src="../assets/js/ecmarkup.js?cache=BPFBckdu" defer=""></script><link rel="canonical" href="../#sec-ecmascript-language-lexical-grammar"></head>
|
||
<body><div id="spec-container"><emu-clause id="sec-ecmascript-language-lexical-grammar">
|
||
<h1><span class="secnum">12</span> ECMAScript Language: Lexical Grammar</h1>
|
||
<p>The source text of an ECMAScript <emu-nt id="_ref_19625"><a href="ecmascript-language-scripts-and-modules.html#prod-Script">Script</a></emu-nt> or <emu-nt id="_ref_19626"><a href="ecmascript-language-scripts-and-modules.html#prod-Module">Module</a></emu-nt> is first converted into a sequence of input elements, which are tokens, line terminators, comments, or white space. The source text is scanned from left to right, repeatedly taking the longest possible sequence of code points as the next input element.</p>
|
||
<p>There are several situations where the identification of lexical input elements is sensitive to the syntactic grammar context that is consuming the input elements. This requires multiple <emu-xref href="#sec-context-free-grammars" id="_ref_5869"><a href="notational-conventions.html#sec-context-free-grammars">goal symbols</a></emu-xref> for the lexical grammar. The <emu-nt id="_ref_19627"><a href="ecmascript-language-lexical-grammar.html#prod-InputElementHashbangOrRegExp">InputElementHashbangOrRegExp</a></emu-nt> goal is used at the start of a <emu-nt id="_ref_19628"><a href="ecmascript-language-scripts-and-modules.html#prod-Script">Script</a></emu-nt> or <emu-nt id="_ref_19629"><a href="ecmascript-language-scripts-and-modules.html#prod-Module">Module</a></emu-nt>. The <emu-nt id="_ref_19630"><a href="ecmascript-language-lexical-grammar.html#prod-InputElementRegExpOrTemplateTail">InputElementRegExpOrTemplateTail</a></emu-nt> goal is used in syntactic grammar contexts where a <emu-nt id="_ref_19631"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt>, a <emu-nt id="_ref_19632"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateMiddle">TemplateMiddle</a></emu-nt>, or a <emu-nt id="_ref_19633"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateTail">TemplateTail</a></emu-nt> is permitted. The <emu-nt id="_ref_19634"><a href="ecmascript-language-lexical-grammar.html#prod-InputElementRegExp">InputElementRegExp</a></emu-nt> <emu-xref href="#sec-context-free-grammars" id="_ref_5870"><a href="notational-conventions.html#sec-context-free-grammars">goal symbol</a></emu-xref> is used in all syntactic grammar contexts where a <emu-nt id="_ref_19635"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt> is permitted but neither a <emu-nt id="_ref_19636"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateMiddle">TemplateMiddle</a></emu-nt>, nor a <emu-nt id="_ref_19637"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateTail">TemplateTail</a></emu-nt> is permitted. The <emu-nt id="_ref_19638"><a href="ecmascript-language-lexical-grammar.html#prod-InputElementTemplateTail">InputElementTemplateTail</a></emu-nt> goal is used in all syntactic grammar contexts where a <emu-nt id="_ref_19639"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateMiddle">TemplateMiddle</a></emu-nt> or a <emu-nt id="_ref_19640"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateTail">TemplateTail</a></emu-nt> is permitted but a <emu-nt id="_ref_19641"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt> is not permitted. In all other contexts, <emu-nt id="_ref_19642"><a href="ecmascript-language-lexical-grammar.html#prod-InputElementDiv">InputElementDiv</a></emu-nt> is used as the lexical <emu-xref href="#sec-context-free-grammars" id="_ref_5871"><a href="notational-conventions.html#sec-context-free-grammars">goal symbol</a></emu-xref>.</p>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>The use of multiple lexical goals ensures that there are no lexical ambiguities that would affect automatic semicolon insertion. For example, there are no syntactic grammar contexts where both a leading division or division-assignment, and a leading <emu-nt id="_ref_19643"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt> are permitted. This is not affected by semicolon insertion (see <emu-xref href="#sec-automatic-semicolon-insertion" id="_ref_359"><a href="ecmascript-language-lexical-grammar.html#sec-automatic-semicolon-insertion">12.10</a></emu-xref>); in examples such as the following:</p>
|
||
<pre><code class="javascript hljs">a = b
|
||
/hi/g.<span class="hljs-title function_">exec</span>(c).<span class="hljs-title function_">map</span>(d);</code></pre>
|
||
<p>where the first non-whitespace, non-comment code point after a <emu-nt id="_ref_19644"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> is U+002F (SOLIDUS) and the syntactic context allows division or division-assignment, no semicolon is inserted at the <emu-nt id="_ref_19645"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt>. That is, the above example is interpreted in the same way as:</p>
|
||
<pre><code class="javascript hljs">a = b / hi / g.<span class="hljs-title function_">exec</span>(c).<span class="hljs-title function_">map</span>(d);</code></pre>
|
||
</div></emu-note>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="InputElementDiv" type="lexical" id="prod-InputElementDiv">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-InputElementDiv">InputElementDiv</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fctcswat">
|
||
<emu-nt id="_ref_19646"><a href="ecmascript-language-lexical-grammar.html#prod-WhiteSpace">WhiteSpace</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ozmczrck">
|
||
<emu-nt id="_ref_19647"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ft16wloj">
|
||
<emu-nt id="_ref_19648"><a href="ecmascript-language-lexical-grammar.html#prod-Comment">Comment</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="gxwilro0">
|
||
<emu-nt id="_ref_19649"><a href="ecmascript-language-lexical-grammar.html#prod-CommonToken">CommonToken</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="kanqhgik">
|
||
<emu-nt id="_ref_19650"><a href="ecmascript-language-lexical-grammar.html#prod-DivPunctuator">DivPunctuator</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ehmup46z">
|
||
<emu-nt id="_ref_19651"><a href="ecmascript-language-lexical-grammar.html#prod-RightBracePunctuator">RightBracePunctuator</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="InputElementRegExp" type="lexical" id="prod-InputElementRegExp">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-InputElementRegExp">InputElementRegExp</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fctcswat">
|
||
<emu-nt id="_ref_19652"><a href="ecmascript-language-lexical-grammar.html#prod-WhiteSpace">WhiteSpace</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ozmczrck">
|
||
<emu-nt id="_ref_19653"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ft16wloj">
|
||
<emu-nt id="_ref_19654"><a href="ecmascript-language-lexical-grammar.html#prod-Comment">Comment</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="gxwilro0">
|
||
<emu-nt id="_ref_19655"><a href="ecmascript-language-lexical-grammar.html#prod-CommonToken">CommonToken</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ehmup46z">
|
||
<emu-nt id="_ref_19656"><a href="ecmascript-language-lexical-grammar.html#prod-RightBracePunctuator">RightBracePunctuator</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="mbzy6lvr">
|
||
<emu-nt id="_ref_19657"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="InputElementRegExpOrTemplateTail" type="lexical" id="prod-InputElementRegExpOrTemplateTail">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-InputElementRegExpOrTemplateTail">InputElementRegExpOrTemplateTail</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fctcswat">
|
||
<emu-nt id="_ref_19658"><a href="ecmascript-language-lexical-grammar.html#prod-WhiteSpace">WhiteSpace</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ozmczrck">
|
||
<emu-nt id="_ref_19659"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ft16wloj">
|
||
<emu-nt id="_ref_19660"><a href="ecmascript-language-lexical-grammar.html#prod-Comment">Comment</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="gxwilro0">
|
||
<emu-nt id="_ref_19661"><a href="ecmascript-language-lexical-grammar.html#prod-CommonToken">CommonToken</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="mbzy6lvr">
|
||
<emu-nt id="_ref_19662"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="yq5uuf55">
|
||
<emu-nt id="_ref_19663"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateSubstitutionTail">TemplateSubstitutionTail</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="InputElementTemplateTail" type="lexical" id="prod-InputElementTemplateTail">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-InputElementTemplateTail">InputElementTemplateTail</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fctcswat">
|
||
<emu-nt id="_ref_19664"><a href="ecmascript-language-lexical-grammar.html#prod-WhiteSpace">WhiteSpace</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ozmczrck">
|
||
<emu-nt id="_ref_19665"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ft16wloj">
|
||
<emu-nt id="_ref_19666"><a href="ecmascript-language-lexical-grammar.html#prod-Comment">Comment</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="gxwilro0">
|
||
<emu-nt id="_ref_19667"><a href="ecmascript-language-lexical-grammar.html#prod-CommonToken">CommonToken</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="kanqhgik">
|
||
<emu-nt id="_ref_19668"><a href="ecmascript-language-lexical-grammar.html#prod-DivPunctuator">DivPunctuator</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="yq5uuf55">
|
||
<emu-nt id="_ref_19669"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateSubstitutionTail">TemplateSubstitutionTail</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="InputElementHashbangOrRegExp" type="lexical" id="prod-InputElementHashbangOrRegExp">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-InputElementHashbangOrRegExp">InputElementHashbangOrRegExp</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fctcswat">
|
||
<emu-nt id="_ref_19670"><a href="ecmascript-language-lexical-grammar.html#prod-WhiteSpace">WhiteSpace</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ozmczrck">
|
||
<emu-nt id="_ref_19671"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ft16wloj">
|
||
<emu-nt id="_ref_19672"><a href="ecmascript-language-lexical-grammar.html#prod-Comment">Comment</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="gxwilro0">
|
||
<emu-nt id="_ref_19673"><a href="ecmascript-language-lexical-grammar.html#prod-CommonToken">CommonToken</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="pcfv_yin">
|
||
<emu-nt id="_ref_19674"><a href="ecmascript-language-lexical-grammar.html#prod-HashbangComment">HashbangComment</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="mbzy6lvr">
|
||
<emu-nt id="_ref_19675"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
|
||
<emu-clause id="sec-unicode-format-control-characters">
|
||
<h1><span class="secnum">12.1</span> Unicode Format-Control Characters</h1>
|
||
<p>The Unicode format-control characters (i.e., the characters in category “Cf” in the Unicode Character Database such as LEFT-TO-RIGHT MARK or RIGHT-TO-LEFT MARK) are control codes used to control the formatting of a range of text in the absence of higher-level protocols for this (such as mark-up languages).</p>
|
||
<p>It is useful to allow format-control characters in source text to facilitate editing and display. All format control characters may be used within comments, and within string literals, template literals, and regular expression literals.</p>
|
||
<p>U+FEFF (ZERO WIDTH NO-BREAK SPACE) is a format-control character used primarily at the start of a text to mark it as Unicode and to allow detection of the text's encoding and byte order. <ZWNBSP> characters intended for this purpose can sometimes also appear after the start of a text, for example as a result of concatenating files. In <emu-xref href="#sec-source-text" id="_ref_5872"><a href="ecmascript-language-source-code.html#sec-source-text">ECMAScript source text</a></emu-xref> <ZWNBSP> code points are treated as white space characters (see <emu-xref href="#sec-white-space" id="_ref_360"><a href="ecmascript-language-lexical-grammar.html#sec-white-space">12.2</a></emu-xref>) outside of comments, string literals, template literals, and regular expression literals.</p>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-white-space">
|
||
<h1><span class="secnum">12.2</span> White Space</h1>
|
||
<p>White space code points are used to improve source text readability and to separate tokens (indivisible lexical units) from each other, but are otherwise insignificant. White space code points may occur between any two tokens and at the start or end of input. White space code points may occur within a <emu-nt id="_ref_19676"><a href="ecmascript-language-lexical-grammar.html#prod-StringLiteral">StringLiteral</a></emu-nt>, a <emu-nt id="_ref_19677"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt>, a <emu-nt id="_ref_19678"><a href="ecmascript-language-lexical-grammar.html#prod-Template">Template</a></emu-nt>, or a <emu-nt id="_ref_19679"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateSubstitutionTail">TemplateSubstitutionTail</a></emu-nt> where they are considered significant code points forming part of a literal value. They may also occur within a <emu-nt id="_ref_19680"><a href="ecmascript-language-lexical-grammar.html#prod-Comment">Comment</a></emu-nt>, but cannot appear within any other kind of token.</p>
|
||
<p>The ECMAScript white space code points are listed in <emu-xref href="#table-white-space-code-points" id="_ref_361"><a href="ecmascript-language-lexical-grammar.html#table-white-space-code-points">Table 30</a></emu-xref>.</p>
|
||
<emu-table id="table-white-space-code-points" caption="White Space Code Points" oldids="table-32"><figure><figcaption>Table 30: White Space Code Points</figcaption><span id="table-32"></span>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>
|
||
Code Points
|
||
</th>
|
||
<th>
|
||
Name
|
||
</th>
|
||
<th>
|
||
Abbreviation
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr>
|
||
<td>
|
||
<code>U+0009</code>
|
||
</td>
|
||
<td>
|
||
CHARACTER TABULATION
|
||
</td>
|
||
<td>
|
||
<TAB>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>U+000B</code>
|
||
</td>
|
||
<td>
|
||
LINE TABULATION
|
||
</td>
|
||
<td>
|
||
<VT>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>U+000C</code>
|
||
</td>
|
||
<td>
|
||
FORM FEED (FF)
|
||
</td>
|
||
<td>
|
||
<FF>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>U+FEFF</code>
|
||
</td>
|
||
<td>
|
||
ZERO WIDTH NO-BREAK SPACE
|
||
</td>
|
||
<td>
|
||
<ZWNBSP>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
any code point in general category “Space_Separator”
|
||
</td>
|
||
<td>
|
||
</td>
|
||
<td>
|
||
<USP>
|
||
</td>
|
||
</tr>
|
||
</tbody></table>
|
||
</figure></emu-table>
|
||
<emu-note><span class="note">Note 1</span><div class="note-contents">
|
||
<p>U+0020 (SPACE) and U+00A0 (NO-BREAK SPACE) code points are part of <USP>.</p>
|
||
</div></emu-note>
|
||
<emu-note><span class="note">Note 2</span><div class="note-contents">
|
||
<p>Other than for the code points listed in <emu-xref href="#table-white-space-code-points" id="_ref_362"><a href="ecmascript-language-lexical-grammar.html#table-white-space-code-points">Table 30</a></emu-xref>, ECMAScript <emu-nt id="_ref_19681"><a href="ecmascript-language-lexical-grammar.html#prod-WhiteSpace">WhiteSpace</a></emu-nt> intentionally excludes all code points that have the Unicode “White_Space” property but which are not classified in general category “Space_Separator” (“Zs”).</p>
|
||
</div></emu-note>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="WhiteSpace" type="lexical" id="prod-WhiteSpace">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-WhiteSpace">WhiteSpace</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="k4soaizl">
|
||
<emu-gprose><TAB></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="w_cit1lu">
|
||
<emu-gprose><VT></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="dvfflmsr">
|
||
<emu-gprose><FF></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="-4gwujcl">
|
||
<emu-gprose><ZWNBSP></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="68nsiosh">
|
||
<emu-gprose><USP></emu-gprose>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-line-terminators">
|
||
<h1><span class="secnum">12.3</span> Line Terminators</h1>
|
||
<p>Like white space code points, line terminator code points are used to improve source text readability and to separate tokens (indivisible lexical units) from each other. However, unlike white space code points, line terminators have some influence over the behaviour of the syntactic grammar. In general, line terminators may occur between any two tokens, but there are a few places where they are forbidden by the syntactic grammar. Line terminators also affect the process of automatic semicolon insertion (<emu-xref href="#sec-automatic-semicolon-insertion" id="_ref_363"><a href="ecmascript-language-lexical-grammar.html#sec-automatic-semicolon-insertion">12.10</a></emu-xref>). A line terminator cannot occur within any token except a <emu-nt id="_ref_19682"><a href="ecmascript-language-lexical-grammar.html#prod-StringLiteral">StringLiteral</a></emu-nt>, <emu-nt id="_ref_19683"><a href="ecmascript-language-lexical-grammar.html#prod-Template">Template</a></emu-nt>, or <emu-nt id="_ref_19684"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateSubstitutionTail">TemplateSubstitutionTail</a></emu-nt>. <LF> and <CR> line terminators cannot occur within a <emu-nt id="_ref_19685"><a href="ecmascript-language-lexical-grammar.html#prod-StringLiteral">StringLiteral</a></emu-nt> token except as part of a <emu-nt id="_ref_19686"><a href="ecmascript-language-lexical-grammar.html#prod-LineContinuation">LineContinuation</a></emu-nt>.</p>
|
||
<p>A line terminator can occur within a <emu-nt id="_ref_19687"><a href="ecmascript-language-lexical-grammar.html#prod-MultiLineComment">MultiLineComment</a></emu-nt> but cannot occur within a <emu-nt id="_ref_19688"><a href="ecmascript-language-lexical-grammar.html#prod-SingleLineComment">SingleLineComment</a></emu-nt>.</p>
|
||
<p>Line terminators are included in the set of white space code points that are matched by the <code>\s</code> class in regular expressions.</p>
|
||
<p>The ECMAScript line terminator code points are listed in <emu-xref href="#table-line-terminator-code-points" id="_ref_364"><a href="ecmascript-language-lexical-grammar.html#table-line-terminator-code-points">Table 31</a></emu-xref>.</p>
|
||
<emu-table id="table-line-terminator-code-points" caption="Line Terminator Code Points" oldids="table-33"><figure><figcaption>Table 31: Line Terminator Code Points</figcaption><span id="table-33"></span>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>
|
||
Code Point
|
||
</th>
|
||
<th>
|
||
Unicode Name
|
||
</th>
|
||
<th>
|
||
Abbreviation
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr>
|
||
<td>
|
||
<code>U+000A</code>
|
||
</td>
|
||
<td>
|
||
LINE FEED (LF)
|
||
</td>
|
||
<td>
|
||
<LF>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>U+000D</code>
|
||
</td>
|
||
<td>
|
||
CARRIAGE RETURN (CR)
|
||
</td>
|
||
<td>
|
||
<CR>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>U+2028</code>
|
||
</td>
|
||
<td>
|
||
LINE SEPARATOR
|
||
</td>
|
||
<td>
|
||
<LS>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>U+2029</code>
|
||
</td>
|
||
<td>
|
||
PARAGRAPH SEPARATOR
|
||
</td>
|
||
<td>
|
||
<PS>
|
||
</td>
|
||
</tr>
|
||
</tbody></table>
|
||
</figure></emu-table>
|
||
<p>Only the Unicode code points in <emu-xref href="#table-line-terminator-code-points" id="_ref_365"><a href="ecmascript-language-lexical-grammar.html#table-line-terminator-code-points">Table 31</a></emu-xref> are treated as line terminators. Other new line or line breaking Unicode code points are not treated as line terminators but are treated as white space if they meet the requirements listed in <emu-xref href="#table-white-space-code-points" id="_ref_366"><a href="ecmascript-language-lexical-grammar.html#table-white-space-code-points">Table 30</a></emu-xref>. The sequence <CR><LF> is commonly used as a line terminator. It should be considered a single <emu-nt id="_ref_19689"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> for the purpose of reporting line numbers.</p>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="LineTerminator" type="lexical" id="prod-LineTerminator">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="eznvjwhz">
|
||
<emu-gprose><LF></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="q1yr1eki">
|
||
<emu-gprose><CR></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="eaiqsw9w">
|
||
<emu-gprose><LS></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="z8h10fxn">
|
||
<emu-gprose><PS></emu-gprose>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="LineTerminatorSequence" type="lexical" id="prod-LineTerminatorSequence">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="eznvjwhz">
|
||
<emu-gprose><LF></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="hiltsszk">
|
||
<emu-gprose><CR></emu-gprose>
|
||
<emu-gann>[lookahead ≠ <emu-gprose><LF></emu-gprose>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="eaiqsw9w">
|
||
<emu-gprose><LS></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="z8h10fxn">
|
||
<emu-gprose><PS></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="lajs7kyd">
|
||
<emu-gprose><CR></emu-gprose>
|
||
<emu-gprose><LF></emu-gprose>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-comments">
|
||
<h1><span class="secnum">12.4</span> Comments</h1>
|
||
<p>Comments can be either single or multi-line. Multi-line comments cannot nest.</p>
|
||
<p>Because a single-line comment can contain any Unicode code point except a <emu-nt id="_ref_19690"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> code point, and because of the general rule that a token is always as long as possible, a single-line comment always consists of all code points from the <code>//</code> marker to the end of the line. However, the <emu-nt id="_ref_19691"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> at the end of the line is not considered to be part of the single-line comment; it is recognized separately by the lexical grammar and becomes part of the stream of input elements for the syntactic grammar. This point is very important, because it implies that the presence or absence of single-line comments does not affect the process of automatic semicolon insertion (see <emu-xref href="#sec-automatic-semicolon-insertion" id="_ref_367"><a href="ecmascript-language-lexical-grammar.html#sec-automatic-semicolon-insertion">12.10</a></emu-xref>).</p>
|
||
<p>Comments behave like white space and are discarded except that, if a <emu-nt id="_ref_19692"><a href="ecmascript-language-lexical-grammar.html#prod-MultiLineComment">MultiLineComment</a></emu-nt> contains a line terminator code point, then the entire comment is considered to be a <emu-nt id="_ref_19693"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> for purposes of parsing by the syntactic grammar.</p>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="Comment" type="lexical" id="prod-Comment">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-Comment">Comment</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="sieyeref">
|
||
<emu-nt id="_ref_19694"><a href="ecmascript-language-lexical-grammar.html#prod-MultiLineComment">MultiLineComment</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="sscrkqcd">
|
||
<emu-nt id="_ref_19695"><a href="ecmascript-language-lexical-grammar.html#prod-SingleLineComment">SingleLineComment</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="MultiLineComment" type="lexical" id="prod-MultiLineComment">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-MultiLineComment">MultiLineComment</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="hhzm60cr">
|
||
<emu-t>/*</emu-t>
|
||
<emu-nt optional="" id="_ref_19696"><a href="ecmascript-language-lexical-grammar.html#prod-MultiLineCommentChars">MultiLineCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-t>*/</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="MultiLineCommentChars" type="lexical" id="prod-MultiLineCommentChars">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-MultiLineCommentChars">MultiLineCommentChars</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="jkbv-8n6">
|
||
<emu-nt id="_ref_19697"><a href="ecmascript-language-lexical-grammar.html#prod-MultiLineNotAsteriskChar">MultiLineNotAsteriskChar</a></emu-nt>
|
||
<emu-nt optional="" id="_ref_19698"><a href="ecmascript-language-lexical-grammar.html#prod-MultiLineCommentChars">MultiLineCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="b8trwjej">
|
||
<emu-t>*</emu-t>
|
||
<emu-nt optional="" id="_ref_19699"><a href="ecmascript-language-lexical-grammar.html#prod-PostAsteriskCommentChars">PostAsteriskCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="PostAsteriskCommentChars" type="lexical" id="prod-PostAsteriskCommentChars">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-PostAsteriskCommentChars">PostAsteriskCommentChars</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="jwfqbwpm">
|
||
<emu-nt id="_ref_19700"><a href="ecmascript-language-lexical-grammar.html#prod-MultiLineNotForwardSlashOrAsteriskChar">MultiLineNotForwardSlashOrAsteriskChar</a></emu-nt>
|
||
<emu-nt optional="" id="_ref_19701"><a href="ecmascript-language-lexical-grammar.html#prod-MultiLineCommentChars">MultiLineCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="b8trwjej">
|
||
<emu-t>*</emu-t>
|
||
<emu-nt optional="" id="_ref_19702"><a href="ecmascript-language-lexical-grammar.html#prod-PostAsteriskCommentChars">PostAsteriskCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="MultiLineNotAsteriskChar" type="lexical" id="prod-MultiLineNotAsteriskChar">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-MultiLineNotAsteriskChar">MultiLineNotAsteriskChar</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="lflef8ko">
|
||
<emu-nt id="_ref_19703"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not <emu-t>*</emu-t></emu-gmod>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="MultiLineNotForwardSlashOrAsteriskChar" type="lexical" id="prod-MultiLineNotForwardSlashOrAsteriskChar">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-MultiLineNotForwardSlashOrAsteriskChar">MultiLineNotForwardSlashOrAsteriskChar</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="hdfnrv5z">
|
||
<emu-nt id="_ref_19704"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-t>/</emu-t> or <emu-t>*</emu-t></emu-gmod>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleLineComment" type="lexical" id="prod-SingleLineComment">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-SingleLineComment">SingleLineComment</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="u-3whel6">
|
||
<emu-t>//</emu-t>
|
||
<emu-nt optional="" id="_ref_19705"><a href="ecmascript-language-lexical-grammar.html#prod-SingleLineCommentChars">SingleLineCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleLineCommentChars" type="lexical" id="prod-SingleLineCommentChars">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-SingleLineCommentChars">SingleLineCommentChars</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="rshuryvh">
|
||
<emu-nt id="_ref_19706"><a href="ecmascript-language-lexical-grammar.html#prod-SingleLineCommentChar">SingleLineCommentChar</a></emu-nt>
|
||
<emu-nt optional="" id="_ref_19707"><a href="ecmascript-language-lexical-grammar.html#prod-SingleLineCommentChars">SingleLineCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleLineCommentChar" type="lexical" id="prod-SingleLineCommentChar">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-SingleLineCommentChar">SingleLineCommentChar</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="lvvfp8iw">
|
||
<emu-nt id="_ref_19708"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not <emu-nt id="_ref_19709"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<p>A number of productions in this section are given alternative definitions in section <emu-xref href="#sec-html-like-comments" id="_ref_368"><a href="additional-ecmascript-features-for-web-browsers.html#sec-html-like-comments">B.1.1</a></emu-xref></p>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-hashbang">
|
||
<h1><span class="secnum">12.5</span> Hashbang Comments</h1>
|
||
|
||
<p>Hashbang Comments are location-sensitive and like other types of comments are discarded from the stream of input elements for the syntactic grammar.</p>
|
||
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="HashbangComment" type="lexical" id="prod-HashbangComment">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HashbangComment">HashbangComment</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="jrptdok4">
|
||
<emu-t>#!</emu-t>
|
||
<emu-nt optional="" id="_ref_19710"><a href="ecmascript-language-lexical-grammar.html#prod-SingleLineCommentChars">SingleLineCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-tokens">
|
||
<h1><span class="secnum">12.6</span> Tokens</h1>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="CommonToken" type="lexical" id="prod-CommonToken">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-CommonToken">CommonToken</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="drsx4tka">
|
||
<emu-nt id="_ref_19711"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ie2-zc1c">
|
||
<emu-nt id="_ref_19712"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="7hjz1m8p">
|
||
<emu-nt id="_ref_19713"><a href="ecmascript-language-lexical-grammar.html#prod-Punctuator">Punctuator</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="pui0b1rt">
|
||
<emu-nt id="_ref_19714"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteral">NumericLiteral</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="xhtltz00">
|
||
<emu-nt id="_ref_19715"><a href="ecmascript-language-lexical-grammar.html#prod-StringLiteral">StringLiteral</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="psgubhwn">
|
||
<emu-nt id="_ref_19716"><a href="ecmascript-language-lexical-grammar.html#prod-Template">Template</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>The <emu-nt id="_ref_19717"><a href="ecmascript-language-lexical-grammar.html#prod-DivPunctuator">DivPunctuator</a></emu-nt>, <emu-nt id="_ref_19718"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt>, <emu-nt id="_ref_19719"><a href="ecmascript-language-lexical-grammar.html#prod-RightBracePunctuator">RightBracePunctuator</a></emu-nt>, and <emu-nt id="_ref_19720"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateSubstitutionTail">TemplateSubstitutionTail</a></emu-nt> productions derive additional tokens that are not included in the <emu-nt id="_ref_19721"><a href="ecmascript-language-lexical-grammar.html#prod-CommonToken">CommonToken</a></emu-nt> production.</p>
|
||
</div></emu-note>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-names-and-keywords">
|
||
<h1><span class="secnum">12.7</span> Names and Keywords</h1>
|
||
<p><emu-nt id="_ref_19722"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt> and <emu-nt id="_ref_19723"><a href="ecmascript-language-lexical-grammar.html#prod-ReservedWord">ReservedWord</a></emu-nt> are tokens that are interpreted according to the Default Identifier Syntax given in Unicode Standard Annex #31, Identifier and Pattern Syntax, with some small modifications. <emu-nt id="_ref_19724"><a href="ecmascript-language-lexical-grammar.html#prod-ReservedWord">ReservedWord</a></emu-nt> is an enumerated subset of <emu-nt id="_ref_19725"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>. The syntactic grammar defines <emu-nt id="_ref_19726"><a href="ecmascript-language-expressions.html#prod-Identifier">Identifier</a></emu-nt> as an <emu-nt id="_ref_19727"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt> that is not a <emu-nt id="_ref_19728"><a href="ecmascript-language-lexical-grammar.html#prod-ReservedWord">ReservedWord</a></emu-nt>. The Unicode identifier grammar is based on character properties specified by the Unicode Standard. The Unicode code points in the specified categories in the latest version of the Unicode Standard must be treated as in those categories by all conforming ECMAScript implementations. ECMAScript implementations may recognize identifier code points defined in later editions of the Unicode Standard.</p>
|
||
<emu-note><span class="note">Note 1</span><div class="note-contents">
|
||
<p>This standard specifies specific code point additions: U+0024 (DOLLAR SIGN) and U+005F (LOW LINE) are permitted anywhere in an <emu-nt id="_ref_19729"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>.</p>
|
||
</div></emu-note>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="PrivateIdentifier" type="lexical" id="prod-PrivateIdentifier">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="echyiakf" id="prod-j40wR5UN">
|
||
<emu-t>#</emu-t>
|
||
<emu-nt id="_ref_19730"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="IdentifierName" type="lexical" id="prod-IdentifierName">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="q0afq8g8" id="prod-NFOBX-lw">
|
||
<emu-nt id="_ref_19731"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierStart">IdentifierStart</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="cawc7ktu" id="prod-dbXHPjzF">
|
||
<emu-nt id="_ref_19732"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>
|
||
<emu-nt id="_ref_19733"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierPart">IdentifierPart</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="IdentifierStart" type="lexical" id="prod-IdentifierStart">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierStart">IdentifierStart</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="scjzw6a_" id="prod-XMog322C">
|
||
<emu-nt id="_ref_19734"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierStartChar">IdentifierStartChar</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="b7ylgc5w">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_19735"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="IdentifierPart" type="lexical" id="prod-IdentifierPart">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierPart">IdentifierPart</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="q3hdl-qt" id="prod-ba_xP9Ao">
|
||
<emu-nt id="_ref_19736"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierPartChar">IdentifierPartChar</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="b7ylgc5w">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_19737"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="IdentifierStartChar" type="lexical" id="prod-IdentifierStartChar">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierStartChar">IdentifierStartChar</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="cgljdgmz">
|
||
<emu-nt id="_ref_19738"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeIDStart">UnicodeIDStart</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="emlmkqfm">
|
||
<emu-t>$</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="b1zllonv">
|
||
<emu-t>_</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="IdentifierPartChar" type="lexical" id="prod-IdentifierPartChar">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierPartChar">IdentifierPartChar</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="nkrgdqi0">
|
||
<emu-nt id="_ref_19739"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeIDContinue">UnicodeIDContinue</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="emlmkqfm">
|
||
<emu-t>$</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="AsciiLetter" type="lexical" oneof="" id="prod-AsciiLetter">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-AsciiLetter">AsciiLetter</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>a</emu-t> <emu-t>b</emu-t> <emu-t>c</emu-t> <emu-t>d</emu-t> <emu-t>e</emu-t> <emu-t>f</emu-t> <emu-t>g</emu-t> <emu-t>h</emu-t> <emu-t>i</emu-t> <emu-t>j</emu-t> <emu-t>k</emu-t> <emu-t>l</emu-t> <emu-t>m</emu-t> <emu-t>n</emu-t> <emu-t>o</emu-t> <emu-t>p</emu-t> <emu-t>q</emu-t> <emu-t>r</emu-t> <emu-t>s</emu-t> <emu-t>t</emu-t> <emu-t>u</emu-t> <emu-t>v</emu-t> <emu-t>w</emu-t> <emu-t>x</emu-t> <emu-t>y</emu-t> <emu-t>z</emu-t> <emu-t>A</emu-t> <emu-t>B</emu-t> <emu-t>C</emu-t> <emu-t>D</emu-t> <emu-t>E</emu-t> <emu-t>F</emu-t> <emu-t>G</emu-t> <emu-t>H</emu-t> <emu-t>I</emu-t> <emu-t>J</emu-t> <emu-t>K</emu-t> <emu-t>L</emu-t> <emu-t>M</emu-t> <emu-t>N</emu-t> <emu-t>O</emu-t> <emu-t>P</emu-t> <emu-t>Q</emu-t> <emu-t>R</emu-t> <emu-t>S</emu-t> <emu-t>T</emu-t> <emu-t>U</emu-t> <emu-t>V</emu-t> <emu-t>W</emu-t> <emu-t>X</emu-t> <emu-t>Y</emu-t> <emu-t>Z</emu-t></emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="UnicodeIDStart" type="lexical" id="prod-UnicodeIDStart">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeIDStart">UnicodeIDStart</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="5b8wyfgv">
|
||
<emu-gprose>any Unicode code point with the Unicode property “ID_Start”</emu-gprose>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="UnicodeIDContinue" type="lexical" id="prod-UnicodeIDContinue">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeIDContinue">UnicodeIDContinue</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="2xrubxc8">
|
||
<emu-gprose>any Unicode code point with the Unicode property “ID_Continue”</emu-gprose>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<p>The definitions of the nonterminal <emu-nt id="_ref_19740"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt> is given in <emu-xref href="#sec-literals-string-literals" id="_ref_369"><a href="ecmascript-language-lexical-grammar.html#sec-literals-string-literals">12.9.4</a></emu-xref>.</p>
|
||
<emu-note><span class="note">Note 2</span><div class="note-contents">
|
||
<p>The nonterminal <emu-nt id="_ref_19741"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierPart">IdentifierPart</a></emu-nt> derives <code>_</code> via <emu-nt id="_ref_19742"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeIDContinue">UnicodeIDContinue</a></emu-nt>.</p>
|
||
</div></emu-note>
|
||
<emu-note><span class="note">Note 3</span><div class="note-contents">
|
||
<p>The sets of code points with Unicode properties “ID_Start” and “ID_Continue” include, respectively, the code points with Unicode properties “Other_ID_Start” and “Other_ID_Continue”.</p>
|
||
</div></emu-note>
|
||
|
||
<emu-clause id="sec-identifier-names">
|
||
<h1><span class="secnum">12.7.1</span> Identifier Names</h1>
|
||
<p>Unicode escape sequences are permitted in an <emu-nt id="_ref_19743"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>, where they contribute a single Unicode code point equal to the <emu-xref aoid="IdentifierCodePoint" id="_ref_5873"><a href="ecmascript-language-lexical-grammar.html#sec-identifiercodepoint">IdentifierCodePoint</a></emu-xref> of the <emu-nt id="_ref_19744"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt>. The <code>\</code> preceding the <emu-nt id="_ref_19745"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt> does not contribute any code points. A <emu-nt id="_ref_19746"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt> cannot be used to contribute a code point to an <emu-nt id="_ref_19747"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt> that would otherwise be invalid. In other words, if a <code>\</code> <emu-nt id="_ref_19748"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt> sequence were replaced by the <emu-nt id="_ref_19749"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> it contributes, the result must still be a valid <emu-nt id="_ref_19750"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt> that has the exact same sequence of <emu-nt id="_ref_19751"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> elements as the original <emu-nt id="_ref_19752"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>. All interpretations of <emu-nt id="_ref_19753"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt> within this specification are based upon their actual code points regardless of whether or not an escape sequence was used to contribute any particular code point.</p>
|
||
<p>Two <emu-nt id="_ref_19754"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>s that are canonically equivalent according to the Unicode Standard are <em>not</em> equal unless, after replacement of each <emu-nt id="_ref_19755"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt>, they are represented by the exact same sequence of code points.</p>
|
||
|
||
<emu-clause id="sec-identifier-names-static-semantics-early-errors">
|
||
<h1><span class="secnum">12.7.1.1</span> Static Semantics: Early Errors</h1>
|
||
<emu-grammar><emu-production name="IdentifierStart" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierStart">IdentifierStart</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="b7ylgc5w">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_19756"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<ul>
|
||
<li>
|
||
It is a Syntax Error if the <emu-xref aoid="IdentifierCodePoint" id="_ref_5874"><a href="ecmascript-language-lexical-grammar.html#sec-identifiercodepoint">IdentifierCodePoint</a></emu-xref> of <emu-nt id="_ref_19757"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt> is not some Unicode code point matched by the <emu-nt id="_ref_19758"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierStartChar">IdentifierStartChar</a></emu-nt> lexical grammar production.
|
||
</li>
|
||
</ul>
|
||
<emu-grammar><emu-production name="IdentifierPart" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierPart">IdentifierPart</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="b7ylgc5w">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_19759"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<ul>
|
||
<li>
|
||
It is a Syntax Error if the <emu-xref aoid="IdentifierCodePoint" id="_ref_5875"><a href="ecmascript-language-lexical-grammar.html#sec-identifiercodepoint">IdentifierCodePoint</a></emu-xref> of <emu-nt id="_ref_19760"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt> is not some Unicode code point matched by the <emu-nt id="_ref_19761"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierPartChar">IdentifierPartChar</a></emu-nt> lexical grammar production.
|
||
</li>
|
||
</ul>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-identifiercodepoints" type="sdo" aoid="IdentifierCodePoints">
|
||
<h1><span class="secnum">12.7.1.2</span> Static Semantics: IdentifierCodePoints</h1>
|
||
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_5876"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> IdentifierCodePoints takes no arguments and returns a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_5877"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of code points. It is defined piecewise over the following productions:</p>
|
||
<emu-grammar><emu-production name="IdentifierName" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="q0afq8g8" id="prod-NbI37jnW"><emu-nt id="_ref_19762"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierStart">IdentifierStart</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Let <var>cp</var> be the <emu-xref aoid="IdentifierCodePoint" id="_ref_5878"><a href="ecmascript-language-lexical-grammar.html#sec-identifiercodepoint">IdentifierCodePoint</a></emu-xref> of <emu-nt id="_ref_19763"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierStart">IdentifierStart</a></emu-nt>.</li><li>Return « <var>cp</var> ».</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="IdentifierName" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="cawc7ktu" id="prod-VGIPQeJb">
|
||
<emu-nt id="_ref_19764"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>
|
||
<emu-nt id="_ref_19765"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierPart">IdentifierPart</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Let <var>cps</var> be the <emu-xref aoid="IdentifierCodePoints" id="_ref_5879"><a href="ecmascript-language-lexical-grammar.html#sec-identifiercodepoints">IdentifierCodePoints</a></emu-xref> of the derived <emu-nt id="_ref_19766"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>.</li><li>Let <var>cp</var> be the <emu-xref aoid="IdentifierCodePoint" id="_ref_5880"><a href="ecmascript-language-lexical-grammar.html#sec-identifiercodepoint">IdentifierCodePoint</a></emu-xref> of <emu-nt id="_ref_19767"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierPart">IdentifierPart</a></emu-nt>.</li><li>Return the <emu-xref href="#list-concatenation" id="_ref_5881"><a href="ecmascript-data-types-and-values.html#list-concatenation">list-concatenation</a></emu-xref> of <var>cps</var> and « <var>cp</var> ».</li></ol></emu-alg>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-identifiercodepoint" type="sdo" aoid="IdentifierCodePoint">
|
||
<h1><span class="secnum">12.7.1.3</span> Static Semantics: IdentifierCodePoint</h1>
|
||
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_5882"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> IdentifierCodePoint takes no arguments and returns a code point. It is defined piecewise over the following productions:</p>
|
||
<emu-grammar><emu-production name="IdentifierStart" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierStart">IdentifierStart</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="scjzw6a_" id="prod-KPs_9x-C"><emu-nt id="_ref_19768"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierStartChar">IdentifierStartChar</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return the code point matched by <emu-nt id="_ref_19769"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierStartChar">IdentifierStartChar</a></emu-nt>.</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="IdentifierPart" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierPart">IdentifierPart</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="q3hdl-qt" id="prod-fncA2sGb"><emu-nt id="_ref_19770"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierPartChar">IdentifierPartChar</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return the code point matched by <emu-nt id="_ref_19771"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierPartChar">IdentifierPartChar</a></emu-nt>.</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="UnicodeEscapeSequence" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ghktjvoi" id="prod-Ju5Gi-Fv">
|
||
<emu-t>u</emu-t>
|
||
<emu-nt id="_ref_19772"><a href="ecmascript-language-lexical-grammar.html#prod-Hex4Digits">Hex4Digits</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return the code point whose numeric value is the MV of <emu-nt id="_ref_19773"><a href="ecmascript-language-lexical-grammar.html#prod-Hex4Digits">Hex4Digits</a></emu-nt>.</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="UnicodeEscapeSequence" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="uybj7_dt" id="prod-XpfJkBRq">
|
||
<emu-t>u{</emu-t>
|
||
<emu-nt id="_ref_19774"><a href="ecmascript-language-lexical-grammar.html#prod-CodePoint">CodePoint</a></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return the code point whose numeric value is the MV of <emu-nt id="_ref_19775"><a href="ecmascript-language-lexical-grammar.html#prod-CodePoint">CodePoint</a></emu-nt>.</li></ol></emu-alg>
|
||
</emu-clause>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-keywords-and-reserved-words" oldids="sec-reserved-words,sec-keywords,sec-future-reserved-words"><span id="sec-future-reserved-words"></span><span id="sec-keywords"></span><span id="sec-reserved-words"></span>
|
||
<h1><span class="secnum">12.7.2</span> Keywords and Reserved Words</h1>
|
||
<p>A <dfn variants="keywords" tabindex="-1">keyword</dfn> is a token that matches <emu-nt id="_ref_19776"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>, but also has a syntactic use; that is, it appears literally, in a <code>fixed width</code> font, in some syntactic production. The keywords of ECMAScript include <code>if</code>, <code>while</code>, <code>async</code>, <code>await</code>, and many others.</p>
|
||
<p>A <dfn variants="reserved words" tabindex="-1">reserved word</dfn> is an <emu-nt id="_ref_19777"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt> that cannot be used as an identifier. Many keywords are reserved words, but some are not, and some are reserved only in certain contexts. <code>if</code> and <code>while</code> are reserved words. <code>await</code> is reserved only inside async functions and modules. <code>async</code> is not reserved; it can be used as a variable name or statement label without restriction.</p>
|
||
<p>This specification uses a combination of grammatical productions and <emu-xref href="#early-error" id="_ref_5883"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref> rules to specify which names are valid identifiers and which are reserved words. All tokens in the <emu-nt id="_ref_19778"><a href="ecmascript-language-lexical-grammar.html#prod-ReservedWord">ReservedWord</a></emu-nt> list below, except for <code>await</code> and <code>yield</code>, are unconditionally reserved. Exceptions for <code>await</code> and <code>yield</code> are specified in <emu-xref href="#sec-identifiers" id="_ref_370"><a href="ecmascript-language-expressions.html#sec-identifiers">13.1</a></emu-xref>, using parameterized syntactic productions. Lastly, several <emu-xref href="#early-error" id="_ref_5884"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref> rules restrict the set of valid identifiers. See <emu-xref href="#sec-identifiers-static-semantics-early-errors" id="_ref_371"><a href="ecmascript-language-expressions.html#sec-identifiers-static-semantics-early-errors">13.1.1</a></emu-xref>, <emu-xref href="#sec-let-and-const-declarations-static-semantics-early-errors" id="_ref_372"><a href="ecmascript-language-statements-and-declarations.html#sec-let-and-const-declarations-static-semantics-early-errors">14.3.1.1</a></emu-xref>, <emu-xref href="#sec-for-in-and-for-of-statements-static-semantics-early-errors" id="_ref_373"><a href="ecmascript-language-statements-and-declarations.html#sec-for-in-and-for-of-statements-static-semantics-early-errors">14.7.5.1</a></emu-xref>, and <emu-xref href="#sec-class-definitions-static-semantics-early-errors" id="_ref_374"><a href="ecmascript-language-functions-and-classes.html#sec-class-definitions-static-semantics-early-errors">15.7.1</a></emu-xref>. In summary, there are five categories of identifier names:</p>
|
||
<ul>
|
||
<li>
|
||
<p>Those that are always allowed as identifiers, and are not keywords, such as <code>Math</code>, <code>window</code>, <code>toString</code>, and <code>_</code>;</p>
|
||
</li>
|
||
<li>
|
||
<p>Those that are never allowed as identifiers, namely the <emu-nt id="_ref_19779"><a href="ecmascript-language-lexical-grammar.html#prod-ReservedWord">ReservedWord</a></emu-nt>s listed below except <code>await</code> and <code>yield</code>;</p>
|
||
</li>
|
||
<li>
|
||
<p>Those that are contextually allowed as identifiers, namely <code>await</code> and <code>yield</code>;</p>
|
||
</li>
|
||
<li>
|
||
<p>Those that are contextually disallowed as identifiers, in <emu-xref href="#sec-strict-mode-code" id="_ref_5885"><a href="ecmascript-language-source-code.html#sec-strict-mode-code">strict mode code</a></emu-xref>: <code>let</code>, <code>static</code>, <code>implements</code>, <code>interface</code>, <code>package</code>, <code>private</code>, <code>protected</code>, and <code>public</code>;</p>
|
||
</li>
|
||
<li>
|
||
<p>Those that are always allowed as identifiers, but also appear as keywords within certain syntactic productions, at places where <emu-nt id="_ref_19780"><a href="ecmascript-language-expressions.html#prod-Identifier">Identifier</a></emu-nt> is not allowed: <code>as</code>, <code>async</code>, <code>from</code>, <code>get</code>, <code>meta</code>, <code>of</code>, <code>set</code>, and <code>target</code>.</p>
|
||
</li>
|
||
</ul>
|
||
<p>The term <dfn variants="conditional keywords" tabindex="-1">conditional keyword</dfn>, or <dfn variants="contextual keywords" tabindex="-1">contextual keyword</dfn>, is sometimes used to refer to the keywords that fall in the last three categories, and thus can be used as identifiers in some contexts and as keywords in others.</p>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="ReservedWord" type="lexical" oneof="" id="prod-ReservedWord">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-ReservedWord">ReservedWord</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>await</emu-t> <emu-t>break</emu-t> <emu-t>case</emu-t> <emu-t>catch</emu-t> <emu-t>class</emu-t> <emu-t>const</emu-t> <emu-t>continue</emu-t> <emu-t>debugger</emu-t> <emu-t>default</emu-t> <emu-t>delete</emu-t> <emu-t>do</emu-t> <emu-t>else</emu-t> <emu-t>enum</emu-t> <emu-t>export</emu-t> <emu-t>extends</emu-t> <emu-t>false</emu-t> <emu-t>finally</emu-t> <emu-t>for</emu-t> <emu-t>function</emu-t> <emu-t>if</emu-t> <emu-t>import</emu-t> <emu-t>in</emu-t> <emu-t>instanceof</emu-t> <emu-t>new</emu-t> <emu-t>null</emu-t> <emu-t>return</emu-t> <emu-t>super</emu-t> <emu-t>switch</emu-t> <emu-t>this</emu-t> <emu-t>throw</emu-t> <emu-t>true</emu-t> <emu-t>try</emu-t> <emu-t>typeof</emu-t> <emu-t>var</emu-t> <emu-t>void</emu-t> <emu-t>while</emu-t> <emu-t>with</emu-t> <emu-t>yield</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-note><span class="note">Note 1</span><div class="note-contents">
|
||
<p>Per <emu-xref href="#sec-grammar-notation" id="_ref_375"><a href="notational-conventions.html#sec-grammar-notation">5.1.5</a></emu-xref>, keywords in the grammar match literal sequences of specific <emu-nt id="_ref_19781"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> elements. A code point in a keyword cannot be expressed by a <code>\</code> <emu-nt id="_ref_19782"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt>.</p>
|
||
<p>An <emu-nt id="_ref_19783"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt> can contain <code>\</code> <emu-nt id="_ref_19784"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt>s, but it is not possible to declare a variable named "else" by spelling it <code>els\u{65}</code>. The <emu-xref href="#early-error" id="_ref_5886"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref> rules in <emu-xref href="#sec-identifiers-static-semantics-early-errors" id="_ref_376"><a href="ecmascript-language-expressions.html#sec-identifiers-static-semantics-early-errors">13.1.1</a></emu-xref> rule out identifiers with the same <emu-xref aoid="StringValue" id="_ref_5887"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> as a reserved word.</p>
|
||
</div></emu-note>
|
||
<emu-note><span class="note">Note 2</span><div class="note-contents">
|
||
<p><code>enum</code> is not currently used as a keyword in this specification. It is a <em>future reserved word</em>, set aside for use as a keyword in future language extensions.</p>
|
||
<p>Similarly, <code>implements</code>, <code>interface</code>, <code>package</code>, <code>private</code>, <code>protected</code>, and <code>public</code> are future reserved words in <emu-xref href="#sec-strict-mode-code" id="_ref_5888"><a href="ecmascript-language-source-code.html#sec-strict-mode-code">strict mode code</a></emu-xref>.</p>
|
||
</div></emu-note>
|
||
<emu-note><span class="note">Note 3</span><div class="note-contents">
|
||
<p>The names <code>arguments</code> and <code>eval</code> are not keywords, but they are subject to some restrictions in <emu-xref href="#sec-strict-mode-code" id="_ref_5889"><a href="ecmascript-language-source-code.html#sec-strict-mode-code">strict mode code</a></emu-xref>. See <emu-xref href="#sec-identifiers-static-semantics-early-errors" id="_ref_377"><a href="ecmascript-language-expressions.html#sec-identifiers-static-semantics-early-errors">13.1.1</a></emu-xref>, <emu-xref href="#sec-static-semantics-assignmenttargettype" id="_ref_378"><a href="syntax-directed-operations.html#sec-static-semantics-assignmenttargettype">8.6.4</a></emu-xref>, <emu-xref href="#sec-function-definitions-static-semantics-early-errors" id="_ref_379"><a href="ecmascript-language-functions-and-classes.html#sec-function-definitions-static-semantics-early-errors">15.2.1</a></emu-xref>, <emu-xref href="#sec-generator-function-definitions-static-semantics-early-errors" id="_ref_380"><a href="ecmascript-language-functions-and-classes.html#sec-generator-function-definitions-static-semantics-early-errors">15.5.1</a></emu-xref>, <emu-xref href="#sec-async-generator-function-definitions-static-semantics-early-errors" id="_ref_381"><a href="ecmascript-language-functions-and-classes.html#sec-async-generator-function-definitions-static-semantics-early-errors">15.6.1</a></emu-xref>, and <emu-xref href="#sec-async-function-definitions-static-semantics-early-errors" id="_ref_382"><a href="ecmascript-language-functions-and-classes.html#sec-async-function-definitions-static-semantics-early-errors">15.8.1</a></emu-xref>.</p>
|
||
</div></emu-note>
|
||
</emu-clause>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-punctuators">
|
||
<h1><span class="secnum">12.8</span> Punctuators</h1>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="Punctuator" type="lexical" id="prod-Punctuator">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-Punctuator">Punctuator</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="kgn-m1wb">
|
||
<emu-nt id="_ref_19785"><a href="ecmascript-language-lexical-grammar.html#prod-OptionalChainingPunctuator">OptionalChainingPunctuator</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="5laghqp7">
|
||
<emu-nt id="_ref_19786"><a href="ecmascript-language-lexical-grammar.html#prod-OtherPunctuator">OtherPunctuator</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="OptionalChainingPunctuator" type="lexical" id="prod-OptionalChainingPunctuator">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-OptionalChainingPunctuator">OptionalChainingPunctuator</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="imymz5qn">
|
||
<emu-t>?.</emu-t>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_19787"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="OtherPunctuator" type="lexical" oneof="" id="prod-OtherPunctuator">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-OtherPunctuator">OtherPunctuator</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>{</emu-t> <emu-t>(</emu-t> <emu-t>)</emu-t> <emu-t>[</emu-t> <emu-t>]</emu-t> <emu-t>.</emu-t> <emu-t>...</emu-t> <emu-t>;</emu-t> <emu-t>,</emu-t> <emu-t><</emu-t> <emu-t>></emu-t> <emu-t><=</emu-t> <emu-t>>=</emu-t> <emu-t>==</emu-t> <emu-t>!=</emu-t> <emu-t>===</emu-t> <emu-t>!==</emu-t> <emu-t>+</emu-t> <emu-t>-</emu-t> <emu-t>*</emu-t> <emu-t>%</emu-t> <emu-t>**</emu-t> <emu-t>++</emu-t> <emu-t>--</emu-t> <emu-t><<</emu-t> <emu-t>>></emu-t> <emu-t>>>></emu-t> <emu-t>&</emu-t> <emu-t>|</emu-t> <emu-t>^</emu-t> <emu-t>!</emu-t> <emu-t>~</emu-t> <emu-t>&&</emu-t> <emu-t>||</emu-t> <emu-t>??</emu-t> <emu-t>?</emu-t> <emu-t>:</emu-t> <emu-t>=</emu-t> <emu-t>+=</emu-t> <emu-t>-=</emu-t> <emu-t>*=</emu-t> <emu-t>%=</emu-t> <emu-t>**=</emu-t> <emu-t><<=</emu-t> <emu-t>>>=</emu-t> <emu-t>>>>=</emu-t> <emu-t>&=</emu-t> <emu-t>|=</emu-t> <emu-t>^=</emu-t> <emu-t>&&=</emu-t> <emu-t>||=</emu-t> <emu-t>??=</emu-t> <emu-t>=></emu-t></emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="DivPunctuator" type="lexical" id="prod-DivPunctuator">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DivPunctuator">DivPunctuator</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="0_1fu2p8">
|
||
<emu-t>/</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="lgd_45yr">
|
||
<emu-t>/=</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="RightBracePunctuator" type="lexical" id="prod-RightBracePunctuator">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RightBracePunctuator">RightBracePunctuator</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="jvy3_tcq">
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-ecmascript-language-lexical-grammar-literals">
|
||
<h1><span class="secnum">12.9</span> Literals</h1>
|
||
|
||
<emu-clause id="sec-null-literals">
|
||
<h1><span class="secnum">12.9.1</span> Null Literals</h1>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="NullLiteral" type="lexical" id="prod-NullLiteral">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NullLiteral">NullLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="d7uiab7a">
|
||
<emu-t>null</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-boolean-literals">
|
||
<h1><span class="secnum">12.9.2</span> Boolean Literals</h1>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="BooleanLiteral" type="lexical" id="prod-BooleanLiteral">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-BooleanLiteral">BooleanLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="-jc4xg27">
|
||
<emu-t>true</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="i9lgnxtt">
|
||
<emu-t>false</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-literals-numeric-literals" oldids="sec-additional-syntax-numeric-literals"><span id="sec-additional-syntax-numeric-literals"></span>
|
||
<h1><span class="secnum">12.9.3</span> Numeric Literals</h1>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="NumericLiteralSeparator" type="lexical" id="prod-NumericLiteralSeparator">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="b1zllonv">
|
||
<emu-t>_</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="NumericLiteral" type="lexical" id="prod-NumericLiteral">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteral">NumericLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="gma1bw5s" id="prod-Qn_oyvq2">
|
||
<emu-nt id="_ref_19788"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalLiteral">DecimalLiteral</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="jyfxftca">
|
||
<emu-nt id="_ref_19789"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalBigIntegerLiteral">DecimalBigIntegerLiteral</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="4meg50av" id="prod-U27qMVVP">
|
||
<emu-nt params="+Sep" id="_ref_19790"><a href="ecmascript-language-lexical-grammar.html#prod-NonDecimalIntegerLiteral">NonDecimalIntegerLiteral</a><emu-mods><emu-params>[+Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="5kjl_usk" id="prod-lP2MlcII">
|
||
<emu-nt params="+Sep" id="_ref_19791"><a href="ecmascript-language-lexical-grammar.html#prod-NonDecimalIntegerLiteral">NonDecimalIntegerLiteral</a><emu-mods><emu-params>[+Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_19792"><a href="ecmascript-language-lexical-grammar.html#prod-BigIntLiteralSuffix">BigIntLiteralSuffix</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="8n96hykg" id="prod-9vicHpLh">
|
||
<emu-nt id="_ref_19793"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalIntegerLiteral">LegacyOctalIntegerLiteral</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="DecimalBigIntegerLiteral" type="lexical" id="prod-DecimalBigIntegerLiteral">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalBigIntegerLiteral">DecimalBigIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="3e5icnkp" id="prod-v-a6rh2w">
|
||
<emu-t>0</emu-t>
|
||
<emu-nt id="_ref_19794"><a href="ecmascript-language-lexical-grammar.html#prod-BigIntLiteralSuffix">BigIntLiteralSuffix</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="s5lsf_yj" id="prod-b9VW4Mn-">
|
||
<emu-nt id="_ref_19795"><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt>
|
||
<emu-nt params="+Sep" optional="" id="_ref_19796"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[+Sep]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_19797"><a href="ecmascript-language-lexical-grammar.html#prod-BigIntLiteralSuffix">BigIntLiteralSuffix</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="dpnxe4_1" id="prod-fgQ6BNSW">
|
||
<emu-nt id="_ref_19798"><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt>
|
||
<emu-nt id="_ref_19799"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>
|
||
<emu-nt params="+Sep" id="_ref_19800"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[+Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_19801"><a href="ecmascript-language-lexical-grammar.html#prod-BigIntLiteralSuffix">BigIntLiteralSuffix</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="NonDecimalIntegerLiteral" params="Sep" type="lexical" id="prod-NonDecimalIntegerLiteral">
|
||
<emu-nt params="Sep"><a href="ecmascript-language-lexical-grammar.html#prod-NonDecimalIntegerLiteral">NonDecimalIntegerLiteral</a><emu-mods><emu-params>[Sep]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="bob8gtet">
|
||
<emu-nt params="?Sep" id="_ref_19802"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryIntegerLiteral">BinaryIntegerLiteral</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="tt6amuvr">
|
||
<emu-nt params="?Sep" id="_ref_19803"><a href="ecmascript-language-lexical-grammar.html#prod-OctalIntegerLiteral">OctalIntegerLiteral</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="c52jqkaw">
|
||
<emu-nt params="?Sep" id="_ref_19804"><a href="ecmascript-language-lexical-grammar.html#prod-HexIntegerLiteral">HexIntegerLiteral</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="BigIntLiteralSuffix" type="lexical" id="prod-BigIntLiteralSuffix">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-BigIntLiteralSuffix">BigIntLiteralSuffix</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fleftghc">
|
||
<emu-t>n</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="DecimalLiteral" type="lexical" id="prod-DecimalLiteral">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalLiteral">DecimalLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="dkpbjbga">
|
||
<emu-nt id="_ref_19805"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt>
|
||
<emu-t>.</emu-t>
|
||
<emu-nt params="+Sep" optional="" id="_ref_19806"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[+Sep]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-nt params="+Sep" optional="" id="_ref_19807"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentPart">ExponentPart</a><emu-mods><emu-params>[+Sep]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="mqovvwro">
|
||
<emu-t>.</emu-t>
|
||
<emu-nt params="+Sep" id="_ref_19808"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[+Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt params="+Sep" optional="" id="_ref_19809"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentPart">ExponentPart</a><emu-mods><emu-params>[+Sep]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="5axp8jfj">
|
||
<emu-nt id="_ref_19810"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt>
|
||
<emu-nt params="+Sep" optional="" id="_ref_19811"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentPart">ExponentPart</a><emu-mods><emu-params>[+Sep]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="DecimalIntegerLiteral" type="lexical" id="prod-DecimalIntegerLiteral">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ulmkmvlx">
|
||
<emu-t>0</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="1mot5ut_">
|
||
<emu-nt id="_ref_19812"><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="q8hj2ks6">
|
||
<emu-nt id="_ref_19813"><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt>
|
||
<emu-nt optional="" id="_ref_19814"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-nt params="+Sep" id="_ref_19815"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[+Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="xvklurnl">
|
||
<emu-nt id="_ref_19816"><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDecimalIntegerLiteral">NonOctalDecimalIntegerLiteral</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="DecimalDigits" params="Sep" type="lexical" id="prod-DecimalDigits">
|
||
<emu-nt params="Sep"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[Sep]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="s4me4hlz">
|
||
<emu-nt id="_ref_19817"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="vhziw9yj">
|
||
<emu-nt params="?Sep" id="_ref_19818"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_19819"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="o-8mes0t" constraints="+Sep"><emu-constraints>[+Sep]</emu-constraints>
|
||
<emu-nt params="+Sep" id="_ref_19820"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[+Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_19821"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>
|
||
<emu-nt id="_ref_19822"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="DecimalDigit" type="lexical" oneof="" id="prod-DecimalDigit">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>0</emu-t> <emu-t>1</emu-t> <emu-t>2</emu-t> <emu-t>3</emu-t> <emu-t>4</emu-t> <emu-t>5</emu-t> <emu-t>6</emu-t> <emu-t>7</emu-t> <emu-t>8</emu-t> <emu-t>9</emu-t></emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="NonZeroDigit" type="lexical" oneof="" id="prod-NonZeroDigit">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>1</emu-t> <emu-t>2</emu-t> <emu-t>3</emu-t> <emu-t>4</emu-t> <emu-t>5</emu-t> <emu-t>6</emu-t> <emu-t>7</emu-t> <emu-t>8</emu-t> <emu-t>9</emu-t></emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="ExponentPart" params="Sep" type="lexical" id="prod-ExponentPart">
|
||
<emu-nt params="Sep"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentPart">ExponentPart</a><emu-mods><emu-params>[Sep]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="qmupypsn">
|
||
<emu-nt id="_ref_19823"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentIndicator">ExponentIndicator</a></emu-nt>
|
||
<emu-nt params="?Sep" id="_ref_19824"><a href="ecmascript-language-lexical-grammar.html#prod-SignedInteger">SignedInteger</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="ExponentIndicator" type="lexical" oneof="" id="prod-ExponentIndicator">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-ExponentIndicator">ExponentIndicator</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>e</emu-t> <emu-t>E</emu-t></emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SignedInteger" params="Sep" type="lexical" id="prod-SignedInteger">
|
||
<emu-nt params="Sep"><a href="ecmascript-language-lexical-grammar.html#prod-SignedInteger">SignedInteger</a><emu-mods><emu-params>[Sep]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="wf-nrzcq">
|
||
<emu-nt params="?Sep" id="_ref_19825"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="luvuectp">
|
||
<emu-t>+</emu-t>
|
||
<emu-nt params="?Sep" id="_ref_19826"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="z4gitkte">
|
||
<emu-t>-</emu-t>
|
||
<emu-nt params="?Sep" id="_ref_19827"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="BinaryIntegerLiteral" params="Sep" type="lexical" id="prod-BinaryIntegerLiteral">
|
||
<emu-nt params="Sep"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryIntegerLiteral">BinaryIntegerLiteral</a><emu-mods><emu-params>[Sep]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="12yuffnr">
|
||
<emu-t>0b</emu-t>
|
||
<emu-nt params="?Sep" id="_ref_19828"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigits">BinaryDigits</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="fqezwbsj">
|
||
<emu-t>0B</emu-t>
|
||
<emu-nt params="?Sep" id="_ref_19829"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigits">BinaryDigits</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="BinaryDigits" params="Sep" type="lexical" id="prod-BinaryDigits">
|
||
<emu-nt params="Sep"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigits">BinaryDigits</a><emu-mods><emu-params>[Sep]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="5fhui2lc">
|
||
<emu-nt id="_ref_19830"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigit">BinaryDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="zwtkasqs">
|
||
<emu-nt params="?Sep" id="_ref_19831"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigits">BinaryDigits</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_19832"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigit">BinaryDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="klsleygf" constraints="+Sep"><emu-constraints>[+Sep]</emu-constraints>
|
||
<emu-nt params="+Sep" id="_ref_19833"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigits">BinaryDigits</a><emu-mods><emu-params>[+Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_19834"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>
|
||
<emu-nt id="_ref_19835"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigit">BinaryDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="BinaryDigit" type="lexical" oneof="" id="prod-BinaryDigit">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigit">BinaryDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>0</emu-t> <emu-t>1</emu-t></emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="OctalIntegerLiteral" params="Sep" type="lexical" id="prod-OctalIntegerLiteral">
|
||
<emu-nt params="Sep"><a href="ecmascript-language-lexical-grammar.html#prod-OctalIntegerLiteral">OctalIntegerLiteral</a><emu-mods><emu-params>[Sep]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="bpjym_xs">
|
||
<emu-t>0o</emu-t>
|
||
<emu-nt params="?Sep" id="_ref_19836"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigits">OctalDigits</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="otl-ec7z">
|
||
<emu-t>0O</emu-t>
|
||
<emu-nt params="?Sep" id="_ref_19837"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigits">OctalDigits</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="OctalDigits" params="Sep" type="lexical" id="prod-OctalDigits">
|
||
<emu-nt params="Sep"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigits">OctalDigits</a><emu-mods><emu-params>[Sep]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="mbwdu1ji">
|
||
<emu-nt id="_ref_19838"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="i9v7fkh2">
|
||
<emu-nt params="?Sep" id="_ref_19839"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigits">OctalDigits</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_19840"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="-vh1h3qc" constraints="+Sep"><emu-constraints>[+Sep]</emu-constraints>
|
||
<emu-nt params="+Sep" id="_ref_19841"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigits">OctalDigits</a><emu-mods><emu-params>[+Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_19842"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>
|
||
<emu-nt id="_ref_19843"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="LegacyOctalIntegerLiteral" type="lexical" id="prod-LegacyOctalIntegerLiteral">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalIntegerLiteral">LegacyOctalIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="rsu9eufh">
|
||
<emu-t>0</emu-t>
|
||
<emu-nt id="_ref_19844"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="tx3hz6c8">
|
||
<emu-nt id="_ref_19845"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalIntegerLiteral">LegacyOctalIntegerLiteral</a></emu-nt>
|
||
<emu-nt id="_ref_19846"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="NonOctalDecimalIntegerLiteral" type="lexical" id="prod-NonOctalDecimalIntegerLiteral">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDecimalIntegerLiteral">NonOctalDecimalIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="rmz1yyb9">
|
||
<emu-t>0</emu-t>
|
||
<emu-nt id="_ref_19847"><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDigit">NonOctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="yq78icb2">
|
||
<emu-nt id="_ref_19848"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalLikeDecimalIntegerLiteral">LegacyOctalLikeDecimalIntegerLiteral</a></emu-nt>
|
||
<emu-nt id="_ref_19849"><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDigit">NonOctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="qxebmbch">
|
||
<emu-nt id="_ref_19850"><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDecimalIntegerLiteral">NonOctalDecimalIntegerLiteral</a></emu-nt>
|
||
<emu-nt id="_ref_19851"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="LegacyOctalLikeDecimalIntegerLiteral" type="lexical" id="prod-LegacyOctalLikeDecimalIntegerLiteral">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalLikeDecimalIntegerLiteral">LegacyOctalLikeDecimalIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="rsu9eufh">
|
||
<emu-t>0</emu-t>
|
||
<emu-nt id="_ref_19852"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="sk7h1nbk">
|
||
<emu-nt id="_ref_19853"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalLikeDecimalIntegerLiteral">LegacyOctalLikeDecimalIntegerLiteral</a></emu-nt>
|
||
<emu-nt id="_ref_19854"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="OctalDigit" type="lexical" oneof="" id="prod-OctalDigit">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>0</emu-t> <emu-t>1</emu-t> <emu-t>2</emu-t> <emu-t>3</emu-t> <emu-t>4</emu-t> <emu-t>5</emu-t> <emu-t>6</emu-t> <emu-t>7</emu-t></emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="NonOctalDigit" type="lexical" oneof="" id="prod-NonOctalDigit">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDigit">NonOctalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>8</emu-t> <emu-t>9</emu-t></emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="HexIntegerLiteral" params="Sep" type="lexical" id="prod-HexIntegerLiteral">
|
||
<emu-nt params="Sep"><a href="ecmascript-language-lexical-grammar.html#prod-HexIntegerLiteral">HexIntegerLiteral</a><emu-mods><emu-params>[Sep]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ddiauqlo">
|
||
<emu-t>0x</emu-t>
|
||
<emu-nt params="?Sep" id="_ref_19855"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="w-ee7g68">
|
||
<emu-t>0X</emu-t>
|
||
<emu-nt params="?Sep" id="_ref_19856"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="HexDigits" params="Sep" type="lexical" id="prod-HexDigits">
|
||
<emu-nt params="Sep"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a><emu-mods><emu-params>[Sep]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="omskcs0d">
|
||
<emu-nt id="_ref_19857"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="hbi73qbc">
|
||
<emu-nt params="?Sep" id="_ref_19858"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a><emu-mods><emu-params>[?Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_19859"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="amg7w4gj" constraints="+Sep"><emu-constraints>[+Sep]</emu-constraints>
|
||
<emu-nt params="+Sep" id="_ref_19860"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a><emu-mods><emu-params>[+Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_19861"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>
|
||
<emu-nt id="_ref_19862"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="HexDigit" type="lexical" oneof="" id="prod-HexDigit">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>0</emu-t> <emu-t>1</emu-t> <emu-t>2</emu-t> <emu-t>3</emu-t> <emu-t>4</emu-t> <emu-t>5</emu-t> <emu-t>6</emu-t> <emu-t>7</emu-t> <emu-t>8</emu-t> <emu-t>9</emu-t> <emu-t>a</emu-t> <emu-t>b</emu-t> <emu-t>c</emu-t> <emu-t>d</emu-t> <emu-t>e</emu-t> <emu-t>f</emu-t> <emu-t>A</emu-t> <emu-t>B</emu-t> <emu-t>C</emu-t> <emu-t>D</emu-t> <emu-t>E</emu-t> <emu-t>F</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<p>The <emu-nt id="_ref_19863"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> immediately following a <emu-nt id="_ref_19864"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteral">NumericLiteral</a></emu-nt> must not be an <emu-nt id="_ref_19865"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierStart">IdentifierStart</a></emu-nt> or <emu-nt id="_ref_19866"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>.</p>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>For example: <code>3in</code> is an error and not the two input elements <code>3</code> and <code>in</code>.</p>
|
||
</div></emu-note>
|
||
|
||
<emu-clause id="sec-numeric-literals-early-errors">
|
||
<h1><span class="secnum">12.9.3.1</span> Static Semantics: Early Errors</h1>
|
||
<emu-grammar><emu-production name="NumericLiteral" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteral">NumericLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="8n96hykg"><emu-nt id="_ref_19867"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalIntegerLiteral">LegacyOctalIntegerLiteral</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="DecimalIntegerLiteral" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="xvklurnl"><emu-nt id="_ref_19868"><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDecimalIntegerLiteral">NonOctalDecimalIntegerLiteral</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<ul>
|
||
<li>It is a Syntax Error if <emu-xref aoid="IsStrict" id="_ref_5890"><a href="ecmascript-language-source-code.html#sec-isstrict">IsStrict</a></emu-xref>(this production) is <emu-val>true</emu-val>.</li>
|
||
</ul>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">In <emu-xref href="#non-strict-code" id="_ref_5891"><a href="ecmascript-language-source-code.html#non-strict-code">non-strict code</a></emu-xref>, this syntax is <emu-xref href="#sec-conformance" id="_ref_5892"><a href="conformance.html#sec-conformance">Legacy</a></emu-xref>.</div></emu-note>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-static-semantics-mv" oldids="sec-additional-syntax-numeric-literals-status-semantics"><span id="sec-additional-syntax-numeric-literals-status-semantics"></span>
|
||
<h1><span class="secnum">12.9.3.2</span> Static Semantics: MV</h1>
|
||
<p>A numeric literal stands for a value of the <emu-xref href="#sec-ecmascript-language-types-number-type" id="_ref_5893"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-number-type">Number type</a></emu-xref> or the <emu-xref href="#sec-ecmascript-language-types-bigint-type" id="_ref_5894"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-bigint-type">BigInt type</a></emu-xref>.</p>
|
||
<ul>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalLiteral">DecimalLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ivsyqs2o">
|
||
<emu-nt id="_ref_19869"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt>
|
||
<emu-t>.</emu-t>
|
||
<emu-nt id="_ref_19870"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the MV of <emu-nt id="_ref_19871"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt> plus (the MV of <emu-nt id="_ref_19872"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt> × 10<sup>-<var>n</var></sup>), where <var>n</var> is the number of code points in <emu-nt id="_ref_19873"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>, excluding all occurrences of <emu-nt id="_ref_19874"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalLiteral">DecimalLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="lxttymd7">
|
||
<emu-nt id="_ref_19875"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt>
|
||
<emu-t>.</emu-t>
|
||
<emu-nt id="_ref_19876"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentPart">ExponentPart</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the MV of <emu-nt id="_ref_19877"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt> × 10<sup><var>e</var></sup>, where <var>e</var> is the MV of <emu-nt id="_ref_19878"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentPart">ExponentPart</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalLiteral">DecimalLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="7xfditit">
|
||
<emu-nt id="_ref_19879"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt>
|
||
<emu-t>.</emu-t>
|
||
<emu-nt id="_ref_19880"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>
|
||
<emu-nt id="_ref_19881"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentPart">ExponentPart</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19882"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt> plus (the MV of <emu-nt id="_ref_19883"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt> × 10<sup>-<var>n</var></sup>)) × 10<sup><var>e</var></sup>, where <var>n</var> is the number of code points in <emu-nt id="_ref_19884"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>, excluding all occurrences of <emu-nt id="_ref_19885"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt> and <var>e</var> is the MV of <emu-nt id="_ref_19886"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentPart">ExponentPart</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalLiteral">DecimalLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="wfmzcqw1">
|
||
<emu-t>.</emu-t>
|
||
<emu-nt id="_ref_19887"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the MV of <emu-nt id="_ref_19888"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt> × 10<sup>-<var>n</var></sup>, where <var>n</var> is the number of code points in <emu-nt id="_ref_19889"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>, excluding all occurrences of <emu-nt id="_ref_19890"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalLiteral">DecimalLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="dnxzw8a4">
|
||
<emu-t>.</emu-t>
|
||
<emu-nt id="_ref_19891"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>
|
||
<emu-nt id="_ref_19892"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentPart">ExponentPart</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the MV of <emu-nt id="_ref_19893"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt> × 10<sup><var>e</var> - <var>n</var></sup>, where <var>n</var> is the number of code points in <emu-nt id="_ref_19894"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>, excluding all occurrences of <emu-nt id="_ref_19895"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>, and <var>e</var> is the MV of <emu-nt id="_ref_19896"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentPart">ExponentPart</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalLiteral">DecimalLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="br-hwd5f">
|
||
<emu-nt id="_ref_19897"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt>
|
||
<emu-nt id="_ref_19898"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentPart">ExponentPart</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the MV of <emu-nt id="_ref_19899"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt> × 10<sup><var>e</var></sup>, where <var>e</var> is the MV of <emu-nt id="_ref_19900"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentPart">ExponentPart</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalIntegerLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ulmkmvlx"><emu-t>0</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 0.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalIntegerLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalIntegerLiteral">DecimalIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="1lnbu1ra">
|
||
<emu-nt id="_ref_19901"><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt>
|
||
<emu-nt optional="" id="_ref_19902"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_19903"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19904"><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt> × 10<sup><var>n</var></sup>) plus the MV of <emu-nt id="_ref_19905"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>, where <var>n</var> is the number of code points in <emu-nt id="_ref_19906"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>, excluding all occurrences of <emu-nt id="_ref_19907"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalDigits" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="nyugv7lw">
|
||
<emu-nt id="_ref_19908"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>
|
||
<emu-nt id="_ref_19909"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19910"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt> × 10) plus the MV of <emu-nt id="_ref_19911"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalDigits" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="oilcxnyi">
|
||
<emu-nt id="_ref_19912"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>
|
||
<emu-nt id="_ref_19913"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>
|
||
<emu-nt id="_ref_19914"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19915"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt> × 10) plus the MV of <emu-nt id="_ref_19916"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="ExponentPart" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-ExponentPart">ExponentPart</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="f4n1gm76">
|
||
<emu-nt id="_ref_19917"><a href="ecmascript-language-lexical-grammar.html#prod-ExponentIndicator">ExponentIndicator</a></emu-nt>
|
||
<emu-nt id="_ref_19918"><a href="ecmascript-language-lexical-grammar.html#prod-SignedInteger">SignedInteger</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the MV of <emu-nt id="_ref_19919"><a href="ecmascript-language-lexical-grammar.html#prod-SignedInteger">SignedInteger</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="SignedInteger" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-SignedInteger">SignedInteger</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="waadsnwo">
|
||
<emu-t>-</emu-t>
|
||
<emu-nt id="_ref_19920"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the negative of the MV of <emu-nt id="_ref_19921"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ulmkmvlx"><emu-t>0</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ulmkmvlx"><emu-t>0</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="OctalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ulmkmvlx"><emu-t>0</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="LegacyOctalEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalEscapeSequence">LegacyOctalEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ulmkmvlx"><emu-t>0</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="BinaryDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigit">BinaryDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ulmkmvlx"><emu-t>0</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 0.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ksql3txo"><emu-t>1</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="NonZeroDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ksql3txo"><emu-t>1</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ksql3txo"><emu-t>1</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="OctalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ksql3txo"><emu-t>1</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="BinaryDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigit">BinaryDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ksql3txo"><emu-t>1</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 1.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="xkcxbwmk"><emu-t>2</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="NonZeroDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="xkcxbwmk"><emu-t>2</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="xkcxbwmk"><emu-t>2</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="OctalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="xkcxbwmk"><emu-t>2</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 2.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="7gu2shc1"><emu-t>3</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="NonZeroDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="7gu2shc1"><emu-t>3</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="7gu2shc1"><emu-t>3</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="OctalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="7gu2shc1"><emu-t>3</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 3.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="woxkczx2"><emu-t>4</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="NonZeroDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="woxkczx2"><emu-t>4</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="woxkczx2"><emu-t>4</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="OctalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="woxkczx2"><emu-t>4</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 4.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="j83vdwqk"><emu-t>5</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="NonZeroDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="j83vdwqk"><emu-t>5</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="j83vdwqk"><emu-t>5</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="OctalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="j83vdwqk"><emu-t>5</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 5.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="c2shfb68"><emu-t>6</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="NonZeroDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="c2shfb68"><emu-t>6</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="c2shfb68"><emu-t>6</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="OctalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="c2shfb68"><emu-t>6</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 6.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="6l4hpim_"><emu-t>7</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="NonZeroDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="6l4hpim_"><emu-t>7</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="6l4hpim_"><emu-t>7</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="OctalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="6l4hpim_"><emu-t>7</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 7.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="elvyw2lo"><emu-t>8</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="NonZeroDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="elvyw2lo"><emu-t>8</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="NonOctalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDigit">NonOctalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="elvyw2lo"><emu-t>8</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="elvyw2lo"><emu-t>8</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 8.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="DecimalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fj9dcfsf"><emu-t>9</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="NonZeroDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fj9dcfsf"><emu-t>9</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="NonOctalDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDigit">NonOctalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fj9dcfsf"><emu-t>9</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fj9dcfsf"><emu-t>9</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 9.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ph_p3jt-"><emu-t>a</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="nx0p29ri"><emu-t>A</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 10.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ayxoiyyq"><emu-t>b</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="cibwka8w"><emu-t>B</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 11.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="1ztbra35"><emu-t>c</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="x4fmw88j"><emu-t>C</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 12.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="8pmnkw2i"><emu-t>d</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="kzsugx0d"><emu-t>D</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 13.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="dxyfuoqh"><emu-t>e</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="sv9nkvwp"><emu-t>E</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 14.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="qgjk5yjy"><emu-t>f</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> or of <emu-grammar><emu-production name="HexDigit" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="dvrpcls0"><emu-t>F</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 15.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="BinaryDigits" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigits">BinaryDigits</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="gqp0qw4u">
|
||
<emu-nt id="_ref_19922"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigits">BinaryDigits</a></emu-nt>
|
||
<emu-nt id="_ref_19923"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigit">BinaryDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19924"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigits">BinaryDigits</a></emu-nt> × 2) plus the MV of <emu-nt id="_ref_19925"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigit">BinaryDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="BinaryDigits" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigits">BinaryDigits</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="gtcavmjz">
|
||
<emu-nt id="_ref_19926"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigits">BinaryDigits</a></emu-nt>
|
||
<emu-nt id="_ref_19927"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>
|
||
<emu-nt id="_ref_19928"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigit">BinaryDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19929"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigits">BinaryDigits</a></emu-nt> × 2) plus the MV of <emu-nt id="_ref_19930"><a href="ecmascript-language-lexical-grammar.html#prod-BinaryDigit">BinaryDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="OctalDigits" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigits">OctalDigits</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="n6kv_lqw">
|
||
<emu-nt id="_ref_19931"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigits">OctalDigits</a></emu-nt>
|
||
<emu-nt id="_ref_19932"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19933"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigits">OctalDigits</a></emu-nt> × 8) plus the MV of <emu-nt id="_ref_19934"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="OctalDigits" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigits">OctalDigits</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="twqvafmk">
|
||
<emu-nt id="_ref_19935"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigits">OctalDigits</a></emu-nt>
|
||
<emu-nt id="_ref_19936"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>
|
||
<emu-nt id="_ref_19937"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19938"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigits">OctalDigits</a></emu-nt> × 8) plus the MV of <emu-nt id="_ref_19939"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="LegacyOctalIntegerLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalIntegerLiteral">LegacyOctalIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="tx3hz6c8">
|
||
<emu-nt id="_ref_19940"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalIntegerLiteral">LegacyOctalIntegerLiteral</a></emu-nt>
|
||
<emu-nt id="_ref_19941"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19942"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalIntegerLiteral">LegacyOctalIntegerLiteral</a></emu-nt> times 8) plus the MV of <emu-nt id="_ref_19943"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="NonOctalDecimalIntegerLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDecimalIntegerLiteral">NonOctalDecimalIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="yq78icb2">
|
||
<emu-nt id="_ref_19944"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalLikeDecimalIntegerLiteral">LegacyOctalLikeDecimalIntegerLiteral</a></emu-nt>
|
||
<emu-nt id="_ref_19945"><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDigit">NonOctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19946"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalLikeDecimalIntegerLiteral">LegacyOctalLikeDecimalIntegerLiteral</a></emu-nt> times 10) plus the MV of <emu-nt id="_ref_19947"><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDigit">NonOctalDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="NonOctalDecimalIntegerLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDecimalIntegerLiteral">NonOctalDecimalIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="qxebmbch">
|
||
<emu-nt id="_ref_19948"><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDecimalIntegerLiteral">NonOctalDecimalIntegerLiteral</a></emu-nt>
|
||
<emu-nt id="_ref_19949"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19950"><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDecimalIntegerLiteral">NonOctalDecimalIntegerLiteral</a></emu-nt> times 10) plus the MV of <emu-nt id="_ref_19951"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="LegacyOctalLikeDecimalIntegerLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalLikeDecimalIntegerLiteral">LegacyOctalLikeDecimalIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="sk7h1nbk">
|
||
<emu-nt id="_ref_19952"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalLikeDecimalIntegerLiteral">LegacyOctalLikeDecimalIntegerLiteral</a></emu-nt>
|
||
<emu-nt id="_ref_19953"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19954"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalLikeDecimalIntegerLiteral">LegacyOctalLikeDecimalIntegerLiteral</a></emu-nt> times 10) plus the MV of <emu-nt id="_ref_19955"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="HexDigits" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="yciymy2l">
|
||
<emu-nt id="_ref_19956"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a></emu-nt>
|
||
<emu-nt id="_ref_19957"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19958"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a></emu-nt> × 16) plus the MV of <emu-nt id="_ref_19959"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="HexDigits" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="gza2ktug">
|
||
<emu-nt id="_ref_19960"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a></emu-nt>
|
||
<emu-nt id="_ref_19961"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>
|
||
<emu-nt id="_ref_19962"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (the MV of <emu-nt id="_ref_19963"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a></emu-nt> × 16) plus the MV of <emu-nt id="_ref_19964"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>.
|
||
</li>
|
||
</ul>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-numericvalue" type="sdo" aoid="NumericValue">
|
||
<h1><span class="secnum">12.9.3.3</span> Static Semantics: NumericValue</h1>
|
||
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_5895"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> NumericValue takes no arguments and returns a Number or a BigInt. It is defined piecewise over the following productions:</p>
|
||
<emu-grammar><emu-production name="NumericLiteral" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteral">NumericLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="gma1bw5s" id="prod-6EKD79IF"><emu-nt id="_ref_19965"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalLiteral">DecimalLiteral</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return <emu-xref aoid="RoundMVResult" id="_ref_5896"><a href="abstract-operations.html#sec-roundmvresult">RoundMVResult</a></emu-xref>(MV of <emu-nt id="_ref_19966"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalLiteral">DecimalLiteral</a></emu-nt>).</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="NumericLiteral" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteral">NumericLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="6ge3c7dq" id="prod-VwBAoy40"><emu-nt id="_ref_19967"><a href="ecmascript-language-lexical-grammar.html#prod-NonDecimalIntegerLiteral">NonDecimalIntegerLiteral</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return <emu-xref aoid="𝔽" id="_ref_5897"><a href="notational-conventions.html#%F0%9D%94%BD">𝔽</a></emu-xref>(MV of <emu-nt id="_ref_19968"><a href="ecmascript-language-lexical-grammar.html#prod-NonDecimalIntegerLiteral">NonDecimalIntegerLiteral</a></emu-nt>).</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="NumericLiteral" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteral">NumericLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="8n96hykg" id="prod-n5uysvQ-"><emu-nt id="_ref_19969"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalIntegerLiteral">LegacyOctalIntegerLiteral</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return <emu-xref aoid="𝔽" id="_ref_5898"><a href="notational-conventions.html#%F0%9D%94%BD">𝔽</a></emu-xref>(MV of <emu-nt id="_ref_19970"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalIntegerLiteral">LegacyOctalIntegerLiteral</a></emu-nt>).</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="NumericLiteral" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteral">NumericLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="an71bvql" id="prod-MgVpq-Ot">
|
||
<emu-nt id="_ref_19971"><a href="ecmascript-language-lexical-grammar.html#prod-NonDecimalIntegerLiteral">NonDecimalIntegerLiteral</a></emu-nt>
|
||
<emu-nt id="_ref_19972"><a href="ecmascript-language-lexical-grammar.html#prod-BigIntLiteralSuffix">BigIntLiteralSuffix</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return the <emu-xref href="#bigint-value-for" id="_ref_5899"><a href="notational-conventions.html#bigint-value-for">BigInt value for</a></emu-xref> the MV of <emu-nt id="_ref_19973"><a href="ecmascript-language-lexical-grammar.html#prod-NonDecimalIntegerLiteral">NonDecimalIntegerLiteral</a></emu-nt>.</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="DecimalBigIntegerLiteral" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalBigIntegerLiteral">DecimalBigIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="3e5icnkp" id="prod-_KqL62EN">
|
||
<emu-t>0</emu-t>
|
||
<emu-nt id="_ref_19974"><a href="ecmascript-language-lexical-grammar.html#prod-BigIntLiteralSuffix">BigIntLiteralSuffix</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return <emu-val>0</emu-val><sub>ℤ</sub>.</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="DecimalBigIntegerLiteral" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalBigIntegerLiteral">DecimalBigIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="dkfbjt3h" id="prod-k8d8Sn1k">
|
||
<emu-nt id="_ref_19975"><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt>
|
||
<emu-nt id="_ref_19976"><a href="ecmascript-language-lexical-grammar.html#prod-BigIntLiteralSuffix">BigIntLiteralSuffix</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return the <emu-xref href="#bigint-value-for" id="_ref_5900"><a href="notational-conventions.html#bigint-value-for">BigInt value for</a></emu-xref> the MV of <emu-nt id="_ref_19977"><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt>.</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="DecimalBigIntegerLiteral" type="lexical">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalBigIntegerLiteral">DecimalBigIntegerLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="kwaczm1q" id="prod-6lkR-0p2">
|
||
<emu-nt id="_ref_19978"><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt>
|
||
<emu-nt id="_ref_19979"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>
|
||
<emu-nt id="_ref_19980"><a href="ecmascript-language-lexical-grammar.html#prod-BigIntLiteralSuffix">BigIntLiteralSuffix</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="9dtmhu9b" id="prod-Rb94_ol-">
|
||
<emu-nt id="_ref_19981"><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt>
|
||
<emu-nt id="_ref_19982"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>
|
||
<emu-nt id="_ref_19983"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>
|
||
<emu-nt id="_ref_19984"><a href="ecmascript-language-lexical-grammar.html#prod-BigIntLiteralSuffix">BigIntLiteralSuffix</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Let <var>n</var> be the number of code points in <emu-nt id="_ref_19985"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>, excluding all occurrences of <emu-nt id="_ref_19986"><a href="ecmascript-language-lexical-grammar.html#prod-NumericLiteralSeparator">NumericLiteralSeparator</a></emu-nt>.</li><li>Let <var>mv</var> be (the MV of <emu-nt id="_ref_19987"><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroDigit">NonZeroDigit</a></emu-nt> × 10<sup><var>n</var></sup>) plus the MV of <emu-nt id="_ref_19988"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a></emu-nt>.</li><li>Return <emu-xref aoid="ℤ" id="_ref_5901"><a href="notational-conventions.html#%E2%84%A4">ℤ</a></emu-xref>(<var>mv</var>).</li></ol></emu-alg>
|
||
</emu-clause>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-literals-string-literals" oldids="sec-additional-syntax-string-literals"><span id="sec-additional-syntax-string-literals"></span>
|
||
<h1><span class="secnum">12.9.4</span> String Literals</h1>
|
||
<emu-note><span class="note">Note 1</span><div class="note-contents">
|
||
<p>A string literal is 0 or more Unicode code points enclosed in single or double quotes. Unicode code points may also be represented by an escape sequence. All code points may appear literally in a string literal except for the closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), and U+000A (LINE FEED). Any code points may appear in the form of an escape sequence. String literals evaluate to ECMAScript String values. When generating these String values Unicode code points are UTF-16 encoded as defined in <emu-xref href="#sec-utf16encodecodepoint" id="_ref_383"><a href="ecmascript-language-source-code.html#sec-utf16encodecodepoint">11.1.1</a></emu-xref>. Code points belonging to the Basic Multilingual Plane are encoded as a single code unit element of the string. All other code points are encoded as two code unit elements of the string.</p>
|
||
</div></emu-note>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="StringLiteral" type="lexical" id="prod-StringLiteral">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-StringLiteral">StringLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fdix8v-c">
|
||
<emu-t>"</emu-t>
|
||
<emu-nt optional="" id="_ref_19989"><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacters">DoubleStringCharacters</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-t>"</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="guyz2t4p">
|
||
<emu-t>'</emu-t>
|
||
<emu-nt optional="" id="_ref_19990"><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacters">SingleStringCharacters</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-t>'</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="DoubleStringCharacters" type="lexical" id="prod-DoubleStringCharacters">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacters">DoubleStringCharacters</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="i9q8d_st">
|
||
<emu-nt id="_ref_19991"><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacter">DoubleStringCharacter</a></emu-nt>
|
||
<emu-nt optional="" id="_ref_19992"><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacters">DoubleStringCharacters</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleStringCharacters" type="lexical" id="prod-SingleStringCharacters">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacters">SingleStringCharacters</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="f9kevwoi">
|
||
<emu-nt id="_ref_19993"><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacter">SingleStringCharacter</a></emu-nt>
|
||
<emu-nt optional="" id="_ref_19994"><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacters">SingleStringCharacters</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="DoubleStringCharacter" type="lexical" id="prod-DoubleStringCharacter">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacter">DoubleStringCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="qh-v7bpd">
|
||
<emu-nt id="_ref_19995"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-t>"</emu-t> or <emu-t>\</emu-t> or <emu-nt id="_ref_19996"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod>
|
||
</emu-rhs>
|
||
<emu-rhs a="eaiqsw9w">
|
||
<emu-gprose><LS></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="z8h10fxn">
|
||
<emu-gprose><PS></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="6n2njt_x">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_19997"><a href="ecmascript-language-lexical-grammar.html#prod-EscapeSequence">EscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ajkpm2ja">
|
||
<emu-nt id="_ref_19998"><a href="ecmascript-language-lexical-grammar.html#prod-LineContinuation">LineContinuation</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleStringCharacter" type="lexical" id="prod-SingleStringCharacter">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacter">SingleStringCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="xqnh0twg">
|
||
<emu-nt id="_ref_19999"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-t>'</emu-t> or <emu-t>\</emu-t> or <emu-nt id="_ref_20000"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod>
|
||
</emu-rhs>
|
||
<emu-rhs a="eaiqsw9w">
|
||
<emu-gprose><LS></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="z8h10fxn">
|
||
<emu-gprose><PS></emu-gprose>
|
||
</emu-rhs>
|
||
<emu-rhs a="6n2njt_x">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_20001"><a href="ecmascript-language-lexical-grammar.html#prod-EscapeSequence">EscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ajkpm2ja">
|
||
<emu-nt id="_ref_20002"><a href="ecmascript-language-lexical-grammar.html#prod-LineContinuation">LineContinuation</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="LineContinuation" type="lexical" id="prod-LineContinuation">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LineContinuation">LineContinuation</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="xik9y9lz">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_20003"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="EscapeSequence" type="lexical" id="prod-EscapeSequence">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-EscapeSequence">EscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="6ehvb3kw">
|
||
<emu-nt id="_ref_20004"><a href="ecmascript-language-lexical-grammar.html#prod-CharacterEscapeSequence">CharacterEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="br2d94cy">
|
||
<emu-t>0</emu-t>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20005"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="6mwrfc1u">
|
||
<emu-nt id="_ref_20006"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalEscapeSequence">LegacyOctalEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="nv0ui3q7">
|
||
<emu-nt id="_ref_20007"><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDecimalEscapeSequence">NonOctalDecimalEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="qacbhaps">
|
||
<emu-nt id="_ref_20008"><a href="ecmascript-language-lexical-grammar.html#prod-HexEscapeSequence">HexEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="rl1vvdtr">
|
||
<emu-nt id="_ref_20009"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="CharacterEscapeSequence" type="lexical" id="prod-CharacterEscapeSequence">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-CharacterEscapeSequence">CharacterEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="desdj6ig">
|
||
<emu-nt id="_ref_20010"><a href="ecmascript-language-lexical-grammar.html#prod-SingleEscapeCharacter">SingleEscapeCharacter</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="t5gkmnte">
|
||
<emu-nt id="_ref_20011"><a href="ecmascript-language-lexical-grammar.html#prod-NonEscapeCharacter">NonEscapeCharacter</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleEscapeCharacter" type="lexical" oneof="" id="prod-SingleEscapeCharacter">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-SingleEscapeCharacter">SingleEscapeCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>'</emu-t> <emu-t>"</emu-t> <emu-t>\</emu-t> <emu-t>b</emu-t> <emu-t>f</emu-t> <emu-t>n</emu-t> <emu-t>r</emu-t> <emu-t>t</emu-t> <emu-t>v</emu-t></emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="NonEscapeCharacter" type="lexical" id="prod-NonEscapeCharacter">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonEscapeCharacter">NonEscapeCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="g6xhj53i">
|
||
<emu-nt id="_ref_20012"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-nt id="_ref_20013"><a href="ecmascript-language-lexical-grammar.html#prod-EscapeCharacter">EscapeCharacter</a></emu-nt> or <emu-nt id="_ref_20014"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="EscapeCharacter" type="lexical" id="prod-EscapeCharacter">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-EscapeCharacter">EscapeCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="desdj6ig">
|
||
<emu-nt id="_ref_20015"><a href="ecmascript-language-lexical-grammar.html#prod-SingleEscapeCharacter">SingleEscapeCharacter</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="s4me4hlz">
|
||
<emu-nt id="_ref_20016"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="fqodqad9">
|
||
<emu-t>x</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="jc5mvt_f">
|
||
<emu-t>u</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="LegacyOctalEscapeSequence" type="lexical" id="prod-LegacyOctalEscapeSequence">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalEscapeSequence">LegacyOctalEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="7ty-i8nt">
|
||
<emu-t>0</emu-t>
|
||
<emu-gann>[lookahead ∈ { <emu-t>8</emu-t>, <emu-t>9</emu-t> }]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="zo2dw1jh">
|
||
<emu-nt id="_ref_20017"><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroOctalDigit">NonZeroOctalDigit</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20018"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="j1oybrrs">
|
||
<emu-nt id="_ref_20019"><a href="ecmascript-language-lexical-grammar.html#prod-ZeroToThree">ZeroToThree</a></emu-nt>
|
||
<emu-nt id="_ref_20020"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20021"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="ci1_zc16">
|
||
<emu-nt id="_ref_20022"><a href="ecmascript-language-lexical-grammar.html#prod-FourToSeven">FourToSeven</a></emu-nt>
|
||
<emu-nt id="_ref_20023"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="4u5dk78q">
|
||
<emu-nt id="_ref_20024"><a href="ecmascript-language-lexical-grammar.html#prod-ZeroToThree">ZeroToThree</a></emu-nt>
|
||
<emu-nt id="_ref_20025"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20026"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="NonZeroOctalDigit" type="lexical" id="prod-NonZeroOctalDigit">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonZeroOctalDigit">NonZeroOctalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="oqgsby5s">
|
||
<emu-nt id="_ref_20027"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt> <emu-gmod>but not <emu-t>0</emu-t></emu-gmod>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="ZeroToThree" type="lexical" oneof="" id="prod-ZeroToThree">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-ZeroToThree">ZeroToThree</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>0</emu-t> <emu-t>1</emu-t> <emu-t>2</emu-t> <emu-t>3</emu-t></emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="FourToSeven" type="lexical" oneof="" id="prod-FourToSeven">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-FourToSeven">FourToSeven</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>4</emu-t> <emu-t>5</emu-t> <emu-t>6</emu-t> <emu-t>7</emu-t></emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="NonOctalDecimalEscapeSequence" type="lexical" oneof="" id="prod-NonOctalDecimalEscapeSequence">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDecimalEscapeSequence">NonOctalDecimalEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>8</emu-t> <emu-t>9</emu-t></emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="HexEscapeSequence" type="lexical" id="prod-HexEscapeSequence">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexEscapeSequence">HexEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="2o-xpa4a">
|
||
<emu-t>x</emu-t>
|
||
<emu-nt id="_ref_20028"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20029"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="UnicodeEscapeSequence" type="lexical" id="prod-UnicodeEscapeSequence">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ghktjvoi" id="prod-yPsTqmeL">
|
||
<emu-t>u</emu-t>
|
||
<emu-nt id="_ref_20030"><a href="ecmascript-language-lexical-grammar.html#prod-Hex4Digits">Hex4Digits</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="uybj7_dt" id="prod-qIqpq7Bo">
|
||
<emu-t>u{</emu-t>
|
||
<emu-nt id="_ref_20031"><a href="ecmascript-language-lexical-grammar.html#prod-CodePoint">CodePoint</a></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="Hex4Digits" type="lexical" id="prod-Hex4Digits">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-Hex4Digits">Hex4Digits</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="c6jeysfq">
|
||
<emu-nt id="_ref_20032"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20033"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20034"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20035"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<p>The definition of the nonterminal <emu-nt id="_ref_20036"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> is given in <emu-xref href="#sec-literals-numeric-literals" id="_ref_384"><a href="ecmascript-language-lexical-grammar.html#sec-literals-numeric-literals">12.9.3</a></emu-xref>. <emu-nt id="_ref_20037"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> is defined in <emu-xref href="#sec-source-text" id="_ref_385"><a href="ecmascript-language-source-code.html#sec-source-text">11.1</a></emu-xref>.</p>
|
||
<emu-note><span class="note">Note 2</span><div class="note-contents">
|
||
<p><LF> and <CR> cannot appear in a string literal, except as part of a <emu-nt id="_ref_20038"><a href="ecmascript-language-lexical-grammar.html#prod-LineContinuation">LineContinuation</a></emu-nt> to produce the empty code points sequence. The proper way to include either in the String value of a string literal is to use an escape sequence such as <code>\n</code> or <code>\u000A</code>.</p>
|
||
</div></emu-note>
|
||
|
||
<emu-clause id="sec-string-literals-early-errors">
|
||
<h1><span class="secnum">12.9.4.1</span> Static Semantics: Early Errors</h1>
|
||
<emu-grammar><emu-production name="EscapeSequence" type="lexical">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-EscapeSequence">EscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="6mwrfc1u">
|
||
<emu-nt id="_ref_20039"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalEscapeSequence">LegacyOctalEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="nv0ui3q7">
|
||
<emu-nt id="_ref_20040"><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDecimalEscapeSequence">NonOctalDecimalEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<ul>
|
||
<li>It is a Syntax Error if <emu-xref aoid="IsStrict" id="_ref_5902"><a href="ecmascript-language-source-code.html#sec-isstrict">IsStrict</a></emu-xref>(this production) is <emu-val>true</emu-val>.</li>
|
||
</ul>
|
||
<emu-note><span class="note">Note 1</span><div class="note-contents">In <emu-xref href="#non-strict-code" id="_ref_5903"><a href="ecmascript-language-source-code.html#non-strict-code">non-strict code</a></emu-xref>, this syntax is <emu-xref href="#sec-conformance" id="_ref_5904"><a href="conformance.html#sec-conformance">Legacy</a></emu-xref>.</div></emu-note>
|
||
<emu-note><span class="note">Note 2</span><div class="note-contents">
|
||
<p>It is possible for string literals to precede a <emu-xref href="#use-strict-directive" id="_ref_5905"><a href="ecmascript-language-source-code.html#use-strict-directive">Use Strict Directive</a></emu-xref> that places the enclosing code in <emu-xref href="#sec-strict-mode-code" id="_ref_386"><a href="ecmascript-language-source-code.html#sec-strict-mode-code">strict mode</a></emu-xref>, and implementations must take care to enforce the above rules for such literals. For example, the following source text contains a Syntax Error:</p>
|
||
<pre><code class="javascript hljs"><span class="hljs-keyword">function</span> <span class="hljs-title function_">invalid</span>(<span class="hljs-params"></span>) { <span class="hljs-string">"\7"</span>; <span class="hljs-string">"use strict"</span>; }</code></pre>
|
||
</div></emu-note>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-static-semantics-sv" oldids="sec-string-literals-static-semantics-stringvalue,sec-additional-syntax-string-literals-static-semantics" type="sdo" aoid="SV"><span id="sec-additional-syntax-string-literals-static-semantics"></span><span id="sec-string-literals-static-semantics-stringvalue"></span>
|
||
<h1><span class="secnum">12.9.4.2</span> Static Semantics: SV</h1>
|
||
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_5906"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> SV takes no arguments and returns a String.</p>
|
||
<p>A string literal stands for a value of the <emu-xref href="#sec-ecmascript-language-types-string-type" id="_ref_5907"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type">String type</a></emu-xref>. SV produces String values for string literals through recursive application on the various parts of the string literal. As part of this process, some Unicode code points within the string literal are interpreted as having a <emu-xref href="#mathematical-value" id="_ref_5908"><a href="notational-conventions.html#mathematical-value">mathematical value</a></emu-xref>, as described below or in <emu-xref href="#sec-literals-numeric-literals" id="_ref_387"><a href="ecmascript-language-lexical-grammar.html#sec-literals-numeric-literals">12.9.3</a></emu-xref>.</p>
|
||
|
||
<ul>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="StringLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-StringLiteral">StringLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ot_2xigm">
|
||
<emu-t>"</emu-t>
|
||
<emu-t>"</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the empty String.
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="StringLiteral" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-StringLiteral">StringLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="dhhrcrr2">
|
||
<emu-t>'</emu-t>
|
||
<emu-t>'</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the empty String.
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="DoubleStringCharacters" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacters">DoubleStringCharacters</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="mz8kfg36">
|
||
<emu-nt id="_ref_20041"><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacter">DoubleStringCharacter</a></emu-nt>
|
||
<emu-nt id="_ref_20042"><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacters">DoubleStringCharacters</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5909"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the SV of <emu-nt id="_ref_20043"><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacter">DoubleStringCharacter</a></emu-nt> and the SV of <emu-nt id="_ref_20044"><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacters">DoubleStringCharacters</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="SingleStringCharacters" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacters">SingleStringCharacters</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ievpmfb9">
|
||
<emu-nt id="_ref_20045"><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacter">SingleStringCharacter</a></emu-nt>
|
||
<emu-nt id="_ref_20046"><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacters">SingleStringCharacters</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5910"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the SV of <emu-nt id="_ref_20047"><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacter">SingleStringCharacter</a></emu-nt> and the SV of <emu-nt id="_ref_20048"><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacters">SingleStringCharacters</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="DoubleStringCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacter">DoubleStringCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="qh-v7bpd"><emu-nt id="_ref_20049"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-t>"</emu-t> or <emu-t>\</emu-t> or <emu-nt id="_ref_20050"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the result of performing <emu-xref aoid="UTF16EncodeCodePoint" id="_ref_5911"><a href="ecmascript-language-source-code.html#sec-utf16encodecodepoint">UTF16EncodeCodePoint</a></emu-xref> on the code point matched by <emu-nt id="_ref_20051"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="DoubleStringCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacter">DoubleStringCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="eaiqsw9w"><emu-gprose><LS></emu-gprose></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x2028 (LINE SEPARATOR).
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="DoubleStringCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacter">DoubleStringCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="z8h10fxn"><emu-gprose><PS></emu-gprose></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x2029 (PARAGRAPH SEPARATOR).
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="DoubleStringCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DoubleStringCharacter">DoubleStringCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ajkpm2ja"><emu-nt id="_ref_20052"><a href="ecmascript-language-lexical-grammar.html#prod-LineContinuation">LineContinuation</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the empty String.
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="SingleStringCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacter">SingleStringCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="xqnh0twg"><emu-nt id="_ref_20053"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-t>'</emu-t> or <emu-t>\</emu-t> or <emu-nt id="_ref_20054"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the result of performing <emu-xref aoid="UTF16EncodeCodePoint" id="_ref_5912"><a href="ecmascript-language-source-code.html#sec-utf16encodecodepoint">UTF16EncodeCodePoint</a></emu-xref> on the code point matched by <emu-nt id="_ref_20055"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="SingleStringCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacter">SingleStringCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="eaiqsw9w"><emu-gprose><LS></emu-gprose></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x2028 (LINE SEPARATOR).
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="SingleStringCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacter">SingleStringCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="z8h10fxn"><emu-gprose><PS></emu-gprose></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x2029 (PARAGRAPH SEPARATOR).
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="SingleStringCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-SingleStringCharacter">SingleStringCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ajkpm2ja"><emu-nt id="_ref_20056"><a href="ecmascript-language-lexical-grammar.html#prod-LineContinuation">LineContinuation</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the empty String.
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="EscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-EscapeSequence">EscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ulmkmvlx"><emu-t>0</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x0000 (NULL).
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="CharacterEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-CharacterEscapeSequence">CharacterEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="desdj6ig"><emu-nt id="_ref_20057"><a href="ecmascript-language-lexical-grammar.html#prod-SingleEscapeCharacter">SingleEscapeCharacter</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit whose numeric value is determined by the <emu-nt id="_ref_20058"><a href="ecmascript-language-lexical-grammar.html#prod-SingleEscapeCharacter">SingleEscapeCharacter</a></emu-nt> according to <emu-xref href="#table-string-single-character-escape-sequences" id="_ref_388"><a href="ecmascript-language-lexical-grammar.html#table-string-single-character-escape-sequences">Table 32</a></emu-xref>.
|
||
</li>
|
||
</ul>
|
||
<emu-table id="table-string-single-character-escape-sequences" caption="String Single Character Escape Sequences" oldids="table-34"><figure><figcaption>Table 32: String Single Character Escape Sequences</figcaption><span id="table-34"></span>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>
|
||
Escape Sequence
|
||
</th>
|
||
<th>
|
||
Code Unit Value
|
||
</th>
|
||
<th>
|
||
Unicode Character Name
|
||
</th>
|
||
<th>
|
||
Symbol
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr>
|
||
<td>
|
||
<code>\b</code>
|
||
</td>
|
||
<td>
|
||
<code>0x0008</code>
|
||
</td>
|
||
<td>
|
||
BACKSPACE
|
||
</td>
|
||
<td>
|
||
<BS>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>\t</code>
|
||
</td>
|
||
<td>
|
||
<code>0x0009</code>
|
||
</td>
|
||
<td>
|
||
CHARACTER TABULATION
|
||
</td>
|
||
<td>
|
||
<HT>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>\n</code>
|
||
</td>
|
||
<td>
|
||
<code>0x000A</code>
|
||
</td>
|
||
<td>
|
||
LINE FEED (LF)
|
||
</td>
|
||
<td>
|
||
<LF>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>\v</code>
|
||
</td>
|
||
<td>
|
||
<code>0x000B</code>
|
||
</td>
|
||
<td>
|
||
LINE TABULATION
|
||
</td>
|
||
<td>
|
||
<VT>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>\f</code>
|
||
</td>
|
||
<td>
|
||
<code>0x000C</code>
|
||
</td>
|
||
<td>
|
||
FORM FEED (FF)
|
||
</td>
|
||
<td>
|
||
<FF>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>\r</code>
|
||
</td>
|
||
<td>
|
||
<code>0x000D</code>
|
||
</td>
|
||
<td>
|
||
CARRIAGE RETURN (CR)
|
||
</td>
|
||
<td>
|
||
<CR>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>\"</code>
|
||
</td>
|
||
<td>
|
||
<code>0x0022</code>
|
||
</td>
|
||
<td>
|
||
QUOTATION MARK
|
||
</td>
|
||
<td>
|
||
<code>"</code>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>\'</code>
|
||
</td>
|
||
<td>
|
||
<code>0x0027</code>
|
||
</td>
|
||
<td>
|
||
APOSTROPHE
|
||
</td>
|
||
<td>
|
||
<code>'</code>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>\\</code>
|
||
</td>
|
||
<td>
|
||
<code>0x005C</code>
|
||
</td>
|
||
<td>
|
||
REVERSE SOLIDUS
|
||
</td>
|
||
<td>
|
||
<code>\</code>
|
||
</td>
|
||
</tr>
|
||
</tbody></table>
|
||
</figure></emu-table>
|
||
<ul>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="NonEscapeCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonEscapeCharacter">NonEscapeCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="g6xhj53i"><emu-nt id="_ref_20059"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-nt id="_ref_20060"><a href="ecmascript-language-lexical-grammar.html#prod-EscapeCharacter">EscapeCharacter</a></emu-nt> or <emu-nt id="_ref_20061"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the result of performing <emu-xref aoid="UTF16EncodeCodePoint" id="_ref_5913"><a href="ecmascript-language-source-code.html#sec-utf16encodecodepoint">UTF16EncodeCodePoint</a></emu-xref> on the code point matched by <emu-nt id="_ref_20062"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="EscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-EscapeSequence">EscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="6mwrfc1u"><emu-nt id="_ref_20063"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalEscapeSequence">LegacyOctalEscapeSequence</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit whose numeric value is the MV of <emu-nt id="_ref_20064"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalEscapeSequence">LegacyOctalEscapeSequence</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="NonOctalDecimalEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDecimalEscapeSequence">NonOctalDecimalEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="elvyw2lo"><emu-t>8</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x0038 (DIGIT EIGHT).
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="NonOctalDecimalEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NonOctalDecimalEscapeSequence">NonOctalDecimalEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fj9dcfsf"><emu-t>9</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x0039 (DIGIT NINE).
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="HexEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexEscapeSequence">HexEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="2o-xpa4a">
|
||
<emu-t>x</emu-t>
|
||
<emu-nt id="_ref_20065"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20066"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit whose numeric value is the MV of <emu-nt id="_ref_20067"><a href="ecmascript-language-lexical-grammar.html#prod-HexEscapeSequence">HexEscapeSequence</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="Hex4Digits" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-Hex4Digits">Hex4Digits</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="c6jeysfq">
|
||
<emu-nt id="_ref_20068"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20069"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20070"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20071"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit whose numeric value is the MV of <emu-nt id="_ref_20072"><a href="ecmascript-language-lexical-grammar.html#prod-Hex4Digits">Hex4Digits</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="UnicodeEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="uybj7_dt">
|
||
<emu-t>u{</emu-t>
|
||
<emu-nt id="_ref_20073"><a href="ecmascript-language-lexical-grammar.html#prod-CodePoint">CodePoint</a></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the result of performing <emu-xref aoid="UTF16EncodeCodePoint" id="_ref_5914"><a href="ecmascript-language-source-code.html#sec-utf16encodecodepoint">UTF16EncodeCodePoint</a></emu-xref> on the MV of <emu-nt id="_ref_20074"><a href="ecmascript-language-lexical-grammar.html#prod-CodePoint">CodePoint</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The SV of <emu-grammar><emu-production name="TemplateEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateEscapeSequence">TemplateEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ulmkmvlx"><emu-t>0</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x0000 (NULL).
|
||
</li>
|
||
</ul>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-string-literals-static-semantics-mv">
|
||
<h1><span class="secnum">12.9.4.3</span> Static Semantics: MV</h1>
|
||
<ul>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="LegacyOctalEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalEscapeSequence">LegacyOctalEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ebo5t_hb">
|
||
<emu-nt id="_ref_20075"><a href="ecmascript-language-lexical-grammar.html#prod-ZeroToThree">ZeroToThree</a></emu-nt>
|
||
<emu-nt id="_ref_20076"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (8 times the MV of <emu-nt id="_ref_20077"><a href="ecmascript-language-lexical-grammar.html#prod-ZeroToThree">ZeroToThree</a></emu-nt>) plus the MV of <emu-nt id="_ref_20078"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="LegacyOctalEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalEscapeSequence">LegacyOctalEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ci1_zc16">
|
||
<emu-nt id="_ref_20079"><a href="ecmascript-language-lexical-grammar.html#prod-FourToSeven">FourToSeven</a></emu-nt>
|
||
<emu-nt id="_ref_20080"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (8 times the MV of <emu-nt id="_ref_20081"><a href="ecmascript-language-lexical-grammar.html#prod-FourToSeven">FourToSeven</a></emu-nt>) plus the MV of <emu-nt id="_ref_20082"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="LegacyOctalEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalEscapeSequence">LegacyOctalEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="4u5dk78q">
|
||
<emu-nt id="_ref_20083"><a href="ecmascript-language-lexical-grammar.html#prod-ZeroToThree">ZeroToThree</a></emu-nt>
|
||
<emu-nt id="_ref_20084"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20085"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (64 (that is, 8<sup>2</sup>) times the MV of <emu-nt id="_ref_20086"><a href="ecmascript-language-lexical-grammar.html#prod-ZeroToThree">ZeroToThree</a></emu-nt>) plus (8 times the MV of the first <emu-nt id="_ref_20087"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>) plus the MV of the second <emu-nt id="_ref_20088"><a href="ecmascript-language-lexical-grammar.html#prod-OctalDigit">OctalDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="ZeroToThree" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-ZeroToThree">ZeroToThree</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ulmkmvlx"><emu-t>0</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 0.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="ZeroToThree" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-ZeroToThree">ZeroToThree</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ksql3txo"><emu-t>1</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 1.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="ZeroToThree" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-ZeroToThree">ZeroToThree</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="xkcxbwmk"><emu-t>2</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 2.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="ZeroToThree" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-ZeroToThree">ZeroToThree</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="7gu2shc1"><emu-t>3</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 3.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="FourToSeven" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-FourToSeven">FourToSeven</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="woxkczx2"><emu-t>4</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 4.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="FourToSeven" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-FourToSeven">FourToSeven</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="j83vdwqk"><emu-t>5</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 5.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="FourToSeven" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-FourToSeven">FourToSeven</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="c2shfb68"><emu-t>6</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 6.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="FourToSeven" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-FourToSeven">FourToSeven</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="6l4hpim_"><emu-t>7</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is 7.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="HexEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexEscapeSequence">HexEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="2o-xpa4a">
|
||
<emu-t>x</emu-t>
|
||
<emu-nt id="_ref_20089"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20090"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (16 times the MV of the first <emu-nt id="_ref_20091"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>) plus the MV of the second <emu-nt id="_ref_20092"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The MV of <emu-grammar><emu-production name="Hex4Digits" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-Hex4Digits">Hex4Digits</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="c6jeysfq">
|
||
<emu-nt id="_ref_20093"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20094"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20095"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20096"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is (0x1000 × the MV of the first <emu-nt id="_ref_20097"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>) plus (0x100 × the MV of the second <emu-nt id="_ref_20098"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>) plus (0x10 × the MV of the third <emu-nt id="_ref_20099"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>) plus the MV of the fourth <emu-nt id="_ref_20100"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>.
|
||
</li>
|
||
</ul>
|
||
</emu-clause>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-literals-regular-expression-literals">
|
||
<h1><span class="secnum">12.9.5</span> Regular Expression Literals</h1>
|
||
<emu-note><span class="note">Note 1</span><div class="note-contents">
|
||
<p>A regular expression literal is an input element that is converted to a RegExp object (see <emu-xref href="#sec-regexp-regular-expression-objects" id="_ref_389"><a href="text-processing.html#sec-regexp-regular-expression-objects">22.2</a></emu-xref>) each time the literal is evaluated. Two regular expression literals in a program evaluate to regular expression objects that never compare as <code>===</code> to each other even if the two literals' contents are identical. A RegExp object may also be created at runtime by <code>new RegExp</code> or calling the RegExp <emu-xref href="#constructor" id="_ref_5915"><a href="ecmascript-data-types-and-values.html#constructor">constructor</a></emu-xref> as a function (see <emu-xref href="#sec-regexp-constructor" id="_ref_390"><a href="text-processing.html#sec-regexp-constructor">22.2.4</a></emu-xref>).</p>
|
||
</div></emu-note>
|
||
<p>The productions below describe the syntax for a regular expression literal and are used by the input element scanner to find the end of the regular expression literal. The source text comprising the <emu-nt id="_ref_20101"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionBody">RegularExpressionBody</a></emu-nt> and the <emu-nt id="_ref_20102"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionFlags">RegularExpressionFlags</a></emu-nt> are subsequently parsed again using the more stringent ECMAScript Regular Expression grammar (<emu-xref href="#sec-patterns" id="_ref_391"><a href="text-processing.html#sec-patterns">22.2.1</a></emu-xref>).</p>
|
||
<p>An implementation may extend the ECMAScript Regular Expression grammar defined in <emu-xref href="#sec-patterns" id="_ref_392"><a href="text-processing.html#sec-patterns">22.2.1</a></emu-xref>, but it must not extend the <emu-nt id="_ref_20103"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionBody">RegularExpressionBody</a></emu-nt> and <emu-nt id="_ref_20104"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionFlags">RegularExpressionFlags</a></emu-nt> productions defined below or the productions used by these productions.</p>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="RegularExpressionLiteral" type="lexical" id="prod-RegularExpressionLiteral">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="v3gfo--_" id="prod-6WVj7Zp6">
|
||
<emu-t>/</emu-t>
|
||
<emu-nt id="_ref_20105"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionBody">RegularExpressionBody</a></emu-nt>
|
||
<emu-t>/</emu-t>
|
||
<emu-nt id="_ref_20106"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionFlags">RegularExpressionFlags</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="RegularExpressionBody" type="lexical" id="prod-RegularExpressionBody">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionBody">RegularExpressionBody</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="u6ewnk3q">
|
||
<emu-nt id="_ref_20107"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionFirstChar">RegularExpressionFirstChar</a></emu-nt>
|
||
<emu-nt id="_ref_20108"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionChars">RegularExpressionChars</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="RegularExpressionChars" type="lexical" id="prod-RegularExpressionChars">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionChars">RegularExpressionChars</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="n7nathbb">
|
||
<emu-gann>[empty]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="qygc7azr">
|
||
<emu-nt id="_ref_20109"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionChars">RegularExpressionChars</a></emu-nt>
|
||
<emu-nt id="_ref_20110"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionChar">RegularExpressionChar</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="RegularExpressionFirstChar" type="lexical" id="prod-RegularExpressionFirstChar">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionFirstChar">RegularExpressionFirstChar</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="2hsmcj0g">
|
||
<emu-nt id="_ref_20111"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionNonTerminator">RegularExpressionNonTerminator</a></emu-nt> <emu-gmod>but not one of <emu-t>*</emu-t> or <emu-t>\</emu-t> or <emu-t>/</emu-t> or <emu-t>[</emu-t></emu-gmod>
|
||
</emu-rhs>
|
||
<emu-rhs a="njv5p0rd">
|
||
<emu-nt id="_ref_20112"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionBackslashSequence">RegularExpressionBackslashSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="xmafjorq">
|
||
<emu-nt id="_ref_20113"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionClass">RegularExpressionClass</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="RegularExpressionChar" type="lexical" id="prod-RegularExpressionChar">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionChar">RegularExpressionChar</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="8mp_fppd">
|
||
<emu-nt id="_ref_20114"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionNonTerminator">RegularExpressionNonTerminator</a></emu-nt> <emu-gmod>but not one of <emu-t>\</emu-t> or <emu-t>/</emu-t> or <emu-t>[</emu-t></emu-gmod>
|
||
</emu-rhs>
|
||
<emu-rhs a="njv5p0rd">
|
||
<emu-nt id="_ref_20115"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionBackslashSequence">RegularExpressionBackslashSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="xmafjorq">
|
||
<emu-nt id="_ref_20116"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionClass">RegularExpressionClass</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="RegularExpressionBackslashSequence" type="lexical" id="prod-RegularExpressionBackslashSequence">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionBackslashSequence">RegularExpressionBackslashSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="12vrrw1t">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_20117"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionNonTerminator">RegularExpressionNonTerminator</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="RegularExpressionNonTerminator" type="lexical" id="prod-RegularExpressionNonTerminator">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionNonTerminator">RegularExpressionNonTerminator</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="lvvfp8iw">
|
||
<emu-nt id="_ref_20118"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not <emu-nt id="_ref_20119"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="RegularExpressionClass" type="lexical" id="prod-RegularExpressionClass">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionClass">RegularExpressionClass</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="tbvecnsu">
|
||
<emu-t>[</emu-t>
|
||
<emu-nt id="_ref_20120"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionClassChars">RegularExpressionClassChars</a></emu-nt>
|
||
<emu-t>]</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="RegularExpressionClassChars" type="lexical" id="prod-RegularExpressionClassChars">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionClassChars">RegularExpressionClassChars</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="n7nathbb">
|
||
<emu-gann>[empty]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="dr3lbtf5">
|
||
<emu-nt id="_ref_20121"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionClassChars">RegularExpressionClassChars</a></emu-nt>
|
||
<emu-nt id="_ref_20122"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionClassChar">RegularExpressionClassChar</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="RegularExpressionClassChar" type="lexical" id="prod-RegularExpressionClassChar">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionClassChar">RegularExpressionClassChar</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="f9eiuy71">
|
||
<emu-nt id="_ref_20123"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionNonTerminator">RegularExpressionNonTerminator</a></emu-nt> <emu-gmod>but not one of <emu-t>]</emu-t> or <emu-t>\</emu-t></emu-gmod>
|
||
</emu-rhs>
|
||
<emu-rhs a="njv5p0rd">
|
||
<emu-nt id="_ref_20124"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionBackslashSequence">RegularExpressionBackslashSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="RegularExpressionFlags" type="lexical" id="prod-RegularExpressionFlags">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionFlags">RegularExpressionFlags</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="n7nathbb">
|
||
<emu-gann>[empty]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="9bwye56f">
|
||
<emu-nt id="_ref_20125"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionFlags">RegularExpressionFlags</a></emu-nt>
|
||
<emu-nt id="_ref_20126"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierPartChar">IdentifierPartChar</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-note><span class="note">Note 2</span><div class="note-contents">
|
||
<p>Regular expression literals may not be empty; instead of representing an empty regular expression literal, the code unit sequence <code>//</code> starts a single-line comment. To specify an empty regular expression, use: <code>/(?:)/</code>.</p>
|
||
</div></emu-note>
|
||
|
||
<emu-clause id="sec-static-semantics-bodytext" type="sdo" aoid="BodyText">
|
||
<h1><span class="secnum">12.9.5.1</span> Static Semantics: BodyText</h1>
|
||
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_5916"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> BodyText takes no arguments and returns source text. It is defined piecewise over the following productions:</p>
|
||
<emu-grammar><emu-production name="RegularExpressionLiteral" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="v3gfo--_" id="prod-GHASI6lr">
|
||
<emu-t>/</emu-t>
|
||
<emu-nt id="_ref_20127"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionBody">RegularExpressionBody</a></emu-nt>
|
||
<emu-t>/</emu-t>
|
||
<emu-nt id="_ref_20128"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionFlags">RegularExpressionFlags</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return the source text that was recognized as <emu-nt id="_ref_20129"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionBody">RegularExpressionBody</a></emu-nt>.</li></ol></emu-alg>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-static-semantics-flagtext" type="sdo" aoid="FlagText">
|
||
<h1><span class="secnum">12.9.5.2</span> Static Semantics: FlagText</h1>
|
||
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_5917"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> FlagText takes no arguments and returns source text. It is defined piecewise over the following productions:</p>
|
||
<emu-grammar><emu-production name="RegularExpressionLiteral" type="lexical" collapsed="">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="v3gfo--_" id="prod-U3zNjneX">
|
||
<emu-t>/</emu-t>
|
||
<emu-nt id="_ref_20130"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionBody">RegularExpressionBody</a></emu-nt>
|
||
<emu-t>/</emu-t>
|
||
<emu-nt id="_ref_20131"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionFlags">RegularExpressionFlags</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return the source text that was recognized as <emu-nt id="_ref_20132"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionFlags">RegularExpressionFlags</a></emu-nt>.</li></ol></emu-alg>
|
||
</emu-clause>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-template-literal-lexical-components">
|
||
<h1><span class="secnum">12.9.6</span> Template Literal Lexical Components</h1>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="Template" type="lexical" id="prod-Template">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-Template">Template</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="e_otk8es">
|
||
<emu-nt id="_ref_20133"><a href="ecmascript-language-lexical-grammar.html#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="q5pllvwq">
|
||
<emu-nt id="_ref_20134"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateHead">TemplateHead</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="NoSubstitutionTemplate" type="lexical" id="prod-NoSubstitutionTemplate">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="bw9ca6ur">
|
||
<emu-t>`</emu-t>
|
||
<emu-nt optional="" id="_ref_20135"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacters">TemplateCharacters</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-t>`</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="TemplateHead" type="lexical" id="prod-TemplateHead">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateHead">TemplateHead</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="v7fy_fdt">
|
||
<emu-t>`</emu-t>
|
||
<emu-nt optional="" id="_ref_20136"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacters">TemplateCharacters</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-t>${</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="TemplateSubstitutionTail" type="lexical" id="prod-TemplateSubstitutionTail">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateSubstitutionTail">TemplateSubstitutionTail</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="zlwdxe92">
|
||
<emu-nt id="_ref_20137"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateMiddle">TemplateMiddle</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="v_5hijma">
|
||
<emu-nt id="_ref_20138"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateTail">TemplateTail</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="TemplateMiddle" type="lexical" id="prod-TemplateMiddle">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateMiddle">TemplateMiddle</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="n2nbtpup">
|
||
<emu-t>}</emu-t>
|
||
<emu-nt optional="" id="_ref_20139"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacters">TemplateCharacters</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-t>${</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="TemplateTail" type="lexical" id="prod-TemplateTail">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateTail">TemplateTail</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="_o9bwnqb">
|
||
<emu-t>}</emu-t>
|
||
<emu-nt optional="" id="_ref_20140"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacters">TemplateCharacters</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-t>`</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="TemplateCharacters" type="lexical" id="prod-TemplateCharacters">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacters">TemplateCharacters</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="-mjqxz72">
|
||
<emu-nt id="_ref_20141"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt>
|
||
<emu-nt optional="" id="_ref_20142"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacters">TemplateCharacters</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="TemplateCharacter" type="lexical" id="prod-TemplateCharacter">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="a8o1qsam">
|
||
<emu-t>$</emu-t>
|
||
<emu-gann>[lookahead ≠ <emu-t>{</emu-t>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="hva1-ccd">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_20143"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateEscapeSequence">TemplateEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="amrzzf_i">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_20144"><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ajkpm2ja">
|
||
<emu-nt id="_ref_20145"><a href="ecmascript-language-lexical-grammar.html#prod-LineContinuation">LineContinuation</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="vegl2qv9">
|
||
<emu-nt id="_ref_20146"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="tidqqejp">
|
||
<emu-nt id="_ref_20147"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-t>`</emu-t> or <emu-t>\</emu-t> or <emu-t>$</emu-t> or <emu-nt id="_ref_20148"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="TemplateEscapeSequence" type="lexical" id="prod-TemplateEscapeSequence">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateEscapeSequence">TemplateEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="6ehvb3kw">
|
||
<emu-nt id="_ref_20149"><a href="ecmascript-language-lexical-grammar.html#prod-CharacterEscapeSequence">CharacterEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="br2d94cy">
|
||
<emu-t>0</emu-t>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20150"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="qacbhaps">
|
||
<emu-nt id="_ref_20151"><a href="ecmascript-language-lexical-grammar.html#prod-HexEscapeSequence">HexEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="rl1vvdtr">
|
||
<emu-nt id="_ref_20152"><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="NotEscapeSequence" type="lexical" id="prod-NotEscapeSequence">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="wkfhlj8g">
|
||
<emu-t>0</emu-t>
|
||
<emu-nt id="_ref_20153"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ny9edrjl">
|
||
<emu-nt id="_ref_20154"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt> <emu-gmod>but not <emu-t>0</emu-t></emu-gmod>
|
||
</emu-rhs>
|
||
<emu-rhs a="zz8wwgpo">
|
||
<emu-t>x</emu-t>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20155"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="fwgfqqso">
|
||
<emu-t>x</emu-t>
|
||
<emu-nt id="_ref_20156"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20157"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="mwyqnw8x">
|
||
<emu-t>u</emu-t>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20158"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
<emu-gann>[lookahead ≠ <emu-t>{</emu-t>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="q3eunasx">
|
||
<emu-t>u</emu-t>
|
||
<emu-nt id="_ref_20159"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20160"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="r2foprbe">
|
||
<emu-t>u</emu-t>
|
||
<emu-nt id="_ref_20161"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20162"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20163"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="esa2zfmr">
|
||
<emu-t>u</emu-t>
|
||
<emu-nt id="_ref_20164"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20165"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20166"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20167"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="od14t37t">
|
||
<emu-t>u</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20168"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="olgecex1">
|
||
<emu-t>u</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-nt id="_ref_20169"><a href="ecmascript-language-lexical-grammar.html#prod-NotCodePoint">NotCodePoint</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20170"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="pj_qta32">
|
||
<emu-t>u</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-nt id="_ref_20171"><a href="ecmascript-language-lexical-grammar.html#prod-CodePoint">CodePoint</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20172"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
<emu-gann>[lookahead ≠ <emu-t>}</emu-t>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="NotCodePoint" type="lexical" id="prod-NotCodePoint">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NotCodePoint">NotCodePoint</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="iibaj99h">
|
||
<emu-nt params="~Sep" id="_ref_20173"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a><emu-mods><emu-params>[~Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-gmod>but only if the MV of <emu-nt id="_ref_20174"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a></emu-nt> > 0x10FFFF</emu-gmod>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="CodePoint" type="lexical" id="prod-CodePoint">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-CodePoint">CodePoint</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="_cg3azun">
|
||
<emu-nt params="~Sep" id="_ref_20175"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a><emu-mods><emu-params>[~Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-gmod>but only if the MV of <emu-nt id="_ref_20176"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a></emu-nt> ≤ 0x10FFFF</emu-gmod>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p><emu-nt id="_ref_20177"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateSubstitutionTail">TemplateSubstitutionTail</a></emu-nt> is used by the <emu-nt id="_ref_20178"><a href="ecmascript-language-lexical-grammar.html#prod-InputElementTemplateTail">InputElementTemplateTail</a></emu-nt> alternative lexical goal.</p>
|
||
</div></emu-note>
|
||
|
||
<emu-clause id="sec-static-semantics-tv" type="sdo" oldids="sec-static-semantics-tv-and-trv" aoid="TV"><span id="sec-static-semantics-tv-and-trv"></span>
|
||
<h1><span class="secnum">12.9.6.1</span> Static Semantics: TV</h1>
|
||
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_5918"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> TV takes no arguments and returns a String or <emu-val>undefined</emu-val>. A template literal component is interpreted by TV as a value of the <emu-xref href="#sec-ecmascript-language-types-string-type" id="_ref_5919"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type">String type</a></emu-xref>. TV is used to construct the indexed components of a template object (colloquially, the template values). In TV, escape sequences are replaced by the UTF-16 code unit(s) of the Unicode code point represented by the escape sequence.</p>
|
||
<ul>
|
||
<li>
|
||
The TV of <emu-grammar><emu-production name="NoSubstitutionTemplate" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="dxjmibqw">
|
||
<emu-t>`</emu-t>
|
||
<emu-t>`</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the empty String.
|
||
</li>
|
||
<li>
|
||
The TV of <emu-grammar><emu-production name="TemplateHead" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateHead">TemplateHead</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="jxmmarsm">
|
||
<emu-t>`</emu-t>
|
||
<emu-t>${</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the empty String.
|
||
</li>
|
||
<li>
|
||
The TV of <emu-grammar><emu-production name="TemplateMiddle" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateMiddle">TemplateMiddle</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="bg2t_-jo">
|
||
<emu-t>}</emu-t>
|
||
<emu-t>${</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the empty String.
|
||
</li>
|
||
<li>
|
||
The TV of <emu-grammar><emu-production name="TemplateTail" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateTail">TemplateTail</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="eouh0k9p">
|
||
<emu-t>}</emu-t>
|
||
<emu-t>`</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the empty String.
|
||
</li>
|
||
<li>
|
||
The TV of <emu-grammar><emu-production name="TemplateCharacters" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacters">TemplateCharacters</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="x55hrcdd">
|
||
<emu-nt id="_ref_20179"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt>
|
||
<emu-nt id="_ref_20180"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacters">TemplateCharacters</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is <emu-val>undefined</emu-val> if the TV of <emu-nt id="_ref_20181"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> is <emu-val>undefined</emu-val> or the TV of <emu-nt id="_ref_20182"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacters">TemplateCharacters</a></emu-nt> is <emu-val>undefined</emu-val>. Otherwise, it is the <emu-xref href="#string-concatenation" id="_ref_5920"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the TV of <emu-nt id="_ref_20183"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> and the TV of <emu-nt id="_ref_20184"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacters">TemplateCharacters</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="tidqqejp"><emu-nt id="_ref_20185"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-t>`</emu-t> or <emu-t>\</emu-t> or <emu-t>$</emu-t> or <emu-nt id="_ref_20186"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the result of performing <emu-xref aoid="UTF16EncodeCodePoint" id="_ref_5921"><a href="ecmascript-language-source-code.html#sec-utf16encodecodepoint">UTF16EncodeCodePoint</a></emu-xref> on the code point matched by <emu-nt id="_ref_20187"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="emlmkqfm"><emu-t>$</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x0024 (DOLLAR SIGN).
|
||
</li>
|
||
<li>
|
||
The TV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="hva1-ccd">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_20188"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateEscapeSequence">TemplateEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref aoid="SV" id="_ref_5922"><a href="ecmascript-language-lexical-grammar.html#sec-static-semantics-sv">SV</a></emu-xref> of <emu-nt id="_ref_20189"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateEscapeSequence">TemplateEscapeSequence</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="amrzzf_i">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_20190"><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is <emu-val>undefined</emu-val>.
|
||
</li>
|
||
<li>
|
||
The TV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="vegl2qv9"><emu-nt id="_ref_20191"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref aoid="TRV" id="_ref_5923"><a href="ecmascript-language-lexical-grammar.html#sec-static-semantics-trv">TRV</a></emu-xref> of <emu-nt id="_ref_20192"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TV of <emu-grammar><emu-production name="LineContinuation" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LineContinuation">LineContinuation</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="xik9y9lz">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_20193"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the empty String.
|
||
</li>
|
||
</ul>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-static-semantics-trv" type="sdo" aoid="TRV">
|
||
<h1><span class="secnum">12.9.6.2</span> Static Semantics: TRV</h1>
|
||
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_5924"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> TRV takes no arguments and returns a String. A template literal component is interpreted by TRV as a value of the <emu-xref href="#sec-ecmascript-language-types-string-type" id="_ref_5925"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type">String type</a></emu-xref>. TRV is used to construct the raw components of a template object (colloquially, the template raw values). TRV is similar to <emu-xref aoid="TV" id="_ref_5926"><a href="ecmascript-language-lexical-grammar.html#sec-static-semantics-tv">TV</a></emu-xref> with the difference being that in TRV, escape sequences are interpreted as they appear in the literal.</p>
|
||
<ul>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="NoSubstitutionTemplate" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="dxjmibqw">
|
||
<emu-t>`</emu-t>
|
||
<emu-t>`</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the empty String.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="TemplateHead" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateHead">TemplateHead</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="jxmmarsm">
|
||
<emu-t>`</emu-t>
|
||
<emu-t>${</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the empty String.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="TemplateMiddle" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateMiddle">TemplateMiddle</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="bg2t_-jo">
|
||
<emu-t>}</emu-t>
|
||
<emu-t>${</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the empty String.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="TemplateTail" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateTail">TemplateTail</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="eouh0k9p">
|
||
<emu-t>}</emu-t>
|
||
<emu-t>`</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the empty String.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="TemplateCharacters" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacters">TemplateCharacters</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="x55hrcdd">
|
||
<emu-nt id="_ref_20194"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt>
|
||
<emu-nt id="_ref_20195"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacters">TemplateCharacters</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5927"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the TRV of <emu-nt id="_ref_20196"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> and the TRV of <emu-nt id="_ref_20197"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacters">TemplateCharacters</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="tidqqejp"><emu-nt id="_ref_20198"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-t>`</emu-t> or <emu-t>\</emu-t> or <emu-t>$</emu-t> or <emu-nt id="_ref_20199"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the result of performing <emu-xref aoid="UTF16EncodeCodePoint" id="_ref_5928"><a href="ecmascript-language-source-code.html#sec-utf16encodecodepoint">UTF16EncodeCodePoint</a></emu-xref> on the code point matched by <emu-nt id="_ref_20200"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="emlmkqfm"><emu-t>$</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x0024 (DOLLAR SIGN).
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="hva1-ccd">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_20201"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateEscapeSequence">TemplateEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5929"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x005C (REVERSE SOLIDUS) and the TRV of <emu-nt id="_ref_20202"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateEscapeSequence">TemplateEscapeSequence</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="amrzzf_i">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_20203"><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5930"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x005C (REVERSE SOLIDUS) and the TRV of <emu-nt id="_ref_20204"><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="TemplateEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-TemplateEscapeSequence">TemplateEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ulmkmvlx"><emu-t>0</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x0030 (DIGIT ZERO).
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="wkfhlj8g">
|
||
<emu-t>0</emu-t>
|
||
<emu-nt id="_ref_20205"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5931"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x0030 (DIGIT ZERO) and the TRV of <emu-nt id="_ref_20206"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="zz8wwgpo">
|
||
<emu-t>x</emu-t>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20207"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x0078 (LATIN SMALL LETTER X).
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fwgfqqso">
|
||
<emu-t>x</emu-t>
|
||
<emu-nt id="_ref_20208"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20209"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5932"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x0078 (LATIN SMALL LETTER X) and the TRV of <emu-nt id="_ref_20210"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="mwyqnw8x">
|
||
<emu-t>u</emu-t>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20211"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
<emu-gann>[lookahead ≠ <emu-t>{</emu-t>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x0075 (LATIN SMALL LETTER U).
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="q3eunasx">
|
||
<emu-t>u</emu-t>
|
||
<emu-nt id="_ref_20212"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20213"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5933"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x0075 (LATIN SMALL LETTER U) and the TRV of <emu-nt id="_ref_20214"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="r2foprbe">
|
||
<emu-t>u</emu-t>
|
||
<emu-nt id="_ref_20215"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20216"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20217"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5934"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x0075 (LATIN SMALL LETTER U), the TRV of the first <emu-nt id="_ref_20218"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>, and the TRV of the second <emu-nt id="_ref_20219"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="esa2zfmr">
|
||
<emu-t>u</emu-t>
|
||
<emu-nt id="_ref_20220"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20221"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20222"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20223"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5935"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x0075 (LATIN SMALL LETTER U), the TRV of the first <emu-nt id="_ref_20224"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>, the TRV of the second <emu-nt id="_ref_20225"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>, and the TRV of the third <emu-nt id="_ref_20226"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="od14t37t">
|
||
<emu-t>u</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20227"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5936"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x0075 (LATIN SMALL LETTER U) and the code unit 0x007B (LEFT CURLY BRACKET).
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="olgecex1">
|
||
<emu-t>u</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-nt id="_ref_20228"><a href="ecmascript-language-lexical-grammar.html#prod-NotCodePoint">NotCodePoint</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20229"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5937"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x0075 (LATIN SMALL LETTER U), the code unit 0x007B (LEFT CURLY BRACKET), and the TRV of <emu-nt id="_ref_20230"><a href="ecmascript-language-lexical-grammar.html#prod-NotCodePoint">NotCodePoint</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="pj_qta32">
|
||
<emu-t>u</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-nt id="_ref_20231"><a href="ecmascript-language-lexical-grammar.html#prod-CodePoint">CodePoint</a></emu-nt>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_20232"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann>
|
||
<emu-gann>[lookahead ≠ <emu-t>}</emu-t>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5938"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x0075 (LATIN SMALL LETTER U), the code unit 0x007B (LEFT CURLY BRACKET), and the TRV of <emu-nt id="_ref_20233"><a href="ecmascript-language-lexical-grammar.html#prod-CodePoint">CodePoint</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="DecimalDigit" type="lexical" oneof="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>0</emu-t> <emu-t>1</emu-t> <emu-t>2</emu-t> <emu-t>3</emu-t> <emu-t>4</emu-t> <emu-t>5</emu-t> <emu-t>6</emu-t> <emu-t>7</emu-t> <emu-t>8</emu-t> <emu-t>9</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the result of performing <emu-xref aoid="UTF16EncodeCodePoint" id="_ref_5939"><a href="ecmascript-language-source-code.html#sec-utf16encodecodepoint">UTF16EncodeCodePoint</a></emu-xref> on the single code point matched by this production.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="CharacterEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-CharacterEscapeSequence">CharacterEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="t5gkmnte"><emu-nt id="_ref_20234"><a href="ecmascript-language-lexical-grammar.html#prod-NonEscapeCharacter">NonEscapeCharacter</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref aoid="SV" id="_ref_5940"><a href="ecmascript-language-lexical-grammar.html#sec-static-semantics-sv">SV</a></emu-xref> of <emu-nt id="_ref_20235"><a href="ecmascript-language-lexical-grammar.html#prod-NonEscapeCharacter">NonEscapeCharacter</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="SingleEscapeCharacter" type="lexical" oneof="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-SingleEscapeCharacter">SingleEscapeCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>'</emu-t> <emu-t>"</emu-t> <emu-t>\</emu-t> <emu-t>b</emu-t> <emu-t>f</emu-t> <emu-t>n</emu-t> <emu-t>r</emu-t> <emu-t>t</emu-t> <emu-t>v</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the result of performing <emu-xref aoid="UTF16EncodeCodePoint" id="_ref_5941"><a href="ecmascript-language-source-code.html#sec-utf16encodecodepoint">UTF16EncodeCodePoint</a></emu-xref> on the single code point matched by this production.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="HexEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexEscapeSequence">HexEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="2o-xpa4a">
|
||
<emu-t>x</emu-t>
|
||
<emu-nt id="_ref_20236"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20237"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5942"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x0078 (LATIN SMALL LETTER X), the TRV of the first <emu-nt id="_ref_20238"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>, and the TRV of the second <emu-nt id="_ref_20239"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="UnicodeEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ghktjvoi">
|
||
<emu-t>u</emu-t>
|
||
<emu-nt id="_ref_20240"><a href="ecmascript-language-lexical-grammar.html#prod-Hex4Digits">Hex4Digits</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5943"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x0075 (LATIN SMALL LETTER U) and the TRV of <emu-nt id="_ref_20241"><a href="ecmascript-language-lexical-grammar.html#prod-Hex4Digits">Hex4Digits</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="UnicodeEscapeSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="uybj7_dt">
|
||
<emu-t>u{</emu-t>
|
||
<emu-nt id="_ref_20242"><a href="ecmascript-language-lexical-grammar.html#prod-CodePoint">CodePoint</a></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5944"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x0075 (LATIN SMALL LETTER U), the code unit 0x007B (LEFT CURLY BRACKET), the TRV of <emu-nt id="_ref_20243"><a href="ecmascript-language-lexical-grammar.html#prod-CodePoint">CodePoint</a></emu-nt>, and the code unit 0x007D (RIGHT CURLY BRACKET).
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="Hex4Digits" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-Hex4Digits">Hex4Digits</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="c6jeysfq">
|
||
<emu-nt id="_ref_20244"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20245"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20246"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
<emu-nt id="_ref_20247"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5945"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the TRV of the first <emu-nt id="_ref_20248"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>, the TRV of the second <emu-nt id="_ref_20249"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>, the TRV of the third <emu-nt id="_ref_20250"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>, and the TRV of the fourth <emu-nt id="_ref_20251"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="HexDigits" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="yciymy2l">
|
||
<emu-nt id="_ref_20252"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a></emu-nt>
|
||
<emu-nt id="_ref_20253"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5946"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the TRV of <emu-nt id="_ref_20254"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a></emu-nt> and the TRV of <emu-nt id="_ref_20255"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="HexDigit" type="lexical" oneof="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-HexDigit">HexDigit</a></emu-nt> <emu-geq>::</emu-geq> <emu-oneof>one of</emu-oneof> <emu-rhs><emu-t>0</emu-t> <emu-t>1</emu-t> <emu-t>2</emu-t> <emu-t>3</emu-t> <emu-t>4</emu-t> <emu-t>5</emu-t> <emu-t>6</emu-t> <emu-t>7</emu-t> <emu-t>8</emu-t> <emu-t>9</emu-t> <emu-t>a</emu-t> <emu-t>b</emu-t> <emu-t>c</emu-t> <emu-t>d</emu-t> <emu-t>e</emu-t> <emu-t>f</emu-t> <emu-t>A</emu-t> <emu-t>B</emu-t> <emu-t>C</emu-t> <emu-t>D</emu-t> <emu-t>E</emu-t> <emu-t>F</emu-t></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the result of performing <emu-xref aoid="UTF16EncodeCodePoint" id="_ref_5947"><a href="ecmascript-language-source-code.html#sec-utf16encodecodepoint">UTF16EncodeCodePoint</a></emu-xref> on the single code point matched by this production.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="LineContinuation" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LineContinuation">LineContinuation</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="xik9y9lz">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt id="_ref_20256"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the <emu-xref href="#string-concatenation" id="_ref_5948"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x005C (REVERSE SOLIDUS) and the TRV of <emu-nt id="_ref_20257"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="LineTerminatorSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="eznvjwhz"><emu-gprose><LF></emu-gprose></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x000A (LINE FEED).
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="LineTerminatorSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="q1yr1eki"><emu-gprose><CR></emu-gprose></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x000A (LINE FEED).
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="LineTerminatorSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="eaiqsw9w"><emu-gprose><LS></emu-gprose></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x2028 (LINE SEPARATOR).
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="LineTerminatorSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="z8h10fxn"><emu-gprose><PS></emu-gprose></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x2029 (PARAGRAPH SEPARATOR).
|
||
</li>
|
||
<li>
|
||
The TRV of <emu-grammar><emu-production name="LineTerminatorSequence" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="lajs7kyd">
|
||
<emu-gprose><CR></emu-gprose>
|
||
<emu-gprose><LF></emu-gprose>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the String value consisting of the code unit 0x000A (LINE FEED).
|
||
</li>
|
||
</ul>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p><emu-xref aoid="TV" id="_ref_5949"><a href="ecmascript-language-lexical-grammar.html#sec-static-semantics-tv">TV</a></emu-xref> excludes the code units of <emu-nt id="_ref_20258"><a href="ecmascript-language-lexical-grammar.html#prod-LineContinuation">LineContinuation</a></emu-nt> while TRV includes them. <CR><LF> and <CR> <emu-nt id="_ref_20259"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt>s are normalized to <LF> for both <emu-xref aoid="TV" id="_ref_5950"><a href="ecmascript-language-lexical-grammar.html#sec-static-semantics-tv">TV</a></emu-xref> and TRV. An explicit <emu-nt id="_ref_20260"><a href="ecmascript-language-lexical-grammar.html#prod-TemplateEscapeSequence">TemplateEscapeSequence</a></emu-nt> is needed to include a <CR> or <CR><LF> sequence.</p>
|
||
</div></emu-note>
|
||
</emu-clause>
|
||
</emu-clause>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-automatic-semicolon-insertion">
|
||
<h1><span class="secnum">12.10</span> Automatic Semicolon Insertion</h1>
|
||
<p>Most ECMAScript statements and declarations must be terminated with a semicolon. Such semicolons may always appear explicitly in the source text. For convenience, however, such semicolons may be omitted from the source text in certain situations. These situations are described by saying that semicolons are automatically inserted into the source code token stream in those situations.</p>
|
||
|
||
<emu-clause id="sec-rules-of-automatic-semicolon-insertion" namespace="asi-rules">
|
||
<h1><span class="secnum">12.10.1</span> Rules of Automatic Semicolon Insertion</h1>
|
||
<p>In the following rules, “token” means the actual recognized lexical token determined using the current lexical <emu-xref href="#sec-context-free-grammars" id="_ref_17370"><a href="notational-conventions.html#sec-context-free-grammars">goal symbol</a></emu-xref> as described in clause <emu-xref href="#sec-ecmascript-language-lexical-grammar" id="_ref_393"><a href="ecmascript-language-lexical-grammar.html#sec-ecmascript-language-lexical-grammar">12</a></emu-xref>.</p>
|
||
<p>There are three basic rules of semicolon insertion:</p>
|
||
<ol>
|
||
<li>
|
||
<p>When, as the source text is parsed from left to right, a token (called the <em>offending token</em>) is encountered that is not allowed by any production of the grammar, then a semicolon is automatically inserted before the offending token if one or more of the following conditions is true:</p>
|
||
<ul>
|
||
<li>
|
||
The offending token is separated from the previous token by at least one <emu-nt id="_ref_20261"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
The offending token is <code>}</code>.
|
||
</li>
|
||
<li>
|
||
The previous token is <code>)</code> and the inserted semicolon would then be parsed as the terminating semicolon of a do-while statement (<emu-xref href="#sec-do-while-statement" id="_ref_394"><a href="ecmascript-language-statements-and-declarations.html#sec-do-while-statement">14.7.2</a></emu-xref>).
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
When, as the source text is parsed from left to right, the end of the input stream of tokens is encountered and the parser is unable to parse the input token stream as a single instance of the goal nonterminal, then a semicolon is automatically inserted at the end of the input stream.
|
||
</li>
|
||
<li>
|
||
When, as the source text is parsed from left to right, a token is encountered that is allowed by some production of the grammar, but the production is a <em>restricted production</em> and the token would be the first token for a terminal or nonterminal immediately following the annotation “[no <emu-nt id="_ref_20262"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]” within the restricted production (and therefore such a token is called a restricted token), and the restricted token is separated from the previous token by at least one <emu-nt id="_ref_20263"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt>, then a semicolon is automatically inserted before the restricted token.
|
||
</li>
|
||
</ol>
|
||
<p>However, there is an additional overriding condition on the preceding rules: a semicolon is never inserted automatically if the semicolon would then be parsed as an empty statement or if that semicolon would become one of the two semicolons in the header of a <code>for</code> statement (see <emu-xref href="#sec-for-statement" id="_ref_395"><a href="ecmascript-language-statements-and-declarations.html#sec-for-statement">14.7.4</a></emu-xref>).</p>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>The following are the only restricted productions in the grammar:</p>
|
||
<emu-grammar><emu-production name="UpdateExpression" params="Yield, Await">
|
||
<emu-nt params="Yield, Await"><a href="ecmascript-language-expressions.html#prod-UpdateExpression">UpdateExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="egpm8pw8">
|
||
<emu-nt params="?Yield, ?Await" id="_ref_20264"><a href="ecmascript-language-expressions.html#prod-LeftHandSideExpression">LeftHandSideExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-gann>[no <emu-nt id="_ref_20265"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-t>++</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="xaomniuu">
|
||
<emu-nt params="?Yield, ?Await" id="_ref_20266"><a href="ecmascript-language-expressions.html#prod-LeftHandSideExpression">LeftHandSideExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-gann>[no <emu-nt id="_ref_20267"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-t>--</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="ContinueStatement" params="Yield, Await">
|
||
<emu-nt params="Yield, Await"><a href="ecmascript-language-statements-and-declarations.html#prod-ContinueStatement">ContinueStatement</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="6qppgxyk">
|
||
<emu-t>continue</emu-t>
|
||
<emu-t>;</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="fiwlh1nt">
|
||
<emu-t>continue</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20268"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-nt params="?Yield, ?Await" id="_ref_20269"><a href="ecmascript-language-expressions.html#prod-LabelIdentifier">LabelIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>;</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="BreakStatement" params="Yield, Await">
|
||
<emu-nt params="Yield, Await"><a href="ecmascript-language-statements-and-declarations.html#prod-BreakStatement">BreakStatement</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tlip5zkt">
|
||
<emu-t>break</emu-t>
|
||
<emu-t>;</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="nio0l2c9">
|
||
<emu-t>break</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20270"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-nt params="?Yield, ?Await" id="_ref_20271"><a href="ecmascript-language-expressions.html#prod-LabelIdentifier">LabelIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>;</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="ReturnStatement" params="Yield, Await">
|
||
<emu-nt params="Yield, Await"><a href="ecmascript-language-statements-and-declarations.html#prod-ReturnStatement">ReturnStatement</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="cykzgrgr">
|
||
<emu-t>return</emu-t>
|
||
<emu-t>;</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="tybfdyhl">
|
||
<emu-t>return</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20272"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-nt params="+In, ?Yield, ?Await" id="_ref_20273"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>;</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="ThrowStatement" params="Yield, Await">
|
||
<emu-nt params="Yield, Await"><a href="ecmascript-language-statements-and-declarations.html#prod-ThrowStatement">ThrowStatement</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="q_cybpdb">
|
||
<emu-t>throw</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20274"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-nt params="+In, ?Yield, ?Await" id="_ref_20275"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>;</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="YieldExpression" params="In, Await">
|
||
<emu-nt params="In, Await"><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a><emu-mods><emu-params>[In, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="0d8zyjn8">
|
||
<emu-t>yield</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="alznzlpx">
|
||
<emu-t>yield</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20276"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-nt params="?In, +Yield, ?Await" id="_ref_20277"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a><emu-mods><emu-params>[?In, +Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="mrbi6v84">
|
||
<emu-t>yield</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20278"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-t>*</emu-t>
|
||
<emu-nt params="?In, +Yield, ?Await" id="_ref_20279"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a><emu-mods><emu-params>[?In, +Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="ArrowFunction" params="In, Yield, Await">
|
||
<emu-nt params="In, Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a><emu-mods><emu-params>[In, Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="c-igjs-g">
|
||
<emu-nt params="?Yield, ?Await" id="_ref_20280"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-gann>[no <emu-nt id="_ref_20281"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-t>=></emu-t>
|
||
<emu-nt params="?In" id="_ref_20282"><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a><emu-mods><emu-params>[?In]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="AsyncFunctionDeclaration" params="Yield, Await, Default">
|
||
<emu-nt params="Yield, Await, Default"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a><emu-mods><emu-params>[Yield, Await, Default]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="9rildsyw">
|
||
<emu-t>async</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20283"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-t>function</emu-t>
|
||
<emu-nt params="?Yield, ?Await" id="_ref_20284"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt params="~Yield, +Await" id="_ref_20285"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[~Yield, +Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-nt id="_ref_20286"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="_vbcugdo" constraints="+Default"><emu-constraints>[+Default]</emu-constraints>
|
||
<emu-t>async</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20287"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-t>function</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt params="~Yield, +Await" id="_ref_20288"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[~Yield, +Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-nt id="_ref_20289"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="AsyncFunctionExpression">
|
||
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mviccgpw">
|
||
<emu-t>async</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20290"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-t>function</emu-t>
|
||
<emu-nt params="~Yield, +Await" optional="" id="_ref_20291"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[~Yield, +Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt params="~Yield, +Await" id="_ref_20292"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[~Yield, +Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-nt id="_ref_20293"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="AsyncMethod" params="Yield, Await">
|
||
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncMethod">AsyncMethod</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tzooi3sy">
|
||
<emu-t>async</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20294"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-nt params="?Yield, ?Await" id="_ref_20295"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt params="~Yield, +Await" id="_ref_20296"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a><emu-mods><emu-params>[~Yield, +Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-nt id="_ref_20297"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="AsyncGeneratorDeclaration" params="Yield, Await, Default">
|
||
<emu-nt params="Yield, Await, Default"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a><emu-mods><emu-params>[Yield, Await, Default]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="vxevrvwx">
|
||
<emu-t>async</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20298"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-t>function</emu-t>
|
||
<emu-t>*</emu-t>
|
||
<emu-nt params="?Yield, ?Await" id="_ref_20299"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt params="+Yield, +Await" id="_ref_20300"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[+Yield, +Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-nt id="_ref_20301"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="zdnckwse" constraints="+Default"><emu-constraints>[+Default]</emu-constraints>
|
||
<emu-t>async</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20302"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-t>function</emu-t>
|
||
<emu-t>*</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt params="+Yield, +Await" id="_ref_20303"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[+Yield, +Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-nt id="_ref_20304"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="AsyncGeneratorExpression">
|
||
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="yh0wbqjf">
|
||
<emu-t>async</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20305"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-t>function</emu-t>
|
||
<emu-t>*</emu-t>
|
||
<emu-nt params="+Yield, +Await" optional="" id="_ref_20306"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[+Yield, +Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt params="+Yield, +Await" id="_ref_20307"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[+Yield, +Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-nt id="_ref_20308"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="AsyncGeneratorMethod" params="Yield, Await">
|
||
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorMethod">AsyncGeneratorMethod</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="bojlwy10">
|
||
<emu-t>async</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20309"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-t>*</emu-t>
|
||
<emu-nt params="?Yield, ?Await" id="_ref_20310"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt params="+Yield, +Await" id="_ref_20311"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a><emu-mods><emu-params>[+Yield, +Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-t>{</emu-t>
|
||
<emu-nt id="_ref_20312"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="AsyncArrowFunction" params="In, Yield, Await">
|
||
<emu-nt params="In, Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a><emu-mods><emu-params>[In, Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="u1dc5ef3">
|
||
<emu-t>async</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20313"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-nt params="?Yield" id="_ref_20314"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowBindingIdentifier">AsyncArrowBindingIdentifier</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt>
|
||
<emu-gann>[no <emu-nt id="_ref_20315"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-t>=></emu-t>
|
||
<emu-nt params="?In" id="_ref_20316"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a><emu-mods><emu-params>[?In]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="callcover">
|
||
<emu-nt params="?Yield, ?Await" id="_ref_20317"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-gann>[no <emu-nt id="_ref_20318"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-t>=></emu-t>
|
||
<emu-nt params="?In" id="_ref_20319"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a><emu-mods><emu-params>[?In]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="AsyncArrowHead">
|
||
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowHead">AsyncArrowHead</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ydfl_ghb">
|
||
<emu-t>async</emu-t>
|
||
<emu-gann>[no <emu-nt id="_ref_20320"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
|
||
<emu-nt params="~Yield, +Await" id="_ref_20321"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFormalParameters">ArrowFormalParameters</a><emu-mods><emu-params>[~Yield, +Await]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<p>The practical effect of these restricted productions is as follows:</p>
|
||
<ul>
|
||
<li>
|
||
When a <code>++</code> or <code>--</code> token is encountered where the parser would treat it as a postfix operator, and at least one <emu-nt id="_ref_20322"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> occurred between the preceding token and the <code>++</code> or <code>--</code> token, then a semicolon is automatically inserted before the <code>++</code> or <code>--</code> token.
|
||
</li>
|
||
<li>
|
||
When a <code>continue</code>, <code>break</code>, <code>return</code>, <code>throw</code>, or <code>yield</code> token is encountered and a <emu-nt id="_ref_20323"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> is encountered before the next token, a semicolon is automatically inserted after the <code>continue</code>, <code>break</code>, <code>return</code>, <code>throw</code>, or <code>yield</code> token.
|
||
</li>
|
||
<li>
|
||
When arrow function parameter(s) are followed by a <emu-nt id="_ref_20324"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> before a <code>=></code> token, a semicolon is automatically inserted and the punctuator causes a syntax error.
|
||
</li>
|
||
<li>
|
||
When an <code>async</code> token is followed by a <emu-nt id="_ref_20325"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> before a <code>function</code> or <emu-nt id="_ref_20326"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt> or <code>(</code> token, a semicolon is automatically inserted and the <code>async</code> token is not treated as part of the same expression or class element as the following tokens.
|
||
</li>
|
||
<li>
|
||
When an <code>async</code> token is followed by a <emu-nt id="_ref_20327"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> before a <code>*</code> token, a semicolon is automatically inserted and the punctuator causes a syntax error.
|
||
</li>
|
||
</ul>
|
||
<p>The resulting practical advice to ECMAScript programmers is:</p>
|
||
<ul>
|
||
<li>
|
||
A postfix <code>++</code> or <code>--</code> operator should be on the same line as its operand.
|
||
</li>
|
||
<li>
|
||
An <emu-nt id="_ref_20328"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt> in a <code>return</code> or <code>throw</code> statement or an <emu-nt id="_ref_20329"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt> in a <code>yield</code> expression should start on the same line as the <code>return</code>, <code>throw</code>, or <code>yield</code> token.
|
||
</li>
|
||
<li>
|
||
A <emu-nt id="_ref_20330"><a href="ecmascript-language-expressions.html#prod-LabelIdentifier">LabelIdentifier</a></emu-nt> in a <code>break</code> or <code>continue</code> statement should be on the same line as the <code>break</code> or <code>continue</code> token.
|
||
</li>
|
||
<li>
|
||
The end of an arrow function's parameter(s) and its <code>=></code> should be on the same line.
|
||
</li>
|
||
<li>
|
||
The <code>async</code> token preceding an asynchronous function or method should be on the same line as the immediately following token.
|
||
</li>
|
||
</ul>
|
||
</div></emu-note>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-examples-of-automatic-semicolon-insertion">
|
||
<h1><span class="secnum">12.10.2</span> Examples of Automatic Semicolon Insertion</h1>
|
||
<em>This section is non-normative.</em>
|
||
<p>The source</p>
|
||
<pre><code class="javascript hljs">{ <span class="hljs-number">1</span> <span class="hljs-number">2</span> } <span class="hljs-number">3</span></code></pre>
|
||
<p>is not a valid sentence in the ECMAScript grammar, even with the automatic semicolon insertion rules. In contrast, the source</p>
|
||
<pre><code class="javascript hljs">{ <span class="hljs-number">1</span>
|
||
<span class="hljs-number">2</span> } <span class="hljs-number">3</span></code></pre>
|
||
<p>is also not a valid ECMAScript sentence, but is transformed by automatic semicolon insertion into the following:</p>
|
||
<pre><code class="javascript hljs">{ <span class="hljs-number">1</span>
|
||
;<span class="hljs-number">2</span> ;} <span class="hljs-number">3</span>;</code></pre>
|
||
<p>which is a valid ECMAScript sentence.</p>
|
||
<p>The source</p>
|
||
<pre><code class="javascript hljs"><span class="hljs-keyword">for</span> (a; b
|
||
)</code></pre>
|
||
<p>is not a valid ECMAScript sentence and is not altered by automatic semicolon insertion because the semicolon is needed for the header of a <code>for</code> statement. Automatic semicolon insertion never inserts one of the two semicolons in the header of a <code>for</code> statement.</p>
|
||
<p>The source</p>
|
||
<pre><code class="javascript hljs"><span class="hljs-keyword">return</span>
|
||
a + b</code></pre>
|
||
<p>is transformed by automatic semicolon insertion into the following:</p>
|
||
<pre><code class="javascript hljs"><span class="hljs-keyword">return</span>;
|
||
a + b;</code></pre>
|
||
<emu-note><span class="note">Note 1</span><div class="note-contents">
|
||
<p>The expression <code>a + b</code> is not treated as a value to be returned by the <code>return</code> statement, because a <emu-nt id="_ref_20331"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> separates it from the token <code>return</code>.</p>
|
||
</div></emu-note>
|
||
<p>The source</p>
|
||
<pre><code class="javascript hljs">a = b
|
||
++c</code></pre>
|
||
<p>is transformed by automatic semicolon insertion into the following:</p>
|
||
<pre><code class="javascript hljs">a = b;
|
||
++c;</code></pre>
|
||
<emu-note><span class="note">Note 2</span><div class="note-contents">
|
||
<p>The token <code>++</code> is not treated as a postfix operator applying to the variable <code>b</code>, because a <emu-nt id="_ref_20332"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> occurs between <code>b</code> and <code>++</code>.</p>
|
||
</div></emu-note>
|
||
<p>The source</p>
|
||
<pre><code class="javascript hljs"><span class="hljs-keyword">if</span> (a > b)
|
||
<span class="hljs-keyword">else</span> c = d</code></pre>
|
||
<p>is not a valid ECMAScript sentence and is not altered by automatic semicolon insertion before the <code>else</code> token, even though no production of the grammar applies at that point, because an automatically inserted semicolon would then be parsed as an empty statement.</p>
|
||
<p>The source</p>
|
||
<pre><code class="javascript hljs">a = b + c
|
||
(d + e).<span class="hljs-title function_">print</span>()</code></pre>
|
||
<p>is <em>not</em> transformed by automatic semicolon insertion, because the parenthesized expression that begins the second line can be interpreted as an argument list for a function call:</p>
|
||
<pre><code class="javascript hljs">a = b + <span class="hljs-title function_">c</span>(d + e).<span class="hljs-title function_">print</span>()</code></pre>
|
||
<p>In the circumstance that an assignment statement must begin with a left parenthesis, it is a good idea for the programmer to provide an explicit semicolon at the end of the preceding statement rather than to rely on automatic semicolon insertion.</p>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-interesting-cases-of-automatic-semicolon-insertion">
|
||
<h1><span class="secnum">12.10.3</span> Interesting Cases of Automatic Semicolon Insertion</h1>
|
||
<em>This section is non-normative.</em>
|
||
<p>ECMAScript programs can be written in a style with very few semicolons by relying on automatic semicolon insertion. As described above, semicolons are not inserted at every newline, and automatic semicolon insertion can depend on multiple tokens across line terminators.</p>
|
||
|
||
<p>As new syntactic features are added to ECMAScript, additional grammar productions could be added that cause lines relying on automatic semicolon insertion preceding them to change grammar productions when parsed.</p>
|
||
|
||
<p>For the purposes of this section, a case of automatic semicolon insertion is considered interesting if it is a place where a semicolon may or may not be inserted, depending on the source text which precedes it. The rest of this section describes a number of interesting cases of automatic semicolon insertion in this version of ECMAScript.</p>
|
||
|
||
<emu-clause id="sec-asi-interesting-cases-in-statement-lists">
|
||
<h1><span class="secnum">12.10.3.1</span> Interesting Cases of Automatic Semicolon Insertion in Statement Lists</h1>
|
||
<p>In a <emu-nt id="_ref_20333"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a></emu-nt>, many <emu-nt id="_ref_20334"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementListItem">StatementListItem</a></emu-nt>s end in semicolons, which may be omitted using automatic semicolon insertion. As a consequence of the rules above, at the end of a line ending an expression, a semicolon is required if the following line begins with any of the following:</p>
|
||
<ul>
|
||
<li><strong>An opening parenthesis (<code>(</code>)</strong>. Without a semicolon, the two lines together are treated as a <emu-nt id="_ref_20335"><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt>.</li>
|
||
<li><strong>An opening square bracket (<code>[</code>)</strong>. Without a semicolon, the two lines together are treated as property access, rather than an <emu-nt id="_ref_20336"><a href="ecmascript-language-expressions.html#prod-ArrayLiteral">ArrayLiteral</a></emu-nt> or <emu-nt id="_ref_20337"><a href="ecmascript-language-expressions.html#prod-ArrayAssignmentPattern">ArrayAssignmentPattern</a></emu-nt>.</li>
|
||
<li><strong>A template literal (<code>`</code>)</strong>. Without a semicolon, the two lines together are interpreted as a tagged Template (<emu-xref href="#sec-tagged-templates" id="_ref_396"><a href="ecmascript-language-expressions.html#sec-tagged-templates">13.3.11</a></emu-xref>), with the previous expression as the <emu-nt id="_ref_20338"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt>.</li>
|
||
<li><strong>Unary <code>+</code> or <code>-</code></strong>. Without a semicolon, the two lines together are interpreted as a usage of the corresponding binary operator.</li>
|
||
<li><strong>A RegExp literal</strong>. Without a semicolon, the two lines together may be parsed instead as the <code>/</code> <emu-nt id="_ref_20339"><a href="ecmascript-language-expressions.html#prod-MultiplicativeOperator">MultiplicativeOperator</a></emu-nt>, for example if the RegExp has flags.</li>
|
||
</ul>
|
||
</emu-clause>
|
||
|
||
<emu-clause id="sec-asi-cases-with-no-lineterminator-here">
|
||
<h1><span class="secnum">12.10.3.2</span> Cases of Automatic Semicolon Insertion and “[no <emu-nt id="_ref_20340"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]”</h1>
|
||
<em>This section is non-normative.</em>
|
||
<p>ECMAScript contains grammar productions which include “[no <emu-nt id="_ref_20341"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]”. These productions are sometimes a means to have optional operands in the grammar. Introducing a <emu-nt id="_ref_20342"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> in these locations would change the grammar production of a source text by using the grammar production without the optional operand.</p>
|
||
|
||
<p>The rest of this section describes a number of productions using “[no <emu-nt id="_ref_20343"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]” in this version of ECMAScript.</p>
|
||
|
||
<emu-clause id="sec-no-lineterminator-here-automatic-semicolon-insertion-list">
|
||
<h1><span class="secnum">12.10.3.2.1</span> List of Grammar Productions with Optional Operands and “[no <emu-nt id="_ref_20344"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]”</h1>
|
||
<ul>
|
||
<li><emu-nt id="_ref_20345"><a href="ecmascript-language-expressions.html#prod-UpdateExpression">UpdateExpression</a></emu-nt>.</li>
|
||
<li><emu-nt id="_ref_20346"><a href="ecmascript-language-statements-and-declarations.html#prod-ContinueStatement">ContinueStatement</a></emu-nt>.</li>
|
||
<li><emu-nt id="_ref_20347"><a href="ecmascript-language-statements-and-declarations.html#prod-BreakStatement">BreakStatement</a></emu-nt>.</li>
|
||
<li><emu-nt id="_ref_20348"><a href="ecmascript-language-statements-and-declarations.html#prod-ReturnStatement">ReturnStatement</a></emu-nt>.</li>
|
||
<li><emu-nt id="_ref_20349"><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt>.</li>
|
||
<li>Async Function Definitions (<emu-xref href="#sec-async-function-definitions" id="_ref_397"><a href="ecmascript-language-functions-and-classes.html#sec-async-function-definitions">15.8</a></emu-xref>) with relation to Function Definitions (<emu-xref href="#sec-function-definitions" id="_ref_398"><a href="ecmascript-language-functions-and-classes.html#sec-function-definitions">15.2</a></emu-xref>)</li>
|
||
</ul>
|
||
</emu-clause>
|
||
</emu-clause>
|
||
</emu-clause>
|
||
</emu-clause>
|
||
</emu-clause></div></body></html> |