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.js26
1 files changed, 26 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 000000000..21db892d8
--- /dev/null
+++ b/js/src/jit-test/tests/debug/Debugger-onNewPromise-02.js
@@ -0,0 +1,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, '');