diff options
author | portix <none@none> | 2013-02-11 22:28:26 +0100 |
---|---|---|
committer | portix <none@none> | 2013-02-11 22:28:26 +0100 |
commit | e4d3878ea5c017ba39bee6176d92f4277d13e70a (patch) | |
tree | b11d41735a2fd32143fec91d1cb33552f040f463 /scripts | |
parent | b07701ff69e59382e4e4196640b09a26fb130e61 (diff) | |
download | dwb-e4d3878ea5c017ba39bee6176d92f4277d13e70a.zip |
Implementing Deferred.when
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/dwb.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/lib/dwb.js b/scripts/lib/dwb.js index a734c7e5..584b04dd 100644 --- a/scripts/lib/dwb.js +++ b/scripts/lib/dwb.js @@ -204,5 +204,14 @@ } } }); + Object.defineProperty(Deferred, "when", { + value : function(value, callback, errback) + { + if (value instanceof Deferred) + return value.then(callback, errback); + else + return callback(value); + } + }); })(); Object.preventExtensions(this); |