Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Promise/all/ctx-ctor-throws.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: >
6 `Promise.all` invoked on a constructor value that throws an error
7 es6id: 25.4.4.1
8 info: |
9 1. Let C be the this value.
10 [...]
11 6. Let promiseCapability be NewPromiseCapability(C).
12 7. ReturnIfAbrupt(promiseCapability).
13
14 25.4.1.5 NewPromiseCapability
15 [...]
16 6. Let promise be Construct(C, «executor»).
17 7. ReturnIfAbrupt(promise).
18 ---*/
19
20 var CustomPromise = function() {
21 throw new Test262Error();
22 };
23
24 assert.throws(Test262Error, function() {
25 Promise.all.call(CustomPromise);
26 });