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 7Array.prototype[0] = 'a'; 8delete Array.prototype[0]; 9 10function foo(a, i) { 11 return a[i]; 12} 13 14var a = new Array(100000); 15a[3] = 'x'; 16 17foo(a, 3); 18foo(a, 3); 19foo(a, 3); 20%OptimizeFunctionOnNextCall(foo); 21foo(a, 3); 22Array.prototype[0] = 'a'; 23var z = foo(a, 0); 24assertEquals('a', z); 25