Skip to content

Commit

Permalink
Bug 1817347 - Prevent jorendb from spewing out enormous strings r=jonco
Browse files Browse the repository at this point in the history
  • Loading branch information
hotsphink committed Mar 23, 2023
1 parent 512a9a2 commit 3c9f04d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/examples/jorendb.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ function dvToString(v) {
if (typeof(v) === 'object' && v !== null) {
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) {
Expand Down

0 comments on commit 3c9f04d

Please sign in to comment.