www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 4cb5e7e4d5438f95b1140b9971556c5942fa8213
parent f78b18c692a05e98ecede0d76cce2f9ae4867767
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sat, 25 Apr 2015 02:07:25 -0400

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.

Diffstat:
Mchrome/content/zotero/xpcom/db.js | 18------------------
1 file changed, 0 insertions(+), 18 deletions(-)

diff --git 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);