Skip to content

Commit cead7e5

Browse files
committed
Only lib changes
1 parent 8b888fe commit cead7e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1781
-1723
lines changed

lib/AsyncDependenciesBlock.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,42 @@
66
const DependenciesBlock = require("./DependenciesBlock");
77

88
module.exports = class AsyncDependenciesBlock extends DependenciesBlock {
9-
constructor(name, module, loc) {
9+
constructor(name, module, loc, request) {
1010
super();
1111
this.chunkName = name;
12-
this.chunks = null;
12+
this.chunkGroup = undefined;
1313
this.module = module;
1414
this.loc = loc;
15+
this.request = request;
1516
}
16-
get chunk() {
17-
throw new Error("`chunk` was been renamed to `chunks` and is now an array");
17+
18+
get chunks() {
19+
throw new Error("Moved to AsyncDependenciesBlock.chunkGroup");
1820
}
19-
set chunk(chunk) {
20-
throw new Error("`chunk` was been renamed to `chunks` and is now an array");
21+
22+
set chunks(value) {
23+
throw new Error("Moved to AsyncDependenciesBlock.chunkGroup");
2124
}
25+
2226
updateHash(hash) {
2327
hash.update(this.chunkName || "");
24-
hash.update(this.chunks && this.chunks.map((chunk) => {
28+
hash.update(this.chunkGroup && this.chunkGroup.chunks.map(chunk => {
2529
return chunk.id !== null ? chunk.id : "";
2630
}).join(",") || "");
2731
super.updateHash(hash);
2832
}
33+
2934
disconnect() {
30-
this.chunks = null;
35+
this.chunkGroup = undefined;
3136
super.disconnect();
3237
}
38+
3339
unseal() {
34-
this.chunks = null;
40+
this.chunkGroup = undefined;
3541
super.unseal();
3642
}
43+
3744
sortItems() {
3845
super.sortItems();
39-
if(this.chunks) {
40-
this.chunks.sort((a, b) => a.compareTo(b));
41-
}
4246
}
4347
};

0 commit comments

Comments
 (0)