1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/basic/bug642164.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,14 @@ 1.4 +function raisesException(exception) { 1.5 + return function (code) { 1.6 + eval(code); 1.7 + }; 1.8 +}; 1.9 +function obj() { 1.10 + var o = { assertEq: true, y: 1 }; 1.11 + Object.defineProperty(o, 'x', { writable: false }); 1.12 + return o; 1.13 +} 1.14 +function in_strict_with(expr) { 1.15 + return "with(obj()) { (function () { 'use strict'; " + expr + " })(); }"; 1.16 +} 1.17 +try { assertEq(raisesException(TypeError)(in_strict_with('x++;')), true); } catch (e) {}