mirror of
https://github.com/morluto/rea
synced 2026-10-26 14:25:49 -04:00
fix(javascript): retain standalone GraphQL source operations
Retain named operations in GraphQL Source bodies with locationOffset metadata. Use final property ownership and parsed lexical facts to suppress copies only when a recovered document, its containers and source aliases have proven private metadata ownership. Preserve independent observations after writes, exports, opaque uses, classic-script global exposure or direct evaluation. Share interpretation across application and captured-web analysis. Build optional reference indexes once per source and checkpoint examined records, including suppressed findings, to retain cooperative cancellation. Fixes #3311 Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
inspectRouteProperty,
|
||||
inspectRoleProperty,
|
||||
inspectRpcNode,
|
||||
finishRpcScanSteps,
|
||||
indexVitePreloadDependencyTable,
|
||||
} from "./javascriptStaticAnalysisCalls.js";
|
||||
import {
|
||||
@@ -81,8 +82,9 @@ export function* analyzeParsedJavaScriptStaticSourceSteps(
|
||||
): Generator<void, JavaScriptStaticAnalysis> {
|
||||
const accumulator = createJavaScriptAnalysisAccumulator(source.length);
|
||||
// One definitions pass serves receiver classification and binding lookup.
|
||||
const { bindings, receivers } =
|
||||
yield* indexJavaScriptBindingsWithReceiversSteps(file.program);
|
||||
const index = yield* indexJavaScriptBindingsWithReceiversSteps(file.program);
|
||||
const { bindings, receivers } = index;
|
||||
yield* index.indexAmbientWritesSteps();
|
||||
const electronIdentity = yield* indexJavaScriptElectronIdentitySteps(
|
||||
file.program,
|
||||
bindings,
|
||||
@@ -95,7 +97,7 @@ export function* analyzeParsedJavaScriptStaticSourceSteps(
|
||||
vitePreloadDependencyTable: indexVitePreloadDependencyTable(file.program),
|
||||
openReceiverFacts: receivers.openReceivers,
|
||||
electronBindings: electronIdentity.bindings,
|
||||
rpcScan: createJavaScriptRpcScan(source, receivers.rpcClientRoots),
|
||||
rpcScan: createJavaScriptRpcScan(source, receivers.rpcClientRoots, index),
|
||||
},
|
||||
bindings,
|
||||
);
|
||||
@@ -122,6 +124,7 @@ function* traverseStaticSourceSteps(
|
||||
return undefined;
|
||||
},
|
||||
});
|
||||
yield* finishRpcScanSteps(findings);
|
||||
}
|
||||
|
||||
const finalizeStaticAnalysis = (
|
||||
|
||||
Reference in New Issue
Block a user