Diffstat (limited to 'frontend/gamma/js/Clipperz/Async.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/Async.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/frontend/gamma/js/Clipperz/Async.js b/frontend/gamma/js/Clipperz/Async.js index 97d8ecf..f7a9517 100644 --- a/frontend/gamma/js/Clipperz/Async.js +++ b/frontend/gamma/js/Clipperz/Async.js @@ -468,99 +468,99 @@ MochiKit.Base.update(Clipperz.Async, { methods = MochiKit.Base.values(someRequests); deferredResult = new Clipperz.Async.Deferred(aName, args); deferredResult.addCallback(Clipperz.Async.forkAndJoin(aName + " [inner forkAndJoin]", methods, args)); deferredResult.addBoth(function(someResults) { var returnFunction; var results; var i,c; var result; if (someResults instanceof MochiKit.Async.CancelledError) { returnFunction = MochiKit.Async.fail; result = someResults; } else { if (someResults instanceof Error) { returnFunction = MochiKit.Async.fail; results = someResults['message']; } else { returnFunction = MochiKit.Async.succeed; results = someResults; } result = {}; c = requestKeys.length; for (i=0; i<c; i++) { result[requestKeys[i]] = results[i]; } } return returnFunction.call(null, result); }); deferredResult.callback(aValue); return deferredResult; }, aName, someRequests, args); }, //------------------------------------------------------------------------- 'collectAll': function (someDeferredObjects) { var deferredResult; deferredResult = new MochiKit.Async.DeferredList(someDeferredObjects, false, false, false); deferredResult.addCallback(function (aResultList) { return MochiKit.Base.map(function (aResult) { if (aResult[0]) { return aResult[1]; - } else { + } else { throw aResult[1]; - } + } }, aResultList); }); return deferredResult; }, //------------------------------------------------------------------------- 'setItem': function (anObject, aKey, aValue) { anObject[aKey] = aValue; return anObject; }, 'setItemOnObject': function (aKey, aValue, anObject) { anObject[aKey] = aValue; return anObject; }, 'setDeferredItemOnObject': function (aKey, aDeferredFunction, anObject) { return Clipperz.Async.callbacks("Clipperz.Async.setDeferredItemOnObject", [ aDeferredFunction, MochiKit.Base.partial(Clipperz.Async.setItem, anObject, aKey) ], {trace:false}, anObject); }, //------------------------------------------------------------------------- 'deferredIf': function (aName, aThenBlock, anElseBlock) { return function (aValue) { var deferredResult; if (!MochiKit.Base.isUndefinedOrNull(aValue) && aValue) { deferredResult = Clipperz.Async.callbacks(aName + " <then>", aThenBlock, null, aValue); } else { deferredResult = Clipperz.Async.callbacks(aName + " <else>", anElseBlock, null, aValue); } return deferredResult; } }, //------------------------------------------------------------------------- 'log': function(aMessage, aResult) { if (CLIPPERZ_DEFERRED_LOGGING_ENABLED) { Clipperz.log(aMessage + " ", aResult); |