summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testWatchRecursion.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-10-27 02:14:16 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-10-27 02:14:16 +0100
commit24027f0df9d23304709a80c22c6bfdbd27a95046 (patch)
treef3bbd19d50d8433df73a2691a22239912169405e /js/src/jit-test/tests/basic/testWatchRecursion.js
parent44a077980abb92dcea9ed374fd9719eaaf2f1458 (diff)
downloadUXP-24027f0df9d23304709a80c22c6bfdbd27a95046.tar
UXP-24027f0df9d23304709a80c22c6bfdbd27a95046.tar.gz
UXP-24027f0df9d23304709a80c22c6bfdbd27a95046.tar.lz
UXP-24027f0df9d23304709a80c22c6bfdbd27a95046.tar.xz
UXP-24027f0df9d23304709a80c22c6bfdbd27a95046.zip
Issue #1257 - Part 3: Remove/update tests.
This removes a ton of tests that are no longer relevant with (un)watch removed (e.g. testing stability/bugs in the watchpoint system itself which has never been the most stable), and updates others that would previously rely on watch/unwatch, so that they don't unexpectedly fail.
Diffstat (limited to 'js/src/jit-test/tests/basic/testWatchRecursion.js')
-rw-r--r--js/src/jit-test/tests/basic/testWatchRecursion.js63
1 files changed, 0 insertions, 63 deletions
diff --git a/js/src/jit-test/tests/basic/testWatchRecursion.js b/js/src/jit-test/tests/basic/testWatchRecursion.js
deleted file mode 100644
index e5d5877df..000000000
--- a/js/src/jit-test/tests/basic/testWatchRecursion.js
+++ /dev/null
@@ -1,63 +0,0 @@
-// Test that the watch handler is not called recursively for the same object
-// and property.
-(function() {
- var obj1 = {}, obj2 = {};
- var handler_entry_count = 0;
- var handler_exit_count = 0;
-
- obj1.watch('x', handler);
- obj1.watch('y', handler);
- obj2.watch('x', handler);
- obj1.x = 1;
- assertEq(handler_entry_count, 3);
- assertEq(handler_exit_count, 3);
-
- function handler(id) {
- handler_entry_count++;
- assertEq(handler_exit_count, 0);
- switch (true) {
- case this === obj1 && id === "x":
- assertEq(handler_entry_count, 1);
- obj2.x = 3;
- assertEq(handler_exit_count, 2);
- break;
- case this === obj2 && id === "x":
- assertEq(handler_entry_count, 2);
- obj1.y = 4;
- assertEq(handler_exit_count, 1);
- break;
- default:
- assertEq(this, obj1);
- assertEq(id, "y");
- assertEq(handler_entry_count, 3);
-
- // We expect no more watch handler invocations
- obj1.x = 5;
- obj1.y = 6;
- obj2.x = 7;
- assertEq(handler_exit_count, 0);
- break;
- }
- ++handler_exit_count;
- assertEq(handler_entry_count, 3);
- }
-})();
-
-
-// Test that run-away recursion in watch handlers is properly handled.
-(function() {
- var obj = {};
- var i = 0;
- try {
- handler();
- throw new Error("Unreachable");
- } catch(e) {
- assertEq(e instanceof InternalError, true);
- }
-
- function handler() {
- var prop = "a" + ++i;
- obj.watch(prop, handler);
- obj[prop] = 2;
- }
-})();