Commit 9b5d4cd
committed
fix: correct acorn-walk ancestor visitor signature and ts-expect-error in tests
acorn-walk's ancestor() visitor signature is (node, state, ancestors) —
the previous code used (node, ancestors) so ancestors was actually
receiving the state arg (undefined at runtime), causing a crash when
accessing ancestors.length and TypeScript errors about unknown types.
The direct `import.meta.env = ...` assignments in tests are read-only
per TypeScript's ImportMeta, but vitest's MetaEnvReplacerPlugin rewrites
them at runtime. Added // @ts-expect-error to suppress the compile-time
error in all three test files.1 parent 0bd2550 commit 9b5d4cd
File tree
4 files changed
+4
-1
lines changed- packages/vitest/src/node/plugins
- test
- browser/test
- core/test
4 files changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
0 commit comments