Comparing version 0.9.1 to 0.9.2
{ | ||
"name": "q", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "A library for promises (CommonJS/Promises/A,B,D)", | ||
@@ -47,3 +47,3 @@ "homepage": "https://github.com/kriskowal/q", | ||
"devDependencies": { | ||
"jshint": ">=0.9.1", | ||
"jshint": ">=1.1.0", | ||
"cover": "*", | ||
@@ -50,0 +50,0 @@ "jasmine-node": "1.2.2", |
28
q.js
@@ -341,11 +341,2 @@ // vim:ts=4:sts=4:sw=4: | ||
function deprecate(callback, name, alternative) { | ||
return function () { | ||
if (typeof console !== "undefined" && typeof console.warn === "function") { | ||
console.warn(name + " is deprecated, use " + alternative + " instead.", new Error("").stack); | ||
} | ||
return callback.apply(callback, arguments); | ||
}; | ||
} | ||
// end of shims | ||
@@ -357,3 +348,3 @@ // beginning of real work | ||
* Passes Q promises through, | ||
* Coerces CommonJS/Promises/A+ promises to Q promises. | ||
* Coerces thenables to Q promises. | ||
*/ | ||
@@ -650,3 +641,3 @@ function Q(value) { | ||
object = valueOf(object); | ||
return isPromise(object) && 'exception' in object; | ||
return isPromise(object) && "exception" in object; | ||
} | ||
@@ -741,3 +732,3 @@ | ||
// promised function. | ||
if (name == null) { // iff name is null or undefined | ||
if (name === null || name === void 0) { | ||
return object.apply(void 0, args); | ||
@@ -1004,3 +995,3 @@ } else { | ||
*/ | ||
Q['return'] = _return; | ||
Q["return"] = _return; | ||
function _return(value) { | ||
@@ -1326,3 +1317,3 @@ throw new QReturnValue(value); | ||
deferred.reject(exception); | ||
}); | ||
}, deferred.notify); | ||
@@ -1346,6 +1337,10 @@ return deferred.promise; | ||
} | ||
var deferred = defer(); | ||
when(promise, undefined, undefined, deferred.notify); | ||
setTimeout(function () { | ||
deferred.resolve(promise); | ||
}, timeout); | ||
return deferred.promise; | ||
@@ -1416,4 +1411,4 @@ } | ||
Q.nbind = nbind; | ||
function nbind(callback/*, ... args*/) { | ||
var baseArgs = array_slice(arguments, 1); | ||
function nbind(callback, thisArg /*, ... args*/) { | ||
var baseArgs = array_slice(arguments, 2); | ||
return function () { | ||
@@ -1424,3 +1419,2 @@ var nodeArgs = baseArgs.concat(array_slice(arguments)); | ||
var thisArg = this; | ||
function bound() { | ||
@@ -1427,0 +1421,0 @@ return callback.apply(thisArg, arguments); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70939
1370