File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ module Promises {
129129 return SrdRef[AllPromise[InputType]]()~use_in(__this){
130130 construct();
131131 promise.wkThis = castSrdRef[__this, Promise[Array[InputType]]];
132+ def allResolved: Bool = true;
132133 def i: Int;
133134 for i = 0, i < inputs.getLength(), ++i {
134135 inputChainNodes.add(SrdRef[AllChainNode[InputType]]()~use_in(self){
@@ -139,8 +140,17 @@ module Promises {
139140 next~no_deref = inputs(i).child;
140141 inputs(i).child~no_deref = self.obj;
141142 });
142- result.add(InputType());
143+ if inputChainNodes(i).depPromise.status == Status.RESOLVED {
144+ result.add(inputChainNodes(i).depPromise.result);
145+ } else {
146+ allResolved = false;
147+ result.add(InputType());
148+ if inputChainNodes(i).depPromise.status == Status.REJECTED and status == Status.NEW {
149+ reject(inputChainNodes(i).depPromise.error);
150+ }
151+ }
143152 }
153+ if allResolved resolve(result);
144154 };
145155 }
146156
You can’t perform that action at this time.
0 commit comments