Repository navigation
Preserve extracted native Object.assign identity - #609
Open
CaelmBleidd wants to merge 1 commit into
Open
CaelmBleidd wants to merge 1 commit into
CaelmBleidd wants to merge 1 commit into
Conversation
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.
Bundled JavaScript such as Vest stores
Object.assignin a module variable (var assign_default = Object.assign) and calls it later. The method-property capture previously recognized only an immediately matching receiver call; extraction could become a mixed-kind value and stop at the correct function-field runtime-sort guard.Give the exact native SDK
Object.assignproperty a stable callable identity even without an immediate call. Retain its native owner/name for later unbound calls while each invocation keeps its own argument/result types and passes through the ordinary native mutation/nullish-target boundary. Captured native functions retain functiontypeofand can be recovered from boxed storage. The runtime-sort guard is unchanged.Reuse the existing written/deleted property metadata so a replacement or deletion takes precedence on a later property read. Already extracted original functions retain their native target after either mutation. Project/source objects named
Objectkeep their own method behavior. This PR does not implement Object.assign property copying; that remains the selected model/residual-call policy.Depends on #589 for nullish native Object targets, which in turn depends on #559. This PR contains one additional callable-identity commit.
Validation: 18 focused tests pass with zero failures or skips (5 new source/native-oracle tests, 8 nullable Object-boundary tests, 5 builtin-owner tests). Strict TS main/test lint reports zero issues. Removing only the new native capture entry point makes the source alias/function-identity check return 0 instead of 1; restoring it passes. This discriminates lost native identity without claiming that this focused fixture reproduces the original corpus sort-guard exception. A separate method-bearing object-literal shadow fixture stopped before the subject operation; its exact source/hash and failed trace are preserved as a separate finding, with root cause unverified. The shadow regression here uses the existing supported declared-source-class pattern and retains the same native oracle result. Another preserved fixture exposes deferred module initialization when a module original is first read only after replacing the native property; the retention tests explicitly read the original into a local before mutation to isolate callable identity. Eager module side-effect semantics are outside this change. Full suites are left to CI; real corpus impact is checked on the combined runtime.