fix(javascript): retain partial indexed source map facts

Share section classification across declaration analysis and mapping parsing. Preserve external URLs, malformed section reasons, section paths and safe sibling declarations without fetching nested maps.

Refs #5466. All 50 focused tests passed, including real CLI and stdio MCP regressions; typecheck and lint passed.
This commit is contained in:
morluto
2026-10-20 22:18:23 +08:00
parent 497037e6e3
commit 2b2e362a00
9 changed files with 972 additions and 105 deletions
@@ -293,6 +293,33 @@ export const addJavaScriptArtifactFiles = (
asset: target,
...javascriptArtifactAnalysisScopes["source-map"],
limitation: sourceMap.limitation,
...(sourceMap.external_sections === undefined &&
sourceMap.invalid_sections === undefined
? {}
: {
details: {
...(sourceMap.external_sections === undefined
? {}
: {
external_sections: sourceMap.external_sections.map(
({ section_path, url }) => ({
section_path: [...section_path],
url,
}),
),
}),
...(sourceMap.invalid_sections === undefined
? {}
: {
invalid_sections: sourceMap.invalid_sections.map(
({ section_path, reason }) => ({
section_path: [...section_path],
reason,
}),
),
}),
},
}),
});
const inlineScripts = inlineScriptsByPath.get(file.path);
if (inlineScripts !== undefined)