Commit a70344c6 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[test] Reduce max depthness of nested objects in JSON-stringify.js test.

Modification of InstanceType enum caused JsonStringifier::Serialize_() function
to consume more stack space (because of a switch statement) in non-optimized
debug build which now causes stack overflow on certain depth of nested objects.
The modification affects neither optimized debug nor release builds.

Change-Id: Ia2925d9abbd1c32c5a4694e14c49b2d0bd119419
Reviewed-on: https://chromium-review.googlesource.com/789074
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49657}
parent 4cb6ef83
......@@ -475,7 +475,7 @@ function createTests() {
});
result.push(function (jsonObject){
var deepObject = {};
for (var i = 0; i < 1024; i++)
for (var i = 0; i < 1000; i++)
deepObject = {next:deepObject};
return jsonObject.stringify(deepObject);
});
......@@ -488,7 +488,7 @@ function createTests() {
result.push(function (jsonObject){
var depth = 0;
function toDeepVirtualJSONObject() {
if (++depth >= 1024)
if (++depth >= 1000)
return {};
var r = {};
r.toJSON = toDeepVirtualJSONObject;
......
......@@ -499,7 +499,7 @@ function (jsonObject){
PASS tests[i](nativeJSON) is tests[i](JSON)
function (jsonObject){
var deepObject = {};
for (var i = 0; i < 1024; i++)
for (var i = 0; i < 1000; i++)
deepObject = {next:deepObject};
return jsonObject.stringify(deepObject);
}
......@@ -514,7 +514,7 @@ PASS tests[i](nativeJSON) is tests[i](JSON)
function (jsonObject){
var depth = 0;
function toDeepVirtualJSONObject() {
if (++depth >= 1024)
if (++depth >= 1000)
return {};
var r = {};
r.toJSON = toDeepVirtualJSONObject;
......
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