@angular/compiler-cli 17.0.0-next.7 → 17.0.0-next.8
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-PBDWVP2J.js → chunk-35SQ73FP.js} +687 -548
- package/bundles/chunk-35SQ73FP.js.map +6 -0
- package/bundles/{chunk-3NXCUQ44.js → chunk-5WC7IWWT.js} +8 -8
- package/bundles/{chunk-HJOPJLIM.js → chunk-BV3ZUD7T.js} +9 -8
- package/bundles/chunk-BV3ZUD7T.js.map +6 -0
- package/bundles/{chunk-GYHDNUIK.js → chunk-EKTJ7622.js} +7 -7
- package/bundles/{chunk-PYIYPY3X.js → chunk-EQ7Q3KIO.js} +30 -30
- package/bundles/{chunk-W3AMRN7J.js → chunk-JPBJE7OS.js} +5 -5
- package/bundles/{chunk-UHYH6BYB.js → chunk-JZC4T2RR.js} +1 -1
- package/bundles/{chunk-SBDNBITT.js → chunk-LYJKWJUC.js} +3 -3
- package/bundles/{chunk-C4TR4DIO.js → chunk-NNS2FLUN.js} +4 -4
- package/bundles/{chunk-PAPUMJUA.js → chunk-NVNYQX3M.js} +29 -27
- package/bundles/{chunk-PAPUMJUA.js.map → chunk-NVNYQX3M.js.map} +1 -1
- package/bundles/{chunk-CSOLWS7O.js → chunk-PCMLSPQF.js} +7 -7
- package/bundles/{chunk-I3FLXBLP.js → chunk-XXCMYI3O.js} +182 -147
- package/bundles/chunk-XXCMYI3O.js.map +6 -0
- package/bundles/index.js +13 -13
- package/bundles/linker/babel/index.js +13 -13
- package/bundles/linker/index.js +5 -5
- package/bundles/ngcc/index.js +1 -1
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +3 -3
- package/bundles/private/migrations.js +6 -6
- package/bundles/private/tooling.js +4 -4
- package/bundles/src/bin/ng_xi18n.js +11 -11
- package/bundles/src/bin/ngc.js +9 -9
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +3 -3
- package/src/ngtsc/annotations/common/index.d.ts +1 -0
- package/src/ngtsc/annotations/common/src/debug_info.d.ts +10 -0
- package/src/ngtsc/annotations/common/src/util.d.ts +1 -1
- package/src/ngtsc/annotations/component/src/handler.d.ts +2 -1
- package/src/ngtsc/annotations/component/src/metadata.d.ts +2 -1
- package/src/ngtsc/core/api/src/public_options.d.ts +8 -0
- package/src/ngtsc/diagnostics/src/error_code.d.ts +9 -0
- package/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.d.ts +2 -1
- package/src/ngtsc/docs/src/entities.d.ts +5 -0
- package/src/ngtsc/docs/src/extractor.d.ts +4 -0
- package/src/ngtsc/docs/src/filters.d.ts +9 -0
- package/src/ngtsc/docs/src/function_extractor.d.ts +3 -0
- package/src/ngtsc/docs/src/type_alias_extractor.d.ts +18 -0
- package/src/ngtsc/perf/src/api.d.ts +7 -3
- package/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.d.ts +10 -0
- package/bundles/chunk-HJOPJLIM.js.map +0 -6
- package/bundles/chunk-I3FLXBLP.js.map +0 -6
- package/bundles/chunk-PBDWVP2J.js.map +0 -6
- /package/bundles/{chunk-3NXCUQ44.js.map → chunk-5WC7IWWT.js.map} +0 -0
- /package/bundles/{chunk-GYHDNUIK.js.map → chunk-EKTJ7622.js.map} +0 -0
- /package/bundles/{chunk-PYIYPY3X.js.map → chunk-EQ7Q3KIO.js.map} +0 -0
- /package/bundles/{chunk-W3AMRN7J.js.map → chunk-JPBJE7OS.js.map} +0 -0
- /package/bundles/{chunk-UHYH6BYB.js.map → chunk-JZC4T2RR.js.map} +0 -0
- /package/bundles/{chunk-SBDNBITT.js.map → chunk-LYJKWJUC.js.map} +0 -0
- /package/bundles/{chunk-C4TR4DIO.js.map → chunk-NNS2FLUN.js.map} +0 -0
- /package/bundles/{chunk-CSOLWS7O.js.map → chunk-PCMLSPQF.js.map} +0 -0
|
@@ -36,12 +36,12 @@ import {
|
|
|
36
36
|
aliasTransformFactory,
|
|
37
37
|
declarationTransformFactory,
|
|
38
38
|
ivyTransformFactory
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-XXCMYI3O.js";
|
|
40
40
|
import {
|
|
41
41
|
ImportManager,
|
|
42
42
|
translateExpression,
|
|
43
43
|
translateType
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-5WC7IWWT.js";
|
|
45
45
|
import {
|
|
46
46
|
AbsoluteModuleStrategy,
|
|
47
47
|
AliasStrategy,
|
|
@@ -83,14 +83,14 @@ import {
|
|
|
83
83
|
relativePathBetween,
|
|
84
84
|
replaceTsWithNgInErrors,
|
|
85
85
|
toUnredirectedSourceFile
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-NVNYQX3M.js";
|
|
87
87
|
import {
|
|
88
88
|
ActivePerfRecorder,
|
|
89
89
|
DelegatingPerfRecorder,
|
|
90
90
|
PerfCheckpoint,
|
|
91
91
|
PerfEvent,
|
|
92
92
|
PerfPhase
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-BV3ZUD7T.js";
|
|
94
94
|
import {
|
|
95
95
|
LogicalFileSystem,
|
|
96
96
|
absoluteFrom,
|
|
@@ -100,9 +100,9 @@ import {
|
|
|
100
100
|
getSourceFileOrError,
|
|
101
101
|
join,
|
|
102
102
|
resolve
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-PCMLSPQF.js";
|
|
104
104
|
|
|
105
|
-
// bazel-out/
|
|
105
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
106
106
|
var DEFAULT_ERROR_CODE = 100;
|
|
107
107
|
var UNKNOWN_ERROR_CODE = 500;
|
|
108
108
|
var SOURCE = "angular";
|
|
@@ -120,7 +120,7 @@ var EmitFlags;
|
|
|
120
120
|
EmitFlags2[EmitFlags2["All"] = 31] = "All";
|
|
121
121
|
})(EmitFlags || (EmitFlags = {}));
|
|
122
122
|
|
|
123
|
-
// bazel-out/
|
|
123
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/compiler_host.mjs
|
|
124
124
|
import ts from "typescript";
|
|
125
125
|
var wrapHostForTest = null;
|
|
126
126
|
function createCompilerHost({ options, tsHost = ts.createCompilerHost(options, true) }) {
|
|
@@ -130,7 +130,7 @@ function createCompilerHost({ options, tsHost = ts.createCompilerHost(options, t
|
|
|
130
130
|
return tsHost;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
// bazel-out/
|
|
133
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/entities.mjs
|
|
134
134
|
var EntryType;
|
|
135
135
|
(function(EntryType2) {
|
|
136
136
|
EntryType2["Block"] = "Block";
|
|
@@ -157,6 +157,7 @@ var MemberType;
|
|
|
157
157
|
})(MemberType || (MemberType = {}));
|
|
158
158
|
var MemberTags;
|
|
159
159
|
(function(MemberTags2) {
|
|
160
|
+
MemberTags2["Abstract"] = "abstract";
|
|
160
161
|
MemberTags2["Static"] = "static";
|
|
161
162
|
MemberTags2["Readonly"] = "readonly";
|
|
162
163
|
MemberTags2["Protected"] = "protected";
|
|
@@ -165,11 +166,11 @@ var MemberTags;
|
|
|
165
166
|
MemberTags2["Output"] = "output";
|
|
166
167
|
})(MemberTags || (MemberTags = {}));
|
|
167
168
|
|
|
168
|
-
// bazel-out/
|
|
169
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
169
170
|
import { HtmlParser, MessageBundle } from "@angular/compiler";
|
|
170
|
-
import
|
|
171
|
+
import ts37 from "typescript";
|
|
171
172
|
|
|
172
|
-
// bazel-out/
|
|
173
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
|
|
173
174
|
import { Xliff, Xliff2, Xmb } from "@angular/compiler";
|
|
174
175
|
import * as path from "path";
|
|
175
176
|
function i18nGetExtension(formatName) {
|
|
@@ -220,10 +221,10 @@ function getPathNormalizer(basePath) {
|
|
|
220
221
|
};
|
|
221
222
|
}
|
|
222
223
|
|
|
223
|
-
// bazel-out/
|
|
224
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
|
|
224
225
|
import ts2 from "typescript";
|
|
225
226
|
|
|
226
|
-
// bazel-out/
|
|
227
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/version_helpers.mjs
|
|
227
228
|
function toNumbers(value) {
|
|
228
229
|
const suffixIndex = value.lastIndexOf("-");
|
|
229
230
|
return value.slice(0, suffixIndex === -1 ? value.length : suffixIndex).split(".").map((segment) => {
|
|
@@ -258,7 +259,7 @@ function compareVersions(v1, v2) {
|
|
|
258
259
|
return compareNumbers(toNumbers(v1), toNumbers(v2));
|
|
259
260
|
}
|
|
260
261
|
|
|
261
|
-
// bazel-out/
|
|
262
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
|
|
262
263
|
var MIN_TS_VERSION = "5.2.0";
|
|
263
264
|
var MAX_TS_VERSION = "5.3.0";
|
|
264
265
|
var tsVersion = ts2.version;
|
|
@@ -271,10 +272,10 @@ function verifySupportedTypeScriptVersion() {
|
|
|
271
272
|
checkVersion(tsVersion, MIN_TS_VERSION, MAX_TS_VERSION);
|
|
272
273
|
}
|
|
273
274
|
|
|
274
|
-
// bazel-out/
|
|
275
|
-
import
|
|
275
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
276
|
+
import ts35 from "typescript";
|
|
276
277
|
|
|
277
|
-
// bazel-out/
|
|
278
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
|
|
278
279
|
var CycleAnalyzer = class {
|
|
279
280
|
constructor(importGraph) {
|
|
280
281
|
this.importGraph = importGraph;
|
|
@@ -345,7 +346,7 @@ var Cycle = class {
|
|
|
345
346
|
}
|
|
346
347
|
};
|
|
347
348
|
|
|
348
|
-
// bazel-out/
|
|
349
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/imports.mjs
|
|
349
350
|
import ts3 from "typescript";
|
|
350
351
|
var ImportGraph = class {
|
|
351
352
|
constructor(checker, perf) {
|
|
@@ -437,7 +438,7 @@ var Found = class {
|
|
|
437
438
|
}
|
|
438
439
|
};
|
|
439
440
|
|
|
440
|
-
// bazel-out/
|
|
441
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/jsdoc_extractor.mjs
|
|
441
442
|
import ts4 from "typescript";
|
|
442
443
|
function extractJsDocTags(node) {
|
|
443
444
|
return ts4.getJSDocTags(node).map((t) => {
|
|
@@ -461,12 +462,12 @@ function extractRawJsDoc(node) {
|
|
|
461
462
|
return (_b = (_a = ts4.getJSDocCommentsAndTags(node).find(ts4.isJSDoc)) == null ? void 0 : _a.getFullText()) != null ? _b : "";
|
|
462
463
|
}
|
|
463
464
|
|
|
464
|
-
// bazel-out/
|
|
465
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/type_extractor.mjs
|
|
465
466
|
function extractResolvedTypeString(node, checker) {
|
|
466
467
|
return checker.typeToString(checker.getTypeAtLocation(node));
|
|
467
468
|
}
|
|
468
469
|
|
|
469
|
-
// bazel-out/
|
|
470
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/enum_extractor.mjs
|
|
470
471
|
import ts5 from "typescript";
|
|
471
472
|
function extractEnum(declaration, typeChecker) {
|
|
472
473
|
return {
|
|
@@ -495,7 +496,8 @@ function getEnumMemberValue(memberNode) {
|
|
|
495
496
|
return (_a = literal == null ? void 0 : literal.getText()) != null ? _a : "";
|
|
496
497
|
}
|
|
497
498
|
|
|
498
|
-
// bazel-out/
|
|
499
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/function_extractor.mjs
|
|
500
|
+
import ts6 from "typescript";
|
|
499
501
|
var FunctionExtractor = class {
|
|
500
502
|
constructor(declaration, typeChecker) {
|
|
501
503
|
this.declaration = declaration;
|
|
@@ -523,13 +525,45 @@ var FunctionExtractor = class {
|
|
|
523
525
|
isRestParam: !!param.dotDotDotToken
|
|
524
526
|
}));
|
|
525
527
|
}
|
|
528
|
+
getOverloads() {
|
|
529
|
+
var _a, _b, _c, _d;
|
|
530
|
+
const overloads = [];
|
|
531
|
+
const symbol = this.getSymbol();
|
|
532
|
+
const declarationCount = (_b = (_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a.length) != null ? _b : 0;
|
|
533
|
+
if (declarationCount > 1) {
|
|
534
|
+
for (let i = 0; i < declarationCount - 1; i++) {
|
|
535
|
+
const overloadDeclaration = (_c = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _c[i];
|
|
536
|
+
if ((overloadDeclaration == null ? void 0 : overloadDeclaration.pos) === this.declaration.pos)
|
|
537
|
+
continue;
|
|
538
|
+
if (overloadDeclaration && ts6.isFunctionDeclaration(overloadDeclaration) && ((_d = overloadDeclaration.modifiers) == null ? void 0 : _d.some((mod) => mod.kind === ts6.SyntaxKind.ExportKeyword))) {
|
|
539
|
+
overloads.push(overloadDeclaration);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
return overloads;
|
|
544
|
+
}
|
|
545
|
+
getSymbol() {
|
|
546
|
+
return this.typeChecker.getSymbolsInScope(this.declaration, ts6.SymbolFlags.Function).find((s) => {
|
|
547
|
+
var _a;
|
|
548
|
+
return s.name === ((_a = this.declaration.name) == null ? void 0 : _a.getText());
|
|
549
|
+
});
|
|
550
|
+
}
|
|
526
551
|
};
|
|
527
552
|
|
|
528
|
-
// bazel-out/
|
|
553
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/extractor.mjs
|
|
554
|
+
import ts8 from "typescript";
|
|
555
|
+
|
|
556
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/class_extractor.mjs
|
|
529
557
|
import ts7 from "typescript";
|
|
530
558
|
|
|
531
|
-
// bazel-out/
|
|
532
|
-
|
|
559
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/filters.mjs
|
|
560
|
+
function isAngularPrivateName(name) {
|
|
561
|
+
var _a;
|
|
562
|
+
const firstChar = (_a = name[0]) != null ? _a : "";
|
|
563
|
+
return firstChar === "\u0275" || firstChar === "_";
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/class_extractor.mjs
|
|
533
567
|
var ClassExtractor = class {
|
|
534
568
|
constructor(declaration, typeChecker) {
|
|
535
569
|
this.declaration = declaration;
|
|
@@ -538,7 +572,8 @@ var ClassExtractor = class {
|
|
|
538
572
|
extract() {
|
|
539
573
|
return {
|
|
540
574
|
name: this.declaration.name.text,
|
|
541
|
-
|
|
575
|
+
isAbstract: this.isAbstract(),
|
|
576
|
+
entryType: ts7.isInterfaceDeclaration(this.declaration) ? EntryType.Interface : EntryType.UndecoratedClass,
|
|
542
577
|
members: this.extractAllClassMembers(this.declaration),
|
|
543
578
|
description: extractJsDocDescription(this.declaration),
|
|
544
579
|
jsdocTags: extractJsDocTags(this.declaration),
|
|
@@ -558,11 +593,11 @@ var ClassExtractor = class {
|
|
|
558
593
|
return members;
|
|
559
594
|
}
|
|
560
595
|
extractClassMember(memberDeclaration) {
|
|
561
|
-
if (this.isMethod(memberDeclaration)) {
|
|
596
|
+
if (this.isMethod(memberDeclaration) && !this.isImplementationForOverload(memberDeclaration)) {
|
|
562
597
|
return this.extractMethod(memberDeclaration);
|
|
563
598
|
} else if (this.isProperty(memberDeclaration)) {
|
|
564
599
|
return this.extractClassProperty(memberDeclaration);
|
|
565
|
-
} else if (
|
|
600
|
+
} else if (ts7.isAccessor(memberDeclaration)) {
|
|
566
601
|
return this.extractGetterSetter(memberDeclaration);
|
|
567
602
|
}
|
|
568
603
|
return void 0;
|
|
@@ -588,7 +623,7 @@ var ClassExtractor = class {
|
|
|
588
623
|
extractGetterSetter(accessor) {
|
|
589
624
|
return {
|
|
590
625
|
...this.extractClassProperty(accessor),
|
|
591
|
-
memberType:
|
|
626
|
+
memberType: ts7.isGetAccessor(accessor) ? MemberType.Getter : MemberType.Setter
|
|
592
627
|
};
|
|
593
628
|
}
|
|
594
629
|
getMemberTags(member) {
|
|
@@ -610,28 +645,46 @@ var ClassExtractor = class {
|
|
|
610
645
|
}
|
|
611
646
|
getTagForMemberModifier(mod) {
|
|
612
647
|
switch (mod.kind) {
|
|
613
|
-
case
|
|
648
|
+
case ts7.SyntaxKind.StaticKeyword:
|
|
614
649
|
return MemberTags.Static;
|
|
615
|
-
case
|
|
650
|
+
case ts7.SyntaxKind.ReadonlyKeyword:
|
|
616
651
|
return MemberTags.Readonly;
|
|
617
|
-
case
|
|
652
|
+
case ts7.SyntaxKind.ProtectedKeyword:
|
|
618
653
|
return MemberTags.Protected;
|
|
654
|
+
case ts7.SyntaxKind.AbstractKeyword:
|
|
655
|
+
return MemberTags.Abstract;
|
|
619
656
|
default:
|
|
620
657
|
return void 0;
|
|
621
658
|
}
|
|
622
659
|
}
|
|
623
660
|
isMemberExcluded(member) {
|
|
624
661
|
var _a;
|
|
625
|
-
return !member.name || !this.isDocumentableMember(member) || !!((_a = member.modifiers) == null ? void 0 : _a.some((mod) => mod.kind ===
|
|
662
|
+
return !member.name || !this.isDocumentableMember(member) || !!((_a = member.modifiers) == null ? void 0 : _a.some((mod) => mod.kind === ts7.SyntaxKind.PrivateKeyword)) || isAngularPrivateName(member.name.getText());
|
|
626
663
|
}
|
|
627
664
|
isDocumentableMember(member) {
|
|
628
|
-
return this.isMethod(member) || this.isProperty(member) ||
|
|
665
|
+
return this.isMethod(member) || this.isProperty(member) || ts7.isAccessor(member);
|
|
629
666
|
}
|
|
630
667
|
isProperty(member) {
|
|
631
|
-
return
|
|
668
|
+
return ts7.isPropertyDeclaration(member) || ts7.isPropertySignature(member);
|
|
632
669
|
}
|
|
633
670
|
isMethod(member) {
|
|
634
|
-
return
|
|
671
|
+
return ts7.isMethodDeclaration(member) || ts7.isMethodSignature(member);
|
|
672
|
+
}
|
|
673
|
+
isAbstract() {
|
|
674
|
+
var _a;
|
|
675
|
+
const modifiers = (_a = this.declaration.modifiers) != null ? _a : [];
|
|
676
|
+
return modifiers.some((mod) => mod.kind === ts7.SyntaxKind.AbstractKeyword);
|
|
677
|
+
}
|
|
678
|
+
isImplementationForOverload(method) {
|
|
679
|
+
if (method.kind === ts7.SyntaxKind.MethodSignature)
|
|
680
|
+
return false;
|
|
681
|
+
const methodsWithSameName = this.declaration.members.filter((member) => {
|
|
682
|
+
var _a;
|
|
683
|
+
return ((_a = member.name) == null ? void 0 : _a.getText()) === method.name.getText();
|
|
684
|
+
}).sort((a, b) => a.pos - b.pos);
|
|
685
|
+
if (methodsWithSameName.length === 1)
|
|
686
|
+
return false;
|
|
687
|
+
return method.pos === methodsWithSameName[methodsWithSameName.length - 1].pos;
|
|
635
688
|
}
|
|
636
689
|
};
|
|
637
690
|
var DirectiveExtractor = class extends ClassExtractor {
|
|
@@ -656,6 +709,7 @@ var DirectiveExtractor = class extends ClassExtractor {
|
|
|
656
709
|
if (inputMetadata) {
|
|
657
710
|
entry.memberTags.push(MemberTags.Input);
|
|
658
711
|
entry.inputAlias = inputMetadata.bindingPropertyName;
|
|
712
|
+
entry.isRequiredInput = inputMetadata.required;
|
|
659
713
|
}
|
|
660
714
|
const outputMetadata = this.getOutputMetadata(propertyDeclaration);
|
|
661
715
|
if (outputMetadata) {
|
|
@@ -725,7 +779,7 @@ function extractInterface(declaration, typeChecker) {
|
|
|
725
779
|
return extractor.extract();
|
|
726
780
|
}
|
|
727
781
|
|
|
728
|
-
// bazel-out/
|
|
782
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/constant_extractor.mjs
|
|
729
783
|
function extractConstant(declaration, typeChecker) {
|
|
730
784
|
const resolvedType = typeChecker.getBaseTypeOfLiteralType(typeChecker.getTypeAtLocation(declaration));
|
|
731
785
|
const variableStatement = declaration.parent.parent;
|
|
@@ -743,47 +797,79 @@ function isSyntheticAngularConstant(declaration) {
|
|
|
743
797
|
return declaration.name.getText() === "USED_FOR_NG_TYPE_CHECKING";
|
|
744
798
|
}
|
|
745
799
|
|
|
746
|
-
// bazel-out/
|
|
800
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/type_alias_extractor.mjs
|
|
801
|
+
function extractTypeAlias(declaration) {
|
|
802
|
+
return {
|
|
803
|
+
name: declaration.name.getText(),
|
|
804
|
+
type: declaration.type.getText(),
|
|
805
|
+
entryType: EntryType.TypeAlias,
|
|
806
|
+
rawComment: extractRawJsDoc(declaration),
|
|
807
|
+
description: extractJsDocDescription(declaration),
|
|
808
|
+
jsdocTags: extractJsDocTags(declaration)
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/extractor.mjs
|
|
747
813
|
var DocsExtractor = class {
|
|
748
814
|
constructor(typeChecker, metadataReader) {
|
|
749
815
|
this.typeChecker = typeChecker;
|
|
750
816
|
this.metadataReader = metadataReader;
|
|
751
817
|
}
|
|
752
818
|
extractAll(sourceFile) {
|
|
753
|
-
var _a;
|
|
754
819
|
const entries = [];
|
|
755
|
-
const
|
|
756
|
-
const exportedDeclarationMap = reflector.getExportsOfModule(sourceFile);
|
|
757
|
-
const exportedDeclarations = Array.from((_a = exportedDeclarationMap == null ? void 0 : exportedDeclarationMap.entries()) != null ? _a : []).map(([exportName, declaration]) => [exportName, declaration.node]).sort(([a, declarationA], [b, declarationB]) => declarationA.pos - declarationB.pos);
|
|
820
|
+
const exportedDeclarations = this.getExportedDeclarations(sourceFile);
|
|
758
821
|
for (const [exportName, node] of exportedDeclarations) {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
}
|
|
763
|
-
if (ts7.isInterfaceDeclaration(node)) {
|
|
764
|
-
entry = extractInterface(node, this.typeChecker);
|
|
765
|
-
}
|
|
766
|
-
if (ts7.isFunctionDeclaration(node)) {
|
|
767
|
-
const functionExtractor = new FunctionExtractor(node, this.typeChecker);
|
|
768
|
-
entry = functionExtractor.extract();
|
|
769
|
-
}
|
|
770
|
-
if (ts7.isVariableDeclaration(node) && !isSyntheticAngularConstant(node)) {
|
|
771
|
-
entry = extractConstant(node, this.typeChecker);
|
|
772
|
-
}
|
|
773
|
-
if (ts7.isEnumDeclaration(node)) {
|
|
774
|
-
entry = extractEnum(node, this.typeChecker);
|
|
775
|
-
}
|
|
822
|
+
if (isAngularPrivateName(exportName))
|
|
823
|
+
continue;
|
|
824
|
+
const entry = this.extractDeclaration(node);
|
|
776
825
|
if (entry) {
|
|
777
|
-
entry
|
|
778
|
-
entries.push(entry);
|
|
826
|
+
entries.push({ ...entry, name: exportName });
|
|
779
827
|
}
|
|
780
828
|
}
|
|
781
829
|
return entries;
|
|
782
830
|
}
|
|
831
|
+
extractDeclaration(node) {
|
|
832
|
+
if (isNamedClassDeclaration(node)) {
|
|
833
|
+
return extractClass(node, this.metadataReader, this.typeChecker);
|
|
834
|
+
}
|
|
835
|
+
if (ts8.isInterfaceDeclaration(node)) {
|
|
836
|
+
return extractInterface(node, this.typeChecker);
|
|
837
|
+
}
|
|
838
|
+
if (ts8.isFunctionDeclaration(node)) {
|
|
839
|
+
const functionExtractor = new FunctionExtractor(node, this.typeChecker);
|
|
840
|
+
return functionExtractor.extract();
|
|
841
|
+
}
|
|
842
|
+
if (ts8.isVariableDeclaration(node) && !isSyntheticAngularConstant(node)) {
|
|
843
|
+
return extractConstant(node, this.typeChecker);
|
|
844
|
+
}
|
|
845
|
+
if (ts8.isTypeAliasDeclaration(node)) {
|
|
846
|
+
return extractTypeAlias(node);
|
|
847
|
+
}
|
|
848
|
+
if (ts8.isEnumDeclaration(node)) {
|
|
849
|
+
return extractEnum(node, this.typeChecker);
|
|
850
|
+
}
|
|
851
|
+
return null;
|
|
852
|
+
}
|
|
853
|
+
getExportedDeclarations(sourceFile) {
|
|
854
|
+
var _a;
|
|
855
|
+
const reflector = new TypeScriptReflectionHost(this.typeChecker);
|
|
856
|
+
const exportedDeclarationMap = reflector.getExportsOfModule(sourceFile);
|
|
857
|
+
let exportedDeclarations = Array.from((_a = exportedDeclarationMap == null ? void 0 : exportedDeclarationMap.entries()) != null ? _a : []).map(([exportName, declaration]) => [exportName, declaration.node]);
|
|
858
|
+
const declarationCount = exportedDeclarations.length;
|
|
859
|
+
for (let i = 0; i < declarationCount; i++) {
|
|
860
|
+
const [exportName, declaration] = exportedDeclarations[i];
|
|
861
|
+
if (ts8.isFunctionDeclaration(declaration)) {
|
|
862
|
+
const extractor = new FunctionExtractor(declaration, this.typeChecker);
|
|
863
|
+
const overloads = extractor.getOverloads().map((overload) => [exportName, overload]);
|
|
864
|
+
exportedDeclarations.push(...overloads);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
return exportedDeclarations.sort(([a, declarationA], [b, declarationB]) => declarationA.pos - declarationB.pos);
|
|
868
|
+
}
|
|
783
869
|
};
|
|
784
870
|
|
|
785
|
-
// bazel-out/
|
|
786
|
-
import
|
|
871
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/generator.mjs
|
|
872
|
+
import ts9 from "typescript";
|
|
787
873
|
var FlatIndexGenerator = class {
|
|
788
874
|
constructor(entryPoint, relativeFlatIndexPath, moduleName) {
|
|
789
875
|
this.entryPoint = entryPoint;
|
|
@@ -799,7 +885,7 @@ var FlatIndexGenerator = class {
|
|
|
799
885
|
|
|
800
886
|
export * from '${relativeEntryPoint}';
|
|
801
887
|
`;
|
|
802
|
-
const genFile =
|
|
888
|
+
const genFile = ts9.createSourceFile(this.flatIndexPath, contents, ts9.ScriptTarget.ES2015, true, ts9.ScriptKind.TS);
|
|
803
889
|
if (this.moduleName !== null) {
|
|
804
890
|
genFile.moduleName = this.moduleName;
|
|
805
891
|
}
|
|
@@ -807,7 +893,7 @@ export * from '${relativeEntryPoint}';
|
|
|
807
893
|
}
|
|
808
894
|
};
|
|
809
895
|
|
|
810
|
-
// bazel-out/
|
|
896
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/logic.mjs
|
|
811
897
|
function findFlatIndexEntryPoint(rootFiles) {
|
|
812
898
|
const tsFiles = rootFiles.filter((file) => isNonDeclarationTsPath(file));
|
|
813
899
|
let resolvedEntryPoint = null;
|
|
@@ -823,8 +909,8 @@ function findFlatIndexEntryPoint(rootFiles) {
|
|
|
823
909
|
return resolvedEntryPoint;
|
|
824
910
|
}
|
|
825
911
|
|
|
826
|
-
// bazel-out/
|
|
827
|
-
import
|
|
912
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/private_export_checker.mjs
|
|
913
|
+
import ts10 from "typescript";
|
|
828
914
|
function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
829
915
|
const diagnostics = [];
|
|
830
916
|
const topLevelExports = /* @__PURE__ */ new Set();
|
|
@@ -834,7 +920,7 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
|
834
920
|
}
|
|
835
921
|
const exportedSymbols = checker.getExportsOfModule(moduleSymbol);
|
|
836
922
|
exportedSymbols.forEach((symbol) => {
|
|
837
|
-
if (symbol.flags &
|
|
923
|
+
if (symbol.flags & ts10.SymbolFlags.Alias) {
|
|
838
924
|
symbol = checker.getAliasedSymbol(symbol);
|
|
839
925
|
}
|
|
840
926
|
const decl = symbol.valueDeclaration;
|
|
@@ -858,7 +944,7 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
|
858
944
|
visibleVia = transitivePath.map((seg) => getNameOfDeclaration(seg)).join(" -> ");
|
|
859
945
|
}
|
|
860
946
|
const diagnostic = {
|
|
861
|
-
category:
|
|
947
|
+
category: ts10.DiagnosticCategory.Error,
|
|
862
948
|
code: ngErrorCode(ErrorCode.SYMBOL_NOT_EXPORTED),
|
|
863
949
|
file: transitiveReference.getSourceFile(),
|
|
864
950
|
...getPosOfDeclaration(transitiveReference),
|
|
@@ -878,7 +964,7 @@ function getPosOfDeclaration(decl) {
|
|
|
878
964
|
};
|
|
879
965
|
}
|
|
880
966
|
function getIdentifierOfDeclaration(decl) {
|
|
881
|
-
if ((
|
|
967
|
+
if ((ts10.isClassDeclaration(decl) || ts10.isVariableDeclaration(decl) || ts10.isFunctionDeclaration(decl)) && decl.name !== void 0 && ts10.isIdentifier(decl.name)) {
|
|
882
968
|
return decl.name;
|
|
883
969
|
} else {
|
|
884
970
|
return null;
|
|
@@ -890,20 +976,20 @@ function getNameOfDeclaration(decl) {
|
|
|
890
976
|
}
|
|
891
977
|
function getDescriptorOfDeclaration(decl) {
|
|
892
978
|
switch (decl.kind) {
|
|
893
|
-
case
|
|
979
|
+
case ts10.SyntaxKind.ClassDeclaration:
|
|
894
980
|
return "class";
|
|
895
|
-
case
|
|
981
|
+
case ts10.SyntaxKind.FunctionDeclaration:
|
|
896
982
|
return "function";
|
|
897
|
-
case
|
|
983
|
+
case ts10.SyntaxKind.VariableDeclaration:
|
|
898
984
|
return "variable";
|
|
899
|
-
case
|
|
985
|
+
case ts10.SyntaxKind.EnumDeclaration:
|
|
900
986
|
return "enum";
|
|
901
987
|
default:
|
|
902
988
|
return "declaration";
|
|
903
989
|
}
|
|
904
990
|
}
|
|
905
991
|
|
|
906
|
-
// bazel-out/
|
|
992
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/reference_graph.mjs
|
|
907
993
|
var ReferenceGraph = class {
|
|
908
994
|
constructor() {
|
|
909
995
|
this.references = /* @__PURE__ */ new Map();
|
|
@@ -957,7 +1043,7 @@ var ReferenceGraph = class {
|
|
|
957
1043
|
}
|
|
958
1044
|
};
|
|
959
1045
|
|
|
960
|
-
// bazel-out/
|
|
1046
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/api.mjs
|
|
961
1047
|
var NgOriginalFile = Symbol("NgOriginalFile");
|
|
962
1048
|
var UpdateMode;
|
|
963
1049
|
(function(UpdateMode2) {
|
|
@@ -965,13 +1051,13 @@ var UpdateMode;
|
|
|
965
1051
|
UpdateMode2[UpdateMode2["Incremental"] = 1] = "Incremental";
|
|
966
1052
|
})(UpdateMode || (UpdateMode = {}));
|
|
967
1053
|
|
|
968
|
-
// bazel-out/
|
|
969
|
-
import
|
|
1054
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
1055
|
+
import ts12 from "typescript";
|
|
970
1056
|
|
|
971
|
-
// bazel-out/
|
|
972
|
-
import
|
|
1057
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
1058
|
+
import ts11 from "typescript";
|
|
973
1059
|
|
|
974
|
-
// bazel-out/
|
|
1060
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/expando.mjs
|
|
975
1061
|
var NgExtension = Symbol("NgExtension");
|
|
976
1062
|
function isExtended(sf) {
|
|
977
1063
|
return sf[NgExtension] !== void 0;
|
|
@@ -1031,13 +1117,13 @@ function retagTsFile(sf) {
|
|
|
1031
1117
|
}
|
|
1032
1118
|
}
|
|
1033
1119
|
|
|
1034
|
-
// bazel-out/
|
|
1120
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/util.mjs
|
|
1035
1121
|
var TS_EXTENSIONS = /\.tsx?$/i;
|
|
1036
1122
|
function makeShimFileName(fileName, suffix) {
|
|
1037
1123
|
return absoluteFrom(fileName.replace(TS_EXTENSIONS, suffix));
|
|
1038
1124
|
}
|
|
1039
1125
|
|
|
1040
|
-
// bazel-out/
|
|
1126
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
1041
1127
|
var ShimAdapter = class {
|
|
1042
1128
|
constructor(delegate, tsRootFiles, topLevelGenerators, perFileGenerators, oldProgram) {
|
|
1043
1129
|
this.delegate = delegate;
|
|
@@ -1100,10 +1186,10 @@ var ShimAdapter = class {
|
|
|
1100
1186
|
}
|
|
1101
1187
|
const prefix = match[1];
|
|
1102
1188
|
let baseFileName = absoluteFrom(prefix + ".ts");
|
|
1103
|
-
let inputFile = this.delegate.getSourceFile(baseFileName,
|
|
1189
|
+
let inputFile = this.delegate.getSourceFile(baseFileName, ts11.ScriptTarget.Latest);
|
|
1104
1190
|
if (inputFile === void 0) {
|
|
1105
1191
|
baseFileName = absoluteFrom(prefix + ".tsx");
|
|
1106
|
-
inputFile = this.delegate.getSourceFile(baseFileName,
|
|
1192
|
+
inputFile = this.delegate.getSourceFile(baseFileName, ts11.ScriptTarget.Latest);
|
|
1107
1193
|
}
|
|
1108
1194
|
if (inputFile === void 0 || isShim(inputFile)) {
|
|
1109
1195
|
return void 0;
|
|
@@ -1132,7 +1218,7 @@ var ShimAdapter = class {
|
|
|
1132
1218
|
}
|
|
1133
1219
|
};
|
|
1134
1220
|
|
|
1135
|
-
// bazel-out/
|
|
1221
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/reference_tagger.mjs
|
|
1136
1222
|
var ShimReferenceTagger = class {
|
|
1137
1223
|
constructor(shimExtensions) {
|
|
1138
1224
|
this.tagged = /* @__PURE__ */ new Set();
|
|
@@ -1166,7 +1252,7 @@ var ShimReferenceTagger = class {
|
|
|
1166
1252
|
}
|
|
1167
1253
|
};
|
|
1168
1254
|
|
|
1169
|
-
// bazel-out/
|
|
1255
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
1170
1256
|
var DelegatingCompilerHost = class {
|
|
1171
1257
|
constructor(delegate) {
|
|
1172
1258
|
this.delegate = delegate;
|
|
@@ -1258,7 +1344,7 @@ var TsCreateProgramDriver = class {
|
|
|
1258
1344
|
this.sfMap.clear();
|
|
1259
1345
|
}
|
|
1260
1346
|
for (const [filePath, { newText, originalFile }] of contents.entries()) {
|
|
1261
|
-
const sf =
|
|
1347
|
+
const sf = ts12.createSourceFile(filePath, newText, ts12.ScriptTarget.Latest, true);
|
|
1262
1348
|
if (originalFile !== null) {
|
|
1263
1349
|
sf[NgOriginalFile] = originalFile;
|
|
1264
1350
|
}
|
|
@@ -1267,7 +1353,7 @@ var TsCreateProgramDriver = class {
|
|
|
1267
1353
|
const host = new UpdatedProgramHost(this.sfMap, this.originalProgram, this.originalHost, this.shimExtensionPrefixes);
|
|
1268
1354
|
const oldProgram = this.program;
|
|
1269
1355
|
retagAllTsFiles(oldProgram);
|
|
1270
|
-
this.program =
|
|
1356
|
+
this.program = ts12.createProgram({
|
|
1271
1357
|
host,
|
|
1272
1358
|
rootNames: this.program.getRootFileNames(),
|
|
1273
1359
|
options: this.options,
|
|
@@ -1279,7 +1365,7 @@ var TsCreateProgramDriver = class {
|
|
|
1279
1365
|
}
|
|
1280
1366
|
};
|
|
1281
1367
|
|
|
1282
|
-
// bazel-out/
|
|
1368
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/dependency_tracking.mjs
|
|
1283
1369
|
var FileDependencyGraph = class {
|
|
1284
1370
|
constructor() {
|
|
1285
1371
|
this.nodes = /* @__PURE__ */ new Map();
|
|
@@ -1346,7 +1432,7 @@ function isLogicallyChanged(sf, node, changedTsPaths, deletedTsPaths, changedRes
|
|
|
1346
1432
|
return false;
|
|
1347
1433
|
}
|
|
1348
1434
|
|
|
1349
|
-
// bazel-out/
|
|
1435
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/state.mjs
|
|
1350
1436
|
var IncrementalStateKind;
|
|
1351
1437
|
(function(IncrementalStateKind2) {
|
|
1352
1438
|
IncrementalStateKind2[IncrementalStateKind2["Fresh"] = 0] = "Fresh";
|
|
@@ -1354,7 +1440,7 @@ var IncrementalStateKind;
|
|
|
1354
1440
|
IncrementalStateKind2[IncrementalStateKind2["Analyzed"] = 2] = "Analyzed";
|
|
1355
1441
|
})(IncrementalStateKind || (IncrementalStateKind = {}));
|
|
1356
1442
|
|
|
1357
|
-
// bazel-out/
|
|
1443
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/incremental.mjs
|
|
1358
1444
|
var PhaseKind;
|
|
1359
1445
|
(function(PhaseKind2) {
|
|
1360
1446
|
PhaseKind2[PhaseKind2["Analysis"] = 0] = "Analysis";
|
|
@@ -1555,7 +1641,7 @@ function toOriginalSourceFile(sf) {
|
|
|
1555
1641
|
}
|
|
1556
1642
|
}
|
|
1557
1643
|
|
|
1558
|
-
// bazel-out/
|
|
1644
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/strategy.mjs
|
|
1559
1645
|
var TrackedIncrementalBuildStrategy = class {
|
|
1560
1646
|
constructor() {
|
|
1561
1647
|
this.state = null;
|
|
@@ -1591,7 +1677,7 @@ var PatchedProgramIncrementalBuildStrategy = class {
|
|
|
1591
1677
|
};
|
|
1592
1678
|
var SYM_INCREMENTAL_STATE = Symbol("NgIncrementalState");
|
|
1593
1679
|
|
|
1594
|
-
// bazel-out/
|
|
1680
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/api.mjs
|
|
1595
1681
|
var IdentifierKind;
|
|
1596
1682
|
(function(IdentifierKind2) {
|
|
1597
1683
|
IdentifierKind2[IdentifierKind2["Property"] = 0] = "Property";
|
|
@@ -1609,7 +1695,7 @@ var AbsoluteSourceSpan = class {
|
|
|
1609
1695
|
}
|
|
1610
1696
|
};
|
|
1611
1697
|
|
|
1612
|
-
// bazel-out/
|
|
1698
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/context.mjs
|
|
1613
1699
|
var IndexingContext = class {
|
|
1614
1700
|
constructor() {
|
|
1615
1701
|
this.components = /* @__PURE__ */ new Set();
|
|
@@ -1619,10 +1705,10 @@ var IndexingContext = class {
|
|
|
1619
1705
|
}
|
|
1620
1706
|
};
|
|
1621
1707
|
|
|
1622
|
-
// bazel-out/
|
|
1708
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/transform.mjs
|
|
1623
1709
|
import { ParseSourceFile } from "@angular/compiler";
|
|
1624
1710
|
|
|
1625
|
-
// bazel-out/
|
|
1711
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/template.mjs
|
|
1626
1712
|
import { ASTWithSource, ImplicitReceiver, PropertyRead, PropertyWrite, RecursiveAstVisitor, TmplAstBoundDeferredTrigger, TmplAstElement, TmplAstRecursiveVisitor, TmplAstReference, TmplAstTemplate } from "@angular/compiler";
|
|
1627
1713
|
var ExpressionVisitor = class extends RecursiveAstVisitor {
|
|
1628
1714
|
constructor(expressionStr, absoluteOffset, boundTemplate, targetToIdentifier) {
|
|
@@ -1904,7 +1990,7 @@ function getTemplateIdentifiers(boundTemplate) {
|
|
|
1904
1990
|
return { identifiers: visitor.identifiers, errors: visitor.errors };
|
|
1905
1991
|
}
|
|
1906
1992
|
|
|
1907
|
-
// bazel-out/
|
|
1993
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/transform.mjs
|
|
1908
1994
|
function generateAnalysis(context) {
|
|
1909
1995
|
const analysis = /* @__PURE__ */ new Map();
|
|
1910
1996
|
context.components.forEach(({ declaration, selector, boundTemplate, templateMeta }) => {
|
|
@@ -1940,7 +2026,7 @@ function generateAnalysis(context) {
|
|
|
1940
2026
|
return analysis;
|
|
1941
2027
|
}
|
|
1942
2028
|
|
|
1943
|
-
// bazel-out/
|
|
2029
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/ng_module_index.mjs
|
|
1944
2030
|
var NgModuleIndexImpl = class {
|
|
1945
2031
|
constructor(metaReader, localReader) {
|
|
1946
2032
|
this.metaReader = metaReader;
|
|
@@ -2029,8 +2115,8 @@ var NgModuleIndexImpl = class {
|
|
|
2029
2115
|
}
|
|
2030
2116
|
};
|
|
2031
2117
|
|
|
2032
|
-
// bazel-out/
|
|
2033
|
-
import
|
|
2118
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/resource/src/loader.mjs
|
|
2119
|
+
import ts13 from "typescript";
|
|
2034
2120
|
var CSS_PREPROCESSOR_EXT = /(\.scss|\.sass|\.less|\.styl)$/;
|
|
2035
2121
|
var RESOURCE_MARKER = ".$ngresource$";
|
|
2036
2122
|
var RESOURCE_MARKER_TS = RESOURCE_MARKER + ".ts";
|
|
@@ -2140,7 +2226,7 @@ var AdapterResourceLoader = class {
|
|
|
2140
2226
|
return this.adapter.rootDirs.map((rootDir) => join(rootDir, segment));
|
|
2141
2227
|
}
|
|
2142
2228
|
getResolvedCandidateLocations(url, fromFile) {
|
|
2143
|
-
const failedLookup =
|
|
2229
|
+
const failedLookup = ts13.resolveModuleName(url + RESOURCE_MARKER, fromFile, this.options, this.lookupResolutionHost);
|
|
2144
2230
|
if (failedLookup.failedLookupLocations === void 0) {
|
|
2145
2231
|
throw new Error(`Internal error: expected to find failedLookupLocations during resolution of resource '${url}' in context of ${fromFile}`);
|
|
2146
2232
|
}
|
|
@@ -2175,7 +2261,7 @@ function createLookupResolutionHost(adapter) {
|
|
|
2175
2261
|
};
|
|
2176
2262
|
}
|
|
2177
2263
|
|
|
2178
|
-
// bazel-out/
|
|
2264
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/standalone.mjs
|
|
2179
2265
|
var StandaloneComponentScopeReader = class {
|
|
2180
2266
|
constructor(metaReader, localModuleReader, dtsModuleReader) {
|
|
2181
2267
|
this.metaReader = metaReader;
|
|
@@ -2253,11 +2339,11 @@ var StandaloneComponentScopeReader = class {
|
|
|
2253
2339
|
}
|
|
2254
2340
|
};
|
|
2255
2341
|
|
|
2256
|
-
// bazel-out/
|
|
2342
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
|
|
2257
2343
|
import { CssSelector, DomElementSchemaRegistry as DomElementSchemaRegistry2, ExternalExpr as ExternalExpr2, WrappedNodeExpr } from "@angular/compiler";
|
|
2258
2344
|
|
|
2259
|
-
// bazel-out/
|
|
2260
|
-
import
|
|
2345
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/diagnostic.mjs
|
|
2346
|
+
import ts14 from "typescript";
|
|
2261
2347
|
function makeTemplateDiagnostic(templateId, mapping, span, category, code, messageText, relatedMessages) {
|
|
2262
2348
|
var _a;
|
|
2263
2349
|
if (mapping.type === "direct") {
|
|
@@ -2266,7 +2352,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
2266
2352
|
relatedInformation = [];
|
|
2267
2353
|
for (const relatedMessage of relatedMessages) {
|
|
2268
2354
|
relatedInformation.push({
|
|
2269
|
-
category:
|
|
2355
|
+
category: ts14.DiagnosticCategory.Message,
|
|
2270
2356
|
code: 0,
|
|
2271
2357
|
file: relatedMessage.sourceFile,
|
|
2272
2358
|
start: relatedMessage.start,
|
|
@@ -2295,7 +2381,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
2295
2381
|
if (relatedMessages !== void 0) {
|
|
2296
2382
|
for (const relatedMessage of relatedMessages) {
|
|
2297
2383
|
relatedInformation.push({
|
|
2298
|
-
category:
|
|
2384
|
+
category: ts14.DiagnosticCategory.Message,
|
|
2299
2385
|
code: 0,
|
|
2300
2386
|
file: relatedMessage.sourceFile,
|
|
2301
2387
|
start: relatedMessage.start,
|
|
@@ -2325,7 +2411,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
2325
2411
|
};
|
|
2326
2412
|
}
|
|
2327
2413
|
relatedInformation.push({
|
|
2328
|
-
category:
|
|
2414
|
+
category: ts14.DiagnosticCategory.Message,
|
|
2329
2415
|
code: 0,
|
|
2330
2416
|
file: componentSf,
|
|
2331
2417
|
start: mapping.node.getStart(),
|
|
@@ -2360,10 +2446,10 @@ function parseTemplateAsSourceFile(fileName, template) {
|
|
|
2360
2446
|
if (parseTemplateAsSourceFileForTest !== null) {
|
|
2361
2447
|
return parseTemplateAsSourceFileForTest(fileName, template);
|
|
2362
2448
|
}
|
|
2363
|
-
return
|
|
2449
|
+
return ts14.createSourceFile(fileName, template, ts14.ScriptTarget.Latest, false, ts14.ScriptKind.JSX);
|
|
2364
2450
|
}
|
|
2365
2451
|
|
|
2366
|
-
// bazel-out/
|
|
2452
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/id.mjs
|
|
2367
2453
|
var TEMPLATE_ID = Symbol("ngTemplateId");
|
|
2368
2454
|
var NEXT_TEMPLATE_ID = Symbol("ngNextTemplateId");
|
|
2369
2455
|
function getTemplateId(clazz) {
|
|
@@ -2380,17 +2466,17 @@ function allocateTemplateId(sf) {
|
|
|
2380
2466
|
return `tcb${sf[NEXT_TEMPLATE_ID]++}`;
|
|
2381
2467
|
}
|
|
2382
2468
|
|
|
2383
|
-
// bazel-out/
|
|
2469
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
2384
2470
|
import { EmptyExpr, ImplicitReceiver as ImplicitReceiver2, PropertyRead as PropertyRead2, PropertyWrite as PropertyWrite2, SafePropertyRead, TmplAstReference as TmplAstReference2, TmplAstTextAttribute } from "@angular/compiler";
|
|
2385
|
-
import
|
|
2471
|
+
import ts16 from "typescript";
|
|
2386
2472
|
|
|
2387
|
-
// bazel-out/
|
|
2473
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/comments.mjs
|
|
2388
2474
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan2 } from "@angular/compiler";
|
|
2389
|
-
import
|
|
2475
|
+
import ts15 from "typescript";
|
|
2390
2476
|
var parseSpanComment = /^(\d+),(\d+)$/;
|
|
2391
2477
|
function readSpanComment(node, sourceFile = node.getSourceFile()) {
|
|
2392
|
-
return
|
|
2393
|
-
if (kind !==
|
|
2478
|
+
return ts15.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
2479
|
+
if (kind !== ts15.SyntaxKind.MultiLineCommentTrivia) {
|
|
2394
2480
|
return null;
|
|
2395
2481
|
}
|
|
2396
2482
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -2413,25 +2499,25 @@ var ExpressionIdentifier;
|
|
|
2413
2499
|
ExpressionIdentifier2["EVENT_PARAMETER"] = "EP";
|
|
2414
2500
|
})(ExpressionIdentifier || (ExpressionIdentifier = {}));
|
|
2415
2501
|
function addExpressionIdentifier(node, identifier) {
|
|
2416
|
-
|
|
2502
|
+
ts15.addSyntheticTrailingComment(
|
|
2417
2503
|
node,
|
|
2418
|
-
|
|
2504
|
+
ts15.SyntaxKind.MultiLineCommentTrivia,
|
|
2419
2505
|
`${CommentTriviaType.EXPRESSION_TYPE_IDENTIFIER}:${identifier}`,
|
|
2420
2506
|
false
|
|
2421
2507
|
);
|
|
2422
2508
|
}
|
|
2423
2509
|
var IGNORE_FOR_DIAGNOSTICS_MARKER = `${CommentTriviaType.DIAGNOSTIC}:ignore`;
|
|
2424
2510
|
function markIgnoreDiagnostics(node) {
|
|
2425
|
-
|
|
2511
|
+
ts15.addSyntheticTrailingComment(
|
|
2426
2512
|
node,
|
|
2427
|
-
|
|
2513
|
+
ts15.SyntaxKind.MultiLineCommentTrivia,
|
|
2428
2514
|
IGNORE_FOR_DIAGNOSTICS_MARKER,
|
|
2429
2515
|
false
|
|
2430
2516
|
);
|
|
2431
2517
|
}
|
|
2432
2518
|
function hasIgnoreForDiagnosticsMarker(node, sourceFile) {
|
|
2433
|
-
return
|
|
2434
|
-
if (kind !==
|
|
2519
|
+
return ts15.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
2520
|
+
if (kind !== ts15.SyntaxKind.MultiLineCommentTrivia) {
|
|
2435
2521
|
return null;
|
|
2436
2522
|
}
|
|
2437
2523
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -2505,8 +2591,8 @@ function findAllMatchingNodes(tcb, opts) {
|
|
|
2505
2591
|
return results;
|
|
2506
2592
|
}
|
|
2507
2593
|
function hasExpressionIdentifier(sourceFile, node, identifier) {
|
|
2508
|
-
return
|
|
2509
|
-
if (kind !==
|
|
2594
|
+
return ts15.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
2595
|
+
if (kind !== ts15.SyntaxKind.MultiLineCommentTrivia) {
|
|
2510
2596
|
return false;
|
|
2511
2597
|
}
|
|
2512
2598
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -2514,7 +2600,7 @@ function hasExpressionIdentifier(sourceFile, node, identifier) {
|
|
|
2514
2600
|
}) || false;
|
|
2515
2601
|
}
|
|
2516
2602
|
|
|
2517
|
-
// bazel-out/
|
|
2603
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
2518
2604
|
var CompletionEngine = class {
|
|
2519
2605
|
constructor(tcb, data, tcbPath, tcbIsShim) {
|
|
2520
2606
|
this.tcb = tcb;
|
|
@@ -2524,7 +2610,7 @@ var CompletionEngine = class {
|
|
|
2524
2610
|
this.templateContextCache = /* @__PURE__ */ new Map();
|
|
2525
2611
|
this.expressionCompletionCache = /* @__PURE__ */ new Map();
|
|
2526
2612
|
const globalRead = findFirstMatchingNode(this.tcb, {
|
|
2527
|
-
filter:
|
|
2613
|
+
filter: ts16.isPropertyAccessExpression,
|
|
2528
2614
|
withExpressionIdentifier: ExpressionIdentifier.COMPONENT_COMPLETION
|
|
2529
2615
|
});
|
|
2530
2616
|
if (globalRead !== null) {
|
|
@@ -2548,7 +2634,7 @@ var CompletionEngine = class {
|
|
|
2548
2634
|
let nodeContext = null;
|
|
2549
2635
|
if (node instanceof EmptyExpr) {
|
|
2550
2636
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
2551
|
-
filter:
|
|
2637
|
+
filter: ts16.isIdentifier,
|
|
2552
2638
|
withSpan: node.sourceSpan
|
|
2553
2639
|
});
|
|
2554
2640
|
if (nodeLocation !== null) {
|
|
@@ -2561,7 +2647,7 @@ var CompletionEngine = class {
|
|
|
2561
2647
|
}
|
|
2562
2648
|
if (node instanceof PropertyRead2 && node.receiver instanceof ImplicitReceiver2) {
|
|
2563
2649
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
2564
|
-
filter:
|
|
2650
|
+
filter: ts16.isPropertyAccessExpression,
|
|
2565
2651
|
withSpan: node.sourceSpan
|
|
2566
2652
|
});
|
|
2567
2653
|
if (nodeLocation) {
|
|
@@ -2585,21 +2671,21 @@ var CompletionEngine = class {
|
|
|
2585
2671
|
let tsExpr = null;
|
|
2586
2672
|
if (expr instanceof PropertyRead2 || expr instanceof PropertyWrite2) {
|
|
2587
2673
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
2588
|
-
filter:
|
|
2674
|
+
filter: ts16.isPropertyAccessExpression,
|
|
2589
2675
|
withSpan: expr.nameSpan
|
|
2590
2676
|
});
|
|
2591
2677
|
} else if (expr instanceof SafePropertyRead) {
|
|
2592
2678
|
const ternaryExpr = findFirstMatchingNode(this.tcb, {
|
|
2593
|
-
filter:
|
|
2679
|
+
filter: ts16.isParenthesizedExpression,
|
|
2594
2680
|
withSpan: expr.sourceSpan
|
|
2595
2681
|
});
|
|
2596
|
-
if (ternaryExpr === null || !
|
|
2682
|
+
if (ternaryExpr === null || !ts16.isConditionalExpression(ternaryExpr.expression)) {
|
|
2597
2683
|
return null;
|
|
2598
2684
|
}
|
|
2599
2685
|
const whenTrue = ternaryExpr.expression.whenTrue;
|
|
2600
|
-
if (
|
|
2686
|
+
if (ts16.isPropertyAccessExpression(whenTrue)) {
|
|
2601
2687
|
tsExpr = whenTrue;
|
|
2602
|
-
} else if (
|
|
2688
|
+
} else if (ts16.isCallExpression(whenTrue) && ts16.isPropertyAccessExpression(whenTrue.expression)) {
|
|
2603
2689
|
tsExpr = whenTrue.expression;
|
|
2604
2690
|
}
|
|
2605
2691
|
}
|
|
@@ -2621,15 +2707,15 @@ var CompletionEngine = class {
|
|
|
2621
2707
|
let tsExpr = null;
|
|
2622
2708
|
if (expr instanceof TmplAstTextAttribute) {
|
|
2623
2709
|
const strNode = findFirstMatchingNode(this.tcb, {
|
|
2624
|
-
filter:
|
|
2710
|
+
filter: ts16.isParenthesizedExpression,
|
|
2625
2711
|
withSpan: expr.sourceSpan
|
|
2626
2712
|
});
|
|
2627
|
-
if (strNode !== null &&
|
|
2713
|
+
if (strNode !== null && ts16.isStringLiteral(strNode.expression)) {
|
|
2628
2714
|
tsExpr = strNode.expression;
|
|
2629
2715
|
}
|
|
2630
2716
|
} else {
|
|
2631
2717
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
2632
|
-
filter: (n) =>
|
|
2718
|
+
filter: (n) => ts16.isStringLiteral(n) || ts16.isNumericLiteral(n),
|
|
2633
2719
|
withSpan: expr.sourceSpan
|
|
2634
2720
|
});
|
|
2635
2721
|
}
|
|
@@ -2637,7 +2723,7 @@ var CompletionEngine = class {
|
|
|
2637
2723
|
return null;
|
|
2638
2724
|
}
|
|
2639
2725
|
let positionInShimFile = tsExpr.getEnd();
|
|
2640
|
-
if (
|
|
2726
|
+
if (ts16.isStringLiteral(tsExpr)) {
|
|
2641
2727
|
positionInShimFile -= 1;
|
|
2642
2728
|
}
|
|
2643
2729
|
const res = {
|
|
@@ -2671,12 +2757,12 @@ var CompletionEngine = class {
|
|
|
2671
2757
|
}
|
|
2672
2758
|
};
|
|
2673
2759
|
|
|
2674
|
-
// bazel-out/
|
|
2675
|
-
import
|
|
2760
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
|
|
2761
|
+
import ts30 from "typescript";
|
|
2676
2762
|
|
|
2677
|
-
// bazel-out/
|
|
2763
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/dom.mjs
|
|
2678
2764
|
import { DomElementSchemaRegistry } from "@angular/compiler";
|
|
2679
|
-
import
|
|
2765
|
+
import ts17 from "typescript";
|
|
2680
2766
|
var REGISTRY = new DomElementSchemaRegistry();
|
|
2681
2767
|
var REMOVE_XHTML_REGEX = /^:xhtml:/;
|
|
2682
2768
|
var RegistryDomSchemaChecker = class {
|
|
@@ -2701,7 +2787,7 @@ var RegistryDomSchemaChecker = class {
|
|
|
2701
2787
|
} else {
|
|
2702
2788
|
errorMsg += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas2} of this component.`;
|
|
2703
2789
|
}
|
|
2704
|
-
const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan,
|
|
2790
|
+
const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan, ts17.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ELEMENT), errorMsg);
|
|
2705
2791
|
this._diagnostics.push(diag);
|
|
2706
2792
|
}
|
|
2707
2793
|
}
|
|
@@ -2721,101 +2807,101 @@ var RegistryDomSchemaChecker = class {
|
|
|
2721
2807
|
2. If '${element.name}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas2} of this component to suppress this message.
|
|
2722
2808
|
3. To allow any property add 'NO_ERRORS_SCHEMA' to the ${schemas2} of this component.`;
|
|
2723
2809
|
}
|
|
2724
|
-
const diag = makeTemplateDiagnostic(id, mapping, span,
|
|
2810
|
+
const diag = makeTemplateDiagnostic(id, mapping, span, ts17.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ATTRIBUTE), errorMsg);
|
|
2725
2811
|
this._diagnostics.push(diag);
|
|
2726
2812
|
}
|
|
2727
2813
|
}
|
|
2728
2814
|
};
|
|
2729
2815
|
|
|
2730
|
-
// bazel-out/
|
|
2816
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
|
|
2731
2817
|
import { ExpressionType, ExternalExpr, TypeModifier } from "@angular/compiler";
|
|
2732
|
-
import
|
|
2818
|
+
import ts23 from "typescript";
|
|
2733
2819
|
|
|
2734
|
-
// bazel-out/
|
|
2735
|
-
import
|
|
2820
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/ts_util.mjs
|
|
2821
|
+
import ts18 from "typescript";
|
|
2736
2822
|
var SAFE_TO_CAST_WITHOUT_PARENS = /* @__PURE__ */ new Set([
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2823
|
+
ts18.SyntaxKind.ParenthesizedExpression,
|
|
2824
|
+
ts18.SyntaxKind.Identifier,
|
|
2825
|
+
ts18.SyntaxKind.CallExpression,
|
|
2826
|
+
ts18.SyntaxKind.NonNullExpression,
|
|
2827
|
+
ts18.SyntaxKind.ElementAccessExpression,
|
|
2828
|
+
ts18.SyntaxKind.PropertyAccessExpression,
|
|
2829
|
+
ts18.SyntaxKind.ArrayLiteralExpression,
|
|
2830
|
+
ts18.SyntaxKind.ObjectLiteralExpression,
|
|
2831
|
+
ts18.SyntaxKind.StringLiteral,
|
|
2832
|
+
ts18.SyntaxKind.NumericLiteral,
|
|
2833
|
+
ts18.SyntaxKind.TrueKeyword,
|
|
2834
|
+
ts18.SyntaxKind.FalseKeyword,
|
|
2835
|
+
ts18.SyntaxKind.NullKeyword,
|
|
2836
|
+
ts18.SyntaxKind.UndefinedKeyword
|
|
2751
2837
|
]);
|
|
2752
2838
|
function tsCastToAny(expr) {
|
|
2753
2839
|
if (!SAFE_TO_CAST_WITHOUT_PARENS.has(expr.kind)) {
|
|
2754
|
-
expr =
|
|
2840
|
+
expr = ts18.factory.createParenthesizedExpression(expr);
|
|
2755
2841
|
}
|
|
2756
|
-
return
|
|
2842
|
+
return ts18.factory.createParenthesizedExpression(ts18.factory.createAsExpression(expr, ts18.factory.createKeywordTypeNode(ts18.SyntaxKind.AnyKeyword)));
|
|
2757
2843
|
}
|
|
2758
2844
|
function tsCreateElement(tagName) {
|
|
2759
|
-
const createElement =
|
|
2760
|
-
|
|
2845
|
+
const createElement = ts18.factory.createPropertyAccessExpression(
|
|
2846
|
+
ts18.factory.createIdentifier("document"),
|
|
2761
2847
|
"createElement"
|
|
2762
2848
|
);
|
|
2763
|
-
return
|
|
2849
|
+
return ts18.factory.createCallExpression(
|
|
2764
2850
|
createElement,
|
|
2765
2851
|
void 0,
|
|
2766
|
-
[
|
|
2852
|
+
[ts18.factory.createStringLiteral(tagName)]
|
|
2767
2853
|
);
|
|
2768
2854
|
}
|
|
2769
2855
|
function tsDeclareVariable(id, type) {
|
|
2770
|
-
const decl =
|
|
2856
|
+
const decl = ts18.factory.createVariableDeclaration(
|
|
2771
2857
|
id,
|
|
2772
2858
|
void 0,
|
|
2773
2859
|
type,
|
|
2774
|
-
|
|
2860
|
+
ts18.factory.createNonNullExpression(ts18.factory.createNull())
|
|
2775
2861
|
);
|
|
2776
|
-
return
|
|
2862
|
+
return ts18.factory.createVariableStatement(
|
|
2777
2863
|
void 0,
|
|
2778
2864
|
[decl]
|
|
2779
2865
|
);
|
|
2780
2866
|
}
|
|
2781
2867
|
function tsCreateTypeQueryForCoercedInput(typeName, coercedInputName) {
|
|
2782
|
-
return
|
|
2868
|
+
return ts18.factory.createTypeQueryNode(ts18.factory.createQualifiedName(typeName, `ngAcceptInputType_${coercedInputName}`));
|
|
2783
2869
|
}
|
|
2784
2870
|
function tsCreateVariable(id, initializer) {
|
|
2785
|
-
const decl =
|
|
2871
|
+
const decl = ts18.factory.createVariableDeclaration(
|
|
2786
2872
|
id,
|
|
2787
2873
|
void 0,
|
|
2788
2874
|
void 0,
|
|
2789
2875
|
initializer
|
|
2790
2876
|
);
|
|
2791
|
-
return
|
|
2877
|
+
return ts18.factory.createVariableStatement(
|
|
2792
2878
|
void 0,
|
|
2793
2879
|
[decl]
|
|
2794
2880
|
);
|
|
2795
2881
|
}
|
|
2796
2882
|
function tsCallMethod(receiver, methodName, args = []) {
|
|
2797
|
-
const methodAccess =
|
|
2798
|
-
return
|
|
2883
|
+
const methodAccess = ts18.factory.createPropertyAccessExpression(receiver, methodName);
|
|
2884
|
+
return ts18.factory.createCallExpression(
|
|
2799
2885
|
methodAccess,
|
|
2800
2886
|
void 0,
|
|
2801
2887
|
args
|
|
2802
2888
|
);
|
|
2803
2889
|
}
|
|
2804
2890
|
function isAccessExpression(node) {
|
|
2805
|
-
return
|
|
2891
|
+
return ts18.isPropertyAccessExpression(node) || ts18.isElementAccessExpression(node);
|
|
2806
2892
|
}
|
|
2807
2893
|
|
|
2808
|
-
// bazel-out/
|
|
2894
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
2895
|
+
import ts22 from "typescript";
|
|
2896
|
+
|
|
2897
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
2809
2898
|
import ts21 from "typescript";
|
|
2810
2899
|
|
|
2811
|
-
// bazel-out/
|
|
2900
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
|
|
2812
2901
|
import ts20 from "typescript";
|
|
2813
2902
|
|
|
2814
|
-
// bazel-out/
|
|
2903
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_emitter.mjs
|
|
2815
2904
|
import ts19 from "typescript";
|
|
2816
|
-
|
|
2817
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_emitter.mjs
|
|
2818
|
-
import ts18 from "typescript";
|
|
2819
2905
|
var INELIGIBLE = {};
|
|
2820
2906
|
function canEmitType(type, canEmit) {
|
|
2821
2907
|
return canEmitTypeWorker(type);
|
|
@@ -2823,13 +2909,13 @@ function canEmitType(type, canEmit) {
|
|
|
2823
2909
|
return visitNode(type2) !== INELIGIBLE;
|
|
2824
2910
|
}
|
|
2825
2911
|
function visitNode(node) {
|
|
2826
|
-
if (
|
|
2912
|
+
if (ts19.isImportTypeNode(node)) {
|
|
2827
2913
|
return INELIGIBLE;
|
|
2828
2914
|
}
|
|
2829
|
-
if (
|
|
2915
|
+
if (ts19.isTypeReferenceNode(node) && !canEmitTypeReference(node)) {
|
|
2830
2916
|
return INELIGIBLE;
|
|
2831
2917
|
} else {
|
|
2832
|
-
return
|
|
2918
|
+
return ts19.forEachChild(node, visitNode);
|
|
2833
2919
|
}
|
|
2834
2920
|
}
|
|
2835
2921
|
function canEmitTypeReference(type2) {
|
|
@@ -2846,35 +2932,35 @@ var TypeEmitter = class {
|
|
|
2846
2932
|
emitType(type) {
|
|
2847
2933
|
const typeReferenceTransformer = (context) => {
|
|
2848
2934
|
const visitNode = (node) => {
|
|
2849
|
-
if (
|
|
2935
|
+
if (ts19.isImportTypeNode(node)) {
|
|
2850
2936
|
throw new Error("Unable to emit import type");
|
|
2851
2937
|
}
|
|
2852
|
-
if (
|
|
2938
|
+
if (ts19.isTypeReferenceNode(node)) {
|
|
2853
2939
|
return this.emitTypeReference(node);
|
|
2854
|
-
} else if (
|
|
2940
|
+
} else if (ts19.isLiteralExpression(node)) {
|
|
2855
2941
|
let clone;
|
|
2856
|
-
if (
|
|
2857
|
-
clone =
|
|
2858
|
-
} else if (
|
|
2859
|
-
clone =
|
|
2860
|
-
} else if (
|
|
2861
|
-
clone =
|
|
2862
|
-
} else if (
|
|
2863
|
-
clone =
|
|
2864
|
-
} else if (
|
|
2865
|
-
clone =
|
|
2942
|
+
if (ts19.isStringLiteral(node)) {
|
|
2943
|
+
clone = ts19.factory.createStringLiteral(node.text);
|
|
2944
|
+
} else if (ts19.isNumericLiteral(node)) {
|
|
2945
|
+
clone = ts19.factory.createNumericLiteral(node.text);
|
|
2946
|
+
} else if (ts19.isBigIntLiteral(node)) {
|
|
2947
|
+
clone = ts19.factory.createBigIntLiteral(node.text);
|
|
2948
|
+
} else if (ts19.isNoSubstitutionTemplateLiteral(node)) {
|
|
2949
|
+
clone = ts19.factory.createNoSubstitutionTemplateLiteral(node.text, node.rawText);
|
|
2950
|
+
} else if (ts19.isRegularExpressionLiteral(node)) {
|
|
2951
|
+
clone = ts19.factory.createRegularExpressionLiteral(node.text);
|
|
2866
2952
|
} else {
|
|
2867
|
-
throw new Error(`Unsupported literal kind ${
|
|
2953
|
+
throw new Error(`Unsupported literal kind ${ts19.SyntaxKind[node.kind]}`);
|
|
2868
2954
|
}
|
|
2869
|
-
|
|
2955
|
+
ts19.setTextRange(clone, { pos: -1, end: -1 });
|
|
2870
2956
|
return clone;
|
|
2871
2957
|
} else {
|
|
2872
|
-
return
|
|
2958
|
+
return ts19.visitEachChild(node, visitNode, context);
|
|
2873
2959
|
}
|
|
2874
2960
|
};
|
|
2875
|
-
return (node) =>
|
|
2961
|
+
return (node) => ts19.visitNode(node, visitNode, ts19.isTypeNode);
|
|
2876
2962
|
};
|
|
2877
|
-
return
|
|
2963
|
+
return ts19.transform(type, [typeReferenceTransformer]).transformed[0];
|
|
2878
2964
|
}
|
|
2879
2965
|
emitTypeReference(type) {
|
|
2880
2966
|
const translatedType = this.translator(type);
|
|
@@ -2883,13 +2969,13 @@ var TypeEmitter = class {
|
|
|
2883
2969
|
}
|
|
2884
2970
|
let typeArguments = void 0;
|
|
2885
2971
|
if (type.typeArguments !== void 0) {
|
|
2886
|
-
typeArguments =
|
|
2972
|
+
typeArguments = ts19.factory.createNodeArray(type.typeArguments.map((typeArg) => this.emitType(typeArg)));
|
|
2887
2973
|
}
|
|
2888
|
-
return
|
|
2974
|
+
return ts19.factory.updateTypeReferenceNode(type, translatedType.typeName, typeArguments);
|
|
2889
2975
|
}
|
|
2890
2976
|
};
|
|
2891
2977
|
|
|
2892
|
-
// bazel-out/
|
|
2978
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
|
|
2893
2979
|
var TypeParameterEmitter = class {
|
|
2894
2980
|
constructor(typeParameters, reflector) {
|
|
2895
2981
|
this.typeParameters = typeParameters;
|
|
@@ -2926,11 +3012,11 @@ var TypeParameterEmitter = class {
|
|
|
2926
3012
|
return this.typeParameters.map((typeParam) => {
|
|
2927
3013
|
const constraint = typeParam.constraint !== void 0 ? emitter.emitType(typeParam.constraint) : void 0;
|
|
2928
3014
|
const defaultType = typeParam.default !== void 0 ? emitter.emitType(typeParam.default) : void 0;
|
|
2929
|
-
return
|
|
3015
|
+
return ts20.factory.updateTypeParameterDeclaration(typeParam, typeParam.modifiers, typeParam.name, constraint, defaultType);
|
|
2930
3016
|
});
|
|
2931
3017
|
}
|
|
2932
3018
|
resolveTypeReference(type) {
|
|
2933
|
-
const target =
|
|
3019
|
+
const target = ts20.isIdentifier(type.typeName) ? type.typeName : type.typeName.right;
|
|
2934
3020
|
const declaration = this.reflector.getDeclarationOfIdentifier(target);
|
|
2935
3021
|
if (declaration === null || declaration.node === null) {
|
|
2936
3022
|
return null;
|
|
@@ -2956,8 +3042,8 @@ var TypeParameterEmitter = class {
|
|
|
2956
3042
|
if (typeNode === null) {
|
|
2957
3043
|
return null;
|
|
2958
3044
|
}
|
|
2959
|
-
if (!
|
|
2960
|
-
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${
|
|
3045
|
+
if (!ts20.isTypeReferenceNode(typeNode)) {
|
|
3046
|
+
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts20.SyntaxKind[typeNode.kind]}.`);
|
|
2961
3047
|
}
|
|
2962
3048
|
return typeNode;
|
|
2963
3049
|
}
|
|
@@ -2966,7 +3052,7 @@ var TypeParameterEmitter = class {
|
|
|
2966
3052
|
}
|
|
2967
3053
|
};
|
|
2968
3054
|
|
|
2969
|
-
// bazel-out/
|
|
3055
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
2970
3056
|
var TcbInliningRequirement;
|
|
2971
3057
|
(function(TcbInliningRequirement2) {
|
|
2972
3058
|
TcbInliningRequirement2[TcbInliningRequirement2["MustInline"] = 0] = "MustInline";
|
|
@@ -2999,14 +3085,14 @@ function getTemplateMapping(shimSf, position, resolver, isDiagnosticRequest) {
|
|
|
2999
3085
|
}
|
|
3000
3086
|
function findTypeCheckBlock(file, id, isDiagnosticRequest) {
|
|
3001
3087
|
for (const stmt of file.statements) {
|
|
3002
|
-
if (
|
|
3088
|
+
if (ts21.isFunctionDeclaration(stmt) && getTemplateId2(stmt, file, isDiagnosticRequest) === id) {
|
|
3003
3089
|
return stmt;
|
|
3004
3090
|
}
|
|
3005
3091
|
}
|
|
3006
3092
|
return null;
|
|
3007
3093
|
}
|
|
3008
3094
|
function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
|
|
3009
|
-
while (node !== void 0 && !
|
|
3095
|
+
while (node !== void 0 && !ts21.isFunctionDeclaration(node)) {
|
|
3010
3096
|
if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticsRequest) {
|
|
3011
3097
|
return null;
|
|
3012
3098
|
}
|
|
@@ -3023,7 +3109,7 @@ function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
|
|
|
3023
3109
|
return null;
|
|
3024
3110
|
}
|
|
3025
3111
|
function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
|
|
3026
|
-
while (!
|
|
3112
|
+
while (!ts21.isFunctionDeclaration(node)) {
|
|
3027
3113
|
if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticRequest) {
|
|
3028
3114
|
return null;
|
|
3029
3115
|
}
|
|
@@ -3033,8 +3119,8 @@ function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
|
|
|
3033
3119
|
}
|
|
3034
3120
|
}
|
|
3035
3121
|
const start = node.getFullStart();
|
|
3036
|
-
return
|
|
3037
|
-
if (kind !==
|
|
3122
|
+
return ts21.forEachLeadingCommentRange(sourceFile.text, start, (pos, end, kind) => {
|
|
3123
|
+
if (kind !== ts21.SyntaxKind.MultiLineCommentTrivia) {
|
|
3038
3124
|
return null;
|
|
3039
3125
|
}
|
|
3040
3126
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -3046,32 +3132,32 @@ function checkIfGenericTypeBoundsCanBeEmitted(node, reflector, env) {
|
|
|
3046
3132
|
return emitter.canEmit((ref) => env.canReferenceType(ref));
|
|
3047
3133
|
}
|
|
3048
3134
|
|
|
3049
|
-
// bazel-out/
|
|
3135
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
3050
3136
|
function generateTypeCtorDeclarationFn(node, meta, nodeTypeRef, typeParams) {
|
|
3051
3137
|
const rawTypeArgs = typeParams !== void 0 ? generateGenericArgs(typeParams) : void 0;
|
|
3052
|
-
const rawType =
|
|
3138
|
+
const rawType = ts22.factory.createTypeReferenceNode(nodeTypeRef, rawTypeArgs);
|
|
3053
3139
|
const initParam = constructTypeCtorParameter(node, meta, rawType);
|
|
3054
3140
|
const typeParameters = typeParametersWithDefaultTypes(typeParams);
|
|
3055
3141
|
if (meta.body) {
|
|
3056
|
-
const fnType =
|
|
3142
|
+
const fnType = ts22.factory.createFunctionTypeNode(
|
|
3057
3143
|
typeParameters,
|
|
3058
3144
|
[initParam],
|
|
3059
3145
|
rawType
|
|
3060
3146
|
);
|
|
3061
|
-
const decl =
|
|
3147
|
+
const decl = ts22.factory.createVariableDeclaration(
|
|
3062
3148
|
meta.fnName,
|
|
3063
3149
|
void 0,
|
|
3064
3150
|
fnType,
|
|
3065
|
-
|
|
3151
|
+
ts22.factory.createNonNullExpression(ts22.factory.createNull())
|
|
3066
3152
|
);
|
|
3067
|
-
const declList =
|
|
3068
|
-
return
|
|
3153
|
+
const declList = ts22.factory.createVariableDeclarationList([decl], ts22.NodeFlags.Const);
|
|
3154
|
+
return ts22.factory.createVariableStatement(
|
|
3069
3155
|
void 0,
|
|
3070
3156
|
declList
|
|
3071
3157
|
);
|
|
3072
3158
|
} else {
|
|
3073
|
-
return
|
|
3074
|
-
[
|
|
3159
|
+
return ts22.factory.createFunctionDeclaration(
|
|
3160
|
+
[ts22.factory.createModifier(ts22.SyntaxKind.DeclareKeyword)],
|
|
3075
3161
|
void 0,
|
|
3076
3162
|
meta.fnName,
|
|
3077
3163
|
typeParameters,
|
|
@@ -3083,16 +3169,16 @@ function generateTypeCtorDeclarationFn(node, meta, nodeTypeRef, typeParams) {
|
|
|
3083
3169
|
}
|
|
3084
3170
|
function generateInlineTypeCtor(node, meta) {
|
|
3085
3171
|
const rawTypeArgs = node.typeParameters !== void 0 ? generateGenericArgs(node.typeParameters) : void 0;
|
|
3086
|
-
const rawType =
|
|
3172
|
+
const rawType = ts22.factory.createTypeReferenceNode(node.name, rawTypeArgs);
|
|
3087
3173
|
const initParam = constructTypeCtorParameter(node, meta, rawType);
|
|
3088
3174
|
let body = void 0;
|
|
3089
3175
|
if (meta.body) {
|
|
3090
|
-
body =
|
|
3091
|
-
|
|
3176
|
+
body = ts22.factory.createBlock([
|
|
3177
|
+
ts22.factory.createReturnStatement(ts22.factory.createNonNullExpression(ts22.factory.createNull()))
|
|
3092
3178
|
]);
|
|
3093
3179
|
}
|
|
3094
|
-
return
|
|
3095
|
-
[
|
|
3180
|
+
return ts22.factory.createMethodDeclaration(
|
|
3181
|
+
[ts22.factory.createModifier(ts22.SyntaxKind.StaticKeyword)],
|
|
3096
3182
|
void 0,
|
|
3097
3183
|
meta.fnName,
|
|
3098
3184
|
void 0,
|
|
@@ -3108,9 +3194,9 @@ function constructTypeCtorParameter(node, meta, rawType) {
|
|
|
3108
3194
|
const coercedKeys = [];
|
|
3109
3195
|
for (const { classPropertyName, transform } of meta.fields.inputs) {
|
|
3110
3196
|
if (!meta.coercedInputFields.has(classPropertyName)) {
|
|
3111
|
-
plainKeys.push(
|
|
3197
|
+
plainKeys.push(ts22.factory.createLiteralTypeNode(ts22.factory.createStringLiteral(classPropertyName)));
|
|
3112
3198
|
} else {
|
|
3113
|
-
coercedKeys.push(
|
|
3199
|
+
coercedKeys.push(ts22.factory.createPropertySignature(
|
|
3114
3200
|
void 0,
|
|
3115
3201
|
classPropertyName,
|
|
3116
3202
|
void 0,
|
|
@@ -3119,17 +3205,17 @@ function constructTypeCtorParameter(node, meta, rawType) {
|
|
|
3119
3205
|
}
|
|
3120
3206
|
}
|
|
3121
3207
|
if (plainKeys.length > 0) {
|
|
3122
|
-
const keyTypeUnion =
|
|
3123
|
-
initType =
|
|
3208
|
+
const keyTypeUnion = ts22.factory.createUnionTypeNode(plainKeys);
|
|
3209
|
+
initType = ts22.factory.createTypeReferenceNode("Pick", [rawType, keyTypeUnion]);
|
|
3124
3210
|
}
|
|
3125
3211
|
if (coercedKeys.length > 0) {
|
|
3126
|
-
const coercedLiteral =
|
|
3127
|
-
initType = initType !== null ?
|
|
3212
|
+
const coercedLiteral = ts22.factory.createTypeLiteralNode(coercedKeys);
|
|
3213
|
+
initType = initType !== null ? ts22.factory.createIntersectionTypeNode([initType, coercedLiteral]) : coercedLiteral;
|
|
3128
3214
|
}
|
|
3129
3215
|
if (initType === null) {
|
|
3130
|
-
initType =
|
|
3216
|
+
initType = ts22.factory.createTypeLiteralNode([]);
|
|
3131
3217
|
}
|
|
3132
|
-
return
|
|
3218
|
+
return ts22.factory.createParameterDeclaration(
|
|
3133
3219
|
void 0,
|
|
3134
3220
|
void 0,
|
|
3135
3221
|
"init",
|
|
@@ -3139,7 +3225,7 @@ function constructTypeCtorParameter(node, meta, rawType) {
|
|
|
3139
3225
|
);
|
|
3140
3226
|
}
|
|
3141
3227
|
function generateGenericArgs(params) {
|
|
3142
|
-
return params.map((param) =>
|
|
3228
|
+
return params.map((param) => ts22.factory.createTypeReferenceNode(param.name, void 0));
|
|
3143
3229
|
}
|
|
3144
3230
|
function requiresInlineTypeCtor(node, host, env) {
|
|
3145
3231
|
return !checkIfGenericTypeBoundsCanBeEmitted(node, host, env);
|
|
@@ -3150,14 +3236,14 @@ function typeParametersWithDefaultTypes(params) {
|
|
|
3150
3236
|
}
|
|
3151
3237
|
return params.map((param) => {
|
|
3152
3238
|
if (param.default === void 0) {
|
|
3153
|
-
return
|
|
3239
|
+
return ts22.factory.updateTypeParameterDeclaration(param, param.modifiers, param.name, param.constraint, ts22.factory.createKeywordTypeNode(ts22.SyntaxKind.AnyKeyword));
|
|
3154
3240
|
} else {
|
|
3155
3241
|
return param;
|
|
3156
3242
|
}
|
|
3157
3243
|
});
|
|
3158
3244
|
}
|
|
3159
3245
|
|
|
3160
|
-
// bazel-out/
|
|
3246
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
|
|
3161
3247
|
var Environment = class {
|
|
3162
3248
|
constructor(config, importManager, refEmitter, reflector, contextFile) {
|
|
3163
3249
|
this.config = config;
|
|
@@ -3182,13 +3268,13 @@ var Environment = class {
|
|
|
3182
3268
|
}
|
|
3183
3269
|
if (requiresInlineTypeCtor(node, this.reflector, this)) {
|
|
3184
3270
|
const ref = this.reference(dirRef);
|
|
3185
|
-
const typeCtorExpr =
|
|
3271
|
+
const typeCtorExpr = ts23.factory.createPropertyAccessExpression(ref, "ngTypeCtor");
|
|
3186
3272
|
this.typeCtors.set(node, typeCtorExpr);
|
|
3187
3273
|
return typeCtorExpr;
|
|
3188
3274
|
} else {
|
|
3189
3275
|
const fnName = `_ctor${this.nextIds.typeCtor++}`;
|
|
3190
3276
|
const nodeTypeRef = this.referenceType(dirRef);
|
|
3191
|
-
if (!
|
|
3277
|
+
if (!ts23.isTypeReferenceNode(nodeTypeRef)) {
|
|
3192
3278
|
throw new Error(`Expected TypeReferenceNode from reference to ${dirRef.debugName}`);
|
|
3193
3279
|
}
|
|
3194
3280
|
const meta = {
|
|
@@ -3203,7 +3289,7 @@ var Environment = class {
|
|
|
3203
3289
|
const typeParams = this.emitTypeParameters(node);
|
|
3204
3290
|
const typeCtor = generateTypeCtorDeclarationFn(node, meta, nodeTypeRef.typeName, typeParams);
|
|
3205
3291
|
this.typeCtorStatements.push(typeCtor);
|
|
3206
|
-
const fnId =
|
|
3292
|
+
const fnId = ts23.factory.createIdentifier(fnName);
|
|
3207
3293
|
this.typeCtors.set(node, fnId);
|
|
3208
3294
|
return fnId;
|
|
3209
3295
|
}
|
|
@@ -3213,7 +3299,7 @@ var Environment = class {
|
|
|
3213
3299
|
return this.pipeInsts.get(ref.node);
|
|
3214
3300
|
}
|
|
3215
3301
|
const pipeType = this.referenceType(ref);
|
|
3216
|
-
const pipeInstId =
|
|
3302
|
+
const pipeInstId = ts23.factory.createIdentifier(`_pipe${this.nextIds.pipeInst++}`);
|
|
3217
3303
|
this.pipeInstStatements.push(tsDeclareVariable(pipeInstId, pipeType));
|
|
3218
3304
|
this.pipeInsts.set(ref.node, pipeInstId);
|
|
3219
3305
|
return pipeInstId;
|
|
@@ -3251,9 +3337,9 @@ var Environment = class {
|
|
|
3251
3337
|
}
|
|
3252
3338
|
};
|
|
3253
3339
|
|
|
3254
|
-
// bazel-out/
|
|
3340
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/oob.mjs
|
|
3255
3341
|
import { TmplAstElement as TmplAstElement2 } from "@angular/compiler";
|
|
3256
|
-
import
|
|
3342
|
+
import ts24 from "typescript";
|
|
3257
3343
|
var OutOfBandDiagnosticRecorderImpl = class {
|
|
3258
3344
|
constructor(resolver) {
|
|
3259
3345
|
this.resolver = resolver;
|
|
@@ -3267,7 +3353,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3267
3353
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
3268
3354
|
const value = ref.value.trim();
|
|
3269
3355
|
const errorMsg = `No directive found with exportAs '${value}'.`;
|
|
3270
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan,
|
|
3356
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REFERENCE_TARGET), errorMsg));
|
|
3271
3357
|
}
|
|
3272
3358
|
missingPipe(templateId, ast) {
|
|
3273
3359
|
if (this.recordedPipes.has(ast)) {
|
|
@@ -3279,7 +3365,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3279
3365
|
if (sourceSpan === null) {
|
|
3280
3366
|
throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
|
|
3281
3367
|
}
|
|
3282
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan,
|
|
3368
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_PIPE), errorMsg));
|
|
3283
3369
|
this.recordedPipes.add(ast);
|
|
3284
3370
|
}
|
|
3285
3371
|
illegalAssignmentToTemplateVar(templateId, assignment, target) {
|
|
@@ -3290,7 +3376,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3290
3376
|
if (sourceSpan === null) {
|
|
3291
3377
|
throw new Error(`Assertion failure: no SourceLocation found for property binding.`);
|
|
3292
3378
|
}
|
|
3293
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan,
|
|
3379
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMsg, [{
|
|
3294
3380
|
text: `The variable ${assignment.name} is declared here.`,
|
|
3295
3381
|
start: ((_a = target.valueSpan) == null ? void 0 : _a.start.offset) || target.sourceSpan.start.offset,
|
|
3296
3382
|
end: ((_b = target.valueSpan) == null ? void 0 : _b.end.offset) || target.sourceSpan.end.offset,
|
|
@@ -3300,7 +3386,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3300
3386
|
duplicateTemplateVar(templateId, variable, firstDecl) {
|
|
3301
3387
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
3302
3388
|
const errorMsg = `Cannot redeclare variable '${variable.name}' as it was previously declared elsewhere for the same template.`;
|
|
3303
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, variable.sourceSpan,
|
|
3389
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, variable.sourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DUPLICATE_VARIABLE_DECLARATION), errorMsg, [{
|
|
3304
3390
|
text: `The variable '${firstDecl.name}' was first declared here.`,
|
|
3305
3391
|
start: firstDecl.sourceSpan.start.offset,
|
|
3306
3392
|
end: firstDecl.sourceSpan.end.offset,
|
|
@@ -3339,7 +3425,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3339
3425
|
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.
|
|
3340
3426
|
|
|
3341
3427
|
Consider enabling the 'strictTemplates' option in your tsconfig.json for better type inference within this template.`;
|
|
3342
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, diagnosticVar.keySpan,
|
|
3428
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, diagnosticVar.keySpan, ts24.DiagnosticCategory.Suggestion, ngErrorCode(ErrorCode.SUGGEST_SUBOPTIMAL_TYPE_INFERENCE), message));
|
|
3343
3429
|
}
|
|
3344
3430
|
splitTwoWayBinding(templateId, input, output, inputConsumer, outputConsumer) {
|
|
3345
3431
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
@@ -3373,11 +3459,11 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
3373
3459
|
sourceFile: outputConsumer.name.getSourceFile()
|
|
3374
3460
|
});
|
|
3375
3461
|
}
|
|
3376
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, input.keySpan,
|
|
3462
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, input.keySpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SPLIT_TWO_WAY_BINDING), errorMsg, relatedMessages));
|
|
3377
3463
|
}
|
|
3378
3464
|
missingRequiredInputs(templateId, element, directiveName, isComponent, inputAliases) {
|
|
3379
3465
|
const message = `Required input${inputAliases.length === 1 ? "" : "s"} ${inputAliases.map((n) => `'${n}'`).join(", ")} from ${isComponent ? "component" : "directive"} ${directiveName} must be specified.`;
|
|
3380
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), element.startSourceSpan,
|
|
3466
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), element.startSourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REQUIRED_INPUTS), message));
|
|
3381
3467
|
}
|
|
3382
3468
|
illegalForLoopTrackAccess(templateId, block, access) {
|
|
3383
3469
|
const sourceSpan = this.resolver.toParseSourceSpan(templateId, access.sourceSpan);
|
|
@@ -3385,7 +3471,7 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
3385
3471
|
throw new Error(`Assertion failure: no SourceLocation found for property read.`);
|
|
3386
3472
|
}
|
|
3387
3473
|
const message = `Cannot access '${access.name}' inside of a track expression. Only '${block.item.name}', '${block.contextVariables.$index.name}' and properties on the containing component are available to this expression.`;
|
|
3388
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), sourceSpan,
|
|
3474
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), sourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.ILLEGAL_FOR_LOOP_TRACK_ACCESS), message));
|
|
3389
3475
|
}
|
|
3390
3476
|
inaccessibleDeferredTriggerElement(templateId, trigger) {
|
|
3391
3477
|
let message;
|
|
@@ -3396,7 +3482,7 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
3396
3482
|
Check that an element with #${trigger.reference} exists in the same template and it's accessible from the @defer block.
|
|
3397
3483
|
Deferred blocks can only access triggers in same view, a parent embedded view or the root view of the @placeholder block.`;
|
|
3398
3484
|
}
|
|
3399
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), trigger.sourceSpan,
|
|
3485
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), trigger.sourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT), message));
|
|
3400
3486
|
}
|
|
3401
3487
|
};
|
|
3402
3488
|
function makeInlineDiagnostic(templateId, code, node, messageText, relatedInformation) {
|
|
@@ -3407,8 +3493,8 @@ function makeInlineDiagnostic(templateId, code, node, messageText, relatedInform
|
|
|
3407
3493
|
};
|
|
3408
3494
|
}
|
|
3409
3495
|
|
|
3410
|
-
// bazel-out/
|
|
3411
|
-
import
|
|
3496
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/shim.mjs
|
|
3497
|
+
import ts25 from "typescript";
|
|
3412
3498
|
var TypeCheckShimGenerator = class {
|
|
3413
3499
|
constructor() {
|
|
3414
3500
|
this.extensionPrefix = "ngtypecheck";
|
|
@@ -3418,25 +3504,25 @@ var TypeCheckShimGenerator = class {
|
|
|
3418
3504
|
if (priorShimSf !== null) {
|
|
3419
3505
|
return priorShimSf;
|
|
3420
3506
|
}
|
|
3421
|
-
return
|
|
3507
|
+
return ts25.createSourceFile(genFilePath, "export const USED_FOR_NG_TYPE_CHECKING = true;", ts25.ScriptTarget.Latest, true, ts25.ScriptKind.TS);
|
|
3422
3508
|
}
|
|
3423
3509
|
static shimFor(fileName) {
|
|
3424
3510
|
return absoluteFrom(fileName.replace(/\.tsx?$/, ".ngtypecheck.ts"));
|
|
3425
3511
|
}
|
|
3426
3512
|
};
|
|
3427
3513
|
|
|
3428
|
-
// bazel-out/
|
|
3514
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
3429
3515
|
import { BindingPipe, Call as Call2, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver4, PropertyRead as PropertyRead4, PropertyWrite as PropertyWrite3, SafeCall, SafePropertyRead as SafePropertyRead3, ThisReceiver, TmplAstBoundAttribute, TmplAstBoundText, TmplAstDeferredBlock, TmplAstElement as TmplAstElement3, TmplAstForLoopBlock, TmplAstIcu, TmplAstIfBlock, TmplAstIfBlockBranch, TmplAstReference as TmplAstReference3, TmplAstSwitchBlock, TmplAstTemplate as TmplAstTemplate2, TmplAstTextAttribute as TmplAstTextAttribute2, TmplAstVariable as TmplAstVariable2, TransplantedType } from "@angular/compiler";
|
|
3430
|
-
import
|
|
3516
|
+
import ts28 from "typescript";
|
|
3431
3517
|
|
|
3432
|
-
// bazel-out/
|
|
3518
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.mjs
|
|
3433
3519
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan3 } from "@angular/compiler";
|
|
3434
|
-
import
|
|
3520
|
+
import ts26 from "typescript";
|
|
3435
3521
|
function wrapForDiagnostics(expr) {
|
|
3436
|
-
return
|
|
3522
|
+
return ts26.factory.createParenthesizedExpression(expr);
|
|
3437
3523
|
}
|
|
3438
3524
|
function wrapForTypeChecker(expr) {
|
|
3439
|
-
return
|
|
3525
|
+
return ts26.factory.createParenthesizedExpression(expr);
|
|
3440
3526
|
}
|
|
3441
3527
|
function addParseSpanInfo(node, span) {
|
|
3442
3528
|
let commentText;
|
|
@@ -3445,10 +3531,10 @@ function addParseSpanInfo(node, span) {
|
|
|
3445
3531
|
} else {
|
|
3446
3532
|
commentText = `${span.start.offset},${span.end.offset}`;
|
|
3447
3533
|
}
|
|
3448
|
-
|
|
3534
|
+
ts26.addSyntheticTrailingComment(node, ts26.SyntaxKind.MultiLineCommentTrivia, commentText, false);
|
|
3449
3535
|
}
|
|
3450
3536
|
function addTemplateId(tcb, id) {
|
|
3451
|
-
|
|
3537
|
+
ts26.addSyntheticLeadingComment(tcb, ts26.SyntaxKind.MultiLineCommentTrivia, id, true);
|
|
3452
3538
|
}
|
|
3453
3539
|
function shouldReportDiagnostic(diagnostic) {
|
|
3454
3540
|
const { code } = diagnostic;
|
|
@@ -3475,34 +3561,34 @@ function translateDiagnostic(diagnostic, resolver) {
|
|
|
3475
3561
|
return makeTemplateDiagnostic(sourceLocation.id, templateSourceMapping, span, diagnostic.category, diagnostic.code, diagnostic.messageText);
|
|
3476
3562
|
}
|
|
3477
3563
|
|
|
3478
|
-
// bazel-out/
|
|
3564
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/expression.mjs
|
|
3479
3565
|
import { ASTWithSource as ASTWithSource2, Call, EmptyExpr as EmptyExpr2, PropertyRead as PropertyRead3, SafeKeyedRead, SafePropertyRead as SafePropertyRead2 } from "@angular/compiler";
|
|
3480
|
-
import
|
|
3481
|
-
var NULL_AS_ANY =
|
|
3482
|
-
var UNDEFINED =
|
|
3566
|
+
import ts27 from "typescript";
|
|
3567
|
+
var NULL_AS_ANY = ts27.factory.createAsExpression(ts27.factory.createNull(), ts27.factory.createKeywordTypeNode(ts27.SyntaxKind.AnyKeyword));
|
|
3568
|
+
var UNDEFINED = ts27.factory.createIdentifier("undefined");
|
|
3483
3569
|
var UNARY_OPS = /* @__PURE__ */ new Map([
|
|
3484
|
-
["+",
|
|
3485
|
-
["-",
|
|
3570
|
+
["+", ts27.SyntaxKind.PlusToken],
|
|
3571
|
+
["-", ts27.SyntaxKind.MinusToken]
|
|
3486
3572
|
]);
|
|
3487
3573
|
var BINARY_OPS = /* @__PURE__ */ new Map([
|
|
3488
|
-
["+",
|
|
3489
|
-
["-",
|
|
3490
|
-
["<",
|
|
3491
|
-
[">",
|
|
3492
|
-
["<=",
|
|
3493
|
-
[">=",
|
|
3494
|
-
["==",
|
|
3495
|
-
["===",
|
|
3496
|
-
["*",
|
|
3497
|
-
["/",
|
|
3498
|
-
["%",
|
|
3499
|
-
["!=",
|
|
3500
|
-
["!==",
|
|
3501
|
-
["||",
|
|
3502
|
-
["&&",
|
|
3503
|
-
["&",
|
|
3504
|
-
["|",
|
|
3505
|
-
["??",
|
|
3574
|
+
["+", ts27.SyntaxKind.PlusToken],
|
|
3575
|
+
["-", ts27.SyntaxKind.MinusToken],
|
|
3576
|
+
["<", ts27.SyntaxKind.LessThanToken],
|
|
3577
|
+
[">", ts27.SyntaxKind.GreaterThanToken],
|
|
3578
|
+
["<=", ts27.SyntaxKind.LessThanEqualsToken],
|
|
3579
|
+
[">=", ts27.SyntaxKind.GreaterThanEqualsToken],
|
|
3580
|
+
["==", ts27.SyntaxKind.EqualsEqualsToken],
|
|
3581
|
+
["===", ts27.SyntaxKind.EqualsEqualsEqualsToken],
|
|
3582
|
+
["*", ts27.SyntaxKind.AsteriskToken],
|
|
3583
|
+
["/", ts27.SyntaxKind.SlashToken],
|
|
3584
|
+
["%", ts27.SyntaxKind.PercentToken],
|
|
3585
|
+
["!=", ts27.SyntaxKind.ExclamationEqualsToken],
|
|
3586
|
+
["!==", ts27.SyntaxKind.ExclamationEqualsEqualsToken],
|
|
3587
|
+
["||", ts27.SyntaxKind.BarBarToken],
|
|
3588
|
+
["&&", ts27.SyntaxKind.AmpersandAmpersandToken],
|
|
3589
|
+
["&", ts27.SyntaxKind.AmpersandToken],
|
|
3590
|
+
["|", ts27.SyntaxKind.BarToken],
|
|
3591
|
+
["??", ts27.SyntaxKind.QuestionQuestionToken]
|
|
3506
3592
|
]);
|
|
3507
3593
|
function astToTypescript(ast, maybeResolve, config) {
|
|
3508
3594
|
const translator = new AstTranslator(maybeResolve, config);
|
|
@@ -3518,7 +3604,7 @@ var AstTranslator = class {
|
|
|
3518
3604
|
ast = ast.ast;
|
|
3519
3605
|
}
|
|
3520
3606
|
if (ast instanceof EmptyExpr2) {
|
|
3521
|
-
const res =
|
|
3607
|
+
const res = ts27.factory.createIdentifier("undefined");
|
|
3522
3608
|
addParseSpanInfo(res, ast.sourceSpan);
|
|
3523
3609
|
return res;
|
|
3524
3610
|
}
|
|
@@ -3534,7 +3620,7 @@ var AstTranslator = class {
|
|
|
3534
3620
|
if (op === void 0) {
|
|
3535
3621
|
throw new Error(`Unsupported Unary.operator: ${ast.operator}`);
|
|
3536
3622
|
}
|
|
3537
|
-
const node = wrapForDiagnostics(
|
|
3623
|
+
const node = wrapForDiagnostics(ts27.factory.createPrefixUnaryExpression(op, expr));
|
|
3538
3624
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3539
3625
|
return node;
|
|
3540
3626
|
}
|
|
@@ -3545,13 +3631,13 @@ var AstTranslator = class {
|
|
|
3545
3631
|
if (op === void 0) {
|
|
3546
3632
|
throw new Error(`Unsupported Binary.operation: ${ast.operation}`);
|
|
3547
3633
|
}
|
|
3548
|
-
const node =
|
|
3634
|
+
const node = ts27.factory.createBinaryExpression(lhs, op, rhs);
|
|
3549
3635
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3550
3636
|
return node;
|
|
3551
3637
|
}
|
|
3552
3638
|
visitChain(ast) {
|
|
3553
3639
|
const elements = ast.expressions.map((expr) => this.translate(expr));
|
|
3554
|
-
const node = wrapForDiagnostics(
|
|
3640
|
+
const node = wrapForDiagnostics(ts27.factory.createCommaListExpression(elements));
|
|
3555
3641
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3556
3642
|
return node;
|
|
3557
3643
|
}
|
|
@@ -3559,7 +3645,7 @@ var AstTranslator = class {
|
|
|
3559
3645
|
const condExpr = this.translate(ast.condition);
|
|
3560
3646
|
const trueExpr = this.translate(ast.trueExp);
|
|
3561
3647
|
const falseExpr = wrapForTypeChecker(this.translate(ast.falseExp));
|
|
3562
|
-
const node =
|
|
3648
|
+
const node = ts27.factory.createParenthesizedExpression(ts27.factory.createConditionalExpression(condExpr, void 0, trueExpr, void 0, falseExpr));
|
|
3563
3649
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3564
3650
|
return node;
|
|
3565
3651
|
}
|
|
@@ -3570,26 +3656,26 @@ var AstTranslator = class {
|
|
|
3570
3656
|
throw new Error("Method not implemented.");
|
|
3571
3657
|
}
|
|
3572
3658
|
visitInterpolation(ast) {
|
|
3573
|
-
return ast.expressions.reduce((lhs, ast2) =>
|
|
3659
|
+
return ast.expressions.reduce((lhs, ast2) => ts27.factory.createBinaryExpression(lhs, ts27.SyntaxKind.PlusToken, wrapForTypeChecker(this.translate(ast2))), ts27.factory.createStringLiteral(""));
|
|
3574
3660
|
}
|
|
3575
3661
|
visitKeyedRead(ast) {
|
|
3576
3662
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3577
3663
|
const key = this.translate(ast.key);
|
|
3578
|
-
const node =
|
|
3664
|
+
const node = ts27.factory.createElementAccessExpression(receiver, key);
|
|
3579
3665
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3580
3666
|
return node;
|
|
3581
3667
|
}
|
|
3582
3668
|
visitKeyedWrite(ast) {
|
|
3583
3669
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3584
|
-
const left =
|
|
3670
|
+
const left = ts27.factory.createElementAccessExpression(receiver, this.translate(ast.key));
|
|
3585
3671
|
const right = wrapForTypeChecker(this.translate(ast.value));
|
|
3586
|
-
const node = wrapForDiagnostics(
|
|
3672
|
+
const node = wrapForDiagnostics(ts27.factory.createBinaryExpression(left, ts27.SyntaxKind.EqualsToken, right));
|
|
3587
3673
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3588
3674
|
return node;
|
|
3589
3675
|
}
|
|
3590
3676
|
visitLiteralArray(ast) {
|
|
3591
3677
|
const elements = ast.expressions.map((expr) => this.translate(expr));
|
|
3592
|
-
const literal =
|
|
3678
|
+
const literal = ts27.factory.createArrayLiteralExpression(elements);
|
|
3593
3679
|
const node = this.config.strictLiteralTypes ? literal : tsCastToAny(literal);
|
|
3594
3680
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3595
3681
|
return node;
|
|
@@ -3597,9 +3683,9 @@ var AstTranslator = class {
|
|
|
3597
3683
|
visitLiteralMap(ast) {
|
|
3598
3684
|
const properties = ast.keys.map(({ key }, idx) => {
|
|
3599
3685
|
const value = this.translate(ast.values[idx]);
|
|
3600
|
-
return
|
|
3686
|
+
return ts27.factory.createPropertyAssignment(ts27.factory.createStringLiteral(key), value);
|
|
3601
3687
|
});
|
|
3602
|
-
const literal =
|
|
3688
|
+
const literal = ts27.factory.createObjectLiteralExpression(properties, true);
|
|
3603
3689
|
const node = this.config.strictLiteralTypes ? literal : tsCastToAny(literal);
|
|
3604
3690
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3605
3691
|
return node;
|
|
@@ -3607,15 +3693,15 @@ var AstTranslator = class {
|
|
|
3607
3693
|
visitLiteralPrimitive(ast) {
|
|
3608
3694
|
let node;
|
|
3609
3695
|
if (ast.value === void 0) {
|
|
3610
|
-
node =
|
|
3696
|
+
node = ts27.factory.createIdentifier("undefined");
|
|
3611
3697
|
} else if (ast.value === null) {
|
|
3612
|
-
node =
|
|
3698
|
+
node = ts27.factory.createNull();
|
|
3613
3699
|
} else if (typeof ast.value === "string") {
|
|
3614
|
-
node =
|
|
3700
|
+
node = ts27.factory.createStringLiteral(ast.value);
|
|
3615
3701
|
} else if (typeof ast.value === "number") {
|
|
3616
|
-
node =
|
|
3702
|
+
node = ts27.factory.createNumericLiteral(ast.value);
|
|
3617
3703
|
} else if (typeof ast.value === "boolean") {
|
|
3618
|
-
node = ast.value ?
|
|
3704
|
+
node = ast.value ? ts27.factory.createTrue() : ts27.factory.createFalse();
|
|
3619
3705
|
} else {
|
|
3620
3706
|
throw Error(`Unsupported AST value of type ${typeof ast.value}`);
|
|
3621
3707
|
}
|
|
@@ -3624,7 +3710,7 @@ var AstTranslator = class {
|
|
|
3624
3710
|
}
|
|
3625
3711
|
visitNonNullAssert(ast) {
|
|
3626
3712
|
const expr = wrapForDiagnostics(this.translate(ast.expression));
|
|
3627
|
-
const node =
|
|
3713
|
+
const node = ts27.factory.createNonNullExpression(expr);
|
|
3628
3714
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3629
3715
|
return node;
|
|
3630
3716
|
}
|
|
@@ -3633,13 +3719,13 @@ var AstTranslator = class {
|
|
|
3633
3719
|
}
|
|
3634
3720
|
visitPrefixNot(ast) {
|
|
3635
3721
|
const expression = wrapForDiagnostics(this.translate(ast.expression));
|
|
3636
|
-
const node =
|
|
3722
|
+
const node = ts27.factory.createLogicalNot(expression);
|
|
3637
3723
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3638
3724
|
return node;
|
|
3639
3725
|
}
|
|
3640
3726
|
visitPropertyRead(ast) {
|
|
3641
3727
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3642
|
-
const name =
|
|
3728
|
+
const name = ts27.factory.createPropertyAccessExpression(receiver, ast.name);
|
|
3643
3729
|
addParseSpanInfo(name, ast.nameSpan);
|
|
3644
3730
|
const node = wrapForDiagnostics(name);
|
|
3645
3731
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
@@ -3647,12 +3733,12 @@ var AstTranslator = class {
|
|
|
3647
3733
|
}
|
|
3648
3734
|
visitPropertyWrite(ast) {
|
|
3649
3735
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3650
|
-
const left =
|
|
3736
|
+
const left = ts27.factory.createPropertyAccessExpression(receiver, ast.name);
|
|
3651
3737
|
addParseSpanInfo(left, ast.nameSpan);
|
|
3652
3738
|
const leftWithPath = wrapForDiagnostics(left);
|
|
3653
3739
|
addParseSpanInfo(leftWithPath, ast.sourceSpan);
|
|
3654
3740
|
const right = wrapForTypeChecker(this.translate(ast.value));
|
|
3655
|
-
const node = wrapForDiagnostics(
|
|
3741
|
+
const node = wrapForDiagnostics(ts27.factory.createBinaryExpression(leftWithPath, ts27.SyntaxKind.EqualsToken, right));
|
|
3656
3742
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3657
3743
|
return node;
|
|
3658
3744
|
}
|
|
@@ -3660,13 +3746,13 @@ var AstTranslator = class {
|
|
|
3660
3746
|
let node;
|
|
3661
3747
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3662
3748
|
if (this.config.strictSafeNavigationTypes) {
|
|
3663
|
-
const expr =
|
|
3749
|
+
const expr = ts27.factory.createPropertyAccessExpression(ts27.factory.createNonNullExpression(receiver), ast.name);
|
|
3664
3750
|
addParseSpanInfo(expr, ast.nameSpan);
|
|
3665
|
-
node =
|
|
3751
|
+
node = ts27.factory.createParenthesizedExpression(ts27.factory.createConditionalExpression(NULL_AS_ANY, void 0, expr, void 0, UNDEFINED));
|
|
3666
3752
|
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
3667
|
-
node =
|
|
3753
|
+
node = ts27.factory.createPropertyAccessExpression(tsCastToAny(receiver), ast.name);
|
|
3668
3754
|
} else {
|
|
3669
|
-
const expr =
|
|
3755
|
+
const expr = ts27.factory.createPropertyAccessExpression(ts27.factory.createNonNullExpression(receiver), ast.name);
|
|
3670
3756
|
addParseSpanInfo(expr, ast.nameSpan);
|
|
3671
3757
|
node = tsCastToAny(expr);
|
|
3672
3758
|
}
|
|
@@ -3678,13 +3764,13 @@ var AstTranslator = class {
|
|
|
3678
3764
|
const key = this.translate(ast.key);
|
|
3679
3765
|
let node;
|
|
3680
3766
|
if (this.config.strictSafeNavigationTypes) {
|
|
3681
|
-
const expr =
|
|
3767
|
+
const expr = ts27.factory.createElementAccessExpression(ts27.factory.createNonNullExpression(receiver), key);
|
|
3682
3768
|
addParseSpanInfo(expr, ast.sourceSpan);
|
|
3683
|
-
node =
|
|
3769
|
+
node = ts27.factory.createParenthesizedExpression(ts27.factory.createConditionalExpression(NULL_AS_ANY, void 0, expr, void 0, UNDEFINED));
|
|
3684
3770
|
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
3685
|
-
node =
|
|
3771
|
+
node = ts27.factory.createElementAccessExpression(tsCastToAny(receiver), key);
|
|
3686
3772
|
} else {
|
|
3687
|
-
const expr =
|
|
3773
|
+
const expr = ts27.factory.createElementAccessExpression(ts27.factory.createNonNullExpression(receiver), key);
|
|
3688
3774
|
addParseSpanInfo(expr, ast.sourceSpan);
|
|
3689
3775
|
node = tsCastToAny(expr);
|
|
3690
3776
|
}
|
|
@@ -3701,7 +3787,7 @@ var AstTranslator = class {
|
|
|
3701
3787
|
expr = resolved;
|
|
3702
3788
|
} else {
|
|
3703
3789
|
const propertyReceiver = wrapForDiagnostics(this.translate(receiver.receiver));
|
|
3704
|
-
expr =
|
|
3790
|
+
expr = ts27.factory.createPropertyAccessExpression(propertyReceiver, receiver.name);
|
|
3705
3791
|
addParseSpanInfo(expr, receiver.nameSpan);
|
|
3706
3792
|
}
|
|
3707
3793
|
} else {
|
|
@@ -3711,7 +3797,7 @@ var AstTranslator = class {
|
|
|
3711
3797
|
if (ast.receiver instanceof SafePropertyRead2 || ast.receiver instanceof SafeKeyedRead) {
|
|
3712
3798
|
node = this.convertToSafeCall(ast, expr, args);
|
|
3713
3799
|
} else {
|
|
3714
|
-
node =
|
|
3800
|
+
node = ts27.factory.createCallExpression(expr, void 0, args);
|
|
3715
3801
|
}
|
|
3716
3802
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3717
3803
|
return node;
|
|
@@ -3725,13 +3811,13 @@ var AstTranslator = class {
|
|
|
3725
3811
|
}
|
|
3726
3812
|
convertToSafeCall(ast, expr, args) {
|
|
3727
3813
|
if (this.config.strictSafeNavigationTypes) {
|
|
3728
|
-
const call =
|
|
3729
|
-
return
|
|
3814
|
+
const call = ts27.factory.createCallExpression(ts27.factory.createNonNullExpression(expr), void 0, args);
|
|
3815
|
+
return ts27.factory.createParenthesizedExpression(ts27.factory.createConditionalExpression(NULL_AS_ANY, void 0, call, void 0, UNDEFINED));
|
|
3730
3816
|
}
|
|
3731
3817
|
if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
3732
|
-
return
|
|
3818
|
+
return ts27.factory.createCallExpression(tsCastToAny(expr), void 0, args);
|
|
3733
3819
|
}
|
|
3734
|
-
return tsCastToAny(
|
|
3820
|
+
return tsCastToAny(ts27.factory.createCallExpression(ts27.factory.createNonNullExpression(expr), void 0, args));
|
|
3735
3821
|
}
|
|
3736
3822
|
};
|
|
3737
3823
|
var _VeSafeLhsInferenceBugDetector = class {
|
|
@@ -3808,7 +3894,7 @@ var VeSafeLhsInferenceBugDetector = _VeSafeLhsInferenceBugDetector;
|
|
|
3808
3894
|
_VeSafeLhsInferenceBugDetector.SINGLETON = new _VeSafeLhsInferenceBugDetector();
|
|
3809
3895
|
})();
|
|
3810
3896
|
|
|
3811
|
-
// bazel-out/
|
|
3897
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_semantics.mjs
|
|
3812
3898
|
import { ImplicitReceiver as ImplicitReceiver3, RecursiveAstVisitor as RecursiveAstVisitor2, TmplAstVariable } from "@angular/compiler";
|
|
3813
3899
|
var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
|
|
3814
3900
|
constructor(templateId, boundTarget, oob) {
|
|
@@ -3832,7 +3918,7 @@ var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
|
|
|
3832
3918
|
}
|
|
3833
3919
|
};
|
|
3834
3920
|
|
|
3835
|
-
// bazel-out/
|
|
3921
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
3836
3922
|
var TcbGenericContextBehavior;
|
|
3837
3923
|
(function(TcbGenericContextBehavior2) {
|
|
3838
3924
|
TcbGenericContextBehavior2[TcbGenericContextBehavior2["UseEmitter"] = 0] = "UseEmitter";
|
|
@@ -3843,7 +3929,7 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
3843
3929
|
const tcb = new Context(env, domSchemaChecker, oobRecorder, meta.id, meta.boundTarget, meta.pipes, meta.schemas, meta.isStandalone);
|
|
3844
3930
|
const scope = Scope.forNodes(tcb, null, null, tcb.boundTarget.target.template, null);
|
|
3845
3931
|
const ctxRawType = env.referenceType(ref);
|
|
3846
|
-
if (!
|
|
3932
|
+
if (!ts28.isTypeReferenceNode(ctxRawType)) {
|
|
3847
3933
|
throw new Error(`Expected TypeReferenceNode when referencing the ctx param for ${ref.debugName}`);
|
|
3848
3934
|
}
|
|
3849
3935
|
let typeParameters = void 0;
|
|
@@ -3855,25 +3941,25 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
3855
3941
|
switch (genericContextBehavior) {
|
|
3856
3942
|
case TcbGenericContextBehavior.UseEmitter:
|
|
3857
3943
|
typeParameters = new TypeParameterEmitter(ref.node.typeParameters, env.reflector).emit((typeRef) => env.referenceType(typeRef));
|
|
3858
|
-
typeArguments = typeParameters.map((param) =>
|
|
3944
|
+
typeArguments = typeParameters.map((param) => ts28.factory.createTypeReferenceNode(param.name));
|
|
3859
3945
|
break;
|
|
3860
3946
|
case TcbGenericContextBehavior.CopyClassNodes:
|
|
3861
3947
|
typeParameters = [...ref.node.typeParameters];
|
|
3862
|
-
typeArguments = typeParameters.map((param) =>
|
|
3948
|
+
typeArguments = typeParameters.map((param) => ts28.factory.createTypeReferenceNode(param.name));
|
|
3863
3949
|
break;
|
|
3864
3950
|
case TcbGenericContextBehavior.FallbackToAny:
|
|
3865
|
-
typeArguments = ref.node.typeParameters.map(() =>
|
|
3951
|
+
typeArguments = ref.node.typeParameters.map(() => ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
|
|
3866
3952
|
break;
|
|
3867
3953
|
}
|
|
3868
3954
|
}
|
|
3869
3955
|
const paramList = [tcbThisParam(ctxRawType.typeName, typeArguments)];
|
|
3870
3956
|
const scopeStatements = scope.render();
|
|
3871
|
-
const innerBody =
|
|
3957
|
+
const innerBody = ts28.factory.createBlock([
|
|
3872
3958
|
...env.getPreludeStatements(),
|
|
3873
3959
|
...scopeStatements
|
|
3874
3960
|
]);
|
|
3875
|
-
const body =
|
|
3876
|
-
const fnDecl =
|
|
3961
|
+
const body = ts28.factory.createBlock([ts28.factory.createIfStatement(ts28.factory.createTrue(), innerBody, void 0)]);
|
|
3962
|
+
const fnDecl = ts28.factory.createFunctionDeclaration(
|
|
3877
3963
|
void 0,
|
|
3878
3964
|
void 0,
|
|
3879
3965
|
name,
|
|
@@ -3922,7 +4008,7 @@ var TcbTemplateVariableOp = class extends TcbOp {
|
|
|
3922
4008
|
execute() {
|
|
3923
4009
|
const ctx = this.scope.resolve(this.template);
|
|
3924
4010
|
const id = this.tcb.allocateId();
|
|
3925
|
-
const initializer =
|
|
4011
|
+
const initializer = ts28.factory.createPropertyAccessExpression(
|
|
3926
4012
|
ctx,
|
|
3927
4013
|
this.variable.value || "$implicit"
|
|
3928
4014
|
);
|
|
@@ -3948,7 +4034,7 @@ var TcbTemplateContextOp = class extends TcbOp {
|
|
|
3948
4034
|
}
|
|
3949
4035
|
execute() {
|
|
3950
4036
|
const ctx = this.tcb.allocateId();
|
|
3951
|
-
const type =
|
|
4037
|
+
const type = ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword);
|
|
3952
4038
|
this.scope.addStatement(tsDeclareVariable(ctx, type));
|
|
3953
4039
|
return ctx;
|
|
3954
4040
|
}
|
|
@@ -4001,16 +4087,16 @@ var TcbTemplateBodyOp = class extends TcbOp {
|
|
|
4001
4087
|
}
|
|
4002
4088
|
let guard = null;
|
|
4003
4089
|
if (directiveGuards.length > 0) {
|
|
4004
|
-
guard = directiveGuards.reduce((expr, dirGuard) =>
|
|
4090
|
+
guard = directiveGuards.reduce((expr, dirGuard) => ts28.factory.createBinaryExpression(expr, ts28.SyntaxKind.AmpersandAmpersandToken, dirGuard), directiveGuards.pop());
|
|
4005
4091
|
}
|
|
4006
4092
|
const tmplScope = Scope.forNodes(this.tcb, this.scope, this.template, this.template.children, guard);
|
|
4007
4093
|
const statements = tmplScope.render();
|
|
4008
4094
|
if (statements.length === 0) {
|
|
4009
4095
|
return null;
|
|
4010
4096
|
}
|
|
4011
|
-
let tmplBlock =
|
|
4097
|
+
let tmplBlock = ts28.factory.createBlock(statements);
|
|
4012
4098
|
if (guard !== null) {
|
|
4013
|
-
tmplBlock =
|
|
4099
|
+
tmplBlock = ts28.factory.createIfStatement(guard, tmplBlock);
|
|
4014
4100
|
}
|
|
4015
4101
|
this.scope.addStatement(tmplBlock);
|
|
4016
4102
|
return null;
|
|
@@ -4028,7 +4114,7 @@ var TcbExpressionOp = class extends TcbOp {
|
|
|
4028
4114
|
}
|
|
4029
4115
|
execute() {
|
|
4030
4116
|
const expr = tcbExpression(this.expression, this.tcb, this.scope);
|
|
4031
|
-
this.scope.addStatement(
|
|
4117
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(expr));
|
|
4032
4118
|
return null;
|
|
4033
4119
|
}
|
|
4034
4120
|
};
|
|
@@ -4050,11 +4136,11 @@ var TcbDirectiveTypeOpBase = class extends TcbOp {
|
|
|
4050
4136
|
if (this.dir.isGeneric === false || dirRef.node.typeParameters === void 0) {
|
|
4051
4137
|
type = rawType;
|
|
4052
4138
|
} else {
|
|
4053
|
-
if (!
|
|
4139
|
+
if (!ts28.isTypeReferenceNode(rawType)) {
|
|
4054
4140
|
throw new Error(`Expected TypeReferenceNode when referencing the type for ${this.dir.ref.debugName}`);
|
|
4055
4141
|
}
|
|
4056
|
-
const typeArguments = dirRef.node.typeParameters.map(() =>
|
|
4057
|
-
type =
|
|
4142
|
+
const typeArguments = dirRef.node.typeParameters.map(() => ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
|
|
4143
|
+
type = ts28.factory.createTypeReferenceNode(rawType.typeName, typeArguments);
|
|
4058
4144
|
}
|
|
4059
4145
|
const id = this.tcb.allocateId();
|
|
4060
4146
|
addExpressionIdentifier(type, ExpressionIdentifier.DIRECTIVE);
|
|
@@ -4095,11 +4181,11 @@ var TcbReferenceOp = class extends TcbOp {
|
|
|
4095
4181
|
const id = this.tcb.allocateId();
|
|
4096
4182
|
let initializer = this.target instanceof TmplAstTemplate2 || this.target instanceof TmplAstElement3 ? this.scope.resolve(this.target) : this.scope.resolve(this.host, this.target);
|
|
4097
4183
|
if (this.target instanceof TmplAstElement3 && !this.tcb.env.config.checkTypeOfDomReferences || !this.tcb.env.config.checkTypeOfNonDomReferences) {
|
|
4098
|
-
initializer =
|
|
4184
|
+
initializer = ts28.factory.createAsExpression(initializer, ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
|
|
4099
4185
|
} else if (this.target instanceof TmplAstTemplate2) {
|
|
4100
|
-
initializer =
|
|
4101
|
-
initializer =
|
|
4102
|
-
initializer =
|
|
4186
|
+
initializer = ts28.factory.createAsExpression(initializer, ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
|
|
4187
|
+
initializer = ts28.factory.createAsExpression(initializer, this.tcb.env.referenceExternalType("@angular/core", "TemplateRef", [DYNAMIC_TYPE]));
|
|
4188
|
+
initializer = ts28.factory.createParenthesizedExpression(initializer);
|
|
4103
4189
|
}
|
|
4104
4190
|
addParseSpanInfo(initializer, this.node.sourceSpan);
|
|
4105
4191
|
addParseSpanInfo(id, this.node.keySpan);
|
|
@@ -4192,7 +4278,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
4192
4278
|
type = this.tcb.env.referenceTransplantedType(new TransplantedType(transformType));
|
|
4193
4279
|
} else {
|
|
4194
4280
|
const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
|
|
4195
|
-
if (!
|
|
4281
|
+
if (!ts28.isTypeReferenceNode(dirTypeRef)) {
|
|
4196
4282
|
throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
|
|
4197
4283
|
}
|
|
4198
4284
|
type = tsCreateTypeQueryForCoercedInput(dirTypeRef.typeName, fieldName);
|
|
@@ -4208,10 +4294,10 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
4208
4294
|
}
|
|
4209
4295
|
const id = this.tcb.allocateId();
|
|
4210
4296
|
const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
|
|
4211
|
-
if (!
|
|
4297
|
+
if (!ts28.isTypeReferenceNode(dirTypeRef)) {
|
|
4212
4298
|
throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
|
|
4213
4299
|
}
|
|
4214
|
-
const type =
|
|
4300
|
+
const type = ts28.factory.createIndexedAccessTypeNode(ts28.factory.createTypeQueryNode(dirId), ts28.factory.createLiteralTypeNode(ts28.factory.createStringLiteral(fieldName)));
|
|
4215
4301
|
const temp = tsDeclareVariable(id, type);
|
|
4216
4302
|
this.scope.addStatement(temp);
|
|
4217
4303
|
target = id;
|
|
@@ -4219,18 +4305,18 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
4219
4305
|
if (dirId === null) {
|
|
4220
4306
|
dirId = this.scope.resolve(this.node, this.dir);
|
|
4221
4307
|
}
|
|
4222
|
-
target = this.dir.stringLiteralInputFields.has(fieldName) ?
|
|
4308
|
+
target = this.dir.stringLiteralInputFields.has(fieldName) ? ts28.factory.createElementAccessExpression(dirId, ts28.factory.createStringLiteral(fieldName)) : ts28.factory.createPropertyAccessExpression(dirId, ts28.factory.createIdentifier(fieldName));
|
|
4223
4309
|
}
|
|
4224
4310
|
if (attr.attribute.keySpan !== void 0) {
|
|
4225
4311
|
addParseSpanInfo(target, attr.attribute.keySpan);
|
|
4226
4312
|
}
|
|
4227
|
-
assignment =
|
|
4313
|
+
assignment = ts28.factory.createBinaryExpression(target, ts28.SyntaxKind.EqualsToken, assignment);
|
|
4228
4314
|
}
|
|
4229
4315
|
addParseSpanInfo(assignment, attr.attribute.sourceSpan);
|
|
4230
4316
|
if (!this.tcb.env.config.checkTypeOfAttributes && attr.attribute instanceof TmplAstTextAttribute2) {
|
|
4231
4317
|
markIgnoreDiagnostics(assignment);
|
|
4232
4318
|
}
|
|
4233
|
-
this.scope.addStatement(
|
|
4319
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(assignment));
|
|
4234
4320
|
}
|
|
4235
4321
|
this.checkRequiredInputs(seenRequiredInputs);
|
|
4236
4322
|
return null;
|
|
@@ -4261,7 +4347,7 @@ var TcbDirectiveCtorCircularFallbackOp = class extends TcbOp {
|
|
|
4261
4347
|
execute() {
|
|
4262
4348
|
const id = this.tcb.allocateId();
|
|
4263
4349
|
const typeCtor = this.tcb.env.typeCtorFor(this.dir);
|
|
4264
|
-
const circularPlaceholder =
|
|
4350
|
+
const circularPlaceholder = ts28.factory.createCallExpression(typeCtor, void 0, [ts28.factory.createNonNullExpression(ts28.factory.createNull())]);
|
|
4265
4351
|
this.scope.addStatement(tsCreateVariable(id, circularPlaceholder));
|
|
4266
4352
|
return id;
|
|
4267
4353
|
}
|
|
@@ -4329,15 +4415,15 @@ var TcbUnclaimedInputsOp = class extends TcbOp {
|
|
|
4329
4415
|
elId = this.scope.resolve(this.element);
|
|
4330
4416
|
}
|
|
4331
4417
|
const propertyName = (_a = ATTR_TO_PROP.get(binding.name)) != null ? _a : binding.name;
|
|
4332
|
-
const prop =
|
|
4333
|
-
const stmt =
|
|
4418
|
+
const prop = ts28.factory.createElementAccessExpression(elId, ts28.factory.createStringLiteral(propertyName));
|
|
4419
|
+
const stmt = ts28.factory.createBinaryExpression(prop, ts28.SyntaxKind.EqualsToken, wrapForDiagnostics(expr));
|
|
4334
4420
|
addParseSpanInfo(stmt, binding.sourceSpan);
|
|
4335
|
-
this.scope.addStatement(
|
|
4421
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(stmt));
|
|
4336
4422
|
} else {
|
|
4337
|
-
this.scope.addStatement(
|
|
4423
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(expr));
|
|
4338
4424
|
}
|
|
4339
4425
|
} else {
|
|
4340
|
-
this.scope.addStatement(
|
|
4426
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(expr));
|
|
4341
4427
|
}
|
|
4342
4428
|
}
|
|
4343
4429
|
return null;
|
|
@@ -4369,18 +4455,18 @@ var TcbDirectiveOutputsOp = class extends TcbOp {
|
|
|
4369
4455
|
if (dirId === null) {
|
|
4370
4456
|
dirId = this.scope.resolve(this.node, this.dir);
|
|
4371
4457
|
}
|
|
4372
|
-
const outputField =
|
|
4458
|
+
const outputField = ts28.factory.createElementAccessExpression(dirId, ts28.factory.createStringLiteral(field));
|
|
4373
4459
|
addParseSpanInfo(outputField, output.keySpan);
|
|
4374
4460
|
if (this.tcb.env.config.checkTypeOfOutputEvents) {
|
|
4375
4461
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
|
|
4376
|
-
const subscribeFn =
|
|
4377
|
-
const call =
|
|
4462
|
+
const subscribeFn = ts28.factory.createPropertyAccessExpression(outputField, "subscribe");
|
|
4463
|
+
const call = ts28.factory.createCallExpression(subscribeFn, void 0, [handler]);
|
|
4378
4464
|
addParseSpanInfo(call, output.sourceSpan);
|
|
4379
|
-
this.scope.addStatement(
|
|
4465
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(call));
|
|
4380
4466
|
} else {
|
|
4381
|
-
this.scope.addStatement(
|
|
4467
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(outputField));
|
|
4382
4468
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
4383
|
-
this.scope.addStatement(
|
|
4469
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(handler));
|
|
4384
4470
|
}
|
|
4385
4471
|
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
4386
4472
|
}
|
|
@@ -4413,24 +4499,24 @@ var TcbUnclaimedOutputsOp = class extends TcbOp {
|
|
|
4413
4499
|
if (output.type === 1) {
|
|
4414
4500
|
const eventType = this.tcb.env.config.checkTypeOfAnimationEvents ? this.tcb.env.referenceExternalType("@angular/animations", "AnimationEvent") : 1;
|
|
4415
4501
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, eventType);
|
|
4416
|
-
this.scope.addStatement(
|
|
4502
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(handler));
|
|
4417
4503
|
} else if (this.tcb.env.config.checkTypeOfDomEvents) {
|
|
4418
4504
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
|
|
4419
4505
|
if (elId === null) {
|
|
4420
4506
|
elId = this.scope.resolve(this.element);
|
|
4421
4507
|
}
|
|
4422
|
-
const propertyAccess =
|
|
4508
|
+
const propertyAccess = ts28.factory.createPropertyAccessExpression(elId, "addEventListener");
|
|
4423
4509
|
addParseSpanInfo(propertyAccess, output.keySpan);
|
|
4424
|
-
const call =
|
|
4510
|
+
const call = ts28.factory.createCallExpression(
|
|
4425
4511
|
propertyAccess,
|
|
4426
4512
|
void 0,
|
|
4427
|
-
[
|
|
4513
|
+
[ts28.factory.createStringLiteral(output.name), handler]
|
|
4428
4514
|
);
|
|
4429
4515
|
addParseSpanInfo(call, output.sourceSpan);
|
|
4430
|
-
this.scope.addStatement(
|
|
4516
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(call));
|
|
4431
4517
|
} else {
|
|
4432
4518
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
4433
|
-
this.scope.addStatement(
|
|
4519
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(handler));
|
|
4434
4520
|
}
|
|
4435
4521
|
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
4436
4522
|
}
|
|
@@ -4444,11 +4530,11 @@ var TcbComponentContextCompletionOp = class extends TcbOp {
|
|
|
4444
4530
|
this.optional = false;
|
|
4445
4531
|
}
|
|
4446
4532
|
execute() {
|
|
4447
|
-
const ctx =
|
|
4448
|
-
const ctxDot =
|
|
4533
|
+
const ctx = ts28.factory.createThis();
|
|
4534
|
+
const ctxDot = ts28.factory.createPropertyAccessExpression(ctx, "");
|
|
4449
4535
|
markIgnoreDiagnostics(ctxDot);
|
|
4450
4536
|
addExpressionIdentifier(ctxDot, ExpressionIdentifier.COMPONENT_COMPLETION);
|
|
4451
|
-
this.scope.addStatement(
|
|
4537
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(ctxDot));
|
|
4452
4538
|
return null;
|
|
4453
4539
|
}
|
|
4454
4540
|
};
|
|
@@ -4494,6 +4580,7 @@ var TcbIfOp = class extends TcbOp {
|
|
|
4494
4580
|
this.tcb = tcb;
|
|
4495
4581
|
this.scope = scope;
|
|
4496
4582
|
this.block = block;
|
|
4583
|
+
this.expressionScopes = /* @__PURE__ */ new Map();
|
|
4497
4584
|
}
|
|
4498
4585
|
get optional() {
|
|
4499
4586
|
return false;
|
|
@@ -4509,19 +4596,38 @@ var TcbIfOp = class extends TcbOp {
|
|
|
4509
4596
|
return void 0;
|
|
4510
4597
|
}
|
|
4511
4598
|
if (branch.expression === null) {
|
|
4512
|
-
const
|
|
4513
|
-
return
|
|
4599
|
+
const branchScope = Scope.forNodes(this.tcb, this.scope, null, branch.children, this.generateBranchGuard(index));
|
|
4600
|
+
return ts28.factory.createBlock(branchScope.render());
|
|
4514
4601
|
}
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4602
|
+
const expressionScope = Scope.forNodes(this.tcb, this.scope, branch, [], null);
|
|
4603
|
+
expressionScope.render().forEach((stmt) => this.scope.addStatement(stmt));
|
|
4604
|
+
this.expressionScopes.set(branch, expressionScope);
|
|
4605
|
+
const expression = branch.expressionAlias === null ? tcbExpression(branch.expression, this.tcb, expressionScope) : expressionScope.resolve(branch.expressionAlias);
|
|
4606
|
+
const bodyScope = Scope.forNodes(this.tcb, expressionScope, null, branch.children, this.generateBranchGuard(index));
|
|
4607
|
+
return ts28.factory.createIfStatement(expression, ts28.factory.createBlock(bodyScope.render()), this.generateBranch(index + 1));
|
|
4608
|
+
}
|
|
4609
|
+
generateBranchGuard(index) {
|
|
4610
|
+
let guard = null;
|
|
4611
|
+
for (let i = 0; i <= index; i++) {
|
|
4612
|
+
const branch = this.block.branches[i];
|
|
4613
|
+
if (branch.expression === null) {
|
|
4614
|
+
continue;
|
|
4615
|
+
}
|
|
4616
|
+
if (!this.expressionScopes.has(branch)) {
|
|
4617
|
+
throw new Error(`Could not determine expression scope of branch at index ${i}`);
|
|
4618
|
+
}
|
|
4619
|
+
const expressionScope = this.expressionScopes.get(branch);
|
|
4620
|
+
let expression;
|
|
4621
|
+
if (branch.expressionAlias === null) {
|
|
4622
|
+
expression = tcbExpression(branch.expression, this.tcb, expressionScope);
|
|
4623
|
+
markIgnoreDiagnostics(expression);
|
|
4624
|
+
} else {
|
|
4625
|
+
expression = expressionScope.resolve(branch.expressionAlias);
|
|
4626
|
+
}
|
|
4627
|
+
const comparisonExpression = i === index ? expression : ts28.factory.createPrefixUnaryExpression(ts28.SyntaxKind.ExclamationToken, ts28.factory.createParenthesizedExpression(expression));
|
|
4628
|
+
guard = guard === null ? comparisonExpression : ts28.factory.createBinaryExpression(guard, ts28.SyntaxKind.AmpersandAmpersandToken, comparisonExpression);
|
|
4521
4629
|
}
|
|
4522
|
-
|
|
4523
|
-
const expression = branch.expressionAlias === null ? tcbExpression(branch.expression, this.tcb, branchScope) : branchScope.resolve(branch.expressionAlias);
|
|
4524
|
-
return ts27.factory.createIfStatement(expression, ts27.factory.createBlock(branchScope.render()), this.generateBranch(index + 1));
|
|
4630
|
+
return guard;
|
|
4525
4631
|
}
|
|
4526
4632
|
};
|
|
4527
4633
|
var TcbSwitchOp = class extends TcbOp {
|
|
@@ -4535,18 +4641,51 @@ var TcbSwitchOp = class extends TcbOp {
|
|
|
4535
4641
|
return false;
|
|
4536
4642
|
}
|
|
4537
4643
|
execute() {
|
|
4538
|
-
const
|
|
4644
|
+
const expression = tcbExpression(this.block.expression, this.tcb, this.scope);
|
|
4645
|
+
markIgnoreDiagnostics(expression);
|
|
4646
|
+
const root = this.generateCase(0, expression, null);
|
|
4647
|
+
if (root !== void 0) {
|
|
4648
|
+
this.scope.addStatement(root);
|
|
4649
|
+
}
|
|
4650
|
+
return null;
|
|
4651
|
+
}
|
|
4652
|
+
generateCase(index, switchValue, defaultCase) {
|
|
4653
|
+
if (index >= this.block.cases.length) {
|
|
4654
|
+
if (defaultCase !== null) {
|
|
4655
|
+
const defaultScope = Scope.forNodes(this.tcb, this.scope, null, defaultCase.children, this.generateGuard(defaultCase, switchValue));
|
|
4656
|
+
return ts28.factory.createBlock(defaultScope.render());
|
|
4657
|
+
}
|
|
4658
|
+
return void 0;
|
|
4659
|
+
}
|
|
4660
|
+
const current = this.block.cases[index];
|
|
4661
|
+
if (current.expression === null) {
|
|
4662
|
+
return this.generateCase(index + 1, switchValue, current);
|
|
4663
|
+
}
|
|
4664
|
+
const caseScope = Scope.forNodes(this.tcb, this.scope, null, current.children, this.generateGuard(current, switchValue));
|
|
4665
|
+
const caseValue = tcbExpression(current.expression, this.tcb, caseScope);
|
|
4666
|
+
return ts28.factory.createIfStatement(ts28.factory.createBinaryExpression(switchValue, ts28.SyntaxKind.EqualsEqualsEqualsToken, caseValue), ts28.factory.createBlock(caseScope.render()), this.generateCase(index + 1, switchValue, defaultCase));
|
|
4667
|
+
}
|
|
4668
|
+
generateGuard(node, switchValue) {
|
|
4669
|
+
if (node.expression !== null) {
|
|
4670
|
+
const expression = tcbExpression(node.expression, this.tcb, this.scope);
|
|
4671
|
+
markIgnoreDiagnostics(expression);
|
|
4672
|
+
return ts28.factory.createBinaryExpression(switchValue, ts28.SyntaxKind.EqualsEqualsEqualsToken, expression);
|
|
4673
|
+
}
|
|
4674
|
+
let guard = null;
|
|
4539
4675
|
for (const current of this.block.cases) {
|
|
4540
|
-
const breakStatement = ts27.factory.createBreakStatement();
|
|
4541
|
-
const clauseScope = Scope.forNodes(this.tcb, this.scope, null, current.children, null);
|
|
4542
4676
|
if (current.expression === null) {
|
|
4543
|
-
|
|
4677
|
+
continue;
|
|
4678
|
+
}
|
|
4679
|
+
const expression = tcbExpression(current.expression, this.tcb, this.scope);
|
|
4680
|
+
markIgnoreDiagnostics(expression);
|
|
4681
|
+
const comparison = ts28.factory.createBinaryExpression(switchValue, ts28.SyntaxKind.ExclamationEqualsEqualsToken, expression);
|
|
4682
|
+
if (guard === null) {
|
|
4683
|
+
guard = comparison;
|
|
4544
4684
|
} else {
|
|
4545
|
-
|
|
4685
|
+
guard = ts28.factory.createBinaryExpression(guard, ts28.SyntaxKind.AmpersandAmpersandToken, comparison);
|
|
4546
4686
|
}
|
|
4547
4687
|
}
|
|
4548
|
-
|
|
4549
|
-
return null;
|
|
4688
|
+
return guard;
|
|
4550
4689
|
}
|
|
4551
4690
|
};
|
|
4552
4691
|
var TcbForOfOp = class extends TcbOp {
|
|
@@ -4561,19 +4700,19 @@ var TcbForOfOp = class extends TcbOp {
|
|
|
4561
4700
|
}
|
|
4562
4701
|
execute() {
|
|
4563
4702
|
const loopScope = Scope.forNodes(this.tcb, this.scope, this.block, this.block.children, null);
|
|
4564
|
-
const initializer =
|
|
4565
|
-
const expression =
|
|
4703
|
+
const initializer = ts28.factory.createVariableDeclarationList([ts28.factory.createVariableDeclaration(this.block.item.name)], ts28.NodeFlags.Const);
|
|
4704
|
+
const expression = ts28.factory.createNonNullExpression(tcbExpression(this.block.expression, this.tcb, loopScope));
|
|
4566
4705
|
const trackTranslator = new TcbForLoopTrackTranslator(this.tcb, loopScope, this.block);
|
|
4567
4706
|
const trackExpression = trackTranslator.translate(this.block.trackBy);
|
|
4568
4707
|
const statements = [
|
|
4569
4708
|
...loopScope.render(),
|
|
4570
|
-
|
|
4709
|
+
ts28.factory.createExpressionStatement(trackExpression)
|
|
4571
4710
|
];
|
|
4572
|
-
this.scope.addStatement(
|
|
4711
|
+
this.scope.addStatement(ts28.factory.createForOfStatement(void 0, initializer, expression, ts28.factory.createBlock(statements)));
|
|
4573
4712
|
return null;
|
|
4574
4713
|
}
|
|
4575
4714
|
};
|
|
4576
|
-
var INFER_TYPE_FOR_CIRCULAR_OP_EXPR =
|
|
4715
|
+
var INFER_TYPE_FOR_CIRCULAR_OP_EXPR = ts28.factory.createNonNullExpression(ts28.factory.createNull());
|
|
4577
4716
|
var Context = class {
|
|
4578
4717
|
constructor(env, domSchemaChecker, oobRecorder, id, boundTarget, pipes, schemas, hostIsStandalone) {
|
|
4579
4718
|
this.env = env;
|
|
@@ -4587,7 +4726,7 @@ var Context = class {
|
|
|
4587
4726
|
this.nextId = 1;
|
|
4588
4727
|
}
|
|
4589
4728
|
allocateId() {
|
|
4590
|
-
return
|
|
4729
|
+
return ts28.factory.createIdentifier(`_t${this.nextId++}`);
|
|
4591
4730
|
}
|
|
4592
4731
|
getPipeByName(name) {
|
|
4593
4732
|
if (!this.pipes.has(name)) {
|
|
@@ -4631,9 +4770,9 @@ var Scope = class {
|
|
|
4631
4770
|
this.registerVariable(scope, expressionAlias, new TcbBlockVariableOp(tcb, scope, tcbExpression(expression, tcb, scope), expressionAlias));
|
|
4632
4771
|
}
|
|
4633
4772
|
} else if (scopedNode instanceof TmplAstForLoopBlock) {
|
|
4634
|
-
this.registerVariable(scope, scopedNode.item, new TcbBlockVariableOp(tcb, scope,
|
|
4773
|
+
this.registerVariable(scope, scopedNode.item, new TcbBlockVariableOp(tcb, scope, ts28.factory.createIdentifier(scopedNode.item.name), scopedNode.item));
|
|
4635
4774
|
for (const variable of Object.values(scopedNode.contextVariables)) {
|
|
4636
|
-
const type =
|
|
4775
|
+
const type = ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.NumberKeyword);
|
|
4637
4776
|
this.registerVariable(scope, variable, new TcbBlockImplicitVariableOp(tcb, scope, type, variable));
|
|
4638
4777
|
}
|
|
4639
4778
|
}
|
|
@@ -4650,16 +4789,16 @@ var Scope = class {
|
|
|
4650
4789
|
const res = this.resolveLocal(node, directive);
|
|
4651
4790
|
if (res !== null) {
|
|
4652
4791
|
let clone;
|
|
4653
|
-
if (
|
|
4654
|
-
clone =
|
|
4655
|
-
} else if (
|
|
4656
|
-
clone =
|
|
4792
|
+
if (ts28.isIdentifier(res)) {
|
|
4793
|
+
clone = ts28.factory.createIdentifier(res.text);
|
|
4794
|
+
} else if (ts28.isNonNullExpression(res)) {
|
|
4795
|
+
clone = ts28.factory.createNonNullExpression(res.expression);
|
|
4657
4796
|
} else {
|
|
4658
4797
|
throw new Error(`Could not resolve ${node} to an Identifier or a NonNullExpression`);
|
|
4659
4798
|
}
|
|
4660
|
-
|
|
4799
|
+
ts28.setOriginalNode(clone, res);
|
|
4661
4800
|
clone.parent = clone.parent;
|
|
4662
|
-
return
|
|
4801
|
+
return ts28.setSyntheticTrailingComments(clone, []);
|
|
4663
4802
|
} else if (this.parent !== null) {
|
|
4664
4803
|
return this.parent.resolve(node, directive);
|
|
4665
4804
|
} else {
|
|
@@ -4686,7 +4825,7 @@ var Scope = class {
|
|
|
4686
4825
|
} else if (parentGuards === null) {
|
|
4687
4826
|
return this.guard;
|
|
4688
4827
|
} else {
|
|
4689
|
-
return
|
|
4828
|
+
return ts28.factory.createBinaryExpression(parentGuards, ts28.SyntaxKind.AmpersandAmpersandToken, this.guard);
|
|
4690
4829
|
}
|
|
4691
4830
|
}
|
|
4692
4831
|
resolveLocal(ref, directive) {
|
|
@@ -4753,7 +4892,7 @@ var Scope = class {
|
|
|
4753
4892
|
} else if (node instanceof TmplAstIfBlock) {
|
|
4754
4893
|
this.opQueue.push(new TcbIfOp(this.tcb, this, node));
|
|
4755
4894
|
} else if (node instanceof TmplAstSwitchBlock) {
|
|
4756
|
-
this.opQueue.push(new TcbSwitchOp(this.tcb, this, node));
|
|
4895
|
+
this.opQueue.push(new TcbExpressionOp(this.tcb, this, node.expression), new TcbSwitchOp(this.tcb, this, node));
|
|
4757
4896
|
} else if (node instanceof TmplAstForLoopBlock) {
|
|
4758
4897
|
this.opQueue.push(new TcbForOfOp(this.tcb, this, node));
|
|
4759
4898
|
node.empty && this.appendChildren(node.empty);
|
|
@@ -4911,12 +5050,12 @@ var Scope = class {
|
|
|
4911
5050
|
}
|
|
4912
5051
|
};
|
|
4913
5052
|
function tcbThisParam(name, typeArguments) {
|
|
4914
|
-
return
|
|
5053
|
+
return ts28.factory.createParameterDeclaration(
|
|
4915
5054
|
void 0,
|
|
4916
5055
|
void 0,
|
|
4917
5056
|
"this",
|
|
4918
5057
|
void 0,
|
|
4919
|
-
|
|
5058
|
+
ts28.factory.createTypeReferenceNode(name, typeArguments),
|
|
4920
5059
|
void 0
|
|
4921
5060
|
);
|
|
4922
5061
|
}
|
|
@@ -4941,11 +5080,11 @@ var TcbExpressionTranslator = class {
|
|
|
4941
5080
|
return null;
|
|
4942
5081
|
}
|
|
4943
5082
|
const expr = this.translate(ast.value);
|
|
4944
|
-
const result =
|
|
5083
|
+
const result = ts28.factory.createParenthesizedExpression(ts28.factory.createBinaryExpression(target, ts28.SyntaxKind.EqualsToken, expr));
|
|
4945
5084
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
4946
5085
|
return result;
|
|
4947
5086
|
} else if (ast instanceof ImplicitReceiver4) {
|
|
4948
|
-
return
|
|
5087
|
+
return ts28.factory.createThis();
|
|
4949
5088
|
} else if (ast instanceof BindingPipe) {
|
|
4950
5089
|
const expr = this.translate(ast.exp);
|
|
4951
5090
|
const pipeRef = this.tcb.getPipeByName(ast.name);
|
|
@@ -4957,12 +5096,12 @@ var TcbExpressionTranslator = class {
|
|
|
4957
5096
|
pipe = this.tcb.env.pipeInst(pipeRef);
|
|
4958
5097
|
}
|
|
4959
5098
|
const args = ast.args.map((arg) => this.translate(arg));
|
|
4960
|
-
let methodAccess =
|
|
5099
|
+
let methodAccess = ts28.factory.createPropertyAccessExpression(pipe, "transform");
|
|
4961
5100
|
addParseSpanInfo(methodAccess, ast.nameSpan);
|
|
4962
5101
|
if (!this.tcb.env.config.checkTypeOfPipes) {
|
|
4963
|
-
methodAccess =
|
|
5102
|
+
methodAccess = ts28.factory.createAsExpression(methodAccess, ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
|
|
4964
5103
|
}
|
|
4965
|
-
const result =
|
|
5104
|
+
const result = ts28.factory.createCallExpression(
|
|
4966
5105
|
methodAccess,
|
|
4967
5106
|
void 0,
|
|
4968
5107
|
[expr, ...args]
|
|
@@ -4972,8 +5111,8 @@ var TcbExpressionTranslator = class {
|
|
|
4972
5111
|
} else if ((ast instanceof Call2 || ast instanceof SafeCall) && (ast.receiver instanceof PropertyRead4 || ast.receiver instanceof SafePropertyRead3)) {
|
|
4973
5112
|
if (ast.receiver.receiver instanceof ImplicitReceiver4 && !(ast.receiver.receiver instanceof ThisReceiver) && ast.receiver.name === "$any" && ast.args.length === 1) {
|
|
4974
5113
|
const expr = this.translate(ast.args[0]);
|
|
4975
|
-
const exprAsAny =
|
|
4976
|
-
const result =
|
|
5114
|
+
const exprAsAny = ts28.factory.createAsExpression(expr, ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
|
|
5115
|
+
const result = ts28.factory.createParenthesizedExpression(exprAsAny);
|
|
4977
5116
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
4978
5117
|
return result;
|
|
4979
5118
|
}
|
|
@@ -4984,7 +5123,7 @@ var TcbExpressionTranslator = class {
|
|
|
4984
5123
|
const method = wrapForDiagnostics(receiver);
|
|
4985
5124
|
addParseSpanInfo(method, ast.receiver.nameSpan);
|
|
4986
5125
|
const args = ast.args.map((arg) => this.translate(arg));
|
|
4987
|
-
const node =
|
|
5126
|
+
const node = ts28.factory.createCallExpression(method, void 0, args);
|
|
4988
5127
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
4989
5128
|
return node;
|
|
4990
5129
|
} else {
|
|
@@ -5004,20 +5143,20 @@ var TcbExpressionTranslator = class {
|
|
|
5004
5143
|
function tcbCallTypeCtor(dir, tcb, inputs) {
|
|
5005
5144
|
const typeCtor = tcb.env.typeCtorFor(dir);
|
|
5006
5145
|
const members = inputs.map((input) => {
|
|
5007
|
-
const propertyName =
|
|
5146
|
+
const propertyName = ts28.factory.createStringLiteral(input.field);
|
|
5008
5147
|
if (input.type === "binding") {
|
|
5009
5148
|
const expr = widenBinding(input.expression, tcb);
|
|
5010
|
-
const assignment =
|
|
5149
|
+
const assignment = ts28.factory.createPropertyAssignment(propertyName, wrapForDiagnostics(expr));
|
|
5011
5150
|
addParseSpanInfo(assignment, input.sourceSpan);
|
|
5012
5151
|
return assignment;
|
|
5013
5152
|
} else {
|
|
5014
|
-
return
|
|
5153
|
+
return ts28.factory.createPropertyAssignment(propertyName, NULL_AS_ANY);
|
|
5015
5154
|
}
|
|
5016
5155
|
});
|
|
5017
|
-
return
|
|
5156
|
+
return ts28.factory.createCallExpression(
|
|
5018
5157
|
typeCtor,
|
|
5019
5158
|
void 0,
|
|
5020
|
-
[
|
|
5159
|
+
[ts28.factory.createObjectLiteralExpression(members)]
|
|
5021
5160
|
);
|
|
5022
5161
|
}
|
|
5023
5162
|
function getBoundAttributes(directive, node) {
|
|
@@ -5052,17 +5191,17 @@ function translateInput(attr, tcb, scope) {
|
|
|
5052
5191
|
if (attr instanceof TmplAstBoundAttribute) {
|
|
5053
5192
|
return tcbExpression(attr.value, tcb, scope);
|
|
5054
5193
|
} else {
|
|
5055
|
-
return
|
|
5194
|
+
return ts28.factory.createStringLiteral(attr.value);
|
|
5056
5195
|
}
|
|
5057
5196
|
}
|
|
5058
5197
|
function widenBinding(expr, tcb) {
|
|
5059
5198
|
if (!tcb.env.config.checkTypeOfInputBindings) {
|
|
5060
5199
|
return tsCastToAny(expr);
|
|
5061
5200
|
} else if (!tcb.env.config.strictNullInputBindings) {
|
|
5062
|
-
if (
|
|
5201
|
+
if (ts28.isObjectLiteralExpression(expr) || ts28.isArrayLiteralExpression(expr)) {
|
|
5063
5202
|
return expr;
|
|
5064
5203
|
} else {
|
|
5065
|
-
return
|
|
5204
|
+
return ts28.factory.createNonNullExpression(expr);
|
|
5066
5205
|
}
|
|
5067
5206
|
} else {
|
|
5068
5207
|
return expr;
|
|
@@ -5075,16 +5214,16 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
|
|
|
5075
5214
|
if (eventType === 0) {
|
|
5076
5215
|
eventParamType = void 0;
|
|
5077
5216
|
} else if (eventType === 1) {
|
|
5078
|
-
eventParamType =
|
|
5217
|
+
eventParamType = ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword);
|
|
5079
5218
|
} else {
|
|
5080
5219
|
eventParamType = eventType;
|
|
5081
5220
|
}
|
|
5082
5221
|
const guards = scope.guards();
|
|
5083
|
-
let body =
|
|
5222
|
+
let body = ts28.factory.createExpressionStatement(handler);
|
|
5084
5223
|
if (guards !== null) {
|
|
5085
|
-
body =
|
|
5224
|
+
body = ts28.factory.createIfStatement(guards, body);
|
|
5086
5225
|
}
|
|
5087
|
-
const eventParam =
|
|
5226
|
+
const eventParam = ts28.factory.createParameterDeclaration(
|
|
5088
5227
|
void 0,
|
|
5089
5228
|
void 0,
|
|
5090
5229
|
EVENT_PARAMETER,
|
|
@@ -5092,13 +5231,13 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
|
|
|
5092
5231
|
eventParamType
|
|
5093
5232
|
);
|
|
5094
5233
|
addExpressionIdentifier(eventParam, ExpressionIdentifier.EVENT_PARAMETER);
|
|
5095
|
-
return
|
|
5234
|
+
return ts28.factory.createArrowFunction(
|
|
5096
5235
|
void 0,
|
|
5097
5236
|
void 0,
|
|
5098
5237
|
[eventParam],
|
|
5099
|
-
|
|
5238
|
+
ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword),
|
|
5100
5239
|
void 0,
|
|
5101
|
-
|
|
5240
|
+
ts28.factory.createBlock([body])
|
|
5102
5241
|
);
|
|
5103
5242
|
}
|
|
5104
5243
|
function tcbEventHandlerExpression(ast, tcb, scope) {
|
|
@@ -5127,7 +5266,7 @@ function isSplitTwoWayBinding(inputName, output, inputs, tcb) {
|
|
|
5127
5266
|
var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
|
|
5128
5267
|
resolve(ast) {
|
|
5129
5268
|
if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver4 && !(ast.receiver instanceof ThisReceiver) && ast.name === EVENT_PARAMETER) {
|
|
5130
|
-
const event =
|
|
5269
|
+
const event = ts28.factory.createIdentifier(EVENT_PARAMETER);
|
|
5131
5270
|
addParseSpanInfo(event, ast.nameSpan);
|
|
5132
5271
|
return event;
|
|
5133
5272
|
}
|
|
@@ -5150,33 +5289,33 @@ var TcbForLoopTrackTranslator = class extends TcbExpressionTranslator {
|
|
|
5150
5289
|
}
|
|
5151
5290
|
};
|
|
5152
5291
|
|
|
5153
|
-
// bazel-out/
|
|
5154
|
-
import
|
|
5292
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_file.mjs
|
|
5293
|
+
import ts29 from "typescript";
|
|
5155
5294
|
var TypeCheckFile = class extends Environment {
|
|
5156
5295
|
constructor(fileName, config, refEmitter, reflector, compilerHost) {
|
|
5157
|
-
super(config, new ImportManager(new NoopImportRewriter(), "i"), refEmitter, reflector,
|
|
5296
|
+
super(config, new ImportManager(new NoopImportRewriter(), "i"), refEmitter, reflector, ts29.createSourceFile(compilerHost.getCanonicalFileName(fileName), "", ts29.ScriptTarget.Latest, true));
|
|
5158
5297
|
this.fileName = fileName;
|
|
5159
5298
|
this.nextTcbId = 1;
|
|
5160
5299
|
this.tcbStatements = [];
|
|
5161
5300
|
}
|
|
5162
5301
|
addTypeCheckBlock(ref, meta, domSchemaChecker, oobRecorder, genericContextBehavior) {
|
|
5163
|
-
const fnId =
|
|
5302
|
+
const fnId = ts29.factory.createIdentifier(`_tcb${this.nextTcbId++}`);
|
|
5164
5303
|
const fn = generateTypeCheckBlock(this, ref, fnId, meta, domSchemaChecker, oobRecorder, genericContextBehavior);
|
|
5165
5304
|
this.tcbStatements.push(fn);
|
|
5166
5305
|
}
|
|
5167
5306
|
render(removeComments) {
|
|
5168
5307
|
let source = this.importManager.getAllImports(this.contextFile.fileName).map((i) => `import * as ${i.qualifier.text} from '${i.specifier}';`).join("\n") + "\n\n";
|
|
5169
|
-
const printer =
|
|
5308
|
+
const printer = ts29.createPrinter({ removeComments });
|
|
5170
5309
|
source += "\n";
|
|
5171
5310
|
for (const stmt of this.pipeInstStatements) {
|
|
5172
|
-
source += printer.printNode(
|
|
5311
|
+
source += printer.printNode(ts29.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
5173
5312
|
}
|
|
5174
5313
|
for (const stmt of this.typeCtorStatements) {
|
|
5175
|
-
source += printer.printNode(
|
|
5314
|
+
source += printer.printNode(ts29.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
5176
5315
|
}
|
|
5177
5316
|
source += "\n";
|
|
5178
5317
|
for (const stmt of this.tcbStatements) {
|
|
5179
|
-
source += printer.printNode(
|
|
5318
|
+
source += printer.printNode(ts29.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
5180
5319
|
}
|
|
5181
5320
|
source += "\nexport const IS_A_MODULE = true;\n";
|
|
5182
5321
|
return source;
|
|
@@ -5186,7 +5325,7 @@ var TypeCheckFile = class extends Environment {
|
|
|
5186
5325
|
}
|
|
5187
5326
|
};
|
|
5188
5327
|
|
|
5189
|
-
// bazel-out/
|
|
5328
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
|
|
5190
5329
|
var InliningMode;
|
|
5191
5330
|
(function(InliningMode2) {
|
|
5192
5331
|
InliningMode2[InliningMode2["InlineOps"] = 0] = "InlineOps";
|
|
@@ -5291,7 +5430,7 @@ var TypeCheckContextImpl = class {
|
|
|
5291
5430
|
const importManager = new ImportManager(new NoopImportRewriter(), "_i");
|
|
5292
5431
|
const ops = this.opMap.get(sf).sort(orderOps);
|
|
5293
5432
|
const textParts = splitStringAtPoints(sf.text, ops.map((op) => op.splitPoint));
|
|
5294
|
-
const printer =
|
|
5433
|
+
const printer = ts30.createPrinter({ omitTrailingSemicolon: true });
|
|
5295
5434
|
let code = textParts[0];
|
|
5296
5435
|
ops.forEach((op, idx) => {
|
|
5297
5436
|
const text = op.execute(importManager, sf, this.refEmitter, printer);
|
|
@@ -5372,7 +5511,7 @@ var TypeCheckContextImpl = class {
|
|
|
5372
5511
|
if (span.start.offset === span.end.offset) {
|
|
5373
5512
|
span.end.offset++;
|
|
5374
5513
|
}
|
|
5375
|
-
return makeTemplateDiagnostic(templateId, sourceMapping, span,
|
|
5514
|
+
return makeTemplateDiagnostic(templateId, sourceMapping, span, ts30.DiagnosticCategory.Error, ngErrorCode(ErrorCode.TEMPLATE_PARSE_ERROR), error.msg);
|
|
5376
5515
|
});
|
|
5377
5516
|
}
|
|
5378
5517
|
};
|
|
@@ -5390,9 +5529,9 @@ var InlineTcbOp = class {
|
|
|
5390
5529
|
}
|
|
5391
5530
|
execute(im, sf, refEmitter, printer) {
|
|
5392
5531
|
const env = new Environment(this.config, im, refEmitter, this.reflector, sf);
|
|
5393
|
-
const fnName =
|
|
5532
|
+
const fnName = ts30.factory.createIdentifier(`_tcb_${this.ref.node.pos}`);
|
|
5394
5533
|
const fn = generateTypeCheckBlock(env, this.ref, fnName, this.meta, this.domSchemaChecker, this.oobRecorder, TcbGenericContextBehavior.CopyClassNodes);
|
|
5395
|
-
return printer.printNode(
|
|
5534
|
+
return printer.printNode(ts30.EmitHint.Unspecified, fn, sf);
|
|
5396
5535
|
}
|
|
5397
5536
|
};
|
|
5398
5537
|
var TypeCtorOp = class {
|
|
@@ -5405,7 +5544,7 @@ var TypeCtorOp = class {
|
|
|
5405
5544
|
}
|
|
5406
5545
|
execute(im, sf, refEmitter, printer) {
|
|
5407
5546
|
const tcb = generateInlineTypeCtor(this.ref.node, this.meta);
|
|
5408
|
-
return printer.printNode(
|
|
5547
|
+
return printer.printNode(ts30.EmitHint.Unspecified, tcb, sf);
|
|
5409
5548
|
}
|
|
5410
5549
|
};
|
|
5411
5550
|
function orderOps(op1, op2) {
|
|
@@ -5423,10 +5562,10 @@ function splitStringAtPoints(str, points) {
|
|
|
5423
5562
|
return splits;
|
|
5424
5563
|
}
|
|
5425
5564
|
|
|
5426
|
-
// bazel-out/
|
|
5565
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/source.mjs
|
|
5427
5566
|
import { ParseLocation, ParseSourceSpan } from "@angular/compiler";
|
|
5428
5567
|
|
|
5429
|
-
// bazel-out/
|
|
5568
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/line_mappings.mjs
|
|
5430
5569
|
var LF_CHAR = 10;
|
|
5431
5570
|
var CR_CHAR = 13;
|
|
5432
5571
|
var LINE_SEP_CHAR = 8232;
|
|
@@ -5467,7 +5606,7 @@ function findClosestLineStartPosition(linesMap, position, low = 0, high = linesM
|
|
|
5467
5606
|
return low - 1;
|
|
5468
5607
|
}
|
|
5469
5608
|
|
|
5470
|
-
// bazel-out/
|
|
5609
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/source.mjs
|
|
5471
5610
|
var TemplateSource = class {
|
|
5472
5611
|
constructor(mapping, file) {
|
|
5473
5612
|
this.mapping = mapping;
|
|
@@ -5518,9 +5657,9 @@ var TemplateSourceManager = class {
|
|
|
5518
5657
|
}
|
|
5519
5658
|
};
|
|
5520
5659
|
|
|
5521
|
-
// bazel-out/
|
|
5660
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_symbol_builder.mjs
|
|
5522
5661
|
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";
|
|
5523
|
-
import
|
|
5662
|
+
import ts31 from "typescript";
|
|
5524
5663
|
var SymbolBuilder = class {
|
|
5525
5664
|
constructor(tcbPath, tcbIsShim, typeCheckBlock, templateData, componentScopeReader, getTypeChecker) {
|
|
5526
5665
|
this.tcbPath = tcbPath;
|
|
@@ -5564,7 +5703,7 @@ var SymbolBuilder = class {
|
|
|
5564
5703
|
getSymbolOfElement(element) {
|
|
5565
5704
|
var _a;
|
|
5566
5705
|
const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
|
|
5567
|
-
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: elementSourceSpan, filter:
|
|
5706
|
+
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: elementSourceSpan, filter: ts31.isVariableDeclaration });
|
|
5568
5707
|
if (node === null) {
|
|
5569
5708
|
return null;
|
|
5570
5709
|
}
|
|
@@ -5584,12 +5723,12 @@ var SymbolBuilder = class {
|
|
|
5584
5723
|
var _a;
|
|
5585
5724
|
const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
|
|
5586
5725
|
const tcbSourceFile = this.typeCheckBlock.getSourceFile();
|
|
5587
|
-
const isDirectiveDeclaration = (node) => (
|
|
5726
|
+
const isDirectiveDeclaration = (node) => (ts31.isTypeNode(node) || ts31.isIdentifier(node)) && ts31.isVariableDeclaration(node.parent) && hasExpressionIdentifier(tcbSourceFile, node, ExpressionIdentifier.DIRECTIVE);
|
|
5588
5727
|
const nodes = findAllMatchingNodes(this.typeCheckBlock, { withSpan: elementSourceSpan, filter: isDirectiveDeclaration });
|
|
5589
5728
|
const symbols = [];
|
|
5590
5729
|
for (const node of nodes) {
|
|
5591
5730
|
const symbol = this.getSymbolOfTsNode(node.parent);
|
|
5592
|
-
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !
|
|
5731
|
+
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts31.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
|
|
5593
5732
|
continue;
|
|
5594
5733
|
}
|
|
5595
5734
|
const meta = this.getDirectiveMeta(element, symbol.tsSymbol.valueDeclaration);
|
|
@@ -5617,7 +5756,7 @@ var SymbolBuilder = class {
|
|
|
5617
5756
|
}
|
|
5618
5757
|
addHostDirectiveSymbols(host, hostDirectives, symbols) {
|
|
5619
5758
|
for (const current of hostDirectives) {
|
|
5620
|
-
if (!
|
|
5759
|
+
if (!ts31.isClassDeclaration(current.directive.node)) {
|
|
5621
5760
|
continue;
|
|
5622
5761
|
}
|
|
5623
5762
|
const symbol = this.getSymbolOfTsNode(current.directive.node);
|
|
@@ -5690,17 +5829,17 @@ var SymbolBuilder = class {
|
|
|
5690
5829
|
if (!isAccessExpression(n)) {
|
|
5691
5830
|
return false;
|
|
5692
5831
|
}
|
|
5693
|
-
if (
|
|
5832
|
+
if (ts31.isPropertyAccessExpression(n)) {
|
|
5694
5833
|
return n.name.getText() === expectedAccess;
|
|
5695
5834
|
} else {
|
|
5696
|
-
return
|
|
5835
|
+
return ts31.isStringLiteral(n.argumentExpression) && n.argumentExpression.text === expectedAccess;
|
|
5697
5836
|
}
|
|
5698
5837
|
}
|
|
5699
5838
|
const outputFieldAccesses = findAllMatchingNodes(this.typeCheckBlock, { withSpan: eventBinding.keySpan, filter });
|
|
5700
5839
|
const bindings = [];
|
|
5701
5840
|
for (const outputFieldAccess of outputFieldAccesses) {
|
|
5702
5841
|
if (consumer instanceof TmplAstTemplate3 || consumer instanceof TmplAstElement4) {
|
|
5703
|
-
if (!
|
|
5842
|
+
if (!ts31.isPropertyAccessExpression(outputFieldAccess)) {
|
|
5704
5843
|
continue;
|
|
5705
5844
|
}
|
|
5706
5845
|
const addEventListener = outputFieldAccess.name;
|
|
@@ -5723,7 +5862,7 @@ var SymbolBuilder = class {
|
|
|
5723
5862
|
}
|
|
5724
5863
|
});
|
|
5725
5864
|
} else {
|
|
5726
|
-
if (!
|
|
5865
|
+
if (!ts31.isElementAccessExpression(outputFieldAccess)) {
|
|
5727
5866
|
continue;
|
|
5728
5867
|
}
|
|
5729
5868
|
const tsSymbol = this.getTypeChecker().getSymbolAtLocation(outputFieldAccess.argumentExpression);
|
|
@@ -5796,7 +5935,7 @@ var SymbolBuilder = class {
|
|
|
5796
5935
|
return null;
|
|
5797
5936
|
}
|
|
5798
5937
|
const [declaration] = tsSymbol.declarations;
|
|
5799
|
-
if (!
|
|
5938
|
+
if (!ts31.isVariableDeclaration(declaration) || !hasExpressionIdentifier(
|
|
5800
5939
|
declaration.getSourceFile(),
|
|
5801
5940
|
(_a = declaration.type) != null ? _a : declaration.name,
|
|
5802
5941
|
ExpressionIdentifier.DIRECTIVE
|
|
@@ -5804,7 +5943,7 @@ var SymbolBuilder = class {
|
|
|
5804
5943
|
return null;
|
|
5805
5944
|
}
|
|
5806
5945
|
const symbol = this.getSymbolOfTsNode(declaration);
|
|
5807
|
-
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !
|
|
5946
|
+
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts31.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
|
|
5808
5947
|
return null;
|
|
5809
5948
|
}
|
|
5810
5949
|
const ref = new Reference(symbol.tsSymbol.valueDeclaration);
|
|
@@ -5824,7 +5963,7 @@ var SymbolBuilder = class {
|
|
|
5824
5963
|
};
|
|
5825
5964
|
}
|
|
5826
5965
|
getSymbolOfVariable(variable) {
|
|
5827
|
-
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: variable.sourceSpan, filter:
|
|
5966
|
+
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: variable.sourceSpan, filter: ts31.isVariableDeclaration });
|
|
5828
5967
|
if (node === null || node.initializer === void 0) {
|
|
5829
5968
|
return null;
|
|
5830
5969
|
}
|
|
@@ -5847,11 +5986,11 @@ var SymbolBuilder = class {
|
|
|
5847
5986
|
}
|
|
5848
5987
|
getSymbolOfReference(ref) {
|
|
5849
5988
|
const target = this.templateData.boundTarget.getReferenceTarget(ref);
|
|
5850
|
-
let node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: ref.sourceSpan, filter:
|
|
5989
|
+
let node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: ref.sourceSpan, filter: ts31.isVariableDeclaration });
|
|
5851
5990
|
if (node === null || target === null || node.initializer === void 0) {
|
|
5852
5991
|
return null;
|
|
5853
5992
|
}
|
|
5854
|
-
const originalDeclaration =
|
|
5993
|
+
const originalDeclaration = ts31.isParenthesizedExpression(node.initializer) && ts31.isAsExpression(node.initializer.expression) ? this.getTypeChecker().getSymbolAtLocation(node.name) : this.getTypeChecker().getSymbolAtLocation(node.initializer);
|
|
5855
5994
|
if (originalDeclaration === void 0 || originalDeclaration.valueDeclaration === void 0) {
|
|
5856
5995
|
return null;
|
|
5857
5996
|
}
|
|
@@ -5875,7 +6014,7 @@ var SymbolBuilder = class {
|
|
|
5875
6014
|
referenceVarLocation: referenceVarTcbLocation
|
|
5876
6015
|
};
|
|
5877
6016
|
} else {
|
|
5878
|
-
if (!
|
|
6017
|
+
if (!ts31.isClassDeclaration(target.directive.ref.node)) {
|
|
5879
6018
|
return null;
|
|
5880
6019
|
}
|
|
5881
6020
|
return {
|
|
@@ -5890,7 +6029,7 @@ var SymbolBuilder = class {
|
|
|
5890
6029
|
}
|
|
5891
6030
|
}
|
|
5892
6031
|
getSymbolOfPipe(expression) {
|
|
5893
|
-
const methodAccess = findFirstMatchingNode(this.typeCheckBlock, { withSpan: expression.nameSpan, filter:
|
|
6032
|
+
const methodAccess = findFirstMatchingNode(this.typeCheckBlock, { withSpan: expression.nameSpan, filter: ts31.isPropertyAccessExpression });
|
|
5894
6033
|
if (methodAccess === null) {
|
|
5895
6034
|
return null;
|
|
5896
6035
|
}
|
|
@@ -5930,7 +6069,7 @@ var SymbolBuilder = class {
|
|
|
5930
6069
|
}
|
|
5931
6070
|
let node = null;
|
|
5932
6071
|
if (expression instanceof PropertyRead5) {
|
|
5933
|
-
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter:
|
|
6072
|
+
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: ts31.isPropertyAccessExpression });
|
|
5934
6073
|
}
|
|
5935
6074
|
if (node === null) {
|
|
5936
6075
|
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: anyNodeFilter });
|
|
@@ -5938,10 +6077,10 @@ var SymbolBuilder = class {
|
|
|
5938
6077
|
if (node === null) {
|
|
5939
6078
|
return null;
|
|
5940
6079
|
}
|
|
5941
|
-
while (
|
|
6080
|
+
while (ts31.isParenthesizedExpression(node)) {
|
|
5942
6081
|
node = node.expression;
|
|
5943
6082
|
}
|
|
5944
|
-
if (expression instanceof SafePropertyRead4 &&
|
|
6083
|
+
if (expression instanceof SafePropertyRead4 && ts31.isConditionalExpression(node)) {
|
|
5945
6084
|
const whenTrueSymbol = this.getSymbolOfTsNode(node.whenTrue);
|
|
5946
6085
|
if (whenTrueSymbol === null) {
|
|
5947
6086
|
return null;
|
|
@@ -5958,13 +6097,13 @@ var SymbolBuilder = class {
|
|
|
5958
6097
|
}
|
|
5959
6098
|
getSymbolOfTsNode(node) {
|
|
5960
6099
|
var _a;
|
|
5961
|
-
while (
|
|
6100
|
+
while (ts31.isParenthesizedExpression(node)) {
|
|
5962
6101
|
node = node.expression;
|
|
5963
6102
|
}
|
|
5964
6103
|
let tsSymbol;
|
|
5965
|
-
if (
|
|
6104
|
+
if (ts31.isPropertyAccessExpression(node)) {
|
|
5966
6105
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.name);
|
|
5967
|
-
} else if (
|
|
6106
|
+
} else if (ts31.isElementAccessExpression(node)) {
|
|
5968
6107
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.argumentExpression);
|
|
5969
6108
|
} else {
|
|
5970
6109
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node);
|
|
@@ -5982,13 +6121,13 @@ var SymbolBuilder = class {
|
|
|
5982
6121
|
};
|
|
5983
6122
|
}
|
|
5984
6123
|
getTcbPositionForNode(node) {
|
|
5985
|
-
if (
|
|
6124
|
+
if (ts31.isTypeReferenceNode(node)) {
|
|
5986
6125
|
return this.getTcbPositionForNode(node.typeName);
|
|
5987
|
-
} else if (
|
|
6126
|
+
} else if (ts31.isQualifiedName(node)) {
|
|
5988
6127
|
return node.right.getStart();
|
|
5989
|
-
} else if (
|
|
6128
|
+
} else if (ts31.isPropertyAccessExpression(node)) {
|
|
5990
6129
|
return node.name.getStart();
|
|
5991
|
-
} else if (
|
|
6130
|
+
} else if (ts31.isElementAccessExpression(node)) {
|
|
5992
6131
|
return node.argumentExpression.getStart();
|
|
5993
6132
|
} else {
|
|
5994
6133
|
return node.getStart();
|
|
@@ -6002,7 +6141,7 @@ function sourceSpanEqual(a, b) {
|
|
|
6002
6141
|
return a.start.offset === b.start.offset && a.end.offset === b.end.offset;
|
|
6003
6142
|
}
|
|
6004
6143
|
|
|
6005
|
-
// bazel-out/
|
|
6144
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
|
|
6006
6145
|
var REGISTRY2 = new DomElementSchemaRegistry2();
|
|
6007
6146
|
var TemplateTypeCheckerImpl = class {
|
|
6008
6147
|
constructor(originalProgram, programDriver, typeCheckAdapter, config, refEmitter, reflector, compilerHost, priorBuild, metaReader, localMetaReader, ngModuleIndex, componentScopeReader, typeCheckScopeRegistry, perf) {
|
|
@@ -6699,10 +6838,10 @@ var SingleShimTypeCheckingHost = class extends SingleFileTypeCheckingHost {
|
|
|
6699
6838
|
}
|
|
6700
6839
|
};
|
|
6701
6840
|
|
|
6702
|
-
// bazel-out/
|
|
6841
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.mjs
|
|
6703
6842
|
import { TmplAstBoundEvent as TmplAstBoundEvent2 } from "@angular/compiler";
|
|
6704
6843
|
|
|
6705
|
-
// bazel-out/
|
|
6844
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/api/api.mjs
|
|
6706
6845
|
import { ASTWithSource as ASTWithSource4, RecursiveAstVisitor as RecursiveAstVisitor3, TmplAstBoundDeferredTrigger as TmplAstBoundDeferredTrigger2 } from "@angular/compiler";
|
|
6707
6846
|
var TemplateCheckWithVisitor = class {
|
|
6708
6847
|
run(ctx, component, template) {
|
|
@@ -6759,6 +6898,8 @@ var TemplateVisitor2 = class extends RecursiveAstVisitor3 {
|
|
|
6759
6898
|
}
|
|
6760
6899
|
visitTextAttribute(attribute) {
|
|
6761
6900
|
}
|
|
6901
|
+
visitUnknownBlock(block) {
|
|
6902
|
+
}
|
|
6762
6903
|
visitBoundAttribute(attribute) {
|
|
6763
6904
|
this.visitAst(attribute.value);
|
|
6764
6905
|
}
|
|
@@ -6824,7 +6965,7 @@ var TemplateVisitor2 = class extends RecursiveAstVisitor3 {
|
|
|
6824
6965
|
}
|
|
6825
6966
|
};
|
|
6826
6967
|
|
|
6827
|
-
// bazel-out/
|
|
6968
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.mjs
|
|
6828
6969
|
var InvalidBananaInBoxCheck = class extends TemplateCheckWithVisitor {
|
|
6829
6970
|
constructor() {
|
|
6830
6971
|
super(...arguments);
|
|
@@ -6849,7 +6990,7 @@ var factory = {
|
|
|
6849
6990
|
create: () => new InvalidBananaInBoxCheck()
|
|
6850
6991
|
};
|
|
6851
6992
|
|
|
6852
|
-
// bazel-out/
|
|
6993
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/missing_control_flow_directive/index.mjs
|
|
6853
6994
|
import { TmplAstTemplate as TmplAstTemplate4 } from "@angular/compiler";
|
|
6854
6995
|
var KNOWN_CONTROL_FLOW_DIRECTIVES = /* @__PURE__ */ new Map([
|
|
6855
6996
|
["ngIf", "NgIf"],
|
|
@@ -6894,7 +7035,7 @@ var factory2 = {
|
|
|
6894
7035
|
}
|
|
6895
7036
|
};
|
|
6896
7037
|
|
|
6897
|
-
// bazel-out/
|
|
7038
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/missing_ngforof_let/index.mjs
|
|
6898
7039
|
import { TmplAstTemplate as TmplAstTemplate5 } from "@angular/compiler";
|
|
6899
7040
|
var MissingNgForOfLetCheck = class extends TemplateCheckWithVisitor {
|
|
6900
7041
|
constructor() {
|
|
@@ -6927,9 +7068,9 @@ var factory3 = {
|
|
|
6927
7068
|
create: () => new MissingNgForOfLetCheck()
|
|
6928
7069
|
};
|
|
6929
7070
|
|
|
6930
|
-
// bazel-out/
|
|
7071
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.mjs
|
|
6931
7072
|
import { Binary } from "@angular/compiler";
|
|
6932
|
-
import
|
|
7073
|
+
import ts32 from "typescript";
|
|
6933
7074
|
var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
6934
7075
|
constructor() {
|
|
6935
7076
|
super(...arguments);
|
|
@@ -6943,7 +7084,7 @@ var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
6943
7084
|
return [];
|
|
6944
7085
|
}
|
|
6945
7086
|
const typeLeft = symbolLeft.tsType;
|
|
6946
|
-
if (typeLeft.flags & (
|
|
7087
|
+
if (typeLeft.flags & (ts32.TypeFlags.Any | ts32.TypeFlags.Unknown)) {
|
|
6947
7088
|
return [];
|
|
6948
7089
|
}
|
|
6949
7090
|
if (typeLeft.getNonNullableType() !== typeLeft)
|
|
@@ -6972,9 +7113,9 @@ var factory4 = {
|
|
|
6972
7113
|
}
|
|
6973
7114
|
};
|
|
6974
7115
|
|
|
6975
|
-
// bazel-out/
|
|
7116
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/optional_chain_not_nullable/index.mjs
|
|
6976
7117
|
import { SafeCall as SafeCall2, SafeKeyedRead as SafeKeyedRead2, SafePropertyRead as SafePropertyRead5 } from "@angular/compiler";
|
|
6977
|
-
import
|
|
7118
|
+
import ts33 from "typescript";
|
|
6978
7119
|
var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
6979
7120
|
constructor() {
|
|
6980
7121
|
super(...arguments);
|
|
@@ -6988,7 +7129,7 @@ var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
6988
7129
|
return [];
|
|
6989
7130
|
}
|
|
6990
7131
|
const typeLeft = symbolLeft.tsType;
|
|
6991
|
-
if (typeLeft.flags & (
|
|
7132
|
+
if (typeLeft.flags & (ts33.TypeFlags.Any | ts33.TypeFlags.Unknown)) {
|
|
6992
7133
|
return [];
|
|
6993
7134
|
}
|
|
6994
7135
|
if (typeLeft.getNonNullableType() !== typeLeft)
|
|
@@ -7018,7 +7159,7 @@ var factory5 = {
|
|
|
7018
7159
|
}
|
|
7019
7160
|
};
|
|
7020
7161
|
|
|
7021
|
-
// bazel-out/
|
|
7162
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/suffix_not_supported/index.mjs
|
|
7022
7163
|
import { TmplAstBoundAttribute as TmplAstBoundAttribute3 } from "@angular/compiler";
|
|
7023
7164
|
var STYLE_SUFFIXES = ["px", "%", "em"];
|
|
7024
7165
|
var SuffixNotSupportedCheck = class extends TemplateCheckWithVisitor {
|
|
@@ -7042,7 +7183,7 @@ var factory6 = {
|
|
|
7042
7183
|
create: () => new SuffixNotSupportedCheck()
|
|
7043
7184
|
};
|
|
7044
7185
|
|
|
7045
|
-
// bazel-out/
|
|
7186
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/text_attribute_not_binding/index.mjs
|
|
7046
7187
|
import { TmplAstTextAttribute as TmplAstTextAttribute4 } from "@angular/compiler";
|
|
7047
7188
|
var TextAttributeNotBindingSpec = class extends TemplateCheckWithVisitor {
|
|
7048
7189
|
constructor() {
|
|
@@ -7081,10 +7222,10 @@ var factory7 = {
|
|
|
7081
7222
|
create: () => new TextAttributeNotBindingSpec()
|
|
7082
7223
|
};
|
|
7083
7224
|
|
|
7084
|
-
// bazel-out/
|
|
7085
|
-
import
|
|
7225
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
|
|
7226
|
+
import ts34 from "typescript";
|
|
7086
7227
|
|
|
7087
|
-
// bazel-out/
|
|
7228
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/api/src/public_options.mjs
|
|
7088
7229
|
var DiagnosticCategoryLabel;
|
|
7089
7230
|
(function(DiagnosticCategoryLabel2) {
|
|
7090
7231
|
DiagnosticCategoryLabel2["Warning"] = "warning";
|
|
@@ -7092,7 +7233,7 @@ var DiagnosticCategoryLabel;
|
|
|
7092
7233
|
DiagnosticCategoryLabel2["Suppress"] = "suppress";
|
|
7093
7234
|
})(DiagnosticCategoryLabel || (DiagnosticCategoryLabel = {}));
|
|
7094
7235
|
|
|
7095
|
-
// bazel-out/
|
|
7236
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
|
|
7096
7237
|
var ExtendedTemplateCheckerImpl = class {
|
|
7097
7238
|
constructor(templateTypeChecker, typeChecker, templateCheckFactories, options) {
|
|
7098
7239
|
var _a, _b, _c, _d, _e;
|
|
@@ -7131,9 +7272,9 @@ var ExtendedTemplateCheckerImpl = class {
|
|
|
7131
7272
|
function diagnosticLabelToCategory(label) {
|
|
7132
7273
|
switch (label) {
|
|
7133
7274
|
case DiagnosticCategoryLabel.Warning:
|
|
7134
|
-
return
|
|
7275
|
+
return ts34.DiagnosticCategory.Warning;
|
|
7135
7276
|
case DiagnosticCategoryLabel.Error:
|
|
7136
|
-
return
|
|
7277
|
+
return ts34.DiagnosticCategory.Error;
|
|
7137
7278
|
case DiagnosticCategoryLabel.Suppress:
|
|
7138
7279
|
return null;
|
|
7139
7280
|
default:
|
|
@@ -7145,7 +7286,7 @@ function assertNever(value) {
|
|
|
7145
7286
|
${value}`);
|
|
7146
7287
|
}
|
|
7147
7288
|
|
|
7148
|
-
// bazel-out/
|
|
7289
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/index.mjs
|
|
7149
7290
|
var ALL_DIAGNOSTIC_FACTORIES = [
|
|
7150
7291
|
factory,
|
|
7151
7292
|
factory4,
|
|
@@ -7156,7 +7297,7 @@ var ALL_DIAGNOSTIC_FACTORIES = [
|
|
|
7156
7297
|
factory6
|
|
7157
7298
|
];
|
|
7158
7299
|
|
|
7159
|
-
// bazel-out/
|
|
7300
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
7160
7301
|
var CompilationTicketKind;
|
|
7161
7302
|
(function(CompilationTicketKind2) {
|
|
7162
7303
|
CompilationTicketKind2[CompilationTicketKind2["Fresh"] = 0] = "Fresh";
|
|
@@ -7246,7 +7387,7 @@ var NgCompiler = class {
|
|
|
7246
7387
|
this.currentProgram = inputProgram;
|
|
7247
7388
|
this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
|
|
7248
7389
|
this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
|
|
7249
|
-
const moduleResolutionCache =
|
|
7390
|
+
const moduleResolutionCache = ts35.createModuleResolutionCache(
|
|
7250
7391
|
this.adapter.getCurrentDirectory(),
|
|
7251
7392
|
this.adapter.getCanonicalFileName.bind(this.adapter)
|
|
7252
7393
|
);
|
|
@@ -7290,7 +7431,7 @@ var NgCompiler = class {
|
|
|
7290
7431
|
}
|
|
7291
7432
|
for (const clazz of classesToUpdate) {
|
|
7292
7433
|
this.compilation.traitCompiler.updateResources(clazz);
|
|
7293
|
-
if (!
|
|
7434
|
+
if (!ts35.isClassDeclaration(clazz)) {
|
|
7294
7435
|
continue;
|
|
7295
7436
|
}
|
|
7296
7437
|
this.compilation.templateTypeChecker.invalidateClass(clazz);
|
|
@@ -7720,8 +7861,11 @@ var NgCompiler = class {
|
|
|
7720
7861
|
if (supportJitMode === false && compilationMode === CompilationMode.PARTIAL) {
|
|
7721
7862
|
throw new Error('JIT mode support ("supportJitMode" option) cannot be disabled in partial compilation mode.');
|
|
7722
7863
|
}
|
|
7864
|
+
if (supportJitMode === false && this.options.forbidOrphanComponents) {
|
|
7865
|
+
throw new Error('JIT mode support ("supportJitMode" option) cannot be disabled when forbidOrphanComponents is set to true');
|
|
7866
|
+
}
|
|
7723
7867
|
const handlers = [
|
|
7724
|
-
new ComponentDecoratorHandler(reflector, evaluator, metaRegistry, metaReader, scopeReader, depScopeReader, ngModuleScopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, this.resourceManager, this.adapter.rootDirs, this.options.preserveWhitespaces || false, this.options.i18nUseExternalIds !== false, this.options.enableI18nLegacyMessageIdFormat !== false, this.usePoisonedData, this.options.i18nNormalizeLineEndingsInICUs === true, this.moduleResolver, this.cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, this.incrementalCompilation.depGraph, injectableRegistry, semanticDepGraphUpdater, this.closureCompilerEnabled, this.delegatingPerfRecorder, hostDirectivesResolver, supportTestBed, compilationMode, deferredSymbolsTracker),
|
|
7868
|
+
new ComponentDecoratorHandler(reflector, evaluator, metaRegistry, metaReader, scopeReader, depScopeReader, ngModuleScopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, this.resourceManager, this.adapter.rootDirs, this.options.preserveWhitespaces || false, this.options.i18nUseExternalIds !== false, this.options.enableI18nLegacyMessageIdFormat !== false, this.usePoisonedData, this.options.i18nNormalizeLineEndingsInICUs === true, this.moduleResolver, this.cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, this.incrementalCompilation.depGraph, injectableRegistry, semanticDepGraphUpdater, this.closureCompilerEnabled, this.delegatingPerfRecorder, hostDirectivesResolver, supportTestBed, compilationMode, deferredSymbolsTracker, !!this.options.forbidOrphanComponents),
|
|
7725
7869
|
new DirectiveDecoratorHandler(reflector, evaluator, metaRegistry, ngModuleScopeRegistry, metaReader, injectableRegistry, refEmitter, referencesRegistry, isCore, strictCtorDeps, semanticDepGraphUpdater, this.closureCompilerEnabled, this.delegatingPerfRecorder, supportTestBed, compilationMode),
|
|
7726
7870
|
new PipeDecoratorHandler(reflector, evaluator, metaRegistry, ngModuleScopeRegistry, injectableRegistry, isCore, this.delegatingPerfRecorder, supportTestBed, compilationMode),
|
|
7727
7871
|
new InjectableDecoratorHandler(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, this.delegatingPerfRecorder, supportTestBed, compilationMode),
|
|
@@ -7757,18 +7901,18 @@ function isAngularCorePackage(program) {
|
|
|
7757
7901
|
return false;
|
|
7758
7902
|
}
|
|
7759
7903
|
return r3Symbols.statements.some((stmt) => {
|
|
7760
|
-
if (!
|
|
7904
|
+
if (!ts35.isVariableStatement(stmt)) {
|
|
7761
7905
|
return false;
|
|
7762
7906
|
}
|
|
7763
|
-
const modifiers =
|
|
7764
|
-
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind ===
|
|
7907
|
+
const modifiers = ts35.getModifiers(stmt);
|
|
7908
|
+
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind === ts35.SyntaxKind.ExportKeyword)) {
|
|
7765
7909
|
return false;
|
|
7766
7910
|
}
|
|
7767
7911
|
return stmt.declarationList.declarations.some((decl) => {
|
|
7768
|
-
if (!
|
|
7912
|
+
if (!ts35.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
|
|
7769
7913
|
return false;
|
|
7770
7914
|
}
|
|
7771
|
-
if (decl.initializer === void 0 || decl.initializer.kind !==
|
|
7915
|
+
if (decl.initializer === void 0 || decl.initializer.kind !== ts35.SyntaxKind.TrueKeyword) {
|
|
7772
7916
|
return false;
|
|
7773
7917
|
}
|
|
7774
7918
|
return true;
|
|
@@ -7782,7 +7926,7 @@ function* verifyCompatibleTypeCheckOptions(options) {
|
|
|
7782
7926
|
var _a, _b, _c;
|
|
7783
7927
|
if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
|
|
7784
7928
|
yield makeConfigDiagnostic({
|
|
7785
|
-
category:
|
|
7929
|
+
category: ts35.DiagnosticCategory.Error,
|
|
7786
7930
|
code: ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK,
|
|
7787
7931
|
messageText: `
|
|
7788
7932
|
Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
|
|
@@ -7801,7 +7945,7 @@ https://angular.io/guide/template-typecheck
|
|
|
7801
7945
|
}
|
|
7802
7946
|
if (options.extendedDiagnostics && options.strictTemplates === false) {
|
|
7803
7947
|
yield makeConfigDiagnostic({
|
|
7804
|
-
category:
|
|
7948
|
+
category: ts35.DiagnosticCategory.Error,
|
|
7805
7949
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES,
|
|
7806
7950
|
messageText: `
|
|
7807
7951
|
Angular compiler option "extendedDiagnostics" is configured, however "strictTemplates" is disabled.
|
|
@@ -7818,7 +7962,7 @@ One of the following actions is required:
|
|
|
7818
7962
|
const defaultCategory = (_a = options.extendedDiagnostics) == null ? void 0 : _a.defaultCategory;
|
|
7819
7963
|
if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
|
|
7820
7964
|
yield makeConfigDiagnostic({
|
|
7821
|
-
category:
|
|
7965
|
+
category: ts35.DiagnosticCategory.Error,
|
|
7822
7966
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
7823
7967
|
messageText: `
|
|
7824
7968
|
Angular compiler option "extendedDiagnostics.defaultCategory" has an unknown diagnostic category: "${defaultCategory}".
|
|
@@ -7832,7 +7976,7 @@ ${allowedCategoryLabels.join("\n")}
|
|
|
7832
7976
|
for (const [checkName, category] of Object.entries((_c = (_b = options.extendedDiagnostics) == null ? void 0 : _b.checks) != null ? _c : {})) {
|
|
7833
7977
|
if (!allExtendedDiagnosticNames.includes(checkName)) {
|
|
7834
7978
|
yield makeConfigDiagnostic({
|
|
7835
|
-
category:
|
|
7979
|
+
category: ts35.DiagnosticCategory.Error,
|
|
7836
7980
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK,
|
|
7837
7981
|
messageText: `
|
|
7838
7982
|
Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${checkName}".
|
|
@@ -7844,7 +7988,7 @@ ${allExtendedDiagnosticNames.join("\n")}
|
|
|
7844
7988
|
}
|
|
7845
7989
|
if (!allowedCategoryLabels.includes(category)) {
|
|
7846
7990
|
yield makeConfigDiagnostic({
|
|
7847
|
-
category:
|
|
7991
|
+
category: ts35.DiagnosticCategory.Error,
|
|
7848
7992
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
7849
7993
|
messageText: `
|
|
7850
7994
|
Angular compiler option "extendedDiagnostics.checks['${checkName}']" has an unknown diagnostic category: "${category}".
|
|
@@ -7874,7 +8018,7 @@ var ReferenceGraphAdapter = class {
|
|
|
7874
8018
|
for (const { node } of references) {
|
|
7875
8019
|
let sourceFile = node.getSourceFile();
|
|
7876
8020
|
if (sourceFile === void 0) {
|
|
7877
|
-
sourceFile =
|
|
8021
|
+
sourceFile = ts35.getOriginalNode(node).getSourceFile();
|
|
7878
8022
|
}
|
|
7879
8023
|
if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
|
|
7880
8024
|
this.graph.add(source, node);
|
|
@@ -7912,8 +8056,8 @@ function versionMapFromProgram(program, driver) {
|
|
|
7912
8056
|
return versions;
|
|
7913
8057
|
}
|
|
7914
8058
|
|
|
7915
|
-
// bazel-out/
|
|
7916
|
-
import
|
|
8059
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
|
|
8060
|
+
import ts36 from "typescript";
|
|
7917
8061
|
var DelegatingCompilerHost2 = class {
|
|
7918
8062
|
constructor(delegate) {
|
|
7919
8063
|
this.delegate = delegate;
|
|
@@ -7992,7 +8136,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
7992
8136
|
entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
|
|
7993
8137
|
if (entryPoint === null) {
|
|
7994
8138
|
diagnostics.push({
|
|
7995
|
-
category:
|
|
8139
|
+
category: ts36.DiagnosticCategory.Error,
|
|
7996
8140
|
code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
|
|
7997
8141
|
file: void 0,
|
|
7998
8142
|
start: void 0,
|
|
@@ -8035,17 +8179,17 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
8035
8179
|
return this.fileNameToModuleName !== void 0 ? this : null;
|
|
8036
8180
|
}
|
|
8037
8181
|
createCachedResolveModuleNamesFunction() {
|
|
8038
|
-
const moduleResolutionCache =
|
|
8182
|
+
const moduleResolutionCache = ts36.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
|
|
8039
8183
|
return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
|
|
8040
8184
|
return moduleNames.map((moduleName) => {
|
|
8041
|
-
const module =
|
|
8185
|
+
const module = ts36.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
|
|
8042
8186
|
return module.resolvedModule;
|
|
8043
8187
|
});
|
|
8044
8188
|
};
|
|
8045
8189
|
}
|
|
8046
8190
|
};
|
|
8047
8191
|
|
|
8048
|
-
// bazel-out/
|
|
8192
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
8049
8193
|
var NgtscProgram = class {
|
|
8050
8194
|
constructor(rootNames, options, delegateHost, oldProgram) {
|
|
8051
8195
|
this.options = options;
|
|
@@ -8062,7 +8206,7 @@ var NgtscProgram = class {
|
|
|
8062
8206
|
if (reuseProgram !== void 0) {
|
|
8063
8207
|
retagAllTsFiles(reuseProgram);
|
|
8064
8208
|
}
|
|
8065
|
-
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () =>
|
|
8209
|
+
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts37.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
|
|
8066
8210
|
perfRecorder.phase(PerfPhase.Unaccounted);
|
|
8067
8211
|
perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
|
|
8068
8212
|
this.host.postProgramCreationCleanup();
|
|
@@ -8272,37 +8416,37 @@ function mergeEmitResults(emitResults) {
|
|
|
8272
8416
|
return { diagnostics, emitSkipped, emittedFiles };
|
|
8273
8417
|
}
|
|
8274
8418
|
|
|
8275
|
-
// bazel-out/
|
|
8419
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/program.mjs
|
|
8276
8420
|
function createProgram({ rootNames, options, host, oldProgram }) {
|
|
8277
8421
|
return new NgtscProgram(rootNames, options, host, oldProgram);
|
|
8278
8422
|
}
|
|
8279
8423
|
|
|
8280
|
-
// bazel-out/
|
|
8281
|
-
import
|
|
8424
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
8425
|
+
import ts39 from "typescript";
|
|
8282
8426
|
|
|
8283
|
-
// bazel-out/
|
|
8284
|
-
import
|
|
8427
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
|
|
8428
|
+
import ts38 from "typescript";
|
|
8285
8429
|
function createMessageDiagnostic(messageText) {
|
|
8286
8430
|
return {
|
|
8287
8431
|
file: void 0,
|
|
8288
8432
|
start: void 0,
|
|
8289
8433
|
length: void 0,
|
|
8290
|
-
category:
|
|
8434
|
+
category: ts38.DiagnosticCategory.Message,
|
|
8291
8435
|
messageText,
|
|
8292
8436
|
code: DEFAULT_ERROR_CODE,
|
|
8293
8437
|
source: SOURCE
|
|
8294
8438
|
};
|
|
8295
8439
|
}
|
|
8296
8440
|
|
|
8297
|
-
// bazel-out/
|
|
8441
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
8298
8442
|
var defaultFormatHost = {
|
|
8299
|
-
getCurrentDirectory: () =>
|
|
8443
|
+
getCurrentDirectory: () => ts39.sys.getCurrentDirectory(),
|
|
8300
8444
|
getCanonicalFileName: (fileName) => fileName,
|
|
8301
|
-
getNewLine: () =>
|
|
8445
|
+
getNewLine: () => ts39.sys.newLine
|
|
8302
8446
|
};
|
|
8303
8447
|
function formatDiagnostics(diags, host = defaultFormatHost) {
|
|
8304
8448
|
if (diags && diags.length) {
|
|
8305
|
-
return diags.map((diagnostic) => replaceTsWithNgInErrors(
|
|
8449
|
+
return diags.map((diagnostic) => replaceTsWithNgInErrors(ts39.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
|
|
8306
8450
|
} else {
|
|
8307
8451
|
return "";
|
|
8308
8452
|
}
|
|
@@ -8319,7 +8463,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
8319
8463
|
var _a;
|
|
8320
8464
|
try {
|
|
8321
8465
|
const fs = getFileSystem();
|
|
8322
|
-
const readConfigFile = (configFile) =>
|
|
8466
|
+
const readConfigFile = (configFile) => ts39.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
|
|
8323
8467
|
const readAngularCompilerOptions = (configFile, parentOptions = {}) => {
|
|
8324
8468
|
const { config: config2, error: error2 } = readConfigFile(configFile);
|
|
8325
8469
|
if (error2) {
|
|
@@ -8354,7 +8498,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
8354
8498
|
...existingOptions
|
|
8355
8499
|
};
|
|
8356
8500
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
8357
|
-
const { options, errors, fileNames: rootNames, projectReferences } =
|
|
8501
|
+
const { options, errors, fileNames: rootNames, projectReferences } = ts39.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
|
|
8358
8502
|
let emitFlags = EmitFlags.Default;
|
|
8359
8503
|
if (!(options["skipMetadataEmit"] || options["flatModuleOutFile"])) {
|
|
8360
8504
|
emitFlags |= EmitFlags.Metadata;
|
|
@@ -8365,7 +8509,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
8365
8509
|
return { project: projectFile, rootNames, projectReferences, options, errors, emitFlags };
|
|
8366
8510
|
} catch (e) {
|
|
8367
8511
|
const errors = [{
|
|
8368
|
-
category:
|
|
8512
|
+
category: ts39.DiagnosticCategory.Error,
|
|
8369
8513
|
messageText: (_a = e.stack) != null ? _a : e.message,
|
|
8370
8514
|
file: void 0,
|
|
8371
8515
|
start: void 0,
|
|
@@ -8379,7 +8523,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
8379
8523
|
function createParseConfigHost(host, fs = getFileSystem()) {
|
|
8380
8524
|
return {
|
|
8381
8525
|
fileExists: host.exists.bind(host),
|
|
8382
|
-
readDirectory:
|
|
8526
|
+
readDirectory: ts39.sys.readDirectory,
|
|
8383
8527
|
readFile: host.readFile.bind(host),
|
|
8384
8528
|
useCaseSensitiveFileNames: fs.isCaseSensitive()
|
|
8385
8529
|
};
|
|
@@ -8399,12 +8543,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
8399
8543
|
}
|
|
8400
8544
|
} else {
|
|
8401
8545
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
8402
|
-
const { resolvedModule } =
|
|
8403
|
-
extendsValue,
|
|
8404
|
-
configFile,
|
|
8405
|
-
{ moduleResolution: 2, resolveJsonModule: true },
|
|
8406
|
-
parseConfigHost
|
|
8407
|
-
);
|
|
8546
|
+
const { resolvedModule } = ts39.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts39.ModuleResolutionKind.Node10, resolveJsonModule: true }, parseConfigHost);
|
|
8408
8547
|
if (resolvedModule) {
|
|
8409
8548
|
return absoluteFrom(resolvedModule.resolvedFileName);
|
|
8410
8549
|
}
|
|
@@ -8414,7 +8553,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
8414
8553
|
function exitCodeFromResult(diags) {
|
|
8415
8554
|
if (!diags)
|
|
8416
8555
|
return 0;
|
|
8417
|
-
if (diags.every((diag) => diag.category !==
|
|
8556
|
+
if (diags.every((diag) => diag.category !== ts39.DiagnosticCategory.Error)) {
|
|
8418
8557
|
return 0;
|
|
8419
8558
|
}
|
|
8420
8559
|
return diags.some((d) => d.source === "angular" && d.code === UNKNOWN_ERROR_CODE) ? 2 : 1;
|
|
@@ -8447,7 +8586,7 @@ function performCompilation({ rootNames, options, host, oldProgram, emitCallback
|
|
|
8447
8586
|
} catch (e) {
|
|
8448
8587
|
program = void 0;
|
|
8449
8588
|
allDiagnostics.push({
|
|
8450
|
-
category:
|
|
8589
|
+
category: ts39.DiagnosticCategory.Error,
|
|
8451
8590
|
messageText: (_a = e.stack) != null ? _a : e.message,
|
|
8452
8591
|
code: UNKNOWN_ERROR_CODE,
|
|
8453
8592
|
file: void 0,
|
|
@@ -8474,7 +8613,7 @@ function defaultGatherDiagnostics(program) {
|
|
|
8474
8613
|
return allDiagnostics;
|
|
8475
8614
|
}
|
|
8476
8615
|
function hasErrors(diags) {
|
|
8477
|
-
return diags.some((d) => d.category ===
|
|
8616
|
+
return diags.some((d) => d.category === ts39.DiagnosticCategory.Error);
|
|
8478
8617
|
}
|
|
8479
8618
|
|
|
8480
8619
|
export {
|
|
@@ -8511,4 +8650,4 @@ export {
|
|
|
8511
8650
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8512
8651
|
* found in the LICENSE file at https://angular.io/license
|
|
8513
8652
|
*/
|
|
8514
|
-
//# sourceMappingURL=chunk-
|
|
8653
|
+
//# sourceMappingURL=chunk-35SQ73FP.js.map
|