Skip to content

Commit 5d948c4

Browse files
authored
Update JS reserved keywords list, clean up scripts, add documentation (#6167)
* Sort existing keyword list * Regenerate (sorted) keyword list * Update scripts and rebuild js_reserved_map * Update CONTRIBUTING.md * Rebuild libs * Update CHANGELOG
1 parent 4f5b4f5 commit 5d948c4

12 files changed

+782
-584
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
- Fixed subtype checking for record types with "@as" attributes: The subtype relationship now takes into account the compatibility of "@as" attributes between corresponding fields, ensuring correctness in runtime representation.
2424
https://github.com/rescript-lang/rescript-compiler/issues/6158
2525

26+
#### :nail_care: Polish
27+
28+
- Update list of reserved JS keywords. https://github.com/rescript-lang/rescript-compiler/pull/6167
2629

2730
# 11.0.0-alpha.3
2831

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,17 @@ To generate the html:
330330
../scripts/ninja docs
331331
```
332332

333+
## Update JS Reserved Keywords Map
334+
335+
The compiler sources include a list of reserved JS keywords in `jscomp/ext/js_reserved_map.ml` which includes all identifiers in global scope (`window`). This list should be updated from time to time for newer browser versions.
336+
337+
To update it, run:
338+
339+
```sh
340+
npm install puppeteer
341+
node scripts/build_reserved.js
342+
```
343+
333344
## Code structure
334345

335346
The highlevel architecture is illustrated as below:

jscomp/build_reserved.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)