scalar-replace-array-construct-array-02.js (432B)
1 setJitCompilerOption("inlining.bytecode-max-length", 200); 2 3 class Bar { 4 constructor(x, y) { 5 this.value = x + y; 6 } 7 } 8 9 class Foo extends Bar { 10 constructor(...args) { 11 args[0] = 3; 12 super(...args); 13 } 14 } 15 16 // |Foo| must be small enough to be inlinable. 17 assertEq(isSmallFunction(Foo), true); 18 19 with ({}) {} 20 21 var sum = 0; 22 for (var i = 0; i < 100; i++) { 23 let obj = new Foo(1, 2); 24 sum += obj.value; 25 } 26 assertEq(sum, 500);