File tree Expand file tree Collapse file tree 5 files changed +22
-14
lines changed
Expand file tree Collapse file tree 5 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -471,18 +471,16 @@ impl<'a> ParserImpl<'a> {
471471 }
472472 Kind :: TemplateMiddle => {
473473 quasis. push ( self . parse_template_element ( tagged) ) ;
474- }
475- Kind :: Eof => {
476- self . expect ( Kind :: TemplateTail ) ;
477- break ;
478- }
479- _ => {
480474 // TemplateMiddle Expression[+In, ?Yield, ?Await]
481475 let expr =
482476 self . context ( Context :: In , Context :: empty ( ) , Self :: parse_expr) ;
483477 expressions. push ( expr) ;
484478 self . re_lex_template_substitution_tail ( ) ;
485479 }
480+ _ => {
481+ self . expect ( Kind :: TemplateTail ) ;
482+ break ;
483+ }
486484 }
487485 }
488486 }
Original file line number Diff line number Diff line change 1+ const y = `foo ${x function ( ) { } function ( ) { } } `;
Original file line number Diff line number Diff line change @@ -4459,10 +4459,11 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
44594459 1 │ `hello ${10 `test`
44604460 ╰────
44614461
4462- × Unexpected token
4462+ × Expected `}` but found `;`
44634463 ╭─[babel/packages/babel-parser/test/fixtures/es2015/uncategorised/267/input.js:1:12]
44644464 1 │ `hello ${10;test`
4465- · ─
4465+ · ┬
4466+ · ╰── `}` expected
44664467 ╰────
44674468
44684469 × Unexpected token
@@ -9516,10 +9517,11 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
95169517 · ──────
95179518 ╰────
95189519
9519- × Unexpected token
9520+ × Expected `}` but found `;`
95209521 ╭─[babel/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/unclosed-interpolation/input.js:1:12]
95219522 1 │ `hello ${10;test`
9522- · ─
9523+ · ┬
9524+ · ╰── `}` expected
95239525 ╰────
95249526
95259527 × Expected `}` but found `EOF`
Original file line number Diff line number Diff line change 11parser_misc Summary :
22AST Parsed : 40 / 40 (100.00 % )
33Positive Passed : 40 / 40 (100.00 % )
4- Negative Passed : 39 / 39 (100.00 % )
4+ Negative Passed : 40 / 40 (100.00 % )
55
66 × Identifier ` b` has already been declared
77 ╭─[misc / fail / oxc - 10159.js :1 :22 ]
@@ -68,6 +68,13 @@ Negative Passed: 39/39 (100.00%)
6868 2 │ import defer { x } from "x";
6969 ╰────
7070
71+ × Expected ` } ` but found ` function`
72+ ╭─[misc / fail / oxc - 11538.js :1 :20 ]
73+ 1 │ const y = ` foo ${x function () {} function () {}}` ;
74+ · ────┬───
75+ · ╰── ` }` expected
76+ ╰────
77+
7178 × Unexpected token
7279 ╭─[misc / fail / oxc - 169.js :2 :1 ]
7380 1 │ 1 <(V = 82 << t - j0 < (V = $ < LBI < (V = ut < I < (V = $ < LBI < (V = uIV = 82 << t - j0 < (V = $ < LBI < (V = ut < I < (V = $ < LBI < (V <II >
Original file line number Diff line number Diff line change @@ -17766,7 +17766,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/salsa/private
1776617766 · ─
1776717767 ╰────
1776817768
17769- × Expected `}` but found `EOF`
17769+ × Unexpected token
1777017770 ╭─[typescript/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts:5:23]
1777117771 4 │ // Incomplete call, not enough parameters.
1777217772 5 │ f `123qdawdrqw${ 1 }${
@@ -17786,13 +17786,13 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/salsa/private
1778617786 · ─
1778717787 ╰────
1778817788
17789- × Expected `}` but found `EOF`
17789+ × Unexpected token
1779017790 ╭─[typescript/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts:5:30]
1779117791 4 │ // Incomplete call, but too many parameters.
1779217792 5 │ f `123qdawdrqw${ 1 }${ 2 }${
1779317793 ╰────
1779417794
17795- × Expected `}` but found `EOF`
17795+ × Unexpected token
1779617796 ╭─[typescript/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts:5:23]
1779717797 4 │ // Incomplete call, not enough parameters, at EOF.
1779817798 5 │ f `123qdawdrqw${ 1 }${
You can’t perform that action at this time.
0 commit comments