bug1368626.js (485B)
1 var sandbox = evalcx("lazy"); 2 3 // Ensure we can't change the "lazy" property of the sandbox to an accessor, 4 // because that'd allow to execute arbitrary side-effects when calling the 5 // resolve hook of the sandbox. 6 var err; 7 try { 8 Object.defineProperty(sandbox, "lazy", { 9 get() { 10 Object.defineProperty(sandbox, "foo", { value: 0 }); 11 } 12 }); 13 } catch (e) { 14 err = e; 15 } 16 assertEq(err instanceof TypeError, true); 17 18 // Don't assert here. 19 sandbox.foo = 1;