Commit ecb6126e authored by yangguo@chromium.org's avatar yangguo@chromium.org

Remove check for recursion depth for JSON.stringify.

R=mstarzinger@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/11368119

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12882 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d079e3f9
......@@ -42,19 +42,14 @@ assertThrows(function() { rec(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4) },
RangeError);
var depth1 = 1500;
var depth2 = 10000;
var depth = 10000;
var deepArray = [];
for (var i = 0; i < depth1; i++) deepArray = [deepArray];
JSON.stringify(deepArray);
for (var i = depth1; i < depth2; i++) deepArray = [deepArray];
for (var i = 0; i < depth; i++) deepArray = [deepArray];
assertThrows(function() { JSON.stringify(deepArray); }, RangeError);
var deepObject = {};
for (var i = 0; i < depth1; i++) deepObject = { next: deepObject };
JSON.stringify(deepObject);
for (var i = depth1; i < depth2; i++) deepObject = { next: deepObject };
for (var i = 0; i < depth; i++) deepObject = { next: deepObject };
assertThrows(function() { JSON.stringify(deepObject); }, RangeError);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment