| 1 |
// Copyright 2015 Leonardo Balter. All rights reserved. |
| 2 |
// This code is governed by the license found in the LICENSE file. |
| 3 |
/*--- |
| 4 |
esid: sec-array.from |
| 5 |
es6id: 22.1.2.1 |
| 6 |
description: Throws a TypeError if mapFn is not callable (Symbol) |
| 7 |
info: | |
| 8 |
22.1.2.1 Array.from ( items [ , mapfn [ , thisArg ] ] ) |
| 9 |
|
| 10 |
... |
| 11 |
2. If mapfn is undefined, let mapping be false. |
| 12 |
3. else |
| 13 |
a. If IsCallable(mapfn) is false, throw a TypeError exception. |
| 14 |
... |
| 15 |
features: |
| 16 |
- Symbol |
| 17 |
---*/ |
| 18 |
|
| 19 |
assert.throws(TypeError, function() { |
| 20 |
Array.from([], Symbol('1')); |
| 21 |
}); |