Files
camc314 8b35abdfd9 fix(semantic): detect duplicate private class elements (#26361)
The duplicate class element check stored only the last element for each name. This allowed a public element to hide an earlier private declaration, and a setter to hide an earlier getter (or vice versa):

```js
class DuplicateField {
  #x;
  x;
  #x;
}

class DuplicateGetter {
  get #x() {}
  set #x(value) {}
  get #x() {}
}
```

Both classes were accepted despite declaring the same private field or getter twice. The same problem affected setter/getter/setter sequences.

Key a single map by both the element name and whether it is private, so public elements cannot replace private declarations. This keeps the namespaces separate while reserving map capacity only once. For each private name, retain separate slots for setters and other declarations. Look for a previous declaration in the matching slot first, then fall back to the other slot. This catches repeated getters and setters while still allowing one getter/setter pair when both have the same static status.

The existing diagnostic logic continues to reject private names shared by static and instance elements, including the TypeScript-specific diagnostic. Public elements continue through the existing public-element duplicate check.
2026-09-06 21:17:34 +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