commit 1b6a69f656283b3bedd2c7d423512a5821f5499a
parent 414d55346c0d6bc2bd9561a6b975544b28456f2d
Author: Simon Kornblith <simon@simonster.com>
Date: Wed, 27 Mar 2013 23:06:34 -0700
Merge pull request #284 from aurimasv/itemDone
Don't break when stringifying item fields
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js
@@ -98,8 +98,9 @@ Zotero.Translate.Sandbox = {
delete item[i];
continue;
}
-
- var isObject = typeof val === "object" || typeof val === "xml" || typeof val === "function",
+
+ var type = typeof val;
+ var isObject = type === "object" || type === "xml" || type === "function",
shouldBeObject = allowedObjects.indexOf(i) !== -1;
if(isObject && !shouldBeObject) {
// Convert things that shouldn't be objects to objects
@@ -108,7 +109,7 @@ Zotero.Translate.Sandbox = {
} else if(shouldBeObject && !isObject) {
translate._debug("Translate: WARNING: typeof "+i+" is "+type+"; converting to array");
item[i] = [val];
- } else if(typeof val === "string") {
+ } else if(type === "string") {
// trim strings
item[i] = val.trim();
}