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

dbg.onNewPromise = function (promise) {
  log += 'n';
  dbg.onNewPromise = undefined;
};

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