()
| 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) |
nothing calls this directly
no test coverage detected