Reviewers: Jakob, Lasse Reichstein,
Message:
Fixing a valid issue. Though I have concerns that this patch might "break
the
Internet", mainly because ES5.1 is not downward compatible. Any thoughts?
Description:
Fixing issue 1645, removing detection of octal numbers through 0-prefix.
BUG=v8:1645
Please review this at http://codereview.chromium.org/7792031/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/conversions-inl.h
M test/mjsunit/parse-int-float.js
Index: src/conversions-inl.h
diff --git a/src/conversions-inl.h b/src/conversions-inl.h
index
b828638568aa8e687773c52f51472ac20b7f56e5..539dc5aafceb721e800d3e78ef302890857b74b0
100644
--- a/src/conversions-inl.h
+++ b/src/conversions-inl.h
@@ -267,7 +267,7 @@ static double InternalStringToInt(UnicodeCache*
unicode_cache,
++current;
if (current == end) return JunkStringValue();
} else {
- radix = 8;
+ radix = 10;
leading_zero = true;
}
} else {
Index: test/mjsunit/parse-int-float.js
diff --git a/test/mjsunit/parse-int-float.js
b/test/mjsunit/parse-int-float.js
index
a4f09df9b4a24d6ff7ffdc30316183760fa7bde8..a66ddc3a33f68fd3518292157d64269e46fa6b1d
100644
--- a/test/mjsunit/parse-int-float.js
+++ b/test/mjsunit/parse-int-float.js
@@ -29,10 +29,10 @@ assertEquals(0, parseInt('0'));
assertEquals(0, parseInt(' 0'));
assertEquals(0, parseInt(' 0 '));
-assertEquals(63, parseInt('077'));
-assertEquals(63, parseInt(' 077'));
-assertEquals(63, parseInt(' 077 '));
-assertEquals(-63, parseInt(' -077'));
+assertEquals(77, parseInt('077'));
+assertEquals(77, parseInt(' 077'));
+assertEquals(77, parseInt(' 077 '));
+assertEquals(-77, parseInt(' -077'));
assertEquals(3, parseInt('11', 2));
assertEquals(4, parseInt('11', 3));
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev