tc39 / proposal-flatMap

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

FlattenIntoArray does not set length? #41

Closed ljharb closed 6 years ago

ljharb commented 6 years ago

Step 3.c.v.2 creates the data property for the index, but does not update the length property - certainly native Array [[DefineOwnProperty]] updates it for you (https://tc39.github.io/ecma262/#sec-array-exotic-objects-defineownproperty-p-desc step 3.h.ii) - but whatever's created with the species constructor may not.

Precedent is to manually set it:

I think you'd want to add it as 3.c.v.3?