This repository was archived by the owner on Jan 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
744 lines (628 loc) · 75.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
<!doctype html>
<head><meta charset="utf-8">
<link rel="stylesheet" href="ecmarkup.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<script src="ecmarkup.js"></script>
<title>Template Literal Revision</title><script type="application/json" id="menu-search-biblio">[{"type":"clause","id":"","aoid":null,"title":"Introduction","number":"","namespace":"<no location>","location":"","key":"Introduction"},{"type":"clause","id":"sec-template-literal-lexical-components","aoid":null,"title":"(11.8.6) Template Literal Lexical Components","number":"1","namespace":"<no location>","location":"","key":"(11.8.6) Template Literal Lexical Components"},{"type":"clause","id":"sec-static-semantics-tv-and-trv","aoid":null,"title":"(11.8.6.1) Static Semantics: TV and TRV","number":"2","namespace":"<no location>","location":"","key":"(11.8.6.1) Static Semantics: TV and TRV"},{"type":"clause","id":"sec-template-literals","aoid":null,"title":"(12.2.9) Template Literals","number":"3","namespace":"<no location>","location":"","key":"(12.2.9) Template Literals"},{"type":"clause","id":"sec-static-semantics-template-early-errors","aoid":null,"title":"Static Semantics: Early Errors","number":"4","namespace":"<no location>","location":"","key":"Static Semantics: Early Errors"},{"type":"clause","id":"sec-left-hand-side-expressions","aoid":null,"title":"(12.3) Left-Hand-Side Expressions","number":"5","namespace":"<no location>","location":"","key":"(12.3) Left-Hand-Side Expressions"},{"type":"clause","id":"sec-copyright-and-software-license","aoid":null,"title":"Copyright & Software License","number":"A","namespace":"<no location>","location":"","key":"Copyright & Software License"},{"type":"production","id":"prod-Template","name":"Template","namespace":"<no location>","location":"","key":"Template"},{"type":"production","id":"prod-NoSubstitutionTemplate","name":"NoSubstitutionTemplate","namespace":"<no location>","location":"","key":"NoSubstitutionTemplate"},{"type":"production","id":"prod-TemplateHead","name":"TemplateHead","namespace":"<no location>","location":"","key":"TemplateHead"},{"type":"production","id":"prod-TemplateSubstitutionTail","name":"TemplateSubstitutionTail","namespace":"<no location>","location":"","key":"TemplateSubstitutionTail"},{"type":"production","id":"prod-TemplateMiddle","name":"TemplateMiddle","namespace":"<no location>","location":"","key":"TemplateMiddle"},{"type":"production","id":"prod-TemplateTail","name":"TemplateTail","namespace":"<no location>","location":"","key":"TemplateTail"},{"type":"production","id":"prod-TemplateCharacters","name":"TemplateCharacters","namespace":"<no location>","location":"","key":"TemplateCharacters"},{"type":"production","id":"prod-TemplateCharacter","name":"TemplateCharacter","namespace":"<no location>","location":"","key":"TemplateCharacter"},{"type":"production","id":"prod-NotEscapeSequence","name":"NotEscapeSequence","namespace":"<no location>","location":"","key":"NotEscapeSequence"},{"type":"production","id":"prod-NotCodePoint","name":"NotCodePoint","namespace":"<no location>","location":"","key":"NotCodePoint"},{"type":"production","id":"prod-CodePoint","name":"CodePoint","namespace":"<no location>","location":"","key":"CodePoint"},{"type":"production","id":"prod-LineContinuation","name":"LineContinuation","namespace":"<no location>","location":"","key":"LineContinuation"},{"type":"production","id":"prod-EscapeSequence","name":"EscapeSequence","namespace":"<no location>","location":"","key":"EscapeSequence"},{"type":"production","id":"prod-DecimalDigit","name":"DecimalDigit","namespace":"<no location>","location":"","key":"DecimalDigit"},{"type":"production","id":"prod-CharacterEscapeSequence","name":"CharacterEscapeSequence","namespace":"<no location>","location":"","key":"CharacterEscapeSequence"},{"type":"production","id":"prod-SingleEscapeCharacter","name":"SingleEscapeCharacter","namespace":"<no location>","location":"","key":"SingleEscapeCharacter"},{"type":"production","id":"prod-HexEscapeSequence","name":"HexEscapeSequence","namespace":"<no location>","location":"","key":"HexEscapeSequence"},{"type":"production","id":"prod-UnicodeEscapeSequence","name":"UnicodeEscapeSequence","namespace":"<no location>","location":"","key":"UnicodeEscapeSequence"},{"type":"production","id":"prod-Hex4Digits","name":"Hex4Digits","namespace":"<no location>","location":"","key":"Hex4Digits"},{"type":"production","id":"prod-HexDigits","name":"HexDigits","namespace":"<no location>","location":"","key":"HexDigits"},{"type":"production","id":"prod-LineTerminatorSequence","name":"LineTerminatorSequence","namespace":"<no location>","location":"","key":"LineTerminatorSequence"},{"type":"production","id":"prod-TemplateLiteral","name":"TemplateLiteral","namespace":"<no location>","location":"","key":"TemplateLiteral"},{"type":"production","id":"prod-SubstitutionTemplate","name":"SubstitutionTemplate","namespace":"<no location>","location":"","key":"SubstitutionTemplate"},{"type":"production","id":"prod-TemplateSpans","name":"TemplateSpans","namespace":"<no location>","location":"","key":"TemplateSpans"},{"type":"production","id":"prod-TemplateMiddleList","name":"TemplateMiddleList","namespace":"<no location>","location":"","key":"TemplateMiddleList"},{"type":"production","id":"prod-MemberExpression","name":"MemberExpression","namespace":"<no location>","location":"","key":"MemberExpression"},{"type":"production","id":"prod-CallExpression","name":"CallExpression","namespace":"<no location>","location":"","key":"CallExpression"}]</script></head><body><div id="menu-toggle">☰</div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#" title="Introduction"><span class="secnum"></span> Introduction</a></li><li><span class="item-toggle-none"></span><a href="#sec-template-literal-lexical-components" title="(11.8.6) Template Literal Lexical Components"><span class="secnum">1</span> (11.8.6) Template Literal Lexical Components</a></li><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-tv-and-trv" title="(11.8.6.1) Static Semantics: TV and TRV"><span class="secnum">2</span> (11.8.6.1) SS: TV and TRV</a></li><li><span class="item-toggle-none"></span><a href="#sec-template-literals" title="(12.2.9) Template Literals"><span class="secnum">3</span> (12.2.9) Template Literals</a></li><li><span class="item-toggle-none"></span><a href="#sec-static-semantics-template-early-errors" title="Static Semantics: Early Errors"><span class="secnum">4</span> SS: Early Errors</a></li><li><span class="item-toggle-none"></span><a href="#sec-left-hand-side-expressions" title="(12.3) Left-Hand-Side Expressions"><span class="secnum">5</span> (12.3) Left-Hand-Side Expressions</a></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright & Software License"><span class="secnum">A</span> Copyright & Software License</a></li></ol></div></div><h1 class="version">Stage 4 / September 12, 2017</h1><h1 class="title">Template Literal Revision</h1>
<emu-intro>
<h1><span class="secnum"></span>Introduction<span class="utils"><span class="anchor"><a href="#">#</a></span></span></h1>
<p>Template literals should allow the embedding of languages (DSLs etc.). But restrictions on escape sequences make this problematic.</p>
<p>For example, consider making a latex processor with templates:</p>
<pre><code class="javascript hljs"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">latex</span>(<span class="hljs-params">strings</span>) </span>{
<span class="hljs-comment">// ...</span>
}
<span class="hljs-keyword">let</span> <span class="hljs-built_in">document</span> = latex<span class="hljs-string">`
\newcommand{\fun}{\textbf{Fun!}} // works just fine
\newcommand{\unicode}{\textbf{Unicode!}} // Illegal token!
\newcommand{\xerxes}{\textbf{King!}} // Illegal token!
Breve over the h goes \u{h}ere // Illegal token!
`</span></code></pre>
<p>The problem here is that <code>\u</code> is the start of a unicode escape, but ES grammar forces it to be of the form <code>\u00FF</code> or <code>\u{42}</code>
and considers the token <code>\unicode</code> illegal.
Similarly <code>\x</code> is the start of a hex escape like <code>\xFF</code> but <code>\xerxes</code> is illegal. Octal literal escapes have the same problem; <code>\0100</code> is illegal.</p>
<h2>Proposal Overview</h2>
<p>Remove the restriction on escape sequences.</p>
<p>Lifting the restriction raises the question of how to handle cooked template values that contain illegal escape sequences. Currently, cooked template values are supposed to replace escape sequences with the "Unicode code point represented by the escape sequence" but this can't happen if the escape sequence is not valid.</p>
<p>The proposed solution is to set the cooked value to <code>undefined</code> for template values that contain illegal escape sequences. The raw value is still accessible via <code>.raw</code> so embedded DSLs that might contain <code>undefined</code> cooked values can just use the raw string:</p>
<pre><code class="javascript hljs"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">tag</span>(<span class="hljs-params">strs</span>) </span>{
strs[<span class="hljs-number">0</span>] === <span class="hljs-literal">undefined</span>
strs.raw[<span class="hljs-number">0</span>] === <span class="hljs-string">"\\unicode and \\u{55}"</span>;
}
tag<span class="hljs-string">`\unicode and \u{55}`</span></code></pre>
<p>This loosening of the escape sequence restriction only applies to tagged template literals; untagged templates still throw an <emu-xref href="#early-error"><a href="https://tc39.github.io/ecma262/#early-error">early error</a></emu-xref> for invalid escape sequences:</p>
<pre><code class="javascript hljs"><span class="hljs-keyword">let</span> bad = <span class="hljs-string">`bad escape sequence: \unicode`</span>; <span class="hljs-comment">// throws early error</span></code></pre>
</emu-intro>
<!-- es6num="11.8.6" -->
<emu-clause id="sec-template-literal-lexical-components">
<h1><span class="secnum">1</span>(<a href="https://tc39.github.io/ecma262/#sec-template-literal-lexical-components">11.8.6</a>) Template Literal Lexical Components<span class="utils"><span class="anchor"><a href="#sec-template-literal-lexical-components">#</a></span></span></h1>
<h2>Syntax</h2>
<emu-grammar><emu-production name="Template" type="lexical" id="prod-Template">
<emu-nt><a href="#prod-Template">Template</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="7bf3ad2b"><emu-nt><a href="#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt></emu-rhs>
<emu-rhs a="ab9a4b96"><emu-nt><a href="#prod-TemplateHead">TemplateHead</a></emu-nt></emu-rhs>
</emu-production>
<emu-production name="NoSubstitutionTemplate" type="lexical" id="prod-NoSubstitutionTemplate">
<emu-nt><a href="#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="056f5c6b"><emu-t>`</emu-t><emu-nt optional=""><a href="#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="#prod-TemplateHead">TemplateHead</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="bfb172fc"><emu-t>`</emu-t><emu-nt optional=""><a href="#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="#prod-TemplateSubstitutionTail">TemplateSubstitutionTail</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="ccbc035d"><emu-nt><a href="#prod-TemplateMiddle">TemplateMiddle</a></emu-nt></emu-rhs>
<emu-rhs a="57fe6188"><emu-nt><a href="#prod-TemplateTail">TemplateTail</a></emu-nt></emu-rhs>
</emu-production>
<emu-production name="TemplateMiddle" type="lexical" id="prod-TemplateMiddle">
<emu-nt><a href="#prod-TemplateMiddle">TemplateMiddle</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="37635b4e"><emu-t>}</emu-t><emu-nt optional=""><a href="#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="#prod-TemplateTail">TemplateTail</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="fcef5bc0"><emu-t>}</emu-t><emu-nt optional=""><a href="#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="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="f8c26ac5"><emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-nt optional=""><a href="#prod-TemplateCharacters">TemplateCharacters</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt></emu-rhs>
</emu-production></emu-grammar>
<del class="block">
<emu-grammar><emu-production name="TemplateCharacter" type="lexical" id="prod-TemplateCharacter">
<emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="03c3b542"><emu-t>$</emu-t><emu-gann>[lookahead ≠ <emu-t>{</emu-t>]</emu-gann></emu-rhs>
<emu-rhs a="ea7d8d26"><emu-t>\</emu-t><emu-nt><a href="#prod-EscapeSequence">EscapeSequence</a></emu-nt></emu-rhs>
<emu-rhs a="00992933"><emu-nt><a href="#prod-LineContinuation">LineContinuation</a></emu-nt></emu-rhs>
<emu-rhs a="544825da"><emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt></emu-rhs>
<emu-rhs a="4c80ea41"><emu-nt><a href="https://tc39.github.io/ecma262/#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><a href="https://tc39.github.io/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod></emu-rhs>
</emu-production></emu-grammar>
</del>
<ins class="block">
<emu-grammar><emu-production name="TemplateCharacter" type="lexical">
<emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="03c3b542"><emu-t>$</emu-t><emu-gann>[lookahead ≠ <emu-t>{</emu-t>]</emu-gann></emu-rhs>
<emu-rhs a="ea7d8d26"><emu-t>\</emu-t><emu-nt><a href="#prod-EscapeSequence">EscapeSequence</a></emu-nt></emu-rhs>
<emu-rhs a="68cad9cc"><emu-t>\</emu-t><emu-nt><a href="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt></emu-rhs>
<emu-rhs a="00992933"><emu-nt><a href="#prod-LineContinuation">LineContinuation</a></emu-nt></emu-rhs>
<emu-rhs a="544825da"><emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt></emu-rhs>
<emu-rhs a="4c80ea41"><emu-nt><a href="https://tc39.github.io/ecma262/#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><a href="https://tc39.github.io/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod></emu-rhs>
</emu-production></emu-grammar>
</ins>
<ins class="block">
<emu-grammar><emu-production name="NotEscapeSequence" type="lexical" id="prod-NotEscapeSequence">
<emu-nt><a href="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="c247e196"><emu-t>0</emu-t><emu-nt><a href="#prod-DecimalDigit">DecimalDigit</a></emu-nt></emu-rhs>
<emu-rhs a="372f5e0d"><emu-nt><a href="#prod-DecimalDigit">DecimalDigit</a></emu-nt><emu-gmod>but not <emu-t>0</emu-t></emu-gmod></emu-rhs>
<emu-rhs a="e6c4f6ee"><emu-t>x</emu-t><emu-gann>[lookahead ∉ <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann></emu-rhs>
<emu-rhs a="92cdf202"><emu-t>x</emu-t><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-gann>[lookahead ∉ <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann></emu-rhs>
<emu-rhs a="a16001b3"><emu-t>u</emu-t><emu-gann>[lookahead ∉ <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann><emu-gann>[lookahead ≠ <emu-t>{</emu-t>]</emu-gann></emu-rhs>
<emu-rhs a="f7d3e8d4"><emu-t>u</emu-t><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-gann>[lookahead ∉ <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann></emu-rhs>
<emu-rhs a="4ea47d3d"><emu-t>u</emu-t><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-gann>[lookahead ∉ <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann></emu-rhs>
<emu-rhs a="45170c27"><emu-t>u</emu-t><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-gann>[lookahead ∉ <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann></emu-rhs>
<emu-rhs a="5427e268"><emu-t>u</emu-t><emu-t>{</emu-t><emu-gann>[lookahead ∉ <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann></emu-rhs>
<emu-rhs a="4acc9c15"><emu-t>u</emu-t><emu-t>{</emu-t><emu-nt><a href="#prod-NotCodePoint">NotCodePoint</a></emu-nt></emu-rhs>
<emu-rhs a="f2130e7c"><emu-t>u</emu-t><emu-t>{</emu-t><emu-nt><a href="#prod-CodePoint">CodePoint</a></emu-nt><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="#prod-NotCodePoint">NotCodePoint</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="011d5f4d"><emu-nt><a href="#prod-HexDigits">HexDigits</a></emu-nt><emu-gmod>but not if MV of HexDigits ≤ 0x10FFFF </emu-gmod></emu-rhs>
</emu-production>
<emu-production name="CodePoint" type="lexical" id="prod-CodePoint">
<emu-nt><a href="#prod-CodePoint">CodePoint</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="a8b2c3ce"><emu-nt><a href="#prod-HexDigits">HexDigits</a></emu-nt><emu-gmod>but not if MV of HexDigits > 0x10FFFF </emu-gmod></emu-rhs>
</emu-production></emu-grammar>
</ins>
<p>A conforming implementation must not use the extended definition of <emu-nt><a href="#prod-EscapeSequence">EscapeSequence</a></emu-nt> described in <emu-xref href="#sec-additional-syntax-string-literals"><a href="https://tc39.github.io/ecma262/#sec-additional-syntax-string-literals">B.1.2</a></emu-xref> when parsing a <emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt>.</p>
<emu-note><span class="note">Note</span>
<p><emu-nt><a href="#prod-TemplateSubstitutionTail">TemplateSubstitutionTail</a></emu-nt> is used by the <emu-nt><a href="https://tc39.github.io/ecma262/#prod-InputElementTemplateTail">InputElementTemplateTail</a></emu-nt> alternative lexical goal.</p>
</emu-note>
</emu-clause>
<!-- es6num="11.8.6.1" -->
<emu-clause id="sec-static-semantics-tv-and-trv">
<h1><span class="secnum">2</span>(<a href="https://tc39.github.io/ecma262/#sec-static-semantics-tv-and-trv">11.8.6.1</a>) Static Semantics: TV and TRV<span class="utils"><span class="anchor"><a href="#sec-static-semantics-tv-and-trv">#</a></span></span></h1>
<p>A template literal component is interpreted as a sequence of Unicode code points. The Template Value (TV) of a literal component is described in terms of code unit values (SV, <emu-xref href="#sec-literals-string-literals"><a href="https://tc39.github.io/ecma262/#sec-literals-string-literals">11.8.4</a></emu-xref>) contributed by the various parts of the template literal component. As part of this process, some Unicode code points within the template component are interpreted as having a mathematical value (MV, <emu-xref href="#sec-literals-numeric-literals"><a href="https://tc39.github.io/ecma262/#sec-literals-numeric-literals">11.8.3</a></emu-xref>). In determining a TV, escape sequences are replaced by the UTF-16 code unit(s) of the Unicode code point represented by the escape sequence. The Template Raw Value (TRV) is similar to a Template Value with the difference that in TRVs escape sequences are interpreted literally.</p>
<ul>
<li>
The TV and TRV of <emu-grammar><emu-production name="NoSubstitutionTemplate" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="7718e620"><emu-t>`</emu-t><emu-t>`</emu-t></emu-rhs>
</emu-production></emu-grammar> is the empty code unit sequence.
</li>
<li>
The TV and TRV of <emu-grammar><emu-production name="TemplateHead" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateHead">TemplateHead</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="25732601"><emu-t>`</emu-t><emu-t>${</emu-t></emu-rhs>
</emu-production></emu-grammar> is the empty code unit sequence.
</li>
<li>
The TV and TRV of <emu-grammar><emu-production name="TemplateMiddle" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateMiddle">TemplateMiddle</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="046dadff"><emu-t>}</emu-t><emu-t>${</emu-t></emu-rhs>
</emu-production></emu-grammar> is the empty code unit sequence.
</li>
<li>
The TV and TRV of <emu-grammar><emu-production name="TemplateTail" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateTail">TemplateTail</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="7a8ba1d2"><emu-t>}</emu-t><emu-t>`</emu-t></emu-rhs>
</emu-production></emu-grammar> is the empty code unit sequence.
</li>
<li>
The TV of <emu-grammar><emu-production name="NoSubstitutionTemplate" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="2d6bd81e"><emu-t>`</emu-t><emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-t>`</emu-t></emu-rhs>
</emu-production></emu-grammar> is the TV of <emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt>.
</li>
<li>
The TV of <emu-grammar><emu-production name="TemplateHead" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateHead">TemplateHead</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="5451d6b2"><emu-t>`</emu-t><emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-t>${</emu-t></emu-rhs>
</emu-production></emu-grammar> is the TV of <emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt>.
</li>
<li>
The TV of <emu-grammar><emu-production name="TemplateMiddle" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateMiddle">TemplateMiddle</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="b95ec100"><emu-t>}</emu-t><emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-t>${</emu-t></emu-rhs>
</emu-production></emu-grammar> is the TV of <emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt>.
</li>
<li>
The TV of <emu-grammar><emu-production name="TemplateTail" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateTail">TemplateTail</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="ab941abd"><emu-t>}</emu-t><emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-t>`</emu-t></emu-rhs>
</emu-production></emu-grammar> is the TV of <emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt>.
</li>
<li>
The TV of <emu-grammar><emu-production name="TemplateCharacters" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="feb9caa8"><emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the TV of <emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt>.
</li>
<del class="block">
<li>
The TV of <emu-grammar><emu-production name="TemplateCharacters" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="5f9e47ad"><emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is a sequence consisting of the code units in the TV of <emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> followed by all the code units in the TV of <emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt> in order.
</li>
</del>
<ins class="block">
<li>
The TV of <emu-grammar><emu-production name="TemplateCharacters" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="5f9e47ad"><emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is:
<ul>
<li><emu-val>undefined</emu-val> if the TV of <emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> is <emu-val>undefined</emu-val> or the TV of <emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt> is <emu-val>undefined</emu-val>, or</li>
<li>a sequence consisting of the code units in the TV of <emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> followed by all the code units in the TV of <emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt> in order.</li>
</ul>
</li>
</ins>
<li>
The TV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="4c80ea41"><emu-nt><a href="https://tc39.github.io/ecma262/#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><a href="https://tc39.github.io/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod></emu-rhs>
</emu-production></emu-grammar> is the <emu-xref aoid="UTF16Encoding"><a href="https://tc39.github.io/ecma262/#sec-utf16encoding">UTF16Encoding</a></emu-xref> of the code point value of <emu-nt><a href="https://tc39.github.io/ecma262/#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="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="1262cc92"><emu-t>$</emu-t></emu-rhs>
</emu-production></emu-grammar> is the code unit value 0x0024.
</li>
<li>
The TV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="ea7d8d26"><emu-t>\</emu-t><emu-nt><a href="#prod-EscapeSequence">EscapeSequence</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the SV of <emu-nt><a href="#prod-EscapeSequence">EscapeSequence</a></emu-nt>.
</li>
<ins class="block">
<li>
The TV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="68cad9cc"><emu-t>\</emu-t><emu-nt><a href="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is <emu-val>undefined</emu-val>.
</li>
</ins>
<li>
The TV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="00992933"><emu-nt><a href="#prod-LineContinuation">LineContinuation</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the TV of <emu-nt><a href="#prod-LineContinuation">LineContinuation</a></emu-nt>.
</li>
<li>
The TV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="544825da"><emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the TRV of <emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt>.
</li>
<li>
The TV of <emu-grammar><emu-production name="LineContinuation" type="lexical" collapsed="" id="prod-LineContinuation" class=" inline">
<emu-nt><a href="#prod-LineContinuation">LineContinuation</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="c4893d63"><emu-t>\</emu-t><emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the empty code unit sequence.
</li>
<li>
The TRV of <emu-grammar><emu-production name="NoSubstitutionTemplate" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="2d6bd81e"><emu-t>`</emu-t><emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-t>`</emu-t></emu-rhs>
</emu-production></emu-grammar> is the TRV of <emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="TemplateHead" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateHead">TemplateHead</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="5451d6b2"><emu-t>`</emu-t><emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-t>${</emu-t></emu-rhs>
</emu-production></emu-grammar> is the TRV of <emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="TemplateMiddle" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateMiddle">TemplateMiddle</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="b95ec100"><emu-t>}</emu-t><emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-t>${</emu-t></emu-rhs>
</emu-production></emu-grammar> is the TRV of <emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="TemplateTail" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateTail">TemplateTail</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="ab941abd"><emu-t>}</emu-t><emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-t>`</emu-t></emu-rhs>
</emu-production></emu-grammar> is the TRV of <emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="TemplateCharacters" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="feb9caa8"><emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the TRV of <emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="TemplateCharacters" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="5f9e47ad"><emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is a sequence consisting of the code units in the TRV of <emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt> followed by all the code units in the TRV of <emu-nt><a href="#prod-TemplateCharacters">TemplateCharacters</a></emu-nt>, in order.
</li>
<li>
The TRV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="4c80ea41"><emu-nt><a href="https://tc39.github.io/ecma262/#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><a href="https://tc39.github.io/ecma262/#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod></emu-rhs>
</emu-production></emu-grammar> is the <emu-xref aoid="UTF16Encoding"><a href="https://tc39.github.io/ecma262/#sec-utf16encoding">UTF16Encoding</a></emu-xref> of the code point value of <emu-nt><a href="https://tc39.github.io/ecma262/#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="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="1262cc92"><emu-t>$</emu-t></emu-rhs>
</emu-production></emu-grammar> is the code unit value 0x0024.
</li>
<li>
The TRV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="ea7d8d26"><emu-t>\</emu-t><emu-nt><a href="#prod-EscapeSequence">EscapeSequence</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code unit value 0x005C followed by the code units of TRV of <emu-nt><a href="#prod-EscapeSequence">EscapeSequence</a></emu-nt>.
</li>
<ins class="block">
<li>
The TRV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="68cad9cc"><emu-t>\</emu-t><emu-nt><a href="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code unit value 0x005C followed by the code units of TRV of <emu-nt><a href="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt>.
</li>
</ins>
<li>
The TRV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="00992933"><emu-nt><a href="#prod-LineContinuation">LineContinuation</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the TRV of <emu-nt><a href="#prod-LineContinuation">LineContinuation</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="TemplateCharacter" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-TemplateCharacter">TemplateCharacter</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="544825da"><emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the TRV of <emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="EscapeSequence" type="lexical" collapsed="" id="prod-EscapeSequence" class=" inline">
<emu-nt><a href="#prod-EscapeSequence">EscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="e9e86f07"><emu-nt><a href="#prod-CharacterEscapeSequence">CharacterEscapeSequence</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the TRV of the <emu-nt><a href="#prod-CharacterEscapeSequence">CharacterEscapeSequence</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="EscapeSequence" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-EscapeSequence">EscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="5259a431"><emu-t>0</emu-t></emu-rhs>
</emu-production></emu-grammar> is the code unit value 0x0030 (DIGIT ZERO).
</li>
<li>
The TRV of <emu-grammar><emu-production name="EscapeSequence" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-EscapeSequence">EscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="a8071b85"><emu-nt><a href="#prod-HexEscapeSequence">HexEscapeSequence</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the TRV of the <emu-nt><a href="#prod-HexEscapeSequence">HexEscapeSequence</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="EscapeSequence" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-EscapeSequence">EscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="44bd6f55"><emu-nt><a href="#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the TRV of the <emu-nt><a href="#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt>.
</li>
<ins class="block">
<li>
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="c247e196"><emu-t>0</emu-t><emu-nt><a href="#prod-DecimalDigit">DecimalDigit</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code unit value 0x0030 (DIGIT ZERO) followed by the code units of the TRV of <emu-nt><a href="#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="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="e6c4f6ee"><emu-t>x</emu-t><emu-gann>[lookahead ∉ <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann></emu-rhs>
</emu-production></emu-grammar> is the code unit value 0x0078.
</li>
<li>
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="92cdf202"><emu-t>x</emu-t><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-gann>[lookahead ∉ <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code unit value 0x0078 followed by the code units of the TRV of <emu-nt><a href="https://tc39.github.io/ecma262/#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="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="6cc0b5cc"><emu-t>u</emu-t><emu-gann>[lookahead ∉ { <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>, <emu-t>{</emu-t> }]</emu-gann></emu-rhs>
</emu-production></emu-grammar> is the code unit value 0x0075.
</li>
<li>
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="fbf0f634"><emu-t>u</emu-t><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-gann>[lookahead ∉ { <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>, <emu-t>{</emu-t> }]</emu-gann></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code unit value 0x0075 followed by the code units of the TRV of <emu-nt><a href="https://tc39.github.io/ecma262/#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="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="0e40ebfe"><emu-t>u</emu-t><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-gann>[lookahead ∉ { <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>, <emu-t>{</emu-t> }]</emu-gann></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code unit value 0x0075 followed by the code units of the TRV of the first <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt> followed by the code units of the TRV of the second <emu-nt><a href="https://tc39.github.io/ecma262/#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="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="bb49e0cf"><emu-t>u</emu-t><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-gann>[lookahead ∉ { <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>, <emu-t>{</emu-t> }]</emu-gann></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code unit value 0x0075 followed by the code units of the TRV of the first <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt> followed by the code units of the TRV of the second <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt> followed by the code units of the TRV of the third <emu-nt><a href="https://tc39.github.io/ecma262/#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="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="5427e268"><emu-t>u</emu-t><emu-t>{</emu-t><emu-gann>[lookahead ∉ <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>]</emu-gann></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code unit value 0x0075 followed by the code unit value 0x007B.
</li>
<li>
The TRV of <emu-grammar><emu-production name="NotEscapeSequence" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="4acc9c15"><emu-t>u</emu-t><emu-t>{</emu-t><emu-nt><a href="#prod-NotCodePoint">NotCodePoint</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code unit value 0x0075 followed by the code unit value 0x007B followed by the code units of the TRV of <emu-nt><a href="#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="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="e47e392f"><emu-t>u</emu-t><emu-t>{</emu-t><emu-nt><a href="#prod-CodePoint">CodePoint</a></emu-nt><emu-gann>[lookahead ∉ <emu-t>}</emu-t>]</emu-gann></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code unit value 0x0075 followed by the code unit value 0x007B followed by the code units of the TRV of <emu-nt><a href="#prod-CodePoint">CodePoint</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="DecimalDigit" type="lexical" oneof="" id="prod-DecimalDigit" class=" inline">
<emu-nt><a href="#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 SV of the <emu-nt><a href="https://tc39.github.io/ecma262/#prod-SourceCharacter">SourceCharacter</a></emu-nt> that is that single code point.
</li>
<li>
The TRV of <emu-grammar><emu-production name="CodePoint" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-CodePoint">CodePoint</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="a8b2c3ce"><emu-nt><a href="#prod-HexDigits">HexDigits</a></emu-nt><emu-gmod>but not if MV of HexDigits > 0x10FFFF </emu-gmod></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code units of the TRV of <emu-nt><a href="#prod-HexDigits">HexDigits</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="NotCodePoint" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-NotCodePoint">NotCodePoint</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="011d5f4d"><emu-nt><a href="#prod-HexDigits">HexDigits</a></emu-nt><emu-gmod>but not if MV of HexDigits ≤ 0x10FFFF </emu-gmod></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code units of the TRV of <emu-nt><a href="#prod-HexDigits">HexDigits</a></emu-nt>.
</li>
</ins>
<li>
The TRV of <emu-grammar><emu-production name="CharacterEscapeSequence" type="lexical" collapsed="" id="prod-CharacterEscapeSequence" class=" inline">
<emu-nt><a href="#prod-CharacterEscapeSequence">CharacterEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="7444838f"><emu-nt><a href="#prod-SingleEscapeCharacter">SingleEscapeCharacter</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the TRV of the <emu-nt><a href="#prod-SingleEscapeCharacter">SingleEscapeCharacter</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="CharacterEscapeSequence" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-CharacterEscapeSequence">CharacterEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="b7980a98"><emu-nt><a href="https://tc39.github.io/ecma262/#prod-NonEscapeCharacter">NonEscapeCharacter</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the SV of the <emu-nt><a href="https://tc39.github.io/ecma262/#prod-NonEscapeCharacter">NonEscapeCharacter</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="SingleEscapeCharacter" type="lexical" oneof="" id="prod-SingleEscapeCharacter" class=" inline">
<emu-nt><a href="#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 SV of the <emu-nt><a href="https://tc39.github.io/ecma262/#prod-SourceCharacter">SourceCharacter</a></emu-nt> that is that single code point.
</li>
<li>
The TRV of <emu-grammar><emu-production name="HexEscapeSequence" type="lexical" collapsed="" id="prod-HexEscapeSequence" class=" inline">
<emu-nt><a href="#prod-HexEscapeSequence">HexEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="d8ef973c"><emu-t>x</emu-t><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of code unit value 0x0078 followed by TRV of the first <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt> followed by the TRV of the second <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="UnicodeEscapeSequence" type="lexical" collapsed="" id="prod-UnicodeEscapeSequence" class=" inline">
<emu-nt><a href="#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="8072ad8d"><emu-t>u</emu-t><emu-nt><a href="#prod-Hex4Digits">Hex4Digits</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of code unit value 0x0075 followed by TRV of <emu-nt><a href="#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="#prod-UnicodeEscapeSequence">UnicodeEscapeSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="bc0db51f"><emu-t>u{</emu-t><emu-nt><a href="#prod-HexDigits">HexDigits</a></emu-nt><emu-t>}</emu-t></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of code unit value 0x0075 followed by code unit value 0x007B followed by TRV of <emu-nt><a href="#prod-HexDigits">HexDigits</a></emu-nt> followed by code unit value 0x007D.
</li>
<li>
The TRV of <emu-grammar><emu-production name="Hex4Digits" type="lexical" collapsed="" id="prod-Hex4Digits" class=" inline">
<emu-nt><a href="#prod-Hex4Digits">Hex4Digits</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="0ba8de61"><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the TRV of the first <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt> followed by the TRV of the second <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt> followed by the TRV of the third <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt> followed by the TRV of the fourth <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="HexDigits" type="lexical" collapsed="" id="prod-HexDigits" class=" inline">
<emu-nt><a href="#prod-HexDigits">HexDigits</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="a0c48a71"><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the TRV of <emu-nt><a href="https://tc39.github.io/ecma262/#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="#prod-HexDigits">HexDigits</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="c8221899"><emu-nt><a href="#prod-HexDigits">HexDigits</a></emu-nt><emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of TRV of <emu-nt><a href="#prod-HexDigits">HexDigits</a></emu-nt> followed by TRV of <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>.
</li>
<li>
The TRV of a <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt> is the SV of the <emu-nt><a href="https://tc39.github.io/ecma262/#prod-SourceCharacter">SourceCharacter</a></emu-nt> that is that <emu-nt><a href="https://tc39.github.io/ecma262/#prod-HexDigit">HexDigit</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="LineContinuation" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-LineContinuation">LineContinuation</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="c4893d63"><emu-t>\</emu-t><emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code unit value 0x005C followed by the code units of TRV of <emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt>.
</li>
<li>
The TRV of <emu-grammar><emu-production name="LineTerminatorSequence" type="lexical" collapsed="" id="prod-LineTerminatorSequence" class=" inline">
<emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="7b39d525"><emu-gprose><LF></emu-gprose></emu-rhs>
</emu-production></emu-grammar> is the code unit value 0x000A.
</li>
<li>
The TRV of <emu-grammar><emu-production name="LineTerminatorSequence" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="435c91d5"><emu-gprose><CR></emu-gprose></emu-rhs>
</emu-production></emu-grammar> is the code unit value 0x000A.
</li>
<li>
The TRV of <emu-grammar><emu-production name="LineTerminatorSequence" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="10022ab3"><emu-gprose><LS></emu-gprose></emu-rhs>
</emu-production></emu-grammar> is the code unit value 0x2028.
</li>
<li>
The TRV of <emu-grammar><emu-production name="LineTerminatorSequence" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="cfc875d1"><emu-gprose><PS></emu-gprose></emu-rhs>
</emu-production></emu-grammar> is the code unit value 0x2029.
</li>
<li>
The TRV of <emu-grammar><emu-production name="LineTerminatorSequence" type="lexical" collapsed="" class=" inline">
<emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt><emu-geq>::</emu-geq><emu-rhs a="2da252ec"><emu-gprose><CR></emu-gprose><emu-gprose><LF></emu-gprose></emu-rhs>
</emu-production></emu-grammar> is the sequence consisting of the code unit value 0x000A.
</li>
</ul>
<emu-note><span class="note">Note</span>
<p>TV excludes the code units of <emu-nt><a href="#prod-LineContinuation">LineContinuation</a></emu-nt> while TRV includes them. <CR><LF> and <CR> <emu-nt><a href="#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt>s are normalized to <LF> for both TV and TRV. An explicit <emu-nt><a href="#prod-EscapeSequence">EscapeSequence</a></emu-nt> is needed to include a <CR> or <CR><LF> sequence.</p>
</emu-note>
</emu-clause>
<!-- es6num="12.2.9" -->
<emu-clause id="sec-template-literals">
<h1><span class="secnum">3</span>(<a href="https://tc39.github.io/ecma262/#sec-template-literals">12.2.9</a>) Template Literals<span class="utils"><span class="anchor"><a href="#sec-template-literals">#</a></span></span></h1>
<h2>Syntax</h2>
<del class="block">
<emu-grammar><emu-production name="TemplateLiteral" params="Yield" id="prod-TemplateLiteral">
<emu-nt params="Yield"><a href="#prod-TemplateLiteral">TemplateLiteral</a><emu-mods><emu-params>[Yield]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs a="7bf3ad2b"><emu-nt><a href="#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt></emu-rhs>
<emu-rhs a="3b0a1b3c"><emu-nt params="?Yield"><a href="#prod-SubstitutionTemplate">SubstitutionTemplate</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
</emu-production>
<emu-production name="SubstitutionTemplate" params="Yield" id="prod-SubstitutionTemplate">
<emu-nt params="Yield"><a href="#prod-SubstitutionTemplate">SubstitutionTemplate</a><emu-mods><emu-params>[Yield]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs a="e9a466df"><emu-nt><a href="#prod-TemplateHead">TemplateHead</a></emu-nt><emu-nt params="In, ?Yield"><a href="https://tc39.github.io/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[In, ?Yield]</emu-params></emu-mods></emu-nt><emu-nt params="?Yield"><a href="#prod-TemplateSpans">TemplateSpans</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
</emu-production>
<emu-production name="TemplateSpans" params="Yield" id="prod-TemplateSpans">
<emu-nt params="Yield"><a href="#prod-TemplateSpans">TemplateSpans</a><emu-mods><emu-params>[Yield]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs a="57fe6188"><emu-nt><a href="#prod-TemplateTail">TemplateTail</a></emu-nt></emu-rhs>
<emu-rhs a="2a7f8392"><emu-nt params="?Yield"><a href="#prod-TemplateMiddleList">TemplateMiddleList</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-nt><a href="#prod-TemplateTail">TemplateTail</a></emu-nt></emu-rhs>
</emu-production>
<emu-production name="TemplateMiddleList" params="Yield" id="prod-TemplateMiddleList">
<emu-nt params="Yield"><a href="#prod-TemplateMiddleList">TemplateMiddleList</a><emu-mods><emu-params>[Yield]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs a="343328ef"><emu-nt><a href="#prod-TemplateMiddle">TemplateMiddle</a></emu-nt><emu-nt params="In, ?Yield"><a href="https://tc39.github.io/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[In, ?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
<emu-rhs a="07b7e954"><emu-nt params="?Yield"><a href="#prod-TemplateMiddleList">TemplateMiddleList</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-nt><a href="#prod-TemplateMiddle">TemplateMiddle</a></emu-nt><emu-nt params="In, ?Yield"><a href="https://tc39.github.io/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[In, ?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
</emu-production></emu-grammar>
</del>
<ins class="block">
<emu-grammar><emu-production name="TemplateLiteral" params="Yield, Tagged">
<emu-nt params="Yield, Tagged"><a href="#prod-TemplateLiteral">TemplateLiteral</a><emu-mods><emu-params>[Yield, Tagged]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs a="7bf3ad2b"><emu-nt><a href="#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt></emu-rhs>
<emu-rhs a="7b07e2cd"><emu-nt params="?Yield, ?Tagged"><a href="#prod-SubstitutionTemplate">SubstitutionTemplate</a><emu-mods><emu-params>[?Yield, ?Tagged]</emu-params></emu-mods></emu-nt></emu-rhs>
</emu-production>
<emu-production name="SubstitutionTemplate" params="Yield, Tagged">
<emu-nt params="Yield, Tagged"><a href="#prod-SubstitutionTemplate">SubstitutionTemplate</a><emu-mods><emu-params>[Yield, Tagged]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs a="afd08699"><emu-nt><a href="#prod-TemplateHead">TemplateHead</a></emu-nt><emu-nt params="In, ?Yield"><a href="https://tc39.github.io/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[In, ?Yield]</emu-params></emu-mods></emu-nt><emu-nt params="?Yield, ?Tagged"><a href="#prod-TemplateSpans">TemplateSpans</a><emu-mods><emu-params>[?Yield, ?Tagged]</emu-params></emu-mods></emu-nt></emu-rhs>
</emu-production>
<emu-production name="TemplateSpans" params="Yield, Tagged">
<emu-nt params="Yield, Tagged"><a href="#prod-TemplateSpans">TemplateSpans</a><emu-mods><emu-params>[Yield, Tagged]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs a="57fe6188"><emu-nt><a href="#prod-TemplateTail">TemplateTail</a></emu-nt></emu-rhs>
<emu-rhs a="9c7d7be0"><emu-nt params="?Yield, ?Tagged"><a href="#prod-TemplateMiddleList">TemplateMiddleList</a><emu-mods><emu-params>[?Yield, ?Tagged]</emu-params></emu-mods></emu-nt><emu-nt><a href="#prod-TemplateTail">TemplateTail</a></emu-nt></emu-rhs>
</emu-production>
<emu-production name="TemplateMiddleList" params="Yield, Tagged">
<emu-nt params="Yield, Tagged"><a href="#prod-TemplateMiddleList">TemplateMiddleList</a><emu-mods><emu-params>[Yield, Tagged]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs a="343328ef"><emu-nt><a href="#prod-TemplateMiddle">TemplateMiddle</a></emu-nt><emu-nt params="In, ?Yield"><a href="https://tc39.github.io/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[In, ?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
<emu-rhs a="f488cd27"><emu-nt params="?Yield, ?Tagged"><a href="#prod-TemplateMiddleList">TemplateMiddleList</a><emu-mods><emu-params>[?Yield, ?Tagged]</emu-params></emu-mods></emu-nt><emu-nt><a href="#prod-TemplateMiddle">TemplateMiddle</a></emu-nt><emu-nt params="In, ?Yield"><a href="https://tc39.github.io/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[In, ?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
</emu-production></emu-grammar>
</ins>
</emu-clause>
<ins class="block">
<emu-clause id="sec-static-semantics-template-early-errors">
<h1><span class="secnum">4</span>Static Semantics: Early Errors<span class="utils"><span class="anchor"><a href="#sec-static-semantics-template-early-errors">#</a></span></span></h1>
<emu-grammar><emu-production name="TemplateLiteral" params="Yield, Tagged" collapsed="">
<emu-nt params="Yield, Tagged"><a href="#prod-TemplateLiteral">TemplateLiteral</a><emu-mods><emu-params>[Yield, Tagged]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs a="7bf3ad2b"><emu-nt><a href="#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt></emu-rhs>
</emu-production></emu-grammar>
<ul>
<li>
It is a Syntax Error if the Tagged parameter was not set and <emu-nt><a href="#prod-NoSubstitutionTemplate">NoSubstitutionTemplate</a></emu-nt> Contains <emu-nt><a href="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt>.
</li>
</ul>
<emu-grammar><emu-production name="SubstitutionTemplate" params="Yield, Tagged" collapsed="">
<emu-nt params="Yield, Tagged"><a href="#prod-SubstitutionTemplate">SubstitutionTemplate</a><emu-mods><emu-params>[Yield, Tagged]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs a="afd08699"><emu-nt><a href="#prod-TemplateHead">TemplateHead</a></emu-nt><emu-nt params="In, ?Yield"><a href="https://tc39.github.io/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[In, ?Yield]</emu-params></emu-mods></emu-nt><emu-nt params="?Yield, ?Tagged"><a href="#prod-TemplateSpans">TemplateSpans</a><emu-mods><emu-params>[?Yield, ?Tagged]</emu-params></emu-mods></emu-nt></emu-rhs>
</emu-production></emu-grammar>
<ul>
<li>
It is a Syntax Error if the Tagged parameter was not set and <emu-nt><a href="#prod-TemplateHead">TemplateHead</a></emu-nt> Contains <emu-nt><a href="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt>.
</li>
</ul>
<emu-grammar><emu-production name="TemplateSpans" params="Yield, Tagged" collapsed="">
<emu-nt params="Yield, Tagged"><a href="#prod-TemplateSpans">TemplateSpans</a><emu-mods><emu-params>[Yield, Tagged]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs a="57fe6188"><emu-nt><a href="#prod-TemplateTail">TemplateTail</a></emu-nt></emu-rhs>
</emu-production></emu-grammar>
<ul>
<li>
It is a Syntax Error if the Tagged parameter was not set and <emu-nt><a href="#prod-TemplateTail">TemplateTail</a></emu-nt> Contains <emu-nt><a href="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt>.
</li>
</ul>
<emu-grammar><emu-production name="TemplateMiddleList" params="Yield, Tagged">
<emu-nt params="Yield, Tagged"><a href="#prod-TemplateMiddleList">TemplateMiddleList</a><emu-mods><emu-params>[Yield, Tagged]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs a="343328ef"><emu-nt><a href="#prod-TemplateMiddle">TemplateMiddle</a></emu-nt><emu-nt params="In, ?Yield"><a href="https://tc39.github.io/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[In, ?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
<emu-rhs a="f488cd27"><emu-nt params="?Yield, ?Tagged"><a href="#prod-TemplateMiddleList">TemplateMiddleList</a><emu-mods><emu-params>[?Yield, ?Tagged]</emu-params></emu-mods></emu-nt><emu-nt><a href="#prod-TemplateMiddle">TemplateMiddle</a></emu-nt><emu-nt params="In, ?Yield"><a href="https://tc39.github.io/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[In, ?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
</emu-production></emu-grammar>
<ul>
<li>
It is a Syntax Error if the Tagged parameter was not set and <emu-nt><a href="#prod-TemplateMiddle">TemplateMiddle</a></emu-nt> Contains <emu-nt><a href="#prod-NotEscapeSequence">NotEscapeSequence</a></emu-nt>.
</li>
</ul>
</emu-clause>
</ins>
<!-- es6num="12.2.9.1" -->
<!-- <emu-clause id="sec-static-semantics-templatestrings">
<h1>(<a href="https://tc39.github.io/ecma262/#sec-static-semantics-templatestrings">12.2.9.1</a>) Static Semantics: TemplateStrings</h1>
<p>With parameter _raw_.</p>
<emu-grammar>TemplateLiteral : NoSubstitutionTemplate</emu-grammar>
<emu-alg>
1. If _raw_ is *false*, then
1. Let _string_ be the TV of |NoSubstitutionTemplate|.
1. Else,
1. Let _string_ be the TRV of |NoSubstitutionTemplate|.
1. Return a List containing the single element, _string_.
</emu-alg>
<emu-grammar>TemplateLiteral : TemplateHead Expression TemplateSpans</emu-grammar>
<emu-alg>
1. If _raw_ is *false*, then
1. Let _head_ be the TV of |TemplateHead|.
1. Else,
1. Let _head_ be the TRV of |TemplateHead|.
1. Let _tail_ be TemplateStrings of |TemplateSpans| with argument _raw_.
1. <del>Return a List containing _head_ followed by the elements, in order, of _tail_.</del>
1. <ins>If _head_ is *undefined* or _tail_ is *undefined*, then</ins>
1. <ins>Return *undefined*.</ins>
1. <ins>Else,</ins>
1. <ins>Return a List containing _head_ followed by the elements, in order, of _tail_.</ins>
</emu-alg>
<emu-grammar>TemplateSpans : TemplateTail</emu-grammar>
<emu-alg>
1. If _raw_ is *false*, then
1. Let _tail_ be the TV of |TemplateTail|.
1. Else,
1. Let _tail_ be the TRV of |TemplateTail|.
1. Return a List containing the single element, _tail_.
</emu-alg>
<emu-grammar>TemplateSpans : TemplateMiddleList TemplateTail</emu-grammar>
<emu-alg>
1. Let _middle_ be TemplateStrings of |TemplateMiddleList| with argument _raw_.
1. If _raw_ is *false*, then
1. Let _tail_ be the TV of |TemplateTail|.
1. Else,
1. Let _tail_ be the TRV of |TemplateTail|.
1. <del>Return a List containing the elements, in order, of _middle_ followed by _tail_.</del>
1. <ins>If _middle_ is *undefined* or _tail_ is *undefined*, then</ins>
1. <ins>Return *undefined*.</ins>
1. <ins>Else,</ins>
1. <ins>Return a List containing the elements, in order, of _middle_ followed by _tail_.</ins>
</emu-alg>
<emu-grammar>TemplateMiddleList : TemplateMiddle Expression</emu-grammar>
<emu-alg>
1. If _raw_ is *false*, then
1. Let _string_ be the TV of |TemplateMiddle|.
1. Else,
1. Let _string_ be the TRV of |TemplateMiddle|.
1. Return a List containing the single element, _string_.
</emu-alg>
<emu-grammar>TemplateMiddleList : TemplateMiddleList TemplateMiddle Expression</emu-grammar>
<emu-alg>
1. Let _front_ be TemplateStrings of |TemplateMiddleList| with argument _raw_.
1. If _raw_ is *false*, then
1. Let _last_ be the TV of |TemplateMiddle|.
1. Else,
1. Let _last_ be the TRV of |TemplateMiddle|.
1. <del>Append _last_ as the last element of the List _front_.</del>
1. <del>Return _front_.</del>
1. <ins>If _last_ is *undefined* or _front_ is *undefined*, then</ins>
1. <ins>Return *undefined*.</ins>
1. <ins>Else,</ins>
1. <ins>Append _last_ as the last element of the List _front_.</ins>
1. <ins>Return _front_.</ins>
</emu-alg>
</emu-clause> -->
<!-- es6num="12.3" -->
<emu-clause id="sec-left-hand-side-expressions">
<h1><span class="secnum">5</span>(<a href="https://tc39.github.io/ecma262/#sec-left-hand-side-expressions">12.3</a>) Left-Hand-Side Expressions<span class="utils"><span class="anchor"><a href="#sec-left-hand-side-expressions">#</a></span></span></h1>
<h2>Syntax</h2>
<emu-production name="MemberExpression" params="Yield" id="prod-MemberExpression">
<emu-nt params="Yield"><a href="#prod-MemberExpression">MemberExpression</a><emu-mods><emu-params>[Yield]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs><emu-nt params="?Yield"><a href="https://tc39.github.io/ecma262/#prod-PrimaryExpression">PrimaryExpression</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
<emu-rhs><emu-nt params="?Yield"><a href="#prod-MemberExpression">MemberExpression</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-t>[</emu-t><emu-nt params="In, ?Yield"><a href="https://tc39.github.io/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[In, ?Yield]</emu-params></emu-mods></emu-nt><emu-t>]</emu-t></emu-rhs>
<emu-rhs><emu-nt params="?Yield"><a href="#prod-MemberExpression">MemberExpression</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-t>.</emu-t><emu-nt><a href="https://tc39.github.io/ecma262/#prod-IdentifierName">IdentifierName</a></emu-nt></emu-rhs>
<del class="block"><emu-rhs><emu-nt params="?Yield"><a href="#prod-MemberExpression">MemberExpression</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-nt params="?Yield"><a href="#prod-TemplateLiteral">TemplateLiteral</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt></emu-rhs></del>
<ins class="block"><emu-rhs><emu-nt params="?Yield"><a href="#prod-MemberExpression">MemberExpression</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-nt params="?Yield, Tagged"><a href="#prod-TemplateLiteral">TemplateLiteral</a><emu-mods><emu-params>[?Yield, Tagged]</emu-params></emu-mods></emu-nt></emu-rhs></ins>
<emu-rhs><emu-nt params="?Yield"><a href="https://tc39.github.io/ecma262/#prod-SuperProperty">SuperProperty</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
<emu-rhs><emu-nt><a href="https://tc39.github.io/ecma262/#prod-MetaProperty">MetaProperty</a></emu-nt></emu-rhs>
<emu-rhs><emu-t>new</emu-t><emu-nt params="?Yield"><a href="#prod-MemberExpression">MemberExpression</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-nt params="?Yield"><a href="https://tc39.github.io/ecma262/#prod-Arguments">Arguments</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
</emu-production>
<emu-production name="CallExpression" params="Yield" id="prod-CallExpression">
<emu-nt params="Yield"><a href="#prod-CallExpression">CallExpression</a><emu-mods><emu-params>[Yield]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs><emu-nt params="?Yield"><a href="#prod-MemberExpression">MemberExpression</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-nt params="?Yield"><a href="https://tc39.github.io/ecma262/#prod-Arguments">Arguments</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
<emu-rhs><emu-nt params="?Yield"><a href="https://tc39.github.io/ecma262/#prod-SuperCall">SuperCall</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
<emu-rhs><emu-nt params="?Yield"><a href="#prod-CallExpression">CallExpression</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-nt params="?Yield"><a href="https://tc39.github.io/ecma262/#prod-Arguments">Arguments</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt></emu-rhs>
<emu-rhs><emu-nt params="?Yield"><a href="#prod-CallExpression">CallExpression</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-t>[</emu-t><emu-nt params="?Yield"><a href="https://tc39.github.io/ecma262/#prod-Expression">Expression</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-t>]</emu-t></emu-rhs>
<emu-rhs><emu-nt params="?Yield"><a href="#prod-CallExpression">CallExpression</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-t>.</emu-t><emu-nt><a href="https://tc39.github.io/ecma262/#prod-IdentifierName">IdentifierName</a></emu-nt></emu-rhs>
<del class="block"><emu-rhs><emu-nt params="?Yield"><a href="#prod-CallExpression">CallExpression</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-nt params="?Yield"><a href="#prod-TemplateLiteral">TemplateLiteral</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt></emu-rhs></del>
<ins class="block"><emu-rhs><emu-nt params="?Yield"><a href="#prod-CallExpression">CallExpression</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt><emu-nt params="?Yield, Tagged"><a href="#prod-TemplateLiteral">TemplateLiteral</a><emu-mods><emu-params>[?Yield, Tagged]</emu-params></emu-mods></emu-nt></emu-rhs></ins>
</emu-production>
</emu-clause><emu-annex id="sec-copyright-and-software-license">
<h1><span class="secnum">A</span>Copyright & Software License<span class="utils"><span class="anchor"><a href="#sec-copyright-and-software-license">#</a></span></span></h1>
<h2>Copyright Notice</h2>
<p>© 2016 Tim Disney</p>
<h2>Software License</h2>
<p>All Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT http://www.ecma-international.org/memento/codeofconduct.htm FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<ol>
<li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li>
<li>Neither the name of the authors nor Ecma International may be used to endorse or promote products derived from this software without specific prior written permission.</li>
</ol>
<p>THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
</emu-annex>
</body>