summaryrefslogtreecommitdiff
path: root/lib/dojo/promise/all.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dojo/promise/all.js')
-rw-r--r--lib/dojo/promise/all.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/dojo/promise/all.js b/lib/dojo/promise/all.js
new file mode 100644
index 000000000..928c63bec
--- /dev/null
+++ b/lib/dojo/promise/all.js
@@ -0,0 +1,8 @@
+/*
+ Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+//>>built
+define("dojo/promise/all",["../_base/array","../Deferred","../when"],function(_1,_2,_3){"use strict";var _4=_1.some;return function all(_5){var _6,_1;if(_5 instanceof Array){_1=_5;}else{if(_5&&typeof _5==="object"){_6=_5;}}var _7;var _8=[];if(_6){_1=[];for(var _9 in _6){if(Object.hasOwnProperty.call(_6,_9)){_8.push(_9);_1.push(_6[_9]);}}_7={};}else{if(_1){_7=[];}}if(!_1||!_1.length){return new _2().resolve(_7);}var _a=new _2();_a.promise.always(function(){_7=_8=null;});var _b=_1.length;_4(_1,function(_c,_d){if(!_6){_8.push(_d);}_3(_c,function(_e){if(!_a.isFulfilled()){_7[_8[_d]]=_e;if(--_b===0){_a.resolve(_7);}}},_a.reject);return _a.isFulfilled();});return _a.promise;};}); \ No newline at end of file