Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Promise/race/S25.4.4.3_A2.2_T2.js

raw
1 // Copyright 2014 Cubane Canada, Inc. All rights reserved.
2 // See LICENSE for details.
3
4 /*---
5 info: Promise.race rejects on non-iterable argument
6 es6id: S25.4.4.3_A2.2_T2
7 author: Sam Mikes
8 description: Promise.race rejects if argument is not object or is non-iterable
9 flags: [async]
10 ---*/
11
12 Promise.race(new Error("abrupt")).then(function() {
13 $ERROR('Promise unexpectedly resolved: Promise.race(abruptCompletion) should throw TypeError');
14 }, function(err) {
15 if (!(err instanceof TypeError)) {
16 $ERROR('Expected TypeError, got ' + err);
17 }
18 }).then($DONE, $DONE);