1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Correct incorrect Promise() invocation

you're supposed to call Promise() as a constructor rather than a static
function.
This commit is contained in:
Richard van der Hoff
2017-07-11 17:49:18 +01:00
parent 547501ba81
commit 503b6ea6c8

View File

@@ -44,7 +44,7 @@ function createDatabase(db) {
*/
function selectQuery(store, keyRange, resultMapper) {
const query = store.openCursor(keyRange);
return Promise((resolve, reject) => { /*eslint new-cap: 0*/
return new Promise((resolve, reject) => {
const results = [];
query.onerror = (event) => {
reject(new Error("Query failed: " + event.target.errorCode));