mirror of
https://github.com/zotero/zotero.git
synced 2026-10-08 03:08:19 +00:00
Zotero.safeDebug() -- for displaying objects without worrying about recursion or errors
This commit is contained in:
parent
f545e6a884
commit
edccbe4ad8
1 changed files with 16 additions and 0 deletions
|
|
@ -49,6 +49,7 @@ var Zotero = new function(){
|
|||
this.backupDatabase = backupDatabase;
|
||||
this.debug = debug;
|
||||
this.varDump = varDump;
|
||||
this.safeDebug = safeDebug;
|
||||
this.getString = getString;
|
||||
this.flattenArguments = flattenArguments;
|
||||
this.getAncestorByTagName = getAncestorByTagName;
|
||||
|
|
@ -325,6 +326,21 @@ var Zotero = new function(){
|
|||
}
|
||||
|
||||
|
||||
function safeDebug(obj){
|
||||
for (var i in obj){
|
||||
try {
|
||||
Zotero.debug(i + ': ' + obj[i]);
|
||||
}
|
||||
catch (e){
|
||||
try {
|
||||
Zotero.debug(i + ': ERROR');
|
||||
}
|
||||
catch (e){}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getString(name, params){
|
||||
try {
|
||||
if (params){
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue