2013-01-31 01:49:25 +08:00
|
|
|
/*
|
|
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
|
|
Author Tobias Koppers @sokra
|
|
|
|
*/
|
2017-01-09 04:07:41 +08:00
|
|
|
"use strict";
|
|
|
|
const DependenciesBlock = require("./DependenciesBlock");
|
|
|
|
|
|
|
|
module.exports = class AsyncDependenciesBlock extends DependenciesBlock {
|
2018-01-20 00:06:59 +08:00
|
|
|
constructor(name, module, loc, request) {
|
2017-01-09 04:07:41 +08:00
|
|
|
super();
|
|
|
|
this.chunkName = name;
|
2018-01-20 00:06:59 +08:00
|
|
|
this.chunkGroup = undefined;
|
2017-01-09 04:07:41 +08:00
|
|
|
this.module = module;
|
|
|
|
this.loc = loc;
|
2018-01-20 00:06:59 +08:00
|
|
|
this.request = request;
|
2017-01-09 22:09:29 +08:00
|
|
|
}
|
2018-01-20 00:06:59 +08:00
|
|
|
|
|
|
|
get chunks() {
|
|
|
|
throw new Error("Moved to AsyncDependenciesBlock.chunkGroup");
|
2017-01-09 22:09:29 +08:00
|
|
|
}
|
2018-01-20 00:06:59 +08:00
|
|
|
|
|
|
|
set chunks(value) {
|
|
|
|
throw new Error("Moved to AsyncDependenciesBlock.chunkGroup");
|
2016-07-13 17:03:14 +08:00
|
|
|
}
|
2018-01-20 00:06:59 +08:00
|
|
|
|
2017-01-09 04:07:41 +08:00
|
|
|
updateHash(hash) {
|
|
|
|
hash.update(this.chunkName || "");
|
2018-01-20 00:06:59 +08:00
|
|
|
hash.update(this.chunkGroup && this.chunkGroup.chunks.map(chunk => {
|
2017-03-23 20:40:13 +08:00
|
|
|
return chunk.id !== null ? chunk.id : "";
|
2017-01-10 05:21:40 +08:00
|
|
|
}).join(",") || "");
|
2017-01-09 04:07:41 +08:00
|
|
|
super.updateHash(hash);
|
|
|
|
}
|
2018-01-20 00:06:59 +08:00
|
|
|
|
2017-01-09 04:07:41 +08:00
|
|
|
disconnect() {
|
2018-01-20 00:06:59 +08:00
|
|
|
this.chunkGroup = undefined;
|
2017-01-09 04:07:41 +08:00
|
|
|
super.disconnect();
|
|
|
|
}
|
2018-01-20 00:06:59 +08:00
|
|
|
|
2017-01-09 04:07:41 +08:00
|
|
|
unseal() {
|
2018-01-20 00:06:59 +08:00
|
|
|
this.chunkGroup = undefined;
|
2017-01-09 04:07:41 +08:00
|
|
|
super.unseal();
|
|
|
|
}
|
2018-01-20 00:06:59 +08:00
|
|
|
|
2017-01-09 04:07:41 +08:00
|
|
|
sortItems() {
|
|
|
|
super.sortItems();
|
|
|
|
}
|
2017-01-26 08:02:33 +08:00
|
|
|
};
|