Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Promise/all/reject-immed.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 description: Rejecting through immediate invocation of the provided resolving function
5 es6id: 25.4.4.1
6 info: |
7 [...]
8 6. Let promiseCapability be NewPromiseCapability(C).
9 [...]
10 11. Let result be PerformPromiseAll(iteratorRecord, promiseCapability, C).
11 [...]
12
13 25.4.4.1.1 Runtime Semantics: PerformPromiseAll
14 [...]
15 6. Repeat
16 [...]
17 r. Let result be Invoke(nextPromise, "then", resolveElement,
18 promiseCapability.[[Reject]]»).
19
20 25.4.1.3.1 Promise Reject Functions
21 [...]
22 6. Return RejectPromise(promise, reason).
23 flags: [async]
24 ---*/
25
26 var thenable = {
27 then: function(_, reject) {
28 reject();
29 }
30 };
31
32 Promise.all([thenable])
33 .then(function() {
34 $DONE('The promise should not be fulfilled.');
35 }, function(x) {
36 $DONE();
37 });