www

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

commit 6a0351c9405354c3722cb4f317653ab3bf07b045
parent 414d55346c0d6bc2bd9561a6b975544b28456f2d
Author: aurimasv <aurimas.dev@gmail.com>
Date:   Thu, 28 Mar 2013 00:55:05 -0500

Don't break when stringifying item fields. Broken by 2f8f18c9571010b5f9d9035f62b590e63ffc1e4f

Diffstat:
Mchrome/content/zotero/xpcom/translation/translate.js | 7++++---
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(); }