MCPcopy
hub / github.com/webpack/webpack / _restoreFromUnsafeCache

Method _restoreFromUnsafeCache

lib/NormalModule.js:1074–1084  ·  view source on GitHub ↗

* restore unsafe cache data * @param {UnsafeCacheData} unsafeCacheData data from getUnsafeCacheData * @param {NormalModuleFactory} normalModuleFactory the normal module factory handling the unsafe caching

(unsafeCacheData, normalModuleFactory)

Source from the content-addressed store, hash-verified

1072 * @param {NormalModuleFactory} normalModuleFactory the normal module factory handling the unsafe caching
1073 */
1074 _restoreFromUnsafeCache(unsafeCacheData, normalModuleFactory) {
1075 super._restoreFromUnsafeCache(unsafeCacheData, normalModuleFactory);
1076 this.parserOptions = unsafeCacheData.parserOptions;
1077 this.parser = normalModuleFactory.getParser(this.type, this.parserOptions);
1078 this.generatorOptions = unsafeCacheData.generatorOptions;
1079 this.generator = normalModuleFactory.getGenerator(
1080 this.type,
1081 this.generatorOptions
1082 );
1083 // we assume the generator behaves identically and keep cached sourceTypes/Sizes
1084 }
1085
1086 /**
1087 * @param {string} context the compilation context

Callers 1

Calls 2

getParserMethod · 0.80
getGeneratorMethod · 0.80

Tested by

no test coverage detected