diff --git a/scripts/check-keyed-text-bounds.mjs b/scripts/check-keyed-text-bounds.mjs index cdf0b08aa0..4791dc6f05 100644 --- a/scripts/check-keyed-text-bounds.mjs +++ b/scripts/check-keyed-text-bounds.mjs @@ -171,7 +171,7 @@ import { dirname, join, relative, resolve, sep } from 'node:path'; import { fileURLToPath } from 'node:url'; import { isEntrypoint } from './invoked-as.mjs'; -import { blank, scanSource } from './js-comment-mask.mjs'; +import { blank, maskComments, maskCommentsAndLiterals, scanSource } from './js-comment-mask.mjs'; // ── The self-test's own battery roster and floor (#13489) ────────────────── // @@ -398,11 +398,13 @@ function unhintedFiles(relPaths) { * READ from. `struct` additionally has literal CONTENT blanked, delimiters * kept: it is what brackets are COUNTED on, so a `{` inside a string cannot * move the parse. + * + * Both are `js-comment-mask.mjs`'s own exports (#15776) rather than a + * composition re-derived here. */ function project(source) { - const { comment, literal } = scanSource(source); - const masked = blank(source, comment); - return { masked, struct: blank(masked, literal) }; + const masked = maskComments(source); + return { masked, struct: maskCommentsAndLiterals(source) }; } const OPEN_TO_CLOSE = { '(': ')', '{': '}', '[': ']' }; diff --git a/scripts/check-runner-env-posture.mjs b/scripts/check-runner-env-posture.mjs index a64ad15d9a..559fb70fa1 100644 --- a/scripts/check-runner-env-posture.mjs +++ b/scripts/check-runner-env-posture.mjs @@ -77,7 +77,7 @@ import { readFileSync, readdirSync, statSync, existsSync } from 'node:fs'; import { join, relative, resolve, sep } from 'node:path'; import { fileURLToPath } from 'node:url'; -import { scanSource, blank } from './js-comment-mask.mjs'; +import { maskComments, maskCommentsAndLiterals } from './js-comment-mask.mjs'; import { isEntrypoint } from './invoked-as.mjs'; // ── The self-test's own battery roster and floor (#13489) ────────────────── @@ -254,12 +254,13 @@ export const RUNNER_ENV_BRACKET_PATTERN = * * Offsets are preserved by both maskings, so a reported line number still * points at the real line. + * + * Both are `js-comment-mask.mjs`'s own exports (#15776) rather than a + * composition re-derived here. */ export function findRunnerEnvReads(source) { - const flags = scanSource(source); - - const commentMasked = blank(source, flags.comment); - const bothMasked = blank(commentMasked, flags.literal); + const commentMasked = maskComments(source); + const bothMasked = maskCommentsAndLiterals(source); const seen = new Set(); const out = []; diff --git a/scripts/check-widget-option-census.mjs b/scripts/check-widget-option-census.mjs index 21b2da2421..154f59fca6 100644 --- a/scripts/check-widget-option-census.mjs +++ b/scripts/check-widget-option-census.mjs @@ -119,7 +119,7 @@ import { fileURLToPath } from 'node:url'; import process from 'node:process'; import { isEntrypoint } from './invoked-as.mjs'; -import { blank, scanSource } from './js-comment-mask.mjs'; +import { maskCommentsAndLiterals } from './js-comment-mask.mjs'; const HERE = dirname(fileURLToPath(import.meta.url)); const REPO_ROOT = resolve(HERE, '..'); @@ -179,10 +179,12 @@ const NON_DECLARED_MEMBERS = [ * * Delimiters survive (the scanner flags literal content, not its quotes), so a * quoted object key and an array of string literals are both still locatable. + * + * `js-comment-mask.mjs`'s own `maskCommentsAndLiterals` (#15776), not a + * composition re-derived here. */ export function structureMask(source) { - const flags = scanSource(source); - return blank(blank(source, flags.comment), flags.literal); + return maskCommentsAndLiterals(source); } /**