Bug 1227474 - Promisify all client methods. r=jryans

This commit is contained in:
Alexandre Poirot 2015-12-03 06:42:34 -08:00
Родитель 5f4425d536
Коммит ff259744e3
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -243,6 +243,9 @@ const DebuggerClient = exports.DebuggerClient = function (aTransport)
* response, and the return value is considered the new response that * response, and the return value is considered the new response that
* will be passed to the callback. The |this| context is the instance of * will be passed to the callback. The |this| context is the instance of
* the client object we are defining a method for. * 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, DebuggerClient.requester = function (aPacketSkeleton,
{ telemetry, before, after }) { { telemetry, before, after }) {
@ -276,7 +279,7 @@ DebuggerClient.requester = function (aPacketSkeleton,
outgoingPacket = before.call(this, outgoingPacket); outgoingPacket = before.call(this, outgoingPacket);
} }
this.request(outgoingPacket, DevToolsUtils.makeInfallible((aResponse) => { return this.request(outgoingPacket, DevToolsUtils.makeInfallible((aResponse) => {
if (after) { if (after) {
let { from } = aResponse; let { from } = aResponse;
aResponse = after.call(this, aResponse); aResponse = after.call(this, aResponse);