« Bugzilla Issues Index
#2562 — Array.from({0: 1, 2: 2, length: 3 }) should not return sparse array.
- bug_id:
2562
- creation_ts:
2014-02-21 13:27:00 -0800
- short_desc:
Array.from({0: 1, 2: 2, length: 3 }) should not return sparse array.
- delta_ts:
2014-04-06 11:31:06 -0700
- product:
Draft for 6th Edition
- component:
technical issue
- version:
Rev 22: January 20, 2014 Draft
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
FIXED
- priority:
Normal
- bug_severity:
enhancement
- everconfirmed:
true
- reporter:
C. Scott Ananian
- assigned_to:
Allen Wirfs-Brock
- cc:
mathias
- commentid:
7397
- comment_count:
0
- who:
C. Scott Ananian
- bug_when:
2014-02-21 13:27:42 -0800
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.
- commentid:
7446
- comment_count:
1
- who:
Allen Wirfs-Brock
- bug_when:
2014-03-18 15:20:12 -0700
fixed in rev23 editor's draft
- commentid:
7588
- comment_count:
2
- who:
Allen Wirfs-Brock
- bug_when:
2014-04-06 11:31:06 -0700
fixed in rev23 draft