Authored by yyq

fix promise catch

This diff could not be displayed because it is too large.
1 { 1 {
2 "name": "yoho-activity-sdk", 2 "name": "yoho-activity-sdk",
3 - "version": "1.1.4", 3 + "version": "1.1.5",
4 "description": "YOHO!前端js的功能封装包,主要用于在活动页面中,对主要功能的封装。", 4 "description": "YOHO!前端js的功能封装包,主要用于在活动页面中,对主要功能的封装。",
5 "keywords": [ 5 "keywords": [
6 "YOHO!", 6 "YOHO!",
@@ -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.