tc39/proposal-change-array-by-copy

withSpliced performs more work than necessary.

Closed this issue · 1 comments

Array.prototype.withSpliced step 13 is copying more values into the result than it needs to.

1. Repeat, while _k_ < _newLen_,

Repeat, while _k_ < _newLen_, should be Repeat, while _k_ < _actualStart_,

Note, the polyfill already implements the correct version:

while (k < actualStart) {