summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/bug1820602.js
blob: 24fc0fb7ab7aa825a4c920f90d237e7e94d19d03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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() + ")()");