Ben Murdoch | 61f157c | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 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 s = [,0.1]; | ||||
8 | |||||
9 | function foo(a, b) { | ||||
10 | var x = s[a]; | ||||
11 | s[1] = 0.1; | ||||
12 | return x + b; | ||||
13 | } | ||||
14 | |||||
15 | assertEquals(2.1, foo(1, 2)); | ||||
16 | assertEquals(2.1, foo(1, 2)); | ||||
17 | %OptimizeFunctionOnNextCall(foo); | ||||
18 | assertEquals("undefined2", foo(0, "2")); |