@angular/compiler-cli 17.0.0-next.7 → 17.0.0-rc.0
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-W3AMRN7J.js → chunk-225M55ER.js} +2 -2
- package/bundles/{chunk-HJOPJLIM.js → chunk-3IBJEGH3.js} +5 -4
- package/bundles/chunk-3IBJEGH3.js.map +6 -0
- package/bundles/{chunk-C4TR4DIO.js → chunk-7BZJ2Z2V.js} +2 -2
- package/bundles/{chunk-PYIYPY3X.js → chunk-GTB2POO5.js} +3 -3
- package/bundles/{chunk-I3FLXBLP.js → chunk-LPMZPYYV.js} +109 -74
- package/bundles/chunk-LPMZPYYV.js.map +6 -0
- package/bundles/{chunk-PBDWVP2J.js → chunk-Q5XOEMMF.js} +610 -454
- package/bundles/chunk-Q5XOEMMF.js.map +6 -0
- package/bundles/{chunk-PAPUMJUA.js → chunk-RAK4OYZY.js} +3 -1
- package/bundles/{chunk-PAPUMJUA.js.map → chunk-RAK4OYZY.js.map} +1 -1
- package/bundles/{chunk-3NXCUQ44.js → chunk-YR36R26L.js} +2 -2
- package/bundles/index.js +7 -7
- package/bundles/linker/babel/index.js +3 -3
- package/bundles/linker/index.js +3 -3
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/migrations.js +4 -4
- package/bundles/private/tooling.js +2 -2
- package/bundles/src/bin/ng_xi18n.js +6 -6
- package/bundles/src/bin/ngc.js +6 -6
- 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 +14 -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 +6 -2
- package/src/ngtsc/docs/src/generics_extractor.d.ts +15 -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-W3AMRN7J.js.map → chunk-225M55ER.js.map} +0 -0
- /package/bundles/{chunk-C4TR4DIO.js.map → chunk-7BZJ2Z2V.js.map} +0 -0
- /package/bundles/{chunk-PYIYPY3X.js.map → chunk-GTB2POO5.js.map} +0 -0
- /package/bundles/{chunk-3NXCUQ44.js.map → chunk-YR36R26L.js.map} +0 -0
|
@@ -36,12 +36,12 @@ import {
|
|
|
36
36
|
aliasTransformFactory,
|
|
37
37
|
declarationTransformFactory,
|
|
38
38
|
ivyTransformFactory
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-LPMZPYYV.js";
|
|
40
40
|
import {
|
|
41
41
|
ImportManager,
|
|
42
42
|
translateExpression,
|
|
43
43
|
translateType
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-YR36R26L.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-RAK4OYZY.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-3IBJEGH3.js";
|
|
94
94
|
import {
|
|
95
95
|
LogicalFileSystem,
|
|
96
96
|
absoluteFrom,
|
|
@@ -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";
|
|
@@ -167,7 +168,7 @@ var MemberTags;
|
|
|
167
168
|
|
|
168
169
|
// bazel-out/darwin_arm64-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
173
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
|
|
173
174
|
import { Xliff, Xliff2, Xmb } from "@angular/compiler";
|
|
@@ -272,7 +273,7 @@ function verifySupportedTypeScriptVersion() {
|
|
|
272
273
|
}
|
|
273
274
|
|
|
274
275
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
275
|
-
import
|
|
276
|
+
import ts35 from "typescript";
|
|
276
277
|
|
|
277
278
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
|
|
278
279
|
var CycleAnalyzer = class {
|
|
@@ -495,6 +496,22 @@ function getEnumMemberValue(memberNode) {
|
|
|
495
496
|
return (_a = literal == null ? void 0 : literal.getText()) != null ? _a : "";
|
|
496
497
|
}
|
|
497
498
|
|
|
499
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/function_extractor.mjs
|
|
500
|
+
import ts6 from "typescript";
|
|
501
|
+
|
|
502
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/generics_extractor.mjs
|
|
503
|
+
function extractGenerics(declaration) {
|
|
504
|
+
var _a, _b;
|
|
505
|
+
return (_b = (_a = declaration.typeParameters) == null ? void 0 : _a.map((typeParam) => {
|
|
506
|
+
var _a2, _b2;
|
|
507
|
+
return {
|
|
508
|
+
name: typeParam.name.getText(),
|
|
509
|
+
constraint: (_a2 = typeParam.constraint) == null ? void 0 : _a2.getText(),
|
|
510
|
+
default: (_b2 = typeParam.default) == null ? void 0 : _b2.getText()
|
|
511
|
+
};
|
|
512
|
+
})) != null ? _b : [];
|
|
513
|
+
}
|
|
514
|
+
|
|
498
515
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/function_extractor.mjs
|
|
499
516
|
var FunctionExtractor = class {
|
|
500
517
|
constructor(declaration, typeChecker) {
|
|
@@ -509,6 +526,7 @@ var FunctionExtractor = class {
|
|
|
509
526
|
name: this.declaration.name.getText(),
|
|
510
527
|
returnType,
|
|
511
528
|
entryType: EntryType.Function,
|
|
529
|
+
generics: extractGenerics(this.declaration),
|
|
512
530
|
description: extractJsDocDescription(this.declaration),
|
|
513
531
|
jsdocTags: extractJsDocTags(this.declaration),
|
|
514
532
|
rawComment: extractRawJsDoc(this.declaration)
|
|
@@ -523,13 +541,45 @@ var FunctionExtractor = class {
|
|
|
523
541
|
isRestParam: !!param.dotDotDotToken
|
|
524
542
|
}));
|
|
525
543
|
}
|
|
544
|
+
getOverloads() {
|
|
545
|
+
var _a, _b, _c, _d;
|
|
546
|
+
const overloads = [];
|
|
547
|
+
const symbol = this.getSymbol();
|
|
548
|
+
const declarationCount = (_b = (_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a.length) != null ? _b : 0;
|
|
549
|
+
if (declarationCount > 1) {
|
|
550
|
+
for (let i = 0; i < declarationCount - 1; i++) {
|
|
551
|
+
const overloadDeclaration = (_c = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _c[i];
|
|
552
|
+
if ((overloadDeclaration == null ? void 0 : overloadDeclaration.pos) === this.declaration.pos)
|
|
553
|
+
continue;
|
|
554
|
+
if (overloadDeclaration && ts6.isFunctionDeclaration(overloadDeclaration) && ((_d = overloadDeclaration.modifiers) == null ? void 0 : _d.some((mod) => mod.kind === ts6.SyntaxKind.ExportKeyword))) {
|
|
555
|
+
overloads.push(overloadDeclaration);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
return overloads;
|
|
560
|
+
}
|
|
561
|
+
getSymbol() {
|
|
562
|
+
return this.typeChecker.getSymbolsInScope(this.declaration, ts6.SymbolFlags.Function).find((s) => {
|
|
563
|
+
var _a;
|
|
564
|
+
return s.name === ((_a = this.declaration.name) == null ? void 0 : _a.getText());
|
|
565
|
+
});
|
|
566
|
+
}
|
|
526
567
|
};
|
|
527
568
|
|
|
528
569
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/extractor.mjs
|
|
570
|
+
import ts8 from "typescript";
|
|
571
|
+
|
|
572
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/class_extractor.mjs
|
|
529
573
|
import ts7 from "typescript";
|
|
530
574
|
|
|
575
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/filters.mjs
|
|
576
|
+
function isAngularPrivateName(name) {
|
|
577
|
+
var _a;
|
|
578
|
+
const firstChar = (_a = name[0]) != null ? _a : "";
|
|
579
|
+
return firstChar === "\u0275" || firstChar === "_";
|
|
580
|
+
}
|
|
581
|
+
|
|
531
582
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/class_extractor.mjs
|
|
532
|
-
import ts6 from "typescript";
|
|
533
583
|
var ClassExtractor = class {
|
|
534
584
|
constructor(declaration, typeChecker) {
|
|
535
585
|
this.declaration = declaration;
|
|
@@ -538,8 +588,10 @@ var ClassExtractor = class {
|
|
|
538
588
|
extract() {
|
|
539
589
|
return {
|
|
540
590
|
name: this.declaration.name.text,
|
|
541
|
-
|
|
591
|
+
isAbstract: this.isAbstract(),
|
|
592
|
+
entryType: ts7.isInterfaceDeclaration(this.declaration) ? EntryType.Interface : EntryType.UndecoratedClass,
|
|
542
593
|
members: this.extractAllClassMembers(this.declaration),
|
|
594
|
+
generics: extractGenerics(this.declaration),
|
|
543
595
|
description: extractJsDocDescription(this.declaration),
|
|
544
596
|
jsdocTags: extractJsDocTags(this.declaration),
|
|
545
597
|
rawComment: extractRawJsDoc(this.declaration)
|
|
@@ -558,11 +610,11 @@ var ClassExtractor = class {
|
|
|
558
610
|
return members;
|
|
559
611
|
}
|
|
560
612
|
extractClassMember(memberDeclaration) {
|
|
561
|
-
if (this.isMethod(memberDeclaration)) {
|
|
613
|
+
if (this.isMethod(memberDeclaration) && !this.isImplementationForOverload(memberDeclaration)) {
|
|
562
614
|
return this.extractMethod(memberDeclaration);
|
|
563
615
|
} else if (this.isProperty(memberDeclaration)) {
|
|
564
616
|
return this.extractClassProperty(memberDeclaration);
|
|
565
|
-
} else if (
|
|
617
|
+
} else if (ts7.isAccessor(memberDeclaration)) {
|
|
566
618
|
return this.extractGetterSetter(memberDeclaration);
|
|
567
619
|
}
|
|
568
620
|
return void 0;
|
|
@@ -588,7 +640,7 @@ var ClassExtractor = class {
|
|
|
588
640
|
extractGetterSetter(accessor) {
|
|
589
641
|
return {
|
|
590
642
|
...this.extractClassProperty(accessor),
|
|
591
|
-
memberType:
|
|
643
|
+
memberType: ts7.isGetAccessor(accessor) ? MemberType.Getter : MemberType.Setter
|
|
592
644
|
};
|
|
593
645
|
}
|
|
594
646
|
getMemberTags(member) {
|
|
@@ -610,28 +662,46 @@ var ClassExtractor = class {
|
|
|
610
662
|
}
|
|
611
663
|
getTagForMemberModifier(mod) {
|
|
612
664
|
switch (mod.kind) {
|
|
613
|
-
case
|
|
665
|
+
case ts7.SyntaxKind.StaticKeyword:
|
|
614
666
|
return MemberTags.Static;
|
|
615
|
-
case
|
|
667
|
+
case ts7.SyntaxKind.ReadonlyKeyword:
|
|
616
668
|
return MemberTags.Readonly;
|
|
617
|
-
case
|
|
669
|
+
case ts7.SyntaxKind.ProtectedKeyword:
|
|
618
670
|
return MemberTags.Protected;
|
|
671
|
+
case ts7.SyntaxKind.AbstractKeyword:
|
|
672
|
+
return MemberTags.Abstract;
|
|
619
673
|
default:
|
|
620
674
|
return void 0;
|
|
621
675
|
}
|
|
622
676
|
}
|
|
623
677
|
isMemberExcluded(member) {
|
|
624
678
|
var _a;
|
|
625
|
-
return !member.name || !this.isDocumentableMember(member) || !!((_a = member.modifiers) == null ? void 0 : _a.some((mod) => mod.kind ===
|
|
679
|
+
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
680
|
}
|
|
627
681
|
isDocumentableMember(member) {
|
|
628
|
-
return this.isMethod(member) || this.isProperty(member) ||
|
|
682
|
+
return this.isMethod(member) || this.isProperty(member) || ts7.isAccessor(member);
|
|
629
683
|
}
|
|
630
684
|
isProperty(member) {
|
|
631
|
-
return
|
|
685
|
+
return ts7.isPropertyDeclaration(member) || ts7.isPropertySignature(member);
|
|
632
686
|
}
|
|
633
687
|
isMethod(member) {
|
|
634
|
-
return
|
|
688
|
+
return ts7.isMethodDeclaration(member) || ts7.isMethodSignature(member);
|
|
689
|
+
}
|
|
690
|
+
isAbstract() {
|
|
691
|
+
var _a;
|
|
692
|
+
const modifiers = (_a = this.declaration.modifiers) != null ? _a : [];
|
|
693
|
+
return modifiers.some((mod) => mod.kind === ts7.SyntaxKind.AbstractKeyword);
|
|
694
|
+
}
|
|
695
|
+
isImplementationForOverload(method) {
|
|
696
|
+
if (method.kind === ts7.SyntaxKind.MethodSignature)
|
|
697
|
+
return false;
|
|
698
|
+
const methodsWithSameName = this.declaration.members.filter((member) => {
|
|
699
|
+
var _a;
|
|
700
|
+
return ((_a = member.name) == null ? void 0 : _a.getText()) === method.name.getText();
|
|
701
|
+
}).sort((a, b) => a.pos - b.pos);
|
|
702
|
+
if (methodsWithSameName.length === 1)
|
|
703
|
+
return false;
|
|
704
|
+
return method.pos === methodsWithSameName[methodsWithSameName.length - 1].pos;
|
|
635
705
|
}
|
|
636
706
|
};
|
|
637
707
|
var DirectiveExtractor = class extends ClassExtractor {
|
|
@@ -656,6 +726,7 @@ var DirectiveExtractor = class extends ClassExtractor {
|
|
|
656
726
|
if (inputMetadata) {
|
|
657
727
|
entry.memberTags.push(MemberTags.Input);
|
|
658
728
|
entry.inputAlias = inputMetadata.bindingPropertyName;
|
|
729
|
+
entry.isRequiredInput = inputMetadata.required;
|
|
659
730
|
}
|
|
660
731
|
const outputMetadata = this.getOutputMetadata(propertyDeclaration);
|
|
661
732
|
if (outputMetadata) {
|
|
@@ -743,6 +814,18 @@ function isSyntheticAngularConstant(declaration) {
|
|
|
743
814
|
return declaration.name.getText() === "USED_FOR_NG_TYPE_CHECKING";
|
|
744
815
|
}
|
|
745
816
|
|
|
817
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/type_alias_extractor.mjs
|
|
818
|
+
function extractTypeAlias(declaration) {
|
|
819
|
+
return {
|
|
820
|
+
name: declaration.name.getText(),
|
|
821
|
+
type: declaration.type.getText(),
|
|
822
|
+
entryType: EntryType.TypeAlias,
|
|
823
|
+
rawComment: extractRawJsDoc(declaration),
|
|
824
|
+
description: extractJsDocDescription(declaration),
|
|
825
|
+
jsdocTags: extractJsDocTags(declaration)
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
|
|
746
829
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/extractor.mjs
|
|
747
830
|
var DocsExtractor = class {
|
|
748
831
|
constructor(typeChecker, metadataReader) {
|
|
@@ -750,40 +833,60 @@ var DocsExtractor = class {
|
|
|
750
833
|
this.metadataReader = metadataReader;
|
|
751
834
|
}
|
|
752
835
|
extractAll(sourceFile) {
|
|
753
|
-
var _a;
|
|
754
836
|
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);
|
|
837
|
+
const exportedDeclarations = this.getExportedDeclarations(sourceFile);
|
|
758
838
|
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
|
-
}
|
|
839
|
+
if (isAngularPrivateName(exportName))
|
|
840
|
+
continue;
|
|
841
|
+
const entry = this.extractDeclaration(node);
|
|
776
842
|
if (entry) {
|
|
777
|
-
entry
|
|
778
|
-
entries.push(entry);
|
|
843
|
+
entries.push({ ...entry, name: exportName });
|
|
779
844
|
}
|
|
780
845
|
}
|
|
781
846
|
return entries;
|
|
782
847
|
}
|
|
848
|
+
extractDeclaration(node) {
|
|
849
|
+
if (isNamedClassDeclaration(node)) {
|
|
850
|
+
return extractClass(node, this.metadataReader, this.typeChecker);
|
|
851
|
+
}
|
|
852
|
+
if (ts8.isInterfaceDeclaration(node)) {
|
|
853
|
+
return extractInterface(node, this.typeChecker);
|
|
854
|
+
}
|
|
855
|
+
if (ts8.isFunctionDeclaration(node)) {
|
|
856
|
+
const functionExtractor = new FunctionExtractor(node, this.typeChecker);
|
|
857
|
+
return functionExtractor.extract();
|
|
858
|
+
}
|
|
859
|
+
if (ts8.isVariableDeclaration(node) && !isSyntheticAngularConstant(node)) {
|
|
860
|
+
return extractConstant(node, this.typeChecker);
|
|
861
|
+
}
|
|
862
|
+
if (ts8.isTypeAliasDeclaration(node)) {
|
|
863
|
+
return extractTypeAlias(node);
|
|
864
|
+
}
|
|
865
|
+
if (ts8.isEnumDeclaration(node)) {
|
|
866
|
+
return extractEnum(node, this.typeChecker);
|
|
867
|
+
}
|
|
868
|
+
return null;
|
|
869
|
+
}
|
|
870
|
+
getExportedDeclarations(sourceFile) {
|
|
871
|
+
var _a;
|
|
872
|
+
const reflector = new TypeScriptReflectionHost(this.typeChecker);
|
|
873
|
+
const exportedDeclarationMap = reflector.getExportsOfModule(sourceFile);
|
|
874
|
+
let exportedDeclarations = Array.from((_a = exportedDeclarationMap == null ? void 0 : exportedDeclarationMap.entries()) != null ? _a : []).map(([exportName, declaration]) => [exportName, declaration.node]);
|
|
875
|
+
const declarationCount = exportedDeclarations.length;
|
|
876
|
+
for (let i = 0; i < declarationCount; i++) {
|
|
877
|
+
const [exportName, declaration] = exportedDeclarations[i];
|
|
878
|
+
if (ts8.isFunctionDeclaration(declaration)) {
|
|
879
|
+
const extractor = new FunctionExtractor(declaration, this.typeChecker);
|
|
880
|
+
const overloads = extractor.getOverloads().map((overload) => [exportName, overload]);
|
|
881
|
+
exportedDeclarations.push(...overloads);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
return exportedDeclarations.sort(([a, declarationA], [b, declarationB]) => declarationA.pos - declarationB.pos);
|
|
885
|
+
}
|
|
783
886
|
};
|
|
784
887
|
|
|
785
888
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/generator.mjs
|
|
786
|
-
import
|
|
889
|
+
import ts9 from "typescript";
|
|
787
890
|
var FlatIndexGenerator = class {
|
|
788
891
|
constructor(entryPoint, relativeFlatIndexPath, moduleName) {
|
|
789
892
|
this.entryPoint = entryPoint;
|
|
@@ -799,7 +902,7 @@ var FlatIndexGenerator = class {
|
|
|
799
902
|
|
|
800
903
|
export * from '${relativeEntryPoint}';
|
|
801
904
|
`;
|
|
802
|
-
const genFile =
|
|
905
|
+
const genFile = ts9.createSourceFile(this.flatIndexPath, contents, ts9.ScriptTarget.ES2015, true, ts9.ScriptKind.TS);
|
|
803
906
|
if (this.moduleName !== null) {
|
|
804
907
|
genFile.moduleName = this.moduleName;
|
|
805
908
|
}
|
|
@@ -824,7 +927,7 @@ function findFlatIndexEntryPoint(rootFiles) {
|
|
|
824
927
|
}
|
|
825
928
|
|
|
826
929
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/private_export_checker.mjs
|
|
827
|
-
import
|
|
930
|
+
import ts10 from "typescript";
|
|
828
931
|
function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
829
932
|
const diagnostics = [];
|
|
830
933
|
const topLevelExports = /* @__PURE__ */ new Set();
|
|
@@ -834,7 +937,7 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
|
834
937
|
}
|
|
835
938
|
const exportedSymbols = checker.getExportsOfModule(moduleSymbol);
|
|
836
939
|
exportedSymbols.forEach((symbol) => {
|
|
837
|
-
if (symbol.flags &
|
|
940
|
+
if (symbol.flags & ts10.SymbolFlags.Alias) {
|
|
838
941
|
symbol = checker.getAliasedSymbol(symbol);
|
|
839
942
|
}
|
|
840
943
|
const decl = symbol.valueDeclaration;
|
|
@@ -858,7 +961,7 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
|
858
961
|
visibleVia = transitivePath.map((seg) => getNameOfDeclaration(seg)).join(" -> ");
|
|
859
962
|
}
|
|
860
963
|
const diagnostic = {
|
|
861
|
-
category:
|
|
964
|
+
category: ts10.DiagnosticCategory.Error,
|
|
862
965
|
code: ngErrorCode(ErrorCode.SYMBOL_NOT_EXPORTED),
|
|
863
966
|
file: transitiveReference.getSourceFile(),
|
|
864
967
|
...getPosOfDeclaration(transitiveReference),
|
|
@@ -878,7 +981,7 @@ function getPosOfDeclaration(decl) {
|
|
|
878
981
|
};
|
|
879
982
|
}
|
|
880
983
|
function getIdentifierOfDeclaration(decl) {
|
|
881
|
-
if ((
|
|
984
|
+
if ((ts10.isClassDeclaration(decl) || ts10.isVariableDeclaration(decl) || ts10.isFunctionDeclaration(decl)) && decl.name !== void 0 && ts10.isIdentifier(decl.name)) {
|
|
882
985
|
return decl.name;
|
|
883
986
|
} else {
|
|
884
987
|
return null;
|
|
@@ -890,13 +993,13 @@ function getNameOfDeclaration(decl) {
|
|
|
890
993
|
}
|
|
891
994
|
function getDescriptorOfDeclaration(decl) {
|
|
892
995
|
switch (decl.kind) {
|
|
893
|
-
case
|
|
996
|
+
case ts10.SyntaxKind.ClassDeclaration:
|
|
894
997
|
return "class";
|
|
895
|
-
case
|
|
998
|
+
case ts10.SyntaxKind.FunctionDeclaration:
|
|
896
999
|
return "function";
|
|
897
|
-
case
|
|
1000
|
+
case ts10.SyntaxKind.VariableDeclaration:
|
|
898
1001
|
return "variable";
|
|
899
|
-
case
|
|
1002
|
+
case ts10.SyntaxKind.EnumDeclaration:
|
|
900
1003
|
return "enum";
|
|
901
1004
|
default:
|
|
902
1005
|
return "declaration";
|
|
@@ -966,10 +1069,10 @@ var UpdateMode;
|
|
|
966
1069
|
})(UpdateMode || (UpdateMode = {}));
|
|
967
1070
|
|
|
968
1071
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
969
|
-
import
|
|
1072
|
+
import ts12 from "typescript";
|
|
970
1073
|
|
|
971
1074
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
972
|
-
import
|
|
1075
|
+
import ts11 from "typescript";
|
|
973
1076
|
|
|
974
1077
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/expando.mjs
|
|
975
1078
|
var NgExtension = Symbol("NgExtension");
|
|
@@ -1100,10 +1203,10 @@ var ShimAdapter = class {
|
|
|
1100
1203
|
}
|
|
1101
1204
|
const prefix = match[1];
|
|
1102
1205
|
let baseFileName = absoluteFrom(prefix + ".ts");
|
|
1103
|
-
let inputFile = this.delegate.getSourceFile(baseFileName,
|
|
1206
|
+
let inputFile = this.delegate.getSourceFile(baseFileName, ts11.ScriptTarget.Latest);
|
|
1104
1207
|
if (inputFile === void 0) {
|
|
1105
1208
|
baseFileName = absoluteFrom(prefix + ".tsx");
|
|
1106
|
-
inputFile = this.delegate.getSourceFile(baseFileName,
|
|
1209
|
+
inputFile = this.delegate.getSourceFile(baseFileName, ts11.ScriptTarget.Latest);
|
|
1107
1210
|
}
|
|
1108
1211
|
if (inputFile === void 0 || isShim(inputFile)) {
|
|
1109
1212
|
return void 0;
|
|
@@ -1258,7 +1361,7 @@ var TsCreateProgramDriver = class {
|
|
|
1258
1361
|
this.sfMap.clear();
|
|
1259
1362
|
}
|
|
1260
1363
|
for (const [filePath, { newText, originalFile }] of contents.entries()) {
|
|
1261
|
-
const sf =
|
|
1364
|
+
const sf = ts12.createSourceFile(filePath, newText, ts12.ScriptTarget.Latest, true);
|
|
1262
1365
|
if (originalFile !== null) {
|
|
1263
1366
|
sf[NgOriginalFile] = originalFile;
|
|
1264
1367
|
}
|
|
@@ -1267,7 +1370,7 @@ var TsCreateProgramDriver = class {
|
|
|
1267
1370
|
const host = new UpdatedProgramHost(this.sfMap, this.originalProgram, this.originalHost, this.shimExtensionPrefixes);
|
|
1268
1371
|
const oldProgram = this.program;
|
|
1269
1372
|
retagAllTsFiles(oldProgram);
|
|
1270
|
-
this.program =
|
|
1373
|
+
this.program = ts12.createProgram({
|
|
1271
1374
|
host,
|
|
1272
1375
|
rootNames: this.program.getRootFileNames(),
|
|
1273
1376
|
options: this.options,
|
|
@@ -2030,7 +2133,7 @@ var NgModuleIndexImpl = class {
|
|
|
2030
2133
|
};
|
|
2031
2134
|
|
|
2032
2135
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/resource/src/loader.mjs
|
|
2033
|
-
import
|
|
2136
|
+
import ts13 from "typescript";
|
|
2034
2137
|
var CSS_PREPROCESSOR_EXT = /(\.scss|\.sass|\.less|\.styl)$/;
|
|
2035
2138
|
var RESOURCE_MARKER = ".$ngresource$";
|
|
2036
2139
|
var RESOURCE_MARKER_TS = RESOURCE_MARKER + ".ts";
|
|
@@ -2140,7 +2243,7 @@ var AdapterResourceLoader = class {
|
|
|
2140
2243
|
return this.adapter.rootDirs.map((rootDir) => join(rootDir, segment));
|
|
2141
2244
|
}
|
|
2142
2245
|
getResolvedCandidateLocations(url, fromFile) {
|
|
2143
|
-
const failedLookup =
|
|
2246
|
+
const failedLookup = ts13.resolveModuleName(url + RESOURCE_MARKER, fromFile, this.options, this.lookupResolutionHost);
|
|
2144
2247
|
if (failedLookup.failedLookupLocations === void 0) {
|
|
2145
2248
|
throw new Error(`Internal error: expected to find failedLookupLocations during resolution of resource '${url}' in context of ${fromFile}`);
|
|
2146
2249
|
}
|
|
@@ -2257,7 +2360,7 @@ var StandaloneComponentScopeReader = class {
|
|
|
2257
2360
|
import { CssSelector, DomElementSchemaRegistry as DomElementSchemaRegistry2, ExternalExpr as ExternalExpr2, WrappedNodeExpr } from "@angular/compiler";
|
|
2258
2361
|
|
|
2259
2362
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/diagnostic.mjs
|
|
2260
|
-
import
|
|
2363
|
+
import ts14 from "typescript";
|
|
2261
2364
|
function makeTemplateDiagnostic(templateId, mapping, span, category, code, messageText, relatedMessages) {
|
|
2262
2365
|
var _a;
|
|
2263
2366
|
if (mapping.type === "direct") {
|
|
@@ -2266,7 +2369,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
2266
2369
|
relatedInformation = [];
|
|
2267
2370
|
for (const relatedMessage of relatedMessages) {
|
|
2268
2371
|
relatedInformation.push({
|
|
2269
|
-
category:
|
|
2372
|
+
category: ts14.DiagnosticCategory.Message,
|
|
2270
2373
|
code: 0,
|
|
2271
2374
|
file: relatedMessage.sourceFile,
|
|
2272
2375
|
start: relatedMessage.start,
|
|
@@ -2295,7 +2398,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
2295
2398
|
if (relatedMessages !== void 0) {
|
|
2296
2399
|
for (const relatedMessage of relatedMessages) {
|
|
2297
2400
|
relatedInformation.push({
|
|
2298
|
-
category:
|
|
2401
|
+
category: ts14.DiagnosticCategory.Message,
|
|
2299
2402
|
code: 0,
|
|
2300
2403
|
file: relatedMessage.sourceFile,
|
|
2301
2404
|
start: relatedMessage.start,
|
|
@@ -2325,7 +2428,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
2325
2428
|
};
|
|
2326
2429
|
}
|
|
2327
2430
|
relatedInformation.push({
|
|
2328
|
-
category:
|
|
2431
|
+
category: ts14.DiagnosticCategory.Message,
|
|
2329
2432
|
code: 0,
|
|
2330
2433
|
file: componentSf,
|
|
2331
2434
|
start: mapping.node.getStart(),
|
|
@@ -2360,7 +2463,7 @@ function parseTemplateAsSourceFile(fileName, template) {
|
|
|
2360
2463
|
if (parseTemplateAsSourceFileForTest !== null) {
|
|
2361
2464
|
return parseTemplateAsSourceFileForTest(fileName, template);
|
|
2362
2465
|
}
|
|
2363
|
-
return
|
|
2466
|
+
return ts14.createSourceFile(fileName, template, ts14.ScriptTarget.Latest, false, ts14.ScriptKind.JSX);
|
|
2364
2467
|
}
|
|
2365
2468
|
|
|
2366
2469
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/id.mjs
|
|
@@ -2382,15 +2485,15 @@ function allocateTemplateId(sf) {
|
|
|
2382
2485
|
|
|
2383
2486
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
2384
2487
|
import { EmptyExpr, ImplicitReceiver as ImplicitReceiver2, PropertyRead as PropertyRead2, PropertyWrite as PropertyWrite2, SafePropertyRead, TmplAstReference as TmplAstReference2, TmplAstTextAttribute } from "@angular/compiler";
|
|
2385
|
-
import
|
|
2488
|
+
import ts16 from "typescript";
|
|
2386
2489
|
|
|
2387
2490
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/comments.mjs
|
|
2388
2491
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan2 } from "@angular/compiler";
|
|
2389
|
-
import
|
|
2492
|
+
import ts15 from "typescript";
|
|
2390
2493
|
var parseSpanComment = /^(\d+),(\d+)$/;
|
|
2391
2494
|
function readSpanComment(node, sourceFile = node.getSourceFile()) {
|
|
2392
|
-
return
|
|
2393
|
-
if (kind !==
|
|
2495
|
+
return ts15.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
2496
|
+
if (kind !== ts15.SyntaxKind.MultiLineCommentTrivia) {
|
|
2394
2497
|
return null;
|
|
2395
2498
|
}
|
|
2396
2499
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -2413,25 +2516,25 @@ var ExpressionIdentifier;
|
|
|
2413
2516
|
ExpressionIdentifier2["EVENT_PARAMETER"] = "EP";
|
|
2414
2517
|
})(ExpressionIdentifier || (ExpressionIdentifier = {}));
|
|
2415
2518
|
function addExpressionIdentifier(node, identifier) {
|
|
2416
|
-
|
|
2519
|
+
ts15.addSyntheticTrailingComment(
|
|
2417
2520
|
node,
|
|
2418
|
-
|
|
2521
|
+
ts15.SyntaxKind.MultiLineCommentTrivia,
|
|
2419
2522
|
`${CommentTriviaType.EXPRESSION_TYPE_IDENTIFIER}:${identifier}`,
|
|
2420
2523
|
false
|
|
2421
2524
|
);
|
|
2422
2525
|
}
|
|
2423
2526
|
var IGNORE_FOR_DIAGNOSTICS_MARKER = `${CommentTriviaType.DIAGNOSTIC}:ignore`;
|
|
2424
2527
|
function markIgnoreDiagnostics(node) {
|
|
2425
|
-
|
|
2528
|
+
ts15.addSyntheticTrailingComment(
|
|
2426
2529
|
node,
|
|
2427
|
-
|
|
2530
|
+
ts15.SyntaxKind.MultiLineCommentTrivia,
|
|
2428
2531
|
IGNORE_FOR_DIAGNOSTICS_MARKER,
|
|
2429
2532
|
false
|
|
2430
2533
|
);
|
|
2431
2534
|
}
|
|
2432
2535
|
function hasIgnoreForDiagnosticsMarker(node, sourceFile) {
|
|
2433
|
-
return
|
|
2434
|
-
if (kind !==
|
|
2536
|
+
return ts15.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
2537
|
+
if (kind !== ts15.SyntaxKind.MultiLineCommentTrivia) {
|
|
2435
2538
|
return null;
|
|
2436
2539
|
}
|
|
2437
2540
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -2505,8 +2608,8 @@ function findAllMatchingNodes(tcb, opts) {
|
|
|
2505
2608
|
return results;
|
|
2506
2609
|
}
|
|
2507
2610
|
function hasExpressionIdentifier(sourceFile, node, identifier) {
|
|
2508
|
-
return
|
|
2509
|
-
if (kind !==
|
|
2611
|
+
return ts15.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
2612
|
+
if (kind !== ts15.SyntaxKind.MultiLineCommentTrivia) {
|
|
2510
2613
|
return false;
|
|
2511
2614
|
}
|
|
2512
2615
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -2524,7 +2627,7 @@ var CompletionEngine = class {
|
|
|
2524
2627
|
this.templateContextCache = /* @__PURE__ */ new Map();
|
|
2525
2628
|
this.expressionCompletionCache = /* @__PURE__ */ new Map();
|
|
2526
2629
|
const globalRead = findFirstMatchingNode(this.tcb, {
|
|
2527
|
-
filter:
|
|
2630
|
+
filter: ts16.isPropertyAccessExpression,
|
|
2528
2631
|
withExpressionIdentifier: ExpressionIdentifier.COMPONENT_COMPLETION
|
|
2529
2632
|
});
|
|
2530
2633
|
if (globalRead !== null) {
|
|
@@ -2548,7 +2651,7 @@ var CompletionEngine = class {
|
|
|
2548
2651
|
let nodeContext = null;
|
|
2549
2652
|
if (node instanceof EmptyExpr) {
|
|
2550
2653
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
2551
|
-
filter:
|
|
2654
|
+
filter: ts16.isIdentifier,
|
|
2552
2655
|
withSpan: node.sourceSpan
|
|
2553
2656
|
});
|
|
2554
2657
|
if (nodeLocation !== null) {
|
|
@@ -2561,7 +2664,7 @@ var CompletionEngine = class {
|
|
|
2561
2664
|
}
|
|
2562
2665
|
if (node instanceof PropertyRead2 && node.receiver instanceof ImplicitReceiver2) {
|
|
2563
2666
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
2564
|
-
filter:
|
|
2667
|
+
filter: ts16.isPropertyAccessExpression,
|
|
2565
2668
|
withSpan: node.sourceSpan
|
|
2566
2669
|
});
|
|
2567
2670
|
if (nodeLocation) {
|
|
@@ -2585,21 +2688,21 @@ var CompletionEngine = class {
|
|
|
2585
2688
|
let tsExpr = null;
|
|
2586
2689
|
if (expr instanceof PropertyRead2 || expr instanceof PropertyWrite2) {
|
|
2587
2690
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
2588
|
-
filter:
|
|
2691
|
+
filter: ts16.isPropertyAccessExpression,
|
|
2589
2692
|
withSpan: expr.nameSpan
|
|
2590
2693
|
});
|
|
2591
2694
|
} else if (expr instanceof SafePropertyRead) {
|
|
2592
2695
|
const ternaryExpr = findFirstMatchingNode(this.tcb, {
|
|
2593
|
-
filter:
|
|
2696
|
+
filter: ts16.isParenthesizedExpression,
|
|
2594
2697
|
withSpan: expr.sourceSpan
|
|
2595
2698
|
});
|
|
2596
|
-
if (ternaryExpr === null || !
|
|
2699
|
+
if (ternaryExpr === null || !ts16.isConditionalExpression(ternaryExpr.expression)) {
|
|
2597
2700
|
return null;
|
|
2598
2701
|
}
|
|
2599
2702
|
const whenTrue = ternaryExpr.expression.whenTrue;
|
|
2600
|
-
if (
|
|
2703
|
+
if (ts16.isPropertyAccessExpression(whenTrue)) {
|
|
2601
2704
|
tsExpr = whenTrue;
|
|
2602
|
-
} else if (
|
|
2705
|
+
} else if (ts16.isCallExpression(whenTrue) && ts16.isPropertyAccessExpression(whenTrue.expression)) {
|
|
2603
2706
|
tsExpr = whenTrue.expression;
|
|
2604
2707
|
}
|
|
2605
2708
|
}
|
|
@@ -2621,15 +2724,15 @@ var CompletionEngine = class {
|
|
|
2621
2724
|
let tsExpr = null;
|
|
2622
2725
|
if (expr instanceof TmplAstTextAttribute) {
|
|
2623
2726
|
const strNode = findFirstMatchingNode(this.tcb, {
|
|
2624
|
-
filter:
|
|
2727
|
+
filter: ts16.isParenthesizedExpression,
|
|
2625
2728
|
withSpan: expr.sourceSpan
|
|
2626
2729
|
});
|
|
2627
|
-
if (strNode !== null &&
|
|
2730
|
+
if (strNode !== null && ts16.isStringLiteral(strNode.expression)) {
|
|
2628
2731
|
tsExpr = strNode.expression;
|
|
2629
2732
|
}
|
|
2630
2733
|
} else {
|
|
2631
2734
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
2632
|
-
filter: (n) =>
|
|
2735
|
+
filter: (n) => ts16.isStringLiteral(n) || ts16.isNumericLiteral(n),
|
|
2633
2736
|
withSpan: expr.sourceSpan
|
|
2634
2737
|
});
|
|
2635
2738
|
}
|
|
@@ -2637,7 +2740,7 @@ var CompletionEngine = class {
|
|
|
2637
2740
|
return null;
|
|
2638
2741
|
}
|
|
2639
2742
|
let positionInShimFile = tsExpr.getEnd();
|
|
2640
|
-
if (
|
|
2743
|
+
if (ts16.isStringLiteral(tsExpr)) {
|
|
2641
2744
|
positionInShimFile -= 1;
|
|
2642
2745
|
}
|
|
2643
2746
|
const res = {
|
|
@@ -2672,11 +2775,11 @@ var CompletionEngine = class {
|
|
|
2672
2775
|
};
|
|
2673
2776
|
|
|
2674
2777
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
|
|
2675
|
-
import
|
|
2778
|
+
import ts30 from "typescript";
|
|
2676
2779
|
|
|
2677
2780
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/dom.mjs
|
|
2678
2781
|
import { DomElementSchemaRegistry } from "@angular/compiler";
|
|
2679
|
-
import
|
|
2782
|
+
import ts17 from "typescript";
|
|
2680
2783
|
var REGISTRY = new DomElementSchemaRegistry();
|
|
2681
2784
|
var REMOVE_XHTML_REGEX = /^:xhtml:/;
|
|
2682
2785
|
var RegistryDomSchemaChecker = class {
|
|
@@ -2701,7 +2804,7 @@ var RegistryDomSchemaChecker = class {
|
|
|
2701
2804
|
} else {
|
|
2702
2805
|
errorMsg += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas2} of this component.`;
|
|
2703
2806
|
}
|
|
2704
|
-
const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan,
|
|
2807
|
+
const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan, ts17.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ELEMENT), errorMsg);
|
|
2705
2808
|
this._diagnostics.push(diag);
|
|
2706
2809
|
}
|
|
2707
2810
|
}
|
|
@@ -2721,7 +2824,7 @@ var RegistryDomSchemaChecker = class {
|
|
|
2721
2824
|
2. If '${element.name}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas2} of this component to suppress this message.
|
|
2722
2825
|
3. To allow any property add 'NO_ERRORS_SCHEMA' to the ${schemas2} of this component.`;
|
|
2723
2826
|
}
|
|
2724
|
-
const diag = makeTemplateDiagnostic(id, mapping, span,
|
|
2827
|
+
const diag = makeTemplateDiagnostic(id, mapping, span, ts17.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ATTRIBUTE), errorMsg);
|
|
2725
2828
|
this._diagnostics.push(diag);
|
|
2726
2829
|
}
|
|
2727
2830
|
}
|
|
@@ -2729,93 +2832,93 @@ var RegistryDomSchemaChecker = class {
|
|
|
2729
2832
|
|
|
2730
2833
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
|
|
2731
2834
|
import { ExpressionType, ExternalExpr, TypeModifier } from "@angular/compiler";
|
|
2732
|
-
import
|
|
2835
|
+
import ts23 from "typescript";
|
|
2733
2836
|
|
|
2734
2837
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/ts_util.mjs
|
|
2735
|
-
import
|
|
2838
|
+
import ts18 from "typescript";
|
|
2736
2839
|
var SAFE_TO_CAST_WITHOUT_PARENS = /* @__PURE__ */ new Set([
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2840
|
+
ts18.SyntaxKind.ParenthesizedExpression,
|
|
2841
|
+
ts18.SyntaxKind.Identifier,
|
|
2842
|
+
ts18.SyntaxKind.CallExpression,
|
|
2843
|
+
ts18.SyntaxKind.NonNullExpression,
|
|
2844
|
+
ts18.SyntaxKind.ElementAccessExpression,
|
|
2845
|
+
ts18.SyntaxKind.PropertyAccessExpression,
|
|
2846
|
+
ts18.SyntaxKind.ArrayLiteralExpression,
|
|
2847
|
+
ts18.SyntaxKind.ObjectLiteralExpression,
|
|
2848
|
+
ts18.SyntaxKind.StringLiteral,
|
|
2849
|
+
ts18.SyntaxKind.NumericLiteral,
|
|
2850
|
+
ts18.SyntaxKind.TrueKeyword,
|
|
2851
|
+
ts18.SyntaxKind.FalseKeyword,
|
|
2852
|
+
ts18.SyntaxKind.NullKeyword,
|
|
2853
|
+
ts18.SyntaxKind.UndefinedKeyword
|
|
2751
2854
|
]);
|
|
2752
2855
|
function tsCastToAny(expr) {
|
|
2753
2856
|
if (!SAFE_TO_CAST_WITHOUT_PARENS.has(expr.kind)) {
|
|
2754
|
-
expr =
|
|
2857
|
+
expr = ts18.factory.createParenthesizedExpression(expr);
|
|
2755
2858
|
}
|
|
2756
|
-
return
|
|
2859
|
+
return ts18.factory.createParenthesizedExpression(ts18.factory.createAsExpression(expr, ts18.factory.createKeywordTypeNode(ts18.SyntaxKind.AnyKeyword)));
|
|
2757
2860
|
}
|
|
2758
2861
|
function tsCreateElement(tagName) {
|
|
2759
|
-
const createElement =
|
|
2760
|
-
|
|
2862
|
+
const createElement = ts18.factory.createPropertyAccessExpression(
|
|
2863
|
+
ts18.factory.createIdentifier("document"),
|
|
2761
2864
|
"createElement"
|
|
2762
2865
|
);
|
|
2763
|
-
return
|
|
2866
|
+
return ts18.factory.createCallExpression(
|
|
2764
2867
|
createElement,
|
|
2765
2868
|
void 0,
|
|
2766
|
-
[
|
|
2869
|
+
[ts18.factory.createStringLiteral(tagName)]
|
|
2767
2870
|
);
|
|
2768
2871
|
}
|
|
2769
2872
|
function tsDeclareVariable(id, type) {
|
|
2770
|
-
const decl =
|
|
2873
|
+
const decl = ts18.factory.createVariableDeclaration(
|
|
2771
2874
|
id,
|
|
2772
2875
|
void 0,
|
|
2773
2876
|
type,
|
|
2774
|
-
|
|
2877
|
+
ts18.factory.createNonNullExpression(ts18.factory.createNull())
|
|
2775
2878
|
);
|
|
2776
|
-
return
|
|
2879
|
+
return ts18.factory.createVariableStatement(
|
|
2777
2880
|
void 0,
|
|
2778
2881
|
[decl]
|
|
2779
2882
|
);
|
|
2780
2883
|
}
|
|
2781
2884
|
function tsCreateTypeQueryForCoercedInput(typeName, coercedInputName) {
|
|
2782
|
-
return
|
|
2885
|
+
return ts18.factory.createTypeQueryNode(ts18.factory.createQualifiedName(typeName, `ngAcceptInputType_${coercedInputName}`));
|
|
2783
2886
|
}
|
|
2784
2887
|
function tsCreateVariable(id, initializer) {
|
|
2785
|
-
const decl =
|
|
2888
|
+
const decl = ts18.factory.createVariableDeclaration(
|
|
2786
2889
|
id,
|
|
2787
2890
|
void 0,
|
|
2788
2891
|
void 0,
|
|
2789
2892
|
initializer
|
|
2790
2893
|
);
|
|
2791
|
-
return
|
|
2894
|
+
return ts18.factory.createVariableStatement(
|
|
2792
2895
|
void 0,
|
|
2793
2896
|
[decl]
|
|
2794
2897
|
);
|
|
2795
2898
|
}
|
|
2796
2899
|
function tsCallMethod(receiver, methodName, args = []) {
|
|
2797
|
-
const methodAccess =
|
|
2798
|
-
return
|
|
2900
|
+
const methodAccess = ts18.factory.createPropertyAccessExpression(receiver, methodName);
|
|
2901
|
+
return ts18.factory.createCallExpression(
|
|
2799
2902
|
methodAccess,
|
|
2800
2903
|
void 0,
|
|
2801
2904
|
args
|
|
2802
2905
|
);
|
|
2803
2906
|
}
|
|
2804
2907
|
function isAccessExpression(node) {
|
|
2805
|
-
return
|
|
2908
|
+
return ts18.isPropertyAccessExpression(node) || ts18.isElementAccessExpression(node);
|
|
2806
2909
|
}
|
|
2807
2910
|
|
|
2808
2911
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
2809
|
-
import
|
|
2912
|
+
import ts22 from "typescript";
|
|
2810
2913
|
|
|
2811
2914
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
2812
|
-
import
|
|
2915
|
+
import ts21 from "typescript";
|
|
2813
2916
|
|
|
2814
2917
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
|
|
2815
|
-
import
|
|
2918
|
+
import ts20 from "typescript";
|
|
2816
2919
|
|
|
2817
2920
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_emitter.mjs
|
|
2818
|
-
import
|
|
2921
|
+
import ts19 from "typescript";
|
|
2819
2922
|
var INELIGIBLE = {};
|
|
2820
2923
|
function canEmitType(type, canEmit) {
|
|
2821
2924
|
return canEmitTypeWorker(type);
|
|
@@ -2823,13 +2926,13 @@ function canEmitType(type, canEmit) {
|
|
|
2823
2926
|
return visitNode(type2) !== INELIGIBLE;
|
|
2824
2927
|
}
|
|
2825
2928
|
function visitNode(node) {
|
|
2826
|
-
if (
|
|
2929
|
+
if (ts19.isImportTypeNode(node)) {
|
|
2827
2930
|
return INELIGIBLE;
|
|
2828
2931
|
}
|
|
2829
|
-
if (
|
|
2932
|
+
if (ts19.isTypeReferenceNode(node) && !canEmitTypeReference(node)) {
|
|
2830
2933
|
return INELIGIBLE;
|
|
2831
2934
|
} else {
|
|
2832
|
-
return
|
|
2935
|
+
return ts19.forEachChild(node, visitNode);
|
|
2833
2936
|
}
|
|
2834
2937
|
}
|
|
2835
2938
|
function canEmitTypeReference(type2) {
|
|
@@ -2846,35 +2949,35 @@ var TypeEmitter = class {
|
|
|
2846
2949
|
emitType(type) {
|
|
2847
2950
|
const typeReferenceTransformer = (context) => {
|
|
2848
2951
|
const visitNode = (node) => {
|
|
2849
|
-
if (
|
|
2952
|
+
if (ts19.isImportTypeNode(node)) {
|
|
2850
2953
|
throw new Error("Unable to emit import type");
|
|
2851
2954
|
}
|
|
2852
|
-
if (
|
|
2955
|
+
if (ts19.isTypeReferenceNode(node)) {
|
|
2853
2956
|
return this.emitTypeReference(node);
|
|
2854
|
-
} else if (
|
|
2957
|
+
} else if (ts19.isLiteralExpression(node)) {
|
|
2855
2958
|
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 =
|
|
2959
|
+
if (ts19.isStringLiteral(node)) {
|
|
2960
|
+
clone = ts19.factory.createStringLiteral(node.text);
|
|
2961
|
+
} else if (ts19.isNumericLiteral(node)) {
|
|
2962
|
+
clone = ts19.factory.createNumericLiteral(node.text);
|
|
2963
|
+
} else if (ts19.isBigIntLiteral(node)) {
|
|
2964
|
+
clone = ts19.factory.createBigIntLiteral(node.text);
|
|
2965
|
+
} else if (ts19.isNoSubstitutionTemplateLiteral(node)) {
|
|
2966
|
+
clone = ts19.factory.createNoSubstitutionTemplateLiteral(node.text, node.rawText);
|
|
2967
|
+
} else if (ts19.isRegularExpressionLiteral(node)) {
|
|
2968
|
+
clone = ts19.factory.createRegularExpressionLiteral(node.text);
|
|
2866
2969
|
} else {
|
|
2867
|
-
throw new Error(`Unsupported literal kind ${
|
|
2970
|
+
throw new Error(`Unsupported literal kind ${ts19.SyntaxKind[node.kind]}`);
|
|
2868
2971
|
}
|
|
2869
|
-
|
|
2972
|
+
ts19.setTextRange(clone, { pos: -1, end: -1 });
|
|
2870
2973
|
return clone;
|
|
2871
2974
|
} else {
|
|
2872
|
-
return
|
|
2975
|
+
return ts19.visitEachChild(node, visitNode, context);
|
|
2873
2976
|
}
|
|
2874
2977
|
};
|
|
2875
|
-
return (node) =>
|
|
2978
|
+
return (node) => ts19.visitNode(node, visitNode, ts19.isTypeNode);
|
|
2876
2979
|
};
|
|
2877
|
-
return
|
|
2980
|
+
return ts19.transform(type, [typeReferenceTransformer]).transformed[0];
|
|
2878
2981
|
}
|
|
2879
2982
|
emitTypeReference(type) {
|
|
2880
2983
|
const translatedType = this.translator(type);
|
|
@@ -2883,9 +2986,9 @@ var TypeEmitter = class {
|
|
|
2883
2986
|
}
|
|
2884
2987
|
let typeArguments = void 0;
|
|
2885
2988
|
if (type.typeArguments !== void 0) {
|
|
2886
|
-
typeArguments =
|
|
2989
|
+
typeArguments = ts19.factory.createNodeArray(type.typeArguments.map((typeArg) => this.emitType(typeArg)));
|
|
2887
2990
|
}
|
|
2888
|
-
return
|
|
2991
|
+
return ts19.factory.updateTypeReferenceNode(type, translatedType.typeName, typeArguments);
|
|
2889
2992
|
}
|
|
2890
2993
|
};
|
|
2891
2994
|
|
|
@@ -2926,11 +3029,11 @@ var TypeParameterEmitter = class {
|
|
|
2926
3029
|
return this.typeParameters.map((typeParam) => {
|
|
2927
3030
|
const constraint = typeParam.constraint !== void 0 ? emitter.emitType(typeParam.constraint) : void 0;
|
|
2928
3031
|
const defaultType = typeParam.default !== void 0 ? emitter.emitType(typeParam.default) : void 0;
|
|
2929
|
-
return
|
|
3032
|
+
return ts20.factory.updateTypeParameterDeclaration(typeParam, typeParam.modifiers, typeParam.name, constraint, defaultType);
|
|
2930
3033
|
});
|
|
2931
3034
|
}
|
|
2932
3035
|
resolveTypeReference(type) {
|
|
2933
|
-
const target =
|
|
3036
|
+
const target = ts20.isIdentifier(type.typeName) ? type.typeName : type.typeName.right;
|
|
2934
3037
|
const declaration = this.reflector.getDeclarationOfIdentifier(target);
|
|
2935
3038
|
if (declaration === null || declaration.node === null) {
|
|
2936
3039
|
return null;
|
|
@@ -2956,8 +3059,8 @@ var TypeParameterEmitter = class {
|
|
|
2956
3059
|
if (typeNode === null) {
|
|
2957
3060
|
return null;
|
|
2958
3061
|
}
|
|
2959
|
-
if (!
|
|
2960
|
-
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${
|
|
3062
|
+
if (!ts20.isTypeReferenceNode(typeNode)) {
|
|
3063
|
+
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts20.SyntaxKind[typeNode.kind]}.`);
|
|
2961
3064
|
}
|
|
2962
3065
|
return typeNode;
|
|
2963
3066
|
}
|
|
@@ -2999,14 +3102,14 @@ function getTemplateMapping(shimSf, position, resolver, isDiagnosticRequest) {
|
|
|
2999
3102
|
}
|
|
3000
3103
|
function findTypeCheckBlock(file, id, isDiagnosticRequest) {
|
|
3001
3104
|
for (const stmt of file.statements) {
|
|
3002
|
-
if (
|
|
3105
|
+
if (ts21.isFunctionDeclaration(stmt) && getTemplateId2(stmt, file, isDiagnosticRequest) === id) {
|
|
3003
3106
|
return stmt;
|
|
3004
3107
|
}
|
|
3005
3108
|
}
|
|
3006
3109
|
return null;
|
|
3007
3110
|
}
|
|
3008
3111
|
function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
|
|
3009
|
-
while (node !== void 0 && !
|
|
3112
|
+
while (node !== void 0 && !ts21.isFunctionDeclaration(node)) {
|
|
3010
3113
|
if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticsRequest) {
|
|
3011
3114
|
return null;
|
|
3012
3115
|
}
|
|
@@ -3023,7 +3126,7 @@ function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
|
|
|
3023
3126
|
return null;
|
|
3024
3127
|
}
|
|
3025
3128
|
function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
|
|
3026
|
-
while (!
|
|
3129
|
+
while (!ts21.isFunctionDeclaration(node)) {
|
|
3027
3130
|
if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticRequest) {
|
|
3028
3131
|
return null;
|
|
3029
3132
|
}
|
|
@@ -3033,8 +3136,8 @@ function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
|
|
|
3033
3136
|
}
|
|
3034
3137
|
}
|
|
3035
3138
|
const start = node.getFullStart();
|
|
3036
|
-
return
|
|
3037
|
-
if (kind !==
|
|
3139
|
+
return ts21.forEachLeadingCommentRange(sourceFile.text, start, (pos, end, kind) => {
|
|
3140
|
+
if (kind !== ts21.SyntaxKind.MultiLineCommentTrivia) {
|
|
3038
3141
|
return null;
|
|
3039
3142
|
}
|
|
3040
3143
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -3049,29 +3152,29 @@ function checkIfGenericTypeBoundsCanBeEmitted(node, reflector, env) {
|
|
|
3049
3152
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
3050
3153
|
function generateTypeCtorDeclarationFn(node, meta, nodeTypeRef, typeParams) {
|
|
3051
3154
|
const rawTypeArgs = typeParams !== void 0 ? generateGenericArgs(typeParams) : void 0;
|
|
3052
|
-
const rawType =
|
|
3155
|
+
const rawType = ts22.factory.createTypeReferenceNode(nodeTypeRef, rawTypeArgs);
|
|
3053
3156
|
const initParam = constructTypeCtorParameter(node, meta, rawType);
|
|
3054
3157
|
const typeParameters = typeParametersWithDefaultTypes(typeParams);
|
|
3055
3158
|
if (meta.body) {
|
|
3056
|
-
const fnType =
|
|
3159
|
+
const fnType = ts22.factory.createFunctionTypeNode(
|
|
3057
3160
|
typeParameters,
|
|
3058
3161
|
[initParam],
|
|
3059
3162
|
rawType
|
|
3060
3163
|
);
|
|
3061
|
-
const decl =
|
|
3164
|
+
const decl = ts22.factory.createVariableDeclaration(
|
|
3062
3165
|
meta.fnName,
|
|
3063
3166
|
void 0,
|
|
3064
3167
|
fnType,
|
|
3065
|
-
|
|
3168
|
+
ts22.factory.createNonNullExpression(ts22.factory.createNull())
|
|
3066
3169
|
);
|
|
3067
|
-
const declList =
|
|
3068
|
-
return
|
|
3170
|
+
const declList = ts22.factory.createVariableDeclarationList([decl], ts22.NodeFlags.Const);
|
|
3171
|
+
return ts22.factory.createVariableStatement(
|
|
3069
3172
|
void 0,
|
|
3070
3173
|
declList
|
|
3071
3174
|
);
|
|
3072
3175
|
} else {
|
|
3073
|
-
return
|
|
3074
|
-
[
|
|
3176
|
+
return ts22.factory.createFunctionDeclaration(
|
|
3177
|
+
[ts22.factory.createModifier(ts22.SyntaxKind.DeclareKeyword)],
|
|
3075
3178
|
void 0,
|
|
3076
3179
|
meta.fnName,
|
|
3077
3180
|
typeParameters,
|
|
@@ -3083,16 +3186,16 @@ function generateTypeCtorDeclarationFn(node, meta, nodeTypeRef, typeParams) {
|
|
|
3083
3186
|
}
|
|
3084
3187
|
function generateInlineTypeCtor(node, meta) {
|
|
3085
3188
|
const rawTypeArgs = node.typeParameters !== void 0 ? generateGenericArgs(node.typeParameters) : void 0;
|
|
3086
|
-
const rawType =
|
|
3189
|
+
const rawType = ts22.factory.createTypeReferenceNode(node.name, rawTypeArgs);
|
|
3087
3190
|
const initParam = constructTypeCtorParameter(node, meta, rawType);
|
|
3088
3191
|
let body = void 0;
|
|
3089
3192
|
if (meta.body) {
|
|
3090
|
-
body =
|
|
3091
|
-
|
|
3193
|
+
body = ts22.factory.createBlock([
|
|
3194
|
+
ts22.factory.createReturnStatement(ts22.factory.createNonNullExpression(ts22.factory.createNull()))
|
|
3092
3195
|
]);
|
|
3093
3196
|
}
|
|
3094
|
-
return
|
|
3095
|
-
[
|
|
3197
|
+
return ts22.factory.createMethodDeclaration(
|
|
3198
|
+
[ts22.factory.createModifier(ts22.SyntaxKind.StaticKeyword)],
|
|
3096
3199
|
void 0,
|
|
3097
3200
|
meta.fnName,
|
|
3098
3201
|
void 0,
|
|
@@ -3108,9 +3211,9 @@ function constructTypeCtorParameter(node, meta, rawType) {
|
|
|
3108
3211
|
const coercedKeys = [];
|
|
3109
3212
|
for (const { classPropertyName, transform } of meta.fields.inputs) {
|
|
3110
3213
|
if (!meta.coercedInputFields.has(classPropertyName)) {
|
|
3111
|
-
plainKeys.push(
|
|
3214
|
+
plainKeys.push(ts22.factory.createLiteralTypeNode(ts22.factory.createStringLiteral(classPropertyName)));
|
|
3112
3215
|
} else {
|
|
3113
|
-
coercedKeys.push(
|
|
3216
|
+
coercedKeys.push(ts22.factory.createPropertySignature(
|
|
3114
3217
|
void 0,
|
|
3115
3218
|
classPropertyName,
|
|
3116
3219
|
void 0,
|
|
@@ -3119,17 +3222,17 @@ function constructTypeCtorParameter(node, meta, rawType) {
|
|
|
3119
3222
|
}
|
|
3120
3223
|
}
|
|
3121
3224
|
if (plainKeys.length > 0) {
|
|
3122
|
-
const keyTypeUnion =
|
|
3123
|
-
initType =
|
|
3225
|
+
const keyTypeUnion = ts22.factory.createUnionTypeNode(plainKeys);
|
|
3226
|
+
initType = ts22.factory.createTypeReferenceNode("Pick", [rawType, keyTypeUnion]);
|
|
3124
3227
|
}
|
|
3125
3228
|
if (coercedKeys.length > 0) {
|
|
3126
|
-
const coercedLiteral =
|
|
3127
|
-
initType = initType !== null ?
|
|
3229
|
+
const coercedLiteral = ts22.factory.createTypeLiteralNode(coercedKeys);
|
|
3230
|
+
initType = initType !== null ? ts22.factory.createIntersectionTypeNode([initType, coercedLiteral]) : coercedLiteral;
|
|
3128
3231
|
}
|
|
3129
3232
|
if (initType === null) {
|
|
3130
|
-
initType =
|
|
3233
|
+
initType = ts22.factory.createTypeLiteralNode([]);
|
|
3131
3234
|
}
|
|
3132
|
-
return
|
|
3235
|
+
return ts22.factory.createParameterDeclaration(
|
|
3133
3236
|
void 0,
|
|
3134
3237
|
void 0,
|
|
3135
3238
|
"init",
|
|
@@ -3139,7 +3242,7 @@ function constructTypeCtorParameter(node, meta, rawType) {
|
|
|
3139
3242
|
);
|
|
3140
3243
|
}
|
|
3141
3244
|
function generateGenericArgs(params) {
|
|
3142
|
-
return params.map((param) =>
|
|
3245
|
+
return params.map((param) => ts22.factory.createTypeReferenceNode(param.name, void 0));
|
|
3143
3246
|
}
|
|
3144
3247
|
function requiresInlineTypeCtor(node, host, env) {
|
|
3145
3248
|
return !checkIfGenericTypeBoundsCanBeEmitted(node, host, env);
|
|
@@ -3150,7 +3253,7 @@ function typeParametersWithDefaultTypes(params) {
|
|
|
3150
3253
|
}
|
|
3151
3254
|
return params.map((param) => {
|
|
3152
3255
|
if (param.default === void 0) {
|
|
3153
|
-
return
|
|
3256
|
+
return ts22.factory.updateTypeParameterDeclaration(param, param.modifiers, param.name, param.constraint, ts22.factory.createKeywordTypeNode(ts22.SyntaxKind.AnyKeyword));
|
|
3154
3257
|
} else {
|
|
3155
3258
|
return param;
|
|
3156
3259
|
}
|
|
@@ -3182,13 +3285,13 @@ var Environment = class {
|
|
|
3182
3285
|
}
|
|
3183
3286
|
if (requiresInlineTypeCtor(node, this.reflector, this)) {
|
|
3184
3287
|
const ref = this.reference(dirRef);
|
|
3185
|
-
const typeCtorExpr =
|
|
3288
|
+
const typeCtorExpr = ts23.factory.createPropertyAccessExpression(ref, "ngTypeCtor");
|
|
3186
3289
|
this.typeCtors.set(node, typeCtorExpr);
|
|
3187
3290
|
return typeCtorExpr;
|
|
3188
3291
|
} else {
|
|
3189
3292
|
const fnName = `_ctor${this.nextIds.typeCtor++}`;
|
|
3190
3293
|
const nodeTypeRef = this.referenceType(dirRef);
|
|
3191
|
-
if (!
|
|
3294
|
+
if (!ts23.isTypeReferenceNode(nodeTypeRef)) {
|
|
3192
3295
|
throw new Error(`Expected TypeReferenceNode from reference to ${dirRef.debugName}`);
|
|
3193
3296
|
}
|
|
3194
3297
|
const meta = {
|
|
@@ -3203,7 +3306,7 @@ var Environment = class {
|
|
|
3203
3306
|
const typeParams = this.emitTypeParameters(node);
|
|
3204
3307
|
const typeCtor = generateTypeCtorDeclarationFn(node, meta, nodeTypeRef.typeName, typeParams);
|
|
3205
3308
|
this.typeCtorStatements.push(typeCtor);
|
|
3206
|
-
const fnId =
|
|
3309
|
+
const fnId = ts23.factory.createIdentifier(fnName);
|
|
3207
3310
|
this.typeCtors.set(node, fnId);
|
|
3208
3311
|
return fnId;
|
|
3209
3312
|
}
|
|
@@ -3213,7 +3316,7 @@ var Environment = class {
|
|
|
3213
3316
|
return this.pipeInsts.get(ref.node);
|
|
3214
3317
|
}
|
|
3215
3318
|
const pipeType = this.referenceType(ref);
|
|
3216
|
-
const pipeInstId =
|
|
3319
|
+
const pipeInstId = ts23.factory.createIdentifier(`_pipe${this.nextIds.pipeInst++}`);
|
|
3217
3320
|
this.pipeInstStatements.push(tsDeclareVariable(pipeInstId, pipeType));
|
|
3218
3321
|
this.pipeInsts.set(ref.node, pipeInstId);
|
|
3219
3322
|
return pipeInstId;
|
|
@@ -3253,7 +3356,7 @@ var Environment = class {
|
|
|
3253
3356
|
|
|
3254
3357
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/oob.mjs
|
|
3255
3358
|
import { TmplAstElement as TmplAstElement2 } from "@angular/compiler";
|
|
3256
|
-
import
|
|
3359
|
+
import ts24 from "typescript";
|
|
3257
3360
|
var OutOfBandDiagnosticRecorderImpl = class {
|
|
3258
3361
|
constructor(resolver) {
|
|
3259
3362
|
this.resolver = resolver;
|
|
@@ -3267,7 +3370,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3267
3370
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
3268
3371
|
const value = ref.value.trim();
|
|
3269
3372
|
const errorMsg = `No directive found with exportAs '${value}'.`;
|
|
3270
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan,
|
|
3373
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REFERENCE_TARGET), errorMsg));
|
|
3271
3374
|
}
|
|
3272
3375
|
missingPipe(templateId, ast) {
|
|
3273
3376
|
if (this.recordedPipes.has(ast)) {
|
|
@@ -3279,7 +3382,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3279
3382
|
if (sourceSpan === null) {
|
|
3280
3383
|
throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
|
|
3281
3384
|
}
|
|
3282
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan,
|
|
3385
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_PIPE), errorMsg));
|
|
3283
3386
|
this.recordedPipes.add(ast);
|
|
3284
3387
|
}
|
|
3285
3388
|
illegalAssignmentToTemplateVar(templateId, assignment, target) {
|
|
@@ -3290,7 +3393,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3290
3393
|
if (sourceSpan === null) {
|
|
3291
3394
|
throw new Error(`Assertion failure: no SourceLocation found for property binding.`);
|
|
3292
3395
|
}
|
|
3293
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan,
|
|
3396
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMsg, [{
|
|
3294
3397
|
text: `The variable ${assignment.name} is declared here.`,
|
|
3295
3398
|
start: ((_a = target.valueSpan) == null ? void 0 : _a.start.offset) || target.sourceSpan.start.offset,
|
|
3296
3399
|
end: ((_b = target.valueSpan) == null ? void 0 : _b.end.offset) || target.sourceSpan.end.offset,
|
|
@@ -3300,7 +3403,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3300
3403
|
duplicateTemplateVar(templateId, variable, firstDecl) {
|
|
3301
3404
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
3302
3405
|
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,
|
|
3406
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, variable.sourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DUPLICATE_VARIABLE_DECLARATION), errorMsg, [{
|
|
3304
3407
|
text: `The variable '${firstDecl.name}' was first declared here.`,
|
|
3305
3408
|
start: firstDecl.sourceSpan.start.offset,
|
|
3306
3409
|
end: firstDecl.sourceSpan.end.offset,
|
|
@@ -3339,7 +3442,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3339
3442
|
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
3443
|
|
|
3341
3444
|
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,
|
|
3445
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, diagnosticVar.keySpan, ts24.DiagnosticCategory.Suggestion, ngErrorCode(ErrorCode.SUGGEST_SUBOPTIMAL_TYPE_INFERENCE), message));
|
|
3343
3446
|
}
|
|
3344
3447
|
splitTwoWayBinding(templateId, input, output, inputConsumer, outputConsumer) {
|
|
3345
3448
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
@@ -3373,11 +3476,11 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
3373
3476
|
sourceFile: outputConsumer.name.getSourceFile()
|
|
3374
3477
|
});
|
|
3375
3478
|
}
|
|
3376
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, input.keySpan,
|
|
3479
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, input.keySpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SPLIT_TWO_WAY_BINDING), errorMsg, relatedMessages));
|
|
3377
3480
|
}
|
|
3378
3481
|
missingRequiredInputs(templateId, element, directiveName, isComponent, inputAliases) {
|
|
3379
3482
|
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,
|
|
3483
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), element.startSourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REQUIRED_INPUTS), message));
|
|
3381
3484
|
}
|
|
3382
3485
|
illegalForLoopTrackAccess(templateId, block, access) {
|
|
3383
3486
|
const sourceSpan = this.resolver.toParseSourceSpan(templateId, access.sourceSpan);
|
|
@@ -3385,7 +3488,7 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
3385
3488
|
throw new Error(`Assertion failure: no SourceLocation found for property read.`);
|
|
3386
3489
|
}
|
|
3387
3490
|
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,
|
|
3491
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), sourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.ILLEGAL_FOR_LOOP_TRACK_ACCESS), message));
|
|
3389
3492
|
}
|
|
3390
3493
|
inaccessibleDeferredTriggerElement(templateId, trigger) {
|
|
3391
3494
|
let message;
|
|
@@ -3396,7 +3499,7 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
3396
3499
|
Check that an element with #${trigger.reference} exists in the same template and it's accessible from the @defer block.
|
|
3397
3500
|
Deferred blocks can only access triggers in same view, a parent embedded view or the root view of the @placeholder block.`;
|
|
3398
3501
|
}
|
|
3399
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), trigger.sourceSpan,
|
|
3502
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), trigger.sourceSpan, ts24.DiagnosticCategory.Error, ngErrorCode(ErrorCode.INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT), message));
|
|
3400
3503
|
}
|
|
3401
3504
|
};
|
|
3402
3505
|
function makeInlineDiagnostic(templateId, code, node, messageText, relatedInformation) {
|
|
@@ -3408,7 +3511,7 @@ function makeInlineDiagnostic(templateId, code, node, messageText, relatedInform
|
|
|
3408
3511
|
}
|
|
3409
3512
|
|
|
3410
3513
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/shim.mjs
|
|
3411
|
-
import
|
|
3514
|
+
import ts25 from "typescript";
|
|
3412
3515
|
var TypeCheckShimGenerator = class {
|
|
3413
3516
|
constructor() {
|
|
3414
3517
|
this.extensionPrefix = "ngtypecheck";
|
|
@@ -3418,7 +3521,7 @@ var TypeCheckShimGenerator = class {
|
|
|
3418
3521
|
if (priorShimSf !== null) {
|
|
3419
3522
|
return priorShimSf;
|
|
3420
3523
|
}
|
|
3421
|
-
return
|
|
3524
|
+
return ts25.createSourceFile(genFilePath, "export const USED_FOR_NG_TYPE_CHECKING = true;", ts25.ScriptTarget.Latest, true, ts25.ScriptKind.TS);
|
|
3422
3525
|
}
|
|
3423
3526
|
static shimFor(fileName) {
|
|
3424
3527
|
return absoluteFrom(fileName.replace(/\.tsx?$/, ".ngtypecheck.ts"));
|
|
@@ -3427,16 +3530,16 @@ var TypeCheckShimGenerator = class {
|
|
|
3427
3530
|
|
|
3428
3531
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
3429
3532
|
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
|
|
3533
|
+
import ts28 from "typescript";
|
|
3431
3534
|
|
|
3432
3535
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.mjs
|
|
3433
3536
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan3 } from "@angular/compiler";
|
|
3434
|
-
import
|
|
3537
|
+
import ts26 from "typescript";
|
|
3435
3538
|
function wrapForDiagnostics(expr) {
|
|
3436
|
-
return
|
|
3539
|
+
return ts26.factory.createParenthesizedExpression(expr);
|
|
3437
3540
|
}
|
|
3438
3541
|
function wrapForTypeChecker(expr) {
|
|
3439
|
-
return
|
|
3542
|
+
return ts26.factory.createParenthesizedExpression(expr);
|
|
3440
3543
|
}
|
|
3441
3544
|
function addParseSpanInfo(node, span) {
|
|
3442
3545
|
let commentText;
|
|
@@ -3445,10 +3548,10 @@ function addParseSpanInfo(node, span) {
|
|
|
3445
3548
|
} else {
|
|
3446
3549
|
commentText = `${span.start.offset},${span.end.offset}`;
|
|
3447
3550
|
}
|
|
3448
|
-
|
|
3551
|
+
ts26.addSyntheticTrailingComment(node, ts26.SyntaxKind.MultiLineCommentTrivia, commentText, false);
|
|
3449
3552
|
}
|
|
3450
3553
|
function addTemplateId(tcb, id) {
|
|
3451
|
-
|
|
3554
|
+
ts26.addSyntheticLeadingComment(tcb, ts26.SyntaxKind.MultiLineCommentTrivia, id, true);
|
|
3452
3555
|
}
|
|
3453
3556
|
function shouldReportDiagnostic(diagnostic) {
|
|
3454
3557
|
const { code } = diagnostic;
|
|
@@ -3477,32 +3580,32 @@ function translateDiagnostic(diagnostic, resolver) {
|
|
|
3477
3580
|
|
|
3478
3581
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/expression.mjs
|
|
3479
3582
|
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 =
|
|
3583
|
+
import ts27 from "typescript";
|
|
3584
|
+
var NULL_AS_ANY = ts27.factory.createAsExpression(ts27.factory.createNull(), ts27.factory.createKeywordTypeNode(ts27.SyntaxKind.AnyKeyword));
|
|
3585
|
+
var UNDEFINED = ts27.factory.createIdentifier("undefined");
|
|
3483
3586
|
var UNARY_OPS = /* @__PURE__ */ new Map([
|
|
3484
|
-
["+",
|
|
3485
|
-
["-",
|
|
3587
|
+
["+", ts27.SyntaxKind.PlusToken],
|
|
3588
|
+
["-", ts27.SyntaxKind.MinusToken]
|
|
3486
3589
|
]);
|
|
3487
3590
|
var BINARY_OPS = /* @__PURE__ */ new Map([
|
|
3488
|
-
["+",
|
|
3489
|
-
["-",
|
|
3490
|
-
["<",
|
|
3491
|
-
[">",
|
|
3492
|
-
["<=",
|
|
3493
|
-
[">=",
|
|
3494
|
-
["==",
|
|
3495
|
-
["===",
|
|
3496
|
-
["*",
|
|
3497
|
-
["/",
|
|
3498
|
-
["%",
|
|
3499
|
-
["!=",
|
|
3500
|
-
["!==",
|
|
3501
|
-
["||",
|
|
3502
|
-
["&&",
|
|
3503
|
-
["&",
|
|
3504
|
-
["|",
|
|
3505
|
-
["??",
|
|
3591
|
+
["+", ts27.SyntaxKind.PlusToken],
|
|
3592
|
+
["-", ts27.SyntaxKind.MinusToken],
|
|
3593
|
+
["<", ts27.SyntaxKind.LessThanToken],
|
|
3594
|
+
[">", ts27.SyntaxKind.GreaterThanToken],
|
|
3595
|
+
["<=", ts27.SyntaxKind.LessThanEqualsToken],
|
|
3596
|
+
[">=", ts27.SyntaxKind.GreaterThanEqualsToken],
|
|
3597
|
+
["==", ts27.SyntaxKind.EqualsEqualsToken],
|
|
3598
|
+
["===", ts27.SyntaxKind.EqualsEqualsEqualsToken],
|
|
3599
|
+
["*", ts27.SyntaxKind.AsteriskToken],
|
|
3600
|
+
["/", ts27.SyntaxKind.SlashToken],
|
|
3601
|
+
["%", ts27.SyntaxKind.PercentToken],
|
|
3602
|
+
["!=", ts27.SyntaxKind.ExclamationEqualsToken],
|
|
3603
|
+
["!==", ts27.SyntaxKind.ExclamationEqualsEqualsToken],
|
|
3604
|
+
["||", ts27.SyntaxKind.BarBarToken],
|
|
3605
|
+
["&&", ts27.SyntaxKind.AmpersandAmpersandToken],
|
|
3606
|
+
["&", ts27.SyntaxKind.AmpersandToken],
|
|
3607
|
+
["|", ts27.SyntaxKind.BarToken],
|
|
3608
|
+
["??", ts27.SyntaxKind.QuestionQuestionToken]
|
|
3506
3609
|
]);
|
|
3507
3610
|
function astToTypescript(ast, maybeResolve, config) {
|
|
3508
3611
|
const translator = new AstTranslator(maybeResolve, config);
|
|
@@ -3518,7 +3621,7 @@ var AstTranslator = class {
|
|
|
3518
3621
|
ast = ast.ast;
|
|
3519
3622
|
}
|
|
3520
3623
|
if (ast instanceof EmptyExpr2) {
|
|
3521
|
-
const res =
|
|
3624
|
+
const res = ts27.factory.createIdentifier("undefined");
|
|
3522
3625
|
addParseSpanInfo(res, ast.sourceSpan);
|
|
3523
3626
|
return res;
|
|
3524
3627
|
}
|
|
@@ -3534,7 +3637,7 @@ var AstTranslator = class {
|
|
|
3534
3637
|
if (op === void 0) {
|
|
3535
3638
|
throw new Error(`Unsupported Unary.operator: ${ast.operator}`);
|
|
3536
3639
|
}
|
|
3537
|
-
const node = wrapForDiagnostics(
|
|
3640
|
+
const node = wrapForDiagnostics(ts27.factory.createPrefixUnaryExpression(op, expr));
|
|
3538
3641
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3539
3642
|
return node;
|
|
3540
3643
|
}
|
|
@@ -3545,13 +3648,13 @@ var AstTranslator = class {
|
|
|
3545
3648
|
if (op === void 0) {
|
|
3546
3649
|
throw new Error(`Unsupported Binary.operation: ${ast.operation}`);
|
|
3547
3650
|
}
|
|
3548
|
-
const node =
|
|
3651
|
+
const node = ts27.factory.createBinaryExpression(lhs, op, rhs);
|
|
3549
3652
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3550
3653
|
return node;
|
|
3551
3654
|
}
|
|
3552
3655
|
visitChain(ast) {
|
|
3553
3656
|
const elements = ast.expressions.map((expr) => this.translate(expr));
|
|
3554
|
-
const node = wrapForDiagnostics(
|
|
3657
|
+
const node = wrapForDiagnostics(ts27.factory.createCommaListExpression(elements));
|
|
3555
3658
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3556
3659
|
return node;
|
|
3557
3660
|
}
|
|
@@ -3559,7 +3662,7 @@ var AstTranslator = class {
|
|
|
3559
3662
|
const condExpr = this.translate(ast.condition);
|
|
3560
3663
|
const trueExpr = this.translate(ast.trueExp);
|
|
3561
3664
|
const falseExpr = wrapForTypeChecker(this.translate(ast.falseExp));
|
|
3562
|
-
const node =
|
|
3665
|
+
const node = ts27.factory.createParenthesizedExpression(ts27.factory.createConditionalExpression(condExpr, void 0, trueExpr, void 0, falseExpr));
|
|
3563
3666
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3564
3667
|
return node;
|
|
3565
3668
|
}
|
|
@@ -3570,26 +3673,26 @@ var AstTranslator = class {
|
|
|
3570
3673
|
throw new Error("Method not implemented.");
|
|
3571
3674
|
}
|
|
3572
3675
|
visitInterpolation(ast) {
|
|
3573
|
-
return ast.expressions.reduce((lhs, ast2) =>
|
|
3676
|
+
return ast.expressions.reduce((lhs, ast2) => ts27.factory.createBinaryExpression(lhs, ts27.SyntaxKind.PlusToken, wrapForTypeChecker(this.translate(ast2))), ts27.factory.createStringLiteral(""));
|
|
3574
3677
|
}
|
|
3575
3678
|
visitKeyedRead(ast) {
|
|
3576
3679
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3577
3680
|
const key = this.translate(ast.key);
|
|
3578
|
-
const node =
|
|
3681
|
+
const node = ts27.factory.createElementAccessExpression(receiver, key);
|
|
3579
3682
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3580
3683
|
return node;
|
|
3581
3684
|
}
|
|
3582
3685
|
visitKeyedWrite(ast) {
|
|
3583
3686
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3584
|
-
const left =
|
|
3687
|
+
const left = ts27.factory.createElementAccessExpression(receiver, this.translate(ast.key));
|
|
3585
3688
|
const right = wrapForTypeChecker(this.translate(ast.value));
|
|
3586
|
-
const node = wrapForDiagnostics(
|
|
3689
|
+
const node = wrapForDiagnostics(ts27.factory.createBinaryExpression(left, ts27.SyntaxKind.EqualsToken, right));
|
|
3587
3690
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3588
3691
|
return node;
|
|
3589
3692
|
}
|
|
3590
3693
|
visitLiteralArray(ast) {
|
|
3591
3694
|
const elements = ast.expressions.map((expr) => this.translate(expr));
|
|
3592
|
-
const literal =
|
|
3695
|
+
const literal = ts27.factory.createArrayLiteralExpression(elements);
|
|
3593
3696
|
const node = this.config.strictLiteralTypes ? literal : tsCastToAny(literal);
|
|
3594
3697
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3595
3698
|
return node;
|
|
@@ -3597,9 +3700,9 @@ var AstTranslator = class {
|
|
|
3597
3700
|
visitLiteralMap(ast) {
|
|
3598
3701
|
const properties = ast.keys.map(({ key }, idx) => {
|
|
3599
3702
|
const value = this.translate(ast.values[idx]);
|
|
3600
|
-
return
|
|
3703
|
+
return ts27.factory.createPropertyAssignment(ts27.factory.createStringLiteral(key), value);
|
|
3601
3704
|
});
|
|
3602
|
-
const literal =
|
|
3705
|
+
const literal = ts27.factory.createObjectLiteralExpression(properties, true);
|
|
3603
3706
|
const node = this.config.strictLiteralTypes ? literal : tsCastToAny(literal);
|
|
3604
3707
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3605
3708
|
return node;
|
|
@@ -3607,15 +3710,15 @@ var AstTranslator = class {
|
|
|
3607
3710
|
visitLiteralPrimitive(ast) {
|
|
3608
3711
|
let node;
|
|
3609
3712
|
if (ast.value === void 0) {
|
|
3610
|
-
node =
|
|
3713
|
+
node = ts27.factory.createIdentifier("undefined");
|
|
3611
3714
|
} else if (ast.value === null) {
|
|
3612
|
-
node =
|
|
3715
|
+
node = ts27.factory.createNull();
|
|
3613
3716
|
} else if (typeof ast.value === "string") {
|
|
3614
|
-
node =
|
|
3717
|
+
node = ts27.factory.createStringLiteral(ast.value);
|
|
3615
3718
|
} else if (typeof ast.value === "number") {
|
|
3616
|
-
node =
|
|
3719
|
+
node = ts27.factory.createNumericLiteral(ast.value);
|
|
3617
3720
|
} else if (typeof ast.value === "boolean") {
|
|
3618
|
-
node = ast.value ?
|
|
3721
|
+
node = ast.value ? ts27.factory.createTrue() : ts27.factory.createFalse();
|
|
3619
3722
|
} else {
|
|
3620
3723
|
throw Error(`Unsupported AST value of type ${typeof ast.value}`);
|
|
3621
3724
|
}
|
|
@@ -3624,7 +3727,7 @@ var AstTranslator = class {
|
|
|
3624
3727
|
}
|
|
3625
3728
|
visitNonNullAssert(ast) {
|
|
3626
3729
|
const expr = wrapForDiagnostics(this.translate(ast.expression));
|
|
3627
|
-
const node =
|
|
3730
|
+
const node = ts27.factory.createNonNullExpression(expr);
|
|
3628
3731
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3629
3732
|
return node;
|
|
3630
3733
|
}
|
|
@@ -3633,13 +3736,13 @@ var AstTranslator = class {
|
|
|
3633
3736
|
}
|
|
3634
3737
|
visitPrefixNot(ast) {
|
|
3635
3738
|
const expression = wrapForDiagnostics(this.translate(ast.expression));
|
|
3636
|
-
const node =
|
|
3739
|
+
const node = ts27.factory.createLogicalNot(expression);
|
|
3637
3740
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3638
3741
|
return node;
|
|
3639
3742
|
}
|
|
3640
3743
|
visitPropertyRead(ast) {
|
|
3641
3744
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3642
|
-
const name =
|
|
3745
|
+
const name = ts27.factory.createPropertyAccessExpression(receiver, ast.name);
|
|
3643
3746
|
addParseSpanInfo(name, ast.nameSpan);
|
|
3644
3747
|
const node = wrapForDiagnostics(name);
|
|
3645
3748
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
@@ -3647,12 +3750,12 @@ var AstTranslator = class {
|
|
|
3647
3750
|
}
|
|
3648
3751
|
visitPropertyWrite(ast) {
|
|
3649
3752
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3650
|
-
const left =
|
|
3753
|
+
const left = ts27.factory.createPropertyAccessExpression(receiver, ast.name);
|
|
3651
3754
|
addParseSpanInfo(left, ast.nameSpan);
|
|
3652
3755
|
const leftWithPath = wrapForDiagnostics(left);
|
|
3653
3756
|
addParseSpanInfo(leftWithPath, ast.sourceSpan);
|
|
3654
3757
|
const right = wrapForTypeChecker(this.translate(ast.value));
|
|
3655
|
-
const node = wrapForDiagnostics(
|
|
3758
|
+
const node = wrapForDiagnostics(ts27.factory.createBinaryExpression(leftWithPath, ts27.SyntaxKind.EqualsToken, right));
|
|
3656
3759
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3657
3760
|
return node;
|
|
3658
3761
|
}
|
|
@@ -3660,13 +3763,13 @@ var AstTranslator = class {
|
|
|
3660
3763
|
let node;
|
|
3661
3764
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3662
3765
|
if (this.config.strictSafeNavigationTypes) {
|
|
3663
|
-
const expr =
|
|
3766
|
+
const expr = ts27.factory.createPropertyAccessExpression(ts27.factory.createNonNullExpression(receiver), ast.name);
|
|
3664
3767
|
addParseSpanInfo(expr, ast.nameSpan);
|
|
3665
|
-
node =
|
|
3768
|
+
node = ts27.factory.createParenthesizedExpression(ts27.factory.createConditionalExpression(NULL_AS_ANY, void 0, expr, void 0, UNDEFINED));
|
|
3666
3769
|
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
3667
|
-
node =
|
|
3770
|
+
node = ts27.factory.createPropertyAccessExpression(tsCastToAny(receiver), ast.name);
|
|
3668
3771
|
} else {
|
|
3669
|
-
const expr =
|
|
3772
|
+
const expr = ts27.factory.createPropertyAccessExpression(ts27.factory.createNonNullExpression(receiver), ast.name);
|
|
3670
3773
|
addParseSpanInfo(expr, ast.nameSpan);
|
|
3671
3774
|
node = tsCastToAny(expr);
|
|
3672
3775
|
}
|
|
@@ -3678,13 +3781,13 @@ var AstTranslator = class {
|
|
|
3678
3781
|
const key = this.translate(ast.key);
|
|
3679
3782
|
let node;
|
|
3680
3783
|
if (this.config.strictSafeNavigationTypes) {
|
|
3681
|
-
const expr =
|
|
3784
|
+
const expr = ts27.factory.createElementAccessExpression(ts27.factory.createNonNullExpression(receiver), key);
|
|
3682
3785
|
addParseSpanInfo(expr, ast.sourceSpan);
|
|
3683
|
-
node =
|
|
3786
|
+
node = ts27.factory.createParenthesizedExpression(ts27.factory.createConditionalExpression(NULL_AS_ANY, void 0, expr, void 0, UNDEFINED));
|
|
3684
3787
|
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
3685
|
-
node =
|
|
3788
|
+
node = ts27.factory.createElementAccessExpression(tsCastToAny(receiver), key);
|
|
3686
3789
|
} else {
|
|
3687
|
-
const expr =
|
|
3790
|
+
const expr = ts27.factory.createElementAccessExpression(ts27.factory.createNonNullExpression(receiver), key);
|
|
3688
3791
|
addParseSpanInfo(expr, ast.sourceSpan);
|
|
3689
3792
|
node = tsCastToAny(expr);
|
|
3690
3793
|
}
|
|
@@ -3701,7 +3804,7 @@ var AstTranslator = class {
|
|
|
3701
3804
|
expr = resolved;
|
|
3702
3805
|
} else {
|
|
3703
3806
|
const propertyReceiver = wrapForDiagnostics(this.translate(receiver.receiver));
|
|
3704
|
-
expr =
|
|
3807
|
+
expr = ts27.factory.createPropertyAccessExpression(propertyReceiver, receiver.name);
|
|
3705
3808
|
addParseSpanInfo(expr, receiver.nameSpan);
|
|
3706
3809
|
}
|
|
3707
3810
|
} else {
|
|
@@ -3711,7 +3814,7 @@ var AstTranslator = class {
|
|
|
3711
3814
|
if (ast.receiver instanceof SafePropertyRead2 || ast.receiver instanceof SafeKeyedRead) {
|
|
3712
3815
|
node = this.convertToSafeCall(ast, expr, args);
|
|
3713
3816
|
} else {
|
|
3714
|
-
node =
|
|
3817
|
+
node = ts27.factory.createCallExpression(expr, void 0, args);
|
|
3715
3818
|
}
|
|
3716
3819
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3717
3820
|
return node;
|
|
@@ -3725,13 +3828,13 @@ var AstTranslator = class {
|
|
|
3725
3828
|
}
|
|
3726
3829
|
convertToSafeCall(ast, expr, args) {
|
|
3727
3830
|
if (this.config.strictSafeNavigationTypes) {
|
|
3728
|
-
const call =
|
|
3729
|
-
return
|
|
3831
|
+
const call = ts27.factory.createCallExpression(ts27.factory.createNonNullExpression(expr), void 0, args);
|
|
3832
|
+
return ts27.factory.createParenthesizedExpression(ts27.factory.createConditionalExpression(NULL_AS_ANY, void 0, call, void 0, UNDEFINED));
|
|
3730
3833
|
}
|
|
3731
3834
|
if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
3732
|
-
return
|
|
3835
|
+
return ts27.factory.createCallExpression(tsCastToAny(expr), void 0, args);
|
|
3733
3836
|
}
|
|
3734
|
-
return tsCastToAny(
|
|
3837
|
+
return tsCastToAny(ts27.factory.createCallExpression(ts27.factory.createNonNullExpression(expr), void 0, args));
|
|
3735
3838
|
}
|
|
3736
3839
|
};
|
|
3737
3840
|
var _VeSafeLhsInferenceBugDetector = class {
|
|
@@ -3843,7 +3946,7 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
3843
3946
|
const tcb = new Context(env, domSchemaChecker, oobRecorder, meta.id, meta.boundTarget, meta.pipes, meta.schemas, meta.isStandalone);
|
|
3844
3947
|
const scope = Scope.forNodes(tcb, null, null, tcb.boundTarget.target.template, null);
|
|
3845
3948
|
const ctxRawType = env.referenceType(ref);
|
|
3846
|
-
if (!
|
|
3949
|
+
if (!ts28.isTypeReferenceNode(ctxRawType)) {
|
|
3847
3950
|
throw new Error(`Expected TypeReferenceNode when referencing the ctx param for ${ref.debugName}`);
|
|
3848
3951
|
}
|
|
3849
3952
|
let typeParameters = void 0;
|
|
@@ -3855,25 +3958,25 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
3855
3958
|
switch (genericContextBehavior) {
|
|
3856
3959
|
case TcbGenericContextBehavior.UseEmitter:
|
|
3857
3960
|
typeParameters = new TypeParameterEmitter(ref.node.typeParameters, env.reflector).emit((typeRef) => env.referenceType(typeRef));
|
|
3858
|
-
typeArguments = typeParameters.map((param) =>
|
|
3961
|
+
typeArguments = typeParameters.map((param) => ts28.factory.createTypeReferenceNode(param.name));
|
|
3859
3962
|
break;
|
|
3860
3963
|
case TcbGenericContextBehavior.CopyClassNodes:
|
|
3861
3964
|
typeParameters = [...ref.node.typeParameters];
|
|
3862
|
-
typeArguments = typeParameters.map((param) =>
|
|
3965
|
+
typeArguments = typeParameters.map((param) => ts28.factory.createTypeReferenceNode(param.name));
|
|
3863
3966
|
break;
|
|
3864
3967
|
case TcbGenericContextBehavior.FallbackToAny:
|
|
3865
|
-
typeArguments = ref.node.typeParameters.map(() =>
|
|
3968
|
+
typeArguments = ref.node.typeParameters.map(() => ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
|
|
3866
3969
|
break;
|
|
3867
3970
|
}
|
|
3868
3971
|
}
|
|
3869
3972
|
const paramList = [tcbThisParam(ctxRawType.typeName, typeArguments)];
|
|
3870
3973
|
const scopeStatements = scope.render();
|
|
3871
|
-
const innerBody =
|
|
3974
|
+
const innerBody = ts28.factory.createBlock([
|
|
3872
3975
|
...env.getPreludeStatements(),
|
|
3873
3976
|
...scopeStatements
|
|
3874
3977
|
]);
|
|
3875
|
-
const body =
|
|
3876
|
-
const fnDecl =
|
|
3978
|
+
const body = ts28.factory.createBlock([ts28.factory.createIfStatement(ts28.factory.createTrue(), innerBody, void 0)]);
|
|
3979
|
+
const fnDecl = ts28.factory.createFunctionDeclaration(
|
|
3877
3980
|
void 0,
|
|
3878
3981
|
void 0,
|
|
3879
3982
|
name,
|
|
@@ -3922,7 +4025,7 @@ var TcbTemplateVariableOp = class extends TcbOp {
|
|
|
3922
4025
|
execute() {
|
|
3923
4026
|
const ctx = this.scope.resolve(this.template);
|
|
3924
4027
|
const id = this.tcb.allocateId();
|
|
3925
|
-
const initializer =
|
|
4028
|
+
const initializer = ts28.factory.createPropertyAccessExpression(
|
|
3926
4029
|
ctx,
|
|
3927
4030
|
this.variable.value || "$implicit"
|
|
3928
4031
|
);
|
|
@@ -3948,7 +4051,7 @@ var TcbTemplateContextOp = class extends TcbOp {
|
|
|
3948
4051
|
}
|
|
3949
4052
|
execute() {
|
|
3950
4053
|
const ctx = this.tcb.allocateId();
|
|
3951
|
-
const type =
|
|
4054
|
+
const type = ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword);
|
|
3952
4055
|
this.scope.addStatement(tsDeclareVariable(ctx, type));
|
|
3953
4056
|
return ctx;
|
|
3954
4057
|
}
|
|
@@ -4001,16 +4104,16 @@ var TcbTemplateBodyOp = class extends TcbOp {
|
|
|
4001
4104
|
}
|
|
4002
4105
|
let guard = null;
|
|
4003
4106
|
if (directiveGuards.length > 0) {
|
|
4004
|
-
guard = directiveGuards.reduce((expr, dirGuard) =>
|
|
4107
|
+
guard = directiveGuards.reduce((expr, dirGuard) => ts28.factory.createBinaryExpression(expr, ts28.SyntaxKind.AmpersandAmpersandToken, dirGuard), directiveGuards.pop());
|
|
4005
4108
|
}
|
|
4006
4109
|
const tmplScope = Scope.forNodes(this.tcb, this.scope, this.template, this.template.children, guard);
|
|
4007
4110
|
const statements = tmplScope.render();
|
|
4008
4111
|
if (statements.length === 0) {
|
|
4009
4112
|
return null;
|
|
4010
4113
|
}
|
|
4011
|
-
let tmplBlock =
|
|
4114
|
+
let tmplBlock = ts28.factory.createBlock(statements);
|
|
4012
4115
|
if (guard !== null) {
|
|
4013
|
-
tmplBlock =
|
|
4116
|
+
tmplBlock = ts28.factory.createIfStatement(guard, tmplBlock);
|
|
4014
4117
|
}
|
|
4015
4118
|
this.scope.addStatement(tmplBlock);
|
|
4016
4119
|
return null;
|
|
@@ -4028,7 +4131,7 @@ var TcbExpressionOp = class extends TcbOp {
|
|
|
4028
4131
|
}
|
|
4029
4132
|
execute() {
|
|
4030
4133
|
const expr = tcbExpression(this.expression, this.tcb, this.scope);
|
|
4031
|
-
this.scope.addStatement(
|
|
4134
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(expr));
|
|
4032
4135
|
return null;
|
|
4033
4136
|
}
|
|
4034
4137
|
};
|
|
@@ -4050,11 +4153,11 @@ var TcbDirectiveTypeOpBase = class extends TcbOp {
|
|
|
4050
4153
|
if (this.dir.isGeneric === false || dirRef.node.typeParameters === void 0) {
|
|
4051
4154
|
type = rawType;
|
|
4052
4155
|
} else {
|
|
4053
|
-
if (!
|
|
4156
|
+
if (!ts28.isTypeReferenceNode(rawType)) {
|
|
4054
4157
|
throw new Error(`Expected TypeReferenceNode when referencing the type for ${this.dir.ref.debugName}`);
|
|
4055
4158
|
}
|
|
4056
|
-
const typeArguments = dirRef.node.typeParameters.map(() =>
|
|
4057
|
-
type =
|
|
4159
|
+
const typeArguments = dirRef.node.typeParameters.map(() => ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
|
|
4160
|
+
type = ts28.factory.createTypeReferenceNode(rawType.typeName, typeArguments);
|
|
4058
4161
|
}
|
|
4059
4162
|
const id = this.tcb.allocateId();
|
|
4060
4163
|
addExpressionIdentifier(type, ExpressionIdentifier.DIRECTIVE);
|
|
@@ -4095,11 +4198,11 @@ var TcbReferenceOp = class extends TcbOp {
|
|
|
4095
4198
|
const id = this.tcb.allocateId();
|
|
4096
4199
|
let initializer = this.target instanceof TmplAstTemplate2 || this.target instanceof TmplAstElement3 ? this.scope.resolve(this.target) : this.scope.resolve(this.host, this.target);
|
|
4097
4200
|
if (this.target instanceof TmplAstElement3 && !this.tcb.env.config.checkTypeOfDomReferences || !this.tcb.env.config.checkTypeOfNonDomReferences) {
|
|
4098
|
-
initializer =
|
|
4201
|
+
initializer = ts28.factory.createAsExpression(initializer, ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
|
|
4099
4202
|
} else if (this.target instanceof TmplAstTemplate2) {
|
|
4100
|
-
initializer =
|
|
4101
|
-
initializer =
|
|
4102
|
-
initializer =
|
|
4203
|
+
initializer = ts28.factory.createAsExpression(initializer, ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
|
|
4204
|
+
initializer = ts28.factory.createAsExpression(initializer, this.tcb.env.referenceExternalType("@angular/core", "TemplateRef", [DYNAMIC_TYPE]));
|
|
4205
|
+
initializer = ts28.factory.createParenthesizedExpression(initializer);
|
|
4103
4206
|
}
|
|
4104
4207
|
addParseSpanInfo(initializer, this.node.sourceSpan);
|
|
4105
4208
|
addParseSpanInfo(id, this.node.keySpan);
|
|
@@ -4192,7 +4295,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
4192
4295
|
type = this.tcb.env.referenceTransplantedType(new TransplantedType(transformType));
|
|
4193
4296
|
} else {
|
|
4194
4297
|
const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
|
|
4195
|
-
if (!
|
|
4298
|
+
if (!ts28.isTypeReferenceNode(dirTypeRef)) {
|
|
4196
4299
|
throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
|
|
4197
4300
|
}
|
|
4198
4301
|
type = tsCreateTypeQueryForCoercedInput(dirTypeRef.typeName, fieldName);
|
|
@@ -4208,10 +4311,10 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
4208
4311
|
}
|
|
4209
4312
|
const id = this.tcb.allocateId();
|
|
4210
4313
|
const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
|
|
4211
|
-
if (!
|
|
4314
|
+
if (!ts28.isTypeReferenceNode(dirTypeRef)) {
|
|
4212
4315
|
throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
|
|
4213
4316
|
}
|
|
4214
|
-
const type =
|
|
4317
|
+
const type = ts28.factory.createIndexedAccessTypeNode(ts28.factory.createTypeQueryNode(dirId), ts28.factory.createLiteralTypeNode(ts28.factory.createStringLiteral(fieldName)));
|
|
4215
4318
|
const temp = tsDeclareVariable(id, type);
|
|
4216
4319
|
this.scope.addStatement(temp);
|
|
4217
4320
|
target = id;
|
|
@@ -4219,18 +4322,18 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
4219
4322
|
if (dirId === null) {
|
|
4220
4323
|
dirId = this.scope.resolve(this.node, this.dir);
|
|
4221
4324
|
}
|
|
4222
|
-
target = this.dir.stringLiteralInputFields.has(fieldName) ?
|
|
4325
|
+
target = this.dir.stringLiteralInputFields.has(fieldName) ? ts28.factory.createElementAccessExpression(dirId, ts28.factory.createStringLiteral(fieldName)) : ts28.factory.createPropertyAccessExpression(dirId, ts28.factory.createIdentifier(fieldName));
|
|
4223
4326
|
}
|
|
4224
4327
|
if (attr.attribute.keySpan !== void 0) {
|
|
4225
4328
|
addParseSpanInfo(target, attr.attribute.keySpan);
|
|
4226
4329
|
}
|
|
4227
|
-
assignment =
|
|
4330
|
+
assignment = ts28.factory.createBinaryExpression(target, ts28.SyntaxKind.EqualsToken, assignment);
|
|
4228
4331
|
}
|
|
4229
4332
|
addParseSpanInfo(assignment, attr.attribute.sourceSpan);
|
|
4230
4333
|
if (!this.tcb.env.config.checkTypeOfAttributes && attr.attribute instanceof TmplAstTextAttribute2) {
|
|
4231
4334
|
markIgnoreDiagnostics(assignment);
|
|
4232
4335
|
}
|
|
4233
|
-
this.scope.addStatement(
|
|
4336
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(assignment));
|
|
4234
4337
|
}
|
|
4235
4338
|
this.checkRequiredInputs(seenRequiredInputs);
|
|
4236
4339
|
return null;
|
|
@@ -4261,7 +4364,7 @@ var TcbDirectiveCtorCircularFallbackOp = class extends TcbOp {
|
|
|
4261
4364
|
execute() {
|
|
4262
4365
|
const id = this.tcb.allocateId();
|
|
4263
4366
|
const typeCtor = this.tcb.env.typeCtorFor(this.dir);
|
|
4264
|
-
const circularPlaceholder =
|
|
4367
|
+
const circularPlaceholder = ts28.factory.createCallExpression(typeCtor, void 0, [ts28.factory.createNonNullExpression(ts28.factory.createNull())]);
|
|
4265
4368
|
this.scope.addStatement(tsCreateVariable(id, circularPlaceholder));
|
|
4266
4369
|
return id;
|
|
4267
4370
|
}
|
|
@@ -4329,15 +4432,15 @@ var TcbUnclaimedInputsOp = class extends TcbOp {
|
|
|
4329
4432
|
elId = this.scope.resolve(this.element);
|
|
4330
4433
|
}
|
|
4331
4434
|
const propertyName = (_a = ATTR_TO_PROP.get(binding.name)) != null ? _a : binding.name;
|
|
4332
|
-
const prop =
|
|
4333
|
-
const stmt =
|
|
4435
|
+
const prop = ts28.factory.createElementAccessExpression(elId, ts28.factory.createStringLiteral(propertyName));
|
|
4436
|
+
const stmt = ts28.factory.createBinaryExpression(prop, ts28.SyntaxKind.EqualsToken, wrapForDiagnostics(expr));
|
|
4334
4437
|
addParseSpanInfo(stmt, binding.sourceSpan);
|
|
4335
|
-
this.scope.addStatement(
|
|
4438
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(stmt));
|
|
4336
4439
|
} else {
|
|
4337
|
-
this.scope.addStatement(
|
|
4440
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(expr));
|
|
4338
4441
|
}
|
|
4339
4442
|
} else {
|
|
4340
|
-
this.scope.addStatement(
|
|
4443
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(expr));
|
|
4341
4444
|
}
|
|
4342
4445
|
}
|
|
4343
4446
|
return null;
|
|
@@ -4369,18 +4472,18 @@ var TcbDirectiveOutputsOp = class extends TcbOp {
|
|
|
4369
4472
|
if (dirId === null) {
|
|
4370
4473
|
dirId = this.scope.resolve(this.node, this.dir);
|
|
4371
4474
|
}
|
|
4372
|
-
const outputField =
|
|
4475
|
+
const outputField = ts28.factory.createElementAccessExpression(dirId, ts28.factory.createStringLiteral(field));
|
|
4373
4476
|
addParseSpanInfo(outputField, output.keySpan);
|
|
4374
4477
|
if (this.tcb.env.config.checkTypeOfOutputEvents) {
|
|
4375
4478
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
|
|
4376
|
-
const subscribeFn =
|
|
4377
|
-
const call =
|
|
4479
|
+
const subscribeFn = ts28.factory.createPropertyAccessExpression(outputField, "subscribe");
|
|
4480
|
+
const call = ts28.factory.createCallExpression(subscribeFn, void 0, [handler]);
|
|
4378
4481
|
addParseSpanInfo(call, output.sourceSpan);
|
|
4379
|
-
this.scope.addStatement(
|
|
4482
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(call));
|
|
4380
4483
|
} else {
|
|
4381
|
-
this.scope.addStatement(
|
|
4484
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(outputField));
|
|
4382
4485
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
4383
|
-
this.scope.addStatement(
|
|
4486
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(handler));
|
|
4384
4487
|
}
|
|
4385
4488
|
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
4386
4489
|
}
|
|
@@ -4413,24 +4516,24 @@ var TcbUnclaimedOutputsOp = class extends TcbOp {
|
|
|
4413
4516
|
if (output.type === 1) {
|
|
4414
4517
|
const eventType = this.tcb.env.config.checkTypeOfAnimationEvents ? this.tcb.env.referenceExternalType("@angular/animations", "AnimationEvent") : 1;
|
|
4415
4518
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, eventType);
|
|
4416
|
-
this.scope.addStatement(
|
|
4519
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(handler));
|
|
4417
4520
|
} else if (this.tcb.env.config.checkTypeOfDomEvents) {
|
|
4418
4521
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
|
|
4419
4522
|
if (elId === null) {
|
|
4420
4523
|
elId = this.scope.resolve(this.element);
|
|
4421
4524
|
}
|
|
4422
|
-
const propertyAccess =
|
|
4525
|
+
const propertyAccess = ts28.factory.createPropertyAccessExpression(elId, "addEventListener");
|
|
4423
4526
|
addParseSpanInfo(propertyAccess, output.keySpan);
|
|
4424
|
-
const call =
|
|
4527
|
+
const call = ts28.factory.createCallExpression(
|
|
4425
4528
|
propertyAccess,
|
|
4426
4529
|
void 0,
|
|
4427
|
-
[
|
|
4530
|
+
[ts28.factory.createStringLiteral(output.name), handler]
|
|
4428
4531
|
);
|
|
4429
4532
|
addParseSpanInfo(call, output.sourceSpan);
|
|
4430
|
-
this.scope.addStatement(
|
|
4533
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(call));
|
|
4431
4534
|
} else {
|
|
4432
4535
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
4433
|
-
this.scope.addStatement(
|
|
4536
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(handler));
|
|
4434
4537
|
}
|
|
4435
4538
|
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
4436
4539
|
}
|
|
@@ -4444,11 +4547,11 @@ var TcbComponentContextCompletionOp = class extends TcbOp {
|
|
|
4444
4547
|
this.optional = false;
|
|
4445
4548
|
}
|
|
4446
4549
|
execute() {
|
|
4447
|
-
const ctx =
|
|
4448
|
-
const ctxDot =
|
|
4550
|
+
const ctx = ts28.factory.createThis();
|
|
4551
|
+
const ctxDot = ts28.factory.createPropertyAccessExpression(ctx, "");
|
|
4449
4552
|
markIgnoreDiagnostics(ctxDot);
|
|
4450
4553
|
addExpressionIdentifier(ctxDot, ExpressionIdentifier.COMPONENT_COMPLETION);
|
|
4451
|
-
this.scope.addStatement(
|
|
4554
|
+
this.scope.addStatement(ts28.factory.createExpressionStatement(ctxDot));
|
|
4452
4555
|
return null;
|
|
4453
4556
|
}
|
|
4454
4557
|
};
|
|
@@ -4494,6 +4597,7 @@ var TcbIfOp = class extends TcbOp {
|
|
|
4494
4597
|
this.tcb = tcb;
|
|
4495
4598
|
this.scope = scope;
|
|
4496
4599
|
this.block = block;
|
|
4600
|
+
this.expressionScopes = /* @__PURE__ */ new Map();
|
|
4497
4601
|
}
|
|
4498
4602
|
get optional() {
|
|
4499
4603
|
return false;
|
|
@@ -4509,19 +4613,38 @@ var TcbIfOp = class extends TcbOp {
|
|
|
4509
4613
|
return void 0;
|
|
4510
4614
|
}
|
|
4511
4615
|
if (branch.expression === null) {
|
|
4512
|
-
const
|
|
4513
|
-
return
|
|
4616
|
+
const branchScope = Scope.forNodes(this.tcb, this.scope, null, branch.children, this.generateBranchGuard(index));
|
|
4617
|
+
return ts28.factory.createBlock(branchScope.render());
|
|
4514
4618
|
}
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4619
|
+
const expressionScope = Scope.forNodes(this.tcb, this.scope, branch, [], null);
|
|
4620
|
+
expressionScope.render().forEach((stmt) => this.scope.addStatement(stmt));
|
|
4621
|
+
this.expressionScopes.set(branch, expressionScope);
|
|
4622
|
+
const expression = branch.expressionAlias === null ? tcbExpression(branch.expression, this.tcb, expressionScope) : expressionScope.resolve(branch.expressionAlias);
|
|
4623
|
+
const bodyScope = Scope.forNodes(this.tcb, expressionScope, null, branch.children, this.generateBranchGuard(index));
|
|
4624
|
+
return ts28.factory.createIfStatement(expression, ts28.factory.createBlock(bodyScope.render()), this.generateBranch(index + 1));
|
|
4625
|
+
}
|
|
4626
|
+
generateBranchGuard(index) {
|
|
4627
|
+
let guard = null;
|
|
4628
|
+
for (let i = 0; i <= index; i++) {
|
|
4629
|
+
const branch = this.block.branches[i];
|
|
4630
|
+
if (branch.expression === null) {
|
|
4631
|
+
continue;
|
|
4632
|
+
}
|
|
4633
|
+
if (!this.expressionScopes.has(branch)) {
|
|
4634
|
+
throw new Error(`Could not determine expression scope of branch at index ${i}`);
|
|
4635
|
+
}
|
|
4636
|
+
const expressionScope = this.expressionScopes.get(branch);
|
|
4637
|
+
let expression;
|
|
4638
|
+
if (branch.expressionAlias === null) {
|
|
4639
|
+
expression = tcbExpression(branch.expression, this.tcb, expressionScope);
|
|
4640
|
+
markIgnoreDiagnostics(expression);
|
|
4641
|
+
} else {
|
|
4642
|
+
expression = expressionScope.resolve(branch.expressionAlias);
|
|
4643
|
+
}
|
|
4644
|
+
const comparisonExpression = i === index ? expression : ts28.factory.createPrefixUnaryExpression(ts28.SyntaxKind.ExclamationToken, ts28.factory.createParenthesizedExpression(expression));
|
|
4645
|
+
guard = guard === null ? comparisonExpression : ts28.factory.createBinaryExpression(guard, ts28.SyntaxKind.AmpersandAmpersandToken, comparisonExpression);
|
|
4521
4646
|
}
|
|
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));
|
|
4647
|
+
return guard;
|
|
4525
4648
|
}
|
|
4526
4649
|
};
|
|
4527
4650
|
var TcbSwitchOp = class extends TcbOp {
|
|
@@ -4535,18 +4658,51 @@ var TcbSwitchOp = class extends TcbOp {
|
|
|
4535
4658
|
return false;
|
|
4536
4659
|
}
|
|
4537
4660
|
execute() {
|
|
4538
|
-
const
|
|
4661
|
+
const expression = tcbExpression(this.block.expression, this.tcb, this.scope);
|
|
4662
|
+
markIgnoreDiagnostics(expression);
|
|
4663
|
+
const root = this.generateCase(0, expression, null);
|
|
4664
|
+
if (root !== void 0) {
|
|
4665
|
+
this.scope.addStatement(root);
|
|
4666
|
+
}
|
|
4667
|
+
return null;
|
|
4668
|
+
}
|
|
4669
|
+
generateCase(index, switchValue, defaultCase) {
|
|
4670
|
+
if (index >= this.block.cases.length) {
|
|
4671
|
+
if (defaultCase !== null) {
|
|
4672
|
+
const defaultScope = Scope.forNodes(this.tcb, this.scope, null, defaultCase.children, this.generateGuard(defaultCase, switchValue));
|
|
4673
|
+
return ts28.factory.createBlock(defaultScope.render());
|
|
4674
|
+
}
|
|
4675
|
+
return void 0;
|
|
4676
|
+
}
|
|
4677
|
+
const current = this.block.cases[index];
|
|
4678
|
+
if (current.expression === null) {
|
|
4679
|
+
return this.generateCase(index + 1, switchValue, current);
|
|
4680
|
+
}
|
|
4681
|
+
const caseScope = Scope.forNodes(this.tcb, this.scope, null, current.children, this.generateGuard(current, switchValue));
|
|
4682
|
+
const caseValue = tcbExpression(current.expression, this.tcb, caseScope);
|
|
4683
|
+
return ts28.factory.createIfStatement(ts28.factory.createBinaryExpression(switchValue, ts28.SyntaxKind.EqualsEqualsEqualsToken, caseValue), ts28.factory.createBlock(caseScope.render()), this.generateCase(index + 1, switchValue, defaultCase));
|
|
4684
|
+
}
|
|
4685
|
+
generateGuard(node, switchValue) {
|
|
4686
|
+
if (node.expression !== null) {
|
|
4687
|
+
const expression = tcbExpression(node.expression, this.tcb, this.scope);
|
|
4688
|
+
markIgnoreDiagnostics(expression);
|
|
4689
|
+
return ts28.factory.createBinaryExpression(switchValue, ts28.SyntaxKind.EqualsEqualsEqualsToken, expression);
|
|
4690
|
+
}
|
|
4691
|
+
let guard = null;
|
|
4539
4692
|
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
4693
|
if (current.expression === null) {
|
|
4543
|
-
|
|
4694
|
+
continue;
|
|
4695
|
+
}
|
|
4696
|
+
const expression = tcbExpression(current.expression, this.tcb, this.scope);
|
|
4697
|
+
markIgnoreDiagnostics(expression);
|
|
4698
|
+
const comparison = ts28.factory.createBinaryExpression(switchValue, ts28.SyntaxKind.ExclamationEqualsEqualsToken, expression);
|
|
4699
|
+
if (guard === null) {
|
|
4700
|
+
guard = comparison;
|
|
4544
4701
|
} else {
|
|
4545
|
-
|
|
4702
|
+
guard = ts28.factory.createBinaryExpression(guard, ts28.SyntaxKind.AmpersandAmpersandToken, comparison);
|
|
4546
4703
|
}
|
|
4547
4704
|
}
|
|
4548
|
-
|
|
4549
|
-
return null;
|
|
4705
|
+
return guard;
|
|
4550
4706
|
}
|
|
4551
4707
|
};
|
|
4552
4708
|
var TcbForOfOp = class extends TcbOp {
|
|
@@ -4561,19 +4717,19 @@ var TcbForOfOp = class extends TcbOp {
|
|
|
4561
4717
|
}
|
|
4562
4718
|
execute() {
|
|
4563
4719
|
const loopScope = Scope.forNodes(this.tcb, this.scope, this.block, this.block.children, null);
|
|
4564
|
-
const initializer =
|
|
4565
|
-
const expression =
|
|
4720
|
+
const initializer = ts28.factory.createVariableDeclarationList([ts28.factory.createVariableDeclaration(this.block.item.name)], ts28.NodeFlags.Const);
|
|
4721
|
+
const expression = ts28.factory.createNonNullExpression(tcbExpression(this.block.expression, this.tcb, loopScope));
|
|
4566
4722
|
const trackTranslator = new TcbForLoopTrackTranslator(this.tcb, loopScope, this.block);
|
|
4567
4723
|
const trackExpression = trackTranslator.translate(this.block.trackBy);
|
|
4568
4724
|
const statements = [
|
|
4569
4725
|
...loopScope.render(),
|
|
4570
|
-
|
|
4726
|
+
ts28.factory.createExpressionStatement(trackExpression)
|
|
4571
4727
|
];
|
|
4572
|
-
this.scope.addStatement(
|
|
4728
|
+
this.scope.addStatement(ts28.factory.createForOfStatement(void 0, initializer, expression, ts28.factory.createBlock(statements)));
|
|
4573
4729
|
return null;
|
|
4574
4730
|
}
|
|
4575
4731
|
};
|
|
4576
|
-
var INFER_TYPE_FOR_CIRCULAR_OP_EXPR =
|
|
4732
|
+
var INFER_TYPE_FOR_CIRCULAR_OP_EXPR = ts28.factory.createNonNullExpression(ts28.factory.createNull());
|
|
4577
4733
|
var Context = class {
|
|
4578
4734
|
constructor(env, domSchemaChecker, oobRecorder, id, boundTarget, pipes, schemas, hostIsStandalone) {
|
|
4579
4735
|
this.env = env;
|
|
@@ -4587,7 +4743,7 @@ var Context = class {
|
|
|
4587
4743
|
this.nextId = 1;
|
|
4588
4744
|
}
|
|
4589
4745
|
allocateId() {
|
|
4590
|
-
return
|
|
4746
|
+
return ts28.factory.createIdentifier(`_t${this.nextId++}`);
|
|
4591
4747
|
}
|
|
4592
4748
|
getPipeByName(name) {
|
|
4593
4749
|
if (!this.pipes.has(name)) {
|
|
@@ -4631,9 +4787,9 @@ var Scope = class {
|
|
|
4631
4787
|
this.registerVariable(scope, expressionAlias, new TcbBlockVariableOp(tcb, scope, tcbExpression(expression, tcb, scope), expressionAlias));
|
|
4632
4788
|
}
|
|
4633
4789
|
} else if (scopedNode instanceof TmplAstForLoopBlock) {
|
|
4634
|
-
this.registerVariable(scope, scopedNode.item, new TcbBlockVariableOp(tcb, scope,
|
|
4790
|
+
this.registerVariable(scope, scopedNode.item, new TcbBlockVariableOp(tcb, scope, ts28.factory.createIdentifier(scopedNode.item.name), scopedNode.item));
|
|
4635
4791
|
for (const variable of Object.values(scopedNode.contextVariables)) {
|
|
4636
|
-
const type =
|
|
4792
|
+
const type = ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.NumberKeyword);
|
|
4637
4793
|
this.registerVariable(scope, variable, new TcbBlockImplicitVariableOp(tcb, scope, type, variable));
|
|
4638
4794
|
}
|
|
4639
4795
|
}
|
|
@@ -4650,16 +4806,16 @@ var Scope = class {
|
|
|
4650
4806
|
const res = this.resolveLocal(node, directive);
|
|
4651
4807
|
if (res !== null) {
|
|
4652
4808
|
let clone;
|
|
4653
|
-
if (
|
|
4654
|
-
clone =
|
|
4655
|
-
} else if (
|
|
4656
|
-
clone =
|
|
4809
|
+
if (ts28.isIdentifier(res)) {
|
|
4810
|
+
clone = ts28.factory.createIdentifier(res.text);
|
|
4811
|
+
} else if (ts28.isNonNullExpression(res)) {
|
|
4812
|
+
clone = ts28.factory.createNonNullExpression(res.expression);
|
|
4657
4813
|
} else {
|
|
4658
4814
|
throw new Error(`Could not resolve ${node} to an Identifier or a NonNullExpression`);
|
|
4659
4815
|
}
|
|
4660
|
-
|
|
4816
|
+
ts28.setOriginalNode(clone, res);
|
|
4661
4817
|
clone.parent = clone.parent;
|
|
4662
|
-
return
|
|
4818
|
+
return ts28.setSyntheticTrailingComments(clone, []);
|
|
4663
4819
|
} else if (this.parent !== null) {
|
|
4664
4820
|
return this.parent.resolve(node, directive);
|
|
4665
4821
|
} else {
|
|
@@ -4686,7 +4842,7 @@ var Scope = class {
|
|
|
4686
4842
|
} else if (parentGuards === null) {
|
|
4687
4843
|
return this.guard;
|
|
4688
4844
|
} else {
|
|
4689
|
-
return
|
|
4845
|
+
return ts28.factory.createBinaryExpression(parentGuards, ts28.SyntaxKind.AmpersandAmpersandToken, this.guard);
|
|
4690
4846
|
}
|
|
4691
4847
|
}
|
|
4692
4848
|
resolveLocal(ref, directive) {
|
|
@@ -4753,7 +4909,7 @@ var Scope = class {
|
|
|
4753
4909
|
} else if (node instanceof TmplAstIfBlock) {
|
|
4754
4910
|
this.opQueue.push(new TcbIfOp(this.tcb, this, node));
|
|
4755
4911
|
} else if (node instanceof TmplAstSwitchBlock) {
|
|
4756
|
-
this.opQueue.push(new TcbSwitchOp(this.tcb, this, node));
|
|
4912
|
+
this.opQueue.push(new TcbExpressionOp(this.tcb, this, node.expression), new TcbSwitchOp(this.tcb, this, node));
|
|
4757
4913
|
} else if (node instanceof TmplAstForLoopBlock) {
|
|
4758
4914
|
this.opQueue.push(new TcbForOfOp(this.tcb, this, node));
|
|
4759
4915
|
node.empty && this.appendChildren(node.empty);
|
|
@@ -4911,12 +5067,12 @@ var Scope = class {
|
|
|
4911
5067
|
}
|
|
4912
5068
|
};
|
|
4913
5069
|
function tcbThisParam(name, typeArguments) {
|
|
4914
|
-
return
|
|
5070
|
+
return ts28.factory.createParameterDeclaration(
|
|
4915
5071
|
void 0,
|
|
4916
5072
|
void 0,
|
|
4917
5073
|
"this",
|
|
4918
5074
|
void 0,
|
|
4919
|
-
|
|
5075
|
+
ts28.factory.createTypeReferenceNode(name, typeArguments),
|
|
4920
5076
|
void 0
|
|
4921
5077
|
);
|
|
4922
5078
|
}
|
|
@@ -4941,11 +5097,11 @@ var TcbExpressionTranslator = class {
|
|
|
4941
5097
|
return null;
|
|
4942
5098
|
}
|
|
4943
5099
|
const expr = this.translate(ast.value);
|
|
4944
|
-
const result =
|
|
5100
|
+
const result = ts28.factory.createParenthesizedExpression(ts28.factory.createBinaryExpression(target, ts28.SyntaxKind.EqualsToken, expr));
|
|
4945
5101
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
4946
5102
|
return result;
|
|
4947
5103
|
} else if (ast instanceof ImplicitReceiver4) {
|
|
4948
|
-
return
|
|
5104
|
+
return ts28.factory.createThis();
|
|
4949
5105
|
} else if (ast instanceof BindingPipe) {
|
|
4950
5106
|
const expr = this.translate(ast.exp);
|
|
4951
5107
|
const pipeRef = this.tcb.getPipeByName(ast.name);
|
|
@@ -4957,12 +5113,12 @@ var TcbExpressionTranslator = class {
|
|
|
4957
5113
|
pipe = this.tcb.env.pipeInst(pipeRef);
|
|
4958
5114
|
}
|
|
4959
5115
|
const args = ast.args.map((arg) => this.translate(arg));
|
|
4960
|
-
let methodAccess =
|
|
5116
|
+
let methodAccess = ts28.factory.createPropertyAccessExpression(pipe, "transform");
|
|
4961
5117
|
addParseSpanInfo(methodAccess, ast.nameSpan);
|
|
4962
5118
|
if (!this.tcb.env.config.checkTypeOfPipes) {
|
|
4963
|
-
methodAccess =
|
|
5119
|
+
methodAccess = ts28.factory.createAsExpression(methodAccess, ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
|
|
4964
5120
|
}
|
|
4965
|
-
const result =
|
|
5121
|
+
const result = ts28.factory.createCallExpression(
|
|
4966
5122
|
methodAccess,
|
|
4967
5123
|
void 0,
|
|
4968
5124
|
[expr, ...args]
|
|
@@ -4972,8 +5128,8 @@ var TcbExpressionTranslator = class {
|
|
|
4972
5128
|
} else if ((ast instanceof Call2 || ast instanceof SafeCall) && (ast.receiver instanceof PropertyRead4 || ast.receiver instanceof SafePropertyRead3)) {
|
|
4973
5129
|
if (ast.receiver.receiver instanceof ImplicitReceiver4 && !(ast.receiver.receiver instanceof ThisReceiver) && ast.receiver.name === "$any" && ast.args.length === 1) {
|
|
4974
5130
|
const expr = this.translate(ast.args[0]);
|
|
4975
|
-
const exprAsAny =
|
|
4976
|
-
const result =
|
|
5131
|
+
const exprAsAny = ts28.factory.createAsExpression(expr, ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
|
|
5132
|
+
const result = ts28.factory.createParenthesizedExpression(exprAsAny);
|
|
4977
5133
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
4978
5134
|
return result;
|
|
4979
5135
|
}
|
|
@@ -4984,7 +5140,7 @@ var TcbExpressionTranslator = class {
|
|
|
4984
5140
|
const method = wrapForDiagnostics(receiver);
|
|
4985
5141
|
addParseSpanInfo(method, ast.receiver.nameSpan);
|
|
4986
5142
|
const args = ast.args.map((arg) => this.translate(arg));
|
|
4987
|
-
const node =
|
|
5143
|
+
const node = ts28.factory.createCallExpression(method, void 0, args);
|
|
4988
5144
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
4989
5145
|
return node;
|
|
4990
5146
|
} else {
|
|
@@ -5004,20 +5160,20 @@ var TcbExpressionTranslator = class {
|
|
|
5004
5160
|
function tcbCallTypeCtor(dir, tcb, inputs) {
|
|
5005
5161
|
const typeCtor = tcb.env.typeCtorFor(dir);
|
|
5006
5162
|
const members = inputs.map((input) => {
|
|
5007
|
-
const propertyName =
|
|
5163
|
+
const propertyName = ts28.factory.createStringLiteral(input.field);
|
|
5008
5164
|
if (input.type === "binding") {
|
|
5009
5165
|
const expr = widenBinding(input.expression, tcb);
|
|
5010
|
-
const assignment =
|
|
5166
|
+
const assignment = ts28.factory.createPropertyAssignment(propertyName, wrapForDiagnostics(expr));
|
|
5011
5167
|
addParseSpanInfo(assignment, input.sourceSpan);
|
|
5012
5168
|
return assignment;
|
|
5013
5169
|
} else {
|
|
5014
|
-
return
|
|
5170
|
+
return ts28.factory.createPropertyAssignment(propertyName, NULL_AS_ANY);
|
|
5015
5171
|
}
|
|
5016
5172
|
});
|
|
5017
|
-
return
|
|
5173
|
+
return ts28.factory.createCallExpression(
|
|
5018
5174
|
typeCtor,
|
|
5019
5175
|
void 0,
|
|
5020
|
-
[
|
|
5176
|
+
[ts28.factory.createObjectLiteralExpression(members)]
|
|
5021
5177
|
);
|
|
5022
5178
|
}
|
|
5023
5179
|
function getBoundAttributes(directive, node) {
|
|
@@ -5052,17 +5208,17 @@ function translateInput(attr, tcb, scope) {
|
|
|
5052
5208
|
if (attr instanceof TmplAstBoundAttribute) {
|
|
5053
5209
|
return tcbExpression(attr.value, tcb, scope);
|
|
5054
5210
|
} else {
|
|
5055
|
-
return
|
|
5211
|
+
return ts28.factory.createStringLiteral(attr.value);
|
|
5056
5212
|
}
|
|
5057
5213
|
}
|
|
5058
5214
|
function widenBinding(expr, tcb) {
|
|
5059
5215
|
if (!tcb.env.config.checkTypeOfInputBindings) {
|
|
5060
5216
|
return tsCastToAny(expr);
|
|
5061
5217
|
} else if (!tcb.env.config.strictNullInputBindings) {
|
|
5062
|
-
if (
|
|
5218
|
+
if (ts28.isObjectLiteralExpression(expr) || ts28.isArrayLiteralExpression(expr)) {
|
|
5063
5219
|
return expr;
|
|
5064
5220
|
} else {
|
|
5065
|
-
return
|
|
5221
|
+
return ts28.factory.createNonNullExpression(expr);
|
|
5066
5222
|
}
|
|
5067
5223
|
} else {
|
|
5068
5224
|
return expr;
|
|
@@ -5075,16 +5231,16 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
|
|
|
5075
5231
|
if (eventType === 0) {
|
|
5076
5232
|
eventParamType = void 0;
|
|
5077
5233
|
} else if (eventType === 1) {
|
|
5078
|
-
eventParamType =
|
|
5234
|
+
eventParamType = ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword);
|
|
5079
5235
|
} else {
|
|
5080
5236
|
eventParamType = eventType;
|
|
5081
5237
|
}
|
|
5082
5238
|
const guards = scope.guards();
|
|
5083
|
-
let body =
|
|
5239
|
+
let body = ts28.factory.createExpressionStatement(handler);
|
|
5084
5240
|
if (guards !== null) {
|
|
5085
|
-
body =
|
|
5241
|
+
body = ts28.factory.createIfStatement(guards, body);
|
|
5086
5242
|
}
|
|
5087
|
-
const eventParam =
|
|
5243
|
+
const eventParam = ts28.factory.createParameterDeclaration(
|
|
5088
5244
|
void 0,
|
|
5089
5245
|
void 0,
|
|
5090
5246
|
EVENT_PARAMETER,
|
|
@@ -5092,13 +5248,13 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
|
|
|
5092
5248
|
eventParamType
|
|
5093
5249
|
);
|
|
5094
5250
|
addExpressionIdentifier(eventParam, ExpressionIdentifier.EVENT_PARAMETER);
|
|
5095
|
-
return
|
|
5251
|
+
return ts28.factory.createArrowFunction(
|
|
5096
5252
|
void 0,
|
|
5097
5253
|
void 0,
|
|
5098
5254
|
[eventParam],
|
|
5099
|
-
|
|
5255
|
+
ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword),
|
|
5100
5256
|
void 0,
|
|
5101
|
-
|
|
5257
|
+
ts28.factory.createBlock([body])
|
|
5102
5258
|
);
|
|
5103
5259
|
}
|
|
5104
5260
|
function tcbEventHandlerExpression(ast, tcb, scope) {
|
|
@@ -5127,7 +5283,7 @@ function isSplitTwoWayBinding(inputName, output, inputs, tcb) {
|
|
|
5127
5283
|
var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
|
|
5128
5284
|
resolve(ast) {
|
|
5129
5285
|
if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver4 && !(ast.receiver instanceof ThisReceiver) && ast.name === EVENT_PARAMETER) {
|
|
5130
|
-
const event =
|
|
5286
|
+
const event = ts28.factory.createIdentifier(EVENT_PARAMETER);
|
|
5131
5287
|
addParseSpanInfo(event, ast.nameSpan);
|
|
5132
5288
|
return event;
|
|
5133
5289
|
}
|
|
@@ -5151,32 +5307,32 @@ var TcbForLoopTrackTranslator = class extends TcbExpressionTranslator {
|
|
|
5151
5307
|
};
|
|
5152
5308
|
|
|
5153
5309
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_file.mjs
|
|
5154
|
-
import
|
|
5310
|
+
import ts29 from "typescript";
|
|
5155
5311
|
var TypeCheckFile = class extends Environment {
|
|
5156
5312
|
constructor(fileName, config, refEmitter, reflector, compilerHost) {
|
|
5157
|
-
super(config, new ImportManager(new NoopImportRewriter(), "i"), refEmitter, reflector,
|
|
5313
|
+
super(config, new ImportManager(new NoopImportRewriter(), "i"), refEmitter, reflector, ts29.createSourceFile(compilerHost.getCanonicalFileName(fileName), "", ts29.ScriptTarget.Latest, true));
|
|
5158
5314
|
this.fileName = fileName;
|
|
5159
5315
|
this.nextTcbId = 1;
|
|
5160
5316
|
this.tcbStatements = [];
|
|
5161
5317
|
}
|
|
5162
5318
|
addTypeCheckBlock(ref, meta, domSchemaChecker, oobRecorder, genericContextBehavior) {
|
|
5163
|
-
const fnId =
|
|
5319
|
+
const fnId = ts29.factory.createIdentifier(`_tcb${this.nextTcbId++}`);
|
|
5164
5320
|
const fn = generateTypeCheckBlock(this, ref, fnId, meta, domSchemaChecker, oobRecorder, genericContextBehavior);
|
|
5165
5321
|
this.tcbStatements.push(fn);
|
|
5166
5322
|
}
|
|
5167
5323
|
render(removeComments) {
|
|
5168
5324
|
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 =
|
|
5325
|
+
const printer = ts29.createPrinter({ removeComments });
|
|
5170
5326
|
source += "\n";
|
|
5171
5327
|
for (const stmt of this.pipeInstStatements) {
|
|
5172
|
-
source += printer.printNode(
|
|
5328
|
+
source += printer.printNode(ts29.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
5173
5329
|
}
|
|
5174
5330
|
for (const stmt of this.typeCtorStatements) {
|
|
5175
|
-
source += printer.printNode(
|
|
5331
|
+
source += printer.printNode(ts29.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
5176
5332
|
}
|
|
5177
5333
|
source += "\n";
|
|
5178
5334
|
for (const stmt of this.tcbStatements) {
|
|
5179
|
-
source += printer.printNode(
|
|
5335
|
+
source += printer.printNode(ts29.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
5180
5336
|
}
|
|
5181
5337
|
source += "\nexport const IS_A_MODULE = true;\n";
|
|
5182
5338
|
return source;
|
|
@@ -5291,7 +5447,7 @@ var TypeCheckContextImpl = class {
|
|
|
5291
5447
|
const importManager = new ImportManager(new NoopImportRewriter(), "_i");
|
|
5292
5448
|
const ops = this.opMap.get(sf).sort(orderOps);
|
|
5293
5449
|
const textParts = splitStringAtPoints(sf.text, ops.map((op) => op.splitPoint));
|
|
5294
|
-
const printer =
|
|
5450
|
+
const printer = ts30.createPrinter({ omitTrailingSemicolon: true });
|
|
5295
5451
|
let code = textParts[0];
|
|
5296
5452
|
ops.forEach((op, idx) => {
|
|
5297
5453
|
const text = op.execute(importManager, sf, this.refEmitter, printer);
|
|
@@ -5372,7 +5528,7 @@ var TypeCheckContextImpl = class {
|
|
|
5372
5528
|
if (span.start.offset === span.end.offset) {
|
|
5373
5529
|
span.end.offset++;
|
|
5374
5530
|
}
|
|
5375
|
-
return makeTemplateDiagnostic(templateId, sourceMapping, span,
|
|
5531
|
+
return makeTemplateDiagnostic(templateId, sourceMapping, span, ts30.DiagnosticCategory.Error, ngErrorCode(ErrorCode.TEMPLATE_PARSE_ERROR), error.msg);
|
|
5376
5532
|
});
|
|
5377
5533
|
}
|
|
5378
5534
|
};
|
|
@@ -5390,9 +5546,9 @@ var InlineTcbOp = class {
|
|
|
5390
5546
|
}
|
|
5391
5547
|
execute(im, sf, refEmitter, printer) {
|
|
5392
5548
|
const env = new Environment(this.config, im, refEmitter, this.reflector, sf);
|
|
5393
|
-
const fnName =
|
|
5549
|
+
const fnName = ts30.factory.createIdentifier(`_tcb_${this.ref.node.pos}`);
|
|
5394
5550
|
const fn = generateTypeCheckBlock(env, this.ref, fnName, this.meta, this.domSchemaChecker, this.oobRecorder, TcbGenericContextBehavior.CopyClassNodes);
|
|
5395
|
-
return printer.printNode(
|
|
5551
|
+
return printer.printNode(ts30.EmitHint.Unspecified, fn, sf);
|
|
5396
5552
|
}
|
|
5397
5553
|
};
|
|
5398
5554
|
var TypeCtorOp = class {
|
|
@@ -5405,7 +5561,7 @@ var TypeCtorOp = class {
|
|
|
5405
5561
|
}
|
|
5406
5562
|
execute(im, sf, refEmitter, printer) {
|
|
5407
5563
|
const tcb = generateInlineTypeCtor(this.ref.node, this.meta);
|
|
5408
|
-
return printer.printNode(
|
|
5564
|
+
return printer.printNode(ts30.EmitHint.Unspecified, tcb, sf);
|
|
5409
5565
|
}
|
|
5410
5566
|
};
|
|
5411
5567
|
function orderOps(op1, op2) {
|
|
@@ -5520,7 +5676,7 @@ var TemplateSourceManager = class {
|
|
|
5520
5676
|
|
|
5521
5677
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_symbol_builder.mjs
|
|
5522
5678
|
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
|
|
5679
|
+
import ts31 from "typescript";
|
|
5524
5680
|
var SymbolBuilder = class {
|
|
5525
5681
|
constructor(tcbPath, tcbIsShim, typeCheckBlock, templateData, componentScopeReader, getTypeChecker) {
|
|
5526
5682
|
this.tcbPath = tcbPath;
|
|
@@ -5564,7 +5720,7 @@ var SymbolBuilder = class {
|
|
|
5564
5720
|
getSymbolOfElement(element) {
|
|
5565
5721
|
var _a;
|
|
5566
5722
|
const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
|
|
5567
|
-
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: elementSourceSpan, filter:
|
|
5723
|
+
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: elementSourceSpan, filter: ts31.isVariableDeclaration });
|
|
5568
5724
|
if (node === null) {
|
|
5569
5725
|
return null;
|
|
5570
5726
|
}
|
|
@@ -5584,12 +5740,12 @@ var SymbolBuilder = class {
|
|
|
5584
5740
|
var _a;
|
|
5585
5741
|
const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
|
|
5586
5742
|
const tcbSourceFile = this.typeCheckBlock.getSourceFile();
|
|
5587
|
-
const isDirectiveDeclaration = (node) => (
|
|
5743
|
+
const isDirectiveDeclaration = (node) => (ts31.isTypeNode(node) || ts31.isIdentifier(node)) && ts31.isVariableDeclaration(node.parent) && hasExpressionIdentifier(tcbSourceFile, node, ExpressionIdentifier.DIRECTIVE);
|
|
5588
5744
|
const nodes = findAllMatchingNodes(this.typeCheckBlock, { withSpan: elementSourceSpan, filter: isDirectiveDeclaration });
|
|
5589
5745
|
const symbols = [];
|
|
5590
5746
|
for (const node of nodes) {
|
|
5591
5747
|
const symbol = this.getSymbolOfTsNode(node.parent);
|
|
5592
|
-
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !
|
|
5748
|
+
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts31.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
|
|
5593
5749
|
continue;
|
|
5594
5750
|
}
|
|
5595
5751
|
const meta = this.getDirectiveMeta(element, symbol.tsSymbol.valueDeclaration);
|
|
@@ -5617,7 +5773,7 @@ var SymbolBuilder = class {
|
|
|
5617
5773
|
}
|
|
5618
5774
|
addHostDirectiveSymbols(host, hostDirectives, symbols) {
|
|
5619
5775
|
for (const current of hostDirectives) {
|
|
5620
|
-
if (!
|
|
5776
|
+
if (!ts31.isClassDeclaration(current.directive.node)) {
|
|
5621
5777
|
continue;
|
|
5622
5778
|
}
|
|
5623
5779
|
const symbol = this.getSymbolOfTsNode(current.directive.node);
|
|
@@ -5690,17 +5846,17 @@ var SymbolBuilder = class {
|
|
|
5690
5846
|
if (!isAccessExpression(n)) {
|
|
5691
5847
|
return false;
|
|
5692
5848
|
}
|
|
5693
|
-
if (
|
|
5849
|
+
if (ts31.isPropertyAccessExpression(n)) {
|
|
5694
5850
|
return n.name.getText() === expectedAccess;
|
|
5695
5851
|
} else {
|
|
5696
|
-
return
|
|
5852
|
+
return ts31.isStringLiteral(n.argumentExpression) && n.argumentExpression.text === expectedAccess;
|
|
5697
5853
|
}
|
|
5698
5854
|
}
|
|
5699
5855
|
const outputFieldAccesses = findAllMatchingNodes(this.typeCheckBlock, { withSpan: eventBinding.keySpan, filter });
|
|
5700
5856
|
const bindings = [];
|
|
5701
5857
|
for (const outputFieldAccess of outputFieldAccesses) {
|
|
5702
5858
|
if (consumer instanceof TmplAstTemplate3 || consumer instanceof TmplAstElement4) {
|
|
5703
|
-
if (!
|
|
5859
|
+
if (!ts31.isPropertyAccessExpression(outputFieldAccess)) {
|
|
5704
5860
|
continue;
|
|
5705
5861
|
}
|
|
5706
5862
|
const addEventListener = outputFieldAccess.name;
|
|
@@ -5723,7 +5879,7 @@ var SymbolBuilder = class {
|
|
|
5723
5879
|
}
|
|
5724
5880
|
});
|
|
5725
5881
|
} else {
|
|
5726
|
-
if (!
|
|
5882
|
+
if (!ts31.isElementAccessExpression(outputFieldAccess)) {
|
|
5727
5883
|
continue;
|
|
5728
5884
|
}
|
|
5729
5885
|
const tsSymbol = this.getTypeChecker().getSymbolAtLocation(outputFieldAccess.argumentExpression);
|
|
@@ -5796,7 +5952,7 @@ var SymbolBuilder = class {
|
|
|
5796
5952
|
return null;
|
|
5797
5953
|
}
|
|
5798
5954
|
const [declaration] = tsSymbol.declarations;
|
|
5799
|
-
if (!
|
|
5955
|
+
if (!ts31.isVariableDeclaration(declaration) || !hasExpressionIdentifier(
|
|
5800
5956
|
declaration.getSourceFile(),
|
|
5801
5957
|
(_a = declaration.type) != null ? _a : declaration.name,
|
|
5802
5958
|
ExpressionIdentifier.DIRECTIVE
|
|
@@ -5804,7 +5960,7 @@ var SymbolBuilder = class {
|
|
|
5804
5960
|
return null;
|
|
5805
5961
|
}
|
|
5806
5962
|
const symbol = this.getSymbolOfTsNode(declaration);
|
|
5807
|
-
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !
|
|
5963
|
+
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts31.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
|
|
5808
5964
|
return null;
|
|
5809
5965
|
}
|
|
5810
5966
|
const ref = new Reference(symbol.tsSymbol.valueDeclaration);
|
|
@@ -5824,7 +5980,7 @@ var SymbolBuilder = class {
|
|
|
5824
5980
|
};
|
|
5825
5981
|
}
|
|
5826
5982
|
getSymbolOfVariable(variable) {
|
|
5827
|
-
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: variable.sourceSpan, filter:
|
|
5983
|
+
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: variable.sourceSpan, filter: ts31.isVariableDeclaration });
|
|
5828
5984
|
if (node === null || node.initializer === void 0) {
|
|
5829
5985
|
return null;
|
|
5830
5986
|
}
|
|
@@ -5847,11 +6003,11 @@ var SymbolBuilder = class {
|
|
|
5847
6003
|
}
|
|
5848
6004
|
getSymbolOfReference(ref) {
|
|
5849
6005
|
const target = this.templateData.boundTarget.getReferenceTarget(ref);
|
|
5850
|
-
let node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: ref.sourceSpan, filter:
|
|
6006
|
+
let node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: ref.sourceSpan, filter: ts31.isVariableDeclaration });
|
|
5851
6007
|
if (node === null || target === null || node.initializer === void 0) {
|
|
5852
6008
|
return null;
|
|
5853
6009
|
}
|
|
5854
|
-
const originalDeclaration =
|
|
6010
|
+
const originalDeclaration = ts31.isParenthesizedExpression(node.initializer) && ts31.isAsExpression(node.initializer.expression) ? this.getTypeChecker().getSymbolAtLocation(node.name) : this.getTypeChecker().getSymbolAtLocation(node.initializer);
|
|
5855
6011
|
if (originalDeclaration === void 0 || originalDeclaration.valueDeclaration === void 0) {
|
|
5856
6012
|
return null;
|
|
5857
6013
|
}
|
|
@@ -5875,7 +6031,7 @@ var SymbolBuilder = class {
|
|
|
5875
6031
|
referenceVarLocation: referenceVarTcbLocation
|
|
5876
6032
|
};
|
|
5877
6033
|
} else {
|
|
5878
|
-
if (!
|
|
6034
|
+
if (!ts31.isClassDeclaration(target.directive.ref.node)) {
|
|
5879
6035
|
return null;
|
|
5880
6036
|
}
|
|
5881
6037
|
return {
|
|
@@ -5890,7 +6046,7 @@ var SymbolBuilder = class {
|
|
|
5890
6046
|
}
|
|
5891
6047
|
}
|
|
5892
6048
|
getSymbolOfPipe(expression) {
|
|
5893
|
-
const methodAccess = findFirstMatchingNode(this.typeCheckBlock, { withSpan: expression.nameSpan, filter:
|
|
6049
|
+
const methodAccess = findFirstMatchingNode(this.typeCheckBlock, { withSpan: expression.nameSpan, filter: ts31.isPropertyAccessExpression });
|
|
5894
6050
|
if (methodAccess === null) {
|
|
5895
6051
|
return null;
|
|
5896
6052
|
}
|
|
@@ -5930,7 +6086,7 @@ var SymbolBuilder = class {
|
|
|
5930
6086
|
}
|
|
5931
6087
|
let node = null;
|
|
5932
6088
|
if (expression instanceof PropertyRead5) {
|
|
5933
|
-
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter:
|
|
6089
|
+
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: ts31.isPropertyAccessExpression });
|
|
5934
6090
|
}
|
|
5935
6091
|
if (node === null) {
|
|
5936
6092
|
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: anyNodeFilter });
|
|
@@ -5938,10 +6094,10 @@ var SymbolBuilder = class {
|
|
|
5938
6094
|
if (node === null) {
|
|
5939
6095
|
return null;
|
|
5940
6096
|
}
|
|
5941
|
-
while (
|
|
6097
|
+
while (ts31.isParenthesizedExpression(node)) {
|
|
5942
6098
|
node = node.expression;
|
|
5943
6099
|
}
|
|
5944
|
-
if (expression instanceof SafePropertyRead4 &&
|
|
6100
|
+
if (expression instanceof SafePropertyRead4 && ts31.isConditionalExpression(node)) {
|
|
5945
6101
|
const whenTrueSymbol = this.getSymbolOfTsNode(node.whenTrue);
|
|
5946
6102
|
if (whenTrueSymbol === null) {
|
|
5947
6103
|
return null;
|
|
@@ -5958,13 +6114,13 @@ var SymbolBuilder = class {
|
|
|
5958
6114
|
}
|
|
5959
6115
|
getSymbolOfTsNode(node) {
|
|
5960
6116
|
var _a;
|
|
5961
|
-
while (
|
|
6117
|
+
while (ts31.isParenthesizedExpression(node)) {
|
|
5962
6118
|
node = node.expression;
|
|
5963
6119
|
}
|
|
5964
6120
|
let tsSymbol;
|
|
5965
|
-
if (
|
|
6121
|
+
if (ts31.isPropertyAccessExpression(node)) {
|
|
5966
6122
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.name);
|
|
5967
|
-
} else if (
|
|
6123
|
+
} else if (ts31.isElementAccessExpression(node)) {
|
|
5968
6124
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.argumentExpression);
|
|
5969
6125
|
} else {
|
|
5970
6126
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node);
|
|
@@ -5982,13 +6138,13 @@ var SymbolBuilder = class {
|
|
|
5982
6138
|
};
|
|
5983
6139
|
}
|
|
5984
6140
|
getTcbPositionForNode(node) {
|
|
5985
|
-
if (
|
|
6141
|
+
if (ts31.isTypeReferenceNode(node)) {
|
|
5986
6142
|
return this.getTcbPositionForNode(node.typeName);
|
|
5987
|
-
} else if (
|
|
6143
|
+
} else if (ts31.isQualifiedName(node)) {
|
|
5988
6144
|
return node.right.getStart();
|
|
5989
|
-
} else if (
|
|
6145
|
+
} else if (ts31.isPropertyAccessExpression(node)) {
|
|
5990
6146
|
return node.name.getStart();
|
|
5991
|
-
} else if (
|
|
6147
|
+
} else if (ts31.isElementAccessExpression(node)) {
|
|
5992
6148
|
return node.argumentExpression.getStart();
|
|
5993
6149
|
} else {
|
|
5994
6150
|
return node.getStart();
|
|
@@ -6759,6 +6915,8 @@ var TemplateVisitor2 = class extends RecursiveAstVisitor3 {
|
|
|
6759
6915
|
}
|
|
6760
6916
|
visitTextAttribute(attribute) {
|
|
6761
6917
|
}
|
|
6918
|
+
visitUnknownBlock(block) {
|
|
6919
|
+
}
|
|
6762
6920
|
visitBoundAttribute(attribute) {
|
|
6763
6921
|
this.visitAst(attribute.value);
|
|
6764
6922
|
}
|
|
@@ -6929,7 +7087,7 @@ var factory3 = {
|
|
|
6929
7087
|
|
|
6930
7088
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.mjs
|
|
6931
7089
|
import { Binary } from "@angular/compiler";
|
|
6932
|
-
import
|
|
7090
|
+
import ts32 from "typescript";
|
|
6933
7091
|
var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
6934
7092
|
constructor() {
|
|
6935
7093
|
super(...arguments);
|
|
@@ -6943,7 +7101,7 @@ var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
6943
7101
|
return [];
|
|
6944
7102
|
}
|
|
6945
7103
|
const typeLeft = symbolLeft.tsType;
|
|
6946
|
-
if (typeLeft.flags & (
|
|
7104
|
+
if (typeLeft.flags & (ts32.TypeFlags.Any | ts32.TypeFlags.Unknown)) {
|
|
6947
7105
|
return [];
|
|
6948
7106
|
}
|
|
6949
7107
|
if (typeLeft.getNonNullableType() !== typeLeft)
|
|
@@ -6974,7 +7132,7 @@ var factory4 = {
|
|
|
6974
7132
|
|
|
6975
7133
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/optional_chain_not_nullable/index.mjs
|
|
6976
7134
|
import { SafeCall as SafeCall2, SafeKeyedRead as SafeKeyedRead2, SafePropertyRead as SafePropertyRead5 } from "@angular/compiler";
|
|
6977
|
-
import
|
|
7135
|
+
import ts33 from "typescript";
|
|
6978
7136
|
var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
6979
7137
|
constructor() {
|
|
6980
7138
|
super(...arguments);
|
|
@@ -6988,7 +7146,7 @@ var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
6988
7146
|
return [];
|
|
6989
7147
|
}
|
|
6990
7148
|
const typeLeft = symbolLeft.tsType;
|
|
6991
|
-
if (typeLeft.flags & (
|
|
7149
|
+
if (typeLeft.flags & (ts33.TypeFlags.Any | ts33.TypeFlags.Unknown)) {
|
|
6992
7150
|
return [];
|
|
6993
7151
|
}
|
|
6994
7152
|
if (typeLeft.getNonNullableType() !== typeLeft)
|
|
@@ -7082,7 +7240,7 @@ var factory7 = {
|
|
|
7082
7240
|
};
|
|
7083
7241
|
|
|
7084
7242
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
|
|
7085
|
-
import
|
|
7243
|
+
import ts34 from "typescript";
|
|
7086
7244
|
|
|
7087
7245
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/api/src/public_options.mjs
|
|
7088
7246
|
var DiagnosticCategoryLabel;
|
|
@@ -7131,9 +7289,9 @@ var ExtendedTemplateCheckerImpl = class {
|
|
|
7131
7289
|
function diagnosticLabelToCategory(label) {
|
|
7132
7290
|
switch (label) {
|
|
7133
7291
|
case DiagnosticCategoryLabel.Warning:
|
|
7134
|
-
return
|
|
7292
|
+
return ts34.DiagnosticCategory.Warning;
|
|
7135
7293
|
case DiagnosticCategoryLabel.Error:
|
|
7136
|
-
return
|
|
7294
|
+
return ts34.DiagnosticCategory.Error;
|
|
7137
7295
|
case DiagnosticCategoryLabel.Suppress:
|
|
7138
7296
|
return null;
|
|
7139
7297
|
default:
|
|
@@ -7246,7 +7404,7 @@ var NgCompiler = class {
|
|
|
7246
7404
|
this.currentProgram = inputProgram;
|
|
7247
7405
|
this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
|
|
7248
7406
|
this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
|
|
7249
|
-
const moduleResolutionCache =
|
|
7407
|
+
const moduleResolutionCache = ts35.createModuleResolutionCache(
|
|
7250
7408
|
this.adapter.getCurrentDirectory(),
|
|
7251
7409
|
this.adapter.getCanonicalFileName.bind(this.adapter)
|
|
7252
7410
|
);
|
|
@@ -7290,7 +7448,7 @@ var NgCompiler = class {
|
|
|
7290
7448
|
}
|
|
7291
7449
|
for (const clazz of classesToUpdate) {
|
|
7292
7450
|
this.compilation.traitCompiler.updateResources(clazz);
|
|
7293
|
-
if (!
|
|
7451
|
+
if (!ts35.isClassDeclaration(clazz)) {
|
|
7294
7452
|
continue;
|
|
7295
7453
|
}
|
|
7296
7454
|
this.compilation.templateTypeChecker.invalidateClass(clazz);
|
|
@@ -7720,8 +7878,11 @@ var NgCompiler = class {
|
|
|
7720
7878
|
if (supportJitMode === false && compilationMode === CompilationMode.PARTIAL) {
|
|
7721
7879
|
throw new Error('JIT mode support ("supportJitMode" option) cannot be disabled in partial compilation mode.');
|
|
7722
7880
|
}
|
|
7881
|
+
if (supportJitMode === false && this.options.forbidOrphanComponents) {
|
|
7882
|
+
throw new Error('JIT mode support ("supportJitMode" option) cannot be disabled when forbidOrphanComponents is set to true');
|
|
7883
|
+
}
|
|
7723
7884
|
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),
|
|
7885
|
+
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
7886
|
new DirectiveDecoratorHandler(reflector, evaluator, metaRegistry, ngModuleScopeRegistry, metaReader, injectableRegistry, refEmitter, referencesRegistry, isCore, strictCtorDeps, semanticDepGraphUpdater, this.closureCompilerEnabled, this.delegatingPerfRecorder, supportTestBed, compilationMode),
|
|
7726
7887
|
new PipeDecoratorHandler(reflector, evaluator, metaRegistry, ngModuleScopeRegistry, injectableRegistry, isCore, this.delegatingPerfRecorder, supportTestBed, compilationMode),
|
|
7727
7888
|
new InjectableDecoratorHandler(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, this.delegatingPerfRecorder, supportTestBed, compilationMode),
|
|
@@ -7757,18 +7918,18 @@ function isAngularCorePackage(program) {
|
|
|
7757
7918
|
return false;
|
|
7758
7919
|
}
|
|
7759
7920
|
return r3Symbols.statements.some((stmt) => {
|
|
7760
|
-
if (!
|
|
7921
|
+
if (!ts35.isVariableStatement(stmt)) {
|
|
7761
7922
|
return false;
|
|
7762
7923
|
}
|
|
7763
|
-
const modifiers =
|
|
7764
|
-
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind ===
|
|
7924
|
+
const modifiers = ts35.getModifiers(stmt);
|
|
7925
|
+
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind === ts35.SyntaxKind.ExportKeyword)) {
|
|
7765
7926
|
return false;
|
|
7766
7927
|
}
|
|
7767
7928
|
return stmt.declarationList.declarations.some((decl) => {
|
|
7768
|
-
if (!
|
|
7929
|
+
if (!ts35.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
|
|
7769
7930
|
return false;
|
|
7770
7931
|
}
|
|
7771
|
-
if (decl.initializer === void 0 || decl.initializer.kind !==
|
|
7932
|
+
if (decl.initializer === void 0 || decl.initializer.kind !== ts35.SyntaxKind.TrueKeyword) {
|
|
7772
7933
|
return false;
|
|
7773
7934
|
}
|
|
7774
7935
|
return true;
|
|
@@ -7782,7 +7943,7 @@ function* verifyCompatibleTypeCheckOptions(options) {
|
|
|
7782
7943
|
var _a, _b, _c;
|
|
7783
7944
|
if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
|
|
7784
7945
|
yield makeConfigDiagnostic({
|
|
7785
|
-
category:
|
|
7946
|
+
category: ts35.DiagnosticCategory.Error,
|
|
7786
7947
|
code: ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK,
|
|
7787
7948
|
messageText: `
|
|
7788
7949
|
Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
|
|
@@ -7801,7 +7962,7 @@ https://angular.io/guide/template-typecheck
|
|
|
7801
7962
|
}
|
|
7802
7963
|
if (options.extendedDiagnostics && options.strictTemplates === false) {
|
|
7803
7964
|
yield makeConfigDiagnostic({
|
|
7804
|
-
category:
|
|
7965
|
+
category: ts35.DiagnosticCategory.Error,
|
|
7805
7966
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES,
|
|
7806
7967
|
messageText: `
|
|
7807
7968
|
Angular compiler option "extendedDiagnostics" is configured, however "strictTemplates" is disabled.
|
|
@@ -7818,7 +7979,7 @@ One of the following actions is required:
|
|
|
7818
7979
|
const defaultCategory = (_a = options.extendedDiagnostics) == null ? void 0 : _a.defaultCategory;
|
|
7819
7980
|
if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
|
|
7820
7981
|
yield makeConfigDiagnostic({
|
|
7821
|
-
category:
|
|
7982
|
+
category: ts35.DiagnosticCategory.Error,
|
|
7822
7983
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
7823
7984
|
messageText: `
|
|
7824
7985
|
Angular compiler option "extendedDiagnostics.defaultCategory" has an unknown diagnostic category: "${defaultCategory}".
|
|
@@ -7832,7 +7993,7 @@ ${allowedCategoryLabels.join("\n")}
|
|
|
7832
7993
|
for (const [checkName, category] of Object.entries((_c = (_b = options.extendedDiagnostics) == null ? void 0 : _b.checks) != null ? _c : {})) {
|
|
7833
7994
|
if (!allExtendedDiagnosticNames.includes(checkName)) {
|
|
7834
7995
|
yield makeConfigDiagnostic({
|
|
7835
|
-
category:
|
|
7996
|
+
category: ts35.DiagnosticCategory.Error,
|
|
7836
7997
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK,
|
|
7837
7998
|
messageText: `
|
|
7838
7999
|
Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${checkName}".
|
|
@@ -7844,7 +8005,7 @@ ${allExtendedDiagnosticNames.join("\n")}
|
|
|
7844
8005
|
}
|
|
7845
8006
|
if (!allowedCategoryLabels.includes(category)) {
|
|
7846
8007
|
yield makeConfigDiagnostic({
|
|
7847
|
-
category:
|
|
8008
|
+
category: ts35.DiagnosticCategory.Error,
|
|
7848
8009
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
7849
8010
|
messageText: `
|
|
7850
8011
|
Angular compiler option "extendedDiagnostics.checks['${checkName}']" has an unknown diagnostic category: "${category}".
|
|
@@ -7874,7 +8035,7 @@ var ReferenceGraphAdapter = class {
|
|
|
7874
8035
|
for (const { node } of references) {
|
|
7875
8036
|
let sourceFile = node.getSourceFile();
|
|
7876
8037
|
if (sourceFile === void 0) {
|
|
7877
|
-
sourceFile =
|
|
8038
|
+
sourceFile = ts35.getOriginalNode(node).getSourceFile();
|
|
7878
8039
|
}
|
|
7879
8040
|
if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
|
|
7880
8041
|
this.graph.add(source, node);
|
|
@@ -7913,7 +8074,7 @@ function versionMapFromProgram(program, driver) {
|
|
|
7913
8074
|
}
|
|
7914
8075
|
|
|
7915
8076
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
|
|
7916
|
-
import
|
|
8077
|
+
import ts36 from "typescript";
|
|
7917
8078
|
var DelegatingCompilerHost2 = class {
|
|
7918
8079
|
constructor(delegate) {
|
|
7919
8080
|
this.delegate = delegate;
|
|
@@ -7992,7 +8153,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
7992
8153
|
entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
|
|
7993
8154
|
if (entryPoint === null) {
|
|
7994
8155
|
diagnostics.push({
|
|
7995
|
-
category:
|
|
8156
|
+
category: ts36.DiagnosticCategory.Error,
|
|
7996
8157
|
code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
|
|
7997
8158
|
file: void 0,
|
|
7998
8159
|
start: void 0,
|
|
@@ -8035,10 +8196,10 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
8035
8196
|
return this.fileNameToModuleName !== void 0 ? this : null;
|
|
8036
8197
|
}
|
|
8037
8198
|
createCachedResolveModuleNamesFunction() {
|
|
8038
|
-
const moduleResolutionCache =
|
|
8199
|
+
const moduleResolutionCache = ts36.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
|
|
8039
8200
|
return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
|
|
8040
8201
|
return moduleNames.map((moduleName) => {
|
|
8041
|
-
const module =
|
|
8202
|
+
const module = ts36.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
|
|
8042
8203
|
return module.resolvedModule;
|
|
8043
8204
|
});
|
|
8044
8205
|
};
|
|
@@ -8062,7 +8223,7 @@ var NgtscProgram = class {
|
|
|
8062
8223
|
if (reuseProgram !== void 0) {
|
|
8063
8224
|
retagAllTsFiles(reuseProgram);
|
|
8064
8225
|
}
|
|
8065
|
-
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () =>
|
|
8226
|
+
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts37.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
|
|
8066
8227
|
perfRecorder.phase(PerfPhase.Unaccounted);
|
|
8067
8228
|
perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
|
|
8068
8229
|
this.host.postProgramCreationCleanup();
|
|
@@ -8278,16 +8439,16 @@ function createProgram({ rootNames, options, host, oldProgram }) {
|
|
|
8278
8439
|
}
|
|
8279
8440
|
|
|
8280
8441
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
8281
|
-
import
|
|
8442
|
+
import ts39 from "typescript";
|
|
8282
8443
|
|
|
8283
8444
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
|
|
8284
|
-
import
|
|
8445
|
+
import ts38 from "typescript";
|
|
8285
8446
|
function createMessageDiagnostic(messageText) {
|
|
8286
8447
|
return {
|
|
8287
8448
|
file: void 0,
|
|
8288
8449
|
start: void 0,
|
|
8289
8450
|
length: void 0,
|
|
8290
|
-
category:
|
|
8451
|
+
category: ts38.DiagnosticCategory.Message,
|
|
8291
8452
|
messageText,
|
|
8292
8453
|
code: DEFAULT_ERROR_CODE,
|
|
8293
8454
|
source: SOURCE
|
|
@@ -8296,13 +8457,13 @@ function createMessageDiagnostic(messageText) {
|
|
|
8296
8457
|
|
|
8297
8458
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
8298
8459
|
var defaultFormatHost = {
|
|
8299
|
-
getCurrentDirectory: () =>
|
|
8460
|
+
getCurrentDirectory: () => ts39.sys.getCurrentDirectory(),
|
|
8300
8461
|
getCanonicalFileName: (fileName) => fileName,
|
|
8301
|
-
getNewLine: () =>
|
|
8462
|
+
getNewLine: () => ts39.sys.newLine
|
|
8302
8463
|
};
|
|
8303
8464
|
function formatDiagnostics(diags, host = defaultFormatHost) {
|
|
8304
8465
|
if (diags && diags.length) {
|
|
8305
|
-
return diags.map((diagnostic) => replaceTsWithNgInErrors(
|
|
8466
|
+
return diags.map((diagnostic) => replaceTsWithNgInErrors(ts39.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
|
|
8306
8467
|
} else {
|
|
8307
8468
|
return "";
|
|
8308
8469
|
}
|
|
@@ -8319,7 +8480,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
8319
8480
|
var _a;
|
|
8320
8481
|
try {
|
|
8321
8482
|
const fs = getFileSystem();
|
|
8322
|
-
const readConfigFile = (configFile) =>
|
|
8483
|
+
const readConfigFile = (configFile) => ts39.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
|
|
8323
8484
|
const readAngularCompilerOptions = (configFile, parentOptions = {}) => {
|
|
8324
8485
|
const { config: config2, error: error2 } = readConfigFile(configFile);
|
|
8325
8486
|
if (error2) {
|
|
@@ -8354,7 +8515,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
8354
8515
|
...existingOptions
|
|
8355
8516
|
};
|
|
8356
8517
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
8357
|
-
const { options, errors, fileNames: rootNames, projectReferences } =
|
|
8518
|
+
const { options, errors, fileNames: rootNames, projectReferences } = ts39.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
|
|
8358
8519
|
let emitFlags = EmitFlags.Default;
|
|
8359
8520
|
if (!(options["skipMetadataEmit"] || options["flatModuleOutFile"])) {
|
|
8360
8521
|
emitFlags |= EmitFlags.Metadata;
|
|
@@ -8365,7 +8526,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
8365
8526
|
return { project: projectFile, rootNames, projectReferences, options, errors, emitFlags };
|
|
8366
8527
|
} catch (e) {
|
|
8367
8528
|
const errors = [{
|
|
8368
|
-
category:
|
|
8529
|
+
category: ts39.DiagnosticCategory.Error,
|
|
8369
8530
|
messageText: (_a = e.stack) != null ? _a : e.message,
|
|
8370
8531
|
file: void 0,
|
|
8371
8532
|
start: void 0,
|
|
@@ -8379,7 +8540,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
8379
8540
|
function createParseConfigHost(host, fs = getFileSystem()) {
|
|
8380
8541
|
return {
|
|
8381
8542
|
fileExists: host.exists.bind(host),
|
|
8382
|
-
readDirectory:
|
|
8543
|
+
readDirectory: ts39.sys.readDirectory,
|
|
8383
8544
|
readFile: host.readFile.bind(host),
|
|
8384
8545
|
useCaseSensitiveFileNames: fs.isCaseSensitive()
|
|
8385
8546
|
};
|
|
@@ -8399,12 +8560,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
8399
8560
|
}
|
|
8400
8561
|
} else {
|
|
8401
8562
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
8402
|
-
const { resolvedModule } =
|
|
8403
|
-
extendsValue,
|
|
8404
|
-
configFile,
|
|
8405
|
-
{ moduleResolution: 2, resolveJsonModule: true },
|
|
8406
|
-
parseConfigHost
|
|
8407
|
-
);
|
|
8563
|
+
const { resolvedModule } = ts39.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts39.ModuleResolutionKind.Node10, resolveJsonModule: true }, parseConfigHost);
|
|
8408
8564
|
if (resolvedModule) {
|
|
8409
8565
|
return absoluteFrom(resolvedModule.resolvedFileName);
|
|
8410
8566
|
}
|
|
@@ -8414,7 +8570,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
8414
8570
|
function exitCodeFromResult(diags) {
|
|
8415
8571
|
if (!diags)
|
|
8416
8572
|
return 0;
|
|
8417
|
-
if (diags.every((diag) => diag.category !==
|
|
8573
|
+
if (diags.every((diag) => diag.category !== ts39.DiagnosticCategory.Error)) {
|
|
8418
8574
|
return 0;
|
|
8419
8575
|
}
|
|
8420
8576
|
return diags.some((d) => d.source === "angular" && d.code === UNKNOWN_ERROR_CODE) ? 2 : 1;
|
|
@@ -8447,7 +8603,7 @@ function performCompilation({ rootNames, options, host, oldProgram, emitCallback
|
|
|
8447
8603
|
} catch (e) {
|
|
8448
8604
|
program = void 0;
|
|
8449
8605
|
allDiagnostics.push({
|
|
8450
|
-
category:
|
|
8606
|
+
category: ts39.DiagnosticCategory.Error,
|
|
8451
8607
|
messageText: (_a = e.stack) != null ? _a : e.message,
|
|
8452
8608
|
code: UNKNOWN_ERROR_CODE,
|
|
8453
8609
|
file: void 0,
|
|
@@ -8474,7 +8630,7 @@ function defaultGatherDiagnostics(program) {
|
|
|
8474
8630
|
return allDiagnostics;
|
|
8475
8631
|
}
|
|
8476
8632
|
function hasErrors(diags) {
|
|
8477
|
-
return diags.some((d) => d.category ===
|
|
8633
|
+
return diags.some((d) => d.category === ts39.DiagnosticCategory.Error);
|
|
8478
8634
|
}
|
|
8479
8635
|
|
|
8480
8636
|
export {
|
|
@@ -8511,4 +8667,4 @@ export {
|
|
|
8511
8667
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8512
8668
|
* found in the LICENSE file at https://angular.io/license
|
|
8513
8669
|
*/
|
|
8514
|
-
//# sourceMappingURL=chunk-
|
|
8670
|
+
//# sourceMappingURL=chunk-Q5XOEMMF.js.map
|