@depup/vitest__mocker 4.1.2-depup.0 → 4.1.4-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/vitest__mocker
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [@vitest/mocker](https://www.npmjs.com/package/@vitest/mocker) @ 4.1.2 |
17
- | Processed | 2026-03-26 |
16
+ | Original | [@vitest/mocker](https://www.npmjs.com/package/@vitest/mocker) @ 4.1.4 |
17
+ | Processed | 2026-04-09 |
18
18
  | Smoke test | passed |
19
19
  | Deps updated | 0 |
20
20
 
package/changes.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "bumped": {},
3
- "timestamp": "2026-03-26T16:31:35.658Z",
3
+ "timestamp": "2026-04-09T08:38:04.337Z",
4
4
  "totalUpdated": 0
5
5
  }
@@ -160,9 +160,8 @@ function esmWalker(root, { onIdentifier, onImportMeta, onDynamicImport, onCallEx
160
160
  identifiers.forEach(([node, stack]) => {
161
161
  if (!isInScope(node.name, stack)) {
162
162
  const parent = stack[0];
163
- const grandparent = stack[1];
164
163
  const hasBindingShortcut = isStaticProperty(parent) && parent.shorthand && (!isNodeInPattern(parent) || isInDestructuringAssignment(parent, parentStack));
165
- const classDeclaration = parent.type === "PropertyDefinition" && grandparent?.type === "ClassBody" || parent.type === "ClassDeclaration" && node === parent.superClass;
164
+ const classDeclaration = parent.type === "ClassDeclaration" && node === parent.superClass;
166
165
  const classExpression = parent.type === "ClassExpression" && node === parent.id;
167
166
  onIdentifier?.(node, {
168
167
  hasBindingShortcut,
@@ -191,6 +190,11 @@ function isRefIdentifier(id, parent, parentStack) {
191
190
  if (parent.type === "MethodDefinition" && !parent.computed) {
192
191
  return false;
193
192
  }
193
+ // class property
194
+ if (parent.type === "PropertyDefinition" && !parent.computed) {
195
+ // Default values can still reference identifiers
196
+ return id === parent.value;
197
+ }
194
198
  // property key
195
199
  if (isStaticPropertyKey(id, parent)) {
196
200
  return false;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@depup/vitest__mocker",
3
3
  "type": "module",
4
- "version": "4.1.2-depup.0",
4
+ "version": "4.1.4-depup.0",
5
5
  "description": "Vitest module mocker implementation (with updated dependencies)",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -85,7 +85,7 @@
85
85
  "dependencies": {
86
86
  "estree-walker": "^3.0.3",
87
87
  "magic-string": "^0.30.21",
88
- "@vitest/spy": "4.1.2"
88
+ "@vitest/spy": "4.1.4"
89
89
  },
90
90
  "devDependencies": {
91
91
  "@types/estree": "^1.0.8",
@@ -95,8 +95,8 @@
95
95
  "msw": "^2.12.10",
96
96
  "pathe": "^2.0.3",
97
97
  "vite": "^6.3.5",
98
- "@vitest/spy": "4.1.2",
99
- "@vitest/utils": "4.1.2"
98
+ "@vitest/spy": "4.1.4",
99
+ "@vitest/utils": "4.1.4"
100
100
  },
101
101
  "scripts": {
102
102
  "build": "premove dist && rollup -c",
@@ -106,8 +106,8 @@
106
106
  "changes": {},
107
107
  "depsUpdated": 0,
108
108
  "originalPackage": "@vitest/mocker",
109
- "originalVersion": "4.1.2",
110
- "processedAt": "2026-03-26T16:31:38.361Z",
109
+ "originalVersion": "4.1.4",
110
+ "processedAt": "2026-04-09T08:38:08.639Z",
111
111
  "smokeTest": "passed"
112
112
  }
113
113
  }