Skip to content

Commit 3c9f04d

Browse files
committed
Bug 1817347 - Prevent jorendb from spewing out enormous strings r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D170146
1 parent 512a9a2 commit 3c9f04d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/examples/jorendb.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ function dvToString(v) {
6262
if (typeof(v) === 'object' && v !== null) {
6363
return `[object ${v.class}]`;
6464
}
65-
return uneval(v);
65+
const s = uneval(v);
66+
if (s.length > 400) {
67+
return s.substr(0, 400) + "...<" + (s.length - 400) + " more bytes>...";
68+
}
69+
return s;
6670
}
6771

6872
function summaryObject(dv) {

0 commit comments

Comments
 (0)