summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/baseline/bug1368626.js
blob: 637c98efbb17dbd42d9b73520c6822ef26a0c96d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var sandbox = evalcx("lazy");

// Ensure we can't change the "lazy" property of the sandbox to an accessor,
// because that'd allow to execute arbitrary side-effects when calling the
// resolve hook of the sandbox.
var err;
try {
    Object.defineProperty(sandbox, "lazy", {
        get() {
            Object.defineProperty(sandbox, "foo", { value: 0 });
        }
    });
} catch (e) {
    err = e;
}
assertEq(err instanceof TypeError, true);

// Don't assert here.
sandbox.foo = 1;