mirror of
https://github.com/morluto/rea.git
synced 2026-11-12 01:41:21 +00:00
fix(javascript): honor effective symbolic descriptor values (#7222)
Resolve ordered descriptor values at the shared JavaScript fact owner and preserve uncertain intrinsic writes instead of stale exports. Normalize ordinary method values and reuse canonical primitive, prototype, ambient identity and ordering facts across consumers. 384 selected tests, format/static/docs checks, all final CI jobs and reviews pass. Actual Node controls cover 35 bundles; one possibly repeated factory explicitly stays unknown. Shipped Obsidian selected-source complete Evidence matches base/fixed CLI and MCP, with coverage and resource measurements in the PR. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
This commit is contained in:
1 parent
d54f5b07b4
commit
d4c511ae6e
12 files changed
+1117
-102
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { runInNewContext } from "node:vm";
|
||||
|
||||
import { analyzeJavaScriptStaticSource } from "./javascriptStaticAnalysis.js";
|
||||
|
||||
@@ -787,14 +788,32 @@ it("keeps named spreads unknown without proving nullish aliases", () => {
|
||||
).toEqual([]);
|
||||
});
|
||||
|
||||
it("skips propertyless literal spreads while retaining string and unknown spreads", () => {
|
||||
expect(
|
||||
rpcEndpoints(`
|
||||
it("preserves named fields across primitive and string spreads while retaining unknown overrides", () => {
|
||||
const source = `
|
||||
httpLink({url:"/primitives",...false,...42,...1n,[void effect()]:0});
|
||||
httpLink({url:"/string",..."ab"});
|
||||
httpLink({url:"/array",...[1]});
|
||||
httpLink({url:"/unknown",...options});
|
||||
`),
|
||||
).toEqual([
|
||||
`;
|
||||
const observed: string[] = [];
|
||||
runInNewContext(
|
||||
source,
|
||||
{
|
||||
httpLink: (options: { url: string }) => observed.push(options.url),
|
||||
effect: () => {},
|
||||
options: { url: "/overwritten" },
|
||||
},
|
||||
{ timeout: 1_000 },
|
||||
);
|
||||
expect(observed).toEqual([
|
||||
"/primitives",
|
||||
"/string",
|
||||
"/array",
|
||||
"/overwritten",
|
||||
]);
|
||||
expect(rpcEndpoints(source)).toEqual([
|
||||
{ kind: "network", value: "/primitives", mechanism: "trpc:link:httpLink" },
|
||||
{ kind: "network", value: "/string", mechanism: "trpc:link:httpLink" },
|
||||
{ kind: "network", value: "/array", mechanism: "trpc:link:httpLink" },
|
||||
]);
|
||||
});
|
||||
Reference in new issue
Block a user