Repository navigation
fix(javascript): verify loader origins, assignment operators, and bootstrap integrity in static analysis - #4338
Closed
1aifanatic wants to merge 5 commits into
Closed
1aifanatic wants to merge 5 commits into
1aifanatic wants to merge 5 commits into
Conversation
7 of 14 tasks
1aifanatic
force-pushed
the
fix/4202-native-addon-assignment-operator
branch
from
October 21, 2026 04:59
c568997 to
a20f4f1
Compare
Author
|
Rebased onto latest
|
13 tasks
Owner
|
Thank you for bringing these loader and bootstrap cases together. Main now covers the reported assignment, loader-origin, optional-call, computed-slot and alias-write defects; the closures for #3883, #3884, #3885, #4202 and #4229 link the owning implementations and regressions. I’m closing this PR as superseded. Its additional unrelated-loader-key control may still be useful; please feel free to reopen if you would like to pursue that focused coverage. I did not rerun the tests in this pass. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
inspectReExportinsrc/domain/javascript/electronStaticAnalysisNative.tstreated arithmetic assignments (+=,-=,*=) toexportsormodule.exportsas"re-export"rather than"require"([Bug] Arithmetic native-addon assignments are reported as direct re-exports #4202).nativeRequireinsrc/domain/javascript/electronStaticAnalysisNative.tsmatched anyIdentifiernamed"require"or.requiremethod call without verifying thatrequirewas an unshadowed loader binding ([Bug] Local require method creates a resolved native-addon binding #3884), and dropped optionalrequire?.(...)calls ([Bug] Optional require call loses its native-addon binding record #3885).exposedSlotWriteinsrc/domain/javascript/javascriptBootstrapIntegrity.tsmissed computed slot writes (load.m[key] = ...) on module tables, leaving false replacedBrowserWindowevidence ([Bug] Computed module-table slot write still reports replaced Electron BrowserWindow #3883).canonicalWebpackInteropBindingsinsrc/domain/javascript/javascriptBundledRequireOrigin.tsmissed loader mutations performed throughconstaliases of bundled require helpers ([Bug] Loader-alias getter replacement leaves false Electron BrowserWindow evidence #4229)."require"rather than direct"re-export".require(...)andrequire?.(...)calls delegate loader provenance and argument normalization to the sharedsemanticRequireCallAtowner, ignoring local.requiremethods and shadowedrequirebindings while retaining optionalrequire?.(...)calls.const key = 0,Number("45840")) and invalidate unproven runtime keys unless they match chunk installation (for (k in chunk) loader.m[k] = chunk[k]).node.operator === "="inelectronStaticAnalysisNative.ts.JavaScriptSemanticAnalysisStatetoinspectElectronNativeNodeand delegate call classification (includingOptionalCallExpression) tosemanticRequireCallAt.javascriptBootstrapIntegrity.ts.mayReferToLoaderBindinginjavascriptBundledRequireOrigin.ts.Validation
npm run test:local -- src/domain/javascript/electronNativeLoaderPaths.test.ts src/domain/javascript/electronWrappedCallPaths.test.ts src/domain/javascript/electronBundledRequireIdentity.test.tsnpm run check:fastnpm run format:checknpm run check:prgate was not run for this focused domain change.Performance and Evidence impact
Author readiness
Leave these unchecked until a human owner has reviewed the diff and validation evidence and is ready to request initial maintainer review.
Human owner: