1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/baseline/bug848743-1.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,42 @@ 1.4 +function A() {}; 1.5 +A.prototype = []; 1.6 + 1.7 +function B() {}; 1.8 +B.prototype = new A(); 1.9 + 1.10 +function C() {}; 1.11 +C.prototype = new B(); 1.12 + 1.13 +function D() {}; 1.14 +D.prototype = new C(); 1.15 + 1.16 +function E() {}; 1.17 +E.prototype = new D(); 1.18 + 1.19 +function f() { 1.20 + var o = new B(); 1.21 + for (var i=0; i<10; i++) 1.22 + o[i] = i; 1.23 + 1.24 + var expected = '{"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9}'; 1.25 + assertEq(JSON.stringify(o), expected); 1.26 + 1.27 + var o = new A(); 1.28 + for (var i=0; i<10; i++) 1.29 + o[i] = i; 1.30 + 1.31 + assertEq(JSON.stringify(o), expected); 1.32 + 1.33 + var o = new D(); 1.34 + for (var i=0; i<10; i++) 1.35 + o[i] = i; 1.36 + 1.37 + assertEq(JSON.stringify(o), expected); 1.38 + 1.39 + var o = new E(); 1.40 + for (var i=0; i<10; i++) 1.41 + o[i] = i; 1.42 + 1.43 + assertEq(JSON.stringify(o), expected); 1.44 +} 1.45 +f();