Skip to content

Commit

Permalink
Merge branch 'master' into drop-lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
aearly committed Jun 3, 2018
2 parents 83d3f73 + ca85923 commit ec8d30c
Show file tree
Hide file tree
Showing 9 changed files with 8,835 additions and 6,156 deletions.
8 changes: 3 additions & 5 deletions .travis.yml
@@ -1,17 +1,15 @@
sudo: false
language: node_js
node_js:
- "0.10"
- "0.12"
- "4"
- "6"
- "8"
- "10"

matrix:
include:
- node_js: "7"
- node_js: "10"
addons:
firefox: "52.0"
firefox: "57.0"
env: BROWSER=true MAKE_TEST=true
env:
matrix: BROWSER=false MAKE_TEST=false
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,9 @@
# v2.6.1
- Updated lodash to prevent `npm audit` warnings. (#1532, #1533)
- Made `async-es` more optimized for webpack users (#1517)
- Fixed a stack overflow with large collections and a synchronous iterator (#1514)
- Various small fixes/chores (#1505, #1511, #1527, #1530)

# v2.6.0
- Added missing aliases for many methods. Previously, you could not (e.g.) `require('async/find')` or use `async.anyLimit`. (#1483)
- Improved `queue` performance. (#1448, #1454)
Expand Down
22 changes: 18 additions & 4 deletions dist/async.js
Expand Up @@ -664,10 +664,13 @@ var reIsUint = /^(?:0|[1-9]\d*)$/;
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
var type = typeof value;
length = length == null ? MAX_SAFE_INTEGER$1 : length;

return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
(type == 'number' ||
(type != 'symbol' && reIsUint.test(value))) &&
(value > -1 && value % 1 == 0 && value < length);
}

/** `Object#toString` result references. */
Expand Down Expand Up @@ -753,6 +756,14 @@ var freeProcess = moduleExports$1 && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
try {
// Use `util.types` for Node.js 10+.
var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types;

if (types) {
return types;
}

// Legacy `process.binding('util')` for Node.js < 10.
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}());
Expand Down Expand Up @@ -968,6 +979,7 @@ function _eachOfLimit(limit) {
var nextElem = iterator(obj);
var done = false;
var running = 0;
var looping = false;

function iterateeCallback(err, value) {
running -= 1;
Expand All @@ -979,12 +991,13 @@ function _eachOfLimit(limit) {
done = true;
return callback(null);
}
else {
else if (!looping) {
replenish();
}
}

function replenish () {
looping = true;
while (running < limit && !done) {
var elem = nextElem();
if (elem === null) {
Expand All @@ -997,6 +1010,7 @@ function _eachOfLimit(limit) {
running += 1;
iteratee(elem.value, elem.key, onlyOnce(iterateeCallback));
}
looping = false;
}

replenish();
Expand Down Expand Up @@ -3817,7 +3831,7 @@ function memoize(fn, hasher) {

/**
* Calls `callback` on a later loop around the event loop. In Node.js this just
* calls `process.nextTicl`. In the browser it will use `setImmediate` if
* calls `process.nextTick`. In the browser it will use `setImmediate` if
* available, otherwise `setTimeout(callback, 0)`, which means other higher
* priority events may precede the execution of `callback`.
*
Expand Down
2 changes: 1 addition & 1 deletion dist/async.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/async.min.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions karma.conf.js
Expand Up @@ -3,6 +3,12 @@ module.exports = function(config) {
browsers: ['Firefox'],
files: ['mocha_test/*.js'],
frameworks: ['browserify', 'mocha'],
plugins: [
'karma-browserify',
'karma-mocha',
'karma-mocha-reporter',
'karma-firefox-launcher'
],
preprocessors: {
'mocha_test/*.js': ['browserify']
},
Expand Down
2 changes: 1 addition & 1 deletion mocha_test/waterfall.js
Expand Up @@ -126,7 +126,7 @@ describe("waterfall", function () {
async.waterfall([
function(callback){
setTimeout(callback, 0, null, 'one', 'two');
setTimeout(callback, 10, null, 'one', 'two');
setTimeout(callback, 2, null, 'one', 'two');
},
function(arg1, arg2, callback){
setTimeout(callback, 15, null, arg1, arg2, 'three');
Expand Down

0 comments on commit ec8d30c

Please sign in to comment.