tc39 / proposal-flatMap

proposal for flatten and flatMap on arrays
https://tc39.github.io/proposal-flatMap
214 stars 19 forks source link

targetIndex off-by-one error in FlattenIntoArray #13

Closed Jessidhia closed 7 years ago

Jessidhia commented 8 years ago

4.c.iv.2 will correctly set the targetIndex to point one past the end of the array flattened by the recursive call; but 4.d will then increment targetIndex once again, potentially creating a hole in the target array.

bterlson commented 7 years ago

Good call.