commit 936069165bdcfecc955cd4baaef17010d5a17091
parent 7a34d09f58153348bcf205bc748096e8075556d3
Author: Simon Kornblith <simon@simonster.com>
Date: Wed, 20 Jul 2011 21:53:38 +0000
Fix reporting of error line numbers
Diffstat:
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js
@@ -1083,11 +1083,7 @@ Zotero.Translate.Base.prototype = {
} else {
if(error) {
// report error to console
- if(this.translator[0] && this.translator[0].logError) {
- this.translator[0].logError(error.toString(), "exception");
- } else {
- Zotero.logError(error);
- }
+ Zotero.logError(error);
// report error to debug log
this._debug("Translation using "+(this.translator && this.translator[0] && this.translator[0].label ? this.translator[0].label : "no translator")+" failed: \n"+errorString, 2);
@@ -1167,7 +1163,8 @@ Zotero.Translate.Base.prototype = {
try {
this._sandboxManager.eval("var translatorInfo = "+translator.code,
- ["detect"+this._entryFunctionSuffix, "do"+this._entryFunctionSuffix, "exports"]);
+ ["detect"+this._entryFunctionSuffix, "do"+this._entryFunctionSuffix, "exports"],
+ (translator.file ? translator.file.path : translator.label));
} catch(e) {
this.complete(false, "Parse error: "+e.toString());
return;
@@ -1279,6 +1276,7 @@ Zotero.Translate.Base.prototype = {
errorString += "\n"+i+' => '+error[i];
}
}
+ errorString += "\nstring => "+error.toString();
}
errorString += "\nurl => "+this.path
diff --git a/chrome/content/zotero/xpcom/translation/translate_firefox.js b/chrome/content/zotero/xpcom/translation/translate_firefox.js
@@ -128,8 +128,8 @@ Zotero.Translate.SandboxManager.prototype = {
/**
* Evaluates code in the sandbox
*/
- "eval":function(code) {
- Components.utils.evalInSandbox(code, this.sandbox);
+ "eval":function(code, exported, path) {
+ Components.utils.evalInSandbox(code, this.sandbox, "1.8", path, 1);
},
/**