1 |
3a515b92
|
cagy
|
/*
|
2 |
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
3 |
|
|
Author Tobias Koppers @sokra
|
4 |
|
|
*/
|
5 |
|
|
"use strict";
|
6 |
|
|
|
7 |
|
|
const Hook = require("./Hook");
|
8 |
|
|
const HookCodeFactory = require("./HookCodeFactory");
|
9 |
|
|
|
10 |
|
|
class AsyncSeriesHookCodeFactory extends HookCodeFactory {
|
11 |
|
|
content({ onError, onDone }) {
|
12 |
|
|
return this.callTapsSeries({
|
13 |
|
|
onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true),
|
14 |
|
|
onDone
|
15 |
|
|
});
|
16 |
|
|
}
|
17 |
|
|
}
|
18 |
|
|
|
19 |
|
|
const factory = new AsyncSeriesHookCodeFactory();
|
20 |
|
|
|
21 |
|
|
class AsyncSeriesHook extends Hook {
|
22 |
|
|
compile(options) {
|
23 |
|
|
factory.setup(this, options);
|
24 |
|
|
return factory.create(options);
|
25 |
|
|
}
|
26 |
|
|
}
|
27 |
|
|
|
28 |
|
|
Object.defineProperties(AsyncSeriesHook.prototype, {
|
29 |
|
|
_call: { value: undefined, configurable: true, writable: true }
|
30 |
|
|
});
|
31 |
|
|
|
32 |
|
|
module.exports = AsyncSeriesHook;
|