From 71c63c6a7455b34cd14662a0dbe4166599b77936 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 21 Feb 2012 22:18:43 -0500 Subject: [PATCH] Attempt to escape wrapper hell by serializing and unserializing the item --- .../content/zotero/tools/testTranslators/translatorTester.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chrome/content/zotero/tools/testTranslators/translatorTester.js b/chrome/content/zotero/tools/testTranslators/translatorTester.js index 49d9913bfb..e84a87d825 100644 --- a/chrome/content/zotero/tools/testTranslators/translatorTester.js +++ b/chrome/content/zotero/tools/testTranslators/translatorTester.js @@ -100,6 +100,11 @@ Zotero_TranslatorTester._sanitizeItem = function(item, forSave) { } } + // try to convert to JSON and back to get rid of undesirable undeletable elements; this may fail + try { + item = JSON.parse(JSON.stringify(item)); + } catch(e) {}; + // remove fields to be ignored for(var j=0, n=Zotero_TranslatorTester_IGNORE_FIELDS.length; j