Debian Codegraph @

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

raw
1 // Copyright 2014 Cubane Canada, Inc. All rights reserved.
2 // See LICENSE for details.
3
4 /*---
5 info: |
6 Promise.race must throw TypeError per
7 CreatePromiseCapabilityRecord step 8 when
8 promiseCapabliity.[[Resolve]] is not callable
9 es6id: S25.4.4.3_A3.1_T2
10 author: Sam Mikes
11 description: Promise.race throws TypeError, even on empty array, when 'this' does not conform to Promise constructor
12 ---*/
13
14 function BadPromiseConstructor(f) {
15 f(undefined, undefined);
16 }
17
18 assert.throws(TypeError, function() {
19 Promise.race.call(BadPromiseConstructor, []);
20 });