summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-onNewPromise-02.js
blob: 21db892d8f825782fbaebfad8eaa94dd80032e4d (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
26
// onNewPromise handlers fire, until they are removed.
if (!('Promise' in this))
    quit(0);

var g = newGlobal();
var dbg = new Debugger(g);
var log;

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

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

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

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