From a71f3bbdd877ac9ac99a8ac6748d660976e4ab72 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sat, 21 Jun 2014 12:50:30 -0400 Subject: [PATCH] Fix #504 Determine whether to copy objects by their constructor names, since the prototypes do not necessarily match --- chrome/content/zotero/xpcom/translation/translate_firefox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/translation/translate_firefox.js b/chrome/content/zotero/xpcom/translation/translate_firefox.js index 20a6de8342..1c8f23ff25 100644 --- a/chrome/content/zotero/xpcom/translation/translate_firefox.js +++ b/chrome/content/zotero/xpcom/translation/translate_firefox.js @@ -492,7 +492,7 @@ Zotero.Translate.SandboxManager.prototype = { */ "_copyObject":function(obj, wm) { if(typeof obj !== "object" || obj === null - || (obj.__proto__ !== Object.prototype && obj.__proto__ !== Array.prototype) + || (obj.constructor.name !== "Object" && obj.constructor.name !== "Array") || "__exposedProps__" in obj) { return obj; } @@ -503,7 +503,7 @@ Zotero.Translate.SandboxManager.prototype = { var prop1 = obj[i]; if(typeof prop1 === "object" && prop1 !== null - && (prop1.__proto__ === Object.prototype || prop1.__proto__ === Array.prototype)) { + && (prop1.constructor.name === "Object" || prop1.constructor.name === "Array")) { var prop2 = wm.get(prop1); if(prop2 === undefined) { prop2 = this._copyObject(prop1, wm);