summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-onPromiseSettled-02.js
blob: b78cbccf112e62529935e08044a404e8c2ab456d (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
// onPromiseSettled handlers fire, until they are removed.

var g = newGlobal({newCompartment: true});
var dbg = new Debugger(g);
var log;

log = '';
g.settlePromiseNow(new g.Promise(function (){}));
assertEq(log, '');

dbg.onPromiseSettled = function (promise) {
  log += 's';
  assertEq(promise.seen, undefined);
  promise.seen = true;
};

log = '';
g.settlePromiseNow(new g.Promise(function (){}));
assertEq(log, 's');

log = '';
dbg.onPromiseSettled = undefined;
g.settlePromiseNow(new g.Promise(function (){}));
assertEq(log, '');