Bug 1817347 - Prevent jorendb from spewing out enormous strings r=jonco

Differential Revision: https://phabricator.services.mozilla.com/D170146
This commit is contained in:
Steve Fink 2023-03-23 21:07:06 +00:00
parent 512a9a280e
commit 3c9f04d7fb

View file

@ -62,7 +62,11 @@ function dvToString(v) {
if (typeof(v) === 'object' && v !== null) { if (typeof(v) === 'object' && v !== null) {
return `[object ${v.class}]`; return `[object ${v.class}]`;
} }
return uneval(v); const s = uneval(v);
if (s.length > 400) {
return s.substr(0, 400) + "...<" + (s.length - 400) + " more bytes>...";
}
return s;
} }
function summaryObject(dv) { function summaryObject(dv) {