fix(javascript): preserve and resolve complete source-map URLs (#1788)

Keep line-comment URL declarations intact and percent-decode local URL paths
once, preserving raw Evidence identity and artifact-root confinement.

Fixes #1781. Fixes #1782.

Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
This commit is contained in:
Ysopwnable authored and GitHub committed 2026-10-11 18:19:39 +08:00
1 parent a077e81bec
commit ce845ba428
4 files changed
+207 -1

No files matched your search

@@ -162,6 +162,14 @@ const contextualCandidate = (
return unresolvedCandidate("external", [
"URL schemes and protocol-relative URLs are outside this local artifact path context.",
]);
if (context === "url-reference") {
const decoded = percentDecodeUrlPath(declared);
if (decoded === null)
return unresolvedCandidate("rejected", [
"The URL reference path percent-decodes to NUL or to bytes that are not UTF-8.",
]);
declared = decoded;
}
return relativeCandidate(input.sourcePath, declared);
};