Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* Promises.js: change for nested objects that contain promises

  • Loading branch information...
commit 5adcfaaf0288683a40c0d0c717662a172331b14a 1 parent b9b9553
@swannodette swannodette authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 Promises.js
View
4 Promises.js
@@ -89,6 +89,7 @@ var Promise = new Class({
// if handed an object look for promises in the values - handles the recursive case
// however you should not put anything in the promise except normal values or promises
// i.e. no custom instances
+ this.__object = value;
this.__isObject = true;
var ps = $treeFilter(value, Promise.isPromise, Promise.isPromise);
Promise.watch(ps, function(promises) {
@@ -214,6 +215,9 @@ var Promise = new Class({
} else {
this.__promise.realize();
}
+ } else if(this.__object) {
+ var ps = $treeFilter(this.__object, Promise.isPromise, Promise.isPromise);
+ ps.map(Function.msg("realize"));
}
return this;
},
Please sign in to comment.
Something went wrong with that request. Please try again.