Permalink
Browse files

* Promises.js: asPromise -> future

  • Loading branch information...
1 parent 5f6a21a commit 7ca9d6fe07b0e66804dfc33536193e4d9afc2450 @swannodette swannodette committed Jan 24, 2010
Showing with 6 additions and 6 deletions.
  1. +3 −3 Promises.js
  2. +3 −3 examples/exampleA.js
View
@@ -11,7 +11,7 @@
*/
Function.implement({
- asPromise: function() { return this.decorate(promise); }
+ future: function() { return this.decorate(promise); }
});
/*
@@ -577,7 +577,7 @@ var $if = function(test, trueExpr, falseExpr) {
if($type(falseExpr) == "function") return falseExpr(test);
return falseExpr;
}
-}.asPromise();
+}.future();
/*
Function: $and
@@ -589,4 +589,4 @@ var $if = function(test, trueExpr, falseExpr) {
var $and = function() {
var args = $A(arguments);
return args.every($identity);
-}.asPromise();
+}.future();
View
@@ -72,7 +72,7 @@ function example3()
// short cut (For Avital)
function example4()
{
- var subtract = function(a, b) { return a - b; }.asPromise();
+ var subtract = function(a, b) { return a - b; }.future();
show(subtract(get("10"), get("7")), "ex4");
}
@@ -140,7 +140,7 @@ function example8()
// Promises with regular values
function example9()
{
- var x = function(x) { return x * 2; }.asPromise();
+ var x = function(x) { return x * 2; }.future();
var p1 = new Promise(5);
var p2 = x(p1);
show(p2);
@@ -149,7 +149,7 @@ function example9()
function example10()
{
- var x = function(a, b) { return a * b; }.asPromise();
+ var x = function(a, b) { return a * b; }.future();
var p1 = $promise(3);
var p2 = $promise(4);
var p3 = x(p1, p2);

0 comments on commit 7ca9d6f

Please sign in to comment.