1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/ion/bug825705.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,23 @@ 1.4 +// Test 1: When constructing x, we shouldn't take the prototype for this. 1.5 +// it will crash if that happens 1.6 +evalcx("\ 1.7 + var x = newGlobal().Object;\ 1.8 + function f() { return new x; }\ 1.9 + f();\ 1.10 + f();\ 1.11 +", newGlobal()); 1.12 + 1.13 +// Test 2: Don't take the prototype of proxy's to create |this|, 1.14 +// as this will throw... Not expected behaviour. 1.15 +var O = new Proxy(function() {}, { 1.16 + get: function() { 1.17 + throw "get trap"; 1.18 + } 1.19 +}); 1.20 + 1.21 +function f() { 1.22 + new O(); 1.23 +} 1.24 + 1.25 +f(); 1.26 +f();