@angular/compiler-cli 13.3.6 → 13.3.7
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-UDG7FV2F.js → chunk-45NS77NQ.js} +4 -4
- package/bundles/{chunk-UDG7FV2F.js.map → chunk-45NS77NQ.js.map} +0 -0
- package/bundles/{chunk-HAJOG5B7.js → chunk-CLV7JFJQ.js} +7 -7
- package/bundles/{chunk-HAJOG5B7.js.map → chunk-CLV7JFJQ.js.map} +0 -0
- package/bundles/{chunk-S2JDWKKT.js → chunk-D5CHHDFQ.js} +72 -71
- package/bundles/chunk-D5CHHDFQ.js.map +6 -0
- package/bundles/{chunk-UTSZJQCU.js → chunk-EIFOOEXQ.js} +7 -7
- package/bundles/{chunk-UTSZJQCU.js.map → chunk-EIFOOEXQ.js.map} +0 -0
- package/bundles/{chunk-FDEQP2NW.js → chunk-HTCAZIYK.js} +6 -6
- package/bundles/{chunk-FDEQP2NW.js.map → chunk-HTCAZIYK.js.map} +0 -0
- package/bundles/{chunk-K2VJV6GY.js → chunk-KAJ5EOEG.js} +165 -575
- package/bundles/chunk-KAJ5EOEG.js.map +6 -0
- package/bundles/{chunk-ZCDB56AX.js → chunk-LX5Q27EF.js} +3 -3
- package/bundles/{chunk-ZCDB56AX.js.map → chunk-LX5Q27EF.js.map} +0 -0
- package/bundles/{chunk-UAIUNABS.js → chunk-NALI3EFD.js} +40 -40
- package/bundles/{chunk-UAIUNABS.js.map → chunk-NALI3EFD.js.map} +0 -0
- package/bundles/{chunk-SWYYBHE5.js → chunk-O4P7N4CX.js} +5 -5
- package/bundles/{chunk-SWYYBHE5.js.map → chunk-O4P7N4CX.js.map} +0 -0
- package/bundles/{chunk-A7GANIJT.js → chunk-Q5GIQ3RV.js} +6 -6
- package/bundles/{chunk-A7GANIJT.js.map → chunk-Q5GIQ3RV.js.map} +0 -0
- package/bundles/{chunk-SJL5HBUW.js → chunk-R3C7RFJ4.js} +2 -2
- package/bundles/{chunk-SJL5HBUW.js.map → chunk-R3C7RFJ4.js.map} +0 -0
- package/bundles/{chunk-LC26KH5A.js → chunk-R4NY3TJC.js} +5 -5
- package/bundles/{chunk-LC26KH5A.js.map → chunk-R4NY3TJC.js.map} +0 -0
- package/bundles/{chunk-W3FLD7KU.js → chunk-WXB5AWIG.js} +26 -26
- package/bundles/{chunk-W3FLD7KU.js.map → chunk-WXB5AWIG.js.map} +0 -0
- package/bundles/{chunk-5XOEDNQ7.js → chunk-ZPZWKMTE.js} +836 -438
- package/bundles/chunk-ZPZWKMTE.js.map +6 -0
- package/bundles/{chunk-IEIGNUVQ.js → chunk-ZZF2R6KZ.js} +31 -31
- package/bundles/{chunk-IEIGNUVQ.js.map → chunk-ZZF2R6KZ.js.map} +0 -0
- package/bundles/index.js +13 -14
- package/bundles/index.js.map +1 -1
- package/bundles/linker/babel/index.js +12 -12
- package/bundles/linker/index.js +4 -4
- package/bundles/ngcc/index.js +12 -12
- package/bundles/ngcc/main-ngcc.js +13 -13
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +13 -13
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +4 -4
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +3 -3
- package/bundles/private/migrations.js +5 -5
- package/bundles/private/tooling.js +2 -2
- package/bundles/src/bin/ng_xi18n.js +10 -10
- package/bundles/src/bin/ngc.js +8 -8
- package/bundles_metadata.json +1 -1
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/package.json +3 -3
- package/src/ngtsc/core/api/src/adapter.d.ts +12 -1
- package/src/ngtsc/core/src/host.d.ts +7 -0
- package/src/ngtsc/transform/src/compilation.d.ts +3 -1
- package/bundles/chunk-5XOEDNQ7.js.map +0 -6
- package/bundles/chunk-K2VJV6GY.js.map +0 -6
- package/bundles/chunk-S2JDWKKT.js.map +0 -6
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
DirectiveDecoratorHandler,
|
|
12
12
|
DtsMetadataReader,
|
|
13
13
|
DtsTransformRegistry,
|
|
14
|
-
FactoryGenerator,
|
|
15
14
|
InjectableClassRegistry,
|
|
16
15
|
InjectableDecoratorHandler,
|
|
17
16
|
LocalMetadataRegistry,
|
|
@@ -21,24 +20,16 @@ import {
|
|
|
21
20
|
PipeDecoratorHandler,
|
|
22
21
|
ResourceRegistry,
|
|
23
22
|
SemanticDepGraphUpdater,
|
|
24
|
-
ShimAdapter,
|
|
25
|
-
ShimReferenceTagger,
|
|
26
|
-
SummaryGenerator,
|
|
27
23
|
TraitCompiler,
|
|
28
24
|
aliasTransformFactory,
|
|
29
|
-
copyFileShimData,
|
|
30
25
|
declarationTransformFactory,
|
|
31
26
|
flattenInheritedDirectiveMetadata,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
ivyTransformFactory,
|
|
35
|
-
retagAllTsFiles,
|
|
36
|
-
untagAllTsFiles
|
|
37
|
-
} from "./chunk-K2VJV6GY.js";
|
|
27
|
+
ivyTransformFactory
|
|
28
|
+
} from "./chunk-KAJ5EOEG.js";
|
|
38
29
|
import {
|
|
39
30
|
TypeScriptReflectionHost,
|
|
40
31
|
isNamedClassDeclaration
|
|
41
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-Q5GIQ3RV.js";
|
|
42
33
|
import {
|
|
43
34
|
AbsoluteModuleStrategy,
|
|
44
35
|
AliasStrategy,
|
|
@@ -79,30 +70,31 @@ import {
|
|
|
79
70
|
toUnredirectedSourceFile,
|
|
80
71
|
translateExpression,
|
|
81
72
|
translateType
|
|
82
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-WXB5AWIG.js";
|
|
83
74
|
import {
|
|
84
75
|
LogicalFileSystem,
|
|
85
76
|
absoluteFrom,
|
|
86
77
|
absoluteFromSourceFile,
|
|
78
|
+
basename,
|
|
87
79
|
dirname,
|
|
88
80
|
getFileSystem,
|
|
89
81
|
getSourceFileOrError,
|
|
90
82
|
join,
|
|
91
83
|
resolve
|
|
92
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-CLV7JFJQ.js";
|
|
93
85
|
import {
|
|
94
86
|
ActivePerfRecorder,
|
|
95
87
|
DelegatingPerfRecorder,
|
|
96
88
|
PerfCheckpoint,
|
|
97
89
|
PerfEvent,
|
|
98
90
|
PerfPhase
|
|
99
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-R4NY3TJC.js";
|
|
100
92
|
import {
|
|
101
93
|
__spreadProps,
|
|
102
94
|
__spreadValues
|
|
103
95
|
} from "./chunk-GMSUYBZP.js";
|
|
104
96
|
|
|
105
|
-
// bazel-out/
|
|
97
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
106
98
|
var DEFAULT_ERROR_CODE = 100;
|
|
107
99
|
var UNKNOWN_ERROR_CODE = 500;
|
|
108
100
|
var SOURCE = "angular";
|
|
@@ -120,7 +112,7 @@ var EmitFlags;
|
|
|
120
112
|
EmitFlags2[EmitFlags2["All"] = 31] = "All";
|
|
121
113
|
})(EmitFlags || (EmitFlags = {}));
|
|
122
114
|
|
|
123
|
-
// bazel-out/
|
|
115
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/compiler_host.mjs
|
|
124
116
|
import ts from "typescript";
|
|
125
117
|
var wrapHostForTest = null;
|
|
126
118
|
function createCompilerHost({ options, tsHost = ts.createCompilerHost(options, true) }) {
|
|
@@ -130,21 +122,21 @@ function createCompilerHost({ options, tsHost = ts.createCompilerHost(options, t
|
|
|
130
122
|
return tsHost;
|
|
131
123
|
}
|
|
132
124
|
|
|
133
|
-
// bazel-out/
|
|
125
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/checker.mjs
|
|
134
126
|
var OptimizeFor;
|
|
135
127
|
(function(OptimizeFor2) {
|
|
136
128
|
OptimizeFor2[OptimizeFor2["SingleFile"] = 0] = "SingleFile";
|
|
137
129
|
OptimizeFor2[OptimizeFor2["WholeProgram"] = 1] = "WholeProgram";
|
|
138
130
|
})(OptimizeFor || (OptimizeFor = {}));
|
|
139
131
|
|
|
140
|
-
// bazel-out/
|
|
132
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/completion.mjs
|
|
141
133
|
var CompletionKind;
|
|
142
134
|
(function(CompletionKind2) {
|
|
143
135
|
CompletionKind2[CompletionKind2["Reference"] = 0] = "Reference";
|
|
144
136
|
CompletionKind2[CompletionKind2["Variable"] = 1] = "Variable";
|
|
145
137
|
})(CompletionKind || (CompletionKind = {}));
|
|
146
138
|
|
|
147
|
-
// bazel-out/
|
|
139
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/symbols.mjs
|
|
148
140
|
var SymbolKind;
|
|
149
141
|
(function(SymbolKind2) {
|
|
150
142
|
SymbolKind2[SymbolKind2["Input"] = 0] = "Input";
|
|
@@ -160,11 +152,11 @@ var SymbolKind;
|
|
|
160
152
|
SymbolKind2[SymbolKind2["Pipe"] = 10] = "Pipe";
|
|
161
153
|
})(SymbolKind || (SymbolKind = {}));
|
|
162
154
|
|
|
163
|
-
// bazel-out/
|
|
155
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
164
156
|
import { HtmlParser, MessageBundle } from "@angular/compiler";
|
|
165
|
-
import
|
|
157
|
+
import ts35 from "typescript";
|
|
166
158
|
|
|
167
|
-
// bazel-out/
|
|
159
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
|
|
168
160
|
import { Xliff, Xliff2, Xmb } from "@angular/compiler";
|
|
169
161
|
import * as path from "path";
|
|
170
162
|
function i18nGetExtension(formatName) {
|
|
@@ -215,10 +207,10 @@ function getPathNormalizer(basePath) {
|
|
|
215
207
|
};
|
|
216
208
|
}
|
|
217
209
|
|
|
218
|
-
// bazel-out/
|
|
210
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
|
|
219
211
|
import ts2 from "typescript";
|
|
220
212
|
|
|
221
|
-
// bazel-out/
|
|
213
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/version_helpers.mjs
|
|
222
214
|
function toNumbers(value) {
|
|
223
215
|
const suffixIndex = value.lastIndexOf("-");
|
|
224
216
|
return value.slice(0, suffixIndex === -1 ? value.length : suffixIndex).split(".").map((segment) => {
|
|
@@ -253,7 +245,7 @@ function compareVersions(v1, v2) {
|
|
|
253
245
|
return compareNumbers(toNumbers(v1), toNumbers(v2));
|
|
254
246
|
}
|
|
255
247
|
|
|
256
|
-
// bazel-out/
|
|
248
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
|
|
257
249
|
var MIN_TS_VERSION = "4.4.2";
|
|
258
250
|
var MAX_TS_VERSION = "4.7.0";
|
|
259
251
|
var tsVersion = ts2.version;
|
|
@@ -266,10 +258,10 @@ function verifySupportedTypeScriptVersion() {
|
|
|
266
258
|
checkVersion(tsVersion, MIN_TS_VERSION, MAX_TS_VERSION);
|
|
267
259
|
}
|
|
268
260
|
|
|
269
|
-
// bazel-out/
|
|
270
|
-
import
|
|
261
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
262
|
+
import ts33 from "typescript";
|
|
271
263
|
|
|
272
|
-
// bazel-out/
|
|
264
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
|
|
273
265
|
var CycleAnalyzer = class {
|
|
274
266
|
constructor(importGraph) {
|
|
275
267
|
this.importGraph = importGraph;
|
|
@@ -340,7 +332,7 @@ var Cycle = class {
|
|
|
340
332
|
}
|
|
341
333
|
};
|
|
342
334
|
|
|
343
|
-
// bazel-out/
|
|
335
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/imports.mjs
|
|
344
336
|
import ts3 from "typescript";
|
|
345
337
|
var ImportGraph = class {
|
|
346
338
|
constructor(checker, perf) {
|
|
@@ -432,7 +424,7 @@ var Found = class {
|
|
|
432
424
|
}
|
|
433
425
|
};
|
|
434
426
|
|
|
435
|
-
// bazel-out/
|
|
427
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/generator.mjs
|
|
436
428
|
import ts4 from "typescript";
|
|
437
429
|
var FlatIndexGenerator = class {
|
|
438
430
|
constructor(entryPoint, relativeFlatIndexPath, moduleName) {
|
|
@@ -457,7 +449,7 @@ export * from '${relativeEntryPoint}';
|
|
|
457
449
|
}
|
|
458
450
|
};
|
|
459
451
|
|
|
460
|
-
// bazel-out/
|
|
452
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/logic.mjs
|
|
461
453
|
function findFlatIndexEntryPoint(rootFiles) {
|
|
462
454
|
const tsFiles = rootFiles.filter((file) => isNonDeclarationTsPath(file));
|
|
463
455
|
let resolvedEntryPoint = null;
|
|
@@ -473,7 +465,7 @@ function findFlatIndexEntryPoint(rootFiles) {
|
|
|
473
465
|
return resolvedEntryPoint;
|
|
474
466
|
}
|
|
475
467
|
|
|
476
|
-
// bazel-out/
|
|
468
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/private_export_checker.mjs
|
|
477
469
|
import ts5 from "typescript";
|
|
478
470
|
function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
479
471
|
const diagnostics = [];
|
|
@@ -553,7 +545,7 @@ function getDescriptorOfDeclaration(decl) {
|
|
|
553
545
|
}
|
|
554
546
|
}
|
|
555
547
|
|
|
556
|
-
// bazel-out/
|
|
548
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/reference_graph.mjs
|
|
557
549
|
var ReferenceGraph = class {
|
|
558
550
|
constructor() {
|
|
559
551
|
this.references = /* @__PURE__ */ new Map();
|
|
@@ -607,7 +599,7 @@ var ReferenceGraph = class {
|
|
|
607
599
|
}
|
|
608
600
|
};
|
|
609
601
|
|
|
610
|
-
// bazel-out/
|
|
602
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/api.mjs
|
|
611
603
|
var NgOriginalFile = Symbol("NgOriginalFile");
|
|
612
604
|
var UpdateMode;
|
|
613
605
|
(function(UpdateMode2) {
|
|
@@ -615,8 +607,408 @@ var UpdateMode;
|
|
|
615
607
|
UpdateMode2[UpdateMode2["Incremental"] = 1] = "Incremental";
|
|
616
608
|
})(UpdateMode || (UpdateMode = {}));
|
|
617
609
|
|
|
618
|
-
// bazel-out/
|
|
610
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
611
|
+
import ts9 from "typescript";
|
|
612
|
+
|
|
613
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
619
614
|
import ts6 from "typescript";
|
|
615
|
+
|
|
616
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/expando.mjs
|
|
617
|
+
var NgExtension = Symbol("NgExtension");
|
|
618
|
+
function isExtended(sf) {
|
|
619
|
+
return sf[NgExtension] !== void 0;
|
|
620
|
+
}
|
|
621
|
+
function sfExtensionData(sf) {
|
|
622
|
+
const extSf = sf;
|
|
623
|
+
if (extSf[NgExtension] !== void 0) {
|
|
624
|
+
return extSf[NgExtension];
|
|
625
|
+
}
|
|
626
|
+
const extension = {
|
|
627
|
+
isTopLevelShim: false,
|
|
628
|
+
fileShim: null,
|
|
629
|
+
originalReferencedFiles: null,
|
|
630
|
+
taggedReferenceFiles: null
|
|
631
|
+
};
|
|
632
|
+
extSf[NgExtension] = extension;
|
|
633
|
+
return extension;
|
|
634
|
+
}
|
|
635
|
+
function isFileShimSourceFile(sf) {
|
|
636
|
+
return isExtended(sf) && sf[NgExtension].fileShim !== null;
|
|
637
|
+
}
|
|
638
|
+
function isShim(sf) {
|
|
639
|
+
return isExtended(sf) && (sf[NgExtension].fileShim !== null || sf[NgExtension].isTopLevelShim);
|
|
640
|
+
}
|
|
641
|
+
function copyFileShimData(from, to) {
|
|
642
|
+
if (!isFileShimSourceFile(from)) {
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
sfExtensionData(to).fileShim = sfExtensionData(from).fileShim;
|
|
646
|
+
}
|
|
647
|
+
function untagAllTsFiles(program) {
|
|
648
|
+
for (const sf of program.getSourceFiles()) {
|
|
649
|
+
untagTsFile(sf);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
function retagAllTsFiles(program) {
|
|
653
|
+
for (const sf of program.getSourceFiles()) {
|
|
654
|
+
retagTsFile(sf);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
function untagTsFile(sf) {
|
|
658
|
+
if (sf.isDeclarationFile || !isExtended(sf)) {
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
const ext = sfExtensionData(sf);
|
|
662
|
+
if (ext.originalReferencedFiles !== null) {
|
|
663
|
+
sf.referencedFiles = ext.originalReferencedFiles;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
function retagTsFile(sf) {
|
|
667
|
+
if (sf.isDeclarationFile || !isExtended(sf)) {
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
const ext = sfExtensionData(sf);
|
|
671
|
+
if (ext.taggedReferenceFiles !== null) {
|
|
672
|
+
sf.referencedFiles = ext.taggedReferenceFiles;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/util.mjs
|
|
677
|
+
var TS_EXTENSIONS = /\.tsx?$/i;
|
|
678
|
+
function makeShimFileName(fileName, suffix) {
|
|
679
|
+
return absoluteFrom(fileName.replace(TS_EXTENSIONS, suffix));
|
|
680
|
+
}
|
|
681
|
+
function generatedModuleName(originalModuleName, originalFileName, genSuffix) {
|
|
682
|
+
let moduleName;
|
|
683
|
+
if (originalFileName.endsWith("/index.ts")) {
|
|
684
|
+
moduleName = originalModuleName + "/index" + genSuffix;
|
|
685
|
+
} else {
|
|
686
|
+
moduleName = originalModuleName + genSuffix;
|
|
687
|
+
}
|
|
688
|
+
return moduleName;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
692
|
+
var ShimAdapter = class {
|
|
693
|
+
constructor(delegate, tsRootFiles, topLevelGenerators, perFileGenerators, oldProgram) {
|
|
694
|
+
this.delegate = delegate;
|
|
695
|
+
this.shims = /* @__PURE__ */ new Map();
|
|
696
|
+
this.priorShims = /* @__PURE__ */ new Map();
|
|
697
|
+
this.notShims = /* @__PURE__ */ new Set();
|
|
698
|
+
this.generators = [];
|
|
699
|
+
this.ignoreForEmit = /* @__PURE__ */ new Set();
|
|
700
|
+
this.extensionPrefixes = [];
|
|
701
|
+
for (const gen of perFileGenerators) {
|
|
702
|
+
const pattern = `^(.*)\\.${gen.extensionPrefix}\\.ts$`;
|
|
703
|
+
const regexp = new RegExp(pattern, "i");
|
|
704
|
+
this.generators.push({
|
|
705
|
+
generator: gen,
|
|
706
|
+
test: regexp,
|
|
707
|
+
suffix: `.${gen.extensionPrefix}.ts`
|
|
708
|
+
});
|
|
709
|
+
this.extensionPrefixes.push(gen.extensionPrefix);
|
|
710
|
+
}
|
|
711
|
+
const extraInputFiles = [];
|
|
712
|
+
for (const gen of topLevelGenerators) {
|
|
713
|
+
const sf = gen.makeTopLevelShim();
|
|
714
|
+
sfExtensionData(sf).isTopLevelShim = true;
|
|
715
|
+
if (!gen.shouldEmit) {
|
|
716
|
+
this.ignoreForEmit.add(sf);
|
|
717
|
+
}
|
|
718
|
+
const fileName = absoluteFromSourceFile(sf);
|
|
719
|
+
this.shims.set(fileName, sf);
|
|
720
|
+
extraInputFiles.push(fileName);
|
|
721
|
+
}
|
|
722
|
+
for (const rootFile of tsRootFiles) {
|
|
723
|
+
for (const gen of this.generators) {
|
|
724
|
+
extraInputFiles.push(makeShimFileName(rootFile, gen.suffix));
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
this.extraInputFiles = extraInputFiles;
|
|
728
|
+
if (oldProgram !== null) {
|
|
729
|
+
for (const oldSf of oldProgram.getSourceFiles()) {
|
|
730
|
+
if (oldSf.isDeclarationFile || !isFileShimSourceFile(oldSf)) {
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
this.priorShims.set(absoluteFromSourceFile(oldSf), oldSf);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
maybeGenerate(fileName) {
|
|
738
|
+
if (this.notShims.has(fileName)) {
|
|
739
|
+
return null;
|
|
740
|
+
} else if (this.shims.has(fileName)) {
|
|
741
|
+
return this.shims.get(fileName);
|
|
742
|
+
}
|
|
743
|
+
if (isDtsPath(fileName)) {
|
|
744
|
+
this.notShims.add(fileName);
|
|
745
|
+
return null;
|
|
746
|
+
}
|
|
747
|
+
for (const record of this.generators) {
|
|
748
|
+
const match = record.test.exec(fileName);
|
|
749
|
+
if (match === null) {
|
|
750
|
+
continue;
|
|
751
|
+
}
|
|
752
|
+
const prefix = match[1];
|
|
753
|
+
let baseFileName = absoluteFrom(prefix + ".ts");
|
|
754
|
+
if (!this.delegate.fileExists(baseFileName)) {
|
|
755
|
+
baseFileName = absoluteFrom(prefix + ".tsx");
|
|
756
|
+
if (!this.delegate.fileExists(baseFileName)) {
|
|
757
|
+
return void 0;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
const inputFile = this.delegate.getSourceFile(baseFileName, ts6.ScriptTarget.Latest);
|
|
761
|
+
if (inputFile === void 0 || isShim(inputFile)) {
|
|
762
|
+
return void 0;
|
|
763
|
+
}
|
|
764
|
+
return this.generateSpecific(fileName, record.generator, inputFile);
|
|
765
|
+
}
|
|
766
|
+
this.notShims.add(fileName);
|
|
767
|
+
return null;
|
|
768
|
+
}
|
|
769
|
+
generateSpecific(fileName, generator, inputFile) {
|
|
770
|
+
let priorShimSf = null;
|
|
771
|
+
if (this.priorShims.has(fileName)) {
|
|
772
|
+
priorShimSf = this.priorShims.get(fileName);
|
|
773
|
+
this.priorShims.delete(fileName);
|
|
774
|
+
}
|
|
775
|
+
const shimSf = generator.generateShimForFile(inputFile, fileName, priorShimSf);
|
|
776
|
+
sfExtensionData(shimSf).fileShim = {
|
|
777
|
+
extension: generator.extensionPrefix,
|
|
778
|
+
generatedFrom: absoluteFromSourceFile(inputFile)
|
|
779
|
+
};
|
|
780
|
+
if (!generator.shouldEmit) {
|
|
781
|
+
this.ignoreForEmit.add(shimSf);
|
|
782
|
+
}
|
|
783
|
+
this.shims.set(fileName, shimSf);
|
|
784
|
+
return shimSf;
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
|
|
788
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/factory_generator.mjs
|
|
789
|
+
import ts7 from "typescript";
|
|
790
|
+
var TS_DTS_SUFFIX = /(\.d)?\.ts$/;
|
|
791
|
+
var STRIP_NG_FACTORY = /(.*)NgFactory$/;
|
|
792
|
+
var FactoryGenerator = class {
|
|
793
|
+
constructor() {
|
|
794
|
+
this.sourceInfo = /* @__PURE__ */ new Map();
|
|
795
|
+
this.sourceToFactorySymbols = /* @__PURE__ */ new Map();
|
|
796
|
+
this.shouldEmit = true;
|
|
797
|
+
this.extensionPrefix = "ngfactory";
|
|
798
|
+
}
|
|
799
|
+
generateShimForFile(sf, genFilePath) {
|
|
800
|
+
const absoluteSfPath = absoluteFromSourceFile(sf);
|
|
801
|
+
const relativePathToSource = "./" + basename(sf.fileName).replace(TS_DTS_SUFFIX, "");
|
|
802
|
+
const symbolNames = sf.statements.filter(ts7.isClassDeclaration).filter((decl) => isExported(decl) && decl.decorators !== void 0 && decl.name !== void 0).map((decl) => decl.name.text);
|
|
803
|
+
let sourceText = "";
|
|
804
|
+
const leadingComment = getFileoverviewComment(sf);
|
|
805
|
+
if (leadingComment !== null) {
|
|
806
|
+
sourceText = leadingComment + "\n\n";
|
|
807
|
+
}
|
|
808
|
+
if (symbolNames.length > 0) {
|
|
809
|
+
const varLines = symbolNames.map((name) => `export const ${name}NgFactory: i0.\u0275NgModuleFactory<any> = new i0.\u0275NgModuleFactory(${name});`);
|
|
810
|
+
sourceText += [
|
|
811
|
+
`import * as i0 from '@angular/core';`,
|
|
812
|
+
`import {${symbolNames.join(", ")}} from '${relativePathToSource}';`,
|
|
813
|
+
...varLines
|
|
814
|
+
].join("\n");
|
|
815
|
+
}
|
|
816
|
+
sourceText += "\nexport const \u0275NonEmptyModule = true;";
|
|
817
|
+
const genFile = ts7.createSourceFile(genFilePath, sourceText, sf.languageVersion, true, ts7.ScriptKind.TS);
|
|
818
|
+
if (sf.moduleName !== void 0) {
|
|
819
|
+
genFile.moduleName = generatedModuleName(sf.moduleName, sf.fileName, ".ngfactory");
|
|
820
|
+
}
|
|
821
|
+
const moduleSymbols = /* @__PURE__ */ new Map();
|
|
822
|
+
this.sourceToFactorySymbols.set(absoluteSfPath, moduleSymbols);
|
|
823
|
+
this.sourceInfo.set(genFilePath, {
|
|
824
|
+
sourceFilePath: absoluteSfPath,
|
|
825
|
+
moduleSymbols
|
|
826
|
+
});
|
|
827
|
+
return genFile;
|
|
828
|
+
}
|
|
829
|
+
track(sf, moduleInfo) {
|
|
830
|
+
if (this.sourceToFactorySymbols.has(sf.fileName)) {
|
|
831
|
+
this.sourceToFactorySymbols.get(sf.fileName).set(moduleInfo.name, moduleInfo);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
};
|
|
835
|
+
function isExported(decl) {
|
|
836
|
+
return decl.modifiers !== void 0 && decl.modifiers.some((mod) => mod.kind == ts7.SyntaxKind.ExportKeyword);
|
|
837
|
+
}
|
|
838
|
+
function generatedFactoryTransform(factoryMap, importRewriter) {
|
|
839
|
+
return (context) => {
|
|
840
|
+
return (file) => {
|
|
841
|
+
return transformFactorySourceFile(factoryMap, context, importRewriter, file);
|
|
842
|
+
};
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
function transformFactorySourceFile(factoryMap, context, importRewriter, file) {
|
|
846
|
+
if (!factoryMap.has(file.fileName)) {
|
|
847
|
+
return file;
|
|
848
|
+
}
|
|
849
|
+
const { moduleSymbols, sourceFilePath } = factoryMap.get(file.fileName);
|
|
850
|
+
const transformedStatements = [];
|
|
851
|
+
let nonEmptyExport = null;
|
|
852
|
+
const coreImportIdentifiers = /* @__PURE__ */ new Set();
|
|
853
|
+
for (const stmt of file.statements) {
|
|
854
|
+
if (ts7.isImportDeclaration(stmt) && ts7.isStringLiteral(stmt.moduleSpecifier) && stmt.moduleSpecifier.text === "@angular/core") {
|
|
855
|
+
const rewrittenModuleSpecifier = importRewriter.rewriteSpecifier("@angular/core", sourceFilePath);
|
|
856
|
+
if (rewrittenModuleSpecifier !== stmt.moduleSpecifier.text) {
|
|
857
|
+
transformedStatements.push(ts7.updateImportDeclaration(stmt, stmt.decorators, stmt.modifiers, stmt.importClause, ts7.createStringLiteral(rewrittenModuleSpecifier), void 0));
|
|
858
|
+
if (stmt.importClause !== void 0 && stmt.importClause.namedBindings !== void 0 && ts7.isNamespaceImport(stmt.importClause.namedBindings)) {
|
|
859
|
+
coreImportIdentifiers.add(stmt.importClause.namedBindings.name.text);
|
|
860
|
+
}
|
|
861
|
+
} else {
|
|
862
|
+
transformedStatements.push(stmt);
|
|
863
|
+
}
|
|
864
|
+
} else if (ts7.isVariableStatement(stmt) && stmt.declarationList.declarations.length === 1) {
|
|
865
|
+
const decl = stmt.declarationList.declarations[0];
|
|
866
|
+
if (ts7.isIdentifier(decl.name)) {
|
|
867
|
+
if (decl.name.text === "\u0275NonEmptyModule") {
|
|
868
|
+
nonEmptyExport = stmt;
|
|
869
|
+
continue;
|
|
870
|
+
}
|
|
871
|
+
const match = STRIP_NG_FACTORY.exec(decl.name.text);
|
|
872
|
+
const module = match ? moduleSymbols.get(match[1]) : null;
|
|
873
|
+
if (module) {
|
|
874
|
+
const moduleIsTreeShakable = !module.hasId;
|
|
875
|
+
const newStmt = !moduleIsTreeShakable ? stmt : updateInitializers(stmt, (init) => init ? wrapInNoSideEffects(init) : void 0);
|
|
876
|
+
transformedStatements.push(newStmt);
|
|
877
|
+
}
|
|
878
|
+
} else {
|
|
879
|
+
transformedStatements.push(stmt);
|
|
880
|
+
}
|
|
881
|
+
} else {
|
|
882
|
+
transformedStatements.push(stmt);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
if (!transformedStatements.some(ts7.isVariableStatement) && nonEmptyExport !== null) {
|
|
886
|
+
transformedStatements.push(nonEmptyExport);
|
|
887
|
+
}
|
|
888
|
+
file = ts7.updateSourceFileNode(file, transformedStatements);
|
|
889
|
+
if (coreImportIdentifiers.size > 0) {
|
|
890
|
+
const visit = (node) => {
|
|
891
|
+
node = ts7.visitEachChild(node, (child) => visit(child), context);
|
|
892
|
+
if (ts7.isPropertyAccessExpression(node) && ts7.isIdentifier(node.expression) && coreImportIdentifiers.has(node.expression.text)) {
|
|
893
|
+
const rewrittenSymbol = importRewriter.rewriteSymbol(node.name.text, "@angular/core");
|
|
894
|
+
if (rewrittenSymbol !== node.name.text) {
|
|
895
|
+
const updated = ts7.updatePropertyAccess(node, node.expression, ts7.createIdentifier(rewrittenSymbol));
|
|
896
|
+
node = updated;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
return node;
|
|
900
|
+
};
|
|
901
|
+
file = visit(file);
|
|
902
|
+
}
|
|
903
|
+
return file;
|
|
904
|
+
}
|
|
905
|
+
function getFileoverviewComment(sourceFile) {
|
|
906
|
+
const text = sourceFile.getFullText();
|
|
907
|
+
const trivia = text.substring(0, sourceFile.getStart());
|
|
908
|
+
const leadingComments = ts7.getLeadingCommentRanges(trivia, 0);
|
|
909
|
+
if (!leadingComments || leadingComments.length === 0) {
|
|
910
|
+
return null;
|
|
911
|
+
}
|
|
912
|
+
const comment = leadingComments[0];
|
|
913
|
+
if (comment.kind !== ts7.SyntaxKind.MultiLineCommentTrivia) {
|
|
914
|
+
return null;
|
|
915
|
+
}
|
|
916
|
+
if (text.substring(comment.end, comment.end + 2) !== "\n\n") {
|
|
917
|
+
return null;
|
|
918
|
+
}
|
|
919
|
+
const commentText = text.substring(comment.pos, comment.end);
|
|
920
|
+
if (commentText.indexOf("@license") !== -1) {
|
|
921
|
+
return null;
|
|
922
|
+
}
|
|
923
|
+
return commentText;
|
|
924
|
+
}
|
|
925
|
+
function wrapInNoSideEffects(expr) {
|
|
926
|
+
const noSideEffects = ts7.createPropertyAccess(ts7.createIdentifier("i0"), "\u0275noSideEffects");
|
|
927
|
+
return ts7.createCall(noSideEffects, [], [
|
|
928
|
+
ts7.createFunctionExpression([], void 0, void 0, [], [], void 0, ts7.createBlock([
|
|
929
|
+
ts7.createReturn(expr)
|
|
930
|
+
]))
|
|
931
|
+
]);
|
|
932
|
+
}
|
|
933
|
+
function updateInitializers(stmt, update) {
|
|
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)))));
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/reference_tagger.mjs
|
|
938
|
+
var ShimReferenceTagger = class {
|
|
939
|
+
constructor(shimExtensions) {
|
|
940
|
+
this.tagged = /* @__PURE__ */ new Set();
|
|
941
|
+
this.enabled = true;
|
|
942
|
+
this.suffixes = shimExtensions.map((extension) => `.${extension}.ts`);
|
|
943
|
+
}
|
|
944
|
+
tag(sf) {
|
|
945
|
+
if (!this.enabled || sf.isDeclarationFile || isShim(sf) || this.tagged.has(sf) || !isNonDeclarationTsPath(sf.fileName)) {
|
|
946
|
+
return;
|
|
947
|
+
}
|
|
948
|
+
const ext = sfExtensionData(sf);
|
|
949
|
+
if (ext.originalReferencedFiles === null) {
|
|
950
|
+
ext.originalReferencedFiles = sf.referencedFiles;
|
|
951
|
+
}
|
|
952
|
+
const referencedFiles = [...ext.originalReferencedFiles];
|
|
953
|
+
const sfPath = absoluteFromSourceFile(sf);
|
|
954
|
+
for (const suffix of this.suffixes) {
|
|
955
|
+
referencedFiles.push({
|
|
956
|
+
fileName: makeShimFileName(sfPath, suffix),
|
|
957
|
+
pos: 0,
|
|
958
|
+
end: 0
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
ext.taggedReferenceFiles = referencedFiles;
|
|
962
|
+
sf.referencedFiles = referencedFiles;
|
|
963
|
+
this.tagged.add(sf);
|
|
964
|
+
}
|
|
965
|
+
finalize() {
|
|
966
|
+
this.enabled = false;
|
|
967
|
+
this.tagged.clear();
|
|
968
|
+
}
|
|
969
|
+
};
|
|
970
|
+
|
|
971
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/summary_generator.mjs
|
|
972
|
+
import ts8 from "typescript";
|
|
973
|
+
var SummaryGenerator = class {
|
|
974
|
+
constructor() {
|
|
975
|
+
this.shouldEmit = true;
|
|
976
|
+
this.extensionPrefix = "ngsummary";
|
|
977
|
+
}
|
|
978
|
+
generateShimForFile(sf, genFilePath) {
|
|
979
|
+
const symbolNames = [];
|
|
980
|
+
for (const stmt of sf.statements) {
|
|
981
|
+
if (ts8.isClassDeclaration(stmt)) {
|
|
982
|
+
if (!isExported2(stmt) || stmt.decorators === void 0 || stmt.name === void 0) {
|
|
983
|
+
continue;
|
|
984
|
+
}
|
|
985
|
+
symbolNames.push(stmt.name.text);
|
|
986
|
+
} else if (ts8.isExportDeclaration(stmt)) {
|
|
987
|
+
if (stmt.exportClause === void 0 || stmt.moduleSpecifier !== void 0 || !ts8.isNamedExports(stmt.exportClause)) {
|
|
988
|
+
continue;
|
|
989
|
+
}
|
|
990
|
+
for (const specifier of stmt.exportClause.elements) {
|
|
991
|
+
symbolNames.push(specifier.name.text);
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
const varLines = symbolNames.map((name) => `export const ${name}NgSummary: any = null;`);
|
|
996
|
+
if (varLines.length === 0) {
|
|
997
|
+
varLines.push(`export const \u0275empty = null;`);
|
|
998
|
+
}
|
|
999
|
+
const sourceText = varLines.join("\n");
|
|
1000
|
+
const genFile = ts8.createSourceFile(genFilePath, sourceText, sf.languageVersion, true, ts8.ScriptKind.TS);
|
|
1001
|
+
if (sf.moduleName !== void 0) {
|
|
1002
|
+
genFile.moduleName = generatedModuleName(sf.moduleName, sf.fileName, ".ngsummary");
|
|
1003
|
+
}
|
|
1004
|
+
return genFile;
|
|
1005
|
+
}
|
|
1006
|
+
};
|
|
1007
|
+
function isExported2(decl) {
|
|
1008
|
+
return decl.modifiers !== void 0 && decl.modifiers.some((mod) => mod.kind == ts8.SyntaxKind.ExportKeyword);
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
620
1012
|
var DelegatingCompilerHost = class {
|
|
621
1013
|
constructor(delegate) {
|
|
622
1014
|
this.delegate = delegate;
|
|
@@ -705,7 +1097,7 @@ var TsCreateProgramDriver = class {
|
|
|
705
1097
|
this.sfMap.clear();
|
|
706
1098
|
}
|
|
707
1099
|
for (const [filePath, { newText, originalFile }] of contents.entries()) {
|
|
708
|
-
const sf =
|
|
1100
|
+
const sf = ts9.createSourceFile(filePath, newText, ts9.ScriptTarget.Latest, true);
|
|
709
1101
|
if (originalFile !== null) {
|
|
710
1102
|
sf[NgOriginalFile] = originalFile;
|
|
711
1103
|
}
|
|
@@ -714,7 +1106,7 @@ var TsCreateProgramDriver = class {
|
|
|
714
1106
|
const host = new UpdatedProgramHost(this.sfMap, this.originalProgram, this.originalHost, this.shimExtensionPrefixes);
|
|
715
1107
|
const oldProgram = this.program;
|
|
716
1108
|
retagAllTsFiles(oldProgram);
|
|
717
|
-
this.program =
|
|
1109
|
+
this.program = ts9.createProgram({
|
|
718
1110
|
host,
|
|
719
1111
|
rootNames: this.program.getRootFileNames(),
|
|
720
1112
|
options: this.options,
|
|
@@ -726,7 +1118,7 @@ var TsCreateProgramDriver = class {
|
|
|
726
1118
|
}
|
|
727
1119
|
};
|
|
728
1120
|
|
|
729
|
-
// bazel-out/
|
|
1121
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/dependency_tracking.mjs
|
|
730
1122
|
var FileDependencyGraph = class {
|
|
731
1123
|
constructor() {
|
|
732
1124
|
this.nodes = /* @__PURE__ */ new Map();
|
|
@@ -793,7 +1185,7 @@ function isLogicallyChanged(sf, node, changedTsPaths, deletedTsPaths, changedRes
|
|
|
793
1185
|
return false;
|
|
794
1186
|
}
|
|
795
1187
|
|
|
796
|
-
// bazel-out/
|
|
1188
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/state.mjs
|
|
797
1189
|
var IncrementalStateKind;
|
|
798
1190
|
(function(IncrementalStateKind2) {
|
|
799
1191
|
IncrementalStateKind2[IncrementalStateKind2["Fresh"] = 0] = "Fresh";
|
|
@@ -801,7 +1193,7 @@ var IncrementalStateKind;
|
|
|
801
1193
|
IncrementalStateKind2[IncrementalStateKind2["Analyzed"] = 2] = "Analyzed";
|
|
802
1194
|
})(IncrementalStateKind || (IncrementalStateKind = {}));
|
|
803
1195
|
|
|
804
|
-
// bazel-out/
|
|
1196
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/incremental.mjs
|
|
805
1197
|
var PhaseKind;
|
|
806
1198
|
(function(PhaseKind2) {
|
|
807
1199
|
PhaseKind2[PhaseKind2["Analysis"] = 0] = "Analysis";
|
|
@@ -1002,7 +1394,7 @@ function toOriginalSourceFile(sf) {
|
|
|
1002
1394
|
}
|
|
1003
1395
|
}
|
|
1004
1396
|
|
|
1005
|
-
// bazel-out/
|
|
1397
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/strategy.mjs
|
|
1006
1398
|
var TrackedIncrementalBuildStrategy = class {
|
|
1007
1399
|
constructor() {
|
|
1008
1400
|
this.state = null;
|
|
@@ -1038,7 +1430,7 @@ var PatchedProgramIncrementalBuildStrategy = class {
|
|
|
1038
1430
|
};
|
|
1039
1431
|
var SYM_INCREMENTAL_STATE = Symbol("NgIncrementalState");
|
|
1040
1432
|
|
|
1041
|
-
// bazel-out/
|
|
1433
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/api.mjs
|
|
1042
1434
|
var IdentifierKind;
|
|
1043
1435
|
(function(IdentifierKind2) {
|
|
1044
1436
|
IdentifierKind2[IdentifierKind2["Property"] = 0] = "Property";
|
|
@@ -1056,7 +1448,7 @@ var AbsoluteSourceSpan = class {
|
|
|
1056
1448
|
}
|
|
1057
1449
|
};
|
|
1058
1450
|
|
|
1059
|
-
// bazel-out/
|
|
1451
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/context.mjs
|
|
1060
1452
|
var IndexingContext = class {
|
|
1061
1453
|
constructor() {
|
|
1062
1454
|
this.components = /* @__PURE__ */ new Set();
|
|
@@ -1066,10 +1458,10 @@ var IndexingContext = class {
|
|
|
1066
1458
|
}
|
|
1067
1459
|
};
|
|
1068
1460
|
|
|
1069
|
-
// bazel-out/
|
|
1461
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/transform.mjs
|
|
1070
1462
|
import { ParseSourceFile } from "@angular/compiler";
|
|
1071
1463
|
|
|
1072
|
-
// bazel-out/
|
|
1464
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/template.mjs
|
|
1073
1465
|
import { ASTWithSource, ImplicitReceiver, PropertyRead, PropertyWrite, RecursiveAstVisitor, TmplAstElement, TmplAstRecursiveVisitor, TmplAstReference, TmplAstTemplate } from "@angular/compiler";
|
|
1074
1466
|
var ExpressionVisitor = class extends RecursiveAstVisitor {
|
|
1075
1467
|
constructor(expressionStr, absoluteOffset, boundTemplate, targetToIdentifier) {
|
|
@@ -1306,7 +1698,7 @@ function getTemplateIdentifiers(boundTemplate) {
|
|
|
1306
1698
|
return { identifiers: visitor.identifiers, errors: visitor.errors };
|
|
1307
1699
|
}
|
|
1308
1700
|
|
|
1309
|
-
// bazel-out/
|
|
1701
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/transform.mjs
|
|
1310
1702
|
function generateAnalysis(context) {
|
|
1311
1703
|
const analysis = /* @__PURE__ */ new Map();
|
|
1312
1704
|
context.components.forEach(({ declaration, selector, boundTemplate, templateMeta }) => {
|
|
@@ -1342,8 +1734,8 @@ function generateAnalysis(context) {
|
|
|
1342
1734
|
return analysis;
|
|
1343
1735
|
}
|
|
1344
1736
|
|
|
1345
|
-
// bazel-out/
|
|
1346
|
-
import
|
|
1737
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/resource/src/loader.mjs
|
|
1738
|
+
import ts10 from "typescript";
|
|
1347
1739
|
var CSS_PREPROCESSOR_EXT = /(\.scss|\.sass|\.less|\.styl)$/;
|
|
1348
1740
|
var RESOURCE_MARKER = ".$ngresource$";
|
|
1349
1741
|
var RESOURCE_MARKER_TS = RESOURCE_MARKER + ".ts";
|
|
@@ -1453,7 +1845,7 @@ var AdapterResourceLoader = class {
|
|
|
1453
1845
|
return this.adapter.rootDirs.map((rootDir) => join(rootDir, segment));
|
|
1454
1846
|
}
|
|
1455
1847
|
getResolvedCandidateLocations(url, fromFile) {
|
|
1456
|
-
const failedLookup =
|
|
1848
|
+
const failedLookup = ts10.resolveModuleName(url + RESOURCE_MARKER, fromFile, this.options, this.lookupResolutionHost);
|
|
1457
1849
|
if (failedLookup.failedLookupLocations === void 0) {
|
|
1458
1850
|
throw new Error(`Internal error: expected to find failedLookupLocations during resolution of resource '${url}' in context of ${fromFile}`);
|
|
1459
1851
|
}
|
|
@@ -1488,7 +1880,7 @@ function createLookupResolutionHost(adapter) {
|
|
|
1488
1880
|
};
|
|
1489
1881
|
}
|
|
1490
1882
|
|
|
1491
|
-
// bazel-out/
|
|
1883
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/dependency.mjs
|
|
1492
1884
|
var MetadataDtsModuleScopeResolver = class {
|
|
1493
1885
|
constructor(dtsMetaReader, aliasingHost) {
|
|
1494
1886
|
this.dtsMetaReader = dtsMetaReader;
|
|
@@ -1574,9 +1966,9 @@ var MetadataDtsModuleScopeResolver = class {
|
|
|
1574
1966
|
}
|
|
1575
1967
|
};
|
|
1576
1968
|
|
|
1577
|
-
// bazel-out/
|
|
1969
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/local.mjs
|
|
1578
1970
|
import { ExternalExpr } from "@angular/compiler";
|
|
1579
|
-
import
|
|
1971
|
+
import ts11 from "typescript";
|
|
1580
1972
|
var LocalModuleScopeRegistry = class {
|
|
1581
1973
|
constructor(localReader, dependencyScopeReader, refEmitter, aliasingHost) {
|
|
1582
1974
|
this.localReader = localReader;
|
|
@@ -1777,7 +2169,7 @@ var LocalModuleScopeRegistry = class {
|
|
|
1777
2169
|
}
|
|
1778
2170
|
getExportedScope(ref, diagnostics, ownerForErrors, type) {
|
|
1779
2171
|
if (ref.node.getSourceFile().isDeclarationFile) {
|
|
1780
|
-
if (!
|
|
2172
|
+
if (!ts11.isClassDeclaration(ref.node)) {
|
|
1781
2173
|
const code = type === "import" ? ErrorCode.NGMODULE_INVALID_IMPORT : ErrorCode.NGMODULE_INVALID_EXPORT;
|
|
1782
2174
|
diagnostics.push(makeDiagnostic(code, identifierOfNode(ref.node) || ref.node, `Appears in the NgModule.${type}s of ${nodeNameForError(ownerForErrors)}, but could not be resolved to an NgModule`));
|
|
1783
2175
|
return "invalid";
|
|
@@ -1884,9 +2276,9 @@ function reexportCollision(module, refA, refB) {
|
|
|
1884
2276
|
]);
|
|
1885
2277
|
}
|
|
1886
2278
|
|
|
1887
|
-
// bazel-out/
|
|
2279
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/typecheck.mjs
|
|
1888
2280
|
import { CssSelector, SelectorMatcher } from "@angular/compiler";
|
|
1889
|
-
import
|
|
2281
|
+
import ts12 from "typescript";
|
|
1890
2282
|
var TypeCheckScopeRegistry = class {
|
|
1891
2283
|
constructor(scopeReader, metaReader) {
|
|
1892
2284
|
this.scopeReader = scopeReader;
|
|
@@ -1919,8 +2311,8 @@ var TypeCheckScopeRegistry = class {
|
|
|
1919
2311
|
}
|
|
1920
2312
|
}
|
|
1921
2313
|
for (const { name, ref } of scope.compilation.pipes) {
|
|
1922
|
-
if (!
|
|
1923
|
-
throw new Error(`Unexpected non-class declaration ${
|
|
2314
|
+
if (!ts12.isClassDeclaration(ref.node)) {
|
|
2315
|
+
throw new Error(`Unexpected non-class declaration ${ts12.SyntaxKind[ref.node.kind]} for pipe ${ref.debugName}`);
|
|
1924
2316
|
}
|
|
1925
2317
|
pipes.set(name, ref);
|
|
1926
2318
|
}
|
|
@@ -1945,11 +2337,11 @@ var TypeCheckScopeRegistry = class {
|
|
|
1945
2337
|
}
|
|
1946
2338
|
};
|
|
1947
2339
|
|
|
1948
|
-
// bazel-out/
|
|
2340
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
|
|
1949
2341
|
import { CssSelector as CssSelector2, DomElementSchemaRegistry as DomElementSchemaRegistry2 } from "@angular/compiler";
|
|
1950
2342
|
|
|
1951
|
-
// bazel-out/
|
|
1952
|
-
import
|
|
2343
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/diagnostic.mjs
|
|
2344
|
+
import ts13 from "typescript";
|
|
1953
2345
|
function makeTemplateDiagnostic(templateId, mapping, span, category, code, messageText, relatedMessages) {
|
|
1954
2346
|
if (mapping.type === "direct") {
|
|
1955
2347
|
let relatedInformation = void 0;
|
|
@@ -1957,7 +2349,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
1957
2349
|
relatedInformation = [];
|
|
1958
2350
|
for (const relatedMessage of relatedMessages) {
|
|
1959
2351
|
relatedInformation.push({
|
|
1960
|
-
category:
|
|
2352
|
+
category: ts13.DiagnosticCategory.Message,
|
|
1961
2353
|
code: 0,
|
|
1962
2354
|
file: relatedMessage.sourceFile,
|
|
1963
2355
|
start: relatedMessage.start,
|
|
@@ -1982,12 +2374,12 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
1982
2374
|
const componentSf = mapping.componentClass.getSourceFile();
|
|
1983
2375
|
const componentName = mapping.componentClass.name.text;
|
|
1984
2376
|
const fileName = mapping.type === "indirect" ? `${componentSf.fileName} (${componentName} template)` : mapping.templateUrl;
|
|
1985
|
-
const sf =
|
|
2377
|
+
const sf = ts13.createSourceFile(fileName, mapping.template, ts13.ScriptTarget.Latest, false, ts13.ScriptKind.JSX);
|
|
1986
2378
|
let relatedInformation = [];
|
|
1987
2379
|
if (relatedMessages !== void 0) {
|
|
1988
2380
|
for (const relatedMessage of relatedMessages) {
|
|
1989
2381
|
relatedInformation.push({
|
|
1990
|
-
category:
|
|
2382
|
+
category: ts13.DiagnosticCategory.Message,
|
|
1991
2383
|
code: 0,
|
|
1992
2384
|
file: relatedMessage.sourceFile,
|
|
1993
2385
|
start: relatedMessage.start,
|
|
@@ -1997,7 +2389,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
1997
2389
|
}
|
|
1998
2390
|
}
|
|
1999
2391
|
relatedInformation.push({
|
|
2000
|
-
category:
|
|
2392
|
+
category: ts13.DiagnosticCategory.Message,
|
|
2001
2393
|
code: 0,
|
|
2002
2394
|
file: componentSf,
|
|
2003
2395
|
start: mapping.node.getStart(),
|
|
@@ -2021,7 +2413,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
2021
2413
|
}
|
|
2022
2414
|
}
|
|
2023
2415
|
|
|
2024
|
-
// bazel-out/
|
|
2416
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/id.mjs
|
|
2025
2417
|
var TEMPLATE_ID = Symbol("ngTemplateId");
|
|
2026
2418
|
var NEXT_TEMPLATE_ID = Symbol("ngNextTemplateId");
|
|
2027
2419
|
function getTemplateId(clazz) {
|
|
@@ -2038,17 +2430,17 @@ function allocateTemplateId(sf) {
|
|
|
2038
2430
|
return `tcb${sf[NEXT_TEMPLATE_ID]++}`;
|
|
2039
2431
|
}
|
|
2040
2432
|
|
|
2041
|
-
// bazel-out/
|
|
2433
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
2042
2434
|
import { EmptyExpr, ImplicitReceiver as ImplicitReceiver2, PropertyRead as PropertyRead2, PropertyWrite as PropertyWrite2, SafePropertyRead, TmplAstReference as TmplAstReference2, TmplAstTextAttribute } from "@angular/compiler";
|
|
2043
|
-
import
|
|
2435
|
+
import ts15 from "typescript";
|
|
2044
2436
|
|
|
2045
|
-
// bazel-out/
|
|
2437
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/comments.mjs
|
|
2046
2438
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan2 } from "@angular/compiler";
|
|
2047
|
-
import
|
|
2439
|
+
import ts14 from "typescript";
|
|
2048
2440
|
var parseSpanComment = /^(\d+),(\d+)$/;
|
|
2049
2441
|
function readSpanComment(node, sourceFile = node.getSourceFile()) {
|
|
2050
|
-
return
|
|
2051
|
-
if (kind !==
|
|
2442
|
+
return ts14.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
2443
|
+
if (kind !== ts14.SyntaxKind.MultiLineCommentTrivia) {
|
|
2052
2444
|
return null;
|
|
2053
2445
|
}
|
|
2054
2446
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -2071,15 +2463,15 @@ var ExpressionIdentifier;
|
|
|
2071
2463
|
ExpressionIdentifier2["EVENT_PARAMETER"] = "EP";
|
|
2072
2464
|
})(ExpressionIdentifier || (ExpressionIdentifier = {}));
|
|
2073
2465
|
function addExpressionIdentifier(node, identifier) {
|
|
2074
|
-
|
|
2466
|
+
ts14.addSyntheticTrailingComment(node, ts14.SyntaxKind.MultiLineCommentTrivia, `${CommentTriviaType.EXPRESSION_TYPE_IDENTIFIER}:${identifier}`, false);
|
|
2075
2467
|
}
|
|
2076
2468
|
var IGNORE_FOR_DIAGNOSTICS_MARKER = `${CommentTriviaType.DIAGNOSTIC}:ignore`;
|
|
2077
2469
|
function markIgnoreDiagnostics(node) {
|
|
2078
|
-
|
|
2470
|
+
ts14.addSyntheticTrailingComment(node, ts14.SyntaxKind.MultiLineCommentTrivia, IGNORE_FOR_DIAGNOSTICS_MARKER, false);
|
|
2079
2471
|
}
|
|
2080
2472
|
function hasIgnoreForDiagnosticsMarker(node, sourceFile) {
|
|
2081
|
-
return
|
|
2082
|
-
if (kind !==
|
|
2473
|
+
return ts14.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
2474
|
+
if (kind !== ts14.SyntaxKind.MultiLineCommentTrivia) {
|
|
2083
2475
|
return null;
|
|
2084
2476
|
}
|
|
2085
2477
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -2153,8 +2545,8 @@ function findAllMatchingNodes(tcb, opts) {
|
|
|
2153
2545
|
return results;
|
|
2154
2546
|
}
|
|
2155
2547
|
function hasExpressionIdentifier(sourceFile, node, identifier) {
|
|
2156
|
-
return
|
|
2157
|
-
if (kind !==
|
|
2548
|
+
return ts14.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
2549
|
+
if (kind !== ts14.SyntaxKind.MultiLineCommentTrivia) {
|
|
2158
2550
|
return false;
|
|
2159
2551
|
}
|
|
2160
2552
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -2162,7 +2554,7 @@ function hasExpressionIdentifier(sourceFile, node, identifier) {
|
|
|
2162
2554
|
}) || false;
|
|
2163
2555
|
}
|
|
2164
2556
|
|
|
2165
|
-
// bazel-out/
|
|
2557
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
2166
2558
|
var CompletionEngine = class {
|
|
2167
2559
|
constructor(tcb, data, tcbPath, tcbIsShim) {
|
|
2168
2560
|
this.tcb = tcb;
|
|
@@ -2172,7 +2564,7 @@ var CompletionEngine = class {
|
|
|
2172
2564
|
this.templateContextCache = /* @__PURE__ */ new Map();
|
|
2173
2565
|
this.expressionCompletionCache = /* @__PURE__ */ new Map();
|
|
2174
2566
|
const globalRead = findFirstMatchingNode(this.tcb, {
|
|
2175
|
-
filter:
|
|
2567
|
+
filter: ts15.isPropertyAccessExpression,
|
|
2176
2568
|
withExpressionIdentifier: ExpressionIdentifier.COMPONENT_COMPLETION
|
|
2177
2569
|
});
|
|
2178
2570
|
if (globalRead !== null) {
|
|
@@ -2196,7 +2588,7 @@ var CompletionEngine = class {
|
|
|
2196
2588
|
let nodeContext = null;
|
|
2197
2589
|
if (node instanceof EmptyExpr) {
|
|
2198
2590
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
2199
|
-
filter:
|
|
2591
|
+
filter: ts15.isIdentifier,
|
|
2200
2592
|
withSpan: node.sourceSpan
|
|
2201
2593
|
});
|
|
2202
2594
|
if (nodeLocation !== null) {
|
|
@@ -2209,7 +2601,7 @@ var CompletionEngine = class {
|
|
|
2209
2601
|
}
|
|
2210
2602
|
if (node instanceof PropertyRead2 && node.receiver instanceof ImplicitReceiver2) {
|
|
2211
2603
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
2212
|
-
filter:
|
|
2604
|
+
filter: ts15.isPropertyAccessExpression,
|
|
2213
2605
|
withSpan: node.sourceSpan
|
|
2214
2606
|
});
|
|
2215
2607
|
if (nodeLocation) {
|
|
@@ -2233,21 +2625,21 @@ var CompletionEngine = class {
|
|
|
2233
2625
|
let tsExpr = null;
|
|
2234
2626
|
if (expr instanceof PropertyRead2 || expr instanceof PropertyWrite2) {
|
|
2235
2627
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
2236
|
-
filter:
|
|
2628
|
+
filter: ts15.isPropertyAccessExpression,
|
|
2237
2629
|
withSpan: expr.nameSpan
|
|
2238
2630
|
});
|
|
2239
2631
|
} else if (expr instanceof SafePropertyRead) {
|
|
2240
2632
|
const ternaryExpr = findFirstMatchingNode(this.tcb, {
|
|
2241
|
-
filter:
|
|
2633
|
+
filter: ts15.isParenthesizedExpression,
|
|
2242
2634
|
withSpan: expr.sourceSpan
|
|
2243
2635
|
});
|
|
2244
|
-
if (ternaryExpr === null || !
|
|
2636
|
+
if (ternaryExpr === null || !ts15.isConditionalExpression(ternaryExpr.expression)) {
|
|
2245
2637
|
return null;
|
|
2246
2638
|
}
|
|
2247
2639
|
const whenTrue = ternaryExpr.expression.whenTrue;
|
|
2248
|
-
if (
|
|
2640
|
+
if (ts15.isPropertyAccessExpression(whenTrue)) {
|
|
2249
2641
|
tsExpr = whenTrue;
|
|
2250
|
-
} else if (
|
|
2642
|
+
} else if (ts15.isCallExpression(whenTrue) && ts15.isPropertyAccessExpression(whenTrue.expression)) {
|
|
2251
2643
|
tsExpr = whenTrue.expression;
|
|
2252
2644
|
}
|
|
2253
2645
|
}
|
|
@@ -2269,15 +2661,15 @@ var CompletionEngine = class {
|
|
|
2269
2661
|
let tsExpr = null;
|
|
2270
2662
|
if (expr instanceof TmplAstTextAttribute) {
|
|
2271
2663
|
const strNode = findFirstMatchingNode(this.tcb, {
|
|
2272
|
-
filter:
|
|
2664
|
+
filter: ts15.isParenthesizedExpression,
|
|
2273
2665
|
withSpan: expr.sourceSpan
|
|
2274
2666
|
});
|
|
2275
|
-
if (strNode !== null &&
|
|
2667
|
+
if (strNode !== null && ts15.isStringLiteral(strNode.expression)) {
|
|
2276
2668
|
tsExpr = strNode.expression;
|
|
2277
2669
|
}
|
|
2278
2670
|
} else {
|
|
2279
2671
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
2280
|
-
filter: (n) =>
|
|
2672
|
+
filter: (n) => ts15.isStringLiteral(n) || ts15.isNumericLiteral(n),
|
|
2281
2673
|
withSpan: expr.sourceSpan
|
|
2282
2674
|
});
|
|
2283
2675
|
}
|
|
@@ -2285,7 +2677,7 @@ var CompletionEngine = class {
|
|
|
2285
2677
|
return null;
|
|
2286
2678
|
}
|
|
2287
2679
|
let positionInShimFile = tsExpr.getEnd();
|
|
2288
|
-
if (
|
|
2680
|
+
if (ts15.isStringLiteral(tsExpr)) {
|
|
2289
2681
|
positionInShimFile -= 1;
|
|
2290
2682
|
}
|
|
2291
2683
|
const res = {
|
|
@@ -2319,12 +2711,12 @@ var CompletionEngine = class {
|
|
|
2319
2711
|
}
|
|
2320
2712
|
};
|
|
2321
2713
|
|
|
2322
|
-
// bazel-out/
|
|
2323
|
-
import
|
|
2714
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
|
|
2715
|
+
import ts29 from "typescript";
|
|
2324
2716
|
|
|
2325
|
-
// bazel-out/
|
|
2717
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/dom.mjs
|
|
2326
2718
|
import { DomElementSchemaRegistry } from "@angular/compiler";
|
|
2327
|
-
import
|
|
2719
|
+
import ts16 from "typescript";
|
|
2328
2720
|
var REGISTRY = new DomElementSchemaRegistry();
|
|
2329
2721
|
var REMOVE_XHTML_REGEX = /^:xhtml:/;
|
|
2330
2722
|
var RegistryDomSchemaChecker = class {
|
|
@@ -2348,7 +2740,7 @@ var RegistryDomSchemaChecker = class {
|
|
|
2348
2740
|
} else {
|
|
2349
2741
|
errorMsg += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;
|
|
2350
2742
|
}
|
|
2351
|
-
const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan,
|
|
2743
|
+
const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan, ts16.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ELEMENT), errorMsg);
|
|
2352
2744
|
this._diagnostics.push(diag);
|
|
2353
2745
|
}
|
|
2354
2746
|
}
|
|
@@ -2366,70 +2758,70 @@ var RegistryDomSchemaChecker = class {
|
|
|
2366
2758
|
2. If '${element.name}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
|
|
2367
2759
|
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;
|
|
2368
2760
|
}
|
|
2369
|
-
const diag = makeTemplateDiagnostic(id, mapping, span,
|
|
2761
|
+
const diag = makeTemplateDiagnostic(id, mapping, span, ts16.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ATTRIBUTE), errorMsg);
|
|
2370
2762
|
this._diagnostics.push(diag);
|
|
2371
2763
|
}
|
|
2372
2764
|
}
|
|
2373
2765
|
};
|
|
2374
2766
|
|
|
2375
|
-
// bazel-out/
|
|
2767
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
|
|
2376
2768
|
import { ExpressionType, ExternalExpr as ExternalExpr2, TypeModifier } from "@angular/compiler";
|
|
2377
|
-
import
|
|
2769
|
+
import ts22 from "typescript";
|
|
2378
2770
|
|
|
2379
|
-
// bazel-out/
|
|
2380
|
-
import
|
|
2771
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/ts_util.mjs
|
|
2772
|
+
import ts17 from "typescript";
|
|
2381
2773
|
var SAFE_TO_CAST_WITHOUT_PARENS = /* @__PURE__ */ new Set([
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2774
|
+
ts17.SyntaxKind.ParenthesizedExpression,
|
|
2775
|
+
ts17.SyntaxKind.Identifier,
|
|
2776
|
+
ts17.SyntaxKind.CallExpression,
|
|
2777
|
+
ts17.SyntaxKind.NonNullExpression,
|
|
2778
|
+
ts17.SyntaxKind.ElementAccessExpression,
|
|
2779
|
+
ts17.SyntaxKind.PropertyAccessExpression,
|
|
2780
|
+
ts17.SyntaxKind.ArrayLiteralExpression,
|
|
2781
|
+
ts17.SyntaxKind.ObjectLiteralExpression,
|
|
2782
|
+
ts17.SyntaxKind.StringLiteral,
|
|
2783
|
+
ts17.SyntaxKind.NumericLiteral,
|
|
2784
|
+
ts17.SyntaxKind.TrueKeyword,
|
|
2785
|
+
ts17.SyntaxKind.FalseKeyword,
|
|
2786
|
+
ts17.SyntaxKind.NullKeyword,
|
|
2787
|
+
ts17.SyntaxKind.UndefinedKeyword
|
|
2396
2788
|
]);
|
|
2397
2789
|
function tsCastToAny(expr) {
|
|
2398
2790
|
if (!SAFE_TO_CAST_WITHOUT_PARENS.has(expr.kind)) {
|
|
2399
|
-
expr =
|
|
2791
|
+
expr = ts17.createParen(expr);
|
|
2400
2792
|
}
|
|
2401
|
-
return
|
|
2793
|
+
return ts17.createParen(ts17.createAsExpression(expr, ts17.createKeywordTypeNode(ts17.SyntaxKind.AnyKeyword)));
|
|
2402
2794
|
}
|
|
2403
2795
|
function tsCreateElement(tagName) {
|
|
2404
|
-
const createElement =
|
|
2405
|
-
return
|
|
2796
|
+
const createElement = ts17.createPropertyAccess(ts17.createIdentifier("document"), "createElement");
|
|
2797
|
+
return ts17.createCall(createElement, void 0, [ts17.createLiteral(tagName)]);
|
|
2406
2798
|
}
|
|
2407
2799
|
function tsDeclareVariable(id, type) {
|
|
2408
|
-
const decl =
|
|
2409
|
-
return
|
|
2800
|
+
const decl = ts17.createVariableDeclaration(id, type, ts17.createNonNullExpression(ts17.createNull()));
|
|
2801
|
+
return ts17.createVariableStatement(void 0, [decl]);
|
|
2410
2802
|
}
|
|
2411
2803
|
function tsCreateTypeQueryForCoercedInput(typeName, coercedInputName) {
|
|
2412
|
-
return
|
|
2804
|
+
return ts17.createTypeQueryNode(ts17.createQualifiedName(typeName, `ngAcceptInputType_${coercedInputName}`));
|
|
2413
2805
|
}
|
|
2414
2806
|
function tsCreateVariable(id, initializer) {
|
|
2415
|
-
const decl =
|
|
2416
|
-
return
|
|
2807
|
+
const decl = ts17.createVariableDeclaration(id, void 0, initializer);
|
|
2808
|
+
return ts17.createVariableStatement(void 0, [decl]);
|
|
2417
2809
|
}
|
|
2418
2810
|
function tsCallMethod(receiver, methodName, args = []) {
|
|
2419
|
-
const methodAccess =
|
|
2420
|
-
return
|
|
2811
|
+
const methodAccess = ts17.createPropertyAccess(receiver, methodName);
|
|
2812
|
+
return ts17.createCall(methodAccess, void 0, args);
|
|
2421
2813
|
}
|
|
2422
2814
|
function checkIfClassIsExported(node) {
|
|
2423
|
-
if (node.modifiers !== void 0 && node.modifiers.some((mod) => mod.kind ===
|
|
2815
|
+
if (node.modifiers !== void 0 && node.modifiers.some((mod) => mod.kind === ts17.SyntaxKind.ExportKeyword)) {
|
|
2424
2816
|
return true;
|
|
2425
|
-
} else if (node.parent !== void 0 &&
|
|
2817
|
+
} else if (node.parent !== void 0 && ts17.isSourceFile(node.parent) && checkIfFileHasExport(node.parent, node.name.text)) {
|
|
2426
2818
|
return true;
|
|
2427
2819
|
}
|
|
2428
2820
|
return false;
|
|
2429
2821
|
}
|
|
2430
2822
|
function checkIfFileHasExport(sf, name) {
|
|
2431
2823
|
for (const stmt of sf.statements) {
|
|
2432
|
-
if (
|
|
2824
|
+
if (ts17.isExportDeclaration(stmt) && stmt.exportClause !== void 0 && ts17.isNamedExports(stmt.exportClause)) {
|
|
2433
2825
|
for (const element of stmt.exportClause.elements) {
|
|
2434
2826
|
if (element.propertyName === void 0 && element.name.text === name) {
|
|
2435
2827
|
return true;
|
|
@@ -2442,20 +2834,20 @@ function checkIfFileHasExport(sf, name) {
|
|
|
2442
2834
|
return false;
|
|
2443
2835
|
}
|
|
2444
2836
|
function isAccessExpression(node) {
|
|
2445
|
-
return
|
|
2837
|
+
return ts17.isPropertyAccessExpression(node) || ts17.isElementAccessExpression(node);
|
|
2446
2838
|
}
|
|
2447
2839
|
|
|
2448
|
-
// bazel-out/
|
|
2449
|
-
import
|
|
2840
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
2841
|
+
import ts21 from "typescript";
|
|
2450
2842
|
|
|
2451
|
-
// bazel-out/
|
|
2452
|
-
import
|
|
2843
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
2844
|
+
import ts20 from "typescript";
|
|
2453
2845
|
|
|
2454
|
-
// bazel-out/
|
|
2455
|
-
import
|
|
2846
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
|
|
2847
|
+
import ts19 from "typescript";
|
|
2456
2848
|
|
|
2457
|
-
// bazel-out/
|
|
2458
|
-
import
|
|
2849
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_emitter.mjs
|
|
2850
|
+
import ts18 from "typescript";
|
|
2459
2851
|
var INELIGIBLE = {};
|
|
2460
2852
|
function canEmitType(type, canEmit) {
|
|
2461
2853
|
return canEmitTypeWorker(type);
|
|
@@ -2463,13 +2855,13 @@ function canEmitType(type, canEmit) {
|
|
|
2463
2855
|
return visitNode(type2) !== INELIGIBLE;
|
|
2464
2856
|
}
|
|
2465
2857
|
function visitNode(node) {
|
|
2466
|
-
if (
|
|
2858
|
+
if (ts18.isImportTypeNode(node)) {
|
|
2467
2859
|
return INELIGIBLE;
|
|
2468
2860
|
}
|
|
2469
|
-
if (
|
|
2861
|
+
if (ts18.isTypeReferenceNode(node) && !canEmitTypeReference(node)) {
|
|
2470
2862
|
return INELIGIBLE;
|
|
2471
2863
|
} else {
|
|
2472
|
-
return
|
|
2864
|
+
return ts18.forEachChild(node, visitNode);
|
|
2473
2865
|
}
|
|
2474
2866
|
}
|
|
2475
2867
|
function canEmitTypeReference(type2) {
|
|
@@ -2486,22 +2878,22 @@ var TypeEmitter = class {
|
|
|
2486
2878
|
emitType(type) {
|
|
2487
2879
|
const typeReferenceTransformer = (context) => {
|
|
2488
2880
|
const visitNode = (node) => {
|
|
2489
|
-
if (
|
|
2881
|
+
if (ts18.isImportTypeNode(node)) {
|
|
2490
2882
|
throw new Error("Unable to emit import type");
|
|
2491
2883
|
}
|
|
2492
|
-
if (
|
|
2884
|
+
if (ts18.isTypeReferenceNode(node)) {
|
|
2493
2885
|
return this.emitTypeReference(node);
|
|
2494
|
-
} else if (
|
|
2495
|
-
const clone =
|
|
2496
|
-
|
|
2886
|
+
} else if (ts18.isLiteralExpression(node)) {
|
|
2887
|
+
const clone = ts18.getMutableClone(node);
|
|
2888
|
+
ts18.setTextRange(clone, { pos: -1, end: -1 });
|
|
2497
2889
|
return clone;
|
|
2498
2890
|
} else {
|
|
2499
|
-
return
|
|
2891
|
+
return ts18.visitEachChild(node, visitNode, context);
|
|
2500
2892
|
}
|
|
2501
2893
|
};
|
|
2502
|
-
return (node) =>
|
|
2894
|
+
return (node) => ts18.visitNode(node, visitNode);
|
|
2503
2895
|
};
|
|
2504
|
-
return
|
|
2896
|
+
return ts18.transform(type, [typeReferenceTransformer]).transformed[0];
|
|
2505
2897
|
}
|
|
2506
2898
|
emitTypeReference(type) {
|
|
2507
2899
|
const translatedType = this.translator(type);
|
|
@@ -2510,13 +2902,13 @@ var TypeEmitter = class {
|
|
|
2510
2902
|
}
|
|
2511
2903
|
let typeArguments = void 0;
|
|
2512
2904
|
if (type.typeArguments !== void 0) {
|
|
2513
|
-
typeArguments =
|
|
2905
|
+
typeArguments = ts18.createNodeArray(type.typeArguments.map((typeArg) => this.emitType(typeArg)));
|
|
2514
2906
|
}
|
|
2515
|
-
return
|
|
2907
|
+
return ts18.updateTypeReferenceNode(type, translatedType.typeName, typeArguments);
|
|
2516
2908
|
}
|
|
2517
2909
|
};
|
|
2518
2910
|
|
|
2519
|
-
// bazel-out/
|
|
2911
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
|
|
2520
2912
|
var TypeParameterEmitter = class {
|
|
2521
2913
|
constructor(typeParameters, reflector) {
|
|
2522
2914
|
this.typeParameters = typeParameters;
|
|
@@ -2553,11 +2945,11 @@ var TypeParameterEmitter = class {
|
|
|
2553
2945
|
return this.typeParameters.map((typeParam) => {
|
|
2554
2946
|
const constraint = typeParam.constraint !== void 0 ? emitter.emitType(typeParam.constraint) : void 0;
|
|
2555
2947
|
const defaultType = typeParam.default !== void 0 ? emitter.emitType(typeParam.default) : void 0;
|
|
2556
|
-
return
|
|
2948
|
+
return ts19.updateTypeParameterDeclaration(typeParam, typeParam.name, constraint, defaultType);
|
|
2557
2949
|
});
|
|
2558
2950
|
}
|
|
2559
2951
|
resolveTypeReference(type) {
|
|
2560
|
-
const target =
|
|
2952
|
+
const target = ts19.isIdentifier(type.typeName) ? type.typeName : type.typeName.right;
|
|
2561
2953
|
const declaration = this.reflector.getDeclarationOfIdentifier(target);
|
|
2562
2954
|
if (declaration === null || declaration.node === null) {
|
|
2563
2955
|
return null;
|
|
@@ -2583,8 +2975,8 @@ var TypeParameterEmitter = class {
|
|
|
2583
2975
|
if (typeNode === null) {
|
|
2584
2976
|
return null;
|
|
2585
2977
|
}
|
|
2586
|
-
if (!
|
|
2587
|
-
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${
|
|
2978
|
+
if (!ts19.isTypeReferenceNode(typeNode)) {
|
|
2979
|
+
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts19.SyntaxKind[typeNode.kind]}.`);
|
|
2588
2980
|
}
|
|
2589
2981
|
return typeNode;
|
|
2590
2982
|
}
|
|
@@ -2593,7 +2985,7 @@ var TypeParameterEmitter = class {
|
|
|
2593
2985
|
}
|
|
2594
2986
|
};
|
|
2595
2987
|
|
|
2596
|
-
// bazel-out/
|
|
2988
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
2597
2989
|
var TcbInliningRequirement;
|
|
2598
2990
|
(function(TcbInliningRequirement2) {
|
|
2599
2991
|
TcbInliningRequirement2[TcbInliningRequirement2["MustInline"] = 0] = "MustInline";
|
|
@@ -2626,14 +3018,14 @@ function getTemplateMapping(shimSf, position, resolver, isDiagnosticRequest) {
|
|
|
2626
3018
|
}
|
|
2627
3019
|
function findTypeCheckBlock(file, id, isDiagnosticRequest) {
|
|
2628
3020
|
for (const stmt of file.statements) {
|
|
2629
|
-
if (
|
|
3021
|
+
if (ts20.isFunctionDeclaration(stmt) && getTemplateId2(stmt, file, isDiagnosticRequest) === id) {
|
|
2630
3022
|
return stmt;
|
|
2631
3023
|
}
|
|
2632
3024
|
}
|
|
2633
3025
|
return null;
|
|
2634
3026
|
}
|
|
2635
3027
|
function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
|
|
2636
|
-
while (node !== void 0 && !
|
|
3028
|
+
while (node !== void 0 && !ts20.isFunctionDeclaration(node)) {
|
|
2637
3029
|
if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticsRequest) {
|
|
2638
3030
|
return null;
|
|
2639
3031
|
}
|
|
@@ -2650,7 +3042,7 @@ function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
|
|
|
2650
3042
|
return null;
|
|
2651
3043
|
}
|
|
2652
3044
|
function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
|
|
2653
|
-
while (!
|
|
3045
|
+
while (!ts20.isFunctionDeclaration(node)) {
|
|
2654
3046
|
if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticRequest) {
|
|
2655
3047
|
return null;
|
|
2656
3048
|
}
|
|
@@ -2660,8 +3052,8 @@ function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
|
|
|
2660
3052
|
}
|
|
2661
3053
|
}
|
|
2662
3054
|
const start = node.getFullStart();
|
|
2663
|
-
return
|
|
2664
|
-
if (kind !==
|
|
3055
|
+
return ts20.forEachLeadingCommentRange(sourceFile.text, start, (pos, end, kind) => {
|
|
3056
|
+
if (kind !== ts20.SyntaxKind.MultiLineCommentTrivia) {
|
|
2665
3057
|
return null;
|
|
2666
3058
|
}
|
|
2667
3059
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -2673,32 +3065,32 @@ function checkIfGenericTypeBoundsCanBeEmitted(node, reflector, env) {
|
|
|
2673
3065
|
return emitter.canEmit((ref) => env.canReferenceType(ref));
|
|
2674
3066
|
}
|
|
2675
3067
|
|
|
2676
|
-
// bazel-out/
|
|
3068
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
2677
3069
|
function generateTypeCtorDeclarationFn(node, meta, nodeTypeRef, typeParams) {
|
|
2678
3070
|
const rawTypeArgs = typeParams !== void 0 ? generateGenericArgs(typeParams) : void 0;
|
|
2679
|
-
const rawType =
|
|
3071
|
+
const rawType = ts21.createTypeReferenceNode(nodeTypeRef, rawTypeArgs);
|
|
2680
3072
|
const initParam = constructTypeCtorParameter(node, meta, rawType);
|
|
2681
3073
|
const typeParameters = typeParametersWithDefaultTypes(typeParams);
|
|
2682
3074
|
if (meta.body) {
|
|
2683
|
-
const fnType =
|
|
2684
|
-
const decl =
|
|
2685
|
-
const declList =
|
|
2686
|
-
return
|
|
3075
|
+
const fnType = ts21.createFunctionTypeNode(typeParameters, [initParam], rawType);
|
|
3076
|
+
const decl = ts21.createVariableDeclaration(meta.fnName, fnType, ts21.createNonNullExpression(ts21.createNull()));
|
|
3077
|
+
const declList = ts21.createVariableDeclarationList([decl], ts21.NodeFlags.Const);
|
|
3078
|
+
return ts21.createVariableStatement(void 0, declList);
|
|
2687
3079
|
} else {
|
|
2688
|
-
return
|
|
3080
|
+
return ts21.createFunctionDeclaration(void 0, [ts21.createModifier(ts21.SyntaxKind.DeclareKeyword)], void 0, meta.fnName, typeParameters, [initParam], rawType, void 0);
|
|
2689
3081
|
}
|
|
2690
3082
|
}
|
|
2691
3083
|
function generateInlineTypeCtor(node, meta) {
|
|
2692
3084
|
const rawTypeArgs = node.typeParameters !== void 0 ? generateGenericArgs(node.typeParameters) : void 0;
|
|
2693
|
-
const rawType =
|
|
3085
|
+
const rawType = ts21.createTypeReferenceNode(node.name, rawTypeArgs);
|
|
2694
3086
|
const initParam = constructTypeCtorParameter(node, meta, rawType);
|
|
2695
3087
|
let body = void 0;
|
|
2696
3088
|
if (meta.body) {
|
|
2697
|
-
body =
|
|
2698
|
-
|
|
3089
|
+
body = ts21.createBlock([
|
|
3090
|
+
ts21.createReturn(ts21.createNonNullExpression(ts21.createNull()))
|
|
2699
3091
|
]);
|
|
2700
3092
|
}
|
|
2701
|
-
return
|
|
3093
|
+
return ts21.createMethod(void 0, [ts21.createModifier(ts21.SyntaxKind.StaticKeyword)], void 0, meta.fnName, void 0, typeParametersWithDefaultTypes(node.typeParameters), [initParam], rawType, body);
|
|
2702
3094
|
}
|
|
2703
3095
|
function constructTypeCtorParameter(node, meta, rawType) {
|
|
2704
3096
|
let initType = null;
|
|
@@ -2707,26 +3099,26 @@ function constructTypeCtorParameter(node, meta, rawType) {
|
|
|
2707
3099
|
const coercedKeys = [];
|
|
2708
3100
|
for (const key of keys) {
|
|
2709
3101
|
if (!meta.coercedInputFields.has(key)) {
|
|
2710
|
-
plainKeys.push(
|
|
3102
|
+
plainKeys.push(ts21.createLiteralTypeNode(ts21.createStringLiteral(key)));
|
|
2711
3103
|
} else {
|
|
2712
|
-
coercedKeys.push(
|
|
3104
|
+
coercedKeys.push(ts21.createPropertySignature(void 0, key, void 0, tsCreateTypeQueryForCoercedInput(rawType.typeName, key), void 0));
|
|
2713
3105
|
}
|
|
2714
3106
|
}
|
|
2715
3107
|
if (plainKeys.length > 0) {
|
|
2716
|
-
const keyTypeUnion =
|
|
2717
|
-
initType =
|
|
3108
|
+
const keyTypeUnion = ts21.createUnionTypeNode(plainKeys);
|
|
3109
|
+
initType = ts21.createTypeReferenceNode("Pick", [rawType, keyTypeUnion]);
|
|
2718
3110
|
}
|
|
2719
3111
|
if (coercedKeys.length > 0) {
|
|
2720
|
-
const coercedLiteral =
|
|
2721
|
-
initType = initType !== null ?
|
|
3112
|
+
const coercedLiteral = ts21.createTypeLiteralNode(coercedKeys);
|
|
3113
|
+
initType = initType !== null ? ts21.createIntersectionTypeNode([initType, coercedLiteral]) : coercedLiteral;
|
|
2722
3114
|
}
|
|
2723
3115
|
if (initType === null) {
|
|
2724
|
-
initType =
|
|
3116
|
+
initType = ts21.createTypeLiteralNode([]);
|
|
2725
3117
|
}
|
|
2726
|
-
return
|
|
3118
|
+
return ts21.createParameter(void 0, void 0, void 0, "init", void 0, initType, void 0);
|
|
2727
3119
|
}
|
|
2728
3120
|
function generateGenericArgs(params) {
|
|
2729
|
-
return params.map((param) =>
|
|
3121
|
+
return params.map((param) => ts21.createTypeReferenceNode(param.name, void 0));
|
|
2730
3122
|
}
|
|
2731
3123
|
function requiresInlineTypeCtor(node, host, env) {
|
|
2732
3124
|
return !checkIfGenericTypeBoundsCanBeEmitted(node, host, env);
|
|
@@ -2737,14 +3129,14 @@ function typeParametersWithDefaultTypes(params) {
|
|
|
2737
3129
|
}
|
|
2738
3130
|
return params.map((param) => {
|
|
2739
3131
|
if (param.default === void 0) {
|
|
2740
|
-
return
|
|
3132
|
+
return ts21.updateTypeParameterDeclaration(param, param.name, param.constraint, ts21.createKeywordTypeNode(ts21.SyntaxKind.AnyKeyword));
|
|
2741
3133
|
} else {
|
|
2742
3134
|
return param;
|
|
2743
3135
|
}
|
|
2744
3136
|
});
|
|
2745
3137
|
}
|
|
2746
3138
|
|
|
2747
|
-
// bazel-out/
|
|
3139
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
|
|
2748
3140
|
var Environment = class {
|
|
2749
3141
|
constructor(config, importManager, refEmitter, reflector, contextFile) {
|
|
2750
3142
|
this.config = config;
|
|
@@ -2769,13 +3161,13 @@ var Environment = class {
|
|
|
2769
3161
|
}
|
|
2770
3162
|
if (requiresInlineTypeCtor(node, this.reflector, this)) {
|
|
2771
3163
|
const ref = this.reference(dirRef);
|
|
2772
|
-
const typeCtorExpr =
|
|
3164
|
+
const typeCtorExpr = ts22.createPropertyAccess(ref, "ngTypeCtor");
|
|
2773
3165
|
this.typeCtors.set(node, typeCtorExpr);
|
|
2774
3166
|
return typeCtorExpr;
|
|
2775
3167
|
} else {
|
|
2776
3168
|
const fnName = `_ctor${this.nextIds.typeCtor++}`;
|
|
2777
3169
|
const nodeTypeRef = this.referenceType(dirRef);
|
|
2778
|
-
if (!
|
|
3170
|
+
if (!ts22.isTypeReferenceNode(nodeTypeRef)) {
|
|
2779
3171
|
throw new Error(`Expected TypeReferenceNode from reference to ${dirRef.debugName}`);
|
|
2780
3172
|
}
|
|
2781
3173
|
const meta = {
|
|
@@ -2791,7 +3183,7 @@ var Environment = class {
|
|
|
2791
3183
|
const typeParams = this.emitTypeParameters(node);
|
|
2792
3184
|
const typeCtor = generateTypeCtorDeclarationFn(node, meta, nodeTypeRef.typeName, typeParams);
|
|
2793
3185
|
this.typeCtorStatements.push(typeCtor);
|
|
2794
|
-
const fnId =
|
|
3186
|
+
const fnId = ts22.createIdentifier(fnName);
|
|
2795
3187
|
this.typeCtors.set(node, fnId);
|
|
2796
3188
|
return fnId;
|
|
2797
3189
|
}
|
|
@@ -2801,7 +3193,7 @@ var Environment = class {
|
|
|
2801
3193
|
return this.pipeInsts.get(ref.node);
|
|
2802
3194
|
}
|
|
2803
3195
|
const pipeType = this.referenceType(ref);
|
|
2804
|
-
const pipeInstId =
|
|
3196
|
+
const pipeInstId = ts22.createIdentifier(`_pipe${this.nextIds.pipeInst++}`);
|
|
2805
3197
|
this.pipeInstStatements.push(tsDeclareVariable(pipeInstId, pipeType));
|
|
2806
3198
|
this.pipeInsts.set(ref.node, pipeInstId);
|
|
2807
3199
|
return pipeInstId;
|
|
@@ -2836,9 +3228,9 @@ var Environment = class {
|
|
|
2836
3228
|
}
|
|
2837
3229
|
};
|
|
2838
3230
|
|
|
2839
|
-
// bazel-out/
|
|
3231
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/oob.mjs
|
|
2840
3232
|
import { TmplAstElement as TmplAstElement2 } from "@angular/compiler";
|
|
2841
|
-
import
|
|
3233
|
+
import ts23 from "typescript";
|
|
2842
3234
|
var OutOfBandDiagnosticRecorderImpl = class {
|
|
2843
3235
|
constructor(resolver) {
|
|
2844
3236
|
this.resolver = resolver;
|
|
@@ -2852,7 +3244,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
2852
3244
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
2853
3245
|
const value = ref.value.trim();
|
|
2854
3246
|
const errorMsg = `No directive found with exportAs '${value}'.`;
|
|
2855
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan,
|
|
3247
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan, ts23.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REFERENCE_TARGET), errorMsg));
|
|
2856
3248
|
}
|
|
2857
3249
|
missingPipe(templateId, ast) {
|
|
2858
3250
|
if (this.recordedPipes.has(ast)) {
|
|
@@ -2864,7 +3256,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
2864
3256
|
if (sourceSpan === null) {
|
|
2865
3257
|
throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
|
|
2866
3258
|
}
|
|
2867
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan,
|
|
3259
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts23.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_PIPE), errorMsg));
|
|
2868
3260
|
this.recordedPipes.add(ast);
|
|
2869
3261
|
}
|
|
2870
3262
|
illegalAssignmentToTemplateVar(templateId, assignment, target) {
|
|
@@ -2875,7 +3267,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
2875
3267
|
if (sourceSpan === null) {
|
|
2876
3268
|
throw new Error(`Assertion failure: no SourceLocation found for property binding.`);
|
|
2877
3269
|
}
|
|
2878
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan,
|
|
3270
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts23.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMsg, [{
|
|
2879
3271
|
text: `The variable ${assignment.name} is declared here.`,
|
|
2880
3272
|
start: ((_a = target.valueSpan) == null ? void 0 : _a.start.offset) || target.sourceSpan.start.offset,
|
|
2881
3273
|
end: ((_b = target.valueSpan) == null ? void 0 : _b.end.offset) || target.sourceSpan.end.offset,
|
|
@@ -2885,7 +3277,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
2885
3277
|
duplicateTemplateVar(templateId, variable, firstDecl) {
|
|
2886
3278
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
2887
3279
|
const errorMsg = `Cannot redeclare variable '${variable.name}' as it was previously declared elsewhere for the same template.`;
|
|
2888
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, variable.sourceSpan,
|
|
3280
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, variable.sourceSpan, ts23.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DUPLICATE_VARIABLE_DECLARATION), errorMsg, [{
|
|
2889
3281
|
text: `The variable '${firstDecl.name}' was first declared here.`,
|
|
2890
3282
|
start: firstDecl.sourceSpan.start.offset,
|
|
2891
3283
|
end: firstDecl.sourceSpan.end.offset,
|
|
@@ -2924,7 +3316,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
2924
3316
|
const message = `This structural directive supports advanced type inference, but the current compiler configuration prevents its usage. The variable ${varIdentification} will have type 'any' as a result.
|
|
2925
3317
|
|
|
2926
3318
|
Consider enabling the 'strictTemplates' option in your tsconfig.json for better type inference within this template.`;
|
|
2927
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, diagnosticVar.keySpan,
|
|
3319
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, diagnosticVar.keySpan, ts23.DiagnosticCategory.Suggestion, ngErrorCode(ErrorCode.SUGGEST_SUBOPTIMAL_TYPE_INFERENCE), message));
|
|
2928
3320
|
}
|
|
2929
3321
|
splitTwoWayBinding(templateId, input, output, inputConsumer, outputConsumer) {
|
|
2930
3322
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
@@ -2958,7 +3350,7 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
2958
3350
|
sourceFile: outputConsumer.name.getSourceFile()
|
|
2959
3351
|
});
|
|
2960
3352
|
}
|
|
2961
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, input.keySpan,
|
|
3353
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, input.keySpan, ts23.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SPLIT_TWO_WAY_BINDING), errorMsg, relatedMessages));
|
|
2962
3354
|
}
|
|
2963
3355
|
};
|
|
2964
3356
|
function makeInlineDiagnostic(templateId, code, node, messageText, relatedInformation) {
|
|
@@ -2968,8 +3360,8 @@ function makeInlineDiagnostic(templateId, code, node, messageText, relatedInform
|
|
|
2968
3360
|
});
|
|
2969
3361
|
}
|
|
2970
3362
|
|
|
2971
|
-
// bazel-out/
|
|
2972
|
-
import
|
|
3363
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/shim.mjs
|
|
3364
|
+
import ts24 from "typescript";
|
|
2973
3365
|
var TypeCheckShimGenerator = class {
|
|
2974
3366
|
constructor() {
|
|
2975
3367
|
this.extensionPrefix = "ngtypecheck";
|
|
@@ -2979,25 +3371,25 @@ var TypeCheckShimGenerator = class {
|
|
|
2979
3371
|
if (priorShimSf !== null) {
|
|
2980
3372
|
return priorShimSf;
|
|
2981
3373
|
}
|
|
2982
|
-
return
|
|
3374
|
+
return ts24.createSourceFile(genFilePath, "export const USED_FOR_NG_TYPE_CHECKING = true;", ts24.ScriptTarget.Latest, true, ts24.ScriptKind.TS);
|
|
2983
3375
|
}
|
|
2984
3376
|
static shimFor(fileName) {
|
|
2985
3377
|
return absoluteFrom(fileName.replace(/\.tsx?$/, ".ngtypecheck.ts"));
|
|
2986
3378
|
}
|
|
2987
3379
|
};
|
|
2988
3380
|
|
|
2989
|
-
// bazel-out/
|
|
3381
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
2990
3382
|
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";
|
|
2991
|
-
import
|
|
3383
|
+
import ts27 from "typescript";
|
|
2992
3384
|
|
|
2993
|
-
// bazel-out/
|
|
3385
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.mjs
|
|
2994
3386
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan3 } from "@angular/compiler";
|
|
2995
|
-
import
|
|
3387
|
+
import ts25 from "typescript";
|
|
2996
3388
|
function wrapForDiagnostics(expr) {
|
|
2997
|
-
return
|
|
3389
|
+
return ts25.createParen(expr);
|
|
2998
3390
|
}
|
|
2999
3391
|
function wrapForTypeChecker(expr) {
|
|
3000
|
-
return
|
|
3392
|
+
return ts25.createParen(expr);
|
|
3001
3393
|
}
|
|
3002
3394
|
function addParseSpanInfo(node, span) {
|
|
3003
3395
|
let commentText;
|
|
@@ -3006,10 +3398,10 @@ function addParseSpanInfo(node, span) {
|
|
|
3006
3398
|
} else {
|
|
3007
3399
|
commentText = `${span.start.offset},${span.end.offset}`;
|
|
3008
3400
|
}
|
|
3009
|
-
|
|
3401
|
+
ts25.addSyntheticTrailingComment(node, ts25.SyntaxKind.MultiLineCommentTrivia, commentText, false);
|
|
3010
3402
|
}
|
|
3011
3403
|
function addTemplateId(tcb, id) {
|
|
3012
|
-
|
|
3404
|
+
ts25.addSyntheticLeadingComment(tcb, ts25.SyntaxKind.MultiLineCommentTrivia, id, true);
|
|
3013
3405
|
}
|
|
3014
3406
|
function shouldReportDiagnostic(diagnostic) {
|
|
3015
3407
|
const { code } = diagnostic;
|
|
@@ -3036,34 +3428,34 @@ function translateDiagnostic(diagnostic, resolver) {
|
|
|
3036
3428
|
return makeTemplateDiagnostic(sourceLocation.id, templateSourceMapping, span, diagnostic.category, diagnostic.code, diagnostic.messageText);
|
|
3037
3429
|
}
|
|
3038
3430
|
|
|
3039
|
-
// bazel-out/
|
|
3431
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/expression.mjs
|
|
3040
3432
|
import { ASTWithSource as ASTWithSource2, Call, EmptyExpr as EmptyExpr2, PropertyRead as PropertyRead3, SafeKeyedRead, SafePropertyRead as SafePropertyRead2 } from "@angular/compiler";
|
|
3041
|
-
import
|
|
3042
|
-
var NULL_AS_ANY =
|
|
3043
|
-
var UNDEFINED =
|
|
3433
|
+
import ts26 from "typescript";
|
|
3434
|
+
var NULL_AS_ANY = ts26.createAsExpression(ts26.createNull(), ts26.createKeywordTypeNode(ts26.SyntaxKind.AnyKeyword));
|
|
3435
|
+
var UNDEFINED = ts26.createIdentifier("undefined");
|
|
3044
3436
|
var UNARY_OPS = /* @__PURE__ */ new Map([
|
|
3045
|
-
["+",
|
|
3046
|
-
["-",
|
|
3437
|
+
["+", ts26.SyntaxKind.PlusToken],
|
|
3438
|
+
["-", ts26.SyntaxKind.MinusToken]
|
|
3047
3439
|
]);
|
|
3048
3440
|
var BINARY_OPS = /* @__PURE__ */ new Map([
|
|
3049
|
-
["+",
|
|
3050
|
-
["-",
|
|
3051
|
-
["<",
|
|
3052
|
-
[">",
|
|
3053
|
-
["<=",
|
|
3054
|
-
[">=",
|
|
3055
|
-
["==",
|
|
3056
|
-
["===",
|
|
3057
|
-
["*",
|
|
3058
|
-
["/",
|
|
3059
|
-
["%",
|
|
3060
|
-
["!=",
|
|
3061
|
-
["!==",
|
|
3062
|
-
["||",
|
|
3063
|
-
["&&",
|
|
3064
|
-
["&",
|
|
3065
|
-
["|",
|
|
3066
|
-
["??",
|
|
3441
|
+
["+", ts26.SyntaxKind.PlusToken],
|
|
3442
|
+
["-", ts26.SyntaxKind.MinusToken],
|
|
3443
|
+
["<", ts26.SyntaxKind.LessThanToken],
|
|
3444
|
+
[">", ts26.SyntaxKind.GreaterThanToken],
|
|
3445
|
+
["<=", ts26.SyntaxKind.LessThanEqualsToken],
|
|
3446
|
+
[">=", ts26.SyntaxKind.GreaterThanEqualsToken],
|
|
3447
|
+
["==", ts26.SyntaxKind.EqualsEqualsToken],
|
|
3448
|
+
["===", ts26.SyntaxKind.EqualsEqualsEqualsToken],
|
|
3449
|
+
["*", ts26.SyntaxKind.AsteriskToken],
|
|
3450
|
+
["/", ts26.SyntaxKind.SlashToken],
|
|
3451
|
+
["%", ts26.SyntaxKind.PercentToken],
|
|
3452
|
+
["!=", ts26.SyntaxKind.ExclamationEqualsToken],
|
|
3453
|
+
["!==", ts26.SyntaxKind.ExclamationEqualsEqualsToken],
|
|
3454
|
+
["||", ts26.SyntaxKind.BarBarToken],
|
|
3455
|
+
["&&", ts26.SyntaxKind.AmpersandAmpersandToken],
|
|
3456
|
+
["&", ts26.SyntaxKind.AmpersandToken],
|
|
3457
|
+
["|", ts26.SyntaxKind.BarToken],
|
|
3458
|
+
["??", ts26.SyntaxKind.QuestionQuestionToken]
|
|
3067
3459
|
]);
|
|
3068
3460
|
function astToTypescript(ast, maybeResolve, config) {
|
|
3069
3461
|
const translator = new AstTranslator(maybeResolve, config);
|
|
@@ -3079,7 +3471,7 @@ var AstTranslator = class {
|
|
|
3079
3471
|
ast = ast.ast;
|
|
3080
3472
|
}
|
|
3081
3473
|
if (ast instanceof EmptyExpr2) {
|
|
3082
|
-
const res =
|
|
3474
|
+
const res = ts26.factory.createIdentifier("undefined");
|
|
3083
3475
|
addParseSpanInfo(res, ast.sourceSpan);
|
|
3084
3476
|
return res;
|
|
3085
3477
|
}
|
|
@@ -3095,7 +3487,7 @@ var AstTranslator = class {
|
|
|
3095
3487
|
if (op === void 0) {
|
|
3096
3488
|
throw new Error(`Unsupported Unary.operator: ${ast.operator}`);
|
|
3097
3489
|
}
|
|
3098
|
-
const node = wrapForDiagnostics(
|
|
3490
|
+
const node = wrapForDiagnostics(ts26.createPrefix(op, expr));
|
|
3099
3491
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3100
3492
|
return node;
|
|
3101
3493
|
}
|
|
@@ -3106,13 +3498,13 @@ var AstTranslator = class {
|
|
|
3106
3498
|
if (op === void 0) {
|
|
3107
3499
|
throw new Error(`Unsupported Binary.operation: ${ast.operation}`);
|
|
3108
3500
|
}
|
|
3109
|
-
const node =
|
|
3501
|
+
const node = ts26.createBinary(lhs, op, rhs);
|
|
3110
3502
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3111
3503
|
return node;
|
|
3112
3504
|
}
|
|
3113
3505
|
visitChain(ast) {
|
|
3114
3506
|
const elements = ast.expressions.map((expr) => this.translate(expr));
|
|
3115
|
-
const node = wrapForDiagnostics(
|
|
3507
|
+
const node = wrapForDiagnostics(ts26.createCommaList(elements));
|
|
3116
3508
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3117
3509
|
return node;
|
|
3118
3510
|
}
|
|
@@ -3120,7 +3512,7 @@ var AstTranslator = class {
|
|
|
3120
3512
|
const condExpr = this.translate(ast.condition);
|
|
3121
3513
|
const trueExpr = this.translate(ast.trueExp);
|
|
3122
3514
|
const falseExpr = wrapForTypeChecker(this.translate(ast.falseExp));
|
|
3123
|
-
const node =
|
|
3515
|
+
const node = ts26.createParen(ts26.createConditional(condExpr, trueExpr, falseExpr));
|
|
3124
3516
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3125
3517
|
return node;
|
|
3126
3518
|
}
|
|
@@ -3131,26 +3523,26 @@ var AstTranslator = class {
|
|
|
3131
3523
|
throw new Error("Method not implemented.");
|
|
3132
3524
|
}
|
|
3133
3525
|
visitInterpolation(ast) {
|
|
3134
|
-
return ast.expressions.reduce((lhs, ast2) =>
|
|
3526
|
+
return ast.expressions.reduce((lhs, ast2) => ts26.createBinary(lhs, ts26.SyntaxKind.PlusToken, wrapForTypeChecker(this.translate(ast2))), ts26.createLiteral(""));
|
|
3135
3527
|
}
|
|
3136
3528
|
visitKeyedRead(ast) {
|
|
3137
3529
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3138
3530
|
const key = this.translate(ast.key);
|
|
3139
|
-
const node =
|
|
3531
|
+
const node = ts26.createElementAccess(receiver, key);
|
|
3140
3532
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3141
3533
|
return node;
|
|
3142
3534
|
}
|
|
3143
3535
|
visitKeyedWrite(ast) {
|
|
3144
3536
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3145
|
-
const left =
|
|
3537
|
+
const left = ts26.createElementAccess(receiver, this.translate(ast.key));
|
|
3146
3538
|
const right = wrapForTypeChecker(this.translate(ast.value));
|
|
3147
|
-
const node = wrapForDiagnostics(
|
|
3539
|
+
const node = wrapForDiagnostics(ts26.createBinary(left, ts26.SyntaxKind.EqualsToken, right));
|
|
3148
3540
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3149
3541
|
return node;
|
|
3150
3542
|
}
|
|
3151
3543
|
visitLiteralArray(ast) {
|
|
3152
3544
|
const elements = ast.expressions.map((expr) => this.translate(expr));
|
|
3153
|
-
const literal =
|
|
3545
|
+
const literal = ts26.createArrayLiteral(elements);
|
|
3154
3546
|
const node = this.config.strictLiteralTypes ? literal : tsCastToAny(literal);
|
|
3155
3547
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3156
3548
|
return node;
|
|
@@ -3158,9 +3550,9 @@ var AstTranslator = class {
|
|
|
3158
3550
|
visitLiteralMap(ast) {
|
|
3159
3551
|
const properties = ast.keys.map(({ key }, idx) => {
|
|
3160
3552
|
const value = this.translate(ast.values[idx]);
|
|
3161
|
-
return
|
|
3553
|
+
return ts26.createPropertyAssignment(ts26.createStringLiteral(key), value);
|
|
3162
3554
|
});
|
|
3163
|
-
const literal =
|
|
3555
|
+
const literal = ts26.createObjectLiteral(properties, true);
|
|
3164
3556
|
const node = this.config.strictLiteralTypes ? literal : tsCastToAny(literal);
|
|
3165
3557
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3166
3558
|
return node;
|
|
@@ -3168,18 +3560,18 @@ var AstTranslator = class {
|
|
|
3168
3560
|
visitLiteralPrimitive(ast) {
|
|
3169
3561
|
let node;
|
|
3170
3562
|
if (ast.value === void 0) {
|
|
3171
|
-
node =
|
|
3563
|
+
node = ts26.createIdentifier("undefined");
|
|
3172
3564
|
} else if (ast.value === null) {
|
|
3173
|
-
node =
|
|
3565
|
+
node = ts26.createNull();
|
|
3174
3566
|
} else {
|
|
3175
|
-
node =
|
|
3567
|
+
node = ts26.createLiteral(ast.value);
|
|
3176
3568
|
}
|
|
3177
3569
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3178
3570
|
return node;
|
|
3179
3571
|
}
|
|
3180
3572
|
visitNonNullAssert(ast) {
|
|
3181
3573
|
const expr = wrapForDiagnostics(this.translate(ast.expression));
|
|
3182
|
-
const node =
|
|
3574
|
+
const node = ts26.createNonNullExpression(expr);
|
|
3183
3575
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3184
3576
|
return node;
|
|
3185
3577
|
}
|
|
@@ -3188,13 +3580,13 @@ var AstTranslator = class {
|
|
|
3188
3580
|
}
|
|
3189
3581
|
visitPrefixNot(ast) {
|
|
3190
3582
|
const expression = wrapForDiagnostics(this.translate(ast.expression));
|
|
3191
|
-
const node =
|
|
3583
|
+
const node = ts26.createLogicalNot(expression);
|
|
3192
3584
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3193
3585
|
return node;
|
|
3194
3586
|
}
|
|
3195
3587
|
visitPropertyRead(ast) {
|
|
3196
3588
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3197
|
-
const name =
|
|
3589
|
+
const name = ts26.createPropertyAccess(receiver, ast.name);
|
|
3198
3590
|
addParseSpanInfo(name, ast.nameSpan);
|
|
3199
3591
|
const node = wrapForDiagnostics(name);
|
|
3200
3592
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
@@ -3202,12 +3594,12 @@ var AstTranslator = class {
|
|
|
3202
3594
|
}
|
|
3203
3595
|
visitPropertyWrite(ast) {
|
|
3204
3596
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3205
|
-
const left =
|
|
3597
|
+
const left = ts26.createPropertyAccess(receiver, ast.name);
|
|
3206
3598
|
addParseSpanInfo(left, ast.nameSpan);
|
|
3207
3599
|
const leftWithPath = wrapForDiagnostics(left);
|
|
3208
3600
|
addParseSpanInfo(leftWithPath, ast.sourceSpan);
|
|
3209
3601
|
const right = wrapForTypeChecker(this.translate(ast.value));
|
|
3210
|
-
const node = wrapForDiagnostics(
|
|
3602
|
+
const node = wrapForDiagnostics(ts26.createBinary(leftWithPath, ts26.SyntaxKind.EqualsToken, right));
|
|
3211
3603
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3212
3604
|
return node;
|
|
3213
3605
|
}
|
|
@@ -3218,13 +3610,13 @@ var AstTranslator = class {
|
|
|
3218
3610
|
let node;
|
|
3219
3611
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3220
3612
|
if (this.config.strictSafeNavigationTypes) {
|
|
3221
|
-
const expr =
|
|
3613
|
+
const expr = ts26.createPropertyAccess(ts26.createNonNullExpression(receiver), ast.name);
|
|
3222
3614
|
addParseSpanInfo(expr, ast.nameSpan);
|
|
3223
|
-
node =
|
|
3615
|
+
node = ts26.createParen(ts26.createConditional(NULL_AS_ANY, expr, UNDEFINED));
|
|
3224
3616
|
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
3225
|
-
node =
|
|
3617
|
+
node = ts26.createPropertyAccess(tsCastToAny(receiver), ast.name);
|
|
3226
3618
|
} else {
|
|
3227
|
-
const expr =
|
|
3619
|
+
const expr = ts26.createPropertyAccess(ts26.createNonNullExpression(receiver), ast.name);
|
|
3228
3620
|
addParseSpanInfo(expr, ast.nameSpan);
|
|
3229
3621
|
node = tsCastToAny(expr);
|
|
3230
3622
|
}
|
|
@@ -3236,13 +3628,13 @@ var AstTranslator = class {
|
|
|
3236
3628
|
const key = this.translate(ast.key);
|
|
3237
3629
|
let node;
|
|
3238
3630
|
if (this.config.strictSafeNavigationTypes) {
|
|
3239
|
-
const expr =
|
|
3631
|
+
const expr = ts26.createElementAccess(ts26.createNonNullExpression(receiver), key);
|
|
3240
3632
|
addParseSpanInfo(expr, ast.sourceSpan);
|
|
3241
|
-
node =
|
|
3633
|
+
node = ts26.createParen(ts26.createConditional(NULL_AS_ANY, expr, UNDEFINED));
|
|
3242
3634
|
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
3243
|
-
node =
|
|
3635
|
+
node = ts26.createElementAccess(tsCastToAny(receiver), key);
|
|
3244
3636
|
} else {
|
|
3245
|
-
const expr =
|
|
3637
|
+
const expr = ts26.createElementAccess(ts26.createNonNullExpression(receiver), key);
|
|
3246
3638
|
addParseSpanInfo(expr, ast.sourceSpan);
|
|
3247
3639
|
node = tsCastToAny(expr);
|
|
3248
3640
|
}
|
|
@@ -3259,7 +3651,7 @@ var AstTranslator = class {
|
|
|
3259
3651
|
expr = resolved;
|
|
3260
3652
|
} else {
|
|
3261
3653
|
const propertyReceiver = wrapForDiagnostics(this.translate(receiver.receiver));
|
|
3262
|
-
expr =
|
|
3654
|
+
expr = ts26.createPropertyAccess(propertyReceiver, receiver.name);
|
|
3263
3655
|
addParseSpanInfo(expr, receiver.nameSpan);
|
|
3264
3656
|
}
|
|
3265
3657
|
} else {
|
|
@@ -3269,7 +3661,7 @@ var AstTranslator = class {
|
|
|
3269
3661
|
if (ast.receiver instanceof SafePropertyRead2 || ast.receiver instanceof SafeKeyedRead) {
|
|
3270
3662
|
node = this.convertToSafeCall(ast, expr, args);
|
|
3271
3663
|
} else {
|
|
3272
|
-
node =
|
|
3664
|
+
node = ts26.createCall(expr, void 0, args);
|
|
3273
3665
|
}
|
|
3274
3666
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3275
3667
|
return node;
|
|
@@ -3283,13 +3675,13 @@ var AstTranslator = class {
|
|
|
3283
3675
|
}
|
|
3284
3676
|
convertToSafeCall(ast, expr, args) {
|
|
3285
3677
|
if (this.config.strictSafeNavigationTypes) {
|
|
3286
|
-
const call =
|
|
3287
|
-
return
|
|
3678
|
+
const call = ts26.createCall(ts26.createNonNullExpression(expr), void 0, args);
|
|
3679
|
+
return ts26.createParen(ts26.createConditional(NULL_AS_ANY, call, UNDEFINED));
|
|
3288
3680
|
}
|
|
3289
3681
|
if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
3290
|
-
return
|
|
3682
|
+
return ts26.createCall(tsCastToAny(expr), void 0, args);
|
|
3291
3683
|
}
|
|
3292
|
-
return tsCastToAny(
|
|
3684
|
+
return tsCastToAny(ts26.createCall(ts26.createNonNullExpression(expr), void 0, args));
|
|
3293
3685
|
}
|
|
3294
3686
|
};
|
|
3295
3687
|
var VeSafeLhsInferenceBugDetector = class {
|
|
@@ -3366,7 +3758,7 @@ var VeSafeLhsInferenceBugDetector = class {
|
|
|
3366
3758
|
};
|
|
3367
3759
|
VeSafeLhsInferenceBugDetector.SINGLETON = new VeSafeLhsInferenceBugDetector();
|
|
3368
3760
|
|
|
3369
|
-
// bazel-out/
|
|
3761
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_semantics.mjs
|
|
3370
3762
|
import { ImplicitReceiver as ImplicitReceiver3, RecursiveAstVisitor as RecursiveAstVisitor2, TmplAstVariable } from "@angular/compiler";
|
|
3371
3763
|
var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
|
|
3372
3764
|
constructor(templateId, boundTarget, oob) {
|
|
@@ -3390,7 +3782,7 @@ var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
|
|
|
3390
3782
|
}
|
|
3391
3783
|
};
|
|
3392
3784
|
|
|
3393
|
-
// bazel-out/
|
|
3785
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
3394
3786
|
var TcbGenericContextBehavior;
|
|
3395
3787
|
(function(TcbGenericContextBehavior2) {
|
|
3396
3788
|
TcbGenericContextBehavior2[TcbGenericContextBehavior2["UseEmitter"] = 0] = "UseEmitter";
|
|
@@ -3401,7 +3793,7 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
3401
3793
|
const tcb = new Context(env, domSchemaChecker, oobRecorder, meta.id, meta.boundTarget, meta.pipes, meta.schemas);
|
|
3402
3794
|
const scope = Scope.forNodes(tcb, null, tcb.boundTarget.target.template, null);
|
|
3403
3795
|
const ctxRawType = env.referenceType(ref);
|
|
3404
|
-
if (!
|
|
3796
|
+
if (!ts27.isTypeReferenceNode(ctxRawType)) {
|
|
3405
3797
|
throw new Error(`Expected TypeReferenceNode when referencing the ctx param for ${ref.debugName}`);
|
|
3406
3798
|
}
|
|
3407
3799
|
let typeParameters = void 0;
|
|
@@ -3413,25 +3805,25 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
3413
3805
|
switch (genericContextBehavior) {
|
|
3414
3806
|
case TcbGenericContextBehavior.UseEmitter:
|
|
3415
3807
|
typeParameters = new TypeParameterEmitter(ref.node.typeParameters, env.reflector).emit((typeRef) => env.referenceType(typeRef));
|
|
3416
|
-
typeArguments = typeParameters.map((param) =>
|
|
3808
|
+
typeArguments = typeParameters.map((param) => ts27.factory.createTypeReferenceNode(param.name));
|
|
3417
3809
|
break;
|
|
3418
3810
|
case TcbGenericContextBehavior.CopyClassNodes:
|
|
3419
3811
|
typeParameters = [...ref.node.typeParameters];
|
|
3420
|
-
typeArguments = typeParameters.map((param) =>
|
|
3812
|
+
typeArguments = typeParameters.map((param) => ts27.factory.createTypeReferenceNode(param.name));
|
|
3421
3813
|
break;
|
|
3422
3814
|
case TcbGenericContextBehavior.FallbackToAny:
|
|
3423
|
-
typeArguments = ref.node.typeParameters.map(() =>
|
|
3815
|
+
typeArguments = ref.node.typeParameters.map(() => ts27.factory.createKeywordTypeNode(ts27.SyntaxKind.AnyKeyword));
|
|
3424
3816
|
break;
|
|
3425
3817
|
}
|
|
3426
3818
|
}
|
|
3427
3819
|
const paramList = [tcbCtxParam(ref.node, ctxRawType.typeName, typeArguments)];
|
|
3428
3820
|
const scopeStatements = scope.render();
|
|
3429
|
-
const innerBody =
|
|
3821
|
+
const innerBody = ts27.createBlock([
|
|
3430
3822
|
...env.getPreludeStatements(),
|
|
3431
3823
|
...scopeStatements
|
|
3432
3824
|
]);
|
|
3433
|
-
const body =
|
|
3434
|
-
const fnDecl =
|
|
3825
|
+
const body = ts27.createBlock([ts27.createIf(ts27.createTrue(), innerBody, void 0)]);
|
|
3826
|
+
const fnDecl = ts27.createFunctionDeclaration(void 0, void 0, void 0, name, env.config.useContextGenericType ? typeParameters : void 0, paramList, void 0, body);
|
|
3435
3827
|
addTemplateId(fnDecl, meta.id);
|
|
3436
3828
|
return fnDecl;
|
|
3437
3829
|
}
|
|
@@ -3472,7 +3864,7 @@ var TcbVariableOp = class extends TcbOp {
|
|
|
3472
3864
|
execute() {
|
|
3473
3865
|
const ctx = this.scope.resolve(this.template);
|
|
3474
3866
|
const id = this.tcb.allocateId();
|
|
3475
|
-
const initializer =
|
|
3867
|
+
const initializer = ts27.createPropertyAccess(ctx, this.variable.value || "$implicit");
|
|
3476
3868
|
addParseSpanInfo(id, this.variable.keySpan);
|
|
3477
3869
|
let variable;
|
|
3478
3870
|
if (this.variable.valueSpan !== void 0) {
|
|
@@ -3495,7 +3887,7 @@ var TcbTemplateContextOp = class extends TcbOp {
|
|
|
3495
3887
|
}
|
|
3496
3888
|
execute() {
|
|
3497
3889
|
const ctx = this.tcb.allocateId();
|
|
3498
|
-
const type =
|
|
3890
|
+
const type = ts27.createKeywordTypeNode(ts27.SyntaxKind.AnyKeyword);
|
|
3499
3891
|
this.scope.addStatement(tsDeclareVariable(ctx, type));
|
|
3500
3892
|
return ctx;
|
|
3501
3893
|
}
|
|
@@ -3548,16 +3940,16 @@ var TcbTemplateBodyOp = class extends TcbOp {
|
|
|
3548
3940
|
}
|
|
3549
3941
|
let guard = null;
|
|
3550
3942
|
if (directiveGuards.length > 0) {
|
|
3551
|
-
guard = directiveGuards.reduce((expr, dirGuard) =>
|
|
3943
|
+
guard = directiveGuards.reduce((expr, dirGuard) => ts27.createBinary(expr, ts27.SyntaxKind.AmpersandAmpersandToken, dirGuard), directiveGuards.pop());
|
|
3552
3944
|
}
|
|
3553
3945
|
const tmplScope = Scope.forNodes(this.tcb, this.scope, this.template, guard);
|
|
3554
3946
|
const statements = tmplScope.render();
|
|
3555
3947
|
if (statements.length === 0) {
|
|
3556
3948
|
return null;
|
|
3557
3949
|
}
|
|
3558
|
-
let tmplBlock =
|
|
3950
|
+
let tmplBlock = ts27.createBlock(statements);
|
|
3559
3951
|
if (guard !== null) {
|
|
3560
|
-
tmplBlock =
|
|
3952
|
+
tmplBlock = ts27.createIf(guard, tmplBlock);
|
|
3561
3953
|
}
|
|
3562
3954
|
this.scope.addStatement(tmplBlock);
|
|
3563
3955
|
return null;
|
|
@@ -3575,7 +3967,7 @@ var TcbTextInterpolationOp = class extends TcbOp {
|
|
|
3575
3967
|
}
|
|
3576
3968
|
execute() {
|
|
3577
3969
|
const expr = tcbExpression(this.binding.value, this.tcb, this.scope);
|
|
3578
|
-
this.scope.addStatement(
|
|
3970
|
+
this.scope.addStatement(ts27.createExpressionStatement(expr));
|
|
3579
3971
|
return null;
|
|
3580
3972
|
}
|
|
3581
3973
|
};
|
|
@@ -3597,11 +3989,11 @@ var TcbDirectiveTypeOpBase = class extends TcbOp {
|
|
|
3597
3989
|
if (this.dir.isGeneric === false || dirRef.node.typeParameters === void 0) {
|
|
3598
3990
|
type = rawType;
|
|
3599
3991
|
} else {
|
|
3600
|
-
if (!
|
|
3992
|
+
if (!ts27.isTypeReferenceNode(rawType)) {
|
|
3601
3993
|
throw new Error(`Expected TypeReferenceNode when referencing the type for ${this.dir.ref.debugName}`);
|
|
3602
3994
|
}
|
|
3603
|
-
const typeArguments = dirRef.node.typeParameters.map(() =>
|
|
3604
|
-
type =
|
|
3995
|
+
const typeArguments = dirRef.node.typeParameters.map(() => ts27.factory.createKeywordTypeNode(ts27.SyntaxKind.AnyKeyword));
|
|
3996
|
+
type = ts27.factory.createTypeReferenceNode(rawType.typeName, typeArguments);
|
|
3605
3997
|
}
|
|
3606
3998
|
const id = this.tcb.allocateId();
|
|
3607
3999
|
addExpressionIdentifier(type, ExpressionIdentifier.DIRECTIVE);
|
|
@@ -3642,11 +4034,11 @@ var TcbReferenceOp = class extends TcbOp {
|
|
|
3642
4034
|
const id = this.tcb.allocateId();
|
|
3643
4035
|
let initializer = this.target instanceof TmplAstTemplate2 || this.target instanceof TmplAstElement3 ? this.scope.resolve(this.target) : this.scope.resolve(this.host, this.target);
|
|
3644
4036
|
if (this.target instanceof TmplAstElement3 && !this.tcb.env.config.checkTypeOfDomReferences || !this.tcb.env.config.checkTypeOfNonDomReferences) {
|
|
3645
|
-
initializer =
|
|
4037
|
+
initializer = ts27.createAsExpression(initializer, ts27.createKeywordTypeNode(ts27.SyntaxKind.AnyKeyword));
|
|
3646
4038
|
} else if (this.target instanceof TmplAstTemplate2) {
|
|
3647
|
-
initializer =
|
|
3648
|
-
initializer =
|
|
3649
|
-
initializer =
|
|
4039
|
+
initializer = ts27.createAsExpression(initializer, ts27.createKeywordTypeNode(ts27.SyntaxKind.AnyKeyword));
|
|
4040
|
+
initializer = ts27.createAsExpression(initializer, this.tcb.env.referenceExternalType("@angular/core", "TemplateRef", [DYNAMIC_TYPE]));
|
|
4041
|
+
initializer = ts27.createParen(initializer);
|
|
3650
4042
|
}
|
|
3651
4043
|
addParseSpanInfo(initializer, this.node.sourceSpan);
|
|
3652
4044
|
addParseSpanInfo(id, this.node.keySpan);
|
|
@@ -3736,7 +4128,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
3736
4128
|
let target;
|
|
3737
4129
|
if (this.dir.coercedInputFields.has(fieldName)) {
|
|
3738
4130
|
const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
|
|
3739
|
-
if (!
|
|
4131
|
+
if (!ts27.isTypeReferenceNode(dirTypeRef)) {
|
|
3740
4132
|
throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
|
|
3741
4133
|
}
|
|
3742
4134
|
const id = this.tcb.allocateId();
|
|
@@ -3751,10 +4143,10 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
3751
4143
|
}
|
|
3752
4144
|
const id = this.tcb.allocateId();
|
|
3753
4145
|
const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
|
|
3754
|
-
if (!
|
|
4146
|
+
if (!ts27.isTypeReferenceNode(dirTypeRef)) {
|
|
3755
4147
|
throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
|
|
3756
4148
|
}
|
|
3757
|
-
const type =
|
|
4149
|
+
const type = ts27.createIndexedAccessTypeNode(ts27.createTypeQueryNode(dirId), ts27.createLiteralTypeNode(ts27.createStringLiteral(fieldName)));
|
|
3758
4150
|
const temp = tsDeclareVariable(id, type);
|
|
3759
4151
|
this.scope.addStatement(temp);
|
|
3760
4152
|
target = id;
|
|
@@ -3762,18 +4154,18 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
3762
4154
|
if (dirId === null) {
|
|
3763
4155
|
dirId = this.scope.resolve(this.node, this.dir);
|
|
3764
4156
|
}
|
|
3765
|
-
target = this.dir.stringLiteralInputFields.has(fieldName) ?
|
|
4157
|
+
target = this.dir.stringLiteralInputFields.has(fieldName) ? ts27.createElementAccess(dirId, ts27.createStringLiteral(fieldName)) : ts27.createPropertyAccess(dirId, ts27.createIdentifier(fieldName));
|
|
3766
4158
|
}
|
|
3767
4159
|
if (input.attribute.keySpan !== void 0) {
|
|
3768
4160
|
addParseSpanInfo(target, input.attribute.keySpan);
|
|
3769
4161
|
}
|
|
3770
|
-
assignment =
|
|
4162
|
+
assignment = ts27.createBinary(target, ts27.SyntaxKind.EqualsToken, assignment);
|
|
3771
4163
|
}
|
|
3772
4164
|
addParseSpanInfo(assignment, input.attribute.sourceSpan);
|
|
3773
4165
|
if (!this.tcb.env.config.checkTypeOfAttributes && input.attribute instanceof TmplAstTextAttribute2) {
|
|
3774
4166
|
markIgnoreDiagnostics(assignment);
|
|
3775
4167
|
}
|
|
3776
|
-
this.scope.addStatement(
|
|
4168
|
+
this.scope.addStatement(ts27.createExpressionStatement(assignment));
|
|
3777
4169
|
}
|
|
3778
4170
|
return null;
|
|
3779
4171
|
}
|
|
@@ -3792,7 +4184,7 @@ var TcbDirectiveCtorCircularFallbackOp = class extends TcbOp {
|
|
|
3792
4184
|
execute() {
|
|
3793
4185
|
const id = this.tcb.allocateId();
|
|
3794
4186
|
const typeCtor = this.tcb.env.typeCtorFor(this.dir);
|
|
3795
|
-
const circularPlaceholder =
|
|
4187
|
+
const circularPlaceholder = ts27.createCall(typeCtor, void 0, [ts27.createNonNullExpression(ts27.createNull())]);
|
|
3796
4188
|
this.scope.addStatement(tsCreateVariable(id, circularPlaceholder));
|
|
3797
4189
|
return id;
|
|
3798
4190
|
}
|
|
@@ -3858,15 +4250,15 @@ var TcbUnclaimedInputsOp = class extends TcbOp {
|
|
|
3858
4250
|
elId = this.scope.resolve(this.element);
|
|
3859
4251
|
}
|
|
3860
4252
|
const propertyName = ATTR_TO_PROP[binding.name] || binding.name;
|
|
3861
|
-
const prop =
|
|
3862
|
-
const stmt =
|
|
4253
|
+
const prop = ts27.createElementAccess(elId, ts27.createStringLiteral(propertyName));
|
|
4254
|
+
const stmt = ts27.createBinary(prop, ts27.SyntaxKind.EqualsToken, wrapForDiagnostics(expr));
|
|
3863
4255
|
addParseSpanInfo(stmt, binding.sourceSpan);
|
|
3864
|
-
this.scope.addStatement(
|
|
4256
|
+
this.scope.addStatement(ts27.createExpressionStatement(stmt));
|
|
3865
4257
|
} else {
|
|
3866
|
-
this.scope.addStatement(
|
|
4258
|
+
this.scope.addStatement(ts27.createExpressionStatement(expr));
|
|
3867
4259
|
}
|
|
3868
4260
|
} else {
|
|
3869
|
-
this.scope.addStatement(
|
|
4261
|
+
this.scope.addStatement(ts27.createExpressionStatement(expr));
|
|
3870
4262
|
}
|
|
3871
4263
|
}
|
|
3872
4264
|
return null;
|
|
@@ -3898,18 +4290,18 @@ var TcbDirectiveOutputsOp = class extends TcbOp {
|
|
|
3898
4290
|
if (dirId === null) {
|
|
3899
4291
|
dirId = this.scope.resolve(this.node, this.dir);
|
|
3900
4292
|
}
|
|
3901
|
-
const outputField =
|
|
4293
|
+
const outputField = ts27.createElementAccess(dirId, ts27.createStringLiteral(field));
|
|
3902
4294
|
addParseSpanInfo(outputField, output.keySpan);
|
|
3903
4295
|
if (this.tcb.env.config.checkTypeOfOutputEvents) {
|
|
3904
4296
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
|
|
3905
|
-
const subscribeFn =
|
|
3906
|
-
const call =
|
|
4297
|
+
const subscribeFn = ts27.createPropertyAccess(outputField, "subscribe");
|
|
4298
|
+
const call = ts27.createCall(subscribeFn, void 0, [handler]);
|
|
3907
4299
|
addParseSpanInfo(call, output.sourceSpan);
|
|
3908
|
-
this.scope.addStatement(
|
|
4300
|
+
this.scope.addStatement(ts27.createExpressionStatement(call));
|
|
3909
4301
|
} else {
|
|
3910
|
-
this.scope.addStatement(
|
|
4302
|
+
this.scope.addStatement(ts27.createExpressionStatement(outputField));
|
|
3911
4303
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
3912
|
-
this.scope.addStatement(
|
|
4304
|
+
this.scope.addStatement(ts27.createExpressionStatement(handler));
|
|
3913
4305
|
}
|
|
3914
4306
|
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
3915
4307
|
}
|
|
@@ -3942,20 +4334,20 @@ var TcbUnclaimedOutputsOp = class extends TcbOp {
|
|
|
3942
4334
|
if (output.type === 1) {
|
|
3943
4335
|
const eventType = this.tcb.env.config.checkTypeOfAnimationEvents ? this.tcb.env.referenceExternalType("@angular/animations", "AnimationEvent") : 1;
|
|
3944
4336
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, eventType);
|
|
3945
|
-
this.scope.addStatement(
|
|
4337
|
+
this.scope.addStatement(ts27.createExpressionStatement(handler));
|
|
3946
4338
|
} else if (this.tcb.env.config.checkTypeOfDomEvents) {
|
|
3947
4339
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
|
|
3948
4340
|
if (elId === null) {
|
|
3949
4341
|
elId = this.scope.resolve(this.element);
|
|
3950
4342
|
}
|
|
3951
|
-
const propertyAccess =
|
|
4343
|
+
const propertyAccess = ts27.createPropertyAccess(elId, "addEventListener");
|
|
3952
4344
|
addParseSpanInfo(propertyAccess, output.keySpan);
|
|
3953
|
-
const call =
|
|
4345
|
+
const call = ts27.createCall(propertyAccess, void 0, [ts27.createStringLiteral(output.name), handler]);
|
|
3954
4346
|
addParseSpanInfo(call, output.sourceSpan);
|
|
3955
|
-
this.scope.addStatement(
|
|
4347
|
+
this.scope.addStatement(ts27.createExpressionStatement(call));
|
|
3956
4348
|
} else {
|
|
3957
4349
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
3958
|
-
this.scope.addStatement(
|
|
4350
|
+
this.scope.addStatement(ts27.createExpressionStatement(handler));
|
|
3959
4351
|
}
|
|
3960
4352
|
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
3961
4353
|
}
|
|
@@ -3969,15 +4361,15 @@ var TcbComponentContextCompletionOp = class extends TcbOp {
|
|
|
3969
4361
|
this.optional = false;
|
|
3970
4362
|
}
|
|
3971
4363
|
execute() {
|
|
3972
|
-
const ctx =
|
|
3973
|
-
const ctxDot =
|
|
4364
|
+
const ctx = ts27.createIdentifier("ctx");
|
|
4365
|
+
const ctxDot = ts27.createPropertyAccess(ctx, "");
|
|
3974
4366
|
markIgnoreDiagnostics(ctxDot);
|
|
3975
4367
|
addExpressionIdentifier(ctxDot, ExpressionIdentifier.COMPONENT_COMPLETION);
|
|
3976
|
-
this.scope.addStatement(
|
|
4368
|
+
this.scope.addStatement(ts27.createExpressionStatement(ctxDot));
|
|
3977
4369
|
return null;
|
|
3978
4370
|
}
|
|
3979
4371
|
};
|
|
3980
|
-
var INFER_TYPE_FOR_CIRCULAR_OP_EXPR =
|
|
4372
|
+
var INFER_TYPE_FOR_CIRCULAR_OP_EXPR = ts27.createNonNullExpression(ts27.createNull());
|
|
3981
4373
|
var Context = class {
|
|
3982
4374
|
constructor(env, domSchemaChecker, oobRecorder, id, boundTarget, pipes, schemas) {
|
|
3983
4375
|
this.env = env;
|
|
@@ -3990,7 +4382,7 @@ var Context = class {
|
|
|
3990
4382
|
this.nextId = 1;
|
|
3991
4383
|
}
|
|
3992
4384
|
allocateId() {
|
|
3993
|
-
return
|
|
4385
|
+
return ts27.createIdentifier(`_t${this.nextId++}`);
|
|
3994
4386
|
}
|
|
3995
4387
|
getPipeByName(name) {
|
|
3996
4388
|
if (!this.pipes.has(name)) {
|
|
@@ -4042,8 +4434,8 @@ var Scope = class {
|
|
|
4042
4434
|
resolve(node, directive) {
|
|
4043
4435
|
const res = this.resolveLocal(node, directive);
|
|
4044
4436
|
if (res !== null) {
|
|
4045
|
-
const clone =
|
|
4046
|
-
|
|
4437
|
+
const clone = ts27.getMutableClone(res);
|
|
4438
|
+
ts27.setSyntheticTrailingComments(clone, []);
|
|
4047
4439
|
return clone;
|
|
4048
4440
|
} else if (this.parent !== null) {
|
|
4049
4441
|
return this.parent.resolve(node, directive);
|
|
@@ -4071,7 +4463,7 @@ var Scope = class {
|
|
|
4071
4463
|
} else if (parentGuards === null) {
|
|
4072
4464
|
return this.guard;
|
|
4073
4465
|
} else {
|
|
4074
|
-
return
|
|
4466
|
+
return ts27.createBinary(parentGuards, ts27.SyntaxKind.AmpersandAmpersandToken, this.guard);
|
|
4075
4467
|
}
|
|
4076
4468
|
}
|
|
4077
4469
|
resolveLocal(ref, directive) {
|
|
@@ -4251,8 +4643,8 @@ var Scope = class {
|
|
|
4251
4643
|
}
|
|
4252
4644
|
};
|
|
4253
4645
|
function tcbCtxParam(node, name, typeArguments) {
|
|
4254
|
-
const type =
|
|
4255
|
-
return
|
|
4646
|
+
const type = ts27.factory.createTypeReferenceNode(name, typeArguments);
|
|
4647
|
+
return ts27.factory.createParameterDeclaration(void 0, void 0, void 0, "ctx", void 0, type, void 0);
|
|
4256
4648
|
}
|
|
4257
4649
|
function tcbExpression(ast, tcb, scope) {
|
|
4258
4650
|
const translator = new TcbExpressionTranslator(tcb, scope);
|
|
@@ -4275,11 +4667,11 @@ var TcbExpressionTranslator = class {
|
|
|
4275
4667
|
return null;
|
|
4276
4668
|
}
|
|
4277
4669
|
const expr = this.translate(ast.value);
|
|
4278
|
-
const result =
|
|
4670
|
+
const result = ts27.createParen(ts27.createBinary(target, ts27.SyntaxKind.EqualsToken, expr));
|
|
4279
4671
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
4280
4672
|
return result;
|
|
4281
4673
|
} else if (ast instanceof ImplicitReceiver4) {
|
|
4282
|
-
return
|
|
4674
|
+
return ts27.createIdentifier("ctx");
|
|
4283
4675
|
} else if (ast instanceof BindingPipe) {
|
|
4284
4676
|
const expr = this.translate(ast.exp);
|
|
4285
4677
|
const pipeRef = this.tcb.getPipeByName(ast.name);
|
|
@@ -4291,19 +4683,19 @@ var TcbExpressionTranslator = class {
|
|
|
4291
4683
|
pipe = this.tcb.env.pipeInst(pipeRef);
|
|
4292
4684
|
}
|
|
4293
4685
|
const args = ast.args.map((arg) => this.translate(arg));
|
|
4294
|
-
let methodAccess =
|
|
4686
|
+
let methodAccess = ts27.factory.createPropertyAccessExpression(pipe, "transform");
|
|
4295
4687
|
addParseSpanInfo(methodAccess, ast.nameSpan);
|
|
4296
4688
|
if (!this.tcb.env.config.checkTypeOfPipes) {
|
|
4297
|
-
methodAccess =
|
|
4689
|
+
methodAccess = ts27.factory.createAsExpression(methodAccess, ts27.factory.createKeywordTypeNode(ts27.SyntaxKind.AnyKeyword));
|
|
4298
4690
|
}
|
|
4299
|
-
const result =
|
|
4691
|
+
const result = ts27.createCall(methodAccess, void 0, [expr, ...args]);
|
|
4300
4692
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
4301
4693
|
return result;
|
|
4302
4694
|
} else if ((ast instanceof Call2 || ast instanceof SafeCall) && (ast.receiver instanceof PropertyRead4 || ast.receiver instanceof SafePropertyRead3)) {
|
|
4303
4695
|
if (ast.receiver.receiver instanceof ImplicitReceiver4 && !(ast.receiver.receiver instanceof ThisReceiver) && ast.receiver.name === "$any" && ast.args.length === 1) {
|
|
4304
4696
|
const expr = this.translate(ast.args[0]);
|
|
4305
|
-
const exprAsAny =
|
|
4306
|
-
const result =
|
|
4697
|
+
const exprAsAny = ts27.createAsExpression(expr, ts27.createKeywordTypeNode(ts27.SyntaxKind.AnyKeyword));
|
|
4698
|
+
const result = ts27.createParen(exprAsAny);
|
|
4307
4699
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
4308
4700
|
return result;
|
|
4309
4701
|
}
|
|
@@ -4314,7 +4706,7 @@ var TcbExpressionTranslator = class {
|
|
|
4314
4706
|
const method = wrapForDiagnostics(receiver);
|
|
4315
4707
|
addParseSpanInfo(method, ast.receiver.nameSpan);
|
|
4316
4708
|
const args = ast.args.map((arg) => this.translate(arg));
|
|
4317
|
-
const node =
|
|
4709
|
+
const node = ts27.createCall(method, void 0, args);
|
|
4318
4710
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
4319
4711
|
return node;
|
|
4320
4712
|
} else {
|
|
@@ -4334,17 +4726,17 @@ var TcbExpressionTranslator = class {
|
|
|
4334
4726
|
function tcbCallTypeCtor(dir, tcb, inputs) {
|
|
4335
4727
|
const typeCtor = tcb.env.typeCtorFor(dir);
|
|
4336
4728
|
const members = inputs.map((input) => {
|
|
4337
|
-
const propertyName =
|
|
4729
|
+
const propertyName = ts27.createStringLiteral(input.field);
|
|
4338
4730
|
if (input.type === "binding") {
|
|
4339
4731
|
const expr = widenBinding(input.expression, tcb);
|
|
4340
|
-
const assignment =
|
|
4732
|
+
const assignment = ts27.createPropertyAssignment(propertyName, wrapForDiagnostics(expr));
|
|
4341
4733
|
addParseSpanInfo(assignment, input.sourceSpan);
|
|
4342
4734
|
return assignment;
|
|
4343
4735
|
} else {
|
|
4344
|
-
return
|
|
4736
|
+
return ts27.createPropertyAssignment(propertyName, NULL_AS_ANY);
|
|
4345
4737
|
}
|
|
4346
4738
|
});
|
|
4347
|
-
return
|
|
4739
|
+
return ts27.createCall(typeCtor, void 0, [ts27.createObjectLiteral(members)]);
|
|
4348
4740
|
}
|
|
4349
4741
|
function getBoundInputs(directive, node, tcb) {
|
|
4350
4742
|
const boundInputs = [];
|
|
@@ -4370,17 +4762,17 @@ function translateInput(attr, tcb, scope) {
|
|
|
4370
4762
|
if (attr instanceof TmplAstBoundAttribute) {
|
|
4371
4763
|
return tcbExpression(attr.value, tcb, scope);
|
|
4372
4764
|
} else {
|
|
4373
|
-
return
|
|
4765
|
+
return ts27.createStringLiteral(attr.value);
|
|
4374
4766
|
}
|
|
4375
4767
|
}
|
|
4376
4768
|
function widenBinding(expr, tcb) {
|
|
4377
4769
|
if (!tcb.env.config.checkTypeOfInputBindings) {
|
|
4378
4770
|
return tsCastToAny(expr);
|
|
4379
4771
|
} else if (!tcb.env.config.strictNullInputBindings) {
|
|
4380
|
-
if (
|
|
4772
|
+
if (ts27.isObjectLiteralExpression(expr) || ts27.isArrayLiteralExpression(expr)) {
|
|
4381
4773
|
return expr;
|
|
4382
4774
|
} else {
|
|
4383
|
-
return
|
|
4775
|
+
return ts27.createNonNullExpression(expr);
|
|
4384
4776
|
}
|
|
4385
4777
|
} else {
|
|
4386
4778
|
return expr;
|
|
@@ -4393,18 +4785,18 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
|
|
|
4393
4785
|
if (eventType === 0) {
|
|
4394
4786
|
eventParamType = void 0;
|
|
4395
4787
|
} else if (eventType === 1) {
|
|
4396
|
-
eventParamType =
|
|
4788
|
+
eventParamType = ts27.createKeywordTypeNode(ts27.SyntaxKind.AnyKeyword);
|
|
4397
4789
|
} else {
|
|
4398
4790
|
eventParamType = eventType;
|
|
4399
4791
|
}
|
|
4400
4792
|
const guards = scope.guards();
|
|
4401
|
-
let body =
|
|
4793
|
+
let body = ts27.createExpressionStatement(handler);
|
|
4402
4794
|
if (guards !== null) {
|
|
4403
|
-
body =
|
|
4795
|
+
body = ts27.createIf(guards, body);
|
|
4404
4796
|
}
|
|
4405
|
-
const eventParam =
|
|
4797
|
+
const eventParam = ts27.createParameter(void 0, void 0, void 0, EVENT_PARAMETER, void 0, eventParamType);
|
|
4406
4798
|
addExpressionIdentifier(eventParam, ExpressionIdentifier.EVENT_PARAMETER);
|
|
4407
|
-
return
|
|
4799
|
+
return ts27.createFunctionExpression(void 0, void 0, void 0, void 0, [eventParam], ts27.createKeywordTypeNode(ts27.SyntaxKind.AnyKeyword), ts27.createBlock([body]));
|
|
4408
4800
|
}
|
|
4409
4801
|
function tcbEventHandlerExpression(ast, tcb, scope) {
|
|
4410
4802
|
const translator = new TcbEventHandlerTranslator(tcb, scope);
|
|
@@ -4432,7 +4824,7 @@ function isSplitTwoWayBinding(inputName, output, inputs, tcb) {
|
|
|
4432
4824
|
var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
|
|
4433
4825
|
resolve(ast) {
|
|
4434
4826
|
if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver4 && !(ast.receiver instanceof ThisReceiver) && ast.name === EVENT_PARAMETER) {
|
|
4435
|
-
const event =
|
|
4827
|
+
const event = ts27.createIdentifier(EVENT_PARAMETER);
|
|
4436
4828
|
addParseSpanInfo(event, ast.nameSpan);
|
|
4437
4829
|
return event;
|
|
4438
4830
|
}
|
|
@@ -4440,33 +4832,33 @@ var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
|
|
|
4440
4832
|
}
|
|
4441
4833
|
};
|
|
4442
4834
|
|
|
4443
|
-
// bazel-out/
|
|
4444
|
-
import
|
|
4835
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_file.mjs
|
|
4836
|
+
import ts28 from "typescript";
|
|
4445
4837
|
var TypeCheckFile = class extends Environment {
|
|
4446
4838
|
constructor(fileName, config, refEmitter, reflector, compilerHost) {
|
|
4447
|
-
super(config, new ImportManager(new NoopImportRewriter(), "i"), refEmitter, reflector,
|
|
4839
|
+
super(config, new ImportManager(new NoopImportRewriter(), "i"), refEmitter, reflector, ts28.createSourceFile(compilerHost.getCanonicalFileName(fileName), "", ts28.ScriptTarget.Latest, true));
|
|
4448
4840
|
this.fileName = fileName;
|
|
4449
4841
|
this.nextTcbId = 1;
|
|
4450
4842
|
this.tcbStatements = [];
|
|
4451
4843
|
}
|
|
4452
4844
|
addTypeCheckBlock(ref, meta, domSchemaChecker, oobRecorder, genericContextBehavior) {
|
|
4453
|
-
const fnId =
|
|
4845
|
+
const fnId = ts28.createIdentifier(`_tcb${this.nextTcbId++}`);
|
|
4454
4846
|
const fn = generateTypeCheckBlock(this, ref, fnId, meta, domSchemaChecker, oobRecorder, genericContextBehavior);
|
|
4455
4847
|
this.tcbStatements.push(fn);
|
|
4456
4848
|
}
|
|
4457
4849
|
render(removeComments) {
|
|
4458
4850
|
let source = this.importManager.getAllImports(this.contextFile.fileName).map((i) => `import * as ${i.qualifier.text} from '${i.specifier}';`).join("\n") + "\n\n";
|
|
4459
|
-
const printer =
|
|
4851
|
+
const printer = ts28.createPrinter({ removeComments });
|
|
4460
4852
|
source += "\n";
|
|
4461
4853
|
for (const stmt of this.pipeInstStatements) {
|
|
4462
|
-
source += printer.printNode(
|
|
4854
|
+
source += printer.printNode(ts28.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
4463
4855
|
}
|
|
4464
4856
|
for (const stmt of this.typeCtorStatements) {
|
|
4465
|
-
source += printer.printNode(
|
|
4857
|
+
source += printer.printNode(ts28.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
4466
4858
|
}
|
|
4467
4859
|
source += "\n";
|
|
4468
4860
|
for (const stmt of this.tcbStatements) {
|
|
4469
|
-
source += printer.printNode(
|
|
4861
|
+
source += printer.printNode(ts28.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
4470
4862
|
}
|
|
4471
4863
|
source += "\nexport const IS_A_MODULE = true;\n";
|
|
4472
4864
|
return source;
|
|
@@ -4476,7 +4868,7 @@ var TypeCheckFile = class extends Environment {
|
|
|
4476
4868
|
}
|
|
4477
4869
|
};
|
|
4478
4870
|
|
|
4479
|
-
// bazel-out/
|
|
4871
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
|
|
4480
4872
|
var InliningMode;
|
|
4481
4873
|
(function(InliningMode2) {
|
|
4482
4874
|
InliningMode2[InliningMode2["InlineOps"] = 0] = "InlineOps";
|
|
@@ -4574,7 +4966,7 @@ var TypeCheckContextImpl = class {
|
|
|
4574
4966
|
const importManager = new ImportManager(new NoopImportRewriter(), "_i");
|
|
4575
4967
|
const ops = this.opMap.get(sf).sort(orderOps);
|
|
4576
4968
|
const textParts = splitStringAtPoints(sf.text, ops.map((op) => op.splitPoint));
|
|
4577
|
-
const printer =
|
|
4969
|
+
const printer = ts29.createPrinter({ omitTrailingSemicolon: true });
|
|
4578
4970
|
let code = textParts[0];
|
|
4579
4971
|
ops.forEach((op, idx) => {
|
|
4580
4972
|
const text = op.execute(importManager, sf, this.refEmitter, printer);
|
|
@@ -4655,7 +5047,7 @@ var TypeCheckContextImpl = class {
|
|
|
4655
5047
|
if (span.start.offset === span.end.offset) {
|
|
4656
5048
|
span.end.offset++;
|
|
4657
5049
|
}
|
|
4658
|
-
return makeTemplateDiagnostic(templateId, sourceMapping, span,
|
|
5050
|
+
return makeTemplateDiagnostic(templateId, sourceMapping, span, ts29.DiagnosticCategory.Error, ngErrorCode(ErrorCode.TEMPLATE_PARSE_ERROR), error.msg);
|
|
4659
5051
|
});
|
|
4660
5052
|
}
|
|
4661
5053
|
};
|
|
@@ -4673,9 +5065,9 @@ var InlineTcbOp = class {
|
|
|
4673
5065
|
}
|
|
4674
5066
|
execute(im, sf, refEmitter, printer) {
|
|
4675
5067
|
const env = new Environment(this.config, im, refEmitter, this.reflector, sf);
|
|
4676
|
-
const fnName =
|
|
5068
|
+
const fnName = ts29.createIdentifier(`_tcb_${this.ref.node.pos}`);
|
|
4677
5069
|
const fn = generateTypeCheckBlock(env, this.ref, fnName, this.meta, this.domSchemaChecker, this.oobRecorder, TcbGenericContextBehavior.CopyClassNodes);
|
|
4678
|
-
return printer.printNode(
|
|
5070
|
+
return printer.printNode(ts29.EmitHint.Unspecified, fn, sf);
|
|
4679
5071
|
}
|
|
4680
5072
|
};
|
|
4681
5073
|
var TypeCtorOp = class {
|
|
@@ -4688,7 +5080,7 @@ var TypeCtorOp = class {
|
|
|
4688
5080
|
}
|
|
4689
5081
|
execute(im, sf, refEmitter, printer) {
|
|
4690
5082
|
const tcb = generateInlineTypeCtor(this.ref.node, this.meta);
|
|
4691
|
-
return printer.printNode(
|
|
5083
|
+
return printer.printNode(ts29.EmitHint.Unspecified, tcb, sf);
|
|
4692
5084
|
}
|
|
4693
5085
|
};
|
|
4694
5086
|
function orderOps(op1, op2) {
|
|
@@ -4706,10 +5098,10 @@ function splitStringAtPoints(str, points) {
|
|
|
4706
5098
|
return splits;
|
|
4707
5099
|
}
|
|
4708
5100
|
|
|
4709
|
-
// bazel-out/
|
|
5101
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/source.mjs
|
|
4710
5102
|
import { ParseLocation, ParseSourceSpan } from "@angular/compiler";
|
|
4711
5103
|
|
|
4712
|
-
// bazel-out/
|
|
5104
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/line_mappings.mjs
|
|
4713
5105
|
var LF_CHAR = 10;
|
|
4714
5106
|
var CR_CHAR = 13;
|
|
4715
5107
|
var LINE_SEP_CHAR = 8232;
|
|
@@ -4750,7 +5142,7 @@ function findClosestLineStartPosition(linesMap, position, low = 0, high = linesM
|
|
|
4750
5142
|
return low - 1;
|
|
4751
5143
|
}
|
|
4752
5144
|
|
|
4753
|
-
// bazel-out/
|
|
5145
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/source.mjs
|
|
4754
5146
|
var TemplateSource = class {
|
|
4755
5147
|
constructor(mapping, file) {
|
|
4756
5148
|
this.mapping = mapping;
|
|
@@ -4801,9 +5193,9 @@ var TemplateSourceManager = class {
|
|
|
4801
5193
|
}
|
|
4802
5194
|
};
|
|
4803
5195
|
|
|
4804
|
-
// bazel-out/
|
|
5196
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_symbol_builder.mjs
|
|
4805
5197
|
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";
|
|
4806
|
-
import
|
|
5198
|
+
import ts30 from "typescript";
|
|
4807
5199
|
var SymbolBuilder = class {
|
|
4808
5200
|
constructor(tcbPath, tcbIsShim, typeCheckBlock, templateData, componentScopeReader, getTypeChecker) {
|
|
4809
5201
|
this.tcbPath = tcbPath;
|
|
@@ -4847,7 +5239,7 @@ var SymbolBuilder = class {
|
|
|
4847
5239
|
getSymbolOfElement(element) {
|
|
4848
5240
|
var _a;
|
|
4849
5241
|
const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
|
|
4850
|
-
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: elementSourceSpan, filter:
|
|
5242
|
+
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: elementSourceSpan, filter: ts30.isVariableDeclaration });
|
|
4851
5243
|
if (node === null) {
|
|
4852
5244
|
return null;
|
|
4853
5245
|
}
|
|
@@ -4866,12 +5258,12 @@ var SymbolBuilder = class {
|
|
|
4866
5258
|
var _a;
|
|
4867
5259
|
const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
|
|
4868
5260
|
const tcbSourceFile = this.typeCheckBlock.getSourceFile();
|
|
4869
|
-
const isDirectiveDeclaration = (node) => (
|
|
5261
|
+
const isDirectiveDeclaration = (node) => (ts30.isTypeNode(node) || ts30.isIdentifier(node)) && ts30.isVariableDeclaration(node.parent) && hasExpressionIdentifier(tcbSourceFile, node, ExpressionIdentifier.DIRECTIVE);
|
|
4870
5262
|
const nodes = findAllMatchingNodes(this.typeCheckBlock, { withSpan: elementSourceSpan, filter: isDirectiveDeclaration });
|
|
4871
5263
|
return nodes.map((node) => {
|
|
4872
5264
|
var _a2;
|
|
4873
5265
|
const symbol = this.getSymbolOfTsNode(node.parent);
|
|
4874
|
-
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !
|
|
5266
|
+
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts30.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
|
|
4875
5267
|
return null;
|
|
4876
5268
|
}
|
|
4877
5269
|
const meta = this.getDirectiveMeta(element, symbol.tsSymbol.valueDeclaration);
|
|
@@ -4940,17 +5332,17 @@ var SymbolBuilder = class {
|
|
|
4940
5332
|
if (!isAccessExpression(n)) {
|
|
4941
5333
|
return false;
|
|
4942
5334
|
}
|
|
4943
|
-
if (
|
|
5335
|
+
if (ts30.isPropertyAccessExpression(n)) {
|
|
4944
5336
|
return n.name.getText() === expectedAccess;
|
|
4945
5337
|
} else {
|
|
4946
|
-
return
|
|
5338
|
+
return ts30.isStringLiteral(n.argumentExpression) && n.argumentExpression.text === expectedAccess;
|
|
4947
5339
|
}
|
|
4948
5340
|
}
|
|
4949
5341
|
const outputFieldAccesses = findAllMatchingNodes(this.typeCheckBlock, { withSpan: eventBinding.keySpan, filter });
|
|
4950
5342
|
const bindings = [];
|
|
4951
5343
|
for (const outputFieldAccess of outputFieldAccesses) {
|
|
4952
5344
|
if (consumer instanceof TmplAstTemplate3 || consumer instanceof TmplAstElement4) {
|
|
4953
|
-
if (!
|
|
5345
|
+
if (!ts30.isPropertyAccessExpression(outputFieldAccess)) {
|
|
4954
5346
|
continue;
|
|
4955
5347
|
}
|
|
4956
5348
|
const addEventListener = outputFieldAccess.name;
|
|
@@ -4973,7 +5365,7 @@ var SymbolBuilder = class {
|
|
|
4973
5365
|
}
|
|
4974
5366
|
});
|
|
4975
5367
|
} else {
|
|
4976
|
-
if (!
|
|
5368
|
+
if (!ts30.isElementAccessExpression(outputFieldAccess)) {
|
|
4977
5369
|
continue;
|
|
4978
5370
|
}
|
|
4979
5371
|
const tsSymbol = this.getTypeChecker().getSymbolAtLocation(outputFieldAccess.argumentExpression);
|
|
@@ -5045,11 +5437,11 @@ var SymbolBuilder = class {
|
|
|
5045
5437
|
return null;
|
|
5046
5438
|
}
|
|
5047
5439
|
const [declaration] = tsSymbol.declarations;
|
|
5048
|
-
if (!
|
|
5440
|
+
if (!ts30.isVariableDeclaration(declaration) || !hasExpressionIdentifier(declaration.getSourceFile(), (_a = declaration.type) != null ? _a : declaration.name, ExpressionIdentifier.DIRECTIVE)) {
|
|
5049
5441
|
return null;
|
|
5050
5442
|
}
|
|
5051
5443
|
const symbol = this.getSymbolOfTsNode(declaration);
|
|
5052
|
-
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !
|
|
5444
|
+
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts30.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
|
|
5053
5445
|
return null;
|
|
5054
5446
|
}
|
|
5055
5447
|
const ngModule = this.getDirectiveModule(symbol.tsSymbol.valueDeclaration);
|
|
@@ -5065,7 +5457,7 @@ var SymbolBuilder = class {
|
|
|
5065
5457
|
};
|
|
5066
5458
|
}
|
|
5067
5459
|
getSymbolOfVariable(variable) {
|
|
5068
|
-
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: variable.sourceSpan, filter:
|
|
5460
|
+
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: variable.sourceSpan, filter: ts30.isVariableDeclaration });
|
|
5069
5461
|
if (node === null || node.initializer === void 0) {
|
|
5070
5462
|
return null;
|
|
5071
5463
|
}
|
|
@@ -5088,11 +5480,11 @@ var SymbolBuilder = class {
|
|
|
5088
5480
|
}
|
|
5089
5481
|
getSymbolOfReference(ref) {
|
|
5090
5482
|
const target = this.templateData.boundTarget.getReferenceTarget(ref);
|
|
5091
|
-
let node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: ref.sourceSpan, filter:
|
|
5483
|
+
let node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: ref.sourceSpan, filter: ts30.isVariableDeclaration });
|
|
5092
5484
|
if (node === null || target === null || node.initializer === void 0) {
|
|
5093
5485
|
return null;
|
|
5094
5486
|
}
|
|
5095
|
-
const originalDeclaration =
|
|
5487
|
+
const originalDeclaration = ts30.isParenthesizedExpression(node.initializer) && ts30.isAsExpression(node.initializer.expression) ? this.getTypeChecker().getSymbolAtLocation(node.name) : this.getTypeChecker().getSymbolAtLocation(node.initializer);
|
|
5096
5488
|
if (originalDeclaration === void 0 || originalDeclaration.valueDeclaration === void 0) {
|
|
5097
5489
|
return null;
|
|
5098
5490
|
}
|
|
@@ -5116,7 +5508,7 @@ var SymbolBuilder = class {
|
|
|
5116
5508
|
referenceVarLocation: referenceVarTcbLocation
|
|
5117
5509
|
};
|
|
5118
5510
|
} else {
|
|
5119
|
-
if (!
|
|
5511
|
+
if (!ts30.isClassDeclaration(target.directive.ref.node)) {
|
|
5120
5512
|
return null;
|
|
5121
5513
|
}
|
|
5122
5514
|
return {
|
|
@@ -5131,7 +5523,7 @@ var SymbolBuilder = class {
|
|
|
5131
5523
|
}
|
|
5132
5524
|
}
|
|
5133
5525
|
getSymbolOfPipe(expression) {
|
|
5134
|
-
const methodAccess = findFirstMatchingNode(this.typeCheckBlock, { withSpan: expression.nameSpan, filter:
|
|
5526
|
+
const methodAccess = findFirstMatchingNode(this.typeCheckBlock, { withSpan: expression.nameSpan, filter: ts30.isPropertyAccessExpression });
|
|
5135
5527
|
if (methodAccess === null) {
|
|
5136
5528
|
return null;
|
|
5137
5529
|
}
|
|
@@ -5170,7 +5562,7 @@ var SymbolBuilder = class {
|
|
|
5170
5562
|
}
|
|
5171
5563
|
let node = null;
|
|
5172
5564
|
if (expression instanceof PropertyRead5) {
|
|
5173
|
-
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter:
|
|
5565
|
+
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: ts30.isPropertyAccessExpression });
|
|
5174
5566
|
}
|
|
5175
5567
|
if (node === null) {
|
|
5176
5568
|
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: anyNodeFilter });
|
|
@@ -5178,10 +5570,10 @@ var SymbolBuilder = class {
|
|
|
5178
5570
|
if (node === null) {
|
|
5179
5571
|
return null;
|
|
5180
5572
|
}
|
|
5181
|
-
while (
|
|
5573
|
+
while (ts30.isParenthesizedExpression(node)) {
|
|
5182
5574
|
node = node.expression;
|
|
5183
5575
|
}
|
|
5184
|
-
if (expression instanceof SafePropertyRead4 &&
|
|
5576
|
+
if (expression instanceof SafePropertyRead4 && ts30.isConditionalExpression(node)) {
|
|
5185
5577
|
const whenTrueSymbol = this.getSymbolOfTsNode(node.whenTrue);
|
|
5186
5578
|
if (whenTrueSymbol === null) {
|
|
5187
5579
|
return null;
|
|
@@ -5197,13 +5589,13 @@ var SymbolBuilder = class {
|
|
|
5197
5589
|
}
|
|
5198
5590
|
getSymbolOfTsNode(node) {
|
|
5199
5591
|
var _a;
|
|
5200
|
-
while (
|
|
5592
|
+
while (ts30.isParenthesizedExpression(node)) {
|
|
5201
5593
|
node = node.expression;
|
|
5202
5594
|
}
|
|
5203
5595
|
let tsSymbol;
|
|
5204
|
-
if (
|
|
5596
|
+
if (ts30.isPropertyAccessExpression(node)) {
|
|
5205
5597
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.name);
|
|
5206
|
-
} else if (
|
|
5598
|
+
} else if (ts30.isElementAccessExpression(node)) {
|
|
5207
5599
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.argumentExpression);
|
|
5208
5600
|
} else {
|
|
5209
5601
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node);
|
|
@@ -5221,13 +5613,13 @@ var SymbolBuilder = class {
|
|
|
5221
5613
|
};
|
|
5222
5614
|
}
|
|
5223
5615
|
getTcbPositionForNode(node) {
|
|
5224
|
-
if (
|
|
5616
|
+
if (ts30.isTypeReferenceNode(node)) {
|
|
5225
5617
|
return this.getTcbPositionForNode(node.typeName);
|
|
5226
|
-
} else if (
|
|
5618
|
+
} else if (ts30.isQualifiedName(node)) {
|
|
5227
5619
|
return node.right.getStart();
|
|
5228
|
-
} else if (
|
|
5620
|
+
} else if (ts30.isPropertyAccessExpression(node)) {
|
|
5229
5621
|
return node.name.getStart();
|
|
5230
|
-
} else if (
|
|
5622
|
+
} else if (ts30.isElementAccessExpression(node)) {
|
|
5231
5623
|
return node.argumentExpression.getStart();
|
|
5232
5624
|
} else {
|
|
5233
5625
|
return node.getStart();
|
|
@@ -5241,7 +5633,7 @@ function sourceSpanEqual(a, b) {
|
|
|
5241
5633
|
return a.start.offset === b.start.offset && a.end.offset === b.end.offset;
|
|
5242
5634
|
}
|
|
5243
5635
|
|
|
5244
|
-
// bazel-out/
|
|
5636
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
|
|
5245
5637
|
var REGISTRY2 = new DomElementSchemaRegistry2();
|
|
5246
5638
|
var TemplateTypeCheckerImpl = class {
|
|
5247
5639
|
constructor(originalProgram, programDriver, typeCheckAdapter, config, refEmitter, reflector, compilerHost, priorBuild, componentScopeReader, typeCheckScopeRegistry, perf) {
|
|
@@ -5775,10 +6167,10 @@ var SingleShimTypeCheckingHost = class extends SingleFileTypeCheckingHost {
|
|
|
5775
6167
|
}
|
|
5776
6168
|
};
|
|
5777
6169
|
|
|
5778
|
-
// bazel-out/
|
|
6170
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.mjs
|
|
5779
6171
|
import { TmplAstBoundEvent as TmplAstBoundEvent2 } from "@angular/compiler";
|
|
5780
6172
|
|
|
5781
|
-
// bazel-out/
|
|
6173
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/api/api.mjs
|
|
5782
6174
|
import { ASTWithSource as ASTWithSource4, RecursiveAstVisitor as RecursiveAstVisitor3 } from "@angular/compiler";
|
|
5783
6175
|
var TemplateCheckWithVisitor = class {
|
|
5784
6176
|
run(ctx, component, template) {
|
|
@@ -5855,7 +6247,7 @@ var TemplateVisitor2 = class extends RecursiveAstVisitor3 {
|
|
|
5855
6247
|
}
|
|
5856
6248
|
};
|
|
5857
6249
|
|
|
5858
|
-
// bazel-out/
|
|
6250
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.mjs
|
|
5859
6251
|
var InvalidBananaInBoxCheck = class extends TemplateCheckWithVisitor {
|
|
5860
6252
|
constructor() {
|
|
5861
6253
|
super(...arguments);
|
|
@@ -5880,9 +6272,9 @@ var factory = {
|
|
|
5880
6272
|
create: () => new InvalidBananaInBoxCheck()
|
|
5881
6273
|
};
|
|
5882
6274
|
|
|
5883
|
-
// bazel-out/
|
|
6275
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.mjs
|
|
5884
6276
|
import { Binary } from "@angular/compiler";
|
|
5885
|
-
import
|
|
6277
|
+
import ts31 from "typescript";
|
|
5886
6278
|
var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
5887
6279
|
constructor() {
|
|
5888
6280
|
super(...arguments);
|
|
@@ -5896,7 +6288,7 @@ var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
5896
6288
|
return [];
|
|
5897
6289
|
}
|
|
5898
6290
|
const typeLeft = symbolLeft.tsType;
|
|
5899
|
-
if (typeLeft.flags & (
|
|
6291
|
+
if (typeLeft.flags & (ts31.TypeFlags.Any | ts31.TypeFlags.Unknown)) {
|
|
5900
6292
|
return [];
|
|
5901
6293
|
}
|
|
5902
6294
|
if (typeLeft.getNonNullableType() !== typeLeft)
|
|
@@ -5925,10 +6317,10 @@ var factory2 = {
|
|
|
5925
6317
|
}
|
|
5926
6318
|
};
|
|
5927
6319
|
|
|
5928
|
-
// bazel-out/
|
|
5929
|
-
import
|
|
6320
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
|
|
6321
|
+
import ts32 from "typescript";
|
|
5930
6322
|
|
|
5931
|
-
// bazel-out/
|
|
6323
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/api/src/public_options.mjs
|
|
5932
6324
|
var DiagnosticCategoryLabel;
|
|
5933
6325
|
(function(DiagnosticCategoryLabel2) {
|
|
5934
6326
|
DiagnosticCategoryLabel2["Warning"] = "warning";
|
|
@@ -5936,7 +6328,7 @@ var DiagnosticCategoryLabel;
|
|
|
5936
6328
|
DiagnosticCategoryLabel2["Suppress"] = "suppress";
|
|
5937
6329
|
})(DiagnosticCategoryLabel || (DiagnosticCategoryLabel = {}));
|
|
5938
6330
|
|
|
5939
|
-
// bazel-out/
|
|
6331
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
|
|
5940
6332
|
var ExtendedTemplateCheckerImpl = class {
|
|
5941
6333
|
constructor(templateTypeChecker, typeChecker, templateCheckFactories, options) {
|
|
5942
6334
|
var _a, _b, _c, _d, _e;
|
|
@@ -5974,9 +6366,9 @@ var ExtendedTemplateCheckerImpl = class {
|
|
|
5974
6366
|
function diagnosticLabelToCategory(label) {
|
|
5975
6367
|
switch (label) {
|
|
5976
6368
|
case DiagnosticCategoryLabel.Warning:
|
|
5977
|
-
return
|
|
6369
|
+
return ts32.DiagnosticCategory.Warning;
|
|
5978
6370
|
case DiagnosticCategoryLabel.Error:
|
|
5979
|
-
return
|
|
6371
|
+
return ts32.DiagnosticCategory.Error;
|
|
5980
6372
|
case DiagnosticCategoryLabel.Suppress:
|
|
5981
6373
|
return null;
|
|
5982
6374
|
default:
|
|
@@ -5988,13 +6380,13 @@ function assertNever(value) {
|
|
|
5988
6380
|
${value}`);
|
|
5989
6381
|
}
|
|
5990
6382
|
|
|
5991
|
-
// bazel-out/
|
|
6383
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/index.mjs
|
|
5992
6384
|
var ALL_DIAGNOSTIC_FACTORIES = [
|
|
5993
6385
|
factory,
|
|
5994
6386
|
factory2
|
|
5995
6387
|
];
|
|
5996
6388
|
|
|
5997
|
-
// bazel-out/
|
|
6389
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
5998
6390
|
var CompilationTicketKind;
|
|
5999
6391
|
(function(CompilationTicketKind2) {
|
|
6000
6392
|
CompilationTicketKind2[CompilationTicketKind2["Fresh"] = 0] = "Fresh";
|
|
@@ -6071,7 +6463,7 @@ var NgCompiler = class {
|
|
|
6071
6463
|
this.currentProgram = inputProgram;
|
|
6072
6464
|
this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
|
|
6073
6465
|
this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
|
|
6074
|
-
const moduleResolutionCache =
|
|
6466
|
+
const moduleResolutionCache = ts33.createModuleResolutionCache(this.adapter.getCurrentDirectory(), this.adapter.getCanonicalFileName.bind(this.adapter));
|
|
6075
6467
|
this.moduleResolver = new ModuleResolver(inputProgram, this.options, this.adapter, moduleResolutionCache);
|
|
6076
6468
|
this.resourceManager = new AdapterResourceLoader(adapter, this.options);
|
|
6077
6469
|
this.cycleAnalyzer = new CycleAnalyzer(new ImportGraph(inputProgram.getTypeChecker(), this.delegatingPerfRecorder));
|
|
@@ -6127,7 +6519,7 @@ var NgCompiler = class {
|
|
|
6127
6519
|
}
|
|
6128
6520
|
for (const clazz of classesToUpdate) {
|
|
6129
6521
|
this.compilation.traitCompiler.updateResources(clazz);
|
|
6130
|
-
if (!
|
|
6522
|
+
if (!ts33.isClassDeclaration(clazz)) {
|
|
6131
6523
|
continue;
|
|
6132
6524
|
}
|
|
6133
6525
|
this.compilation.templateTypeChecker.invalidateClass(clazz);
|
|
@@ -6505,7 +6897,7 @@ var NgCompiler = class {
|
|
|
6505
6897
|
new InjectableDecoratorHandler(reflector, isCore, this.options.strictInjectionParameters || false, injectableRegistry, this.delegatingPerfRecorder),
|
|
6506
6898
|
new NgModuleDecoratorHandler(reflector, evaluator, metaReader, metaRegistry, scopeRegistry, referencesRegistry, isCore, refEmitter, this.adapter.factoryTracker, this.closureCompilerEnabled, injectableRegistry, this.delegatingPerfRecorder)
|
|
6507
6899
|
];
|
|
6508
|
-
const traitCompiler = new TraitCompiler(handlers, reflector, this.delegatingPerfRecorder, this.incrementalCompilation, this.options.compileNonExportedClasses !== false, compilationMode, dtsTransforms, semanticDepGraphUpdater);
|
|
6900
|
+
const traitCompiler = new TraitCompiler(handlers, reflector, this.delegatingPerfRecorder, this.incrementalCompilation, this.options.compileNonExportedClasses !== false, compilationMode, dtsTransforms, semanticDepGraphUpdater, this.adapter);
|
|
6509
6901
|
const notifyingDriver = new NotifyingProgramDriverWrapper(this.programDriver, (program) => {
|
|
6510
6902
|
this.incrementalStrategy.setIncrementalState(this.incrementalCompilation.state, program);
|
|
6511
6903
|
this.currentProgram = program;
|
|
@@ -6535,17 +6927,17 @@ function isAngularCorePackage(program) {
|
|
|
6535
6927
|
return false;
|
|
6536
6928
|
}
|
|
6537
6929
|
return r3Symbols.statements.some((stmt) => {
|
|
6538
|
-
if (!
|
|
6930
|
+
if (!ts33.isVariableStatement(stmt)) {
|
|
6539
6931
|
return false;
|
|
6540
6932
|
}
|
|
6541
|
-
if (stmt.modifiers === void 0 || !stmt.modifiers.some((mod) => mod.kind ===
|
|
6933
|
+
if (stmt.modifiers === void 0 || !stmt.modifiers.some((mod) => mod.kind === ts33.SyntaxKind.ExportKeyword)) {
|
|
6542
6934
|
return false;
|
|
6543
6935
|
}
|
|
6544
6936
|
return stmt.declarationList.declarations.some((decl) => {
|
|
6545
|
-
if (!
|
|
6937
|
+
if (!ts33.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
|
|
6546
6938
|
return false;
|
|
6547
6939
|
}
|
|
6548
|
-
if (decl.initializer === void 0 || decl.initializer.kind !==
|
|
6940
|
+
if (decl.initializer === void 0 || decl.initializer.kind !== ts33.SyntaxKind.TrueKeyword) {
|
|
6549
6941
|
return false;
|
|
6550
6942
|
}
|
|
6551
6943
|
return true;
|
|
@@ -6559,7 +6951,7 @@ function* verifyCompatibleTypeCheckOptions(options) {
|
|
|
6559
6951
|
var _a, _b, _c;
|
|
6560
6952
|
if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
|
|
6561
6953
|
yield makeConfigDiagnostic({
|
|
6562
|
-
category:
|
|
6954
|
+
category: ts33.DiagnosticCategory.Error,
|
|
6563
6955
|
code: ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK,
|
|
6564
6956
|
messageText: `
|
|
6565
6957
|
Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
|
|
@@ -6578,7 +6970,7 @@ https://angular.io/guide/template-typecheck
|
|
|
6578
6970
|
}
|
|
6579
6971
|
if (options.extendedDiagnostics && options.strictTemplates === false) {
|
|
6580
6972
|
yield makeConfigDiagnostic({
|
|
6581
|
-
category:
|
|
6973
|
+
category: ts33.DiagnosticCategory.Error,
|
|
6582
6974
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES,
|
|
6583
6975
|
messageText: `
|
|
6584
6976
|
Angular compiler option "extendedDiagnostics" is configured, however "strictTemplates" is disabled.
|
|
@@ -6595,7 +6987,7 @@ One of the following actions is required:
|
|
|
6595
6987
|
const defaultCategory = (_a = options.extendedDiagnostics) == null ? void 0 : _a.defaultCategory;
|
|
6596
6988
|
if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
|
|
6597
6989
|
yield makeConfigDiagnostic({
|
|
6598
|
-
category:
|
|
6990
|
+
category: ts33.DiagnosticCategory.Error,
|
|
6599
6991
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
6600
6992
|
messageText: `
|
|
6601
6993
|
Angular compiler option "extendedDiagnostics.defaultCategory" has an unknown diagnostic category: "${defaultCategory}".
|
|
@@ -6609,7 +7001,7 @@ ${allowedCategoryLabels.join("\n")}
|
|
|
6609
7001
|
for (const [checkName, category] of Object.entries((_c = (_b = options.extendedDiagnostics) == null ? void 0 : _b.checks) != null ? _c : {})) {
|
|
6610
7002
|
if (!allExtendedDiagnosticNames.includes(checkName)) {
|
|
6611
7003
|
yield makeConfigDiagnostic({
|
|
6612
|
-
category:
|
|
7004
|
+
category: ts33.DiagnosticCategory.Error,
|
|
6613
7005
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK,
|
|
6614
7006
|
messageText: `
|
|
6615
7007
|
Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${checkName}".
|
|
@@ -6621,7 +7013,7 @@ ${allExtendedDiagnosticNames.join("\n")}
|
|
|
6621
7013
|
}
|
|
6622
7014
|
if (!allowedCategoryLabels.includes(category)) {
|
|
6623
7015
|
yield makeConfigDiagnostic({
|
|
6624
|
-
category:
|
|
7016
|
+
category: ts33.DiagnosticCategory.Error,
|
|
6625
7017
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
6626
7018
|
messageText: `
|
|
6627
7019
|
Angular compiler option "extendedDiagnostics.checks['${checkName}']" has an unknown diagnostic category: "${category}".
|
|
@@ -6651,7 +7043,7 @@ var ReferenceGraphAdapter = class {
|
|
|
6651
7043
|
for (const { node } of references) {
|
|
6652
7044
|
let sourceFile = node.getSourceFile();
|
|
6653
7045
|
if (sourceFile === void 0) {
|
|
6654
|
-
sourceFile =
|
|
7046
|
+
sourceFile = ts33.getOriginalNode(node).getSourceFile();
|
|
6655
7047
|
}
|
|
6656
7048
|
if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
|
|
6657
7049
|
this.graph.add(source, node);
|
|
@@ -6689,8 +7081,8 @@ function versionMapFromProgram(program, driver) {
|
|
|
6689
7081
|
return versions;
|
|
6690
7082
|
}
|
|
6691
7083
|
|
|
6692
|
-
// bazel-out/
|
|
6693
|
-
import
|
|
7084
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
|
|
7085
|
+
import ts34 from "typescript";
|
|
6694
7086
|
var DelegatingCompilerHost2 = class {
|
|
6695
7087
|
constructor(delegate) {
|
|
6696
7088
|
this.delegate = delegate;
|
|
@@ -6780,7 +7172,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
6780
7172
|
entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
|
|
6781
7173
|
if (entryPoint === null) {
|
|
6782
7174
|
diagnostics.push({
|
|
6783
|
-
category:
|
|
7175
|
+
category: ts34.DiagnosticCategory.Error,
|
|
6784
7176
|
code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
|
|
6785
7177
|
file: void 0,
|
|
6786
7178
|
start: void 0,
|
|
@@ -6801,6 +7193,9 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
6801
7193
|
isShim(sf) {
|
|
6802
7194
|
return isShim(sf);
|
|
6803
7195
|
}
|
|
7196
|
+
isResource(sf) {
|
|
7197
|
+
return false;
|
|
7198
|
+
}
|
|
6804
7199
|
getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile) {
|
|
6805
7200
|
const shimSf = this.shimAdapter.maybeGenerate(resolve(fileName));
|
|
6806
7201
|
if (shimSf !== null) {
|
|
@@ -6820,17 +7215,17 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
6820
7215
|
return this.fileNameToModuleName !== void 0 ? this : null;
|
|
6821
7216
|
}
|
|
6822
7217
|
createCachedResolveModuleNamesFunction() {
|
|
6823
|
-
const moduleResolutionCache =
|
|
7218
|
+
const moduleResolutionCache = ts34.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
|
|
6824
7219
|
return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
|
|
6825
7220
|
return moduleNames.map((moduleName) => {
|
|
6826
|
-
const module =
|
|
7221
|
+
const module = ts34.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
|
|
6827
7222
|
return module.resolvedModule;
|
|
6828
7223
|
});
|
|
6829
7224
|
};
|
|
6830
7225
|
}
|
|
6831
7226
|
};
|
|
6832
7227
|
|
|
6833
|
-
// bazel-out/
|
|
7228
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
6834
7229
|
var NgtscProgram = class {
|
|
6835
7230
|
constructor(rootNames, options, delegateHost, oldProgram) {
|
|
6836
7231
|
this.options = options;
|
|
@@ -6844,7 +7239,7 @@ var NgtscProgram = class {
|
|
|
6844
7239
|
if (reuseProgram !== void 0) {
|
|
6845
7240
|
retagAllTsFiles(reuseProgram);
|
|
6846
7241
|
}
|
|
6847
|
-
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () =>
|
|
7242
|
+
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts35.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
|
|
6848
7243
|
perfRecorder.phase(PerfPhase.Unaccounted);
|
|
6849
7244
|
perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
|
|
6850
7245
|
this.host.postProgramCreationCleanup();
|
|
@@ -7037,38 +7432,38 @@ function mergeEmitResults(emitResults) {
|
|
|
7037
7432
|
return { diagnostics, emitSkipped, emittedFiles };
|
|
7038
7433
|
}
|
|
7039
7434
|
|
|
7040
|
-
// bazel-out/
|
|
7435
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/program.mjs
|
|
7041
7436
|
function createProgram({ rootNames, options, host, oldProgram }) {
|
|
7042
7437
|
return new NgtscProgram(rootNames, options, host, oldProgram);
|
|
7043
7438
|
}
|
|
7044
7439
|
|
|
7045
|
-
// bazel-out/
|
|
7046
|
-
import
|
|
7440
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
7441
|
+
import ts37 from "typescript";
|
|
7047
7442
|
|
|
7048
|
-
// bazel-out/
|
|
7049
|
-
import
|
|
7443
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
|
|
7444
|
+
import ts36 from "typescript";
|
|
7050
7445
|
var GENERATED_FILES = /(.*?)\.(ngfactory|shim\.ngstyle|ngstyle|ngsummary)\.(js|d\.ts|ts)$/;
|
|
7051
7446
|
function createMessageDiagnostic(messageText) {
|
|
7052
7447
|
return {
|
|
7053
7448
|
file: void 0,
|
|
7054
7449
|
start: void 0,
|
|
7055
7450
|
length: void 0,
|
|
7056
|
-
category:
|
|
7451
|
+
category: ts36.DiagnosticCategory.Message,
|
|
7057
7452
|
messageText,
|
|
7058
7453
|
code: DEFAULT_ERROR_CODE,
|
|
7059
7454
|
source: SOURCE
|
|
7060
7455
|
};
|
|
7061
7456
|
}
|
|
7062
7457
|
|
|
7063
|
-
// bazel-out/
|
|
7458
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
7064
7459
|
var defaultFormatHost = {
|
|
7065
|
-
getCurrentDirectory: () =>
|
|
7460
|
+
getCurrentDirectory: () => ts37.sys.getCurrentDirectory(),
|
|
7066
7461
|
getCanonicalFileName: (fileName) => fileName,
|
|
7067
|
-
getNewLine: () =>
|
|
7462
|
+
getNewLine: () => ts37.sys.newLine
|
|
7068
7463
|
};
|
|
7069
7464
|
function formatDiagnostics(diags, host = defaultFormatHost) {
|
|
7070
7465
|
if (diags && diags.length) {
|
|
7071
|
-
return diags.map((diagnostic) => replaceTsWithNgInErrors(
|
|
7466
|
+
return diags.map((diagnostic) => replaceTsWithNgInErrors(ts37.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
|
|
7072
7467
|
} else {
|
|
7073
7468
|
return "";
|
|
7074
7469
|
}
|
|
@@ -7085,7 +7480,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
7085
7480
|
var _a, _b;
|
|
7086
7481
|
try {
|
|
7087
7482
|
const fs = getFileSystem();
|
|
7088
|
-
const readConfigFile = (configFile) =>
|
|
7483
|
+
const readConfigFile = (configFile) => ts37.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
|
|
7089
7484
|
const readAngularCompilerOptions = (configFile, parentOptions = {}) => {
|
|
7090
7485
|
const { config: config2, error: error2 } = readConfigFile(configFile);
|
|
7091
7486
|
if (error2) {
|
|
@@ -7117,7 +7512,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
7117
7512
|
basePath
|
|
7118
7513
|
}, readAngularCompilerOptions(configFileName)), existingOptions);
|
|
7119
7514
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
7120
|
-
const { options, errors, fileNames: rootNames, projectReferences } =
|
|
7515
|
+
const { options, errors, fileNames: rootNames, projectReferences } = ts37.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
|
|
7121
7516
|
options.enableIvy = !!((_a = options.enableIvy) != null ? _a : true);
|
|
7122
7517
|
let emitFlags = EmitFlags.Default;
|
|
7123
7518
|
if (!(options.skipMetadataEmit || options.flatModuleOutFile)) {
|
|
@@ -7129,7 +7524,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
7129
7524
|
return { project: projectFile, rootNames, projectReferences, options, errors, emitFlags };
|
|
7130
7525
|
} catch (e) {
|
|
7131
7526
|
const errors = [{
|
|
7132
|
-
category:
|
|
7527
|
+
category: ts37.DiagnosticCategory.Error,
|
|
7133
7528
|
messageText: (_b = e.stack) != null ? _b : e.message,
|
|
7134
7529
|
file: void 0,
|
|
7135
7530
|
start: void 0,
|
|
@@ -7143,7 +7538,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
7143
7538
|
function createParseConfigHost(host, fs = getFileSystem()) {
|
|
7144
7539
|
return {
|
|
7145
7540
|
fileExists: host.exists.bind(host),
|
|
7146
|
-
readDirectory:
|
|
7541
|
+
readDirectory: ts37.sys.readDirectory,
|
|
7147
7542
|
readFile: host.readFile.bind(host),
|
|
7148
7543
|
useCaseSensitiveFileNames: fs.isCaseSensitive()
|
|
7149
7544
|
};
|
|
@@ -7163,7 +7558,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
7163
7558
|
}
|
|
7164
7559
|
} else {
|
|
7165
7560
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
7166
|
-
const { resolvedModule } =
|
|
7561
|
+
const { resolvedModule } = ts37.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts37.ModuleResolutionKind.NodeJs, resolveJsonModule: true }, parseConfigHost);
|
|
7167
7562
|
if (resolvedModule) {
|
|
7168
7563
|
return absoluteFrom(resolvedModule.resolvedFileName);
|
|
7169
7564
|
}
|
|
@@ -7173,7 +7568,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
7173
7568
|
function exitCodeFromResult(diags) {
|
|
7174
7569
|
if (!diags)
|
|
7175
7570
|
return 0;
|
|
7176
|
-
if (diags.every((diag) => diag.category !==
|
|
7571
|
+
if (diags.every((diag) => diag.category !== ts37.DiagnosticCategory.Error)) {
|
|
7177
7572
|
return 0;
|
|
7178
7573
|
}
|
|
7179
7574
|
return diags.some((d) => d.source === "angular" && d.code === UNKNOWN_ERROR_CODE) ? 2 : 1;
|
|
@@ -7206,7 +7601,7 @@ function performCompilation({ rootNames, options, host, oldProgram, emitCallback
|
|
|
7206
7601
|
} catch (e) {
|
|
7207
7602
|
program = void 0;
|
|
7208
7603
|
allDiagnostics.push({
|
|
7209
|
-
category:
|
|
7604
|
+
category: ts37.DiagnosticCategory.Error,
|
|
7210
7605
|
messageText: (_a = e.stack) != null ? _a : e.message,
|
|
7211
7606
|
code: UNKNOWN_ERROR_CODE,
|
|
7212
7607
|
file: void 0,
|
|
@@ -7233,7 +7628,7 @@ function defaultGatherDiagnostics(program) {
|
|
|
7233
7628
|
return allDiagnostics;
|
|
7234
7629
|
}
|
|
7235
7630
|
function hasErrors(diags) {
|
|
7236
|
-
return diags.some((d) => d.category ===
|
|
7631
|
+
return diags.some((d) => d.category === ts37.DiagnosticCategory.Error);
|
|
7237
7632
|
}
|
|
7238
7633
|
|
|
7239
7634
|
export {
|
|
@@ -7245,6 +7640,8 @@ export {
|
|
|
7245
7640
|
createCompilerHost,
|
|
7246
7641
|
CycleAnalyzer,
|
|
7247
7642
|
ImportGraph,
|
|
7643
|
+
isShim,
|
|
7644
|
+
untagAllTsFiles,
|
|
7248
7645
|
TsCreateProgramDriver,
|
|
7249
7646
|
PatchedProgramIncrementalBuildStrategy,
|
|
7250
7647
|
MetadataDtsModuleScopeResolver,
|
|
@@ -7273,4 +7670,5 @@ export {
|
|
|
7273
7670
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7274
7671
|
* found in the LICENSE file at https://angular.io/license
|
|
7275
7672
|
*/
|
|
7276
|
-
|
|
7673
|
+
// Closure Compiler ignores @suppress and similar if the comment contains @license.
|
|
7674
|
+
//# sourceMappingURL=chunk-ZPZWKMTE.js.map
|