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

Unified Diff: test/mjsunit/string-charat.js

Issue 2577001: Fix double to integer conversions in runtime string indexing. (Closed)
Patch Set: Created 10 years, 7 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
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/string-charat.js
diff --git a/test/mjsunit/string-charat.js b/test/mjsunit/string-charat.js
index 99afb75c1e62f2b044cb149e616e8123a34e140d..5ce4e89473b52ae3826943c0515e9119e2694cc0 100644
--- a/test/mjsunit/string-charat.js
+++ b/test/mjsunit/string-charat.js
@@ -48,6 +48,7 @@ function basicTest(s, len) {
assertEquals("", s().charAt(-1/0));
assertEquals("t", s().charAt(0));
assertEquals("t", s().charAt(-0.0));
+ assertEquals("t", s().charAt(-0.1));
assertEquals("t", s().charAt(0.4));
assertEquals("e", s().charAt(slowIndex1));
assertEquals("s", s().charAt(slowIndex2));
@@ -63,6 +64,7 @@ function basicTest(s, len) {
assertEquals(101, s().charCodeAt(true));
assertEquals(116, s().charCodeAt(0));
assertEquals(116, s().charCodeAt(-0.0));
+ assertEquals(116, s().charCodeAt(-0.1));
assertEquals(116, s().charCodeAt(0.4));
assertEquals(101, s().charCodeAt(slowIndex1));
assertEquals(115, s().charCodeAt(slowIndex2));
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698