mirror of
https://github.com/morluto/rea
synced 2026-10-27 14:42:18 -04:00
fix(javascript): read utilityProcess.fork options from the argv slot (#6280)
Electron's utilityProcess.fork(modulePath[, args][, options]) treats a
non-array object in the second argument as the options and ignores the
third. The static extractor only read the third argument, so
`fork("./worker.js", { serviceName })` lost the declared name while
reporting exact, complete coverage, and an object in the second slot let
an ignored third argument supply the name.
Move the optional-argv options selection that child_process already used
into the shared expression-shape owner and reuse it for utility
processes. Unproven argv shapes, spreads and identifier options remain
unknown with partial coverage; nullish options or a nullish serviceName
declare no name, matching Electron's runtime checks.
Fixes #6208
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ import { inspectElectronStaticNode } from "./electronStaticAnalysis.js";
|
||||
import { hasPossibleCommonJsDelegateWrite } from "./javascriptSemanticRequireOrigin.js";
|
||||
import { semanticResourceLimitReason } from "./javascriptSemanticResourceLimits.js";
|
||||
import { createStaticNodePathResolveQuery } from "./javascriptStaticPathIntrinsics.js";
|
||||
import { createSemanticExpressionShapeResolver } from "./javascriptSemanticExpressionShapes.js";
|
||||
import { finishElectronBrowserWindowsSteps } from "./electronStaticAnalysisBrowser.js";
|
||||
import {
|
||||
detectVendors,
|
||||
@@ -109,6 +110,7 @@ export function* analyzeParsedJavaScriptStaticSourceSteps(
|
||||
electronInvocationPath: electronIdentity.invocationPath,
|
||||
electronAppPathChangePossible: electronIdentity.mayChangeAppPath,
|
||||
rpcScan: createJavaScriptRpcScan(source, receivers.rpcClientRoots, index),
|
||||
expressionShapes: createSemanticExpressionShapeResolver(bindings),
|
||||
};
|
||||
yield* traverseStaticSourceSteps(file, findings, bindings);
|
||||
yield* finishElectronBrowserWindowsSteps(findings, index);
|
||||
|
||||
Reference in New Issue
Block a user