Use toJSON() if available when running Zotero.debug() on objects
This commit is contained in:
parent
b793c0c406
commit
368b057104
1 changed files with 2 additions and 2 deletions
|
@ -1414,8 +1414,8 @@ Zotero.Utilities = {
|
|||
return '' + obj;
|
||||
}
|
||||
}
|
||||
else if (type == 'string') {
|
||||
return JSON.stringify(obj);
|
||||
else if (type == 'string' || typeof obj.toJSON == 'function') {
|
||||
return JSON.stringify(obj, false, ' ');
|
||||
}
|
||||
else if (type == 'function') {
|
||||
var funcStr = ('' + obj).trim();
|
||||
|
|
Loading…
Reference in a new issue