Zotero.safeDebug() -- for displaying objects without worrying about recursion or errors

This commit is contained in:
Dan Stillman 2006-11-26 23:55:12 +00:00
parent f545e6a884
commit edccbe4ad8

View File

@ -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){