blob: 44186f868ff9099699880726b8f5fa309fc11e39 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// |jit-test| error:Unhandled rejection
load(libdir + "asserts.js");
// Calling settlePromiseNow on already-resolved promise should throw, and
// unhandled rejection tracking should work.
assertThrowsInstanceOf(() => {
var promise = new Promise(resolve => {
resolve(10);
});
settlePromiseNow(promise);
}, Error);
assertThrowsInstanceOf(() => {
var promise = new Promise((_, reject) => {
reject(10);
});
settlePromiseNow(promise);
}, Error);
assertThrowsInstanceOf(() => {
var promise = new Promise(() => {
throw 10;
});
settlePromiseNow(promise);
}, Error);
|