summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-onPromiseSettled-04.js
blob: 6a5297223aed0bd92cf9a57d2ab73c4afd67f003 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// An onPromiseSettled handler can disable itself.
var g = newGlobal({newCompartment: true});
var dbg = new Debugger(g);
var log;

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

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