Index: test/mjsunit/es6/string-repeat.js |
diff --git a/test/mjsunit/es6/string-repeat.js b/test/mjsunit/es6/string-repeat.js |
index 15caea14f3d788fac865dffc6cda4b42540d94a4..d61aec066c8dbd93acc79c5751629db4f0611726 100644 |
--- a/test/mjsunit/es6/string-repeat.js |
+++ b/test/mjsunit/es6/string-repeat.js |
@@ -65,6 +65,12 @@ assertThrows('"a".repeat(Number.POSITIVE_INFINITY)', RangeError); |
assertThrows('"a".repeat(Math.pow(2, 30))', RangeError); |
assertThrows('"a".repeat(Math.pow(2, 40))', RangeError); |
+// Handling empty strings |
+assertThrows('"".repeat(-1)', RangeError); |
+assertThrows('"".repeat(Number.POSITIVE_INFINITY)', RangeError); |
+assertEquals("", "".repeat(Math.pow(2, 30))); |
+assertEquals("", "".repeat(Math.pow(2, 40))); |
+ |
var myobj = { |
toString: function() { |
return "abc"; |