Analysis: CopyArray mutation usage in endojs/endo#3063
Draft
Copilot wants to merge 4 commits intomfig/readonly-array-is-passablefrom
Draft
Analysis: CopyArray mutation usage in endojs/endo#3063Copilot wants to merge 4 commits intomfig/readonly-array-is-passablefrom
Copilot wants to merge 4 commits intomfig/readonly-array-is-passablefrom
Conversation
…rray` fix(pass-style): make `CopyReadonlyArray` also `Passable`
Copilot
AI
changed the title
[WIP] Update CopyArray compatibility with ReadonlyArray
Analysis: CopyArray mutation usage in endojs/endo
Jan 29, 2026
e5684ea to
8d8a604
Compare
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.
Identified all arrays declared as
CopyArraythat are subsequently mutated in the repository, confirming thatCopyArraymust remain mutable to avoid breaking changes.Findings
Production code mutations (
packages/patterns/src/patterns/patternMatchers.js):confirmElementsHasSplit(): OptionalinResultsandoutResultsparameters typed asCopyArrayare mutated via.push()pairsHasSplit(): OptionalinResultsandoutResultsparameters typed asCopyArray<[Key, bigint]>are mutated via.push()Test code mutations (
packages/pass-style/src/types.test-d.ts):CopyArraysupports mutation methods (.push(),.shift())Example Usage
Analysis confirms that changing
CopyArrayfromArray<T>toReadonlyArray<T>would break existing code. The separateCopyReadonlyArraytype introduced in #3061 maintains backward compatibility.Complete analysis available in
/tmp/copyarray-analysis/FINAL-REPORT.md.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.