Skip to content

Commit 85961d4

Browse files
committed
Fix await using double lookahead edge case
1 parent 0ee7596 commit 85961d4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/tests-using.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,9 @@ testFail("for (await using a of x) {}", "Await using cannot appear outside of as
11841184
testFail("switch (x) { case 1: using y = resource; }", "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement (1:21)", {ecmaVersion: 17, sourceType: "module"});
11851185
testFail("switch (x) { case 1: break; default: using y = resource; }", "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement (1:37)", {ecmaVersion: 17, sourceType: "module"});
11861186

1187+
// await using double lookahead should detect using keyword correctly
1188+
testFail("async () => { await using\\u0061 b = c }", "Unexpected token (1:32)", {ecmaVersion: 17, sourceType: "module"});
1189+
11871190
// =============================================================================
11881191
// EDGE CASES - Unusual but valid scenarios and boundary conditions
11891192
// =============================================================================

0 commit comments

Comments
 (0)