Comparing version 0.5.0-alpha to 0.5.0-alpha.1
20
kew.js
@@ -24,4 +24,12 @@ | ||
/** | ||
* @param {function()} callback | ||
*/ | ||
function nextTick (callback) { | ||
callback() | ||
} | ||
var nextTick = process.nextTick | ||
if (typeof process !== 'undefined') { | ||
nextTick = process.nextTick | ||
} | ||
@@ -35,3 +43,3 @@ /** | ||
* @param {Function} callback | ||
* @param {Object} scope | ||
* @param {Object|undefined} scope | ||
* @param {Array} args | ||
@@ -69,5 +77,9 @@ */ | ||
* for leaked rejections. | ||
* @constructor | ||
*/ | ||
function PromiseStats() { | ||
/** @type {number} */ | ||
this.errorsEmitted = 0 | ||
/** @type {number} */ | ||
this.errorsHandled = 0 | ||
@@ -234,3 +246,3 @@ } | ||
* | ||
* @param {function(this:SCOPE, T, ?): RESULT} onSuccess | ||
* @param {function(this:SCOPE, ...): RESULT} onSuccess | ||
* @param {SCOPE} scope Object whose context callback will be executed in. | ||
@@ -271,3 +283,3 @@ * @param {...*} var_args Additional arguments to be passed to the promise callback. | ||
* | ||
* @param {function(this:SCOPE, Error, ?)} onFail | ||
* @param {function(this:SCOPE, ...)} onFail | ||
* @param {SCOPE} scope Object whose context callback will be executed in. | ||
@@ -274,0 +286,0 @@ * @param {...?} var_args |
{ | ||
"name": "kew", | ||
"description": "a lightweight promise library for node", | ||
"version": "0.5.0-alpha", | ||
"version": "0.5.0-alpha.1", | ||
"homepage": "https://github.com/Obvious/kew", | ||
@@ -25,3 +25,3 @@ "authors": [ | ||
"nodeunit": "0.8.1", | ||
"closure-npc": "0.1.3" | ||
"closure-npc": "0.1.5" | ||
}, | ||
@@ -28,0 +28,0 @@ "scripts": { |
@@ -25,2 +25,8 @@ /** | ||
/** | ||
* @param {number} n | ||
* @param {*} result | ||
*/ | ||
var callbackNeedsBind = function (n, result) {}; | ||
/** | ||
@param {Error} error | ||
@@ -36,2 +42,7 @@ */ | ||
/** @return {kew.Promise.<string>} */ | ||
var stringPromise = function () { | ||
return kew.resolve('string') | ||
} | ||
var exampleThen = function () { | ||
@@ -47,2 +58,7 @@ var examplePromise = new Promise(); | ||
var thenBound = function () { | ||
stringPromise().thenBound(callbackNeedsBind, null, 3).failBound(callbackNeedsBind, null, 3); | ||
}; | ||
var examplePromise = function () { | ||
@@ -49,0 +65,0 @@ var promise = new Promise(callback); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
72541
1786
0