forked from webpack/webpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AsyncDependenciesBlock.js
36 lines (30 loc) · 1013 Bytes
/
AsyncDependenciesBlock.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var DependenciesBlock = require("./DependenciesBlock");
function AsyncDependenciesBlock(name, module, loc) {
DependenciesBlock.call(this);
this.chunkName = name;
this.chunks = null;
this.module = module;
this.loc = loc;
Object.defineProperty(this, "chunk", {
get: function() {
throw new Error("`chunk` was been renamed to `chunks` and is now an array");
},
set: function() {
throw new Error("`chunk` was been renamed to `chunks` and is now an array");
}
});
}
module.exports = AsyncDependenciesBlock;
AsyncDependenciesBlock.prototype = Object.create(DependenciesBlock.prototype);
AsyncDependenciesBlock.prototype.updateHash = function updateHash(hash) {
hash.update(this.chunkName || "");
DependenciesBlock.prototype.updateHash.call(this, hash);
};
AsyncDependenciesBlock.prototype.disconnect = function() {
this.chunks = null;
DependenciesBlock.prototype.disconnect.call(this);
};