fixhunt

biome complexity/noUselessUndefinedInitialization

labelled safe
Runs / 2026-10-17T19-30-16-565Z-biome-complexity_noUselessUndefinedInitializationbiome 2.5.152026-10-17 19:30 UTC8 programs × 1 round(s)8 programs, 5 fired, 5 fixed, 0 findings, 1 rejectedmodel cost $0.0004

Programs

idresulttitlehazard
r1-p001fix ok1. __proto__ keys, prototype access, Object.assign vs spreadVariable with name __proto__ used in Object.assign after fix removes initialization; fixes shape `let b = undefined, c = 1, d = 2;`
r1-p002invalid2. interface/declaration merging and name collisions across scopes (shadowing after a move)Variable `b` shadowed by another declaration after fix removes initialization; fixes shape `var a = undefined; let b = undefined, c = 1, d = 2;`
r1-p003fix ok3. async/await, promise ordering, generators and yield positionGenerator/yield position changed after fix removes initialization; fixes shape `for (let i = 0; i < 100; i++) { let i = undefined; }`
r1-p004fix ok4. temporal dead zone: let/const accessed before declaration after code is hoisted or reorderedVariable `y` in TDZ after fix removes initialization; fixes shape `let y = undefined;`
r1-p005silent prediction off5. exceptions thrown inside the code the fix removes or rewritesInitialization value throws; fix removes it; behavior changes
r1-p006fix ok6. var hoisting and re-declaration inside loops or after useVar re-declaration in loop after fix removes initialization; fixes shape `var a = undefined; for (let i = 0; i < 1; i++) { var a = 1; }`
r1-p007fix ok7. ASI and semicolon-less code, leading ( or [ on the next lineVariable initialization merged changes ASI behavior; fixes shape `let f = /**/undefined/**/ ;`
r1-p008silent prediction off8. order of evaluation when expressions are merged, duplicated or deleted (side effects run twice or never)Function with side effect called as initialization; fix removes call; side effect never runs

Sources

r1-p001 · 1. __proto__ keys, prototype access, Object.assign vs spread
1const obj = { __proto__: { x: 1 } };
2let __proto__ = undefined;
3let c = 1;
4let d = 2;
5console.log('before:', obj.__proto__.x);
6console.log('after Object.assign:', Object.assign({}, obj, { __proto__: null }).__proto__);
7try { console.log('after fix:', ({ __proto__: null, ...obj }).__proto__); } catch(e) { console.log('after fix error:', e.message); }
--- orig.js	2026-10-17 15:30:21.377309217 -0400
+++ fixed.js	2026-10-17 15:30:21.653328687 -0400
@@ -1,5 +1,5 @@
 const obj = { __proto__: { x: 1 } };
-let __proto__ = undefined;
+let __proto__ ;
 let c = 1;
 let d = 2;
 console.log('before:', obj.__proto__.x);
before: 1
after Object.assign: [Object: null prototype] {}
after fix: undefined
r1-p002 · 2. interface/declaration merging and name collisions across scopes (shadowing after a move) (generated program does not parse: /home/sun/dev/diaghunt/runs/2026-10-17T19-30-1)
1var a = 1;
2var b; // TDZ guard (will become undefined after fix)
3let b = 2; // shadowing inner scope
4console.log('a:', a);
5console.log('inner b before fix:', b);
6try { console.log('inner b after fix:', ({ a, b, c, d } = {}, b)); } catch(e) { console.log('inner b after fix error:', e.message); }
r1-p003 · 3. async/await, promise ordering, generators and yield position
1async function main() {
2 const gen = (function*() {
3 yield 1;
4 yield 2;
5 })();
6 let i = undefined;
7 const first = gen.next().value;
8 console.log('first yield:', first);
9 console.log('i after first yield:', i);
10 try { console.log('i after fix:', ({ i, ...{} }).i); } catch(e) { console.log('i after fix error:', e.message); }
11}
12main();
--- orig.js	2026-10-17 15:30:21.869343924 -0400
+++ fixed.js	2026-10-17 15:30:22.134362567 -0400
@@ -3,7 +3,7 @@
     yield 1;
     yield 2;
   })();
-  let i = undefined;
+  let i ;
   const first = gen.next().value;
   console.log('first yield:', first);
   console.log('i after first yield:', i);
first yield: 1
i after first yield: undefined
i after fix: undefined
r1-p004 · 4. temporal dead zone: let/const accessed before declaration after code is hoisted or reordered
1try { console.log('y before declaration:', y); } catch(e) { console.log('y before declaration error:', e.name + ': ' + e.message); }
2let y = undefined;
3console.log('y after declaration:', y);
4try { console.log('y after fix:', ({ y }).y); } catch(e) { console.log('y after fix error:', e.name + ': ' + e.message); }
--- orig.js	2026-10-17 15:30:22.295373863 -0400
+++ fixed.js	2026-10-17 15:30:22.579393789 -0400
@@ -1,4 +1,4 @@
 try { console.log('y before declaration:', y); } catch(e) { console.log('y before declaration error:', e.name + ': ' + e.message); }
-let y = undefined;
+let y ;
 console.log('y after declaration:', y);
 try { console.log('y after fix:', ({ y }).y); } catch(e) { console.log('y after fix error:', e.name + ': ' + e.message); }
y before declaration error: ReferenceError: Cannot access 'y' before initialization
y after declaration: undefined
y after fix: undefined
r1-p005 · 5. exceptions thrown inside the code the fix removes or rewrites
1function thrower() { throw new Error('boom'); }
2let x = thrower();
3console.log('x after throw (unreachable):', x);
4try { console.log('x after fix:', ({ x }).x); } catch(e) { console.log('x after fix error:', e.name + ': ' + e.message); }
r1-p006 · 6. var hoisting and re-declaration inside loops or after use
1var a = undefined;
2for (let i = 0; i < 1; i++) {
3 var a = 1;
4}
5console.log('a after loop (var hoisted):', a);
6try { console.log('a after fix:', ({ a }).a); } catch(e) { console.log('a after fix error:', e.message); }
--- orig.js	2026-10-17 15:30:22.942419257 -0400
+++ fixed.js	2026-10-17 15:30:23.212438121 -0400
@@ -1,4 +1,4 @@
-var a = undefined;
+var a ;
 for (let i = 0; i < 1; i++) {
   var a = 1;
 }
a after loop (var hoisted): 1
a after fix: 1
r1-p007 · 7. ASI and semicolon-less code, leading ( or [ on the next line
1// no semicolons; relies on ASI
2let g = undefined
3let h = (function() { return 1; })()
4console.log('g before fix:', g);
5console.log('h before fix:', h);
6try { console.log('g after fix:', ({ g }).g); } catch(e) { console.log('g after fix error:', e.message); }
7try { console.log('h after fix:', ({ h }).h); } catch(e) { console.log('h after fix error:', e.message); }
--- orig.js	2026-10-17 15:30:23.375449496 -0400
+++ fixed.js	2026-10-17 15:30:23.650468687 -0400
@@ -1,5 +1,5 @@
 // no semicolons; relies on ASI
-let g = undefined
+let g 
 let h = (function() { return 1; })()
 console.log('g before fix:', g);
 console.log('h before fix:', h);
g before fix: undefined
h before fix: 1
g after fix: undefined
h after fix: 1
r1-p008 · 8. order of evaluation when expressions are merged, duplicated or deleted (side effects run twice or never)
1let counter = 0;
2function sideEffect() { counter++; return 42; }
3let x = sideEffect();
4console.log('x before fix:', x, 'counter:', counter);
5try { console.log('x after fix:', ({ x }).x, 'counter after fix:', counter); } catch(e) { console.log('x after fix error:', e.message); }
x before fix: 42 counter: 1
x after fix: 42 counter after fix: 1