Files
msd-core/tests
sim 4036470ca0 fix(#3339): consolidated helper silently overwrote an unrelated module-scope function
The runVerifiedPhaseComplete(args, tmpDir) consolidation in the prior
commit hoisted a `function` declaration into a bare (sloppy-mode) block.
Annex B legacy hoisting semantics mean a block-scoped function
declaration in sloppy mode also reassigns any enclosing var of the same
name the instant the block executes -- and this file already had an
unrelated module-scope runVerifiedPhaseComplete(args, tmpDir, env) at
line 54, used by ~50 other call sites throughout the file. The block ran
before any test() body did, so every one of those 50 call sites was
silently pointed at the consolidated helper's different phase-matching
logic (parseInt-based, loses dotted decimal sub-phase segments) instead
of the real one (normalizePhaseToken/phaseTokenFromDirName-based),
breaking multi-level decimal phases like 03.2.1.

Fixed by wrapping the consolidated helper in a strict-mode IIFE, which
disables Annex B hoisting and restores real block scoping.

Caught by a genuine gsd-test failure (2 unique failures, both throw-
class, both in phase-completion verification-gate behavior) -- root-
caused via diff against the pre-consolidation commit and a scoped local
node --test run confirming the fix, not asserted from a hunch.

No test() count changed. No production code touched.
2026-08-12 08:25:14 -04:00
..