blob: d689da767b2fe0ca911f5425c4002dac1ecab76d (
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
|
// |reftest| skip-if(!xulRuntime.shell) -- needs drainJobQueue
{
let {resolve, promise} = Promise.withResolvers();
let result = undefined;
promise.then((v) => result = v);
resolve(5);
drainJobQueue();
assertEq(result, 5);
}
{
let {reject, promise} = Promise.withResolvers();
let result = undefined;
promise.catch((v) => result = v);
reject("abc");
drainJobQueue();
assertEq(result, "abc");
}
reportCompare(true,true);
|