OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Flags: --allow-natives-syntax |
| 6 |
| 7 function bar(a) { |
| 8 a.pop(); |
| 9 } |
| 10 function foo(a) { |
| 11 assertEquals(2, a.length); |
| 12 var d; |
| 13 for (d in a) { |
| 14 bar(a); |
| 15 } |
| 16 // If this fails, bar was not called exactly once. |
| 17 assertEquals(1, a.length); |
| 18 } |
| 19 |
| 20 foo([1,2]); |
| 21 foo([2,3]); |
| 22 %OptimizeFunctionOnNextCall(foo); |
| 23 foo([1,2]); |
OLD | NEW |