From ff259744e33bae6d12a87113b6bb6751e7fcea5c Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Thu, 3 Dec 2015 06:42:34 -0800 Subject: [PATCH] Bug 1227474 - Promisify all client methods. r=jryans --- devtools/shared/client/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devtools/shared/client/main.js b/devtools/shared/client/main.js index a914485508eb..a6093f96c202 100644 --- a/devtools/shared/client/main.js +++ b/devtools/shared/client/main.js @@ -243,6 +243,9 @@ const DebuggerClient = exports.DebuggerClient = function (aTransport) * response, and the return value is considered the new response that * will be passed to the callback. The |this| context is the instance of * the client object we are defining a method for. + * @return Request + * The `Request` object that is a Promise object and resolves once + * we receive the response. (See request method for more details) */ DebuggerClient.requester = function (aPacketSkeleton, { telemetry, before, after }) { @@ -276,7 +279,7 @@ DebuggerClient.requester = function (aPacketSkeleton, outgoingPacket = before.call(this, outgoingPacket); } - this.request(outgoingPacket, DevToolsUtils.makeInfallible((aResponse) => { + return this.request(outgoingPacket, DevToolsUtils.makeInfallible((aResponse) => { if (after) { let { from } = aResponse; aResponse = after.call(this, aResponse);