aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/q.js
diff options
context:
space:
mode:
authorIgor Minar2012-04-02 10:10:46 -0700
committerIgor Minar2012-04-02 10:14:04 -0700
commitc0b78478a0e64942a69aba7c1bfa4eb01c0e9a5e (patch)
tree3130c15a619d9aa20ec6b2188ef7e4e25bee1d13 /src/ng/q.js
parent59fa40ec0e851759d35fb0ea5fd01019d1403049 (diff)
downloadangular.js-c0b78478a0e64942a69aba7c1bfa4eb01c0e9a5e.tar.bz2
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
Diffstat (limited to 'src/ng/q.js')
-rw-r--r--src/ng/q.js2
1 files changed, 1 insertions, 1 deletions
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;
}