summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorportix <none@none>2013-02-11 22:28:26 +0100
committerportix <none@none>2013-02-11 22:28:26 +0100
commite4d3878ea5c017ba39bee6176d92f4277d13e70a (patch)
treeb11d41735a2fd32143fec91d1cb33552f040f463 /scripts
parentb07701ff69e59382e4e4196640b09a26fb130e61 (diff)
downloaddwb-e4d3878ea5c017ba39bee6176d92f4277d13e70a.zip
Implementing Deferred.when
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/dwb.js9
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);