MCPcopy
hub / github.com/webpack/webpack / jobDone

Method jobDone

lib/FileSystemInfo.js:2498–2544  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2496
2497 let jobs = 1;
2498 const jobDone = () => {
2499 if (--jobs === 0) {
2500 if (fileTimestamps.size !== 0) {
2501 snapshot.setFileTimestamps(fileTimestamps);
2502 }
2503 if (fileHashes.size !== 0) {
2504 snapshot.setFileHashes(fileHashes);
2505 }
2506 if (fileTshs.size !== 0) {
2507 snapshot.setFileTshs(fileTshs);
2508 }
2509 if (contextTimestamps.size !== 0) {
2510 snapshot.setContextTimestamps(contextTimestamps);
2511 }
2512 if (contextHashes.size !== 0) {
2513 snapshot.setContextHashes(contextHashes);
2514 }
2515 if (contextTshs.size !== 0) {
2516 snapshot.setContextTshs(contextTshs);
2517 }
2518 if (missingExistence.size !== 0) {
2519 snapshot.setMissingExistence(missingExistence);
2520 }
2521 if (managedItemInfo.size !== 0) {
2522 snapshot.setManagedItemInfo(managedItemInfo);
2523 }
2524 this._managedFilesOptimization.optimize(snapshot, managedFiles);
2525 if (managedFiles.size !== 0) {
2526 snapshot.setManagedFiles(managedFiles);
2527 }
2528 this._managedContextsOptimization.optimize(snapshot, managedContexts);
2529 if (managedContexts.size !== 0) {
2530 snapshot.setManagedContexts(managedContexts);
2531 }
2532 this._managedMissingOptimization.optimize(snapshot, managedMissing);
2533 if (managedMissing.size !== 0) {
2534 snapshot.setManagedMissing(managedMissing);
2535 }
2536 if (children.size !== 0) {
2537 snapshot.setChildren(children);
2538 }
2539 this._snapshotCache.set(snapshot, true);
2540 this._statCreatedSnapshots++;
2541
2542 callback(null, snapshot);
2543 }
2544 };
2545 const jobError = () => {
2546 if (jobs > 0) {
2547 // large negative number instead of NaN or something else to keep jobs to stay a SMI (v8)

Callers

nothing calls this directly

Calls 15

setFileTimestampsMethod · 0.80
setFileHashesMethod · 0.80
setFileTshsMethod · 0.80
setContextTimestampsMethod · 0.80
setContextHashesMethod · 0.80
setContextTshsMethod · 0.80
setMissingExistenceMethod · 0.80
setManagedItemInfoMethod · 0.80
optimizeMethod · 0.80
setManagedFilesMethod · 0.80
setManagedContextsMethod · 0.80
setManagedMissingMethod · 0.80

Tested by

no test coverage detected