OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 var pop = Array.prototype.pop; |
| 8 |
| 9 function foo(a) { |
| 10 a.length; |
| 11 return pop.call(a); |
| 12 } |
| 13 |
| 14 var a = new Array(4); |
| 15 var o = {} |
| 16 o.__defineGetter__(0, function() { return 1; }); |
| 17 |
| 18 assertEquals(undefined, foo(a)); |
| 19 assertEquals(undefined, foo(a)); |
| 20 %OptimizeFunctionOnNextCall(foo); |
| 21 assertEquals(undefined, foo(a)); |
| 22 Array.prototype.__proto__ = o; |
| 23 assertEquals(1, foo(a)); |
OLD | NEW |