Commit 40c95cd2 authored by Nathan Perry's avatar Nathan Perry
Browse files

Simplified unnecessary loop

There is no need to use a confusing loop calling apply with arguments. Just call the function directly each time. This version is shorter and simpler no matter how many times you need to call expose.
parent 7d657a9f
Loading
Loading
Loading
Loading
+3 −9
Original line number Original line Diff line number Diff line
@@ -140,15 +140,9 @@ function expose(methodToExpose, exposeAs) {


}
}


_.forEach([
expose('then');
        ['then'],
expose('catch');
        ['catch'],
expose('finally');
        ['finally']
    ],
    function (args) {
        expose.apply(undefined, args);
    }
);


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