js/src/jit-test/tests/basic/spread-call-not-iterable.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:2bdf11ca109d
1 load(libdir + "asserts.js");
2 load(libdir + "iteration.js");
3
4 assertThrowsInstanceOf(() => Math.sin(...true), TypeError);
5 assertThrowsInstanceOf(() => Math.sin(...false), TypeError);
6 assertThrowsInstanceOf(() => Math.sin(...new Date()), TypeError);
7 assertThrowsInstanceOf(() => Math.sin(...Function("")), TypeError);
8 assertThrowsInstanceOf(() => Math.sin(...function () {}), TypeError);
9 assertThrowsInstanceOf(() => Math.sin(...(x => x)), TypeError);
10 assertThrowsInstanceOf(() => Math.sin(...1), TypeError);
11 assertThrowsInstanceOf(() => Math.sin(...{}), TypeError);
12 var foo = {}
13
14 foo[std_iterator] = 10;
15 assertThrowsInstanceOf(() => Math.sin(...foo), TypeError);
16
17 foo[std_iterator] = function() undefined;
18 assertThrowsInstanceOf(() => Math.sin(...foo), TypeError);
19
20 foo[std_iterator] = function() this;
21 assertThrowsInstanceOf(() => Math.sin(...foo), TypeError);
22
23 foo[std_iterator] = function() this;
24 foo.next = function() { throw 10; };
25 assertThrowsValue(() => Math.sin(...foo), 10);
26
27 assertThrowsInstanceOf(() => Math.sin(.../a/), TypeError);
28 assertThrowsInstanceOf(() => Math.sin(...new Error()), TypeError);

mercurial