diff --git a/implementation-contributed/v8/mjsunit/harmony/to-number.js b/implementation-contributed/v8/mjsunit/harmony/to-number.js index c5a06cf4ffe..e145782d4b9 100644 --- a/implementation-contributed/v8/mjsunit/harmony/to-number.js +++ b/implementation-contributed/v8/mjsunit/harmony/to-number.js @@ -20,6 +20,7 @@ assertEquals(-1, %ToNumber("-1")); assertEquals(123, %ToNumber("123")); assertEquals(NaN, %ToNumber("random text")); assertEquals(NaN, %ToNumber("INFINITY")); +assertEquals(NaN, %ToNumber("infinity")); assertThrows(function() { %ToNumber(Symbol.toPrimitive) }, TypeError); diff --git a/test/built-ins/Number/S15.7.1.1_A1.js b/test/built-ins/Number/S15.7.1.1_A1.js index ebecc20106c..adf4f19515e 100644 --- a/test/built-ins/Number/S15.7.1.1_A1.js +++ b/test/built-ins/Number/S15.7.1.1_A1.js @@ -25,3 +25,4 @@ assert.sameValue( 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'); diff --git a/test/language/expressions/unary-plus/S11.4.6_A3_T3.js b/test/language/expressions/unary-plus/S11.4.6_A3_T3.js index cb6c4546156..9a3a2f6b49f 100644 --- a/test/language/expressions/unary-plus/S11.4.6_A3_T3.js +++ b/test/language/expressions/unary-plus/S11.4.6_A3_T3.js @@ -26,3 +26,8 @@ if (isNaN(+"x") !== true) { if (isNaN(+"INFINITY") !== true) { 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")); +}