mirror of
https://github.com/morluto/rea.git
synced 2026-11-12 01:41:21 +00:00
fix(javascript): preserve loader authority for exact suffixes (#9477)
* fix(javascript): require exact loader suffix case * fix(javascript): share exact loader mode across import resolution * test(process): align symlink fixture with filesystem checkpoints * test(javascript): normalize the module resolution oracle path separators * test(frida): assert the CLI spawn Evidence contract * test(mcp): use an unsupported analysis-view parent * test(browser): separate source-location line bounds from parity * fix(javascript): preserve uncertain loader provenance * test(javascript): cover uncertain require resolution * fix(javascript): retain conditional Electron evidence * fix(javascript): preserve timed semantic provenance * fix(javascript): retain conditional builtin effects * test(javascript): distinguish bundled host authority * fix(javascript): preserve nested loader invocation identity * test(javascript): qualify Electron fixture authority * fix(javascript): preserve loader invocation authority * fix(javascript): respect source order for resolver escapes * fix(javascript): check nested loader callable mutations * fix(javascript): retain conditional constructor requests * fix(reference): retain constructor loader relationships * fix(reference): follow nested loader callable paths * refactor(javascript): share callable mutation interpretation * fix(javascript): require exact package loader suffixes * refactor(javascript): unify conditional relation evidence * refactor(javascript): unify conditional node evidence * fix(javascript): retain unknown authority for mixed case sources * fix(javascript): preserve loader uncertainty for dotfiles * fix(reference): classify javascript suffix dotfiles * test(reference): cover suffix dotfiles through cli * fix(javascript): retain equivalent conditional built-in origins * fix(javascript): preserve wrapped resolver operation * fix(javascript): retain nested conditional built-in receivers * test(javascript): declare CommonJS in native addon fixtures * fix(javascript): retain wrapped resolver candidates * style: format merged native command schema * fix(javascript): preserve uncertain loader authority * test(javascript): require candidate preload evidence * test(javascript): cover reference loader member writes --------- Co-authored-by: ShuaixinHuang <1836656514@qq.com>
This commit is contained in:
1 parent
78a84d75c0
commit
b46f4fcebd
112 files changed
+5156
-797
No files matched your search
@@ -42,7 +42,7 @@ import {
|
||||
type JavaScriptSemanticAnalysisState,
|
||||
type JavaScriptSemanticBindingState,
|
||||
} from "./javascriptSemanticState.js";
|
||||
import { readSemanticRequireOrigin } from "./javascriptSemanticRequireOriginSlot.js";
|
||||
import { readSemanticRequireOriginCandidate } from "./javascriptSemanticRequireOriginSlot.js";
|
||||
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
||||
import {
|
||||
readExactJavaScriptLiteral,
|
||||
@@ -1230,17 +1230,18 @@ const provenanceForBindingInitializers = (
|
||||
} finally {
|
||||
context.bindings.delete(binding.bindingId);
|
||||
}
|
||||
if (resolved.status !== "module" || initializer.projection.length === 0)
|
||||
if (resolved.origins.length === 0 || initializer.projection.length === 0)
|
||||
return resolved;
|
||||
return semanticOriginsProvenance(
|
||||
resolved.origins.map((origin) => ({
|
||||
...origin,
|
||||
importedPath: [
|
||||
...origin.importedPath,
|
||||
...initializer.projection.map((segment) => String(segment)),
|
||||
],
|
||||
})),
|
||||
);
|
||||
const projected = resolved.origins.map((origin) => ({
|
||||
...origin,
|
||||
importedPath: [
|
||||
...origin.importedPath,
|
||||
...initializer.projection.map((segment) => String(segment)),
|
||||
],
|
||||
}));
|
||||
return resolved.status === "ambiguous"
|
||||
? semanticAmbiguousProvenance(projected, resolved.reason)
|
||||
: semanticOriginsProvenance(projected);
|
||||
};
|
||||
|
||||
const provenanceForExpression = (
|
||||
@@ -1273,7 +1274,7 @@ const provenanceForExpression = (
|
||||
expressionDepth: context.expressionDepth + unwrapped.depth,
|
||||
});
|
||||
}
|
||||
const required = readSemanticRequireOrigin(node, context.state);
|
||||
const required = readSemanticRequireOriginCandidate(node, context.state);
|
||||
if (required !== undefined)
|
||||
return semanticOriginsProvenance([required.origin]);
|
||||
if (t.isSequenceExpression(node)) {
|
||||
@@ -1319,14 +1320,14 @@ const provenanceForExpression = (
|
||||
}
|
||||
const base = provenanceForExpression(current, nestedContext(context));
|
||||
const path = members.reverse();
|
||||
return base.status !== "module"
|
||||
? base
|
||||
: semanticOriginsProvenance(
|
||||
base.origins.map((origin) => ({
|
||||
...origin,
|
||||
importedPath: [...origin.importedPath, ...path],
|
||||
})),
|
||||
);
|
||||
if (base.origins.length === 0) return base;
|
||||
const projected = base.origins.map((origin) => ({
|
||||
...origin,
|
||||
importedPath: [...origin.importedPath, ...path],
|
||||
}));
|
||||
return base.status === "ambiguous"
|
||||
? semanticAmbiguousProvenance(projected, base.reason)
|
||||
: semanticOriginsProvenance(projected);
|
||||
}
|
||||
if (t.isConditionalExpression(node) || t.isLogicalExpression(node)) {
|
||||
const candidates = semanticSelectedBranches(node, context).map((branch) =>
|
||||
|
||||
Reference in new issue
Block a user