mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 17:44:27 +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
@@ -118,9 +118,25 @@ const graphFor = async (
|
||||
};
|
||||
|
||||
describe("Electron semantic coverage", () => {
|
||||
it.each(["main.js", "main.MJS"])(
|
||||
"does not present candidate Electron boundaries as proven coverage for %s",
|
||||
async (path) => {
|
||||
const { limitations, electronSemantics } = await graphFor(
|
||||
'const { BrowserWindow } = require("electron"); new BrowserWindow();',
|
||||
undefined,
|
||||
path,
|
||||
);
|
||||
expect(electronSemantics).toBeUndefined();
|
||||
expect(limitations.join(" ")).toContain("Conditional Electron findings");
|
||||
expect(limitations).not.toContain(EMPTY_COVERAGE);
|
||||
},
|
||||
);
|
||||
|
||||
it("reports empty Electron coverage when the module is referenced but nothing is recovered", async () => {
|
||||
const { limitations, electronSemantics } = await graphFor(
|
||||
`const { app } = require("electron");\napp.whenReady();\n`,
|
||||
undefined,
|
||||
"main.cjs",
|
||||
);
|
||||
expect(limitations).toContain(EMPTY_COVERAGE);
|
||||
expect(electronSemantics).toBe("empty");
|
||||
@@ -129,6 +145,8 @@ describe("Electron semantic coverage", () => {
|
||||
it("reports idle-coverage limits, not empty coverage, once a boundary fact is recovered", async () => {
|
||||
const { limitations, electronSemantics } = await graphFor(
|
||||
`const { ipcMain } = require("electron");\nipcMain.handle("ping", () => 1);\n`,
|
||||
undefined,
|
||||
"main.cjs",
|
||||
);
|
||||
expect(limitations).not.toContain(EMPTY_COVERAGE);
|
||||
expect(limitations).toContainEqual(
|
||||
@@ -171,6 +189,8 @@ describe("Electron semantic coverage", () => {
|
||||
it("matches a supported Electron subpath and ignores an unrelated package", async () => {
|
||||
const subpath = await graphFor(
|
||||
`const { app } = require("electron/main");\napp.whenReady();\n`,
|
||||
undefined,
|
||||
"main.cjs",
|
||||
);
|
||||
expect(subpath.electronSemantics).toBe("empty");
|
||||
const unrelated = await graphFor(
|
||||
@@ -193,6 +213,7 @@ describe("Electron semantic coverage", () => {
|
||||
limits: null,
|
||||
},
|
||||
}),
|
||||
"main.cjs",
|
||||
);
|
||||
expect(electronSemantics).toBe("empty");
|
||||
expect(limitations).toContain(EMPTY_COVERAGE);
|
||||
@@ -207,6 +228,7 @@ describe("Electron semantic coverage", () => {
|
||||
...entry,
|
||||
semantic: null,
|
||||
}),
|
||||
"main.cjs",
|
||||
);
|
||||
expect(electronSemantics).toBe("empty");
|
||||
});
|
||||
@@ -304,6 +326,8 @@ it("classifies a bundle module by its loader, not by its name", async () => {
|
||||
`100:(e,t,n)=>{"use strict";const s=n(45840);s.ipcMain.handle("x",()=>1)}`,
|
||||
`n(100);`,
|
||||
),
|
||||
undefined,
|
||||
"main.cjs",
|
||||
);
|
||||
expect(external.electronSemantics).toBe("recovered");
|
||||
|
||||
@@ -315,6 +339,8 @@ it("classifies a bundle module by its loader, not by its name", async () => {
|
||||
`100:(e,t,n)=>{"use strict";const s=n("electron");s.ipcMain.handle("x",()=>1)}`,
|
||||
`n(100);`,
|
||||
),
|
||||
undefined,
|
||||
"main.cjs",
|
||||
);
|
||||
expect(externalUnderKey.electronSemantics).toBe("recovered");
|
||||
});
|
||||
Reference in new issue
Block a user