archives

« Bugzilla Issues Index

#2562 — Array.from({0: 1, 2: 2, length: 3 }) should not return sparse array.


Discussed in http://esdiscuss.org/topic/array-from-and-sparse-arrays

Array.from([1,,2]) returns a non-sparse array (because it uses the iterator case, but see bug 2416), but Array.from({0: 1, 2: 2, length: 3 }) returns a sparse array (because it uses the 'array-like' case).

It was suggested that the two cases should be made consistent. Since "holes are evil", the array-like case should lose the kPresent test in step 17b etc.


fixed in rev23 editor's draft


fixed in rev23 draft