Repository navigation
fix(javascript): preserve array index positions - #668
Closed
rudycelekli wants to merge 1 commit into
Closed
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
Signed-off-by: RudyCelekli <[email protected]>
morluto
approved these changes
Oct 6, 2026
morluto
left a comment
Owner
There was a problem hiding this comment.
Approve: array holes push explicit unknown to preserve indices, fixed prefix breaks on spread so trailing elements do not shift, and index projection uses canonical String(index)===key check (rejects 01/-1/1.5). Dataflow tests cover holes/canonical/spread. Checks green.
Owner
|
Superseded by #705, which cherry-picks this change (plus 13 sibling fixes) onto current main with conflict resolution and regenerated catalogs. Closing to keep one reviewable merge unit. |
Owner
|
Thanks, @rudycelekli, for your work on “fix(javascript): preserve array index positions.” I appreciate your contribution to REA. |
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.
What changed
Preserve JavaScript array positions in static value recovery. Array holes keep an explicit unknown slot; a spread with unknown length ends the fixed-index prefix. Canonical numeric member keys (including
"1") now project array items without accepting"01"as an array index.Real consumer reproduction
The complete built public
analyzeJavaScriptApplicationworkflow analyzes an ownedmain.mjs. Before,const [first,,third] = ["zero",,"two"]omitted the value forthird, and["zero","one"][1]omitted the member value. A native Node process reports"two"/"one"; the repaired serialized semantic graph agrees on all three retained bindings. Separate regressions ensure an unknown spread does not shift a trailing literal into an earlier index, and noncanonical property spellings remain unknown.Verification
npm run check,npm run check:fast,npm run build:cachedpassed.git diff --checkpassed.No schema or tool changes. Unknown holes and spread length remain unknown; this does not claim exact array length or evaluate source code during analysis. Hopper/Ghidra were not exercised: this changes provider-independent static JavaScript semantics. AI assistance was used for investigation, implementation and verification.