Index: test/mjsunit/string-index.js |
diff --git a/test/mjsunit/string-index.js b/test/mjsunit/string-index.js |
index 315708ca5fb5e864c7350b3c36a40120de02dad7..eb6ccc688b9109ab1cfb750d10731acab170d163 100644 |
--- a/test/mjsunit/string-index.js |
+++ b/test/mjsunit/string-index.js |
@@ -250,6 +250,18 @@ for (var i = 0; i < 100; ++i) { |
assertEquals(expected, actual); |
} |
+// Test out of range with a heap number case. |
+Math.abs(-343.2); |
+var keys = [0, Math.abs(2)]; |
Yang
2015/03/23 14:23:59
You probably should check that this is not a smi v
mvstanton
2015/03/23 15:54:45
Done. And the Math.floor(x) * 0.5 trick seems to w
|
+var str = 'ab', arr = ['a', undefined]; |
+for (var i = 0; i < 100; ++i) { |
+ var index = Math.floor(i / 50); |
+ var key = keys[index]; |
+ var expected = arr[index]; |
+ var actual = str[key]; |
+ assertEquals(expected, actual); |
+} |
+ |
// Test two byte string. |
var str = '\u0427', arr = ['\u0427']; |
for (var i = 0; i < 50; ++i) { |