« Bugzilla Issues Index
#2435 — Throwing on Array.from(undefined) should be reconsidered.
- bug_id:
2435
- creation_ts:
2014-01-26 17:30:00 -0800
- short_desc:
Throwing on Array.from(undefined) should be reconsidered.
- delta_ts:
2014-02-21 13:25:56 -0800
- 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:
WONTFIX
- priority:
Normal
- bug_severity:
enhancement
- everconfirmed:
true
- reporter:
Rick Waldron
- assigned_to:
Allen Wirfs-Brock
- cc:
["brterlso", "ecmascript", "mathias", "waldron.rick"]
- commentid:
7004
- comment_count:
0
- who:
Rick Waldron
- bug_when:
2014-01-26 17:30:16 -0800
A contribution to test-262 shed light on the current spec that says:
Array.from(undefined)
Will actually throw a TypeError.
After discussion with Brian Terlson, we agreed that an explicit undefined that produces an empty array (or instance of whatever subclass it's called from) is more useful than the TypeError.
The proposed change is:
Array.from(arrayLike = [], mapFn = undefined, thisArg = undefined)
Where arrayLike will default to an empty array if omitted or receives explicit undefined.
- commentid:
7396
- comment_count:
1
- who:
Rick Waldron
- bug_when:
2014-02-21 13:25:56 -0800
Resolved per Jan 28 discussion:
https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-01/jan-28.md#arrayfrom