new-7.js (512B)
1 // Reduced from v8-raytrace. 2 3 var Class = { 4 create : function() { 5 return function() { 6 this.initialize.apply(this, arguments); 7 } 8 } 9 } 10 11 var Bar = Class.create(); 12 Bar.prototype = { 13 // Compiled third. 14 initialize : function() { } 15 } 16 17 var Foo = Class.create(); 18 Foo.prototype = { 19 // Compiled second. Crashes when setting "bar". Uses LCallConstructor. 20 initialize : function() { 21 this.bar = new Bar(); 22 } 23 } 24 25 // Compiled first. 26 function f() { 27 for (var i = 0; i < 100; i++) { 28 var foo = new Foo(); 29 } 30 } 31 32 f();