Index: test/mjsunit/regress/regress-json-stringify-gc.js |
diff --git a/test/mjsunit/regress/regress-json-stringify-gc.js b/test/mjsunit/regress/regress-json-stringify-gc.js |
index c0a71bf4a1e1b2ea85486c0aade362cee62f9fb0..9683c502d524bf30ad6efc11775502fbffebc901 100644 |
--- a/test/mjsunit/regress/regress-json-stringify-gc.js |
+++ b/test/mjsunit/regress/regress-json-stringify-gc.js |
@@ -39,3 +39,13 @@ json1 = JSON.stringify(a); |
json2 = JSON.stringify(a); |
assertTrue(json1 == json2, "GC caused JSON.stringify to fail."); |
+// Check that the slow path of JSON.stringify works correctly wrt GC. |
+for (var i = 0; i < 100000; i++) { |
+ var s = i.toString(); |
+ assertEquals('"' + s + '"', JSON.stringify(s, null, 0)); |
+} |
+ |
+for (var i = 0; i < 100000; i++) { |
+ var s = i.toString() + "\u2603"; |
+ assertEquals('"' + s + '"', JSON.stringify(s, null, 0)); |
+} |