Skip to content

Commit 2ce1e2e

Browse files
authored
Merge pull request #2 from Kmaschta/fix-range-error
Avoid RangeError from async
2 parents 5706baf + ad0c8d5 commit 2ce1e2e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/MigratExecutor.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ module.exports = function MigratExecutor(project, plugins, runlist, options, wri
6464
err = err || null;
6565
async.series([
6666
function executeAfterEachHook(callback) {
67-
bridge.executeHook('afterEach', [err, item, callback]);
67+
async.setImmediate(function () {
68+
bridge.executeHook('afterEach', [err, item, callback]);
69+
});
6870
}
6971
], function(_err) {
7072
callback(err || _err || null);
@@ -77,10 +79,12 @@ module.exports = function MigratExecutor(project, plugins, runlist, options, wri
7779
err = err || null;
7880
async.series([
7981
function executeAfterRunHook(callback) {
80-
bridge.executeHook('afterRun', [err, runlist, callback]);
82+
async.setImmediate(function () {
83+
bridge.executeHook('afterRun', [err, runlist, callback]);
84+
});
8185
}
8286
], function(_err) {
8387
callback(err || _err || null);
8488
});
8589
});
86-
};
90+
};

0 commit comments

Comments
 (0)