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 3 // found in the LICENSE file. 4 // 5 // Flags: --allow-natives-syntax 6 7 Array.prototype[0] = 'a'; 8 delete Array.prototype[0]; 9 10 function foo(a, i) { 11 return a[i]; 12 } 13 14 var a = new Array(100000); 15 a[3] = 'x'; 16 17 foo(a, 3); 18 foo(a, 3); 19 foo(a, 3); 20 %OptimizeFunctionOnNextCall(foo); 21 foo(a, 3); 22 Array.prototype[0] = 'a'; 23 var z = foo(a, 0); 24 assertEquals('a', z); 25