Reviewers: caseq,
Description:
Removing a wrong check.
A strings which represents an array index with length 8 and 9 digits do not
pass
this check. However generated hash is valid.
BUG=54111
Please review this at http://codereview.chromium.org/3295017/show
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M src/runtime.cc
M test/mjsunit/str-to-num.js
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 5369)
+++ src/runtime.cc (working copy)
@@ -4861,7 +4861,6 @@
// Update the hash field to speed up sequential convertions.
uint32_t hash = StringHasher::MakeCachedArrayIndex(d, len);
#ifdef DEBUG
- ASSERT((hash & String::kContainsCachedArrayIndexMask) == 0);
subject->Hash(); // Force hash calculation.
ASSERT_EQ(static_cast<int>(subject->hash_field()),
static_cast<int>(hash));
Index: test/mjsunit/str-to-num.js
===================================================================
--- test/mjsunit/str-to-num.js (revision 5369)
+++ test/mjsunit/str-to-num.js (working copy)
@@ -203,3 +203,7 @@
assertTrue(isNaN(toNumber("1e")), "1e");
assertTrue(isNaN(toNumber("1e ")), "1e_");
assertTrue(isNaN(toNumber("1" + repeat('0', 1000) + 'junk')), "1e1000
junk");
+
+for (var i = 1; i < 12; i++) {
+ assertEquals(toNumber('1' + repeat('0', i)), Math.pow(10.0, i));
+}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev