Debian Codegraph @

js/src/tests/test262/built-ins/Array/from/items-is-null-throws.js

raw
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 description: Throws a TypeError if items argument is null
6 info: |
7 22.1.2.1 Array.from ( items [ , mapfn [ , thisArg ] ] )
8
9 ...
10 4. Let usingIterator be GetMethod(items, @@iterator).
11 5. ReturnIfAbrupt(usingIterator).
12 ...
13 ---*/
14
15 assert.throws(TypeError, function() {
16 Array.from(null);
17 }, 'Array.from(null) throws a TypeError exception');
18
19 reportCompare(0, 0);