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
7function f1(a, i) {
8  return a[i] + 0.5;
9}
10var arr = [,0.0,2.5];
11assertEquals(0.5, f1(arr, 1));
12assertEquals(0.5, f1(arr, 1));
13%OptimizeFunctionOnNextCall(f1);
14assertEquals(0.5, f1(arr, 1));
15Array.prototype.unshift(1.5);
16assertEquals(2, f1(arr, 0));
17