From 6c6a775be2529506f157ca4eb1993f35c22a2a9a Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 20 Nov 2016 01:54:09 -0500 Subject: [PATCH] Fix migration tests in Fx45 `arguments` wasn't iterable until 46 --- test/tests/zoteroTest.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/test/tests/zoteroTest.js b/test/tests/zoteroTest.js index a3c9b61d6..c38b9fcdc 100644 --- a/test/tests/zoteroTest.js +++ b/test/tests/zoteroTest.js @@ -145,7 +145,14 @@ describe("Zotero Core Functions", function () { return Zotero.Promise.reject(new Error("Error")); } else { - return origFunc(...arguments); + let args; + if (Zotero.platformMajorVersion < 46) { + args = Array.from(arguments); + } + else { + args = arguments; + } + return origFunc(...args); } }); let stub4 = sinon.stub(Zotero.File, "reveal").returns(Zotero.Promise.resolve()); @@ -293,7 +300,14 @@ describe("Zotero Core Functions", function () { return Zotero.Promise.reject(new Error("Error")); } else { - return origFunc(...arguments); + let args; + if (Zotero.platformMajorVersion < 46) { + args = Array.from(arguments); + } + else { + args = arguments; + } + return origFunc(...args); } });