Comparing version 0.4.5 to 0.4.6
/** | ||
* @module vow | ||
* @author Filatov Dmitry <dfilatov@yandex-team.ru> | ||
* @version 0.4.5 | ||
* @version 0.4.6 | ||
* @license | ||
@@ -80,3 +80,17 @@ * Dual licensed under the MIT and GPL licenses: | ||
reject : function(reason) { | ||
this._promise.isResolved() || this._promise._reject(reason); | ||
if(this._promise.isResolved()) { | ||
return; | ||
} | ||
if(vow.isPromise(reason)) { | ||
reason = reason.then(function(val) { | ||
var defer = vow.defer(); | ||
defer.reject(val); | ||
return defer.promise(); | ||
}); | ||
this._promise._resolve(reason); | ||
} | ||
else { | ||
this._promise._reject(reason); | ||
} | ||
}, | ||
@@ -858,10 +872,2 @@ | ||
reject : function(reason) { | ||
if(vow.isPromise(reason)) { | ||
return reason.then(function(val) { | ||
var defer = vow.defer(); | ||
defer.reject(val); | ||
return defer.promise(); | ||
}); | ||
} | ||
var defer = vow.defer(); | ||
@@ -1271,3 +1277,3 @@ defer.reject(reason); | ||
var defineAsGlobal = true; | ||
if(typeof exports === 'object') { | ||
if(typeof module === 'object' && typeof module.exports === 'object') { | ||
module.exports = vow; | ||
@@ -1274,0 +1280,0 @@ defineAsGlobal = false; |
{ | ||
"name" : "vow", | ||
"version" : "0.4.5", | ||
"version" : "0.4.6", | ||
"description" : "DOM Promise and Promises/A+ implementation for Node.js and browsers", | ||
"homepage" : "https://github.com/dfilatov/vow", | ||
"homepage" : "http://dfilatov.github.io/vow/", | ||
"keywords" : ["nodejs", "browser", "async", "promise", "dom", "a+"], | ||
@@ -21,3 +21,3 @@ "author" : "Dmitry Filatov <dfilatov@yandex-team.ru>", | ||
"uglify-js" : "1.3.4", | ||
"promises-aplus-tests": "2.0.3", | ||
"promises-aplus-tests": "2.1.0", | ||
"marked" : "0.2.10", | ||
@@ -24,0 +24,0 @@ "jspath" : "0.2.11", |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
0
72
42465
1165