summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-onPromiseSettled-02.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/debug/Debugger-onPromiseSettled-02.js')
-rw-r--r--js/src/jit-test/tests/debug/Debugger-onPromiseSettled-02.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Debugger-onPromiseSettled-02.js b/js/src/jit-test/tests/debug/Debugger-onPromiseSettled-02.js
new file mode 100644
index 000000000..febca8f78
--- /dev/null
+++ b/js/src/jit-test/tests/debug/Debugger-onPromiseSettled-02.js
@@ -0,0 +1,26 @@
+// onPromiseSettled handlers fire, until they are removed.
+if (!('Promise' in this))
+ quit(0);
+
+var g = newGlobal();
+var dbg = new Debugger(g);
+var log;
+
+log = '';
+g.settlePromiseNow(new g.Promise(function (){}));
+assertEq(log, '');
+
+dbg.onPromiseSettled = function (promise) {
+ log += 's';
+ assertEq(promise.seen, undefined);
+ promise.seen = true;
+};
+
+log = '';
+g.settlePromiseNow(new g.Promise(function (){}));
+assertEq(log, 's');
+
+log = '';
+dbg.onPromiseSettled = undefined;
+g.settlePromiseNow(new g.Promise(function (){}));
+assertEq(log, '');