Skip to content

Commit

Permalink
Limit depth to 1 when outputting data objects
Browse files Browse the repository at this point in the history
This prevents descending into the global object cache that's accessible
from every data object.
  • Loading branch information
dstillman committed Jan 17, 2017
1 parent 1cf2585 commit 33deefb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chrome/content/zotero/xpcom/utilities.js
Expand Up @@ -1386,6 +1386,11 @@ Zotero.Utilities = {
return '<<Unknown type: ' + type + '>> ' + obj;
}

// Don't descend into global object cache for data objects
if (Zotero.isClient && typeof obj == 'object' && obj instanceof Zotero.DataObject) {
maxLevel = 1;
}

// More complex dump with indentation for objects
if (level === undefined) {
level = 0;
Expand Down

0 comments on commit 33deefb

Please sign in to comment.