| 119401 | ts.emitSkippedWithNoDiagnostics = { diagnostics: ts.emptyArray, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; |
| 119402 | /*@internal*/ |
| 119403 | function handleNoEmitOptions(program, sourceFile, writeFile, cancellationToken) { |
| 119404 | var options = program.getCompilerOptions(); |
| 119405 | if (options.noEmit) { |
| 119406 | // Cache the semantic diagnostics |
| 119407 | program.getSemanticDiagnostics(sourceFile, cancellationToken); |
| 119408 | return sourceFile || ts.outFile(options) ? |
| 119409 | ts.emitSkippedWithNoDiagnostics : |
| 119410 | program.emitBuildInfo(writeFile, cancellationToken); |
| 119411 | } |
| 119412 | // If the noEmitOnError flag is set, then check if we have any errors so far. If so, |
| 119413 | // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we |
| 119414 | // get any preEmit diagnostics, not just the ones |
| 119415 | if (!options.noEmitOnError) |
| 119416 | return undefined; |
| 119417 | var diagnostics = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], program.getOptionsDiagnostics(cancellationToken), true), program.getSyntacticDiagnostics(sourceFile, cancellationToken), true), program.getGlobalDiagnostics(cancellationToken), true), program.getSemanticDiagnostics(sourceFile, cancellationToken), true); |
| 119418 | if (diagnostics.length === 0 && ts.getEmitDeclarations(program.getCompilerOptions())) { |
| 119419 | diagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken); |
| 119420 | } |
| 119421 | if (!diagnostics.length) |
| 119422 | return undefined; |
| 119423 | var emittedFiles; |
| 119424 | if (!sourceFile && !ts.outFile(options)) { |
| 119425 | var emitResult = program.emitBuildInfo(writeFile, cancellationToken); |
| 119426 | if (emitResult.diagnostics) |
| 119427 | diagnostics = __spreadArray(__spreadArray([], diagnostics, true), emitResult.diagnostics, true); |
| 119428 | emittedFiles = emitResult.emittedFiles; |
| 119429 | } |
| 119430 | return { diagnostics: diagnostics, sourceMaps: undefined, emittedFiles: emittedFiles, emitSkipped: true }; |
| 119431 | } |
| 119432 | ts.handleNoEmitOptions = handleNoEmitOptions; |
| 119433 | /*@internal*/ |
| 119434 | function filterSemanticDiagnostics(diagnostic, option) { |