Commit 95ef6c2c authored by Henrique J. P. Barcelos's avatar Henrique J. P. Barcelos
Browse files

Exposes some promise methods

Exposes `finally` and the compatibility methods `caught` and `lastly`.
parent 58a6af4a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -128,6 +128,15 @@ request.Request.prototype.catch = function RP$catch(onRejected) {
    return this._rp_promise.catch.apply(this._rp_promise, arguments);
};

request.Request.prototype.finally = function RP$catch() {
    markPromiseInUse(this);
    return this._rp_promise.finally.apply(this._rp_promise);
};

request.Request.prototype.caught = request.Request.prototype.catch;

request.Request.prototype.lastly = request.Request.prototype.finally;

request.Request.prototype.promise = function RP$promise() {
    markPromiseInUse(this);
    return this._rp_promise;