Skip to content

fix: leave an array draft unchanged when deleting an index it does not have - #213

Merged
unadlib merged 13 commits into
mainfrom
fix-array
Oct 27, 2026
Merged

unadlib merged 13 commits into
mainfrom
fix-array

Conversation

@unadlib

@unadlib unadlib commented Oct 27, 2026

Copy link
Copy Markdown
Owner

@github-actions

Copy link
Copy Markdown

Coverage after merging fix-array into main will be

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   apply.ts100%100%100%100%
   array.ts100%100%100%100%
   constant.ts100%100%100%100%
   create.ts100%100%100%100%
   current.ts100%100%100%100%
   draft.ts100%100%100%100%
   draftify.ts100%100%100%100%
   error.ts100%100%100%100%
   index.ts100%100%100%100%
   interface.ts100%100%100%100%
   internal.ts100%100%100%100%
   makeCreator.ts100%100%100%100%
   map.ts100%100%100%100%
   original.ts100%100%100%100%
   patch.ts99.61%99.10%100%100%111
   rawReturn.ts100%100%100%100%
   set.ts100%100%100%100%
   unsafe.ts100%100%100%100%
src/utils
   cast.ts100%100%100%100%
   copy.ts100%100%100%100%
   deepFreeze.ts100%100%100%100%
   draft.ts100%100%100%100%
   finalize.ts100%100%100%100%
   forEach.ts100%100%100%100%
   index.ts100%100%100%100%
   mark.ts100%100%100%100%
   marker.ts100%100%100%100%
   proto.ts100%100%100%100%

@unadlib
unadlib merged commit 7ef4bb8 into main Oct 27, 2026
10 checks passed
@unadlib
unadlib deleted the fix-array branch October 27, 2026 00:55
unadlib added a commit that referenced this pull request Nov 6, 2026
The random sparse edits each start from a new, unfrozen array. Here each state
is the base of the next write, as in a store: thirty writes per sample, to
lists left unfrozen, frozen by auto-freeze, or frozen with their elements by
the application, deleting at indexes the list has and at ones it does not
have. Each list is compared with a plain array given the same edits under the
documented delete, each write's patches replay it both ways, and a write that
deletes only missing indexes returns its base.

Removing the #213 guard from deletePropertyTrap fails all six cases. Copying
frozen arrays with holes by a spread fails the two auto-frozen ones, which
otherwise only "copies of frozen arrays keep holes and undefined elements"
catches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant