(capturedDirectories)
| 2711 | * @param {ManagedContexts} capturedDirectories captured directories |
| 2712 | */ |
| 2713 | const processCapturedDirectories = (capturedDirectories) => { |
| 2714 | if (capturedDirectories.size === 0) { |
| 2715 | return; |
| 2716 | } |
| 2717 | switch (mode) { |
| 2718 | case 3: |
| 2719 | this._contextTshsOptimization.optimize(snapshot, capturedDirectories); |
| 2720 | for (const path of capturedDirectories) { |
| 2721 | const cache = this._contextTshs.get(path); |
| 2722 | /** @type {ResolvedContextTimestampAndHash | null | undefined} */ |
| 2723 | let resolved; |
| 2724 | if ( |
| 2725 | cache !== undefined && |
| 2726 | (resolved = getResolvedTimestamp(cache)) !== undefined |
| 2727 | ) { |
| 2728 | contextTshs.set(path, resolved); |
| 2729 | } else { |
| 2730 | jobs++; |
| 2731 | /** |
| 2732 | * Processes the provided err. |
| 2733 | * @param {(WebpackError | null)=} err error |
| 2734 | * @param {(ResolvedContextTimestampAndHash | null)=} entry entry |
| 2735 | * @returns {void} |
| 2736 | */ |
| 2737 | const callback = (err, entry) => { |
| 2738 | if (err) { |
| 2739 | if (this.logger) { |
| 2740 | this.logger.debug( |
| 2741 | `Error snapshotting context timestamp hash combination of ${path}: ${err.stack}` |
| 2742 | ); |
| 2743 | } |
| 2744 | jobError(); |
| 2745 | } else { |
| 2746 | contextTshs.set( |
| 2747 | path, |
| 2748 | /** @type {ResolvedContextTimestampAndHash | null} */ |
| 2749 | (entry) |
| 2750 | ); |
| 2751 | jobDone(); |
| 2752 | } |
| 2753 | }; |
| 2754 | if (cache !== undefined) { |
| 2755 | this._resolveContextTsh(cache, callback); |
| 2756 | } else { |
| 2757 | this.getContextTsh(path, callback); |
| 2758 | } |
| 2759 | } |
| 2760 | } |
| 2761 | break; |
| 2762 | case 2: |
| 2763 | this._contextHashesOptimization.optimize( |
| 2764 | snapshot, |
| 2765 | capturedDirectories |
| 2766 | ); |
| 2767 | for (const path of capturedDirectories) { |
| 2768 | const cache = this._contextHashes.get(path); |
| 2769 | /** @type {undefined | null | string} */ |
| 2770 | let resolved; |
nothing calls this directly
no test coverage detected