mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 16:04:36 +02:00
Test that "infinity" is not recognized as numeric
This commit is contained in:
parent
c572588ea9
commit
c58ac691eb
@ -20,6 +20,7 @@ assertEquals(-1, %ToNumber("-1"));
|
|||||||
assertEquals(123, %ToNumber("123"));
|
assertEquals(123, %ToNumber("123"));
|
||||||
assertEquals(NaN, %ToNumber("random text"));
|
assertEquals(NaN, %ToNumber("random text"));
|
||||||
assertEquals(NaN, %ToNumber("INFINITY"));
|
assertEquals(NaN, %ToNumber("INFINITY"));
|
||||||
|
assertEquals(NaN, %ToNumber("infinity"));
|
||||||
|
|
||||||
assertThrows(function() { %ToNumber(Symbol.toPrimitive) }, TypeError);
|
assertThrows(function() { %ToNumber(Symbol.toPrimitive) }, TypeError);
|
||||||
|
|
||||||
|
@ -25,3 +25,4 @@ assert.sameValue(
|
|||||||
|
|
||||||
assert.sameValue(Number("abc"), NaN, 'Number("abc") returns NaN');
|
assert.sameValue(Number("abc"), NaN, 'Number("abc") returns NaN');
|
||||||
assert.sameValue(Number("INFINITY"), NaN, 'Number("INFINITY") returns NaN');
|
assert.sameValue(Number("INFINITY"), NaN, 'Number("INFINITY") returns NaN');
|
||||||
|
assert.sameValue(Number("infinity"), NaN, 'Number("infinity") returns NaN');
|
||||||
|
@ -26,3 +26,8 @@ if (isNaN(+"x") !== true) {
|
|||||||
if (isNaN(+"INFINITY") !== true) {
|
if (isNaN(+"INFINITY") !== true) {
|
||||||
throw new Test262Error('#4: +"INFINITY" === Not-a-Number. Actual: ' + (+"INFINITY"));
|
throw new Test262Error('#4: +"INFINITY" === Not-a-Number. Actual: ' + (+"INFINITY"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//CHECK#5
|
||||||
|
if (isNaN(+"infinity") !== true) {
|
||||||
|
throw new Test262Error('#5: +"infinity" === Not-a-Number. Actual: ' + (+"infinity"));
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user