Skip to content

Commit

Permalink
changing async to asyncLib
Browse files Browse the repository at this point in the history
  • Loading branch information
sendilkumarn committed Apr 5, 2017
1 parent 26456f9 commit cd688f8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/MultiCompiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Author Tobias Koppers @sokra
*/
var Tapable = require("tapable");
var async = require("async");
var asyncLib = require("async");
var MultiWatching = require("./MultiWatching");
var MultiStats = require("./MultiStats");

Expand Down Expand Up @@ -100,7 +100,7 @@ function runWithDependencies(compilers, fn, callback) {

function runCompilers(callback) {
if(remainingCompilers.length === 0) return callback();
async.map(getReadyCompilers(), function(compiler, callback) {
asyncLib.map(getReadyCompilers(), function(compiler, callback) {
fn(compiler, function(err) {
if(err) return callback(err);
fulfilledNames[compiler.name] = true;
Expand Down
4 changes: 2 additions & 2 deletions lib/MultiWatching.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
"use strict";

const async = require("async");
const asyncLib = require("async");

class MultiWatching {
constructor(watchings, compiler) {
Expand All @@ -19,7 +19,7 @@ class MultiWatching {
close(callback) {
if(callback === undefined) callback = () => { /*do nothing*/ };

async.forEach(this.watchings, (watching, finishedCallback) => {
asyncLib.forEach(this.watchings, (watching, finishedCallback) => {
watching.close(finishedCallback);
}, err => {
this.compiler.applyPlugins("watch-close");
Expand Down
8 changes: 4 additions & 4 deletions lib/NormalModuleFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
"use strict";

const async = require("async");
const asyncLib = require("async");
const Tapable = require("tapable");
const NormalModule = require("./NormalModule");
const RawModule = require("./RawModule");
Expand Down Expand Up @@ -118,7 +118,7 @@ class NormalModuleFactory extends Tapable {
let resource = elements.pop();
elements = elements.map(identToLoaderRequest);

async.parallel([
asyncLib.parallel([
callback => this.resolveRequestArray(contextInfo, context, elements, this.resolvers.loader, callback),
callback => {
if(resource === "" || resource[0] === "?")
Expand Down Expand Up @@ -194,7 +194,7 @@ class NormalModuleFactory extends Tapable {
settings[r.type] = r.value;
}
});
async.parallel([
asyncLib.parallel([
this.resolveRequestArray.bind(this, contextInfo, this.context, useLoadersPost, this.resolvers.loader),
this.resolveRequestArray.bind(this, contextInfo, this.context, useLoaders, this.resolvers.loader),
this.resolveRequestArray.bind(this, contextInfo, this.context, useLoadersPre, this.resolvers.loader)
Expand Down Expand Up @@ -257,7 +257,7 @@ class NormalModuleFactory extends Tapable {

resolveRequestArray(contextInfo, context, array, resolver, callback) {
if(array.length === 0) return callback(null, []);
async.map(array, (item, callback) => {
asyncLib.map(array, (item, callback) => {
resolver.resolve(contextInfo, context, item.loader, (err, result) => {
if(err && /^[^/]*$/.test(item.loader) && !/-loader$/.test(item.loader)) {
return resolver.resolve(contextInfo, context, item.loader + "-loader", err2 => {
Expand Down
4 changes: 2 additions & 2 deletions test/BenchmarkTestCases.benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const should = require("should");
const path = require("path");
const fs = require("fs");
const async = require("async");
const asyncLib = require("async");
var Test = require("mocha/lib/test");

const webpack = require("../lib/webpack");
Expand Down Expand Up @@ -31,7 +31,7 @@ describe("BenchmarkTestCases", function() {
const rootPath = path.join(__dirname, "..");
getBaselineRevs(rootPath, (err, baselineRevisions) => {
if(err) return done(err);
async.eachSeries(baselineRevisions, (baselineInfo, callback) => {
asyncLib.eachSeries(baselineRevisions, (baselineInfo, callback) => {
const baselineRevision = baselineInfo.rev;
const baselinePath = path.resolve(baselinesPath, baselineRevision);
if(fs.existsSync(path.resolve(baselinePath, ".git"))) {
Expand Down

0 comments on commit cd688f8

Please sign in to comment.