From c0b78478a0e64942a69aba7c1bfa4eb01c0e9a5e Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 2 Apr 2012 10:10:46 -0700 Subject: fix($q): $q.reject should forward callbacks if missing $q.reject('some reason').then() should not blow up, but correctly forward the callbacks instead. Closes #845 --- src/ng/q.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ng/q.js b/src/ng/q.js index 074acd1d..b8e1166e 100644 --- a/src/ng/q.js +++ b/src/ng/q.js @@ -274,7 +274,7 @@ function qFactory(nextTick, exceptionHandler) { then: function(callback, errback) { var result = defer(); nextTick(function() { - result.resolve(errback(reason)); + result.resolve((errback || defaultErrback)(reason)); }); return result.promise; } -- cgit v1.2.3