Files
Dominic ElmandCameron 3dbf1409ab fix(parser): treat escaped contextual keywords as names, not modifiers (#28748)
Treat contextual keywords spelled with a Unicode escape (`st\u0061tic`,
`\u0061sync`, `g\u0065t`, …) as property names rather than modifiers.
Such a token is an IdentifierName and cannot match a keyword terminal,
so `class A { st\u0061tic
x }` declares two fields named `static` and `x`. Previously it was
parsed as `static x` and reported "Keywords cannot contain escape
characters".

`try_parse_modifier` and `parse_contextual_modifier` now skip escaped
tokens. Invalid forms such as `class X { st\u0061tic y() {} }` are still
rejected. The error is now reported at the token after the name, as
Babel does, which accounts for the updated parser snapshots.

The new `misc/pass` fixture covers fields named `static`, `async`,
`get`, `set`, and `accessor` that end at a line break. The rejected
forms are already covered by Babel and test262.

Validated with scoped Rust checks and full parser conformance.

---------

Co-authored-by: Cameron <cameron.clark@hey.com>
2026-11-03 11:14:17 +00:00
..

Coverage tests

Tools are tested against test262, babel and TypeScript for conformance.

Clone the test repositories beforehand:

just submodules

Development

# full run
cargo coverage

# run a single tool against its supported conformance suites
cargo coverage parser
cargo coverage transformer
cargo coverage minifier

# run in watch
cargo watch -x 'coverage minifier'

# filter for a file path
cargo watch -x 'coverage minifier --filter filter-file-path'

# find crash scene by turning off rayon and print out the test cases in serial
cargo coverage --debug

# Run after submodules are updated
UPDATE_SNAPSHOT=1 just c