Socket
Socket
Sign inDemoInstall

q

Package Overview
Dependencies
Maintainers
0
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

q - npm Package Compare versions

Comparing version 0.2.7 to 0.2.8

q/README2

36

q/lib/q.js

@@ -77,2 +77,6 @@ // vim:ts=4:sts=4:sw=4:

var print = typeof console === "undefined" ? identity : function (message) {
console.log(message);
};
/**

@@ -359,2 +363,21 @@ * Performs a task in a future turn of the event loop.

// single call to one of the callbacks
function _resolved(value) {
try {
return resolved ? resolved(value) : value;
} catch (exception) {
print(exception && exception.stack || exception);
return reject(exception);
}
}
function _rejected(reason) {
try {
return rejected ? rejected(reason) : reject(reason);
} catch (exception) {
print(exception && exception.stack || exception);
return reject(exception);
}
}
forward(ref(value), "when", function (value) {

@@ -364,3 +387,3 @@ if (done)

done = true;
deferred.resolve(ref(value)[DUCK]("when", resolved, rejected));
deferred.resolve(ref(value)[DUCK]("when", _resolved, _rejected));
}, function (reason) {

@@ -370,3 +393,3 @@ if (done)

done = true;
deferred.resolve(rejected ? rejected(reason) : reject(reason));
deferred.resolve(_rejected(reason));
});

@@ -502,11 +525,6 @@ return deferred.promise;

*/
function forward(promise, op, resolved /* ... */) {
function forward(promise /* ... */) {
var args = Array.prototype.slice.call(arguments, 1);
enqueue(function () {
try {
promise[DUCK].apply(promise, args);
} catch (exception) {
console !== "undefined" && console.error(exception);
resolved(reject(exception));
}
promise[DUCK].apply(promise, args);
});

@@ -513,0 +531,0 @@ }

{
"name": "q",
"description": "defer/when-style promises (CommonJS/Promises/A,B,D)",
"version": "0.2.7",
"version": "0.2.8",
"homepage": "http://github.com/kriskowal/q/",

@@ -6,0 +6,0 @@ "author": "Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc