Commit baab240
authored
fix(es/parser): allow no-default builds (#11956)
**Description:**
Fixes `swc_ecma_parser` compilation when default features are disabled.
Shared parser modules reference Flow reserved-name helpers even when the
`typescript` feature is disabled, but those helpers only existed in the
TypeScript parser implementation. This adds matching no-op stubs in
`typescript_stubs.rs`, so the no-default build compiles without enabling
TypeScript or Flow behavior.
Also adds a `swc_ecma_parser` no-default check to `tests.yml` and a
patch changeset for `swc_ecma_parser` and `swc_core`.
Validation:
- `git submodule update --init --recursive`
- `cargo check -p swc_ecma_parser --no-default-features`
- `cargo test -p swc_ecma_parser`
- `cargo fmt --all`
- `cargo clippy --all --all-targets -- -D warnings`
- `cargo check --no-default-features` from `crates/swc_ecma_parser`
**Related issue:**
Fixes #119421 parent 09273c0 commit baab240
3 files changed
Lines changed: 19 additions & 4 deletions
File tree
- .changeset
- crates/swc_ecma_parser/src/parser
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
0 commit comments