blob: 903b54ad980042d134428d1c9be329499530cdef [file] [log] [blame]
Ben Murdoch61f157c2016-09-16 13:49:30 +01001// 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
7var s = [,0.1];
8
9function foo(a, b) {
10 var x = s[a];
11 s[1] = 0.1;
12 return x + b;
13}
14
15assertEquals(2.1, foo(1, 2));
16assertEquals(2.1, foo(1, 2));
17%OptimizeFunctionOnNextCall(foo);
18assertEquals("undefined2", foo(0, "2"));