Debian Codegraph @

js/src/tests/test262/built-ins/Promise/race/S25.4.4.3_A2.2_T1.js

raw
1 // |reftest| async
2 // Copyright 2014 Cubane Canada, Inc. All rights reserved.
3 // See LICENSE for details.
4
5 /*---
6 info: Promise.race rejects on non-iterable argument
7 es6id: S25.4.4.3_A2.2_T1
8 author: Sam Mikes
9 description: Promise.race rejects if argument is not object or is non-iterable
10 flags: [async]
11 ---*/
12
13 var nonIterable = 3;
14
15 Promise.race(nonIterable).then(function() {
16 throw new Test262Error('Promise unexpectedly fulfilled: Promise.race(nonIterable) should throw TypeError');
17 }, function(err) {
18 assert(!!(err instanceof TypeError), 'The value of !!(err instanceof TypeError) is expected to be true');
19 }).then($DONE, $DONE);