summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/bug1820602.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/ion/bug1820602.js')
-rw-r--r--js/src/jit-test/tests/ion/bug1820602.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ion/bug1820602.js b/js/src/jit-test/tests/ion/bug1820602.js
new file mode 100644
index 0000000000..24fc0fb7ab
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug1820602.js
@@ -0,0 +1,23 @@
+let domObject = new FakeDOMObject();
+
+let {object, transplant} = transplantableObject({object: domObject});
+assertEq(object, domObject);
+
+let global1 = newGlobal({newCompartment: true});
+let global2 = newGlobal({newCompartment: true});
+
+transplant(global1);
+transplant(global2);
+transplant(global1);
+
+assertEq(object, domObject);
+
+global1.domObj = domObject;
+
+global1.evaluate("(" + function f() {
+ var domObjNormal = new FakeDOMObject();
+ for (var i = 0; i < 5000; i++) {
+ var obj = i < 1500 ? domObjNormal : domObj;
+ assertEq(obj.doFoo(4, 5), 2);
+ }
+}.toString() + ")()");