Skip to content

Commit d212d1f

Browse files
Add await as reserved identifier
1 parent 6ec8014 commit d212d1f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

grammar.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ module.exports = grammar({
6464
[$.primary_expression, $.statement_block, 'object'],
6565
[$.import_statement, $.import],
6666
[$.export_statement, $.primary_expression],
67+
[$.await_expression, $.primary_expression],
6768
],
6869

6970
conflicts: $ => [
@@ -1143,6 +1144,7 @@ module.exports = grammar({
11431144
'get',
11441145
'set',
11451146
'async',
1147+
'await',
11461148
'static',
11471149
'export'
11481150
),

test/corpus/expressions.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ Objects with reserved words for keys
319319
set: function () {},
320320
static: true,
321321
async: true,
322+
await: true,
322323
};
323324

324325
---
@@ -340,6 +341,7 @@ Objects with reserved words for keys
340341
(property_identifier)
341342
(function (formal_parameters) (statement_block)))
342343
(pair (property_identifier) (true))
344+
(pair (property_identifier) (true))
343345
(pair (property_identifier) (true)))))
344346

345347
============================================
@@ -422,6 +424,7 @@ Classes with reserved words as methods
422424
class Foo {
423425
catch() {}
424426
finally() {}
427+
await() {}
425428
}
426429

427430
---
@@ -434,6 +437,10 @@ class Foo {
434437
(property_identifier)
435438
(formal_parameters)
436439
(statement_block))
440+
(method_definition
441+
(property_identifier)
442+
(formal_parameters)
443+
(statement_block))
437444
(method_definition
438445
(property_identifier)
439446
(formal_parameters)

0 commit comments

Comments
 (0)