MCPcopy
hub / github.com/webpack/webpack / updateHash

Method updateHash

lib/Module.js:968–987  ·  view source on GitHub ↗

* Updates the hash with the data contributed by this instance. * @param {Hash} hash the hash used to track dependencies * @param {UpdateHashContext} context context * @returns {void}

(
		hash,
		context = {
			chunkGraph: ChunkGraph.getChunkGraphForModule(
				this,
				"Module.updateHash",
				"DEP_WEBPACK_MODULE_UPDATE_HASH"
			),
			runtime: undefined
		}
	)

Source from the content-addressed store, hash-verified

966 * @returns {void}
967 */
968 updateHash(
969 hash,
970 context = {
971 chunkGraph: ChunkGraph.getChunkGraphForModule(
972 this,
973 "Module.updateHash",
974 "DEP_WEBPACK_MODULE_UPDATE_HASH"
975 ),
976 runtime: undefined
977 }
978 ) {
979 const { chunkGraph, runtime } = context;
980 hash.update(chunkGraph.getModuleGraphHash(this, runtime));
981 if (this.presentationalDependencies !== undefined) {
982 for (const dep of this.presentationalDependencies) {
983 dep.updateHash(hash, context);
984 }
985 }
986 super.updateHash(hash, context);
987 }
988
989 /**
990 * Invalidates the cached state associated with this value.

Callers

nothing calls this directly

Calls 3

getModuleGraphHashMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected