www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 6bed648eb2fb95baddb0275efb5688360d2c419a
parent e8ac371042d7d392f5a5995c03213aa1ff5808c2
Author: Simon Kornblith <simon@simonster.com>
Date:   Mon,  2 Jul 2012 00:11:35 -0400

Dump stack on translation failure in newer versions of Firefox, where it appears to have ceased to be enumerable

Diffstat:
Mchrome/content/zotero/xpcom/translation/translate.js | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js @@ -1406,7 +1406,6 @@ Zotero.Translate.Base.prototype = { Zotero.debug(string, level); } }, - /** * Generates a string from an exception * @param {String|Exception} error @@ -1416,13 +1415,17 @@ Zotero.Translate.Base.prototype = { if(typeof(error) == "string") { errorString = "\nthrown exception => "+error; } else { + var haveStack = false; for(var i in error) { if(typeof(error[i]) != "object") { + if(i === "stack") haveStack = true; errorString += "\n"+i+' => '+error[i]; } } - if(error) { - errorString += "\nstring => "+error.toString(); + errorString += "\nstring => "+error.toString(); + if(!haveStack && error.stack) { + // In case the stack is not enumerable + errorString += "\nstack => "+error.stack.toString(); } }