Skip to content

Commit 667866e

Browse files
committed
fix(bench): sync JS fixture names and use super.count() in DoubleCounter (#1331)
Two bugs introduced by the fix(lint) commit (4ed709e): 1. define-property.js functions were renamed defProp/defProps/create → _defProp/ _defProps/_create (to suppress biome noUnusedVariables), but expected-edges.json was not updated. This caused 5 false positives and 5 false negatives in the benchmark (precision 84.4%, recall 81.8%). 2. DoubleCounter.count was changed from super.count() to Counter.count() by the same lint fix commit. The fixture is meant to test static class-inheritance resolution via super.count(); reverting to Counter.count() made the edge a plain same-file call, causing the class-inheritance recall to drop to 2/3. Fix: update expected-edges.json names to match renamed functions; restore super.count() in inheritance.js with a biome-ignore suppression explaining the intent.
1 parent 66b899a commit 667866e

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

tests/benchmarks/resolution/fixtures/javascript/expected-edges.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,35 +130,35 @@
130130
"notes": "new UserService() — class instantiation tracked as consumption"
131131
},
132132
{
133-
"source": { "name": "defProp", "file": "define-property.js" },
133+
"source": { "name": "_defProp", "file": "define-property.js" },
134134
"target": { "name": "f1", "file": "define-property.js" },
135135
"kind": "calls",
136136
"mode": "pts-define-property",
137137
"notes": "obj.f() — resolved via Object.defineProperty(obj, \"f\", { value: f1 })"
138138
},
139139
{
140-
"source": { "name": "defProps", "file": "define-property.js" },
140+
"source": { "name": "_defProps", "file": "define-property.js" },
141141
"target": { "name": "f1", "file": "define-property.js" },
142142
"kind": "calls",
143143
"mode": "pts-define-property",
144144
"notes": "obj.f1() — resolved via Object.defineProperties(obj, { \"f1\": { value: f1 } })"
145145
},
146146
{
147-
"source": { "name": "defProps", "file": "define-property.js" },
147+
"source": { "name": "_defProps", "file": "define-property.js" },
148148
"target": { "name": "f2", "file": "define-property.js" },
149149
"kind": "calls",
150150
"mode": "pts-define-property",
151151
"notes": "obj.f2() — resolved via Object.defineProperties(obj, { \"f2\": { value: f2 } })"
152152
},
153153
{
154-
"source": { "name": "create", "file": "define-property.js" },
154+
"source": { "name": "_create", "file": "define-property.js" },
155155
"target": { "name": "f1", "file": "define-property.js" },
156156
"kind": "calls",
157157
"mode": "pts-create-prototype",
158158
"notes": "obj.f1() — resolved via Object.create({ f1, f2 })"
159159
},
160160
{
161-
"source": { "name": "create", "file": "define-property.js" },
161+
"source": { "name": "_create", "file": "define-property.js" },
162162
"target": { "name": "f2", "file": "define-property.js" },
163163
"kind": "calls",
164164
"mode": "pts-create-prototype",

tests/benchmarks/resolution/fixtures/javascript/inheritance.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export class Counter {
2929

3030
export class DoubleCounter extends Counter {
3131
static count() {
32-
return Counter.count() * 2; // static super.method() → Counter.count
32+
// biome-ignore lint/complexity/noThisInStatic: intentional super call for class-inheritance resolution test
33+
return super.count() * 2; // static super.method() → Counter.count
3334
}
3435
}

0 commit comments

Comments
 (0)