1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Replace rest of defers

This commit is contained in:
Michael Telatynski
2019-11-25 14:50:40 +00:00
parent 733008cfc4
commit 64bf145e4b
2 changed files with 7 additions and 7 deletions

View File

@@ -256,7 +256,7 @@ HttpResponse.prototype.request = function HttpResponse(
if (!next) { // no more things to return
if (method === "GET" && path === "/sync" && this.ignoreUnhandledSync) {
logger.log("MatrixClient[UT] Ignoring.");
return Promise.defer().promise;
return new Promise(() => {});
}
if (this.pendingLookup) {
if (this.pendingLookup.method === method
@@ -271,7 +271,7 @@ HttpResponse.prototype.request = function HttpResponse(
);
}
this.pendingLookup = {
promise: Promise.defer().promise,
promise: new Promise(() => {}),
method: method,
path: path,
};
@@ -308,10 +308,10 @@ HttpResponse.prototype.request = function HttpResponse(
} else if (method === "GET" && path === "/sync" && this.ignoreUnhandledSync) {
logger.log("MatrixClient[UT] Ignoring.");
this.httpLookups.unshift(next);
return Promise.defer().promise;
return new Promise(() => {});
}
expect(true).toBe(false, "Expected different request. " + logLine);
return Promise.defer().promise;
return new Promise(() => {});
};
HttpResponse.KEEP_ALIVE_PATH = "/_matrix/client/versions";