Skip to content

Commit e8d5eb4

Browse files
committed
fix(gate): put check-console-intercept-disarm's dispatch behind isEntrypoint (check:entry-guard)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
1 parent 7e04c85 commit e8d5eb4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

scripts/check-console-intercept-disarm.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ import { dirname, join, resolve } from 'node:path';
9090
import { tmpdir } from 'node:os';
9191
import { fileURLToPath } from 'node:url';
9292
import { blank, scanSource } from './js-comment-mask.mjs';
93+
import { isEntrypoint } from './invoked-as.mjs';
9394

9495
/**
9596
* Comments AND string/template/regex content blanked, offsets kept. This gate
@@ -419,5 +420,7 @@ function selfTest() {
419420
console.log(`self-test OK: ${cases.length} cases + real-tree population floor.`);
420421
}
421422

422-
if (process.argv.includes('--self-test')) selfTest();
423-
else main();
423+
if (isEntrypoint(import.meta.url)) {
424+
if (process.argv.includes('--self-test')) selfTest();
425+
else main();
426+
}

0 commit comments

Comments
 (0)