summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-onNewPromise-04.js
blob: 410a0add9d5c2cb40b59fc2a00a3d7ae6711f338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// An onNewPromise handler can disable itself.
if (!('Promise' in this))
    quit(0);

var g = newGlobal();
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');