Showing
4 changed files
with
4 additions
and
2 deletions
This diff could not be displayed because it is too large.
@@ -33,9 +33,11 @@ function Promise(fn) { | @@ -33,9 +33,11 @@ function Promise(fn) { | ||
33 | errback(promise._reason); | 33 | errback(promise._reason); |
34 | } | 34 | } |
35 | }) | 35 | }) |
36 | - | ||
37 | }; | 36 | }; |
38 | 37 | ||
38 | + this.catch = function(onRejected) { | ||
39 | + return promise.then(undefined, onRejected); | ||
40 | + }; | ||
39 | 41 | ||
40 | function resolve(value) { | 42 | function resolve(value) { |
41 | setTimeout(function(){ | 43 | setTimeout(function(){ |
This diff could not be displayed because it is too large.
-
Please register or login to post a comment