@angular/compiler-cli 13.1.1 → 13.2.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/{chunk-TI3THPMZ.js → chunk-676MI6WZ.js} +39 -60
- package/bundles/chunk-676MI6WZ.js.map +6 -0
- package/bundles/{chunk-X46CEINM.js → chunk-7PY7XEFH.js} +9 -9
- package/bundles/chunk-7PY7XEFH.js.map +6 -0
- package/bundles/{chunk-AUFNJGZ6.js → chunk-A5PL3TE6.js} +9 -9
- package/bundles/chunk-A5PL3TE6.js.map +6 -0
- package/bundles/{chunk-PF3ZPGF5.js → chunk-ADHVDA4A.js} +12 -12
- package/bundles/{chunk-PF3ZPGF5.js.map → chunk-ADHVDA4A.js.map} +1 -1
- package/bundles/{chunk-J6CW3T62.js → chunk-GLCRIILX.js} +5 -5
- package/bundles/{chunk-J6CW3T62.js.map → chunk-GLCRIILX.js.map} +0 -0
- package/bundles/{chunk-FXVUPJ6A.js → chunk-L2JNRKLG.js} +358 -438
- package/bundles/chunk-L2JNRKLG.js.map +6 -0
- package/bundles/{chunk-P5ZW5MI4.js → chunk-L5DQYLOG.js} +505 -357
- package/bundles/chunk-L5DQYLOG.js.map +6 -0
- package/bundles/{chunk-DJRTTRF3.js → chunk-NU7DCJLY.js} +61 -63
- package/bundles/chunk-NU7DCJLY.js.map +6 -0
- package/bundles/{chunk-QFB4WK55.js → chunk-O4XVCXRT.js} +4 -4
- package/bundles/{chunk-QFB4WK55.js.map → chunk-O4XVCXRT.js.map} +0 -0
- package/bundles/{chunk-O5ZEI3UY.js → chunk-QBU7RUKB.js} +270 -100
- package/bundles/chunk-QBU7RUKB.js.map +6 -0
- package/bundles/{chunk-BPCUCINV.js → chunk-QDWL7SZJ.js} +2 -2
- package/bundles/{chunk-BPCUCINV.js.map → chunk-QDWL7SZJ.js.map} +0 -0
- package/bundles/{chunk-KWZNY2SK.js → chunk-QGM254OS.js} +96 -98
- package/bundles/chunk-QGM254OS.js.map +6 -0
- package/bundles/{chunk-JTYUTYS2.js → chunk-SKBLJA43.js} +3 -3
- package/bundles/{chunk-JTYUTYS2.js.map → chunk-SKBLJA43.js.map} +0 -0
- package/bundles/{chunk-OOIW53QX.js → chunk-UESD6FVI.js} +39 -41
- package/bundles/chunk-UESD6FVI.js.map +6 -0
- package/bundles/{chunk-XA5IZLLC.js → chunk-WQ3TNYTD.js} +6 -6
- package/bundles/{chunk-XA5IZLLC.js.map → chunk-WQ3TNYTD.js.map} +0 -0
- package/bundles/{chunk-W5CGOJQ4.js → chunk-ZWPDFY6U.js} +16 -20
- package/bundles/chunk-ZWPDFY6U.js.map +6 -0
- package/bundles/index.js +14 -14
- package/bundles/index.js.map +1 -1
- package/bundles/linker/babel/index.js +85 -85
- package/bundles/linker/babel/index.js.map +1 -1
- package/bundles/linker/index.js +5 -5
- package/bundles/ngcc/index.js +13 -13
- package/bundles/ngcc/main-ngcc.js +14 -14
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +14 -14
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +5 -5
- package/bundles/private/bazel.js +2 -2
- package/bundles/private/localize.js +4 -4
- package/bundles/private/migrations.js +6 -6
- package/bundles/private/tooling.js +3 -3
- package/bundles/src/bin/ng_xi18n.js +11 -11
- package/bundles/src/bin/ngc.js +11 -11
- package/bundles/src/bin/ngc.js.map +1 -1
- package/bundles_metadata.json +1 -1
- package/index.d.ts +2 -0
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/annotations/src/component.d.ts +2 -1
- package/src/ngtsc/annotations/src/util.d.ts +1 -1
- package/src/ngtsc/core/api/src/options.d.ts +3 -2
- package/src/ngtsc/core/api/src/public_options.d.ts +38 -0
- package/src/ngtsc/diagnostics/index.d.ts +2 -1
- package/src/ngtsc/diagnostics/src/error.d.ts +1 -0
- package/src/ngtsc/diagnostics/src/error_code.d.ts +7 -0
- package/src/ngtsc/diagnostics/src/error_details_base_url.d.ts +1 -1
- package/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.d.ts +21 -0
- package/src/ngtsc/file_system/src/compiler_host.d.ts +1 -0
- package/src/ngtsc/imports/index.d.ts +1 -1
- package/src/ngtsc/imports/src/emitter.d.ts +40 -8
- package/src/ngtsc/translator/src/translator.d.ts +0 -5
- package/src/ngtsc/translator/src/type_translator.d.ts +0 -2
- package/src/ngtsc/typecheck/extended/api/api.d.ts +30 -10
- package/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.d.ts +3 -14
- package/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.d.ts +3 -15
- package/src/ngtsc/typecheck/extended/index.d.ts +3 -0
- package/src/ngtsc/typecheck/extended/src/extended_template_checker.d.ts +5 -4
- package/src/ngtsc/typecheck/src/environment.d.ts +3 -1
- package/src/ngtsc/typecheck/src/tcb_util.d.ts +10 -2
- package/src/ngtsc/typecheck/src/type_constructor.d.ts +3 -2
- package/src/ngtsc/typecheck/src/type_emitter.d.ts +7 -21
- package/src/ngtsc/typecheck/src/type_parameter_emitter.d.ts +2 -2
- package/bundles/chunk-AUFNJGZ6.js.map +0 -6
- package/bundles/chunk-DJRTTRF3.js.map +0 -6
- package/bundles/chunk-FXVUPJ6A.js.map +0 -6
- package/bundles/chunk-KWZNY2SK.js.map +0 -6
- package/bundles/chunk-O5ZEI3UY.js.map +0 -6
- package/bundles/chunk-OOIW53QX.js.map +0 -6
- package/bundles/chunk-P5ZW5MI4.js.map +0 -6
- package/bundles/chunk-TI3THPMZ.js.map +0 -6
- package/bundles/chunk-W5CGOJQ4.js.map +0 -6
- package/bundles/chunk-X46CEINM.js.map +0 -6
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
const __ESM_IMPORT_META_URL__ = import.meta.url;
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
COMPILER_ERRORS_WITH_GUIDES,
|
|
8
7
|
CompilationMode,
|
|
9
8
|
ComponentDecoratorHandler,
|
|
10
9
|
CompoundMetadataReader,
|
|
@@ -12,8 +11,6 @@ import {
|
|
|
12
11
|
DirectiveDecoratorHandler,
|
|
13
12
|
DtsMetadataReader,
|
|
14
13
|
DtsTransformRegistry,
|
|
15
|
-
ERROR_DETAILS_PAGE_BASE_URL,
|
|
16
|
-
ErrorCode,
|
|
17
14
|
InjectableClassRegistry,
|
|
18
15
|
InjectableDecoratorHandler,
|
|
19
16
|
LocalMetadataRegistry,
|
|
@@ -27,20 +24,20 @@ import {
|
|
|
27
24
|
aliasTransformFactory,
|
|
28
25
|
declarationTransformFactory,
|
|
29
26
|
flattenInheritedDirectiveMetadata,
|
|
30
|
-
ivyTransformFactory
|
|
31
|
-
|
|
32
|
-
makeRelatedInformation,
|
|
33
|
-
ngErrorCode,
|
|
34
|
-
replaceTsWithNgInErrors
|
|
35
|
-
} from "./chunk-FXVUPJ6A.js";
|
|
27
|
+
ivyTransformFactory
|
|
28
|
+
} from "./chunk-L2JNRKLG.js";
|
|
36
29
|
import {
|
|
37
30
|
TypeScriptReflectionHost,
|
|
38
31
|
isNamedClassDeclaration
|
|
39
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-7PY7XEFH.js";
|
|
40
33
|
import {
|
|
41
34
|
AbsoluteModuleStrategy,
|
|
42
35
|
AliasStrategy,
|
|
36
|
+
COMPILER_ERRORS_WITH_GUIDES,
|
|
43
37
|
DefaultImportTracker,
|
|
38
|
+
ERROR_DETAILS_PAGE_BASE_URL,
|
|
39
|
+
ErrorCode,
|
|
40
|
+
ExtendedTemplateDiagnosticName,
|
|
44
41
|
ImportFlags,
|
|
45
42
|
ImportManager,
|
|
46
43
|
LocalIdentifierStrategy,
|
|
@@ -54,6 +51,7 @@ import {
|
|
|
54
51
|
RelativePathStrategy,
|
|
55
52
|
UnifiedModulesAliasingHost,
|
|
56
53
|
UnifiedModulesStrategy,
|
|
54
|
+
assertSuccessfulReferenceEmit,
|
|
57
55
|
getRootDirs,
|
|
58
56
|
getSourceFileOrNull,
|
|
59
57
|
getTokenAtPosition,
|
|
@@ -62,13 +60,17 @@ import {
|
|
|
62
60
|
isDtsPath,
|
|
63
61
|
isNonDeclarationTsPath,
|
|
64
62
|
isSymbolWithValueDeclaration,
|
|
63
|
+
makeDiagnostic,
|
|
64
|
+
makeRelatedInformation,
|
|
65
|
+
ngErrorCode,
|
|
65
66
|
nodeNameForError,
|
|
66
67
|
normalizeSeparators,
|
|
67
68
|
relativePathBetween,
|
|
69
|
+
replaceTsWithNgInErrors,
|
|
68
70
|
toUnredirectedSourceFile,
|
|
69
71
|
translateExpression,
|
|
70
72
|
translateType
|
|
71
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-QBU7RUKB.js";
|
|
72
74
|
import {
|
|
73
75
|
LogicalFileSystem,
|
|
74
76
|
absoluteFrom,
|
|
@@ -79,20 +81,20 @@ import {
|
|
|
79
81
|
getSourceFileOrError,
|
|
80
82
|
join,
|
|
81
83
|
resolve
|
|
82
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-676MI6WZ.js";
|
|
83
85
|
import {
|
|
84
86
|
ActivePerfRecorder,
|
|
85
87
|
DelegatingPerfRecorder,
|
|
86
88
|
PerfCheckpoint,
|
|
87
89
|
PerfEvent,
|
|
88
90
|
PerfPhase
|
|
89
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-GLCRIILX.js";
|
|
90
92
|
import {
|
|
91
93
|
__spreadProps,
|
|
92
94
|
__spreadValues
|
|
93
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-WQ3TNYTD.js";
|
|
94
96
|
|
|
95
|
-
// bazel-out/
|
|
97
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
96
98
|
var DEFAULT_ERROR_CODE = 100;
|
|
97
99
|
var UNKNOWN_ERROR_CODE = 500;
|
|
98
100
|
var SOURCE = "angular";
|
|
@@ -110,7 +112,7 @@ var EmitFlags;
|
|
|
110
112
|
EmitFlags2[EmitFlags2["All"] = 31] = "All";
|
|
111
113
|
})(EmitFlags || (EmitFlags = {}));
|
|
112
114
|
|
|
113
|
-
// bazel-out/
|
|
115
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/compiler_host.mjs
|
|
114
116
|
import ts from "typescript";
|
|
115
117
|
var wrapHostForTest = null;
|
|
116
118
|
function createCompilerHost({ options, tsHost = ts.createCompilerHost(options, true) }) {
|
|
@@ -120,21 +122,21 @@ function createCompilerHost({ options, tsHost = ts.createCompilerHost(options, t
|
|
|
120
122
|
return tsHost;
|
|
121
123
|
}
|
|
122
124
|
|
|
123
|
-
// bazel-out/
|
|
125
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/checker.mjs
|
|
124
126
|
var OptimizeFor;
|
|
125
127
|
(function(OptimizeFor2) {
|
|
126
128
|
OptimizeFor2[OptimizeFor2["SingleFile"] = 0] = "SingleFile";
|
|
127
129
|
OptimizeFor2[OptimizeFor2["WholeProgram"] = 1] = "WholeProgram";
|
|
128
130
|
})(OptimizeFor || (OptimizeFor = {}));
|
|
129
131
|
|
|
130
|
-
// bazel-out/
|
|
132
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/completion.mjs
|
|
131
133
|
var CompletionKind;
|
|
132
134
|
(function(CompletionKind2) {
|
|
133
135
|
CompletionKind2[CompletionKind2["Reference"] = 0] = "Reference";
|
|
134
136
|
CompletionKind2[CompletionKind2["Variable"] = 1] = "Variable";
|
|
135
137
|
})(CompletionKind || (CompletionKind = {}));
|
|
136
138
|
|
|
137
|
-
// bazel-out/
|
|
139
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/symbols.mjs
|
|
138
140
|
var SymbolKind;
|
|
139
141
|
(function(SymbolKind2) {
|
|
140
142
|
SymbolKind2[SymbolKind2["Input"] = 0] = "Input";
|
|
@@ -150,17 +152,13 @@ var SymbolKind;
|
|
|
150
152
|
SymbolKind2[SymbolKind2["Pipe"] = 10] = "Pipe";
|
|
151
153
|
})(SymbolKind || (SymbolKind = {}));
|
|
152
154
|
|
|
153
|
-
// bazel-out/
|
|
155
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
154
156
|
import { HtmlParser, MessageBundle } from "@angular/compiler";
|
|
155
|
-
import
|
|
157
|
+
import ts34 from "typescript";
|
|
156
158
|
|
|
157
|
-
// bazel-out/
|
|
159
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
|
|
158
160
|
import { Xliff, Xliff2, Xmb } from "@angular/compiler";
|
|
159
|
-
import
|
|
160
|
-
relative,
|
|
161
|
-
resolve as resolve2,
|
|
162
|
-
sep
|
|
163
|
-
} from "path";
|
|
161
|
+
import * as path from "path";
|
|
164
162
|
function i18nGetExtension(formatName) {
|
|
165
163
|
const format = formatName.toLowerCase();
|
|
166
164
|
switch (format) {
|
|
@@ -175,7 +173,7 @@ function i18nGetExtension(formatName) {
|
|
|
175
173
|
}
|
|
176
174
|
throw new Error(`Unsupported format "${formatName}"`);
|
|
177
175
|
}
|
|
178
|
-
function i18nExtract(formatName, outFile, host, options, bundle, pathResolve =
|
|
176
|
+
function i18nExtract(formatName, outFile, host, options, bundle, pathResolve = path.resolve) {
|
|
179
177
|
formatName = formatName || "xlf";
|
|
180
178
|
const ext = i18nGetExtension(formatName);
|
|
181
179
|
const content = i18nSerialize(bundle, formatName, options);
|
|
@@ -204,15 +202,15 @@ function i18nSerialize(bundle, formatName, options) {
|
|
|
204
202
|
}
|
|
205
203
|
function getPathNormalizer(basePath) {
|
|
206
204
|
return (sourcePath) => {
|
|
207
|
-
sourcePath = basePath ? relative(basePath, sourcePath) : sourcePath;
|
|
208
|
-
return sourcePath.split(sep).join("/");
|
|
205
|
+
sourcePath = basePath ? path.relative(basePath, sourcePath) : sourcePath;
|
|
206
|
+
return sourcePath.split(path.sep).join("/");
|
|
209
207
|
};
|
|
210
208
|
}
|
|
211
209
|
|
|
212
|
-
// bazel-out/
|
|
210
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
|
|
213
211
|
import ts2 from "typescript";
|
|
214
212
|
|
|
215
|
-
// bazel-out/
|
|
213
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/version_helpers.mjs
|
|
216
214
|
function toNumbers(value) {
|
|
217
215
|
const suffixIndex = value.lastIndexOf("-");
|
|
218
216
|
return value.slice(0, suffixIndex === -1 ? value.length : suffixIndex).split(".").map((segment) => {
|
|
@@ -247,7 +245,7 @@ function compareVersions(v1, v2) {
|
|
|
247
245
|
return compareNumbers(toNumbers(v1), toNumbers(v2));
|
|
248
246
|
}
|
|
249
247
|
|
|
250
|
-
// bazel-out/
|
|
248
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
|
|
251
249
|
var MIN_TS_VERSION = "4.4.2";
|
|
252
250
|
var MAX_TS_VERSION = "4.6.0";
|
|
253
251
|
var tsVersion = ts2.version;
|
|
@@ -260,10 +258,10 @@ function verifySupportedTypeScriptVersion() {
|
|
|
260
258
|
checkVersion(tsVersion, MIN_TS_VERSION, MAX_TS_VERSION);
|
|
261
259
|
}
|
|
262
260
|
|
|
263
|
-
// bazel-out/
|
|
264
|
-
import
|
|
261
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
262
|
+
import ts32 from "typescript";
|
|
265
263
|
|
|
266
|
-
// bazel-out/
|
|
264
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
|
|
267
265
|
var CycleAnalyzer = class {
|
|
268
266
|
constructor(importGraph) {
|
|
269
267
|
this.importGraph = importGraph;
|
|
@@ -334,13 +332,13 @@ var Cycle = class {
|
|
|
334
332
|
}
|
|
335
333
|
};
|
|
336
334
|
|
|
337
|
-
// bazel-out/
|
|
335
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/imports.mjs
|
|
338
336
|
import ts3 from "typescript";
|
|
339
337
|
var ImportGraph = class {
|
|
340
338
|
constructor(checker, perf) {
|
|
341
339
|
this.checker = checker;
|
|
342
340
|
this.perf = perf;
|
|
343
|
-
this.imports = new Map();
|
|
341
|
+
this.imports = /* @__PURE__ */ new Map();
|
|
344
342
|
}
|
|
345
343
|
importsOf(sf) {
|
|
346
344
|
if (!this.imports.has(sf)) {
|
|
@@ -352,7 +350,7 @@ var ImportGraph = class {
|
|
|
352
350
|
if (start === end) {
|
|
353
351
|
return [start];
|
|
354
352
|
}
|
|
355
|
-
const found = new Set([start]);
|
|
353
|
+
const found = /* @__PURE__ */ new Set([start]);
|
|
356
354
|
const queue = [new Found(start, null)];
|
|
357
355
|
while (queue.length > 0) {
|
|
358
356
|
const current = queue.shift();
|
|
@@ -377,7 +375,7 @@ var ImportGraph = class {
|
|
|
377
375
|
}
|
|
378
376
|
scanImports(sf) {
|
|
379
377
|
return this.perf.inPhase(PerfPhase.CycleDetection, () => {
|
|
380
|
-
const imports = new Set();
|
|
378
|
+
const imports = /* @__PURE__ */ new Set();
|
|
381
379
|
for (const stmt of sf.statements) {
|
|
382
380
|
if (!ts3.isImportDeclaration(stmt) && !ts3.isExportDeclaration(stmt) || stmt.moduleSpecifier === void 0) {
|
|
383
381
|
continue;
|
|
@@ -426,7 +424,7 @@ var Found = class {
|
|
|
426
424
|
}
|
|
427
425
|
};
|
|
428
426
|
|
|
429
|
-
// bazel-out/
|
|
427
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/generator.mjs
|
|
430
428
|
import ts4 from "typescript";
|
|
431
429
|
var FlatIndexGenerator = class {
|
|
432
430
|
constructor(entryPoint, relativeFlatIndexPath, moduleName) {
|
|
@@ -451,7 +449,7 @@ export * from '${relativeEntryPoint}';
|
|
|
451
449
|
}
|
|
452
450
|
};
|
|
453
451
|
|
|
454
|
-
// bazel-out/
|
|
452
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/logic.mjs
|
|
455
453
|
function findFlatIndexEntryPoint(rootFiles) {
|
|
456
454
|
const tsFiles = rootFiles.filter((file) => isNonDeclarationTsPath(file));
|
|
457
455
|
let resolvedEntryPoint = null;
|
|
@@ -467,11 +465,11 @@ function findFlatIndexEntryPoint(rootFiles) {
|
|
|
467
465
|
return resolvedEntryPoint;
|
|
468
466
|
}
|
|
469
467
|
|
|
470
|
-
// bazel-out/
|
|
468
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/private_export_checker.mjs
|
|
471
469
|
import ts5 from "typescript";
|
|
472
470
|
function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
473
471
|
const diagnostics = [];
|
|
474
|
-
const topLevelExports = new Set();
|
|
472
|
+
const topLevelExports = /* @__PURE__ */ new Set();
|
|
475
473
|
const moduleSymbol = checker.getSymbolAtLocation(entryPoint);
|
|
476
474
|
if (moduleSymbol === void 0) {
|
|
477
475
|
throw new Error(`Internal error: failed to get symbol for entrypoint`);
|
|
@@ -486,7 +484,7 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
|
486
484
|
topLevelExports.add(decl);
|
|
487
485
|
}
|
|
488
486
|
});
|
|
489
|
-
const checkedSet = new Set();
|
|
487
|
+
const checkedSet = /* @__PURE__ */ new Set();
|
|
490
488
|
topLevelExports.forEach((mainExport) => {
|
|
491
489
|
refGraph.transitiveReferencesOf(mainExport).forEach((transitiveReference) => {
|
|
492
490
|
if (checkedSet.has(transitiveReference)) {
|
|
@@ -547,24 +545,24 @@ function getDescriptorOfDeclaration(decl) {
|
|
|
547
545
|
}
|
|
548
546
|
}
|
|
549
547
|
|
|
550
|
-
// bazel-out/
|
|
548
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/reference_graph.mjs
|
|
551
549
|
var ReferenceGraph = class {
|
|
552
550
|
constructor() {
|
|
553
|
-
this.references = new Map();
|
|
551
|
+
this.references = /* @__PURE__ */ new Map();
|
|
554
552
|
}
|
|
555
553
|
add(from, to) {
|
|
556
554
|
if (!this.references.has(from)) {
|
|
557
|
-
this.references.set(from, new Set());
|
|
555
|
+
this.references.set(from, /* @__PURE__ */ new Set());
|
|
558
556
|
}
|
|
559
557
|
this.references.get(from).add(to);
|
|
560
558
|
}
|
|
561
559
|
transitiveReferencesOf(target) {
|
|
562
|
-
const set = new Set();
|
|
560
|
+
const set = /* @__PURE__ */ new Set();
|
|
563
561
|
this.collectTransitiveReferences(set, target);
|
|
564
562
|
return set;
|
|
565
563
|
}
|
|
566
564
|
pathFrom(source, target) {
|
|
567
|
-
return this.collectPathFrom(source, target, new Set());
|
|
565
|
+
return this.collectPathFrom(source, target, /* @__PURE__ */ new Set());
|
|
568
566
|
}
|
|
569
567
|
collectPathFrom(source, target, seen) {
|
|
570
568
|
if (source === target) {
|
|
@@ -601,7 +599,7 @@ var ReferenceGraph = class {
|
|
|
601
599
|
}
|
|
602
600
|
};
|
|
603
601
|
|
|
604
|
-
// bazel-out/
|
|
602
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/api.mjs
|
|
605
603
|
var NgOriginalFile = Symbol("NgOriginalFile");
|
|
606
604
|
var UpdateMode;
|
|
607
605
|
(function(UpdateMode2) {
|
|
@@ -609,13 +607,13 @@ var UpdateMode;
|
|
|
609
607
|
UpdateMode2[UpdateMode2["Incremental"] = 1] = "Incremental";
|
|
610
608
|
})(UpdateMode || (UpdateMode = {}));
|
|
611
609
|
|
|
612
|
-
// bazel-out/
|
|
610
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
613
611
|
import ts9 from "typescript";
|
|
614
612
|
|
|
615
|
-
// bazel-out/
|
|
613
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
616
614
|
import ts6 from "typescript";
|
|
617
615
|
|
|
618
|
-
// bazel-out/
|
|
616
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/expando.mjs
|
|
619
617
|
var NgExtension = Symbol("NgExtension");
|
|
620
618
|
function isExtended(sf) {
|
|
621
619
|
return sf[NgExtension] !== void 0;
|
|
@@ -675,7 +673,7 @@ function retagTsFile(sf) {
|
|
|
675
673
|
}
|
|
676
674
|
}
|
|
677
675
|
|
|
678
|
-
// bazel-out/
|
|
676
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/util.mjs
|
|
679
677
|
var TS_EXTENSIONS = /\.tsx?$/i;
|
|
680
678
|
function makeShimFileName(fileName, suffix) {
|
|
681
679
|
return absoluteFrom(fileName.replace(TS_EXTENSIONS, suffix));
|
|
@@ -690,15 +688,15 @@ function generatedModuleName(originalModuleName, originalFileName, genSuffix) {
|
|
|
690
688
|
return moduleName;
|
|
691
689
|
}
|
|
692
690
|
|
|
693
|
-
// bazel-out/
|
|
691
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
694
692
|
var ShimAdapter = class {
|
|
695
693
|
constructor(delegate, tsRootFiles, topLevelGenerators, perFileGenerators, oldProgram) {
|
|
696
694
|
this.delegate = delegate;
|
|
697
|
-
this.shims = new Map();
|
|
698
|
-
this.priorShims = new Map();
|
|
699
|
-
this.notShims = new Set();
|
|
695
|
+
this.shims = /* @__PURE__ */ new Map();
|
|
696
|
+
this.priorShims = /* @__PURE__ */ new Map();
|
|
697
|
+
this.notShims = /* @__PURE__ */ new Set();
|
|
700
698
|
this.generators = [];
|
|
701
|
-
this.ignoreForEmit = new Set();
|
|
699
|
+
this.ignoreForEmit = /* @__PURE__ */ new Set();
|
|
702
700
|
this.extensionPrefixes = [];
|
|
703
701
|
for (const gen of perFileGenerators) {
|
|
704
702
|
const pattern = `^(.*)\\.${gen.extensionPrefix}\\.ts$`;
|
|
@@ -787,14 +785,14 @@ var ShimAdapter = class {
|
|
|
787
785
|
}
|
|
788
786
|
};
|
|
789
787
|
|
|
790
|
-
// bazel-out/
|
|
788
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/factory_generator.mjs
|
|
791
789
|
import ts7 from "typescript";
|
|
792
790
|
var TS_DTS_SUFFIX = /(\.d)?\.ts$/;
|
|
793
791
|
var STRIP_NG_FACTORY = /(.*)NgFactory$/;
|
|
794
792
|
var FactoryGenerator = class {
|
|
795
793
|
constructor() {
|
|
796
|
-
this.sourceInfo = new Map();
|
|
797
|
-
this.sourceToFactorySymbols = new Map();
|
|
794
|
+
this.sourceInfo = /* @__PURE__ */ new Map();
|
|
795
|
+
this.sourceToFactorySymbols = /* @__PURE__ */ new Map();
|
|
798
796
|
this.shouldEmit = true;
|
|
799
797
|
this.extensionPrefix = "ngfactory";
|
|
800
798
|
}
|
|
@@ -820,7 +818,7 @@ var FactoryGenerator = class {
|
|
|
820
818
|
if (sf.moduleName !== void 0) {
|
|
821
819
|
genFile.moduleName = generatedModuleName(sf.moduleName, sf.fileName, ".ngfactory");
|
|
822
820
|
}
|
|
823
|
-
const moduleSymbols = new Map();
|
|
821
|
+
const moduleSymbols = /* @__PURE__ */ new Map();
|
|
824
822
|
this.sourceToFactorySymbols.set(absoluteSfPath, moduleSymbols);
|
|
825
823
|
this.sourceInfo.set(genFilePath, {
|
|
826
824
|
sourceFilePath: absoluteSfPath,
|
|
@@ -851,7 +849,7 @@ function transformFactorySourceFile(factoryMap, context, importRewriter, file) {
|
|
|
851
849
|
const { moduleSymbols, sourceFilePath } = factoryMap.get(file.fileName);
|
|
852
850
|
const transformedStatements = [];
|
|
853
851
|
let nonEmptyExport = null;
|
|
854
|
-
const coreImportIdentifiers = new Set();
|
|
852
|
+
const coreImportIdentifiers = /* @__PURE__ */ new Set();
|
|
855
853
|
for (const stmt of file.statements) {
|
|
856
854
|
if (ts7.isImportDeclaration(stmt) && ts7.isStringLiteral(stmt.moduleSpecifier) && stmt.moduleSpecifier.text === "@angular/core") {
|
|
857
855
|
const rewrittenModuleSpecifier = importRewriter.rewriteSpecifier("@angular/core", sourceFilePath);
|
|
@@ -936,10 +934,10 @@ function updateInitializers(stmt, update) {
|
|
|
936
934
|
return ts7.updateVariableStatement(stmt, stmt.modifiers, ts7.updateVariableDeclarationList(stmt.declarationList, stmt.declarationList.declarations.map((decl) => ts7.updateVariableDeclaration(decl, decl.name, decl.type, update(decl.initializer)))));
|
|
937
935
|
}
|
|
938
936
|
|
|
939
|
-
// bazel-out/
|
|
937
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/reference_tagger.mjs
|
|
940
938
|
var ShimReferenceTagger = class {
|
|
941
939
|
constructor(shimExtensions) {
|
|
942
|
-
this.tagged = new Set();
|
|
940
|
+
this.tagged = /* @__PURE__ */ new Set();
|
|
943
941
|
this.enabled = true;
|
|
944
942
|
this.suffixes = shimExtensions.map((extension) => `.${extension}.ts`);
|
|
945
943
|
}
|
|
@@ -970,7 +968,7 @@ var ShimReferenceTagger = class {
|
|
|
970
968
|
}
|
|
971
969
|
};
|
|
972
970
|
|
|
973
|
-
// bazel-out/
|
|
971
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/summary_generator.mjs
|
|
974
972
|
import ts8 from "typescript";
|
|
975
973
|
var SummaryGenerator = class {
|
|
976
974
|
constructor() {
|
|
@@ -1010,7 +1008,7 @@ function isExported2(decl) {
|
|
|
1010
1008
|
return decl.modifiers !== void 0 && decl.modifiers.some((mod) => mod.kind == ts8.SyntaxKind.ExportKeyword);
|
|
1011
1009
|
}
|
|
1012
1010
|
|
|
1013
|
-
// bazel-out/
|
|
1011
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
1014
1012
|
var DelegatingCompilerHost = class {
|
|
1015
1013
|
constructor(delegate) {
|
|
1016
1014
|
this.delegate = delegate;
|
|
@@ -1082,7 +1080,7 @@ var TsCreateProgramDriver = class {
|
|
|
1082
1080
|
this.originalHost = originalHost;
|
|
1083
1081
|
this.options = options;
|
|
1084
1082
|
this.shimExtensionPrefixes = shimExtensionPrefixes;
|
|
1085
|
-
this.sfMap = new Map();
|
|
1083
|
+
this.sfMap = /* @__PURE__ */ new Map();
|
|
1086
1084
|
this.program = this.originalProgram;
|
|
1087
1085
|
this.supportsInlineOperations = true;
|
|
1088
1086
|
}
|
|
@@ -1120,10 +1118,10 @@ var TsCreateProgramDriver = class {
|
|
|
1120
1118
|
}
|
|
1121
1119
|
};
|
|
1122
1120
|
|
|
1123
|
-
// bazel-out/
|
|
1121
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/dependency_tracking.mjs
|
|
1124
1122
|
var FileDependencyGraph = class {
|
|
1125
1123
|
constructor() {
|
|
1126
|
-
this.nodes = new Map();
|
|
1124
|
+
this.nodes = /* @__PURE__ */ new Map();
|
|
1127
1125
|
}
|
|
1128
1126
|
addDependency(from, on) {
|
|
1129
1127
|
this.nodeFor(from).dependsOn.add(absoluteFromSourceFile(on));
|
|
@@ -1139,7 +1137,7 @@ var FileDependencyGraph = class {
|
|
|
1139
1137
|
return node ? [...node.usesResources] : [];
|
|
1140
1138
|
}
|
|
1141
1139
|
updateWithPhysicalChanges(previous, changedTsPaths, deletedTsPaths, changedResources) {
|
|
1142
|
-
const logicallyChanged = new Set();
|
|
1140
|
+
const logicallyChanged = /* @__PURE__ */ new Set();
|
|
1143
1141
|
for (const sf of previous.nodes.keys()) {
|
|
1144
1142
|
const sfPath = absoluteFromSourceFile(sf);
|
|
1145
1143
|
const node = previous.nodeFor(sf);
|
|
@@ -1158,8 +1156,8 @@ var FileDependencyGraph = class {
|
|
|
1158
1156
|
nodeFor(sf) {
|
|
1159
1157
|
if (!this.nodes.has(sf)) {
|
|
1160
1158
|
this.nodes.set(sf, {
|
|
1161
|
-
dependsOn: new Set(),
|
|
1162
|
-
usesResources: new Set(),
|
|
1159
|
+
dependsOn: /* @__PURE__ */ new Set(),
|
|
1160
|
+
usesResources: /* @__PURE__ */ new Set(),
|
|
1163
1161
|
failedAnalysis: false
|
|
1164
1162
|
});
|
|
1165
1163
|
}
|
|
@@ -1187,7 +1185,7 @@ function isLogicallyChanged(sf, node, changedTsPaths, deletedTsPaths, changedRes
|
|
|
1187
1185
|
return false;
|
|
1188
1186
|
}
|
|
1189
1187
|
|
|
1190
|
-
// bazel-out/
|
|
1188
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/state.mjs
|
|
1191
1189
|
var IncrementalStateKind;
|
|
1192
1190
|
(function(IncrementalStateKind2) {
|
|
1193
1191
|
IncrementalStateKind2[IncrementalStateKind2["Fresh"] = 0] = "Fresh";
|
|
@@ -1195,7 +1193,7 @@ var IncrementalStateKind;
|
|
|
1195
1193
|
IncrementalStateKind2[IncrementalStateKind2["Analyzed"] = 2] = "Analyzed";
|
|
1196
1194
|
})(IncrementalStateKind || (IncrementalStateKind = {}));
|
|
1197
1195
|
|
|
1198
|
-
// bazel-out/
|
|
1196
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/incremental.mjs
|
|
1199
1197
|
var PhaseKind;
|
|
1200
1198
|
(function(PhaseKind2) {
|
|
1201
1199
|
PhaseKind2[PhaseKind2["Analysis"] = 0] = "Analysis";
|
|
@@ -1220,7 +1218,7 @@ var IncrementalCompilation = class {
|
|
|
1220
1218
|
}
|
|
1221
1219
|
static incremental(program, newVersions, oldProgram, oldState, modifiedResourceFiles, perf) {
|
|
1222
1220
|
return perf.inPhase(PerfPhase.Reconciliation, () => {
|
|
1223
|
-
const physicallyChangedTsFiles = new Set();
|
|
1221
|
+
const physicallyChangedTsFiles = /* @__PURE__ */ new Set();
|
|
1224
1222
|
const changedResourceFiles = new Set(modifiedResourceFiles != null ? modifiedResourceFiles : []);
|
|
1225
1223
|
let priorAnalysis;
|
|
1226
1224
|
switch (oldState.kind) {
|
|
@@ -1296,7 +1294,7 @@ var IncrementalCompilation = class {
|
|
|
1296
1294
|
const { needsEmit, needsTypeCheckEmit, newGraph } = this.phase.semanticDepGraphUpdater.finalize();
|
|
1297
1295
|
let emitted;
|
|
1298
1296
|
if (this.step === null) {
|
|
1299
|
-
emitted = new Set();
|
|
1297
|
+
emitted = /* @__PURE__ */ new Set();
|
|
1300
1298
|
} else {
|
|
1301
1299
|
emitted = new Set(this.step.priorState.emitted);
|
|
1302
1300
|
for (const sfPath of this.step.logicallyChangedTsFiles) {
|
|
@@ -1396,7 +1394,7 @@ function toOriginalSourceFile(sf) {
|
|
|
1396
1394
|
}
|
|
1397
1395
|
}
|
|
1398
1396
|
|
|
1399
|
-
// bazel-out/
|
|
1397
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/strategy.mjs
|
|
1400
1398
|
var TrackedIncrementalBuildStrategy = class {
|
|
1401
1399
|
constructor() {
|
|
1402
1400
|
this.state = null;
|
|
@@ -1432,7 +1430,7 @@ var PatchedProgramIncrementalBuildStrategy = class {
|
|
|
1432
1430
|
};
|
|
1433
1431
|
var SYM_INCREMENTAL_STATE = Symbol("NgIncrementalState");
|
|
1434
1432
|
|
|
1435
|
-
// bazel-out/
|
|
1433
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/api.mjs
|
|
1436
1434
|
var IdentifierKind;
|
|
1437
1435
|
(function(IdentifierKind2) {
|
|
1438
1436
|
IdentifierKind2[IdentifierKind2["Property"] = 0] = "Property";
|
|
@@ -1450,21 +1448,21 @@ var AbsoluteSourceSpan = class {
|
|
|
1450
1448
|
}
|
|
1451
1449
|
};
|
|
1452
1450
|
|
|
1453
|
-
// bazel-out/
|
|
1451
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/context.mjs
|
|
1454
1452
|
var IndexingContext = class {
|
|
1455
1453
|
constructor() {
|
|
1456
|
-
this.components = new Set();
|
|
1454
|
+
this.components = /* @__PURE__ */ new Set();
|
|
1457
1455
|
}
|
|
1458
1456
|
addComponent(info) {
|
|
1459
1457
|
this.components.add(info);
|
|
1460
1458
|
}
|
|
1461
1459
|
};
|
|
1462
1460
|
|
|
1463
|
-
// bazel-out/
|
|
1461
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/transform.mjs
|
|
1464
1462
|
import { ParseSourceFile } from "@angular/compiler";
|
|
1465
1463
|
|
|
1466
|
-
// bazel-out/
|
|
1467
|
-
import { ASTWithSource, ImplicitReceiver, RecursiveAstVisitor, TmplAstElement, TmplAstRecursiveVisitor, TmplAstReference, TmplAstTemplate } from "@angular/compiler";
|
|
1464
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/template.mjs
|
|
1465
|
+
import { ASTWithSource, ImplicitReceiver, PropertyRead, PropertyWrite, RecursiveAstVisitor, TmplAstElement, TmplAstRecursiveVisitor, TmplAstReference, TmplAstTemplate } from "@angular/compiler";
|
|
1468
1466
|
var ExpressionVisitor = class extends RecursiveAstVisitor {
|
|
1469
1467
|
constructor(expressionStr, absoluteOffset, boundTemplate, targetToIdentifier) {
|
|
1470
1468
|
super();
|
|
@@ -1494,7 +1492,10 @@ var ExpressionVisitor = class extends RecursiveAstVisitor {
|
|
|
1494
1492
|
if (!(ast.receiver instanceof ImplicitReceiver)) {
|
|
1495
1493
|
return;
|
|
1496
1494
|
}
|
|
1497
|
-
|
|
1495
|
+
let identifierStart = ast.sourceSpan.start - this.absoluteOffset;
|
|
1496
|
+
if (ast instanceof PropertyRead || ast instanceof PropertyWrite) {
|
|
1497
|
+
identifierStart = ast.nameSpan.start - this.absoluteOffset;
|
|
1498
|
+
}
|
|
1498
1499
|
if (!this.expressionStr.substring(identifierStart).startsWith(ast.name)) {
|
|
1499
1500
|
throw new Error(`Impossible state: "${ast.name}" not found in "${this.expressionStr}" at location ${identifierStart}`);
|
|
1500
1501
|
}
|
|
@@ -1515,9 +1516,9 @@ var TemplateVisitor = class extends TmplAstRecursiveVisitor {
|
|
|
1515
1516
|
constructor(boundTemplate) {
|
|
1516
1517
|
super();
|
|
1517
1518
|
this.boundTemplate = boundTemplate;
|
|
1518
|
-
this.identifiers = new Set();
|
|
1519
|
-
this.targetIdentifierCache = new Map();
|
|
1520
|
-
this.elementAndTemplateIdentifierCache = new Map();
|
|
1519
|
+
this.identifiers = /* @__PURE__ */ new Set();
|
|
1520
|
+
this.targetIdentifierCache = /* @__PURE__ */ new Map();
|
|
1521
|
+
this.elementAndTemplateIdentifierCache = /* @__PURE__ */ new Map();
|
|
1521
1522
|
}
|
|
1522
1523
|
visit(node) {
|
|
1523
1524
|
node.visit(this);
|
|
@@ -1574,7 +1575,11 @@ var TemplateVisitor = class extends TmplAstRecursiveVisitor {
|
|
|
1574
1575
|
name = node.tagName;
|
|
1575
1576
|
kind = IdentifierKind.Template;
|
|
1576
1577
|
} else {
|
|
1577
|
-
|
|
1578
|
+
if (node.name.startsWith(":")) {
|
|
1579
|
+
name = node.name.split(":").pop();
|
|
1580
|
+
} else {
|
|
1581
|
+
name = node.name;
|
|
1582
|
+
}
|
|
1578
1583
|
kind = IdentifierKind.Element;
|
|
1579
1584
|
}
|
|
1580
1585
|
const sourceSpan = node.startSourceSpan;
|
|
@@ -1667,12 +1672,12 @@ function getTemplateIdentifiers(boundTemplate) {
|
|
|
1667
1672
|
return visitor.identifiers;
|
|
1668
1673
|
}
|
|
1669
1674
|
|
|
1670
|
-
// bazel-out/
|
|
1675
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/transform.mjs
|
|
1671
1676
|
function generateAnalysis(context) {
|
|
1672
|
-
const analysis = new Map();
|
|
1677
|
+
const analysis = /* @__PURE__ */ new Map();
|
|
1673
1678
|
context.components.forEach(({ declaration, selector, boundTemplate, templateMeta }) => {
|
|
1674
1679
|
const name = declaration.name.getText();
|
|
1675
|
-
const usedComponents = new Set();
|
|
1680
|
+
const usedComponents = /* @__PURE__ */ new Set();
|
|
1676
1681
|
const usedDirs = boundTemplate.getUsedDirectives();
|
|
1677
1682
|
usedDirs.forEach((dir) => {
|
|
1678
1683
|
if (dir.isComponent) {
|
|
@@ -1701,7 +1706,7 @@ function generateAnalysis(context) {
|
|
|
1701
1706
|
return analysis;
|
|
1702
1707
|
}
|
|
1703
1708
|
|
|
1704
|
-
// bazel-out/
|
|
1709
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/resource/src/loader.mjs
|
|
1705
1710
|
import ts10 from "typescript";
|
|
1706
1711
|
var CSS_PREPROCESSOR_EXT = /(\.scss|\.sass|\.less|\.styl)$/;
|
|
1707
1712
|
var RESOURCE_MARKER = ".$ngresource$";
|
|
@@ -1710,8 +1715,8 @@ var AdapterResourceLoader = class {
|
|
|
1710
1715
|
constructor(adapter, options) {
|
|
1711
1716
|
this.adapter = adapter;
|
|
1712
1717
|
this.options = options;
|
|
1713
|
-
this.cache = new Map();
|
|
1714
|
-
this.fetching = new Map();
|
|
1718
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
1719
|
+
this.fetching = /* @__PURE__ */ new Map();
|
|
1715
1720
|
this.lookupResolutionHost = createLookupResolutionHost(this.adapter);
|
|
1716
1721
|
this.canPreload = !!this.adapter.readResource;
|
|
1717
1722
|
this.canPreprocess = !!this.adapter.transformResource;
|
|
@@ -1847,12 +1852,12 @@ function createLookupResolutionHost(adapter) {
|
|
|
1847
1852
|
};
|
|
1848
1853
|
}
|
|
1849
1854
|
|
|
1850
|
-
// bazel-out/
|
|
1855
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/dependency.mjs
|
|
1851
1856
|
var MetadataDtsModuleScopeResolver = class {
|
|
1852
1857
|
constructor(dtsMetaReader, aliasingHost) {
|
|
1853
1858
|
this.dtsMetaReader = dtsMetaReader;
|
|
1854
1859
|
this.aliasingHost = aliasingHost;
|
|
1855
|
-
this.cache = new Map();
|
|
1860
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
1856
1861
|
}
|
|
1857
1862
|
resolve(ref) {
|
|
1858
1863
|
const clazz = ref.node;
|
|
@@ -1865,13 +1870,13 @@ var MetadataDtsModuleScopeResolver = class {
|
|
|
1865
1870
|
}
|
|
1866
1871
|
const directives = [];
|
|
1867
1872
|
const pipes = [];
|
|
1868
|
-
const ngModules = new Set([clazz]);
|
|
1873
|
+
const ngModules = /* @__PURE__ */ new Set([clazz]);
|
|
1869
1874
|
const meta = this.dtsMetaReader.getNgModuleMetadata(ref);
|
|
1870
1875
|
if (meta === null) {
|
|
1871
1876
|
this.cache.set(clazz, null);
|
|
1872
1877
|
return null;
|
|
1873
1878
|
}
|
|
1874
|
-
const declarations = new Set();
|
|
1879
|
+
const declarations = /* @__PURE__ */ new Set();
|
|
1875
1880
|
for (const declRef of meta.declarations) {
|
|
1876
1881
|
declarations.add(declRef.node);
|
|
1877
1882
|
}
|
|
@@ -1933,7 +1938,7 @@ var MetadataDtsModuleScopeResolver = class {
|
|
|
1933
1938
|
}
|
|
1934
1939
|
};
|
|
1935
1940
|
|
|
1936
|
-
// bazel-out/
|
|
1941
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/local.mjs
|
|
1937
1942
|
import { ExternalExpr } from "@angular/compiler";
|
|
1938
1943
|
import ts11 from "typescript";
|
|
1939
1944
|
var LocalModuleScopeRegistry = class {
|
|
@@ -1943,13 +1948,13 @@ var LocalModuleScopeRegistry = class {
|
|
|
1943
1948
|
this.refEmitter = refEmitter;
|
|
1944
1949
|
this.aliasingHost = aliasingHost;
|
|
1945
1950
|
this.sealed = false;
|
|
1946
|
-
this.declarationToModule = new Map();
|
|
1947
|
-
this.duplicateDeclarations = new Map();
|
|
1948
|
-
this.moduleToRef = new Map();
|
|
1949
|
-
this.cache = new Map();
|
|
1950
|
-
this.remoteScoping = new Map();
|
|
1951
|
-
this.scopeErrors = new Map();
|
|
1952
|
-
this.modulesWithStructuralErrors = new Set();
|
|
1951
|
+
this.declarationToModule = /* @__PURE__ */ new Map();
|
|
1952
|
+
this.duplicateDeclarations = /* @__PURE__ */ new Map();
|
|
1953
|
+
this.moduleToRef = /* @__PURE__ */ new Map();
|
|
1954
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
1955
|
+
this.remoteScoping = /* @__PURE__ */ new Map();
|
|
1956
|
+
this.scopeErrors = /* @__PURE__ */ new Map();
|
|
1957
|
+
this.modulesWithStructuralErrors = /* @__PURE__ */ new Set();
|
|
1953
1958
|
}
|
|
1954
1959
|
registerNgModuleMetadata(data) {
|
|
1955
1960
|
this.assertCollecting();
|
|
@@ -1993,7 +1998,7 @@ var LocalModuleScopeRegistry = class {
|
|
|
1993
1998
|
if (this.duplicateDeclarations.has(decl.node)) {
|
|
1994
1999
|
this.duplicateDeclarations.get(decl.node).set(ngModule, declData);
|
|
1995
2000
|
} else if (this.declarationToModule.has(decl.node) && this.declarationToModule.get(decl.node).ngModule !== ngModule) {
|
|
1996
|
-
const duplicateDeclMap = new Map();
|
|
2001
|
+
const duplicateDeclMap = /* @__PURE__ */ new Map();
|
|
1997
2002
|
const firstDeclData = this.declarationToModule.get(decl.node);
|
|
1998
2003
|
this.modulesWithStructuralErrors.add(firstDeclData.ngModule);
|
|
1999
2004
|
this.modulesWithStructuralErrors.add(ngModule);
|
|
@@ -2015,14 +2020,14 @@ var LocalModuleScopeRegistry = class {
|
|
|
2015
2020
|
this.cache.set(ref.node, null);
|
|
2016
2021
|
return null;
|
|
2017
2022
|
}
|
|
2018
|
-
const compilationModules = new Set([ngModule.ref.node]);
|
|
2019
|
-
const exportedModules = new Set([ngModule.ref.node]);
|
|
2023
|
+
const compilationModules = /* @__PURE__ */ new Set([ngModule.ref.node]);
|
|
2024
|
+
const exportedModules = /* @__PURE__ */ new Set([ngModule.ref.node]);
|
|
2020
2025
|
const diagnostics = [];
|
|
2021
|
-
const compilationDirectives = new Map();
|
|
2022
|
-
const compilationPipes = new Map();
|
|
2023
|
-
const declared = new Set();
|
|
2024
|
-
const exportDirectives = new Map();
|
|
2025
|
-
const exportPipes = new Map();
|
|
2026
|
+
const compilationDirectives = /* @__PURE__ */ new Map();
|
|
2027
|
+
const compilationPipes = /* @__PURE__ */ new Map();
|
|
2028
|
+
const declared = /* @__PURE__ */ new Set();
|
|
2029
|
+
const exportDirectives = /* @__PURE__ */ new Map();
|
|
2030
|
+
const exportPipes = /* @__PURE__ */ new Map();
|
|
2026
2031
|
let isPoisoned = false;
|
|
2027
2032
|
if (this.modulesWithStructuralErrors.has(ngModule.ref.node)) {
|
|
2028
2033
|
isPoisoned = true;
|
|
@@ -2153,7 +2158,7 @@ var LocalModuleScopeRegistry = class {
|
|
|
2153
2158
|
return null;
|
|
2154
2159
|
}
|
|
2155
2160
|
reexports = [];
|
|
2156
|
-
const reexportMap = new Map();
|
|
2161
|
+
const reexportMap = /* @__PURE__ */ new Map();
|
|
2157
2162
|
const ngModuleRef = ref;
|
|
2158
2163
|
const addReexport = (exportRef) => {
|
|
2159
2164
|
if (exportRef.node.getSourceFile() === sourceFile) {
|
|
@@ -2172,7 +2177,9 @@ var LocalModuleScopeRegistry = class {
|
|
|
2172
2177
|
asAlias: exportName
|
|
2173
2178
|
});
|
|
2174
2179
|
} else {
|
|
2175
|
-
const
|
|
2180
|
+
const emittedRef = this.refEmitter.emit(exportRef.cloneWithNoIdentifiers(), sourceFile);
|
|
2181
|
+
assertSuccessfulReferenceEmit(emittedRef, ngModuleRef.node.name, "class");
|
|
2182
|
+
const expr = emittedRef.expression;
|
|
2176
2183
|
if (!(expr instanceof ExternalExpr) || expr.value.moduleName === null || expr.value.name === null) {
|
|
2177
2184
|
throw new Error("Expected ExternalExpr");
|
|
2178
2185
|
}
|
|
@@ -2241,20 +2248,20 @@ function reexportCollision(module, refA, refB) {
|
|
|
2241
2248
|
]);
|
|
2242
2249
|
}
|
|
2243
2250
|
|
|
2244
|
-
// bazel-out/
|
|
2251
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/typecheck.mjs
|
|
2245
2252
|
import { CssSelector, SelectorMatcher } from "@angular/compiler";
|
|
2246
2253
|
import ts12 from "typescript";
|
|
2247
2254
|
var TypeCheckScopeRegistry = class {
|
|
2248
2255
|
constructor(scopeReader, metaReader) {
|
|
2249
2256
|
this.scopeReader = scopeReader;
|
|
2250
2257
|
this.metaReader = metaReader;
|
|
2251
|
-
this.flattenedDirectiveMetaCache = new Map();
|
|
2252
|
-
this.scopeCache = new Map();
|
|
2258
|
+
this.flattenedDirectiveMetaCache = /* @__PURE__ */ new Map();
|
|
2259
|
+
this.scopeCache = /* @__PURE__ */ new Map();
|
|
2253
2260
|
}
|
|
2254
2261
|
getTypeCheckScope(node) {
|
|
2255
2262
|
const matcher = new SelectorMatcher();
|
|
2256
2263
|
const directives = [];
|
|
2257
|
-
const pipes = new Map();
|
|
2264
|
+
const pipes = /* @__PURE__ */ new Map();
|
|
2258
2265
|
const scope = this.scopeReader.getScopeForComponent(node);
|
|
2259
2266
|
if (scope === null) {
|
|
2260
2267
|
return {
|
|
@@ -2302,10 +2309,10 @@ var TypeCheckScopeRegistry = class {
|
|
|
2302
2309
|
}
|
|
2303
2310
|
};
|
|
2304
2311
|
|
|
2305
|
-
// bazel-out/
|
|
2312
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
|
|
2306
2313
|
import { CssSelector as CssSelector2, DomElementSchemaRegistry as DomElementSchemaRegistry2 } from "@angular/compiler";
|
|
2307
2314
|
|
|
2308
|
-
// bazel-out/
|
|
2315
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/diagnostic.mjs
|
|
2309
2316
|
import ts13 from "typescript";
|
|
2310
2317
|
function makeTemplateDiagnostic(templateId, mapping, span, category, code, messageText, relatedMessages) {
|
|
2311
2318
|
if (mapping.type === "direct") {
|
|
@@ -2378,7 +2385,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
2378
2385
|
}
|
|
2379
2386
|
}
|
|
2380
2387
|
|
|
2381
|
-
// bazel-out/
|
|
2388
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/id.mjs
|
|
2382
2389
|
var TEMPLATE_ID = Symbol("ngTemplateId");
|
|
2383
2390
|
var NEXT_TEMPLATE_ID = Symbol("ngNextTemplateId");
|
|
2384
2391
|
function getTemplateId(clazz) {
|
|
@@ -2395,11 +2402,11 @@ function allocateTemplateId(sf) {
|
|
|
2395
2402
|
return `tcb${sf[NEXT_TEMPLATE_ID]++}`;
|
|
2396
2403
|
}
|
|
2397
2404
|
|
|
2398
|
-
// bazel-out/
|
|
2399
|
-
import { EmptyExpr, ImplicitReceiver as ImplicitReceiver2, PropertyRead, PropertyWrite, SafePropertyRead, TmplAstReference as TmplAstReference2, TmplAstTextAttribute } from "@angular/compiler";
|
|
2405
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
2406
|
+
import { EmptyExpr, ImplicitReceiver as ImplicitReceiver2, PropertyRead as PropertyRead2, PropertyWrite as PropertyWrite2, SafePropertyRead, TmplAstReference as TmplAstReference2, TmplAstTextAttribute } from "@angular/compiler";
|
|
2400
2407
|
import ts15 from "typescript";
|
|
2401
2408
|
|
|
2402
|
-
// bazel-out/
|
|
2409
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/comments.mjs
|
|
2403
2410
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan2 } from "@angular/compiler";
|
|
2404
2411
|
import ts14 from "typescript";
|
|
2405
2412
|
var parseSpanComment = /^(\d+),(\d+)$/;
|
|
@@ -2519,14 +2526,14 @@ function hasExpressionIdentifier(sourceFile, node, identifier) {
|
|
|
2519
2526
|
}) || false;
|
|
2520
2527
|
}
|
|
2521
2528
|
|
|
2522
|
-
// bazel-out/
|
|
2529
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
2523
2530
|
var CompletionEngine = class {
|
|
2524
2531
|
constructor(tcb, data, shimPath) {
|
|
2525
2532
|
this.tcb = tcb;
|
|
2526
2533
|
this.data = data;
|
|
2527
2534
|
this.shimPath = shimPath;
|
|
2528
|
-
this.templateContextCache = new Map();
|
|
2529
|
-
this.expressionCompletionCache = new Map();
|
|
2535
|
+
this.templateContextCache = /* @__PURE__ */ new Map();
|
|
2536
|
+
this.expressionCompletionCache = /* @__PURE__ */ new Map();
|
|
2530
2537
|
const globalRead = findFirstMatchingNode(this.tcb, {
|
|
2531
2538
|
filter: ts15.isPropertyAccessExpression,
|
|
2532
2539
|
withExpressionIdentifier: ExpressionIdentifier.COMPONENT_COMPLETION
|
|
@@ -2561,7 +2568,7 @@ var CompletionEngine = class {
|
|
|
2561
2568
|
};
|
|
2562
2569
|
}
|
|
2563
2570
|
}
|
|
2564
|
-
if (node instanceof
|
|
2571
|
+
if (node instanceof PropertyRead2 && node.receiver instanceof ImplicitReceiver2) {
|
|
2565
2572
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
2566
2573
|
filter: ts15.isPropertyAccessExpression,
|
|
2567
2574
|
withSpan: node.sourceSpan
|
|
@@ -2584,7 +2591,7 @@ var CompletionEngine = class {
|
|
|
2584
2591
|
return this.expressionCompletionCache.get(expr);
|
|
2585
2592
|
}
|
|
2586
2593
|
let tsExpr = null;
|
|
2587
|
-
if (expr instanceof
|
|
2594
|
+
if (expr instanceof PropertyRead2 || expr instanceof PropertyWrite2) {
|
|
2588
2595
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
2589
2596
|
filter: ts15.isPropertyAccessExpression,
|
|
2590
2597
|
withSpan: expr.nameSpan
|
|
@@ -2651,7 +2658,7 @@ var CompletionEngine = class {
|
|
|
2651
2658
|
if (this.templateContextCache.has(context)) {
|
|
2652
2659
|
return this.templateContextCache.get(context);
|
|
2653
2660
|
}
|
|
2654
|
-
const templateContext = new Map();
|
|
2661
|
+
const templateContext = /* @__PURE__ */ new Map();
|
|
2655
2662
|
for (const node of this.data.boundTarget.getEntitiesInTemplateScope(context)) {
|
|
2656
2663
|
if (node instanceof TmplAstReference2) {
|
|
2657
2664
|
templateContext.set(node.name, {
|
|
@@ -2670,10 +2677,10 @@ var CompletionEngine = class {
|
|
|
2670
2677
|
}
|
|
2671
2678
|
};
|
|
2672
2679
|
|
|
2673
|
-
// bazel-out/
|
|
2680
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
|
|
2674
2681
|
import ts29 from "typescript";
|
|
2675
2682
|
|
|
2676
|
-
// bazel-out/
|
|
2683
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/dom.mjs
|
|
2677
2684
|
import { DomElementSchemaRegistry } from "@angular/compiler";
|
|
2678
2685
|
import ts16 from "typescript";
|
|
2679
2686
|
var REGISTRY = new DomElementSchemaRegistry();
|
|
@@ -2723,13 +2730,13 @@ var RegistryDomSchemaChecker = class {
|
|
|
2723
2730
|
}
|
|
2724
2731
|
};
|
|
2725
2732
|
|
|
2726
|
-
// bazel-out/
|
|
2733
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
|
|
2727
2734
|
import { ExpressionType, ExternalExpr as ExternalExpr2 } from "@angular/compiler";
|
|
2728
2735
|
import ts22 from "typescript";
|
|
2729
2736
|
|
|
2730
|
-
// bazel-out/
|
|
2737
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/ts_util.mjs
|
|
2731
2738
|
import ts17 from "typescript";
|
|
2732
|
-
var SAFE_TO_CAST_WITHOUT_PARENS = new Set([
|
|
2739
|
+
var SAFE_TO_CAST_WITHOUT_PARENS = /* @__PURE__ */ new Set([
|
|
2733
2740
|
ts17.SyntaxKind.ParenthesizedExpression,
|
|
2734
2741
|
ts17.SyntaxKind.Identifier,
|
|
2735
2742
|
ts17.SyntaxKind.CallExpression,
|
|
@@ -2796,19 +2803,19 @@ function isAccessExpression(node) {
|
|
|
2796
2803
|
return ts17.isPropertyAccessExpression(node) || ts17.isElementAccessExpression(node);
|
|
2797
2804
|
}
|
|
2798
2805
|
|
|
2799
|
-
// bazel-out/
|
|
2806
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
2800
2807
|
import ts21 from "typescript";
|
|
2801
2808
|
|
|
2802
|
-
// bazel-out/
|
|
2809
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
2803
2810
|
import ts20 from "typescript";
|
|
2804
2811
|
|
|
2805
|
-
// bazel-out/
|
|
2812
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
|
|
2806
2813
|
import ts19 from "typescript";
|
|
2807
2814
|
|
|
2808
|
-
// bazel-out/
|
|
2815
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_emitter.mjs
|
|
2809
2816
|
import ts18 from "typescript";
|
|
2810
2817
|
var INELIGIBLE = {};
|
|
2811
|
-
function canEmitType(type,
|
|
2818
|
+
function canEmitType(type, canEmit) {
|
|
2812
2819
|
return canEmitTypeWorker(type);
|
|
2813
2820
|
function canEmitTypeWorker(type2) {
|
|
2814
2821
|
return visitNode(type2) !== INELIGIBLE;
|
|
@@ -2824,20 +2831,15 @@ function canEmitType(type, resolver) {
|
|
|
2824
2831
|
}
|
|
2825
2832
|
}
|
|
2826
2833
|
function canEmitTypeReference(type2) {
|
|
2827
|
-
|
|
2828
|
-
if (reference === null) {
|
|
2834
|
+
if (!canEmit(type2)) {
|
|
2829
2835
|
return false;
|
|
2830
2836
|
}
|
|
2831
|
-
if (reference instanceof Reference) {
|
|
2832
|
-
return true;
|
|
2833
|
-
}
|
|
2834
2837
|
return type2.typeArguments === void 0 || type2.typeArguments.every(canEmitTypeWorker);
|
|
2835
2838
|
}
|
|
2836
2839
|
}
|
|
2837
2840
|
var TypeEmitter = class {
|
|
2838
|
-
constructor(
|
|
2839
|
-
this.
|
|
2840
|
-
this.emitReference = emitReference;
|
|
2841
|
+
constructor(translator) {
|
|
2842
|
+
this.translator = translator;
|
|
2841
2843
|
}
|
|
2842
2844
|
emitType(type) {
|
|
2843
2845
|
const typeReferenceTransformer = (context) => {
|
|
@@ -2860,51 +2862,52 @@ var TypeEmitter = class {
|
|
|
2860
2862
|
return ts18.transform(type, [typeReferenceTransformer]).transformed[0];
|
|
2861
2863
|
}
|
|
2862
2864
|
emitTypeReference(type) {
|
|
2863
|
-
const
|
|
2864
|
-
if (
|
|
2865
|
+
const translatedType = this.translator(type);
|
|
2866
|
+
if (translatedType === null) {
|
|
2865
2867
|
throw new Error("Unable to emit an unresolved reference");
|
|
2866
2868
|
}
|
|
2867
2869
|
let typeArguments = void 0;
|
|
2868
2870
|
if (type.typeArguments !== void 0) {
|
|
2869
2871
|
typeArguments = ts18.createNodeArray(type.typeArguments.map((typeArg) => this.emitType(typeArg)));
|
|
2870
2872
|
}
|
|
2871
|
-
|
|
2872
|
-
if (reference instanceof Reference) {
|
|
2873
|
-
const emittedType = this.emitReference(reference);
|
|
2874
|
-
if (!ts18.isTypeReferenceNode(emittedType)) {
|
|
2875
|
-
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts18.SyntaxKind[emittedType.kind]}`);
|
|
2876
|
-
}
|
|
2877
|
-
typeName = emittedType.typeName;
|
|
2878
|
-
}
|
|
2879
|
-
return ts18.updateTypeReferenceNode(type, typeName, typeArguments);
|
|
2873
|
+
return ts18.updateTypeReferenceNode(type, translatedType.typeName, typeArguments);
|
|
2880
2874
|
}
|
|
2881
2875
|
};
|
|
2882
2876
|
|
|
2883
|
-
// bazel-out/
|
|
2877
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
|
|
2884
2878
|
var TypeParameterEmitter = class {
|
|
2885
2879
|
constructor(typeParameters, reflector) {
|
|
2886
2880
|
this.typeParameters = typeParameters;
|
|
2887
2881
|
this.reflector = reflector;
|
|
2888
2882
|
}
|
|
2889
|
-
canEmit() {
|
|
2883
|
+
canEmit(canEmitReference) {
|
|
2890
2884
|
if (this.typeParameters === void 0) {
|
|
2891
2885
|
return true;
|
|
2892
2886
|
}
|
|
2893
2887
|
return this.typeParameters.every((typeParam) => {
|
|
2894
|
-
return this.canEmitType(typeParam.constraint) && this.canEmitType(typeParam.default);
|
|
2888
|
+
return this.canEmitType(typeParam.constraint, canEmitReference) && this.canEmitType(typeParam.default, canEmitReference);
|
|
2895
2889
|
});
|
|
2896
2890
|
}
|
|
2897
|
-
canEmitType(type) {
|
|
2891
|
+
canEmitType(type, canEmitReference) {
|
|
2898
2892
|
if (type === void 0) {
|
|
2899
2893
|
return true;
|
|
2900
2894
|
}
|
|
2901
|
-
return canEmitType(type, (typeReference) =>
|
|
2895
|
+
return canEmitType(type, (typeReference) => {
|
|
2896
|
+
const reference = this.resolveTypeReference(typeReference);
|
|
2897
|
+
if (reference === null) {
|
|
2898
|
+
return false;
|
|
2899
|
+
}
|
|
2900
|
+
if (reference instanceof Reference) {
|
|
2901
|
+
return canEmitReference(reference);
|
|
2902
|
+
}
|
|
2903
|
+
return true;
|
|
2904
|
+
});
|
|
2902
2905
|
}
|
|
2903
2906
|
emit(emitReference) {
|
|
2904
2907
|
if (this.typeParameters === void 0) {
|
|
2905
2908
|
return void 0;
|
|
2906
2909
|
}
|
|
2907
|
-
const emitter = new TypeEmitter((type) => this.
|
|
2910
|
+
const emitter = new TypeEmitter((type) => this.translateTypeReference(type, emitReference));
|
|
2908
2911
|
return this.typeParameters.map((typeParam) => {
|
|
2909
2912
|
const constraint = typeParam.constraint !== void 0 ? emitter.emitType(typeParam.constraint) : void 0;
|
|
2910
2913
|
const defaultType = typeParam.default !== void 0 ? emitter.emitType(typeParam.default) : void 0;
|
|
@@ -2927,33 +2930,38 @@ var TypeParameterEmitter = class {
|
|
|
2927
2930
|
resolutionContext: type.getSourceFile().fileName
|
|
2928
2931
|
};
|
|
2929
2932
|
}
|
|
2930
|
-
if (!this.isTopLevelExport(declaration.node)) {
|
|
2931
|
-
return null;
|
|
2932
|
-
}
|
|
2933
2933
|
return new Reference(declaration.node, owningModule);
|
|
2934
2934
|
}
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2935
|
+
translateTypeReference(type, emitReference) {
|
|
2936
|
+
const reference = this.resolveTypeReference(type);
|
|
2937
|
+
if (!(reference instanceof Reference)) {
|
|
2938
|
+
return reference;
|
|
2939
|
+
}
|
|
2940
|
+
const typeNode = emitReference(reference);
|
|
2941
|
+
if (typeNode === null) {
|
|
2942
|
+
return null;
|
|
2943
|
+
}
|
|
2944
|
+
if (!ts19.isTypeReferenceNode(typeNode)) {
|
|
2945
|
+
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts19.SyntaxKind[typeNode.kind]}.`);
|
|
2938
2946
|
}
|
|
2939
|
-
return
|
|
2947
|
+
return typeNode;
|
|
2940
2948
|
}
|
|
2941
2949
|
isLocalTypeParameter(decl) {
|
|
2942
2950
|
return this.typeParameters.some((param) => param === decl);
|
|
2943
2951
|
}
|
|
2944
2952
|
};
|
|
2945
2953
|
|
|
2946
|
-
// bazel-out/
|
|
2954
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
2947
2955
|
var TcbInliningRequirement;
|
|
2948
2956
|
(function(TcbInliningRequirement2) {
|
|
2949
2957
|
TcbInliningRequirement2[TcbInliningRequirement2["MustInline"] = 0] = "MustInline";
|
|
2950
2958
|
TcbInliningRequirement2[TcbInliningRequirement2["ShouldInlineForGenericBounds"] = 1] = "ShouldInlineForGenericBounds";
|
|
2951
2959
|
TcbInliningRequirement2[TcbInliningRequirement2["None"] = 2] = "None";
|
|
2952
2960
|
})(TcbInliningRequirement || (TcbInliningRequirement = {}));
|
|
2953
|
-
function requiresInlineTypeCheckBlock(node, usedPipes, reflector) {
|
|
2961
|
+
function requiresInlineTypeCheckBlock(node, env, usedPipes, reflector) {
|
|
2954
2962
|
if (!checkIfClassIsExported(node)) {
|
|
2955
2963
|
return TcbInliningRequirement.MustInline;
|
|
2956
|
-
} else if (!
|
|
2964
|
+
} else if (!checkIfGenericTypeBoundsCanBeEmitted(node, reflector, env)) {
|
|
2957
2965
|
return TcbInliningRequirement.ShouldInlineForGenericBounds;
|
|
2958
2966
|
} else if (Array.from(usedPipes.values()).some((pipeRef) => !checkIfClassIsExported(pipeRef.node))) {
|
|
2959
2967
|
return TcbInliningRequirement.MustInline;
|
|
@@ -3018,15 +3026,13 @@ function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
|
|
|
3018
3026
|
return commentText;
|
|
3019
3027
|
}) || null;
|
|
3020
3028
|
}
|
|
3021
|
-
function
|
|
3022
|
-
|
|
3029
|
+
function checkIfGenericTypeBoundsCanBeEmitted(node, reflector, env) {
|
|
3030
|
+
const emitter = new TypeParameterEmitter(node.typeParameters, reflector);
|
|
3031
|
+
return emitter.canEmit((ref) => env.canReferenceType(ref));
|
|
3023
3032
|
}
|
|
3024
3033
|
|
|
3025
|
-
// bazel-out/
|
|
3026
|
-
function generateTypeCtorDeclarationFn(node, meta, nodeTypeRef, typeParams
|
|
3027
|
-
if (requiresInlineTypeCtor(node, reflector)) {
|
|
3028
|
-
throw new Error(`${node.name.text} requires an inline type constructor`);
|
|
3029
|
-
}
|
|
3034
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
3035
|
+
function generateTypeCtorDeclarationFn(node, meta, nodeTypeRef, typeParams) {
|
|
3030
3036
|
const rawTypeArgs = typeParams !== void 0 ? generateGenericArgs(typeParams) : void 0;
|
|
3031
3037
|
const rawType = ts21.createTypeReferenceNode(nodeTypeRef, rawTypeArgs);
|
|
3032
3038
|
const initParam = constructTypeCtorParameter(node, meta, rawType);
|
|
@@ -3080,8 +3086,8 @@ function constructTypeCtorParameter(node, meta, rawType) {
|
|
|
3080
3086
|
function generateGenericArgs(params) {
|
|
3081
3087
|
return params.map((param) => ts21.createTypeReferenceNode(param.name, void 0));
|
|
3082
3088
|
}
|
|
3083
|
-
function requiresInlineTypeCtor(node, host) {
|
|
3084
|
-
return !
|
|
3089
|
+
function requiresInlineTypeCtor(node, host, env) {
|
|
3090
|
+
return !checkIfGenericTypeBoundsCanBeEmitted(node, host, env);
|
|
3085
3091
|
}
|
|
3086
3092
|
function typeParametersWithDefaultTypes(params) {
|
|
3087
3093
|
if (params === void 0) {
|
|
@@ -3096,7 +3102,7 @@ function typeParametersWithDefaultTypes(params) {
|
|
|
3096
3102
|
});
|
|
3097
3103
|
}
|
|
3098
3104
|
|
|
3099
|
-
// bazel-out/
|
|
3105
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
|
|
3100
3106
|
var Environment = class {
|
|
3101
3107
|
constructor(config, importManager, refEmitter, reflector, contextFile) {
|
|
3102
3108
|
this.config = config;
|
|
@@ -3108,9 +3114,9 @@ var Environment = class {
|
|
|
3108
3114
|
pipeInst: 1,
|
|
3109
3115
|
typeCtor: 1
|
|
3110
3116
|
};
|
|
3111
|
-
this.typeCtors = new Map();
|
|
3117
|
+
this.typeCtors = /* @__PURE__ */ new Map();
|
|
3112
3118
|
this.typeCtorStatements = [];
|
|
3113
|
-
this.pipeInsts = new Map();
|
|
3119
|
+
this.pipeInsts = /* @__PURE__ */ new Map();
|
|
3114
3120
|
this.pipeInstStatements = [];
|
|
3115
3121
|
}
|
|
3116
3122
|
typeCtorFor(dir) {
|
|
@@ -3119,7 +3125,7 @@ var Environment = class {
|
|
|
3119
3125
|
if (this.typeCtors.has(node)) {
|
|
3120
3126
|
return this.typeCtors.get(node);
|
|
3121
3127
|
}
|
|
3122
|
-
if (requiresInlineTypeCtor(node, this.reflector)) {
|
|
3128
|
+
if (requiresInlineTypeCtor(node, this.reflector, this)) {
|
|
3123
3129
|
const ref = this.reference(dirRef);
|
|
3124
3130
|
const typeCtorExpr = ts22.createPropertyAccess(ref, "ngTypeCtor");
|
|
3125
3131
|
this.typeCtors.set(node, typeCtorExpr);
|
|
@@ -3141,7 +3147,7 @@ var Environment = class {
|
|
|
3141
3147
|
coercedInputFields: dir.coercedInputFields
|
|
3142
3148
|
};
|
|
3143
3149
|
const typeParams = this.emitTypeParameters(node);
|
|
3144
|
-
const typeCtor = generateTypeCtorDeclarationFn(node, meta, nodeTypeRef.typeName, typeParams
|
|
3150
|
+
const typeCtor = generateTypeCtorDeclarationFn(node, meta, nodeTypeRef.typeName, typeParams);
|
|
3145
3151
|
this.typeCtorStatements.push(typeCtor);
|
|
3146
3152
|
const fnId = ts22.createIdentifier(fnName);
|
|
3147
3153
|
this.typeCtors.set(node, fnId);
|
|
@@ -3160,10 +3166,16 @@ var Environment = class {
|
|
|
3160
3166
|
}
|
|
3161
3167
|
reference(ref) {
|
|
3162
3168
|
const ngExpr = this.refEmitter.emit(ref, this.contextFile, ImportFlags.NoAliasing);
|
|
3169
|
+
assertSuccessfulReferenceEmit(ngExpr, this.contextFile, "class");
|
|
3163
3170
|
return translateExpression(ngExpr.expression, this.importManager);
|
|
3164
3171
|
}
|
|
3172
|
+
canReferenceType(ref) {
|
|
3173
|
+
const result = this.refEmitter.emit(ref, this.contextFile, ImportFlags.NoAliasing | ImportFlags.AllowTypeImports);
|
|
3174
|
+
return result.kind === 0;
|
|
3175
|
+
}
|
|
3165
3176
|
referenceType(ref) {
|
|
3166
3177
|
const ngExpr = this.refEmitter.emit(ref, this.contextFile, ImportFlags.NoAliasing | ImportFlags.AllowTypeImports);
|
|
3178
|
+
assertSuccessfulReferenceEmit(ngExpr, this.contextFile, "symbol");
|
|
3167
3179
|
return translateType(new ExpressionType(ngExpr.expression), this.importManager);
|
|
3168
3180
|
}
|
|
3169
3181
|
emitTypeParameters(declaration) {
|
|
@@ -3182,14 +3194,14 @@ var Environment = class {
|
|
|
3182
3194
|
}
|
|
3183
3195
|
};
|
|
3184
3196
|
|
|
3185
|
-
// bazel-out/
|
|
3197
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/oob.mjs
|
|
3186
3198
|
import { TmplAstElement as TmplAstElement2 } from "@angular/compiler";
|
|
3187
3199
|
import ts23 from "typescript";
|
|
3188
3200
|
var OutOfBandDiagnosticRecorderImpl = class {
|
|
3189
3201
|
constructor(resolver) {
|
|
3190
3202
|
this.resolver = resolver;
|
|
3191
3203
|
this._diagnostics = [];
|
|
3192
|
-
this.recordedPipes = new Set();
|
|
3204
|
+
this.recordedPipes = /* @__PURE__ */ new Set();
|
|
3193
3205
|
}
|
|
3194
3206
|
get diagnostics() {
|
|
3195
3207
|
return this._diagnostics;
|
|
@@ -3314,7 +3326,7 @@ function makeInlineDiagnostic(templateId, code, node, messageText, relatedInform
|
|
|
3314
3326
|
});
|
|
3315
3327
|
}
|
|
3316
3328
|
|
|
3317
|
-
// bazel-out/
|
|
3329
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/shim.mjs
|
|
3318
3330
|
import ts24 from "typescript";
|
|
3319
3331
|
var TypeCheckShimGenerator = class {
|
|
3320
3332
|
constructor() {
|
|
@@ -3332,11 +3344,11 @@ var TypeCheckShimGenerator = class {
|
|
|
3332
3344
|
}
|
|
3333
3345
|
};
|
|
3334
3346
|
|
|
3335
|
-
// bazel-out/
|
|
3336
|
-
import { BindingPipe, Call as Call2, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver4, PropertyRead as
|
|
3347
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
3348
|
+
import { BindingPipe, Call as Call2, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver4, PropertyRead as PropertyRead4, PropertyWrite as PropertyWrite3, SafeCall, SafePropertyRead as SafePropertyRead3, ThisReceiver, TmplAstBoundAttribute, TmplAstBoundText, TmplAstElement as TmplAstElement3, TmplAstIcu, TmplAstReference as TmplAstReference3, TmplAstTemplate as TmplAstTemplate2, TmplAstTextAttribute as TmplAstTextAttribute2, TmplAstVariable as TmplAstVariable2 } from "@angular/compiler";
|
|
3337
3349
|
import ts27 from "typescript";
|
|
3338
3350
|
|
|
3339
|
-
// bazel-out/
|
|
3351
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.mjs
|
|
3340
3352
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan3 } from "@angular/compiler";
|
|
3341
3353
|
import ts25 from "typescript";
|
|
3342
3354
|
function wrapForDiagnostics(expr) {
|
|
@@ -3382,16 +3394,16 @@ function translateDiagnostic(diagnostic, resolver) {
|
|
|
3382
3394
|
return makeTemplateDiagnostic(sourceLocation.id, templateSourceMapping, span, diagnostic.category, diagnostic.code, diagnostic.messageText);
|
|
3383
3395
|
}
|
|
3384
3396
|
|
|
3385
|
-
// bazel-out/
|
|
3386
|
-
import { ASTWithSource as ASTWithSource2, Call, EmptyExpr as EmptyExpr2, SafeKeyedRead, SafePropertyRead as SafePropertyRead2 } from "@angular/compiler";
|
|
3397
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/expression.mjs
|
|
3398
|
+
import { ASTWithSource as ASTWithSource2, Call, EmptyExpr as EmptyExpr2, PropertyRead as PropertyRead3, SafeKeyedRead, SafePropertyRead as SafePropertyRead2 } from "@angular/compiler";
|
|
3387
3399
|
import ts26 from "typescript";
|
|
3388
3400
|
var NULL_AS_ANY = ts26.createAsExpression(ts26.createNull(), ts26.createKeywordTypeNode(ts26.SyntaxKind.AnyKeyword));
|
|
3389
3401
|
var UNDEFINED = ts26.createIdentifier("undefined");
|
|
3390
|
-
var UNARY_OPS = new Map([
|
|
3402
|
+
var UNARY_OPS = /* @__PURE__ */ new Map([
|
|
3391
3403
|
["+", ts26.SyntaxKind.PlusToken],
|
|
3392
3404
|
["-", ts26.SyntaxKind.MinusToken]
|
|
3393
3405
|
]);
|
|
3394
|
-
var BINARY_OPS = new Map([
|
|
3406
|
+
var BINARY_OPS = /* @__PURE__ */ new Map([
|
|
3395
3407
|
["+", ts26.SyntaxKind.PlusToken],
|
|
3396
3408
|
["-", ts26.SyntaxKind.MinusToken],
|
|
3397
3409
|
["<", ts26.SyntaxKind.LessThanToken],
|
|
@@ -3597,23 +3609,46 @@ var AstTranslator = class {
|
|
|
3597
3609
|
}
|
|
3598
3610
|
visitCall(ast) {
|
|
3599
3611
|
const args = ast.args.map((expr2) => this.translate(expr2));
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
if (
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
3607
|
-
node = ts26.createCall(tsCastToAny(expr), void 0, args);
|
|
3612
|
+
let expr;
|
|
3613
|
+
const receiver = ast.receiver;
|
|
3614
|
+
if (receiver instanceof PropertyRead3) {
|
|
3615
|
+
const resolved = this.maybeResolve(receiver);
|
|
3616
|
+
if (resolved !== null) {
|
|
3617
|
+
expr = resolved;
|
|
3608
3618
|
} else {
|
|
3609
|
-
|
|
3619
|
+
const propertyReceiver = wrapForDiagnostics(this.translate(receiver.receiver));
|
|
3620
|
+
expr = ts26.createPropertyAccess(propertyReceiver, receiver.name);
|
|
3621
|
+
addParseSpanInfo(expr, receiver.nameSpan);
|
|
3610
3622
|
}
|
|
3623
|
+
} else {
|
|
3624
|
+
expr = this.translate(receiver);
|
|
3625
|
+
}
|
|
3626
|
+
let node;
|
|
3627
|
+
if (ast.receiver instanceof SafePropertyRead2 || ast.receiver instanceof SafeKeyedRead) {
|
|
3628
|
+
node = this.convertToSafeCall(ast, expr, args);
|
|
3611
3629
|
} else {
|
|
3612
3630
|
node = ts26.createCall(expr, void 0, args);
|
|
3613
3631
|
}
|
|
3614
3632
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3615
3633
|
return node;
|
|
3616
3634
|
}
|
|
3635
|
+
visitSafeCall(ast) {
|
|
3636
|
+
const args = ast.args.map((expr2) => this.translate(expr2));
|
|
3637
|
+
const expr = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3638
|
+
const node = this.convertToSafeCall(ast, expr, args);
|
|
3639
|
+
addParseSpanInfo(node, ast.sourceSpan);
|
|
3640
|
+
return node;
|
|
3641
|
+
}
|
|
3642
|
+
convertToSafeCall(ast, expr, args) {
|
|
3643
|
+
if (this.config.strictSafeNavigationTypes) {
|
|
3644
|
+
const call = ts26.createCall(ts26.createNonNullExpression(expr), void 0, args);
|
|
3645
|
+
return ts26.createParen(ts26.createConditional(NULL_AS_ANY, call, UNDEFINED));
|
|
3646
|
+
}
|
|
3647
|
+
if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
3648
|
+
return ts26.createCall(tsCastToAny(expr), void 0, args);
|
|
3649
|
+
}
|
|
3650
|
+
return tsCastToAny(ts26.createCall(ts26.createNonNullExpression(expr), void 0, args));
|
|
3651
|
+
}
|
|
3617
3652
|
};
|
|
3618
3653
|
var VeSafeLhsInferenceBugDetector = class {
|
|
3619
3654
|
static veWillInferAnyFor(ast) {
|
|
@@ -3635,6 +3670,9 @@ var VeSafeLhsInferenceBugDetector = class {
|
|
|
3635
3670
|
visitCall(ast) {
|
|
3636
3671
|
return true;
|
|
3637
3672
|
}
|
|
3673
|
+
visitSafeCall(ast) {
|
|
3674
|
+
return false;
|
|
3675
|
+
}
|
|
3638
3676
|
visitImplicitReceiver(ast) {
|
|
3639
3677
|
return false;
|
|
3640
3678
|
}
|
|
@@ -3686,7 +3724,7 @@ var VeSafeLhsInferenceBugDetector = class {
|
|
|
3686
3724
|
};
|
|
3687
3725
|
VeSafeLhsInferenceBugDetector.SINGLETON = new VeSafeLhsInferenceBugDetector();
|
|
3688
3726
|
|
|
3689
|
-
// bazel-out/
|
|
3727
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_semantics.mjs
|
|
3690
3728
|
import { ImplicitReceiver as ImplicitReceiver3, RecursiveAstVisitor as RecursiveAstVisitor2, TmplAstVariable } from "@angular/compiler";
|
|
3691
3729
|
var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
|
|
3692
3730
|
constructor(templateId, boundTarget, oob) {
|
|
@@ -3710,7 +3748,7 @@ var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
|
|
|
3710
3748
|
}
|
|
3711
3749
|
};
|
|
3712
3750
|
|
|
3713
|
-
// bazel-out/
|
|
3751
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
3714
3752
|
var TcbGenericContextBehavior;
|
|
3715
3753
|
(function(TcbGenericContextBehavior2) {
|
|
3716
3754
|
TcbGenericContextBehavior2[TcbGenericContextBehavior2["UseEmitter"] = 0] = "UseEmitter";
|
|
@@ -4002,7 +4040,7 @@ var TcbDirectiveCtorOp = class extends TcbOp {
|
|
|
4002
4040
|
const id = this.tcb.allocateId();
|
|
4003
4041
|
addExpressionIdentifier(id, ExpressionIdentifier.DIRECTIVE);
|
|
4004
4042
|
addParseSpanInfo(id, this.node.startSourceSpan || this.node.sourceSpan);
|
|
4005
|
-
const genericInputs = new Map();
|
|
4043
|
+
const genericInputs = /* @__PURE__ */ new Map();
|
|
4006
4044
|
const inputs = getBoundInputs(this.dir, this.node, this.tcb);
|
|
4007
4045
|
for (const input of inputs) {
|
|
4008
4046
|
if (!this.tcb.env.config.checkTypeOfAttributes && input.attribute instanceof TmplAstTextAttribute2) {
|
|
@@ -4325,11 +4363,11 @@ var Scope = class {
|
|
|
4325
4363
|
this.parent = parent;
|
|
4326
4364
|
this.guard = guard;
|
|
4327
4365
|
this.opQueue = [];
|
|
4328
|
-
this.elementOpMap = new Map();
|
|
4329
|
-
this.directiveOpMap = new Map();
|
|
4330
|
-
this.referenceOpMap = new Map();
|
|
4331
|
-
this.templateCtxOpMap = new Map();
|
|
4332
|
-
this.varMap = new Map();
|
|
4366
|
+
this.elementOpMap = /* @__PURE__ */ new Map();
|
|
4367
|
+
this.directiveOpMap = /* @__PURE__ */ new Map();
|
|
4368
|
+
this.referenceOpMap = /* @__PURE__ */ new Map();
|
|
4369
|
+
this.templateCtxOpMap = /* @__PURE__ */ new Map();
|
|
4370
|
+
this.varMap = /* @__PURE__ */ new Map();
|
|
4333
4371
|
this.statements = [];
|
|
4334
4372
|
}
|
|
4335
4373
|
static forNodes(tcb, parent, templateOrNodes, guard) {
|
|
@@ -4339,7 +4377,7 @@ var Scope = class {
|
|
|
4339
4377
|
}
|
|
4340
4378
|
let children;
|
|
4341
4379
|
if (templateOrNodes instanceof TmplAstTemplate2) {
|
|
4342
|
-
const varMap = new Map();
|
|
4380
|
+
const varMap = /* @__PURE__ */ new Map();
|
|
4343
4381
|
for (const v of templateOrNodes.variables) {
|
|
4344
4382
|
if (!varMap.has(v.name)) {
|
|
4345
4383
|
varMap.set(v.name, v);
|
|
@@ -4477,7 +4515,7 @@ var Scope = class {
|
|
|
4477
4515
|
}
|
|
4478
4516
|
}
|
|
4479
4517
|
appendDirectivesAndInputsOfNode(node) {
|
|
4480
|
-
const claimedInputs = new Set();
|
|
4518
|
+
const claimedInputs = /* @__PURE__ */ new Set();
|
|
4481
4519
|
const directives = this.tcb.boundTarget.getDirectivesOfNode(node);
|
|
4482
4520
|
if (directives === null || directives.length === 0) {
|
|
4483
4521
|
if (node instanceof TmplAstElement3) {
|
|
@@ -4486,14 +4524,14 @@ var Scope = class {
|
|
|
4486
4524
|
}
|
|
4487
4525
|
return;
|
|
4488
4526
|
}
|
|
4489
|
-
const dirMap = new Map();
|
|
4527
|
+
const dirMap = /* @__PURE__ */ new Map();
|
|
4490
4528
|
for (const dir of directives) {
|
|
4491
4529
|
let directiveOp;
|
|
4492
4530
|
const host = this.tcb.env.reflector;
|
|
4493
4531
|
const dirRef = dir.ref;
|
|
4494
4532
|
if (!dir.isGeneric) {
|
|
4495
4533
|
directiveOp = new TcbNonGenericDirectiveTypeOp(this.tcb, this, node, dir);
|
|
4496
|
-
} else if (!requiresInlineTypeCtor(dirRef.node, host) || this.tcb.env.config.useInlineTypeConstructors) {
|
|
4534
|
+
} else if (!requiresInlineTypeCtor(dirRef.node, host, this.tcb.env) || this.tcb.env.config.useInlineTypeConstructors) {
|
|
4497
4535
|
directiveOp = new TcbDirectiveCtorOp(this.tcb, this, node, dir);
|
|
4498
4536
|
} else {
|
|
4499
4537
|
directiveOp = new TcbGenericDirectiveTypeWithAnyParamsOp(this.tcb, this, node, dir);
|
|
@@ -4515,7 +4553,7 @@ var Scope = class {
|
|
|
4515
4553
|
}
|
|
4516
4554
|
}
|
|
4517
4555
|
appendOutputsOfNode(node) {
|
|
4518
|
-
const claimedOutputs = new Set();
|
|
4556
|
+
const claimedOutputs = /* @__PURE__ */ new Set();
|
|
4519
4557
|
const directives = this.tcb.boundTarget.getDirectivesOfNode(node);
|
|
4520
4558
|
if (directives === null || directives.length === 0) {
|
|
4521
4559
|
if (node instanceof TmplAstElement3) {
|
|
@@ -4541,7 +4579,7 @@ var Scope = class {
|
|
|
4541
4579
|
continue;
|
|
4542
4580
|
}
|
|
4543
4581
|
if (node instanceof TmplAstElement3) {
|
|
4544
|
-
const claimedInputs = new Set();
|
|
4582
|
+
const claimedInputs = /* @__PURE__ */ new Set();
|
|
4545
4583
|
const directives = this.tcb.boundTarget.getDirectivesOfNode(node);
|
|
4546
4584
|
let hasDirectives;
|
|
4547
4585
|
if (directives === null || directives.length === 0) {
|
|
@@ -4587,9 +4625,9 @@ var TcbExpressionTranslator = class {
|
|
|
4587
4625
|
return astToTypescript(ast, (ast2) => this.resolve(ast2), this.tcb.env.config);
|
|
4588
4626
|
}
|
|
4589
4627
|
resolve(ast) {
|
|
4590
|
-
if (ast instanceof
|
|
4628
|
+
if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver4) {
|
|
4591
4629
|
return this.resolveTarget(ast);
|
|
4592
|
-
} else if (ast instanceof
|
|
4630
|
+
} else if (ast instanceof PropertyWrite3 && ast.receiver instanceof ImplicitReceiver4) {
|
|
4593
4631
|
const target = this.resolveTarget(ast);
|
|
4594
4632
|
if (target === null) {
|
|
4595
4633
|
return null;
|
|
@@ -4619,8 +4657,8 @@ var TcbExpressionTranslator = class {
|
|
|
4619
4657
|
const result = ts27.createCall(methodAccess, void 0, [expr, ...args]);
|
|
4620
4658
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
4621
4659
|
return result;
|
|
4622
|
-
} else if (ast instanceof Call2
|
|
4623
|
-
if (ast.receiver.name === "$any" && ast.args.length === 1) {
|
|
4660
|
+
} else if ((ast instanceof Call2 || ast instanceof SafeCall) && (ast.receiver instanceof PropertyRead4 || ast.receiver instanceof SafePropertyRead3)) {
|
|
4661
|
+
if (ast.receiver.receiver instanceof ImplicitReceiver4 && !(ast.receiver.receiver instanceof ThisReceiver) && ast.receiver.name === "$any" && ast.args.length === 1) {
|
|
4624
4662
|
const expr = this.translate(ast.args[0]);
|
|
4625
4663
|
const exprAsAny = ts27.createAsExpression(expr, ts27.createKeywordTypeNode(ts27.SyntaxKind.AnyKeyword));
|
|
4626
4664
|
const result = ts27.createParen(exprAsAny);
|
|
@@ -4751,7 +4789,7 @@ function isSplitTwoWayBinding(inputName, output, inputs, tcb) {
|
|
|
4751
4789
|
}
|
|
4752
4790
|
var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
|
|
4753
4791
|
resolve(ast) {
|
|
4754
|
-
if (ast instanceof
|
|
4792
|
+
if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver4 && !(ast.receiver instanceof ThisReceiver) && ast.name === EVENT_PARAMETER) {
|
|
4755
4793
|
const event = ts27.createIdentifier(EVENT_PARAMETER);
|
|
4756
4794
|
addParseSpanInfo(event, ast.nameSpan);
|
|
4757
4795
|
return event;
|
|
@@ -4760,7 +4798,7 @@ var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
|
|
|
4760
4798
|
}
|
|
4761
4799
|
};
|
|
4762
4800
|
|
|
4763
|
-
// bazel-out/
|
|
4801
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_file.mjs
|
|
4764
4802
|
import ts28 from "typescript";
|
|
4765
4803
|
var TypeCheckFile = class extends Environment {
|
|
4766
4804
|
constructor(fileName, config, refEmitter, reflector, compilerHost) {
|
|
@@ -4796,7 +4834,7 @@ var TypeCheckFile = class extends Environment {
|
|
|
4796
4834
|
}
|
|
4797
4835
|
};
|
|
4798
4836
|
|
|
4799
|
-
// bazel-out/
|
|
4837
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
|
|
4800
4838
|
var InliningMode;
|
|
4801
4839
|
(function(InliningMode2) {
|
|
4802
4840
|
InliningMode2[InliningMode2["InlineOps"] = 0] = "InlineOps";
|
|
@@ -4811,9 +4849,9 @@ var TypeCheckContextImpl = class {
|
|
|
4811
4849
|
this.host = host;
|
|
4812
4850
|
this.inlining = inlining;
|
|
4813
4851
|
this.perf = perf;
|
|
4814
|
-
this.fileMap = new Map();
|
|
4815
|
-
this.opMap = new Map();
|
|
4816
|
-
this.typeCtorPending = new Set();
|
|
4852
|
+
this.fileMap = /* @__PURE__ */ new Map();
|
|
4853
|
+
this.opMap = /* @__PURE__ */ new Map();
|
|
4854
|
+
this.typeCtorPending = /* @__PURE__ */ new Set();
|
|
4817
4855
|
if (inlining === InliningMode.Error && config.useInlineTypeConstructors) {
|
|
4818
4856
|
throw new Error(`AssertionError: invalid inlining configuration.`);
|
|
4819
4857
|
}
|
|
@@ -4834,7 +4872,7 @@ var TypeCheckContextImpl = class {
|
|
|
4834
4872
|
for (const dir of boundTarget.getUsedDirectives()) {
|
|
4835
4873
|
const dirRef = dir.ref;
|
|
4836
4874
|
const dirNode = dirRef.node;
|
|
4837
|
-
if (!dir.isGeneric || !requiresInlineTypeCtor(dirNode, this.reflector)) {
|
|
4875
|
+
if (!dir.isGeneric || !requiresInlineTypeCtor(dirNode, this.reflector, shimData.file)) {
|
|
4838
4876
|
continue;
|
|
4839
4877
|
}
|
|
4840
4878
|
this.addInlineTypeCtor(fileData, dirNode.getSourceFile(), dirRef, {
|
|
@@ -4854,7 +4892,7 @@ var TypeCheckContextImpl = class {
|
|
|
4854
4892
|
boundTarget,
|
|
4855
4893
|
templateDiagnostics
|
|
4856
4894
|
});
|
|
4857
|
-
const inliningRequirement = requiresInlineTypeCheckBlock(ref.node, pipes, this.reflector);
|
|
4895
|
+
const inliningRequirement = requiresInlineTypeCheckBlock(ref.node, shimData.file, pipes, this.reflector);
|
|
4858
4896
|
if (this.inlining === InliningMode.Error && inliningRequirement === TcbInliningRequirement.MustInline) {
|
|
4859
4897
|
shimData.oobRecorder.requiresInlineTcb(templateId, ref.node);
|
|
4860
4898
|
this.perf.eventCount(PerfEvent.SkipGenerateTcbNoInline);
|
|
@@ -4905,7 +4943,7 @@ var TypeCheckContextImpl = class {
|
|
|
4905
4943
|
return code;
|
|
4906
4944
|
}
|
|
4907
4945
|
finalize() {
|
|
4908
|
-
const updates = new Map();
|
|
4946
|
+
const updates = /* @__PURE__ */ new Map();
|
|
4909
4947
|
for (const originalSf of this.opMap.keys()) {
|
|
4910
4948
|
const newText = this.transform(originalSf);
|
|
4911
4949
|
if (newText !== null) {
|
|
@@ -4952,7 +4990,7 @@ var TypeCheckContextImpl = class {
|
|
|
4952
4990
|
domSchemaChecker: new RegistryDomSchemaChecker(fileData.sourceManager),
|
|
4953
4991
|
oobRecorder: new OutOfBandDiagnosticRecorderImpl(fileData.sourceManager),
|
|
4954
4992
|
file: new TypeCheckFile(shimPath, this.config, this.refEmitter, this.reflector, this.compilerHost),
|
|
4955
|
-
templates: new Map()
|
|
4993
|
+
templates: /* @__PURE__ */ new Map()
|
|
4956
4994
|
});
|
|
4957
4995
|
}
|
|
4958
4996
|
return fileData.shimData.get(shimPath);
|
|
@@ -4963,7 +5001,7 @@ var TypeCheckContextImpl = class {
|
|
|
4963
5001
|
const data = {
|
|
4964
5002
|
hasInlines: false,
|
|
4965
5003
|
sourceManager: this.host.getSourceManager(sfPath),
|
|
4966
|
-
shimData: new Map()
|
|
5004
|
+
shimData: /* @__PURE__ */ new Map()
|
|
4967
5005
|
};
|
|
4968
5006
|
this.fileMap.set(sfPath, data);
|
|
4969
5007
|
}
|
|
@@ -5026,10 +5064,10 @@ function splitStringAtPoints(str, points) {
|
|
|
5026
5064
|
return splits;
|
|
5027
5065
|
}
|
|
5028
5066
|
|
|
5029
|
-
// bazel-out/
|
|
5067
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/source.mjs
|
|
5030
5068
|
import { ParseLocation, ParseSourceSpan } from "@angular/compiler";
|
|
5031
5069
|
|
|
5032
|
-
// bazel-out/
|
|
5070
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/line_mappings.mjs
|
|
5033
5071
|
var LF_CHAR = 10;
|
|
5034
5072
|
var CR_CHAR = 13;
|
|
5035
5073
|
var LINE_SEP_CHAR = 8232;
|
|
@@ -5070,7 +5108,7 @@ function findClosestLineStartPosition(linesMap, position, low = 0, high = linesM
|
|
|
5070
5108
|
return low - 1;
|
|
5071
5109
|
}
|
|
5072
5110
|
|
|
5073
|
-
// bazel-out/
|
|
5111
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/source.mjs
|
|
5074
5112
|
var TemplateSource = class {
|
|
5075
5113
|
constructor(mapping, file) {
|
|
5076
5114
|
this.mapping = mapping;
|
|
@@ -5096,7 +5134,7 @@ var TemplateSource = class {
|
|
|
5096
5134
|
};
|
|
5097
5135
|
var TemplateSourceManager = class {
|
|
5098
5136
|
constructor() {
|
|
5099
|
-
this.templateSources = new Map();
|
|
5137
|
+
this.templateSources = /* @__PURE__ */ new Map();
|
|
5100
5138
|
}
|
|
5101
5139
|
getTemplateId(node) {
|
|
5102
5140
|
return getTemplateId(node);
|
|
@@ -5121,8 +5159,8 @@ var TemplateSourceManager = class {
|
|
|
5121
5159
|
}
|
|
5122
5160
|
};
|
|
5123
5161
|
|
|
5124
|
-
// bazel-out/
|
|
5125
|
-
import { AST, ASTWithSource as ASTWithSource3, BindingPipe as BindingPipe2, PropertyRead as
|
|
5162
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_symbol_builder.mjs
|
|
5163
|
+
import { AST, ASTWithSource as ASTWithSource3, BindingPipe as BindingPipe2, PropertyRead as PropertyRead5, PropertyWrite as PropertyWrite4, SafePropertyRead as SafePropertyRead4, TmplAstBoundAttribute as TmplAstBoundAttribute2, TmplAstBoundEvent, TmplAstElement as TmplAstElement4, TmplAstReference as TmplAstReference4, TmplAstTemplate as TmplAstTemplate3, TmplAstTextAttribute as TmplAstTextAttribute3, TmplAstVariable as TmplAstVariable3 } from "@angular/compiler";
|
|
5126
5164
|
import ts30 from "typescript";
|
|
5127
5165
|
var SymbolBuilder = class {
|
|
5128
5166
|
constructor(shimPath, typeCheckBlock, templateData, componentScopeReader, getTypeChecker) {
|
|
@@ -5131,7 +5169,7 @@ var SymbolBuilder = class {
|
|
|
5131
5169
|
this.templateData = templateData;
|
|
5132
5170
|
this.componentScopeReader = componentScopeReader;
|
|
5133
5171
|
this.getTypeChecker = getTypeChecker;
|
|
5134
|
-
this.symbolCache = new Map();
|
|
5172
|
+
this.symbolCache = /* @__PURE__ */ new Map();
|
|
5135
5173
|
}
|
|
5136
5174
|
getSymbol(node) {
|
|
5137
5175
|
if (this.symbolCache.has(node)) {
|
|
@@ -5474,11 +5512,11 @@ var SymbolBuilder = class {
|
|
|
5474
5512
|
return this.getSymbol(expressionTarget);
|
|
5475
5513
|
}
|
|
5476
5514
|
let withSpan = expression.sourceSpan;
|
|
5477
|
-
if (expression instanceof
|
|
5515
|
+
if (expression instanceof PropertyWrite4) {
|
|
5478
5516
|
withSpan = expression.nameSpan;
|
|
5479
5517
|
}
|
|
5480
5518
|
let node = null;
|
|
5481
|
-
if (expression instanceof
|
|
5519
|
+
if (expression instanceof PropertyRead5) {
|
|
5482
5520
|
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: ts30.isPropertyAccessExpression });
|
|
5483
5521
|
}
|
|
5484
5522
|
if (node === null) {
|
|
@@ -5546,7 +5584,7 @@ function sourceSpanEqual(a, b) {
|
|
|
5546
5584
|
return a.start.offset === b.start.offset && a.end.offset === b.end.offset;
|
|
5547
5585
|
}
|
|
5548
5586
|
|
|
5549
|
-
// bazel-out/
|
|
5587
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
|
|
5550
5588
|
var REGISTRY2 = new DomElementSchemaRegistry2();
|
|
5551
5589
|
var TemplateTypeCheckerImpl = class {
|
|
5552
5590
|
constructor(originalProgram, programDriver, typeCheckAdapter, config, refEmitter, reflector, compilerHost, priorBuild, componentScopeReader, typeCheckScopeRegistry, perf) {
|
|
@@ -5561,11 +5599,11 @@ var TemplateTypeCheckerImpl = class {
|
|
|
5561
5599
|
this.componentScopeReader = componentScopeReader;
|
|
5562
5600
|
this.typeCheckScopeRegistry = typeCheckScopeRegistry;
|
|
5563
5601
|
this.perf = perf;
|
|
5564
|
-
this.state = new Map();
|
|
5565
|
-
this.completionCache = new Map();
|
|
5566
|
-
this.symbolBuilderCache = new Map();
|
|
5567
|
-
this.scopeCache = new Map();
|
|
5568
|
-
this.elementTagCache = new Map();
|
|
5602
|
+
this.state = /* @__PURE__ */ new Map();
|
|
5603
|
+
this.completionCache = /* @__PURE__ */ new Map();
|
|
5604
|
+
this.symbolBuilderCache = /* @__PURE__ */ new Map();
|
|
5605
|
+
this.scopeCache = /* @__PURE__ */ new Map();
|
|
5606
|
+
this.elementTagCache = /* @__PURE__ */ new Map();
|
|
5569
5607
|
this.isComplete = false;
|
|
5570
5608
|
}
|
|
5571
5609
|
getTemplate(component) {
|
|
@@ -5848,7 +5886,7 @@ var TemplateTypeCheckerImpl = class {
|
|
|
5848
5886
|
hasInlines: false,
|
|
5849
5887
|
sourceManager: new TemplateSourceManager(),
|
|
5850
5888
|
isComplete: false,
|
|
5851
|
-
shimData: new Map()
|
|
5889
|
+
shimData: /* @__PURE__ */ new Map()
|
|
5852
5890
|
});
|
|
5853
5891
|
}
|
|
5854
5892
|
return this.state.get(path2);
|
|
@@ -5896,7 +5934,7 @@ var TemplateTypeCheckerImpl = class {
|
|
|
5896
5934
|
if (this.elementTagCache.has(component)) {
|
|
5897
5935
|
return this.elementTagCache.get(component);
|
|
5898
5936
|
}
|
|
5899
|
-
const tagMap = new Map();
|
|
5937
|
+
const tagMap = /* @__PURE__ */ new Map();
|
|
5900
5938
|
for (const tag of REGISTRY2.allKnownElementNames()) {
|
|
5901
5939
|
tagMap.set(tag, null);
|
|
5902
5940
|
}
|
|
@@ -6062,30 +6100,10 @@ var SingleShimTypeCheckingHost = class extends SingleFileTypeCheckingHost {
|
|
|
6062
6100
|
}
|
|
6063
6101
|
};
|
|
6064
6102
|
|
|
6065
|
-
// bazel-out/
|
|
6066
|
-
var ExtendedTemplateCheckerImpl = class {
|
|
6067
|
-
constructor(templateTypeChecker, typeChecker, templateChecks) {
|
|
6068
|
-
this.templateChecks = templateChecks;
|
|
6069
|
-
this.ctx = { templateTypeChecker, typeChecker };
|
|
6070
|
-
}
|
|
6071
|
-
getDiagnosticsForComponent(component) {
|
|
6072
|
-
const template = this.ctx.templateTypeChecker.getTemplate(component);
|
|
6073
|
-
if (template === null) {
|
|
6074
|
-
return [];
|
|
6075
|
-
}
|
|
6076
|
-
const diagnostics = [];
|
|
6077
|
-
for (const check of this.templateChecks) {
|
|
6078
|
-
diagnostics.push(...check.run(this.ctx, component, template));
|
|
6079
|
-
}
|
|
6080
|
-
return diagnostics;
|
|
6081
|
-
}
|
|
6082
|
-
};
|
|
6083
|
-
|
|
6084
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.mjs
|
|
6103
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.mjs
|
|
6085
6104
|
import { TmplAstBoundEvent as TmplAstBoundEvent2 } from "@angular/compiler";
|
|
6086
|
-
import ts31 from "typescript";
|
|
6087
6105
|
|
|
6088
|
-
// bazel-out/
|
|
6106
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/api/api.mjs
|
|
6089
6107
|
import { ASTWithSource as ASTWithSource4, RecursiveAstVisitor as RecursiveAstVisitor3 } from "@angular/compiler";
|
|
6090
6108
|
var TemplateCheckWithVisitor = class {
|
|
6091
6109
|
run(ctx, component, template) {
|
|
@@ -6162,7 +6180,7 @@ var TemplateVisitor2 = class extends RecursiveAstVisitor3 {
|
|
|
6162
6180
|
}
|
|
6163
6181
|
};
|
|
6164
6182
|
|
|
6165
|
-
// bazel-out/
|
|
6183
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.mjs
|
|
6166
6184
|
var InvalidBananaInBoxCheck = class extends TemplateCheckWithVisitor {
|
|
6167
6185
|
constructor() {
|
|
6168
6186
|
super(...arguments);
|
|
@@ -6176,15 +6194,19 @@ var InvalidBananaInBoxCheck = class extends TemplateCheckWithVisitor {
|
|
|
6176
6194
|
return [];
|
|
6177
6195
|
const boundSyntax = node.sourceSpan.toString();
|
|
6178
6196
|
const expectedBoundSyntax = boundSyntax.replace(`(${name})`, `[(${name.slice(1, -1)})]`);
|
|
6179
|
-
const diagnostic = ctx.
|
|
6197
|
+
const diagnostic = ctx.makeTemplateDiagnostic(node.sourceSpan, `In the two-way binding syntax the parentheses should be inside the brackets, ex. '${expectedBoundSyntax}'.
|
|
6180
6198
|
Find more at https://angular.io/guide/two-way-binding`);
|
|
6181
6199
|
return [diagnostic];
|
|
6182
6200
|
}
|
|
6183
6201
|
};
|
|
6202
|
+
var factory = {
|
|
6203
|
+
code: ErrorCode.INVALID_BANANA_IN_BOX,
|
|
6204
|
+
name: ExtendedTemplateDiagnosticName.INVALID_BANANA_IN_BOX,
|
|
6205
|
+
create: () => new InvalidBananaInBoxCheck()
|
|
6206
|
+
};
|
|
6184
6207
|
|
|
6185
|
-
// bazel-out/
|
|
6208
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.mjs
|
|
6186
6209
|
import { Binary } from "@angular/compiler";
|
|
6187
|
-
import ts32 from "typescript";
|
|
6188
6210
|
var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
6189
6211
|
constructor() {
|
|
6190
6212
|
super(...arguments);
|
|
@@ -6205,12 +6227,91 @@ var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
6205
6227
|
return [];
|
|
6206
6228
|
}
|
|
6207
6229
|
const span = ctx.templateTypeChecker.getTemplateMappingAtShimLocation(symbol.shimLocation).span;
|
|
6208
|
-
const diagnostic = ctx.
|
|
6230
|
+
const diagnostic = ctx.makeTemplateDiagnostic(span, `The left side of this nullish coalescing operation does not include 'null' or 'undefined' in its type, therefore the '??' operator can be safely removed.`);
|
|
6209
6231
|
return [diagnostic];
|
|
6210
6232
|
}
|
|
6211
6233
|
};
|
|
6234
|
+
var factory2 = {
|
|
6235
|
+
code: ErrorCode.NULLISH_COALESCING_NOT_NULLABLE,
|
|
6236
|
+
name: ExtendedTemplateDiagnosticName.NULLISH_COALESCING_NOT_NULLABLE,
|
|
6237
|
+
create: (options) => {
|
|
6238
|
+
if (options.strictNullChecks === false) {
|
|
6239
|
+
return null;
|
|
6240
|
+
}
|
|
6241
|
+
return new NullishCoalescingNotNullableCheck();
|
|
6242
|
+
}
|
|
6243
|
+
};
|
|
6244
|
+
|
|
6245
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
|
|
6246
|
+
import ts31 from "typescript";
|
|
6247
|
+
|
|
6248
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/api/src/public_options.mjs
|
|
6249
|
+
var DiagnosticCategoryLabel;
|
|
6250
|
+
(function(DiagnosticCategoryLabel2) {
|
|
6251
|
+
DiagnosticCategoryLabel2["Warning"] = "warning";
|
|
6252
|
+
DiagnosticCategoryLabel2["Error"] = "error";
|
|
6253
|
+
DiagnosticCategoryLabel2["Suppress"] = "suppress";
|
|
6254
|
+
})(DiagnosticCategoryLabel || (DiagnosticCategoryLabel = {}));
|
|
6255
|
+
|
|
6256
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
|
|
6257
|
+
var ExtendedTemplateCheckerImpl = class {
|
|
6258
|
+
constructor(templateTypeChecker, typeChecker, templateCheckFactories, options) {
|
|
6259
|
+
var _a, _b, _c, _d, _e;
|
|
6260
|
+
this.partialCtx = { templateTypeChecker, typeChecker };
|
|
6261
|
+
this.templateChecks = /* @__PURE__ */ new Map();
|
|
6262
|
+
for (const factory3 of templateCheckFactories) {
|
|
6263
|
+
const category = diagnosticLabelToCategory((_e = (_d = (_b = (_a = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _a.checks) == null ? void 0 : _b[factory3.name]) != null ? _d : (_c = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _c.defaultCategory) != null ? _e : DiagnosticCategoryLabel.Warning);
|
|
6264
|
+
if (category === null) {
|
|
6265
|
+
continue;
|
|
6266
|
+
}
|
|
6267
|
+
const check = factory3.create(options);
|
|
6268
|
+
if (check === null) {
|
|
6269
|
+
continue;
|
|
6270
|
+
}
|
|
6271
|
+
this.templateChecks.set(check, category);
|
|
6272
|
+
}
|
|
6273
|
+
}
|
|
6274
|
+
getDiagnosticsForComponent(component) {
|
|
6275
|
+
const template = this.partialCtx.templateTypeChecker.getTemplate(component);
|
|
6276
|
+
if (template === null) {
|
|
6277
|
+
return [];
|
|
6278
|
+
}
|
|
6279
|
+
const diagnostics = [];
|
|
6280
|
+
for (const [check, category] of this.templateChecks.entries()) {
|
|
6281
|
+
const ctx = __spreadProps(__spreadValues({}, this.partialCtx), {
|
|
6282
|
+
makeTemplateDiagnostic: (span, message, relatedInformation) => {
|
|
6283
|
+
return this.partialCtx.templateTypeChecker.makeTemplateDiagnostic(component, span, category, check.code, message, relatedInformation);
|
|
6284
|
+
}
|
|
6285
|
+
});
|
|
6286
|
+
diagnostics.push(...check.run(ctx, component, template));
|
|
6287
|
+
}
|
|
6288
|
+
return diagnostics;
|
|
6289
|
+
}
|
|
6290
|
+
};
|
|
6291
|
+
function diagnosticLabelToCategory(label) {
|
|
6292
|
+
switch (label) {
|
|
6293
|
+
case DiagnosticCategoryLabel.Warning:
|
|
6294
|
+
return ts31.DiagnosticCategory.Warning;
|
|
6295
|
+
case DiagnosticCategoryLabel.Error:
|
|
6296
|
+
return ts31.DiagnosticCategory.Error;
|
|
6297
|
+
case DiagnosticCategoryLabel.Suppress:
|
|
6298
|
+
return null;
|
|
6299
|
+
default:
|
|
6300
|
+
return assertNever(label);
|
|
6301
|
+
}
|
|
6302
|
+
}
|
|
6303
|
+
function assertNever(value) {
|
|
6304
|
+
throw new Error(`Unexpected call to 'assertNever()' with value:
|
|
6305
|
+
${value}`);
|
|
6306
|
+
}
|
|
6212
6307
|
|
|
6213
|
-
// bazel-out/
|
|
6308
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/index.mjs
|
|
6309
|
+
var ALL_DIAGNOSTIC_FACTORIES = [
|
|
6310
|
+
factory,
|
|
6311
|
+
factory2
|
|
6312
|
+
];
|
|
6313
|
+
|
|
6314
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
6214
6315
|
var CompilationTicketKind;
|
|
6215
6316
|
(function(CompilationTicketKind2) {
|
|
6216
6317
|
CompilationTicketKind2[CompilationTicketKind2["Fresh"] = 0] = "Fresh";
|
|
@@ -6286,15 +6387,11 @@ var NgCompiler = class {
|
|
|
6286
6387
|
if (this.options._extendedTemplateDiagnostics === true && this.options.strictTemplates === false) {
|
|
6287
6388
|
throw new Error("The '_extendedTemplateDiagnostics' option requires 'strictTemplates' to also be enabled.");
|
|
6288
6389
|
}
|
|
6289
|
-
this.constructionDiagnostics.push(...this.adapter.constructionDiagnostics);
|
|
6290
|
-
const incompatibleTypeCheckOptionsDiagnostic = verifyCompatibleTypeCheckOptions(this.options);
|
|
6291
|
-
if (incompatibleTypeCheckOptionsDiagnostic !== null) {
|
|
6292
|
-
this.constructionDiagnostics.push(incompatibleTypeCheckOptionsDiagnostic);
|
|
6293
|
-
}
|
|
6390
|
+
this.constructionDiagnostics.push(...this.adapter.constructionDiagnostics, ...verifyCompatibleTypeCheckOptions(this.options));
|
|
6294
6391
|
this.currentProgram = inputProgram;
|
|
6295
6392
|
this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
|
|
6296
6393
|
this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
|
|
6297
|
-
const moduleResolutionCache =
|
|
6394
|
+
const moduleResolutionCache = ts32.createModuleResolutionCache(this.adapter.getCurrentDirectory(), this.adapter.getCanonicalFileName.bind(this.adapter));
|
|
6298
6395
|
this.moduleResolver = new ModuleResolver(inputProgram, this.options, this.adapter, moduleResolutionCache);
|
|
6299
6396
|
this.resourceManager = new AdapterResourceLoader(adapter, this.options);
|
|
6300
6397
|
this.cycleAnalyzer = new CycleAnalyzer(new ImportGraph(inputProgram.getTypeChecker(), this.delegatingPerfRecorder));
|
|
@@ -6339,7 +6436,7 @@ var NgCompiler = class {
|
|
|
6339
6436
|
return;
|
|
6340
6437
|
}
|
|
6341
6438
|
this.resourceManager.invalidate();
|
|
6342
|
-
const classesToUpdate = new Set();
|
|
6439
|
+
const classesToUpdate = /* @__PURE__ */ new Set();
|
|
6343
6440
|
for (const resourceFile of changedResources) {
|
|
6344
6441
|
for (const templateClass of this.getComponentsWithTemplateFile(resourceFile)) {
|
|
6345
6442
|
classesToUpdate.add(templateClass);
|
|
@@ -6350,7 +6447,7 @@ var NgCompiler = class {
|
|
|
6350
6447
|
}
|
|
6351
6448
|
for (const clazz of classesToUpdate) {
|
|
6352
6449
|
this.compilation.traitCompiler.updateResources(clazz);
|
|
6353
|
-
if (!
|
|
6450
|
+
if (!ts32.isClassDeclaration(clazz)) {
|
|
6354
6451
|
continue;
|
|
6355
6452
|
}
|
|
6356
6453
|
this.compilation.templateTypeChecker.invalidateClass(clazz);
|
|
@@ -6731,11 +6828,7 @@ var NgCompiler = class {
|
|
|
6731
6828
|
this.currentProgram = program;
|
|
6732
6829
|
});
|
|
6733
6830
|
const templateTypeChecker = new TemplateTypeCheckerImpl(this.inputProgram, notifyingDriver, traitCompiler, this.getTypeCheckingConfig(), refEmitter, reflector, this.adapter, this.incrementalCompilation, scopeRegistry, typeCheckScopeRegistry, this.delegatingPerfRecorder);
|
|
6734
|
-
const
|
|
6735
|
-
if (this.options.strictNullChecks) {
|
|
6736
|
-
templateChecks.push(new NullishCoalescingNotNullableCheck());
|
|
6737
|
-
}
|
|
6738
|
-
const extendedTemplateChecker = new ExtendedTemplateCheckerImpl(templateTypeChecker, checker, templateChecks);
|
|
6831
|
+
const extendedTemplateChecker = new ExtendedTemplateCheckerImpl(templateTypeChecker, checker, ALL_DIAGNOSTIC_FACTORIES, this.options);
|
|
6739
6832
|
return {
|
|
6740
6833
|
isCore,
|
|
6741
6834
|
traitCompiler,
|
|
@@ -6759,17 +6852,17 @@ function isAngularCorePackage(program) {
|
|
|
6759
6852
|
return false;
|
|
6760
6853
|
}
|
|
6761
6854
|
return r3Symbols.statements.some((stmt) => {
|
|
6762
|
-
if (!
|
|
6855
|
+
if (!ts32.isVariableStatement(stmt)) {
|
|
6763
6856
|
return false;
|
|
6764
6857
|
}
|
|
6765
|
-
if (stmt.modifiers === void 0 || !stmt.modifiers.some((mod) => mod.kind ===
|
|
6858
|
+
if (stmt.modifiers === void 0 || !stmt.modifiers.some((mod) => mod.kind === ts32.SyntaxKind.ExportKeyword)) {
|
|
6766
6859
|
return false;
|
|
6767
6860
|
}
|
|
6768
6861
|
return stmt.declarationList.declarations.some((decl) => {
|
|
6769
|
-
if (!
|
|
6862
|
+
if (!ts32.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
|
|
6770
6863
|
return false;
|
|
6771
6864
|
}
|
|
6772
|
-
if (decl.initializer === void 0 || decl.initializer.kind !==
|
|
6865
|
+
if (decl.initializer === void 0 || decl.initializer.kind !== ts32.SyntaxKind.TrueKeyword) {
|
|
6773
6866
|
return false;
|
|
6774
6867
|
}
|
|
6775
6868
|
return true;
|
|
@@ -6779,15 +6872,14 @@ function isAngularCorePackage(program) {
|
|
|
6779
6872
|
function getR3SymbolsFile(program) {
|
|
6780
6873
|
return program.getSourceFiles().find((file) => file.fileName.indexOf("r3_symbols.ts") >= 0) || null;
|
|
6781
6874
|
}
|
|
6782
|
-
function verifyCompatibleTypeCheckOptions(options) {
|
|
6875
|
+
function* verifyCompatibleTypeCheckOptions(options) {
|
|
6876
|
+
var _a, _b, _c;
|
|
6783
6877
|
if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
|
|
6784
|
-
|
|
6785
|
-
category:
|
|
6786
|
-
code:
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
length: void 0,
|
|
6790
|
-
messageText: `Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
|
|
6878
|
+
yield makeConfigDiagnostic({
|
|
6879
|
+
category: ts32.DiagnosticCategory.Error,
|
|
6880
|
+
code: ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK,
|
|
6881
|
+
messageText: `
|
|
6882
|
+
Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
|
|
6791
6883
|
|
|
6792
6884
|
Having the "strictTemplates" flag enabled implies that "fullTemplateTypeCheck" is also enabled, so
|
|
6793
6885
|
the latter can not be explicitly disabled.
|
|
@@ -6797,10 +6889,76 @@ One of the following actions is required:
|
|
|
6797
6889
|
2. Remove "strictTemplates" or set it to 'false'.
|
|
6798
6890
|
|
|
6799
6891
|
More information about the template type checking compiler options can be found in the documentation:
|
|
6800
|
-
https://
|
|
6801
|
-
|
|
6892
|
+
https://angular.io/guide/template-typecheck
|
|
6893
|
+
`.trim()
|
|
6894
|
+
});
|
|
6895
|
+
}
|
|
6896
|
+
if (options.extendedDiagnostics && options.strictTemplates === false) {
|
|
6897
|
+
yield makeConfigDiagnostic({
|
|
6898
|
+
category: ts32.DiagnosticCategory.Error,
|
|
6899
|
+
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES,
|
|
6900
|
+
messageText: `
|
|
6901
|
+
Angular compiler option "extendedDiagnostics" is configured, however "strictTemplates" is disabled.
|
|
6902
|
+
|
|
6903
|
+
Using "extendedDiagnostics" requires that "strictTemplates" is also enabled.
|
|
6904
|
+
|
|
6905
|
+
One of the following actions is required:
|
|
6906
|
+
1. Remove "strictTemplates: false" to enable it.
|
|
6907
|
+
2. Remove "extendedDiagnostics" configuration to disable them.
|
|
6908
|
+
`.trim()
|
|
6909
|
+
});
|
|
6910
|
+
}
|
|
6911
|
+
const allowedCategoryLabels = Array.from(Object.values(DiagnosticCategoryLabel));
|
|
6912
|
+
const defaultCategory = (_a = options.extendedDiagnostics) == null ? void 0 : _a.defaultCategory;
|
|
6913
|
+
if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
|
|
6914
|
+
yield makeConfigDiagnostic({
|
|
6915
|
+
category: ts32.DiagnosticCategory.Error,
|
|
6916
|
+
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
6917
|
+
messageText: `
|
|
6918
|
+
Angular compiler option "extendedDiagnostics.defaultCategory" has an unknown diagnostic category: "${defaultCategory}".
|
|
6919
|
+
|
|
6920
|
+
Allowed diagnostic categories are:
|
|
6921
|
+
${allowedCategoryLabels.join("\n")}
|
|
6922
|
+
`.trim()
|
|
6923
|
+
});
|
|
6924
|
+
}
|
|
6925
|
+
const allExtendedDiagnosticNames = ALL_DIAGNOSTIC_FACTORIES.map((factory3) => factory3.name);
|
|
6926
|
+
for (const [checkName, category] of Object.entries((_c = (_b = options.extendedDiagnostics) == null ? void 0 : _b.checks) != null ? _c : {})) {
|
|
6927
|
+
if (!allExtendedDiagnosticNames.includes(checkName)) {
|
|
6928
|
+
yield makeConfigDiagnostic({
|
|
6929
|
+
category: ts32.DiagnosticCategory.Error,
|
|
6930
|
+
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK,
|
|
6931
|
+
messageText: `
|
|
6932
|
+
Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${checkName}".
|
|
6933
|
+
|
|
6934
|
+
Allowed check names are:
|
|
6935
|
+
${allExtendedDiagnosticNames.join("\n")}
|
|
6936
|
+
`.trim()
|
|
6937
|
+
});
|
|
6938
|
+
}
|
|
6939
|
+
if (!allowedCategoryLabels.includes(category)) {
|
|
6940
|
+
yield makeConfigDiagnostic({
|
|
6941
|
+
category: ts32.DiagnosticCategory.Error,
|
|
6942
|
+
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
6943
|
+
messageText: `
|
|
6944
|
+
Angular compiler option "extendedDiagnostics.checks['${checkName}']" has an unknown diagnostic category: "${category}".
|
|
6945
|
+
|
|
6946
|
+
Allowed diagnostic categories are:
|
|
6947
|
+
${allowedCategoryLabels.join("\n")}
|
|
6948
|
+
`.trim()
|
|
6949
|
+
});
|
|
6950
|
+
}
|
|
6802
6951
|
}
|
|
6803
|
-
|
|
6952
|
+
}
|
|
6953
|
+
function makeConfigDiagnostic({ category, code, messageText }) {
|
|
6954
|
+
return {
|
|
6955
|
+
category,
|
|
6956
|
+
code: ngErrorCode(code),
|
|
6957
|
+
file: void 0,
|
|
6958
|
+
start: void 0,
|
|
6959
|
+
length: void 0,
|
|
6960
|
+
messageText
|
|
6961
|
+
};
|
|
6804
6962
|
}
|
|
6805
6963
|
var ReferenceGraphAdapter = class {
|
|
6806
6964
|
constructor(graph) {
|
|
@@ -6810,7 +6968,7 @@ var ReferenceGraphAdapter = class {
|
|
|
6810
6968
|
for (const { node } of references) {
|
|
6811
6969
|
let sourceFile = node.getSourceFile();
|
|
6812
6970
|
if (sourceFile === void 0) {
|
|
6813
|
-
sourceFile =
|
|
6971
|
+
sourceFile = ts32.getOriginalNode(node).getSourceFile();
|
|
6814
6972
|
}
|
|
6815
6973
|
if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
|
|
6816
6974
|
this.graph.add(source, node);
|
|
@@ -6840,7 +6998,7 @@ function versionMapFromProgram(program, driver) {
|
|
|
6840
6998
|
if (driver.getSourceFileVersion === void 0) {
|
|
6841
6999
|
return null;
|
|
6842
7000
|
}
|
|
6843
|
-
const versions = new Map();
|
|
7001
|
+
const versions = /* @__PURE__ */ new Map();
|
|
6844
7002
|
for (const possiblyRedirectedSourceFile of program.getSourceFiles()) {
|
|
6845
7003
|
const sf = toUnredirectedSourceFile(possiblyRedirectedSourceFile);
|
|
6846
7004
|
versions.set(absoluteFromSourceFile(sf), driver.getSourceFileVersion(sf));
|
|
@@ -6848,8 +7006,8 @@ function versionMapFromProgram(program, driver) {
|
|
|
6848
7006
|
return versions;
|
|
6849
7007
|
}
|
|
6850
7008
|
|
|
6851
|
-
// bazel-out/
|
|
6852
|
-
import
|
|
7009
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
|
|
7010
|
+
import ts33 from "typescript";
|
|
6853
7011
|
var DelegatingCompilerHost2 = class {
|
|
6854
7012
|
constructor(delegate) {
|
|
6855
7013
|
this.delegate = delegate;
|
|
@@ -6939,7 +7097,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
6939
7097
|
entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
|
|
6940
7098
|
if (entryPoint === null) {
|
|
6941
7099
|
diagnostics.push({
|
|
6942
|
-
category:
|
|
7100
|
+
category: ts33.DiagnosticCategory.Error,
|
|
6943
7101
|
code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
|
|
6944
7102
|
file: void 0,
|
|
6945
7103
|
start: void 0,
|
|
@@ -6979,17 +7137,17 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
6979
7137
|
return this.fileNameToModuleName !== void 0 ? this : null;
|
|
6980
7138
|
}
|
|
6981
7139
|
createCachedResolveModuleNamesFunction() {
|
|
6982
|
-
const moduleResolutionCache =
|
|
7140
|
+
const moduleResolutionCache = ts33.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
|
|
6983
7141
|
return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
|
|
6984
7142
|
return moduleNames.map((moduleName) => {
|
|
6985
|
-
const module =
|
|
7143
|
+
const module = ts33.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
|
|
6986
7144
|
return module.resolvedModule;
|
|
6987
7145
|
});
|
|
6988
7146
|
};
|
|
6989
7147
|
}
|
|
6990
7148
|
};
|
|
6991
7149
|
|
|
6992
|
-
// bazel-out/
|
|
7150
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
6993
7151
|
var NgtscProgram = class {
|
|
6994
7152
|
constructor(rootNames, options, delegateHost, oldProgram) {
|
|
6995
7153
|
this.options = options;
|
|
@@ -7003,14 +7161,14 @@ var NgtscProgram = class {
|
|
|
7003
7161
|
if (reuseProgram !== void 0) {
|
|
7004
7162
|
retagAllTsFiles(reuseProgram);
|
|
7005
7163
|
}
|
|
7006
|
-
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () =>
|
|
7164
|
+
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts34.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
|
|
7007
7165
|
perfRecorder.phase(PerfPhase.Unaccounted);
|
|
7008
7166
|
perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
|
|
7009
7167
|
this.host.postProgramCreationCleanup();
|
|
7010
7168
|
untagAllTsFiles(this.tsProgram);
|
|
7011
7169
|
const programDriver = new TsCreateProgramDriver(this.tsProgram, this.host, this.options, this.host.shimExtensionPrefixes);
|
|
7012
7170
|
this.incrementalStrategy = oldProgram !== void 0 ? oldProgram.incrementalStrategy.toNextBuildStrategy() : new TrackedIncrementalBuildStrategy();
|
|
7013
|
-
const modifiedResourceFiles = new Set();
|
|
7171
|
+
const modifiedResourceFiles = /* @__PURE__ */ new Set();
|
|
7014
7172
|
if (this.host.getModifiedResourceFiles !== void 0) {
|
|
7015
7173
|
const strings = this.host.getModifiedResourceFiles();
|
|
7016
7174
|
if (strings !== void 0) {
|
|
@@ -7196,39 +7354,38 @@ function mergeEmitResults(emitResults) {
|
|
|
7196
7354
|
return { diagnostics, emitSkipped, emittedFiles };
|
|
7197
7355
|
}
|
|
7198
7356
|
|
|
7199
|
-
// bazel-out/
|
|
7357
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/program.mjs
|
|
7200
7358
|
function createProgram({ rootNames, options, host, oldProgram }) {
|
|
7201
7359
|
return new NgtscProgram(rootNames, options, host, oldProgram);
|
|
7202
7360
|
}
|
|
7203
7361
|
|
|
7204
|
-
// bazel-out/
|
|
7205
|
-
import { isSyntaxError } from "@angular/compiler";
|
|
7206
|
-
import ts37 from "typescript";
|
|
7207
|
-
|
|
7208
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
|
|
7362
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
7209
7363
|
import ts36 from "typescript";
|
|
7364
|
+
|
|
7365
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
|
|
7366
|
+
import ts35 from "typescript";
|
|
7210
7367
|
var GENERATED_FILES = /(.*?)\.(ngfactory|shim\.ngstyle|ngstyle|ngsummary)\.(js|d\.ts|ts)$/;
|
|
7211
7368
|
function createMessageDiagnostic(messageText) {
|
|
7212
7369
|
return {
|
|
7213
7370
|
file: void 0,
|
|
7214
7371
|
start: void 0,
|
|
7215
7372
|
length: void 0,
|
|
7216
|
-
category:
|
|
7373
|
+
category: ts35.DiagnosticCategory.Message,
|
|
7217
7374
|
messageText,
|
|
7218
7375
|
code: DEFAULT_ERROR_CODE,
|
|
7219
7376
|
source: SOURCE
|
|
7220
7377
|
};
|
|
7221
7378
|
}
|
|
7222
7379
|
|
|
7223
|
-
// bazel-out/
|
|
7380
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
7224
7381
|
var defaultFormatHost = {
|
|
7225
|
-
getCurrentDirectory: () =>
|
|
7382
|
+
getCurrentDirectory: () => ts36.sys.getCurrentDirectory(),
|
|
7226
7383
|
getCanonicalFileName: (fileName) => fileName,
|
|
7227
|
-
getNewLine: () =>
|
|
7384
|
+
getNewLine: () => ts36.sys.newLine
|
|
7228
7385
|
};
|
|
7229
7386
|
function formatDiagnostics(diags, host = defaultFormatHost) {
|
|
7230
7387
|
if (diags && diags.length) {
|
|
7231
|
-
return diags.map((diagnostic) => replaceTsWithNgInErrors(
|
|
7388
|
+
return diags.map((diagnostic) => replaceTsWithNgInErrors(ts36.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
|
|
7232
7389
|
} else {
|
|
7233
7390
|
return "";
|
|
7234
7391
|
}
|
|
@@ -7245,7 +7402,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
7245
7402
|
var _a;
|
|
7246
7403
|
try {
|
|
7247
7404
|
const fs = getFileSystem();
|
|
7248
|
-
const readConfigFile = (configFile) =>
|
|
7405
|
+
const readConfigFile = (configFile) => ts36.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
|
|
7249
7406
|
const readAngularCompilerOptions = (configFile, parentOptions = {}) => {
|
|
7250
7407
|
const { config: config2, error: error2 } = readConfigFile(configFile);
|
|
7251
7408
|
if (error2) {
|
|
@@ -7277,7 +7434,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
7277
7434
|
basePath
|
|
7278
7435
|
}, readAngularCompilerOptions(configFileName)), existingOptions);
|
|
7279
7436
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
7280
|
-
const { options, errors, fileNames: rootNames, projectReferences } =
|
|
7437
|
+
const { options, errors, fileNames: rootNames, projectReferences } = ts36.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
|
|
7281
7438
|
options.enableIvy = !!((_a = options.enableIvy) != null ? _a : true);
|
|
7282
7439
|
let emitFlags = EmitFlags.Default;
|
|
7283
7440
|
if (!(options.skipMetadataEmit || options.flatModuleOutFile)) {
|
|
@@ -7289,7 +7446,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
7289
7446
|
return { project: projectFile, rootNames, projectReferences, options, errors, emitFlags };
|
|
7290
7447
|
} catch (e) {
|
|
7291
7448
|
const errors = [{
|
|
7292
|
-
category:
|
|
7449
|
+
category: ts36.DiagnosticCategory.Error,
|
|
7293
7450
|
messageText: e.stack,
|
|
7294
7451
|
file: void 0,
|
|
7295
7452
|
start: void 0,
|
|
@@ -7303,7 +7460,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
7303
7460
|
function createParseConfigHost(host, fs = getFileSystem()) {
|
|
7304
7461
|
return {
|
|
7305
7462
|
fileExists: host.exists.bind(host),
|
|
7306
|
-
readDirectory:
|
|
7463
|
+
readDirectory: ts36.sys.readDirectory,
|
|
7307
7464
|
readFile: host.readFile.bind(host),
|
|
7308
7465
|
useCaseSensitiveFileNames: fs.isCaseSensitive()
|
|
7309
7466
|
};
|
|
@@ -7323,7 +7480,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
7323
7480
|
}
|
|
7324
7481
|
} else {
|
|
7325
7482
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
7326
|
-
const { resolvedModule } =
|
|
7483
|
+
const { resolvedModule } = ts36.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts36.ModuleResolutionKind.NodeJs, resolveJsonModule: true }, parseConfigHost);
|
|
7327
7484
|
if (resolvedModule) {
|
|
7328
7485
|
return absoluteFrom(resolvedModule.resolvedFileName);
|
|
7329
7486
|
}
|
|
@@ -7333,7 +7490,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
7333
7490
|
function exitCodeFromResult(diags) {
|
|
7334
7491
|
if (!diags)
|
|
7335
7492
|
return 0;
|
|
7336
|
-
if (diags.every((diag) => diag.category !==
|
|
7493
|
+
if (diags.every((diag) => diag.category !== ts36.DiagnosticCategory.Error)) {
|
|
7337
7494
|
return 0;
|
|
7338
7495
|
}
|
|
7339
7496
|
return diags.some((d) => d.source === "angular" && d.code === UNKNOWN_ERROR_CODE) ? 2 : 1;
|
|
@@ -7363,20 +7520,11 @@ function performCompilation({ rootNames, options, host, oldProgram, emitCallback
|
|
|
7363
7520
|
}
|
|
7364
7521
|
return { diagnostics: allDiagnostics, program };
|
|
7365
7522
|
} catch (e) {
|
|
7366
|
-
|
|
7367
|
-
let code;
|
|
7368
|
-
if (isSyntaxError(e)) {
|
|
7369
|
-
errMsg = e.message;
|
|
7370
|
-
code = DEFAULT_ERROR_CODE;
|
|
7371
|
-
} else {
|
|
7372
|
-
errMsg = e.stack;
|
|
7373
|
-
program = void 0;
|
|
7374
|
-
code = UNKNOWN_ERROR_CODE;
|
|
7375
|
-
}
|
|
7523
|
+
program = void 0;
|
|
7376
7524
|
allDiagnostics.push({
|
|
7377
|
-
category:
|
|
7378
|
-
messageText:
|
|
7379
|
-
code,
|
|
7525
|
+
category: ts36.DiagnosticCategory.Error,
|
|
7526
|
+
messageText: e.stack,
|
|
7527
|
+
code: UNKNOWN_ERROR_CODE,
|
|
7380
7528
|
file: void 0,
|
|
7381
7529
|
start: void 0,
|
|
7382
7530
|
length: void 0
|
|
@@ -7401,7 +7549,7 @@ function defaultGatherDiagnostics(program) {
|
|
|
7401
7549
|
return allDiagnostics;
|
|
7402
7550
|
}
|
|
7403
7551
|
function hasErrors(diags) {
|
|
7404
|
-
return diags.some((d) => d.category ===
|
|
7552
|
+
return diags.some((d) => d.category === ts36.DiagnosticCategory.Error);
|
|
7405
7553
|
}
|
|
7406
7554
|
|
|
7407
7555
|
export {
|
|
@@ -7443,4 +7591,4 @@ export {
|
|
|
7443
7591
|
* found in the LICENSE file at https://angular.io/license
|
|
7444
7592
|
*/
|
|
7445
7593
|
// Closure Compiler ignores @suppress and similar if the comment contains @license.
|
|
7446
|
-
//# sourceMappingURL=chunk-
|
|
7594
|
+
//# sourceMappingURL=chunk-L5DQYLOG.js.map
|