Comparing version 0.0.3 to 0.0.4
0.0.4 / 2011-10-05 | ||
================== | ||
* oaths now except and apply custom context during 'then' callbacks | ||
0.0.3 / 2011-10-04 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -13,3 +13,3 @@ /*! | ||
*/ | ||
exports.version = '0.0.3'; | ||
exports.version = '0.0.4'; | ||
@@ -55,3 +55,4 @@ | ||
this._options = { | ||
parent: options.parent || null | ||
parent: options.parent || null, | ||
context: options.context || this | ||
}; | ||
@@ -102,3 +103,10 @@ | ||
Oath.prototype.then = function (success, failure) { | ||
this.pending.push({ resolve: success, reject: failure }); | ||
var context = this._options.context, | ||
succ, fail; | ||
succ = function () { success.apply(context, arguments); }; | ||
if (failure) | ||
fail = function () { failure.apply(context, arguments); }; | ||
this.pending.push({ resolve: succ, reject: fail }); | ||
return this; | ||
@@ -105,0 +113,0 @@ }; |
@@ -5,3 +5,3 @@ { | ||
"description": "Tiny promises.", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"homepage": "http://logicalparadox.github.com/oath", | ||
@@ -8,0 +8,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
13544
316