1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/ion/getprop-constant.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,20 @@ 1.4 +// |jit-test| error: TypeError 1.5 + 1.6 +/* GETPROP of a known constant where the lvalue may not be an object. */ 1.7 + 1.8 +function foo(ox) { 1.9 + var x = ox; 1.10 + var n = 0; 1.11 + for (var i = 0; i < 90; i++) { 1.12 + n += x.f.g; 1.13 + if (i >= 80) 1.14 + x = undefined; 1.15 + } 1.16 + print(n); 1.17 +} 1.18 +var n = 1; 1.19 +function f() {} 1.20 +function g() {} 1.21 +g.g = 1; 1.22 +f.prototype = {f:g}; 1.23 +foo(new f());