inline-arguments-escaped-slice-1.js (876B)
1 // |jit-test| --fast-warmup 2 3 function foo(args) { 4 with ({}) {} 5 return args.length; 6 } 7 8 function inner() { 9 return arguments; 10 } 11 12 function outer0() { 13 trialInline(); 14 var args = Array.prototype.slice.call(inner()); 15 return foo(args); 16 } 17 18 function outer1() { 19 trialInline(); 20 var args = Array.prototype.slice.call(inner(1)); 21 return foo(args); 22 } 23 24 function outer2() { 25 trialInline(); 26 var args = Array.prototype.slice.call(inner(1, 2)); 27 return foo(args); 28 } 29 30 function outer3() { 31 trialInline(); 32 var args = Array.prototype.slice.call(inner(1, 2, 3)); 33 return foo(args); 34 } 35 36 function outer4() { 37 trialInline(); 38 var args = Array.prototype.slice.call(inner(1, 2, 3, 4)); 39 return foo(args); 40 } 41 42 with ({}) {} 43 44 for (var i = 0; i < 50; i++) { 45 assertEq(outer0(), 0); 46 assertEq(outer1(), 1); 47 assertEq(outer2(), 2); 48 assertEq(outer3(), 3); 49 assertEq(outer4(), 4); 50 }