mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 21:46:01 +00:00
refactor(javascript): reuse invalid source-map projection (#16265)
This commit is contained in:
1 parent
7c7cd6bc4a
commit
100dcabeb6
1 file changed
+5
-15
@@ -618,7 +618,11 @@ const parseSourceMap = (
|
||||
file: JavaScriptArtifactFile,
|
||||
signal: AbortSignal | undefined,
|
||||
): JavaScriptSourceMapObservation => {
|
||||
if (!file.text.included) return unavailableSourceMap(file);
|
||||
if (!file.text.included)
|
||||
return invalidSourceMap(
|
||||
file,
|
||||
"Source-map text could not be decoded as UTF-8.",
|
||||
);
|
||||
const observed = inspectLocalSourceMapDeclarations(file.text.value, {
|
||||
check: () => assertJavaScriptAnalysisActive(signal),
|
||||
});
|
||||
@@ -692,20 +696,6 @@ export const htmlInlineScriptLimitation = ({
|
||||
// Keep the agent-facing limitation short; the unknown scope keeps the ranges.
|
||||
const HTML_INLINE_SCRIPT_LIMITATION_LINES = 10;
|
||||
|
||||
const unavailableSourceMap = (
|
||||
file: JavaScriptArtifactFile,
|
||||
): JavaScriptSourceMapObservation => {
|
||||
if (file.text.included)
|
||||
throw new TypeError("Expected unavailable source-map text");
|
||||
return {
|
||||
path: file.path,
|
||||
sha256: file.sha256,
|
||||
status: "invalid",
|
||||
sources: [],
|
||||
limitation: "Source-map text could not be decoded as UTF-8.",
|
||||
};
|
||||
};
|
||||
|
||||
const invalidSourceMap = (
|
||||
file: JavaScriptArtifactFile,
|
||||
limitation: string,
|
||||
|
||||
Reference in new issue
Block a user