| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Flags: --harmony-object-observe |
| 5 // Flags: --allow-natives-syntax | 6 // Flags: --allow-natives-syntax |
| 6 | 7 |
| 7 var v = 0; | 8 var v = 0; |
| 8 | 9 |
| 9 function push_wrapper(array, value) { | 10 function push_wrapper(array, value) { |
| 10 array.push(value); | 11 array.push(value); |
| 11 } | 12 } |
| 12 function pop_wrapper(array) { | 13 function pop_wrapper(array) { |
| 13 return array.pop(); | 14 return array.pop(); |
| 14 } | 15 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 assertEquals(6, v); | 51 assertEquals(6, v); |
| 51 %OptimizeFunctionOnNextCall(pop_wrapper); | 52 %OptimizeFunctionOnNextCall(pop_wrapper); |
| 52 pop_wrapper(array); | 53 pop_wrapper(array); |
| 53 %RunMicrotasks(); | 54 %RunMicrotasks(); |
| 54 assertEquals(1, array.length); | 55 assertEquals(1, array.length); |
| 55 assertEquals(7, v); | 56 assertEquals(7, v); |
| 56 pop_wrapper(array); | 57 pop_wrapper(array); |
| 57 %RunMicrotasks(); | 58 %RunMicrotasks(); |
| 58 assertEquals(0, array.length); | 59 assertEquals(0, array.length); |
| 59 assertEquals(8, v); | 60 assertEquals(8, v); |
| OLD | NEW |