File tree Expand file tree Collapse file tree 8 files changed +28
-16
lines changed Expand file tree Collapse file tree 8 files changed +28
-16
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ impl<'a> ParserImpl<'a> {
4141 let Expression :: Identifier ( ident) = & expr else {
4242 return self . unexpected ( ) ;
4343 } ;
44+ // It is a Syntax Error if ArrowParameters Contains AwaitExpression is true.
45+ if ident. name == "await" {
46+ self . error ( diagnostics:: identifier_async ( "await" , ident. span ) ) ;
47+ }
4448 return Some ( self . parse_simple_arrow_function_expression (
4549 span,
4650 ident,
File renamed without changes.
Original file line number Diff line number Diff line change 11codegen_misc Summary :
2- AST Parsed : 49 / 49 (100.00 % )
3- Positive Passed : 49 / 49 (100.00 % )
2+ AST Parsed : 48 / 48 (100.00 % )
3+ Positive Passed : 48 / 48 (100.00 % )
Original file line number Diff line number Diff line change 11formatter_misc Summary :
2- AST Parsed : 49 / 49 (100.00 % )
3- Positive Passed : 48 / 49 (97.96 % )
4- Expect to Parse : tasks / coverage / misc / pass / oxc - 11487.cjs
5- Cannot use ` await` as an identifier in an async context
2+ AST Parsed : 48 / 48 (100.00 % )
3+ Positive Passed : 48 / 48 (100.00 % )
Original file line number Diff line number Diff line change @@ -3,9 +3,7 @@ commit: 4cc3d888
33parser_babel Summary:
44AST Parsed : 2422/2440 (99.26%)
55Positive Passed: 2395/2440 (98.16%)
6- Negative Passed: 1675/1752 (95.61%)
7- Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/input.js
8-
6+ Negative Passed: 1676/1752 (95.66%)
97Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-rest/input.js
108
119Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/input.js
@@ -5632,6 +5630,12 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
56325630 ╰────
56335631 help: Either remove this `await` or add the `async` keyword to the enclosing function
56345632
5633+ × Cannot use `await` as an identifier in an async context
5634+ ╭─[babel/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/input.js:1:7]
5635+ 1 │ async await => {}
5636+ · ─────
5637+ ╰────
5638+
56355639 × Expected a semicolon or an implicit semicolon after a statement, but found none
56365640 ╭─[babel/packages/babel-parser/test/fixtures/es2017/async-functions/async-function-and-non-bmp-character/input.js:1:6]
56375641 1 │ async function𝐬 f() {}
Original file line number Diff line number Diff line change 11parser_misc Summary :
2- AST Parsed : 49 / 49 (100.00 % )
3- Positive Passed : 49 / 49 (100.00 % )
4- Negative Passed : 93 / 93 (100.00 % )
2+ AST Parsed : 48 / 48 (100.00 % )
3+ Positive Passed : 48 / 48 (100.00 % )
4+ Negative Passed : 94 / 94 (100.00 % )
55
66 × Cannot assign to ' arguments' in strict mode
77 ╭─[misc / fail / arguments - eval .ts :1 :10 ]
@@ -124,6 +124,12 @@ Negative Passed: 93/93 (100.00%)
124124 · ────
125125 ╰────
126126
127+ × Cannot use ` await` as an identifier in an async context
128+ ╭─[misc / fail / oxc - 11487.cjs :1 :7 ]
129+ 1 │ async await = > {}
130+ · ─────
131+ ╰────
132+
127133 × Unexpected token
128134 ╭─[misc / fail / oxc - 11487.mjs :1 :13 ]
129135 1 │ async await = > {}
Original file line number Diff line number Diff line change 11semantic_misc Summary :
2- AST Parsed : 49 / 49 (100.00 % )
3- Positive Passed : 31 / 49 ( 63.27 % )
2+ AST Parsed : 48 / 48 (100.00 % )
3+ Positive Passed : 30 / 48 ( 62.50 % )
44semantic Error : tasks / coverage / misc / pass / oxc - 11593.ts
55Scope children mismatch :
66after transform : ScopeId (0 ): [ScopeId (1 )]
Original file line number Diff line number Diff line change 11transformer_misc Summary :
2- AST Parsed : 49 / 49 (100.00 % )
3- Positive Passed : 49 / 49 (100.00 % )
2+ AST Parsed : 48 / 48 (100.00 % )
3+ Positive Passed : 48 / 48 (100.00 % )
You can’t perform that action at this time.
0 commit comments