feat: add readonly to reserved identifiers

pull/643/head
Amaan Qureshi 2024-01-31 21:01:53 +07:00
parent c96c095f60
commit e281f36ee4
No known key found for this signature in database
GPG Key ID: E67890ADC4227273
2 changed files with 31 additions and 5 deletions

@ -236,14 +236,39 @@ Objects with reserved words as keys
public: true,
private: true,
readonly: true
}
};
{
readonly: 1,
abstract: 1,
static: 1
};
---
(program (expression_statement (object
(pair key: (property_identifier) value: (true))
(pair key: (property_identifier) value: (true))
(pair key: (property_identifier) value: (true)))))
(program
(expression_statement
(object
(pair
key: (property_identifier)
value: (true))
(pair
key: (property_identifier)
value: (true))
(pair
key: (property_identifier)
value: (true))))
(expression_statement
(object
(pair
key: (property_identifier)
value: (number))
(pair
key: (property_identifier)
value: (number))
(pair
key: (property_identifier)
value: (number)))))
====================================
Assignment to non-null LHS

@ -1052,6 +1052,7 @@ module.exports = function defineGrammar(dialect) {
'export',
'object',
'new',
'readonly',
previous,
),
},