MCPcopy
hub / github.com/webpack/webpack / onDependenciesSorted

Method onDependenciesSorted

lib/Compilation.js:1841–1871  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

1839 * @returns {void}
1840 */
1841 const onDependenciesSorted = (err) => {
1842 if (err) return callback(err);
1843
1844 // early exit without changing parallelism back and forth
1845 if (sortedDependencies.length === 0 && inProgressTransitive === 1) {
1846 return callback();
1847 }
1848
1849 // This is nested so we need to allow one additional task
1850 this.processDependenciesQueue.increaseParallelism();
1851
1852 for (const item of sortedDependencies) {
1853 inProgressTransitive++;
1854 // eslint-disable-next-line no-loop-func
1855 this.handleModuleCreation(item, (err) => {
1856 // In V8, the Error objects keep a reference to the functions on the stack. These warnings &
1857 // errors are created inside closures that keep a reference to the Compilation, so errors are
1858 // leaking the Compilation object.
1859 if (err && this.bail) {
1860 if (inProgressTransitive <= 0) return;
1861 inProgressTransitive = -1;
1862 // eslint-disable-next-line no-self-assign
1863 err.stack = err.stack;
1864 onTransitiveTasksFinished(err);
1865 return;
1866 }
1867 if (--inProgressTransitive === 0) onTransitiveTasksFinished();
1868 });
1869 }
1870 if (--inProgressTransitive === 0) onTransitiveTasksFinished();
1871 };
1872
1873 /**
1874 * On transitive tasks finished.

Callers

nothing calls this directly

Calls 3

handleModuleCreationMethod · 0.95
increaseParallelismMethod · 0.80
callbackFunction · 0.50

Tested by

no test coverage detected