From 580cc32f6fd4d5d54e16de534fff4f1392ff7c7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Tue, 7 Mar 2017 12:34:52 +0200 Subject: [PATCH] Remove Promise.prototype.finally calls from translate.js not in ES6 We could monkey-patch a finally function in connectors as described in this gist https://gist.github.com/jish/e9bcd75e391a2b21206b , but it appears to silence propogation of unhandled rejections and it could later come back to bite us in the butt. Native and proper support for finally is, however, planned in ES7. --- chrome/content/zotero/xpcom/translation/translate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 3bae3e7007..132878102b 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1542,7 +1542,7 @@ Zotero.Translate.Base.prototype = { this._waitingForSave = true; this._saveItems(this.saveQueue) .catch(e => this._runHandler("error", e)) - .finally(() => this.saveQueue = []); + .then(() => this.saveQueue = []); return; } this._debug("Translation successful");