Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1167)

Unified Diff: test/mjsunit/parse-int-float.js

Issue 1529004: StringToInt rewritten. This version doesn't allocate memory for long decimals... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/parse-int-float.js
===================================================================
--- test/mjsunit/parse-int-float.js (revision 4332)
+++ test/mjsunit/parse-int-float.js (working copy)
@@ -42,7 +42,10 @@
assertEquals(0x12, parseInt('0x12', 16));
assertEquals(0x12, parseInt('0x12', 16.1));
assertEquals(0x12, parseInt('0x12', NaN));
-
+assertTrue(isNaN(parseInt('0x ')));
+assertTrue(isNaN(parseInt('0x')));
+assertTrue(isNaN(parseInt('0x ', 16)));
+assertTrue(isNaN(parseInt('0x', 16)));
assertEquals(12, parseInt('12aaa'));
assertEquals(0.1, parseFloat('0.1'));
@@ -51,7 +54,21 @@
assertEquals(0, parseFloat('0x12'));
assertEquals(77, parseFloat('077'));
+assertEquals(Infinity, parseInt('1000000000000000000000000000000000000000000000'
+ + '000000000000000000000000000000000000000000000000000000000000000000000000'
+ + '000000000000000000000000000000000000000000000000000000000000000000000000'
+ + '000000000000000000000000000000000000000000000000000000000000000000000000'
+ + '000000000000000000000000000000000000000000000000000000000000000000000000'
+ + '0000000000000'));
+assertEquals(Infinity, parseInt('0x10000000000000000000000000000000000000000000'
+ + '000000000000000000000000000000000000000000000000000000000000000000000000'
+ + '000000000000000000000000000000000000000000000000000000000000000000000000'
+ + '000000000000000000000000000000000000000000000000000000000000000000000000'
+ + '000000000000000000000000000000000000000000000000000000000000000000000000'
+ + '0000000000000'));
+
+
var i;
var y = 10;
« src/conversions.cc ('K') | « src/runtime.cc ('k') | test/mjsunit/str-to-num.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698