Ben Murdoch | 097c5b2 | 2016-05-18 11:27:45 +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 o = {} |
| 8 | var p = {foo: 1.5} |
| 9 | |
| 10 | function g(x) { return x.foo === +x.foo; } |
| 11 | |
| 12 | assertEquals(false, g(o)); |
| 13 | assertEquals(false, g(o)); |
| 14 | %OptimizeFunctionOnNextCall(g); |
| 15 | assertEquals(false, g(o)); // Still fine here. |
| 16 | assertEquals(true, g(p)); |
| 17 | %OptimizeFunctionOnNextCall(g); |
| 18 | assertEquals(false, g(o)); // Confused by type feedback. |