* Processes the provided error callback. * @param {ErrorCallback} callback signals when the compiler closes * @returns {void}
(callback)
| 1463 | * @returns {void} |
| 1464 | */ |
| 1465 | close(callback) { |
| 1466 | if (this.watching) { |
| 1467 | // When there is still an active watching, close this first |
| 1468 | this.watching.close((_err) => { |
| 1469 | this.close(callback); |
| 1470 | }); |
| 1471 | return; |
| 1472 | } |
| 1473 | this.hooks.shutdown.callAsync((err) => { |
| 1474 | if (err) return callback(err); |
| 1475 | // Defer a microtask so a close() made inside the run callback can't |
| 1476 | // release codeGenerationResults before afterDone fires on the same stack. |
| 1477 | const lastCompilation = this._lastCompilation; |
| 1478 | if (lastCompilation !== undefined) { |
| 1479 | Promise.resolve().then(() => { |
| 1480 | this._releaseUnusedCompilationData(lastCompilation); |
| 1481 | }); |
| 1482 | } |
| 1483 | this._lastCompilation = undefined; |
| 1484 | this._lastNormalModuleFactory = undefined; |
| 1485 | this.cache.shutdown(callback); |
| 1486 | }); |
| 1487 | } |
| 1488 | |
| 1489 | /** |
| 1490 | * Schema validation function with optional pre-compiled check |
nothing calls this directly
no test coverage detected