refactor(parser): rename ModifierFlags to ModifierKinds#20739
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Pull request overview
This PR updates the TypeScript/JavaScript parser modifier-set type naming to reflect its semantics: renaming ModifierFlags to ModifierKinds now that the representation is no longer a bitflags!-style flags type.
Changes:
- Rename the modifier set type from
ModifierFlagstoModifierKinds. - Update parser call sites and local variables to use
ModifierKindsconsistently. - Update diagnostics signatures/helpers that accept “allowed modifiers” sets.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_parser/src/ts/types.rs | Update modifier verification call sites to use ModifierKinds. |
| crates/oxc_parser/src/ts/statement.rs | Replace ModifierFlags usage/imports with ModifierKinds in TS statement parsing. |
| crates/oxc_parser/src/modifiers.rs | Rename the core modifier-set type and propagate the rename through parsing/validation logic and stored fields. |
| crates/oxc_parser/src/js/statement.rs | Update enum-const modifier construction to use ModifierKinds. |
| crates/oxc_parser/src/js/object.rs | Update modifier verification call sites/imports to ModifierKinds. |
| crates/oxc_parser/src/js/module.rs | Update default export class modifier construction to ModifierKinds. |
| crates/oxc_parser/src/js/function.rs | Update parameter/function modifier allowlists to ModifierKinds. |
| crates/oxc_parser/src/js/class.rs | Update class-element modifier allowlists and constants to ModifierKinds. |
| crates/oxc_parser/src/diagnostics.rs | Update diagnostics helper signatures and imports to accept Option<ModifierKinds>. |
bcd1734 to
f72933b
Compare
a590ebe to
6587e2d
Compare
f72933b to
0b12df6
Compare
0b12df6 to
9d5b470
Compare
6587e2d to
33e028e
Compare
Merge activity
|
9d5b470 to
0c15f8f
Compare
|
Didnt push any code changes, just restacked, because it ended up with conflicts (somehow) |
Pure refactor. Rename `ModifierFlags` to `ModifierKinds`. This type represents a collection of `ModifierKind`s, and after #20738 it's no longer implemented as `bitflags!`, so the name is no longer appropriate. This PR is pure renaming - rename the type, and variables that hold the type.
0c15f8f to
cfa7b0f
Compare

Pure refactor. Rename
ModifierFlagstoModifierKinds. This type represents a collection ofModifierKinds, and after #20738 it's no longer implemented asbitflags!, so the name is no longer appropriate.This PR is pure renaming - rename the type, and variables that hold the type.