| 1 |
// Copyright 2009 the Sputnik authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
info: Operator use ToString |
| 6 |
es5id: 15.1.2.3_A1_T5 |
| 7 |
es6id: 18.2.4 |
| 8 |
esid: sec-parsefloat-string |
| 9 |
description: Checking for Number object |
| 10 |
---*/ |
| 11 |
|
| 12 |
//CHECK#1 |
| 13 |
if (parseFloat(new Number(-1.1)) !== parseFloat("-1.1")) { |
| 14 |
$ERROR('#1: parseFloat(new Number(-1.1)) === parseFloat("-1.1"). Actual: ' + (parseFloat(new Number(-1.1)))); |
| 15 |
} |
| 16 |
|
| 17 |
//CHECK#2 |
| 18 |
if (parseFloat(new Number(Infinity)) !== parseFloat("Infinity")) { |
| 19 |
$ERROR('#2: parseFloat(new Number(Infinity)) === parseFloat("Infinity"). Actual: ' + (parseFloat(new Number(Infinity)))); |
| 20 |
} |
| 21 |
|
| 22 |
//CHECK#3 |
| 23 |
if (String(parseFloat(new Number(NaN))) !== "NaN") { |
| 24 |
$ERROR('#3: String(parseFloat(new Number(NaN))) === "NaN". Actual: ' + (String(parseFloat(new Number(NaN))))); |
| 25 |
} |
| 26 |
|
| 27 |
//CHECK#4 |
| 28 |
if (parseFloat(new Number(.01e+2)) !== parseFloat(".01e+2")) { |
| 29 |
$ERROR('#4: parseFloat(new Number(.01e+2)) === parseFloat(".01e+2"). Actual: ' + (parseFloat(new Number(.01e+2)))); |
| 30 |
} |