From 4cb5e7e4d5438f95b1140b9971556c5942fa8213 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 25 Apr 2015 02:07:25 -0400 Subject: [PATCH] Remove check for ES5 generators in Zotero.DB.executeTransaction() This doesn't work properly in some contexts and can break things. There might be a better test, but we probably don't need this anymore. --- chrome/content/zotero/xpcom/db.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js index a6ab81767..9f386e6e6 100644 --- a/chrome/content/zotero/xpcom/db.js +++ b/chrome/content/zotero/xpcom/db.js @@ -89,10 +89,6 @@ Zotero.DBConnection = function(dbName) { this._self = this; this._transactionPromise = null; - - // Get GeneratorFunction, so we can test for an ES6 generator - var g = function* () { yield 1; }; - this._generatorFunction = Object.getPrototypeOf(g).constructor; } ///////////////////////////////////////////////////////////////// @@ -460,20 +456,6 @@ Zotero.DBConnection.prototype.executeTransaction = Zotero.Promise.coroutine(func Zotero.debug("Async DB transaction in progress -- increasing level to " + ++this._asyncTransactionNestingLevel, 5); - try { - // Check for ES5 generators, which don't work properly - if (func.isGenerator() && !(func instanceof this._generatorFunction)) { - Zotero.debug(func); - throw new Error("func must be an ES6 generator"); - } - var result = yield Zotero.Promise.coroutine(func)(); - } - catch (e) { - Zotero.debug("Rolled back nested async DB transaction", 5); - this._asyncTransactionNestingLevel = 0; - throw e; - } - if (options) { if (options.onCommit) { this._callbacks.current.commit.push(options.onCommit);