OLD | NEW |
(Empty) | |
| 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 function test(f) { |
| 8 assertTrue(f(0)); |
| 9 assertTrue(f(Number.MIN_VALUE)); |
| 10 assertTrue(f(Number.MAX_VALUE)); |
| 11 assertTrue(f(Number.MIN_SAFE_INTEGER)); |
| 12 assertTrue(f(Number.MIN_SAFE_INTEGER - 13)); |
| 13 assertTrue(f(Number.MAX_SAFE_INTEGER)); |
| 14 assertTrue(f(Number.MAX_SAFE_INTEGER + 23)); |
| 15 assertFalse(f(Number.NaN)); |
| 16 assertFalse(f(Number.POSITIVE_INFINITY)); |
| 17 assertFalse(f(Number.NEGATIVE_INFINITY)); |
| 18 assertFalse(f(1 / 0)); |
| 19 assertFalse(f(-1 / 0)); |
| 20 } |
| 21 |
| 22 function f(x) { |
| 23 return Number.isFinite(+x); |
| 24 } |
| 25 |
| 26 test(f); |
| 27 test(f); |
| 28 %OptimizeFunctionOnNextCall(f); |
| 29 test(f); |
OLD | NEW |