From b58d84fba16db957e5272e0a3e810bc36a1e45ae Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 10 Jul 2017 16:06:04 +0100 Subject: [PATCH] q.Promise -> Promise ``` find src spec -name '*.js' | xargs perl -i -pe 's/q\.Promise/Promise/' ``` --- src/crypto/store/indexeddb-crypto-store-backend.js | 2 +- src/crypto/store/indexeddb-crypto-store.js | 4 ++-- src/store/indexeddb-local-backend.js | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/crypto/store/indexeddb-crypto-store-backend.js b/src/crypto/store/indexeddb-crypto-store-backend.js index e1d4ff1cc..c6738367d 100644 --- a/src/crypto/store/indexeddb-crypto-store-backend.js +++ b/src/crypto/store/indexeddb-crypto-store-backend.js @@ -284,7 +284,7 @@ function createDatabase(db) { } function promiseifyTxn(txn) { - return new q.Promise((resolve, reject) => { + return new Promise((resolve, reject) => { txn.oncomplete = resolve; txn.onerror = reject; }); diff --git a/src/crypto/store/indexeddb-crypto-store.js b/src/crypto/store/indexeddb-crypto-store.js index 79aa3ad7c..c3bde5fcb 100644 --- a/src/crypto/store/indexeddb-crypto-store.js +++ b/src/crypto/store/indexeddb-crypto-store.js @@ -56,7 +56,7 @@ export default class IndexedDBCryptoStore { return this._backendPromise; } - this._backendPromise = new q.Promise((resolve, reject) => { + this._backendPromise = new Promise((resolve, reject) => { if (!this._indexedDB) { reject(new Error('no indexeddb support available')); return; @@ -107,7 +107,7 @@ export default class IndexedDBCryptoStore { * @returns {Promise} resolves when the store has been cleared. */ deleteAllData() { - return new q.Promise((resolve, reject) => { + return new Promise((resolve, reject) => { if (!this._indexedDB) { reject(new Error('no indexeddb support available')); return; diff --git a/src/store/indexeddb-local-backend.js b/src/store/indexeddb-local-backend.js index d8d8bfb2b..30ec9b597 100644 --- a/src/store/indexeddb-local-backend.js +++ b/src/store/indexeddb-local-backend.js @@ -44,7 +44,7 @@ function createDatabase(db) { */ function selectQuery(store, keyRange, resultMapper) { const query = store.openCursor(keyRange); - return q.Promise((resolve, reject) => { /*eslint new-cap: 0*/ + return Promise((resolve, reject) => { /*eslint new-cap: 0*/ const results = []; query.onerror = (event) => { reject(new Error("Query failed: " + event.target.errorCode)); @@ -63,7 +63,7 @@ function selectQuery(store, keyRange, resultMapper) { } function promiseifyTxn(txn) { - return new q.Promise((resolve, reject) => { + return new Promise((resolve, reject) => { txn.oncomplete = function(event) { resolve(event); }; @@ -74,7 +74,7 @@ function promiseifyTxn(txn) { } function promiseifyRequest(req) { - return new q.Promise((resolve, reject) => { + return new Promise((resolve, reject) => { req.onsuccess = function(event) { resolve(event); }; @@ -163,7 +163,7 @@ LocalIndexedDBStoreBackend.prototype = { * @return {Promise} Resolved when the database is cleared. */ clearDatabase: function() { - return new q.Promise((resolve, reject) => { + return new Promise((resolve, reject) => { console.log(`Removing indexeddb instance: ${this._dbName}`); const req = this.indexedDB.deleteDatabase(this._dbName);