summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-onNewPromise-02.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/debug/Debugger-onNewPromise-02.js')
-rw-r--r--js/src/jit-test/tests/debug/Debugger-onNewPromise-02.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Debugger-onNewPromise-02.js b/js/src/jit-test/tests/debug/Debugger-onNewPromise-02.js
new file mode 100644
index 0000000000..61cb8f03ef
--- /dev/null
+++ b/js/src/jit-test/tests/debug/Debugger-onNewPromise-02.js
@@ -0,0 +1,24 @@
+// onNewPromise handlers fire, until they are removed.
+
+var g = newGlobal({newCompartment: true});
+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, '');