[6a3a178] | 1 | /**
|
---|
| 2 | * @license
|
---|
| 3 | * Copyright Google LLC All Rights Reserved.
|
---|
| 4 | *
|
---|
| 5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
| 6 | * found in the LICENSE file at https://angular.io/license
|
---|
| 7 | */
|
---|
| 8 | (function (factory) {
|
---|
| 9 | if (typeof module === "object" && typeof module.exports === "object") {
|
---|
| 10 | var v = factory(require, exports);
|
---|
| 11 | if (v !== undefined) module.exports = v;
|
---|
| 12 | }
|
---|
| 13 | else if (typeof define === "function" && define.amd) {
|
---|
| 14 | define("@angular/compiler-cli/src/ngtsc/program", ["require", "exports", "tslib", "@angular/compiler", "typescript", "@angular/compiler-cli/src/transformers/api", "@angular/compiler-cli/src/transformers/i18n", "@angular/compiler-cli/src/typescript_support", "@angular/compiler-cli/src/ngtsc/core", "@angular/compiler-cli/src/ngtsc/file_system", "@angular/compiler-cli/src/ngtsc/incremental", "@angular/compiler-cli/src/ngtsc/perf", "@angular/compiler-cli/src/ngtsc/program_driver", "@angular/compiler-cli/src/ngtsc/shims", "@angular/compiler-cli/src/ngtsc/typecheck/api"], factory);
|
---|
| 15 | }
|
---|
| 16 | })(function (require, exports) {
|
---|
| 17 | "use strict";
|
---|
| 18 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 19 | exports.NgtscProgram = void 0;
|
---|
| 20 | var tslib_1 = require("tslib");
|
---|
| 21 | var compiler_1 = require("@angular/compiler");
|
---|
| 22 | var ts = require("typescript");
|
---|
| 23 | var api = require("@angular/compiler-cli/src/transformers/api");
|
---|
| 24 | var i18n_1 = require("@angular/compiler-cli/src/transformers/i18n");
|
---|
| 25 | var typescript_support_1 = require("@angular/compiler-cli/src/typescript_support");
|
---|
| 26 | var core_1 = require("@angular/compiler-cli/src/ngtsc/core");
|
---|
| 27 | var file_system_1 = require("@angular/compiler-cli/src/ngtsc/file_system");
|
---|
| 28 | var incremental_1 = require("@angular/compiler-cli/src/ngtsc/incremental");
|
---|
| 29 | var perf_1 = require("@angular/compiler-cli/src/ngtsc/perf");
|
---|
| 30 | var program_driver_1 = require("@angular/compiler-cli/src/ngtsc/program_driver");
|
---|
| 31 | var shims_1 = require("@angular/compiler-cli/src/ngtsc/shims");
|
---|
| 32 | var api_1 = require("@angular/compiler-cli/src/ngtsc/typecheck/api");
|
---|
| 33 | /**
|
---|
| 34 | * Entrypoint to the Angular Compiler (Ivy+) which sits behind the `api.Program` interface, allowing
|
---|
| 35 | * it to be a drop-in replacement for the legacy View Engine compiler to tooling such as the
|
---|
| 36 | * command-line main() function or the Angular CLI.
|
---|
| 37 | */
|
---|
| 38 | var NgtscProgram = /** @class */ (function () {
|
---|
| 39 | function NgtscProgram(rootNames, options, delegateHost, oldProgram) {
|
---|
| 40 | var e_1, _a;
|
---|
| 41 | var _this = this;
|
---|
| 42 | this.options = options;
|
---|
| 43 | var perfRecorder = perf_1.ActivePerfRecorder.zeroedToNow();
|
---|
| 44 | perfRecorder.phase(perf_1.PerfPhase.Setup);
|
---|
| 45 | // First, check whether the current TS version is supported.
|
---|
| 46 | if (!options.disableTypeScriptVersionCheck) {
|
---|
| 47 | typescript_support_1.verifySupportedTypeScriptVersion();
|
---|
| 48 | }
|
---|
| 49 | var reuseProgram = oldProgram === null || oldProgram === void 0 ? void 0 : oldProgram.compiler.getCurrentProgram();
|
---|
| 50 | this.host = core_1.NgCompilerHost.wrap(delegateHost, rootNames, options, reuseProgram !== null && reuseProgram !== void 0 ? reuseProgram : null);
|
---|
| 51 | if (reuseProgram !== undefined) {
|
---|
| 52 | // Prior to reusing the old program, restore shim tagging for all its `ts.SourceFile`s.
|
---|
| 53 | // TypeScript checks the `referencedFiles` of `ts.SourceFile`s for changes when evaluating
|
---|
| 54 | // incremental reuse of data from the old program, so it's important that these match in order
|
---|
| 55 | // to get the most benefit out of reuse.
|
---|
| 56 | shims_1.retagAllTsFiles(reuseProgram);
|
---|
| 57 | }
|
---|
| 58 | this.tsProgram = perfRecorder.inPhase(perf_1.PerfPhase.TypeScriptProgramCreate, function () { return ts.createProgram(_this.host.inputFiles, options, _this.host, reuseProgram); });
|
---|
| 59 | perfRecorder.phase(perf_1.PerfPhase.Unaccounted);
|
---|
| 60 | perfRecorder.memory(perf_1.PerfCheckpoint.TypeScriptProgramCreate);
|
---|
| 61 | this.host.postProgramCreationCleanup();
|
---|
| 62 | // Shim tagging has served its purpose, and tags can now be removed from all `ts.SourceFile`s in
|
---|
| 63 | // the program.
|
---|
| 64 | shims_1.untagAllTsFiles(this.tsProgram);
|
---|
| 65 | var programDriver = new program_driver_1.TsCreateProgramDriver(this.tsProgram, this.host, this.options, this.host.shimExtensionPrefixes);
|
---|
| 66 | this.incrementalStrategy = oldProgram !== undefined ?
|
---|
| 67 | oldProgram.incrementalStrategy.toNextBuildStrategy() :
|
---|
| 68 | new incremental_1.TrackedIncrementalBuildStrategy();
|
---|
| 69 | var modifiedResourceFiles = new Set();
|
---|
| 70 | if (this.host.getModifiedResourceFiles !== undefined) {
|
---|
| 71 | var strings = this.host.getModifiedResourceFiles();
|
---|
| 72 | if (strings !== undefined) {
|
---|
| 73 | try {
|
---|
| 74 | for (var strings_1 = tslib_1.__values(strings), strings_1_1 = strings_1.next(); !strings_1_1.done; strings_1_1 = strings_1.next()) {
|
---|
| 75 | var fileString = strings_1_1.value;
|
---|
| 76 | modifiedResourceFiles.add(file_system_1.absoluteFrom(fileString));
|
---|
| 77 | }
|
---|
| 78 | }
|
---|
| 79 | catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
---|
| 80 | finally {
|
---|
| 81 | try {
|
---|
| 82 | if (strings_1_1 && !strings_1_1.done && (_a = strings_1.return)) _a.call(strings_1);
|
---|
| 83 | }
|
---|
| 84 | finally { if (e_1) throw e_1.error; }
|
---|
| 85 | }
|
---|
| 86 | }
|
---|
| 87 | }
|
---|
| 88 | var ticket;
|
---|
| 89 | if (oldProgram === undefined) {
|
---|
| 90 | ticket = core_1.freshCompilationTicket(this.tsProgram, options, this.incrementalStrategy, programDriver, perfRecorder,
|
---|
| 91 | /* enableTemplateTypeChecker */ false, /* usePoisonedData */ false);
|
---|
| 92 | }
|
---|
| 93 | else {
|
---|
| 94 | ticket = core_1.incrementalFromCompilerTicket(oldProgram.compiler, this.tsProgram, this.incrementalStrategy, programDriver, modifiedResourceFiles, perfRecorder);
|
---|
| 95 | }
|
---|
| 96 | // Create the NgCompiler which will drive the rest of the compilation.
|
---|
| 97 | this.compiler = core_1.NgCompiler.fromTicket(ticket, this.host);
|
---|
| 98 | }
|
---|
| 99 | NgtscProgram.prototype.getTsProgram = function () {
|
---|
| 100 | return this.tsProgram;
|
---|
| 101 | };
|
---|
| 102 | NgtscProgram.prototype.getReuseTsProgram = function () {
|
---|
| 103 | return this.compiler.getCurrentProgram();
|
---|
| 104 | };
|
---|
| 105 | NgtscProgram.prototype.getTsOptionDiagnostics = function (cancellationToken) {
|
---|
| 106 | var _this = this;
|
---|
| 107 | return this.compiler.perfRecorder.inPhase(perf_1.PerfPhase.TypeScriptDiagnostics, function () { return _this.tsProgram.getOptionsDiagnostics(cancellationToken); });
|
---|
| 108 | };
|
---|
| 109 | NgtscProgram.prototype.getTsSyntacticDiagnostics = function (sourceFile, cancellationToken) {
|
---|
| 110 | var _this = this;
|
---|
| 111 | return this.compiler.perfRecorder.inPhase(perf_1.PerfPhase.TypeScriptDiagnostics, function () {
|
---|
| 112 | var e_2, _a;
|
---|
| 113 | var ignoredFiles = _this.compiler.ignoreForDiagnostics;
|
---|
| 114 | var res;
|
---|
| 115 | if (sourceFile !== undefined) {
|
---|
| 116 | if (ignoredFiles.has(sourceFile)) {
|
---|
| 117 | return [];
|
---|
| 118 | }
|
---|
| 119 | res = _this.tsProgram.getSyntacticDiagnostics(sourceFile, cancellationToken);
|
---|
| 120 | }
|
---|
| 121 | else {
|
---|
| 122 | var diagnostics = [];
|
---|
| 123 | try {
|
---|
| 124 | for (var _b = tslib_1.__values(_this.tsProgram.getSourceFiles()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
---|
| 125 | var sf = _c.value;
|
---|
| 126 | if (!ignoredFiles.has(sf)) {
|
---|
| 127 | diagnostics.push.apply(diagnostics, tslib_1.__spreadArray([], tslib_1.__read(_this.tsProgram.getSyntacticDiagnostics(sf, cancellationToken))));
|
---|
| 128 | }
|
---|
| 129 | }
|
---|
| 130 | }
|
---|
| 131 | catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
---|
| 132 | finally {
|
---|
| 133 | try {
|
---|
| 134 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
---|
| 135 | }
|
---|
| 136 | finally { if (e_2) throw e_2.error; }
|
---|
| 137 | }
|
---|
| 138 | res = diagnostics;
|
---|
| 139 | }
|
---|
| 140 | return res;
|
---|
| 141 | });
|
---|
| 142 | };
|
---|
| 143 | NgtscProgram.prototype.getTsSemanticDiagnostics = function (sourceFile, cancellationToken) {
|
---|
| 144 | var _this = this;
|
---|
| 145 | return this.compiler.perfRecorder.inPhase(perf_1.PerfPhase.TypeScriptDiagnostics, function () {
|
---|
| 146 | var e_3, _a;
|
---|
| 147 | var ignoredFiles = _this.compiler.ignoreForDiagnostics;
|
---|
| 148 | var res;
|
---|
| 149 | if (sourceFile !== undefined) {
|
---|
| 150 | if (ignoredFiles.has(sourceFile)) {
|
---|
| 151 | return [];
|
---|
| 152 | }
|
---|
| 153 | res = _this.tsProgram.getSemanticDiagnostics(sourceFile, cancellationToken);
|
---|
| 154 | }
|
---|
| 155 | else {
|
---|
| 156 | var diagnostics = [];
|
---|
| 157 | try {
|
---|
| 158 | for (var _b = tslib_1.__values(_this.tsProgram.getSourceFiles()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
---|
| 159 | var sf = _c.value;
|
---|
| 160 | if (!ignoredFiles.has(sf)) {
|
---|
| 161 | diagnostics.push.apply(diagnostics, tslib_1.__spreadArray([], tslib_1.__read(_this.tsProgram.getSemanticDiagnostics(sf, cancellationToken))));
|
---|
| 162 | }
|
---|
| 163 | }
|
---|
| 164 | }
|
---|
| 165 | catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
---|
| 166 | finally {
|
---|
| 167 | try {
|
---|
| 168 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
---|
| 169 | }
|
---|
| 170 | finally { if (e_3) throw e_3.error; }
|
---|
| 171 | }
|
---|
| 172 | res = diagnostics;
|
---|
| 173 | }
|
---|
| 174 | return res;
|
---|
| 175 | });
|
---|
| 176 | };
|
---|
| 177 | NgtscProgram.prototype.getNgOptionDiagnostics = function (cancellationToken) {
|
---|
| 178 | return this.compiler.getOptionDiagnostics();
|
---|
| 179 | };
|
---|
| 180 | NgtscProgram.prototype.getNgStructuralDiagnostics = function (cancellationToken) {
|
---|
| 181 | return [];
|
---|
| 182 | };
|
---|
| 183 | NgtscProgram.prototype.getNgSemanticDiagnostics = function (fileName, cancellationToken) {
|
---|
| 184 | var sf = undefined;
|
---|
| 185 | if (fileName !== undefined) {
|
---|
| 186 | sf = this.tsProgram.getSourceFile(fileName);
|
---|
| 187 | if (sf === undefined) {
|
---|
| 188 | // There are no diagnostics for files which don't exist in the program - maybe the caller
|
---|
| 189 | // has stale data?
|
---|
| 190 | return [];
|
---|
| 191 | }
|
---|
| 192 | }
|
---|
| 193 | if (sf === undefined) {
|
---|
| 194 | return this.compiler.getDiagnostics();
|
---|
| 195 | }
|
---|
| 196 | else {
|
---|
| 197 | return this.compiler.getDiagnosticsForFile(sf, api_1.OptimizeFor.WholeProgram);
|
---|
| 198 | }
|
---|
| 199 | };
|
---|
| 200 | /**
|
---|
| 201 | * Ensure that the `NgCompiler` has properly analyzed the program, and allow for the asynchronous
|
---|
| 202 | * loading of any resources during the process.
|
---|
| 203 | *
|
---|
| 204 | * This is used by the Angular CLI to allow for spawning (async) child compilations for things
|
---|
| 205 | * like SASS files used in `styleUrls`.
|
---|
| 206 | */
|
---|
| 207 | NgtscProgram.prototype.loadNgStructureAsync = function () {
|
---|
| 208 | return this.compiler.analyzeAsync();
|
---|
| 209 | };
|
---|
| 210 | NgtscProgram.prototype.listLazyRoutes = function (entryRoute) {
|
---|
| 211 | return this.compiler.listLazyRoutes(entryRoute);
|
---|
| 212 | };
|
---|
| 213 | NgtscProgram.prototype.emitXi18n = function () {
|
---|
| 214 | var _a, _b, _c;
|
---|
| 215 | var ctx = new compiler_1.MessageBundle(new compiler_1.HtmlParser(), [], {}, (_a = this.options.i18nOutLocale) !== null && _a !== void 0 ? _a : null);
|
---|
| 216 | this.compiler.xi18n(ctx);
|
---|
| 217 | i18n_1.i18nExtract((_b = this.options.i18nOutFormat) !== null && _b !== void 0 ? _b : null, (_c = this.options.i18nOutFile) !== null && _c !== void 0 ? _c : null, this.host, this.options, ctx, file_system_1.resolve);
|
---|
| 218 | };
|
---|
| 219 | NgtscProgram.prototype.emit = function (opts) {
|
---|
| 220 | var _this = this;
|
---|
| 221 | // Check if emission of the i18n messages bundle was requested.
|
---|
| 222 | if (opts !== undefined && opts.emitFlags !== undefined &&
|
---|
| 223 | opts.emitFlags & api.EmitFlags.I18nBundle) {
|
---|
| 224 | this.emitXi18n();
|
---|
| 225 | // `api.EmitFlags` is a View Engine compiler concept. We only pay attention to the absence of
|
---|
| 226 | // the other flags here if i18n emit was requested (since this is usually done in the xi18n
|
---|
| 227 | // flow, where we don't want to emit JS at all).
|
---|
| 228 | if (!(opts.emitFlags & api.EmitFlags.JS)) {
|
---|
| 229 | return {
|
---|
| 230 | diagnostics: [],
|
---|
| 231 | emitSkipped: true,
|
---|
| 232 | emittedFiles: [],
|
---|
| 233 | };
|
---|
| 234 | }
|
---|
| 235 | }
|
---|
| 236 | this.compiler.perfRecorder.memory(perf_1.PerfCheckpoint.PreEmit);
|
---|
| 237 | var res = this.compiler.perfRecorder.inPhase(perf_1.PerfPhase.TypeScriptEmit, function () {
|
---|
| 238 | var e_4, _a;
|
---|
| 239 | var transformers = _this.compiler.prepareEmit().transformers;
|
---|
| 240 | var ignoreFiles = _this.compiler.ignoreForEmit;
|
---|
| 241 | var emitCallback = opts && opts.emitCallback || defaultEmitCallback;
|
---|
| 242 | var writeFile = function (fileName, data, writeByteOrderMark, onError, sourceFiles) {
|
---|
| 243 | var e_5, _a;
|
---|
| 244 | if (sourceFiles !== undefined) {
|
---|
| 245 | try {
|
---|
| 246 | // Record successful writes for any `ts.SourceFile` (that's not a declaration file)
|
---|
| 247 | // that's an input to this write.
|
---|
| 248 | for (var sourceFiles_1 = tslib_1.__values(sourceFiles), sourceFiles_1_1 = sourceFiles_1.next(); !sourceFiles_1_1.done; sourceFiles_1_1 = sourceFiles_1.next()) {
|
---|
| 249 | var writtenSf = sourceFiles_1_1.value;
|
---|
| 250 | if (writtenSf.isDeclarationFile) {
|
---|
| 251 | continue;
|
---|
| 252 | }
|
---|
| 253 | _this.compiler.incrementalCompilation.recordSuccessfulEmit(writtenSf);
|
---|
| 254 | }
|
---|
| 255 | }
|
---|
| 256 | catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
---|
| 257 | finally {
|
---|
| 258 | try {
|
---|
| 259 | if (sourceFiles_1_1 && !sourceFiles_1_1.done && (_a = sourceFiles_1.return)) _a.call(sourceFiles_1);
|
---|
| 260 | }
|
---|
| 261 | finally { if (e_5) throw e_5.error; }
|
---|
| 262 | }
|
---|
| 263 | }
|
---|
| 264 | _this.host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles);
|
---|
| 265 | };
|
---|
| 266 | var customTransforms = opts && opts.customTransformers;
|
---|
| 267 | var beforeTransforms = transformers.before || [];
|
---|
| 268 | var afterDeclarationsTransforms = transformers.afterDeclarations;
|
---|
| 269 | if (customTransforms !== undefined && customTransforms.beforeTs !== undefined) {
|
---|
| 270 | beforeTransforms.push.apply(beforeTransforms, tslib_1.__spreadArray([], tslib_1.__read(customTransforms.beforeTs)));
|
---|
| 271 | }
|
---|
| 272 | var emitResults = [];
|
---|
| 273 | try {
|
---|
| 274 | for (var _b = tslib_1.__values(_this.tsProgram.getSourceFiles()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
---|
| 275 | var targetSourceFile = _c.value;
|
---|
| 276 | if (targetSourceFile.isDeclarationFile || ignoreFiles.has(targetSourceFile)) {
|
---|
| 277 | continue;
|
---|
| 278 | }
|
---|
| 279 | if (_this.compiler.incrementalCompilation.safeToSkipEmit(targetSourceFile)) {
|
---|
| 280 | _this.compiler.perfRecorder.eventCount(perf_1.PerfEvent.EmitSkipSourceFile);
|
---|
| 281 | continue;
|
---|
| 282 | }
|
---|
| 283 | _this.compiler.perfRecorder.eventCount(perf_1.PerfEvent.EmitSourceFile);
|
---|
| 284 | emitResults.push(emitCallback({
|
---|
| 285 | targetSourceFile: targetSourceFile,
|
---|
| 286 | program: _this.tsProgram,
|
---|
| 287 | host: _this.host,
|
---|
| 288 | options: _this.options,
|
---|
| 289 | emitOnlyDtsFiles: false,
|
---|
| 290 | writeFile: writeFile,
|
---|
| 291 | customTransformers: {
|
---|
| 292 | before: beforeTransforms,
|
---|
| 293 | after: customTransforms && customTransforms.afterTs,
|
---|
| 294 | afterDeclarations: afterDeclarationsTransforms,
|
---|
| 295 | },
|
---|
| 296 | }));
|
---|
| 297 | }
|
---|
| 298 | }
|
---|
| 299 | catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
---|
| 300 | finally {
|
---|
| 301 | try {
|
---|
| 302 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
---|
| 303 | }
|
---|
| 304 | finally { if (e_4) throw e_4.error; }
|
---|
| 305 | }
|
---|
| 306 | _this.compiler.perfRecorder.memory(perf_1.PerfCheckpoint.Emit);
|
---|
| 307 | // Run the emit, including a custom transformer that will downlevel the Ivy decorators in
|
---|
| 308 | // code.
|
---|
| 309 | return ((opts && opts.mergeEmitResultsCallback) || mergeEmitResults)(emitResults);
|
---|
| 310 | });
|
---|
| 311 | // Record performance analysis information to disk if we've been asked to do so.
|
---|
| 312 | if (this.options.tracePerformance !== undefined) {
|
---|
| 313 | var perf = this.compiler.perfRecorder.finalize();
|
---|
| 314 | file_system_1.getFileSystem().writeFile(file_system_1.getFileSystem().resolve(this.options.tracePerformance), JSON.stringify(perf, null, 2));
|
---|
| 315 | }
|
---|
| 316 | return res;
|
---|
| 317 | };
|
---|
| 318 | NgtscProgram.prototype.getIndexedComponents = function () {
|
---|
| 319 | return this.compiler.getIndexedComponents();
|
---|
| 320 | };
|
---|
| 321 | NgtscProgram.prototype.getLibrarySummaries = function () {
|
---|
| 322 | throw new Error('Method not implemented.');
|
---|
| 323 | };
|
---|
| 324 | NgtscProgram.prototype.getEmittedGeneratedFiles = function () {
|
---|
| 325 | throw new Error('Method not implemented.');
|
---|
| 326 | };
|
---|
| 327 | NgtscProgram.prototype.getEmittedSourceFiles = function () {
|
---|
| 328 | throw new Error('Method not implemented.');
|
---|
| 329 | };
|
---|
| 330 | return NgtscProgram;
|
---|
| 331 | }());
|
---|
| 332 | exports.NgtscProgram = NgtscProgram;
|
---|
| 333 | var defaultEmitCallback = function (_a) {
|
---|
| 334 | var program = _a.program, targetSourceFile = _a.targetSourceFile, writeFile = _a.writeFile, cancellationToken = _a.cancellationToken, emitOnlyDtsFiles = _a.emitOnlyDtsFiles, customTransformers = _a.customTransformers;
|
---|
| 335 | return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers);
|
---|
| 336 | };
|
---|
| 337 | function mergeEmitResults(emitResults) {
|
---|
| 338 | var e_6, _a;
|
---|
| 339 | var diagnostics = [];
|
---|
| 340 | var emitSkipped = false;
|
---|
| 341 | var emittedFiles = [];
|
---|
| 342 | try {
|
---|
| 343 | for (var emitResults_1 = tslib_1.__values(emitResults), emitResults_1_1 = emitResults_1.next(); !emitResults_1_1.done; emitResults_1_1 = emitResults_1.next()) {
|
---|
| 344 | var er = emitResults_1_1.value;
|
---|
| 345 | diagnostics.push.apply(diagnostics, tslib_1.__spreadArray([], tslib_1.__read(er.diagnostics)));
|
---|
| 346 | emitSkipped = emitSkipped || er.emitSkipped;
|
---|
| 347 | emittedFiles.push.apply(emittedFiles, tslib_1.__spreadArray([], tslib_1.__read((er.emittedFiles || []))));
|
---|
| 348 | }
|
---|
| 349 | }
|
---|
| 350 | catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
---|
| 351 | finally {
|
---|
| 352 | try {
|
---|
| 353 | if (emitResults_1_1 && !emitResults_1_1.done && (_a = emitResults_1.return)) _a.call(emitResults_1);
|
---|
| 354 | }
|
---|
| 355 | finally { if (e_6) throw e_6.error; }
|
---|
| 356 | }
|
---|
| 357 | return { diagnostics: diagnostics, emitSkipped: emitSkipped, emittedFiles: emittedFiles };
|
---|
| 358 | }
|
---|
| 359 | });
|
---|
| 360 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZ3JhbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9zcmMvbmd0c2MvcHJvZ3JhbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7Ozs7O0lBRUgsOENBQTJFO0lBQzNFLCtCQUFpQztJQUVqQyxnRUFBMkM7SUFDM0Msb0VBQWlEO0lBQ2pELG1GQUF1RTtJQUV2RSw2REFBNEg7SUFFNUgsMkVBQW1GO0lBQ25GLDJFQUE4RDtJQUU5RCw2REFBa0c7SUFDbEcsaUZBQXVEO0lBRXZELCtEQUF5RDtJQUN6RCxxRUFBNEM7SUFFNUM7Ozs7T0FJRztJQUNIO1FBV0Usc0JBQ0ksU0FBZ0MsRUFBVSxPQUEwQixFQUNwRSxZQUE4QixFQUFFLFVBQXlCOztZQUY3RCxpQkF1RUM7WUF0RTZDLFlBQU8sR0FBUCxPQUFPLENBQW1CO1lBRXRFLElBQU0sWUFBWSxHQUFHLHlCQUFrQixDQUFDLFdBQVcsRUFBRSxDQUFDO1lBRXRELFlBQVksQ0FBQyxLQUFLLENBQUMsZ0JBQVMsQ0FBQyx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