Skip to content

Commit

Permalink
Remove Promise.prototype.finally calls from translate.js not in ES6
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
adomasven committed Mar 7, 2017
1 parent e9fd7f2 commit 580cc32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chrome/content/zotero/xpcom/translation/translate.js
Expand Up @@ -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");
Expand Down

0 comments on commit 580cc32

Please sign in to comment.