Skip to content

Commit e281f36

Browse files
committed
feat: add readonly to reserved identifiers
1 parent c96c095 commit e281f36

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

common/corpus/expressions.txt

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,39 @@ Objects with reserved words as keys
236236
public: true,
237237
private: true,
238238
readonly: true
239-
}
239+
};
240+
241+
{
242+
readonly: 1,
243+
abstract: 1,
244+
static: 1
245+
};
240246

241247
---
242248

243-
(program (expression_statement (object
244-
(pair key: (property_identifier) value: (true))
245-
(pair key: (property_identifier) value: (true))
246-
(pair key: (property_identifier) value: (true)))))
249+
(program
250+
(expression_statement
251+
(object
252+
(pair
253+
key: (property_identifier)
254+
value: (true))
255+
(pair
256+
key: (property_identifier)
257+
value: (true))
258+
(pair
259+
key: (property_identifier)
260+
value: (true))))
261+
(expression_statement
262+
(object
263+
(pair
264+
key: (property_identifier)
265+
value: (number))
266+
(pair
267+
key: (property_identifier)
268+
value: (number))
269+
(pair
270+
key: (property_identifier)
271+
value: (number)))))
247272

248273
====================================
249274
Assignment to non-null LHS

common/define-grammar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,7 @@ module.exports = function defineGrammar(dialect) {
10521052
'export',
10531053
'object',
10541054
'new',
1055+
'readonly',
10551056
previous,
10561057
),
10571058
},

0 commit comments

Comments
 (0)