From aa321f34957ebf5bcaba81b6425d5745e85814b1 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 24 May 2017 00:59:45 -0400 Subject: [PATCH] Add example async/await to test Babel transform --- chrome/content/zotero/xpcom/itemTreeView.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index f361dc7d1a..d30e37b4c5 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -70,7 +70,7 @@ Zotero.ItemTreeView.prototype.collapseAll = false; /** * Called by the tree itself */ -Zotero.ItemTreeView.prototype.setTree = Zotero.Promise.coroutine(function* (treebox) { +Zotero.ItemTreeView.prototype.setTree = async function (treebox) { try { Zotero.debug("Setting tree for " + this.collectionTreeRow.id + " items view " + this.id); var start = Date.now(); @@ -115,7 +115,7 @@ Zotero.ItemTreeView.prototype.setTree = Zotero.Promise.coroutine(function* (tree return; } - yield this.refresh(true); + await this.refresh(true); if (!this._treebox.treeBody) { return; } @@ -280,14 +280,14 @@ Zotero.ItemTreeView.prototype.setTree = Zotero.Promise.coroutine(function* (tree if (this.collectionTreeRow && this.collectionTreeRow.itemToSelect) { var item = this.collectionTreeRow.itemToSelect; - yield this.selectItem(item['id'], item['expand']); + await this.selectItem(item['id'], item['expand']); this.collectionTreeRow.itemToSelect = null; } Zotero.debug("Set tree for items view " + this.id + " in " + (Date.now() - start) + " ms"); this._initialized = true; - yield this.runListeners('load'); + await this.runListeners('load'); } catch (e) { Zotero.debug(e, 1); @@ -297,7 +297,7 @@ Zotero.ItemTreeView.prototype.setTree = Zotero.Promise.coroutine(function* (tree } throw e; } -}); +} Zotero.ItemTreeView.prototype.setSortColumn = function() {