@angular/compiler-cli 17.2.1 → 17.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/{chunk-KYE5EYIK.js → chunk-5BWCY2AS.js} +13 -13
- package/bundles/{chunk-63UQIYTZ.js → chunk-6VI5PEAF.js} +30 -30
- package/bundles/{chunk-UM6JO3VZ.js → chunk-75YFKYUJ.js} +7 -7
- package/bundles/{chunk-KMYUI7UU.js → chunk-FUGV6LEW.js} +562 -525
- package/bundles/chunk-FUGV6LEW.js.map +6 -0
- package/bundles/{chunk-CVK4HV4K.js → chunk-HL2GCSY7.js} +37 -37
- package/bundles/{chunk-6VEEN3ZS.js → chunk-Q5Y7HH3O.js} +5 -5
- package/bundles/{chunk-64JBPJBS.js → chunk-R4KQI5XI.js} +5 -5
- package/bundles/{chunk-QLLRERNV.js → chunk-RMH722TZ.js} +5 -5
- package/bundles/{chunk-LYJKWJUC.js → chunk-SBDNBITT.js} +3 -3
- package/bundles/{chunk-PQBKKYRL.js → chunk-SN7STUDB.js} +81 -80
- package/bundles/{chunk-PQBKKYRL.js.map → chunk-SN7STUDB.js.map} +1 -1
- package/bundles/{chunk-2WQIUGOU.js → chunk-WCD6LVCP.js} +7 -7
- package/bundles/index.js +12 -12
- package/bundles/linker/babel/index.js +12 -12
- package/bundles/linker/index.js +4 -4
- package/bundles/ngcc/index.js +1 -1
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +3 -3
- package/bundles/private/migrations.js +5 -5
- package/bundles/private/tooling.js +5 -5
- package/bundles/src/bin/ng_xi18n.js +10 -10
- package/bundles/src/bin/ngc.js +8 -8
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/docs/src/constant_extractor.d.ts +2 -2
- package/bundles/chunk-KMYUI7UU.js.map +0 -6
- /package/bundles/{chunk-KYE5EYIK.js.map → chunk-5BWCY2AS.js.map} +0 -0
- /package/bundles/{chunk-63UQIYTZ.js.map → chunk-6VI5PEAF.js.map} +0 -0
- /package/bundles/{chunk-UM6JO3VZ.js.map → chunk-75YFKYUJ.js.map} +0 -0
- /package/bundles/{chunk-CVK4HV4K.js.map → chunk-HL2GCSY7.js.map} +0 -0
- /package/bundles/{chunk-6VEEN3ZS.js.map → chunk-Q5Y7HH3O.js.map} +0 -0
- /package/bundles/{chunk-64JBPJBS.js.map → chunk-R4KQI5XI.js.map} +0 -0
- /package/bundles/{chunk-QLLRERNV.js.map → chunk-RMH722TZ.js.map} +0 -0
- /package/bundles/{chunk-LYJKWJUC.js.map → chunk-SBDNBITT.js.map} +0 -0
- /package/bundles/{chunk-2WQIUGOU.js.map → chunk-WCD6LVCP.js.map} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
PotentialImportKind,
|
|
9
9
|
PotentialImportMode,
|
|
10
10
|
SymbolKind
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Q5Y7HH3O.js";
|
|
12
12
|
import {
|
|
13
13
|
CompilationMode,
|
|
14
14
|
ComponentDecoratorHandler,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
declarationTransformFactory,
|
|
40
40
|
isHostDirectiveMetaForGlobalMode,
|
|
41
41
|
ivyTransformFactory
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-SN7STUDB.js";
|
|
43
43
|
import {
|
|
44
44
|
AbsoluteModuleStrategy,
|
|
45
45
|
AliasStrategy,
|
|
@@ -88,14 +88,14 @@ import {
|
|
|
88
88
|
toUnredirectedSourceFile,
|
|
89
89
|
translateExpression,
|
|
90
90
|
translateType
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-HL2GCSY7.js";
|
|
92
92
|
import {
|
|
93
93
|
ActivePerfRecorder,
|
|
94
94
|
DelegatingPerfRecorder,
|
|
95
95
|
PerfCheckpoint,
|
|
96
96
|
PerfEvent,
|
|
97
97
|
PerfPhase
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-R4KQI5XI.js";
|
|
99
99
|
import {
|
|
100
100
|
LogicalFileSystem,
|
|
101
101
|
absoluteFrom,
|
|
@@ -105,9 +105,9 @@ import {
|
|
|
105
105
|
getSourceFileOrError,
|
|
106
106
|
join,
|
|
107
107
|
resolve
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-75YFKYUJ.js";
|
|
109
109
|
|
|
110
|
-
// bazel-out/
|
|
110
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
111
111
|
var DEFAULT_ERROR_CODE = 100;
|
|
112
112
|
var UNKNOWN_ERROR_CODE = 500;
|
|
113
113
|
var SOURCE = "angular";
|
|
@@ -125,7 +125,7 @@ var EmitFlags;
|
|
|
125
125
|
EmitFlags2[EmitFlags2["All"] = 31] = "All";
|
|
126
126
|
})(EmitFlags || (EmitFlags = {}));
|
|
127
127
|
|
|
128
|
-
// bazel-out/
|
|
128
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/compiler_host.mjs
|
|
129
129
|
import ts from "typescript";
|
|
130
130
|
var wrapHostForTest = null;
|
|
131
131
|
function createCompilerHost({ options, tsHost = ts.createCompilerHost(options, true) }) {
|
|
@@ -135,7 +135,7 @@ function createCompilerHost({ options, tsHost = ts.createCompilerHost(options, t
|
|
|
135
135
|
return tsHost;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
// bazel-out/
|
|
138
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/entities.mjs
|
|
139
139
|
var EntryType;
|
|
140
140
|
(function(EntryType2) {
|
|
141
141
|
EntryType2["Block"] = "block";
|
|
@@ -178,11 +178,11 @@ var MemberTags;
|
|
|
178
178
|
MemberTags2["Inherited"] = "override";
|
|
179
179
|
})(MemberTags || (MemberTags = {}));
|
|
180
180
|
|
|
181
|
-
// bazel-out/
|
|
181
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
182
182
|
import { HtmlParser, MessageBundle } from "@angular/compiler";
|
|
183
|
-
import
|
|
183
|
+
import ts38 from "typescript";
|
|
184
184
|
|
|
185
|
-
// bazel-out/
|
|
185
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
|
|
186
186
|
import { Xliff, Xliff2, Xmb } from "@angular/compiler";
|
|
187
187
|
import * as path from "path";
|
|
188
188
|
function i18nGetExtension(formatName) {
|
|
@@ -233,10 +233,10 @@ function getPathNormalizer(basePath) {
|
|
|
233
233
|
};
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
// bazel-out/
|
|
236
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
|
|
237
237
|
import ts2 from "typescript";
|
|
238
238
|
|
|
239
|
-
// bazel-out/
|
|
239
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/version_helpers.mjs
|
|
240
240
|
function toNumbers(value) {
|
|
241
241
|
const suffixIndex = value.lastIndexOf("-");
|
|
242
242
|
return value.slice(0, suffixIndex === -1 ? value.length : suffixIndex).split(".").map((segment) => {
|
|
@@ -271,7 +271,7 @@ function compareVersions(v1, v2) {
|
|
|
271
271
|
return compareNumbers(toNumbers(v1), toNumbers(v2));
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
// bazel-out/
|
|
274
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
|
|
275
275
|
var MIN_TS_VERSION = "5.2.0";
|
|
276
276
|
var MAX_TS_VERSION = "5.4.0";
|
|
277
277
|
var tsVersion = ts2.version;
|
|
@@ -284,10 +284,10 @@ function verifySupportedTypeScriptVersion() {
|
|
|
284
284
|
checkVersion(tsVersion, MIN_TS_VERSION, MAX_TS_VERSION);
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
// bazel-out/
|
|
288
|
-
import
|
|
287
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
288
|
+
import ts36 from "typescript";
|
|
289
289
|
|
|
290
|
-
// bazel-out/
|
|
290
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
|
|
291
291
|
var CycleAnalyzer = class {
|
|
292
292
|
constructor(importGraph) {
|
|
293
293
|
this.importGraph = importGraph;
|
|
@@ -358,7 +358,7 @@ var Cycle = class {
|
|
|
358
358
|
}
|
|
359
359
|
};
|
|
360
360
|
|
|
361
|
-
// bazel-out/
|
|
361
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/imports.mjs
|
|
362
362
|
import ts3 from "typescript";
|
|
363
363
|
var ImportGraph = class {
|
|
364
364
|
constructor(checker, perf) {
|
|
@@ -450,23 +450,23 @@ var Found = class {
|
|
|
450
450
|
}
|
|
451
451
|
};
|
|
452
452
|
|
|
453
|
-
// bazel-out/
|
|
454
|
-
import
|
|
453
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/extractor.mjs
|
|
454
|
+
import ts10 from "typescript";
|
|
455
455
|
|
|
456
|
-
// bazel-out/
|
|
456
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/class_extractor.mjs
|
|
457
457
|
import ts6 from "typescript";
|
|
458
458
|
|
|
459
|
-
// bazel-out/
|
|
459
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/filters.mjs
|
|
460
460
|
function isAngularPrivateName(name) {
|
|
461
461
|
var _a;
|
|
462
462
|
const firstChar = (_a = name[0]) != null ? _a : "";
|
|
463
463
|
return firstChar === "\u0275" || firstChar === "_";
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
-
// bazel-out/
|
|
466
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/function_extractor.mjs
|
|
467
467
|
import ts5 from "typescript";
|
|
468
468
|
|
|
469
|
-
// bazel-out/
|
|
469
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/generics_extractor.mjs
|
|
470
470
|
function extractGenerics(declaration) {
|
|
471
471
|
var _a, _b;
|
|
472
472
|
return (_b = (_a = declaration.typeParameters) == null ? void 0 : _a.map((typeParam) => {
|
|
@@ -479,7 +479,7 @@ function extractGenerics(declaration) {
|
|
|
479
479
|
})) != null ? _b : [];
|
|
480
480
|
}
|
|
481
481
|
|
|
482
|
-
// bazel-out/
|
|
482
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/jsdoc_extractor.mjs
|
|
483
483
|
import ts4 from "typescript";
|
|
484
484
|
var decoratorExpression = /@(?=(Injectable|Component|Directive|Pipe|NgModule|Input|Output|HostBinding|HostListener|Inject|Optional|Self|Host|SkipSelf))/g;
|
|
485
485
|
function extractJsDocTags(node) {
|
|
@@ -523,12 +523,12 @@ function unescapeAngularDecorators(comment) {
|
|
|
523
523
|
return comment.replace(/_NG_AT_/g, "@");
|
|
524
524
|
}
|
|
525
525
|
|
|
526
|
-
// bazel-out/
|
|
526
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/type_extractor.mjs
|
|
527
527
|
function extractResolvedTypeString(node, checker) {
|
|
528
528
|
return checker.typeToString(checker.getTypeAtLocation(node));
|
|
529
529
|
}
|
|
530
530
|
|
|
531
|
-
// bazel-out/
|
|
531
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/function_extractor.mjs
|
|
532
532
|
var FunctionExtractor = class {
|
|
533
533
|
constructor(name, declaration, typeChecker) {
|
|
534
534
|
this.name = name;
|
|
@@ -584,7 +584,7 @@ var FunctionExtractor = class {
|
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
586
|
|
|
587
|
-
// bazel-out/
|
|
587
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/class_extractor.mjs
|
|
588
588
|
var ClassExtractor = class {
|
|
589
589
|
constructor(declaration, typeChecker) {
|
|
590
590
|
this.declaration = declaration;
|
|
@@ -845,26 +845,63 @@ function extractInterface(declaration, typeChecker) {
|
|
|
845
845
|
return extractor.extract();
|
|
846
846
|
}
|
|
847
847
|
|
|
848
|
-
// bazel-out/
|
|
848
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/constant_extractor.mjs
|
|
849
|
+
import ts7 from "typescript";
|
|
850
|
+
var LITERAL_AS_ENUM_TAG = "object-literal-as-enum";
|
|
849
851
|
function extractConstant(declaration, typeChecker) {
|
|
850
852
|
const resolvedType = typeChecker.getBaseTypeOfLiteralType(typeChecker.getTypeAtLocation(declaration));
|
|
851
|
-
const variableStatement = declaration.parent.parent;
|
|
852
853
|
const rawComment = extractRawJsDoc(declaration.parent.parent);
|
|
854
|
+
const jsdocTags = extractJsDocTags(declaration);
|
|
855
|
+
const description = extractJsDocDescription(declaration);
|
|
856
|
+
const name = declaration.name.getText();
|
|
857
|
+
if (jsdocTags.some((tag) => tag.name === LITERAL_AS_ENUM_TAG)) {
|
|
858
|
+
return {
|
|
859
|
+
name,
|
|
860
|
+
entryType: EntryType.Enum,
|
|
861
|
+
members: extractLiteralPropertiesAsEnumMembers(declaration),
|
|
862
|
+
rawComment,
|
|
863
|
+
description,
|
|
864
|
+
jsdocTags: jsdocTags.filter((tag) => tag.name !== LITERAL_AS_ENUM_TAG)
|
|
865
|
+
};
|
|
866
|
+
}
|
|
853
867
|
return {
|
|
854
|
-
name
|
|
868
|
+
name,
|
|
855
869
|
type: typeChecker.typeToString(resolvedType),
|
|
856
870
|
entryType: EntryType.Constant,
|
|
857
871
|
rawComment,
|
|
858
|
-
description
|
|
859
|
-
jsdocTags
|
|
872
|
+
description,
|
|
873
|
+
jsdocTags
|
|
860
874
|
};
|
|
861
875
|
}
|
|
862
876
|
function isSyntheticAngularConstant(declaration) {
|
|
863
877
|
return declaration.name.getText() === "USED_FOR_NG_TYPE_CHECKING";
|
|
864
878
|
}
|
|
879
|
+
function extractLiteralPropertiesAsEnumMembers(declaration) {
|
|
880
|
+
const initializer = declaration.initializer;
|
|
881
|
+
if (initializer === void 0 || !ts7.isObjectLiteralExpression(initializer)) {
|
|
882
|
+
throw new Error(`Declaration tagged with "${LITERAL_AS_ENUM_TAG}" must be initialized to an object literal`);
|
|
883
|
+
}
|
|
884
|
+
return initializer.properties.map((prop) => {
|
|
885
|
+
if (!ts7.isPropertyAssignment(prop) || !ts7.isIdentifier(prop.name)) {
|
|
886
|
+
throw new Error(`Property in declaration tagged with "${LITERAL_AS_ENUM_TAG}" must be a property assignment with a static name`);
|
|
887
|
+
}
|
|
888
|
+
if (!ts7.isNumericLiteral(prop.initializer) && !ts7.isStringLiteralLike(prop.initializer)) {
|
|
889
|
+
throw new Error(`Property in declaration tagged with "${LITERAL_AS_ENUM_TAG}" must be initialized to a number or string literal`);
|
|
890
|
+
}
|
|
891
|
+
return {
|
|
892
|
+
name: prop.name.text,
|
|
893
|
+
type: `${declaration.name.getText()}.${prop.name.text}`,
|
|
894
|
+
value: prop.initializer.getText(),
|
|
895
|
+
memberType: MemberType.EnumItem,
|
|
896
|
+
jsdocTags: extractJsDocTags(prop),
|
|
897
|
+
description: extractJsDocDescription(prop),
|
|
898
|
+
memberTags: []
|
|
899
|
+
};
|
|
900
|
+
});
|
|
901
|
+
}
|
|
865
902
|
|
|
866
|
-
// bazel-out/
|
|
867
|
-
import
|
|
903
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/decorator_extractor.mjs
|
|
904
|
+
import ts8 from "typescript";
|
|
868
905
|
function extractorDecorator(declaration, typeChecker) {
|
|
869
906
|
const documentedNode = getDecoratorJsDocNode(declaration);
|
|
870
907
|
const decoratorType = getDecoratorType(declaration);
|
|
@@ -885,7 +922,7 @@ function isDecoratorDeclaration(declaration) {
|
|
|
885
922
|
return !!getDecoratorType(declaration);
|
|
886
923
|
}
|
|
887
924
|
function isDecoratorOptionsInterface(declaration) {
|
|
888
|
-
return declaration.getSourceFile().statements.some((s) =>
|
|
925
|
+
return declaration.getSourceFile().statements.some((s) => ts8.isVariableStatement(s) && s.declarationList.declarations.some((d) => isDecoratorDeclaration(d) && d.name.getText() === declaration.name.getText()));
|
|
889
926
|
}
|
|
890
927
|
function getDecoratorType(declaration) {
|
|
891
928
|
var _a, _b;
|
|
@@ -902,19 +939,19 @@ function getDecoratorOptions(declaration, typeChecker) {
|
|
|
902
939
|
var _a, _b;
|
|
903
940
|
const name = declaration.name.getText();
|
|
904
941
|
const optionsDeclaration = declaration.getSourceFile().statements.find((node) => {
|
|
905
|
-
return (
|
|
942
|
+
return (ts8.isInterfaceDeclaration(node) || ts8.isTypeAliasDeclaration(node)) && node.name.getText() === name;
|
|
906
943
|
});
|
|
907
944
|
if (!optionsDeclaration) {
|
|
908
945
|
throw new Error(`Decorator "${name}" has no corresponding options interface.`);
|
|
909
946
|
}
|
|
910
947
|
let optionsInterface;
|
|
911
|
-
if (
|
|
948
|
+
if (ts8.isTypeAliasDeclaration(optionsDeclaration)) {
|
|
912
949
|
const aliasedType = typeChecker.getTypeAtLocation(optionsDeclaration.type);
|
|
913
|
-
optionsInterface = ((_b = (_a = aliasedType.getSymbol()) == null ? void 0 : _a.getDeclarations()) != null ? _b : []).find((d) =>
|
|
950
|
+
optionsInterface = ((_b = (_a = aliasedType.getSymbol()) == null ? void 0 : _a.getDeclarations()) != null ? _b : []).find((d) => ts8.isInterfaceDeclaration(d));
|
|
914
951
|
} else {
|
|
915
952
|
optionsInterface = optionsDeclaration;
|
|
916
953
|
}
|
|
917
|
-
if (!optionsInterface || !
|
|
954
|
+
if (!optionsInterface || !ts8.isInterfaceDeclaration(optionsInterface)) {
|
|
918
955
|
throw new Error(`Options for decorator "${name}" is not an interface.`);
|
|
919
956
|
}
|
|
920
957
|
return extractInterface(optionsInterface, typeChecker).members;
|
|
@@ -922,22 +959,22 @@ function getDecoratorOptions(declaration, typeChecker) {
|
|
|
922
959
|
function getDecoratorJsDocNode(declaration) {
|
|
923
960
|
const name = declaration.name.getText();
|
|
924
961
|
const decoratorInterface = declaration.getSourceFile().statements.find((s) => {
|
|
925
|
-
return
|
|
962
|
+
return ts8.isInterfaceDeclaration(s) && s.name.getText() === `${name}Decorator`;
|
|
926
963
|
});
|
|
927
|
-
if (!decoratorInterface || !
|
|
964
|
+
if (!decoratorInterface || !ts8.isInterfaceDeclaration(decoratorInterface)) {
|
|
928
965
|
throw new Error(`No interface "${name}Decorator" found.`);
|
|
929
966
|
}
|
|
930
967
|
const callSignature = decoratorInterface.members.find((node) => {
|
|
931
|
-
return
|
|
968
|
+
return ts8.isCallSignatureDeclaration(node) && extractRawJsDoc(node);
|
|
932
969
|
});
|
|
933
|
-
if (!callSignature || !
|
|
970
|
+
if (!callSignature || !ts8.isCallSignatureDeclaration(callSignature)) {
|
|
934
971
|
throw new Error(`No call signature with JsDoc on "${name}Decorator"`);
|
|
935
972
|
}
|
|
936
973
|
return callSignature;
|
|
937
974
|
}
|
|
938
975
|
|
|
939
|
-
// bazel-out/
|
|
940
|
-
import
|
|
976
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/enum_extractor.mjs
|
|
977
|
+
import ts9 from "typescript";
|
|
941
978
|
function extractEnum(declaration, typeChecker) {
|
|
942
979
|
return {
|
|
943
980
|
name: declaration.name.getText(),
|
|
@@ -962,12 +999,12 @@ function extractEnumMembers(declaration, checker) {
|
|
|
962
999
|
function getEnumMemberValue(memberNode) {
|
|
963
1000
|
var _a;
|
|
964
1001
|
const literal = memberNode.getChildren().find((n) => {
|
|
965
|
-
return
|
|
1002
|
+
return ts9.isNumericLiteral(n) || ts9.isStringLiteral(n) || ts9.isPrefixUnaryExpression(n) && n.operator === ts9.SyntaxKind.MinusToken && ts9.isNumericLiteral(n.operand);
|
|
966
1003
|
});
|
|
967
1004
|
return (_a = literal == null ? void 0 : literal.getText()) != null ? _a : "";
|
|
968
1005
|
}
|
|
969
1006
|
|
|
970
|
-
// bazel-out/
|
|
1007
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/type_alias_extractor.mjs
|
|
971
1008
|
function extractTypeAlias(declaration) {
|
|
972
1009
|
return {
|
|
973
1010
|
name: declaration.name.getText(),
|
|
@@ -979,7 +1016,7 @@ function extractTypeAlias(declaration) {
|
|
|
979
1016
|
};
|
|
980
1017
|
}
|
|
981
1018
|
|
|
982
|
-
// bazel-out/
|
|
1019
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/extractor.mjs
|
|
983
1020
|
var DocsExtractor = class {
|
|
984
1021
|
constructor(typeChecker, metadataReader) {
|
|
985
1022
|
this.typeChecker = typeChecker;
|
|
@@ -1002,20 +1039,20 @@ var DocsExtractor = class {
|
|
|
1002
1039
|
if (isNamedClassDeclaration(node)) {
|
|
1003
1040
|
return extractClass(node, this.metadataReader, this.typeChecker);
|
|
1004
1041
|
}
|
|
1005
|
-
if (
|
|
1042
|
+
if (ts10.isInterfaceDeclaration(node) && !isIgnoredInterface(node)) {
|
|
1006
1043
|
return extractInterface(node, this.typeChecker);
|
|
1007
1044
|
}
|
|
1008
|
-
if (
|
|
1045
|
+
if (ts10.isFunctionDeclaration(node)) {
|
|
1009
1046
|
const functionExtractor = new FunctionExtractor(node.name.getText(), node, this.typeChecker);
|
|
1010
1047
|
return functionExtractor.extract();
|
|
1011
1048
|
}
|
|
1012
|
-
if (
|
|
1049
|
+
if (ts10.isVariableDeclaration(node) && !isSyntheticAngularConstant(node)) {
|
|
1013
1050
|
return isDecoratorDeclaration(node) ? extractorDecorator(node, this.typeChecker) : extractConstant(node, this.typeChecker);
|
|
1014
1051
|
}
|
|
1015
|
-
if (
|
|
1052
|
+
if (ts10.isTypeAliasDeclaration(node)) {
|
|
1016
1053
|
return extractTypeAlias(node);
|
|
1017
1054
|
}
|
|
1018
|
-
if (
|
|
1055
|
+
if (ts10.isEnumDeclaration(node)) {
|
|
1019
1056
|
return extractEnum(node, this.typeChecker);
|
|
1020
1057
|
}
|
|
1021
1058
|
return null;
|
|
@@ -1028,7 +1065,7 @@ var DocsExtractor = class {
|
|
|
1028
1065
|
const declarationCount = exportedDeclarations.length;
|
|
1029
1066
|
for (let i = 0; i < declarationCount; i++) {
|
|
1030
1067
|
const [exportName, declaration] = exportedDeclarations[i];
|
|
1031
|
-
if (
|
|
1068
|
+
if (ts10.isFunctionDeclaration(declaration)) {
|
|
1032
1069
|
const extractor = new FunctionExtractor(exportName, declaration, this.typeChecker);
|
|
1033
1070
|
const overloads = extractor.getOverloads().map((overload) => [exportName, overload]);
|
|
1034
1071
|
exportedDeclarations.push(...overloads);
|
|
@@ -1041,8 +1078,8 @@ function isIgnoredInterface(node) {
|
|
|
1041
1078
|
return node.name.getText().endsWith("Decorator") || isDecoratorOptionsInterface(node);
|
|
1042
1079
|
}
|
|
1043
1080
|
|
|
1044
|
-
// bazel-out/
|
|
1045
|
-
import
|
|
1081
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/generator.mjs
|
|
1082
|
+
import ts11 from "typescript";
|
|
1046
1083
|
var FlatIndexGenerator = class {
|
|
1047
1084
|
constructor(entryPoint, relativeFlatIndexPath, moduleName) {
|
|
1048
1085
|
this.entryPoint = entryPoint;
|
|
@@ -1058,7 +1095,7 @@ var FlatIndexGenerator = class {
|
|
|
1058
1095
|
|
|
1059
1096
|
export * from '${relativeEntryPoint}';
|
|
1060
1097
|
`;
|
|
1061
|
-
const genFile =
|
|
1098
|
+
const genFile = ts11.createSourceFile(this.flatIndexPath, contents, ts11.ScriptTarget.ES2015, true, ts11.ScriptKind.TS);
|
|
1062
1099
|
if (this.moduleName !== null) {
|
|
1063
1100
|
genFile.moduleName = this.moduleName;
|
|
1064
1101
|
}
|
|
@@ -1066,7 +1103,7 @@ export * from '${relativeEntryPoint}';
|
|
|
1066
1103
|
}
|
|
1067
1104
|
};
|
|
1068
1105
|
|
|
1069
|
-
// bazel-out/
|
|
1106
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/logic.mjs
|
|
1070
1107
|
function findFlatIndexEntryPoint(rootFiles) {
|
|
1071
1108
|
const tsFiles = rootFiles.filter((file) => isNonDeclarationTsPath(file));
|
|
1072
1109
|
let resolvedEntryPoint = null;
|
|
@@ -1082,8 +1119,8 @@ function findFlatIndexEntryPoint(rootFiles) {
|
|
|
1082
1119
|
return resolvedEntryPoint;
|
|
1083
1120
|
}
|
|
1084
1121
|
|
|
1085
|
-
// bazel-out/
|
|
1086
|
-
import
|
|
1122
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/private_export_checker.mjs
|
|
1123
|
+
import ts12 from "typescript";
|
|
1087
1124
|
function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
1088
1125
|
const diagnostics = [];
|
|
1089
1126
|
const topLevelExports = /* @__PURE__ */ new Set();
|
|
@@ -1093,7 +1130,7 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
|
1093
1130
|
}
|
|
1094
1131
|
const exportedSymbols = checker.getExportsOfModule(moduleSymbol);
|
|
1095
1132
|
exportedSymbols.forEach((symbol) => {
|
|
1096
|
-
if (symbol.flags &
|
|
1133
|
+
if (symbol.flags & ts12.SymbolFlags.Alias) {
|
|
1097
1134
|
symbol = checker.getAliasedSymbol(symbol);
|
|
1098
1135
|
}
|
|
1099
1136
|
const decl = symbol.valueDeclaration;
|
|
@@ -1117,7 +1154,7 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
|
1117
1154
|
visibleVia = transitivePath.map((seg) => getNameOfDeclaration(seg)).join(" -> ");
|
|
1118
1155
|
}
|
|
1119
1156
|
const diagnostic = {
|
|
1120
|
-
category:
|
|
1157
|
+
category: ts12.DiagnosticCategory.Error,
|
|
1121
1158
|
code: ngErrorCode(ErrorCode.SYMBOL_NOT_EXPORTED),
|
|
1122
1159
|
file: transitiveReference.getSourceFile(),
|
|
1123
1160
|
...getPosOfDeclaration(transitiveReference),
|
|
@@ -1137,7 +1174,7 @@ function getPosOfDeclaration(decl) {
|
|
|
1137
1174
|
};
|
|
1138
1175
|
}
|
|
1139
1176
|
function getIdentifierOfDeclaration(decl) {
|
|
1140
|
-
if ((
|
|
1177
|
+
if ((ts12.isClassDeclaration(decl) || ts12.isVariableDeclaration(decl) || ts12.isFunctionDeclaration(decl)) && decl.name !== void 0 && ts12.isIdentifier(decl.name)) {
|
|
1141
1178
|
return decl.name;
|
|
1142
1179
|
} else {
|
|
1143
1180
|
return null;
|
|
@@ -1149,20 +1186,20 @@ function getNameOfDeclaration(decl) {
|
|
|
1149
1186
|
}
|
|
1150
1187
|
function getDescriptorOfDeclaration(decl) {
|
|
1151
1188
|
switch (decl.kind) {
|
|
1152
|
-
case
|
|
1189
|
+
case ts12.SyntaxKind.ClassDeclaration:
|
|
1153
1190
|
return "class";
|
|
1154
|
-
case
|
|
1191
|
+
case ts12.SyntaxKind.FunctionDeclaration:
|
|
1155
1192
|
return "function";
|
|
1156
|
-
case
|
|
1193
|
+
case ts12.SyntaxKind.VariableDeclaration:
|
|
1157
1194
|
return "variable";
|
|
1158
|
-
case
|
|
1195
|
+
case ts12.SyntaxKind.EnumDeclaration:
|
|
1159
1196
|
return "enum";
|
|
1160
1197
|
default:
|
|
1161
1198
|
return "declaration";
|
|
1162
1199
|
}
|
|
1163
1200
|
}
|
|
1164
1201
|
|
|
1165
|
-
// bazel-out/
|
|
1202
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/reference_graph.mjs
|
|
1166
1203
|
var ReferenceGraph = class {
|
|
1167
1204
|
constructor() {
|
|
1168
1205
|
this.references = /* @__PURE__ */ new Map();
|
|
@@ -1216,7 +1253,7 @@ var ReferenceGraph = class {
|
|
|
1216
1253
|
}
|
|
1217
1254
|
};
|
|
1218
1255
|
|
|
1219
|
-
// bazel-out/
|
|
1256
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/api.mjs
|
|
1220
1257
|
var NgOriginalFile = Symbol("NgOriginalFile");
|
|
1221
1258
|
var UpdateMode;
|
|
1222
1259
|
(function(UpdateMode2) {
|
|
@@ -1224,13 +1261,13 @@ var UpdateMode;
|
|
|
1224
1261
|
UpdateMode2[UpdateMode2["Incremental"] = 1] = "Incremental";
|
|
1225
1262
|
})(UpdateMode || (UpdateMode = {}));
|
|
1226
1263
|
|
|
1227
|
-
// bazel-out/
|
|
1228
|
-
import
|
|
1264
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
1265
|
+
import ts14 from "typescript";
|
|
1229
1266
|
|
|
1230
|
-
// bazel-out/
|
|
1231
|
-
import
|
|
1267
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
1268
|
+
import ts13 from "typescript";
|
|
1232
1269
|
|
|
1233
|
-
// bazel-out/
|
|
1270
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/expando.mjs
|
|
1234
1271
|
var NgExtension = Symbol("NgExtension");
|
|
1235
1272
|
function isExtended(sf) {
|
|
1236
1273
|
return sf[NgExtension] !== void 0;
|
|
@@ -1290,13 +1327,13 @@ function retagTsFile(sf) {
|
|
|
1290
1327
|
}
|
|
1291
1328
|
}
|
|
1292
1329
|
|
|
1293
|
-
// bazel-out/
|
|
1330
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/util.mjs
|
|
1294
1331
|
var TS_EXTENSIONS = /\.tsx?$/i;
|
|
1295
1332
|
function makeShimFileName(fileName, suffix) {
|
|
1296
1333
|
return absoluteFrom(fileName.replace(TS_EXTENSIONS, suffix));
|
|
1297
1334
|
}
|
|
1298
1335
|
|
|
1299
|
-
// bazel-out/
|
|
1336
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
1300
1337
|
var ShimAdapter = class {
|
|
1301
1338
|
constructor(delegate, tsRootFiles, topLevelGenerators, perFileGenerators, oldProgram) {
|
|
1302
1339
|
this.delegate = delegate;
|
|
@@ -1359,10 +1396,10 @@ var ShimAdapter = class {
|
|
|
1359
1396
|
}
|
|
1360
1397
|
const prefix = match[1];
|
|
1361
1398
|
let baseFileName = absoluteFrom(prefix + ".ts");
|
|
1362
|
-
let inputFile = this.delegate.getSourceFile(baseFileName,
|
|
1399
|
+
let inputFile = this.delegate.getSourceFile(baseFileName, ts13.ScriptTarget.Latest);
|
|
1363
1400
|
if (inputFile === void 0) {
|
|
1364
1401
|
baseFileName = absoluteFrom(prefix + ".tsx");
|
|
1365
|
-
inputFile = this.delegate.getSourceFile(baseFileName,
|
|
1402
|
+
inputFile = this.delegate.getSourceFile(baseFileName, ts13.ScriptTarget.Latest);
|
|
1366
1403
|
}
|
|
1367
1404
|
if (inputFile === void 0 || isShim(inputFile)) {
|
|
1368
1405
|
return void 0;
|
|
@@ -1391,7 +1428,7 @@ var ShimAdapter = class {
|
|
|
1391
1428
|
}
|
|
1392
1429
|
};
|
|
1393
1430
|
|
|
1394
|
-
// bazel-out/
|
|
1431
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/reference_tagger.mjs
|
|
1395
1432
|
var ShimReferenceTagger = class {
|
|
1396
1433
|
constructor(shimExtensions) {
|
|
1397
1434
|
this.tagged = /* @__PURE__ */ new Set();
|
|
@@ -1425,7 +1462,7 @@ var ShimReferenceTagger = class {
|
|
|
1425
1462
|
}
|
|
1426
1463
|
};
|
|
1427
1464
|
|
|
1428
|
-
// bazel-out/
|
|
1465
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
1429
1466
|
var DelegatingCompilerHost = class {
|
|
1430
1467
|
get jsDocParsingMode() {
|
|
1431
1468
|
return this.delegate.jsDocParsingMode;
|
|
@@ -1523,7 +1560,7 @@ var TsCreateProgramDriver = class {
|
|
|
1523
1560
|
this.sfMap.clear();
|
|
1524
1561
|
}
|
|
1525
1562
|
for (const [filePath, { newText, originalFile }] of contents.entries()) {
|
|
1526
|
-
const sf =
|
|
1563
|
+
const sf = ts14.createSourceFile(filePath, newText, ts14.ScriptTarget.Latest, true);
|
|
1527
1564
|
if (originalFile !== null) {
|
|
1528
1565
|
sf[NgOriginalFile] = originalFile;
|
|
1529
1566
|
}
|
|
@@ -1532,7 +1569,7 @@ var TsCreateProgramDriver = class {
|
|
|
1532
1569
|
const host = new UpdatedProgramHost(this.sfMap, this.originalProgram, this.originalHost, this.shimExtensionPrefixes);
|
|
1533
1570
|
const oldProgram = this.program;
|
|
1534
1571
|
retagAllTsFiles(oldProgram);
|
|
1535
|
-
this.program =
|
|
1572
|
+
this.program = ts14.createProgram({
|
|
1536
1573
|
host,
|
|
1537
1574
|
rootNames: this.program.getRootFileNames(),
|
|
1538
1575
|
options: this.options,
|
|
@@ -1544,7 +1581,7 @@ var TsCreateProgramDriver = class {
|
|
|
1544
1581
|
}
|
|
1545
1582
|
};
|
|
1546
1583
|
|
|
1547
|
-
// bazel-out/
|
|
1584
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/dependency_tracking.mjs
|
|
1548
1585
|
var FileDependencyGraph = class {
|
|
1549
1586
|
constructor() {
|
|
1550
1587
|
this.nodes = /* @__PURE__ */ new Map();
|
|
@@ -1611,7 +1648,7 @@ function isLogicallyChanged(sf, node, changedTsPaths, deletedTsPaths, changedRes
|
|
|
1611
1648
|
return false;
|
|
1612
1649
|
}
|
|
1613
1650
|
|
|
1614
|
-
// bazel-out/
|
|
1651
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/state.mjs
|
|
1615
1652
|
var IncrementalStateKind;
|
|
1616
1653
|
(function(IncrementalStateKind2) {
|
|
1617
1654
|
IncrementalStateKind2[IncrementalStateKind2["Fresh"] = 0] = "Fresh";
|
|
@@ -1619,7 +1656,7 @@ var IncrementalStateKind;
|
|
|
1619
1656
|
IncrementalStateKind2[IncrementalStateKind2["Analyzed"] = 2] = "Analyzed";
|
|
1620
1657
|
})(IncrementalStateKind || (IncrementalStateKind = {}));
|
|
1621
1658
|
|
|
1622
|
-
// bazel-out/
|
|
1659
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/incremental.mjs
|
|
1623
1660
|
var PhaseKind;
|
|
1624
1661
|
(function(PhaseKind2) {
|
|
1625
1662
|
PhaseKind2[PhaseKind2["Analysis"] = 0] = "Analysis";
|
|
@@ -1820,7 +1857,7 @@ function toOriginalSourceFile(sf) {
|
|
|
1820
1857
|
}
|
|
1821
1858
|
}
|
|
1822
1859
|
|
|
1823
|
-
// bazel-out/
|
|
1860
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/strategy.mjs
|
|
1824
1861
|
var TrackedIncrementalBuildStrategy = class {
|
|
1825
1862
|
constructor() {
|
|
1826
1863
|
this.state = null;
|
|
@@ -1856,7 +1893,7 @@ var PatchedProgramIncrementalBuildStrategy = class {
|
|
|
1856
1893
|
};
|
|
1857
1894
|
var SYM_INCREMENTAL_STATE = Symbol("NgIncrementalState");
|
|
1858
1895
|
|
|
1859
|
-
// bazel-out/
|
|
1896
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/api.mjs
|
|
1860
1897
|
var IdentifierKind;
|
|
1861
1898
|
(function(IdentifierKind2) {
|
|
1862
1899
|
IdentifierKind2[IdentifierKind2["Property"] = 0] = "Property";
|
|
@@ -1874,7 +1911,7 @@ var AbsoluteSourceSpan = class {
|
|
|
1874
1911
|
}
|
|
1875
1912
|
};
|
|
1876
1913
|
|
|
1877
|
-
// bazel-out/
|
|
1914
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/context.mjs
|
|
1878
1915
|
var IndexingContext = class {
|
|
1879
1916
|
constructor() {
|
|
1880
1917
|
this.components = /* @__PURE__ */ new Set();
|
|
@@ -1884,10 +1921,10 @@ var IndexingContext = class {
|
|
|
1884
1921
|
}
|
|
1885
1922
|
};
|
|
1886
1923
|
|
|
1887
|
-
// bazel-out/
|
|
1924
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/transform.mjs
|
|
1888
1925
|
import { ParseSourceFile } from "@angular/compiler";
|
|
1889
1926
|
|
|
1890
|
-
// bazel-out/
|
|
1927
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/template.mjs
|
|
1891
1928
|
import { ASTWithSource, ImplicitReceiver, PropertyRead, PropertyWrite, RecursiveAstVisitor, TmplAstBoundDeferredTrigger, TmplAstElement, TmplAstRecursiveVisitor, TmplAstReference, TmplAstTemplate } from "@angular/compiler";
|
|
1892
1929
|
var ExpressionVisitor = class extends RecursiveAstVisitor {
|
|
1893
1930
|
constructor(expressionStr, absoluteOffset, boundTemplate, targetToIdentifier) {
|
|
@@ -2169,7 +2206,7 @@ function getTemplateIdentifiers(boundTemplate) {
|
|
|
2169
2206
|
return { identifiers: visitor.identifiers, errors: visitor.errors };
|
|
2170
2207
|
}
|
|
2171
2208
|
|
|
2172
|
-
// bazel-out/
|
|
2209
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/transform.mjs
|
|
2173
2210
|
function generateAnalysis(context) {
|
|
2174
2211
|
const analysis = /* @__PURE__ */ new Map();
|
|
2175
2212
|
context.components.forEach(({ declaration, selector, boundTemplate, templateMeta }) => {
|
|
@@ -2205,7 +2242,7 @@ function generateAnalysis(context) {
|
|
|
2205
2242
|
return analysis;
|
|
2206
2243
|
}
|
|
2207
2244
|
|
|
2208
|
-
// bazel-out/
|
|
2245
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/ng_module_index.mjs
|
|
2209
2246
|
var NgModuleIndexImpl = class {
|
|
2210
2247
|
constructor(metaReader, localReader) {
|
|
2211
2248
|
this.metaReader = metaReader;
|
|
@@ -2294,8 +2331,8 @@ var NgModuleIndexImpl = class {
|
|
|
2294
2331
|
}
|
|
2295
2332
|
};
|
|
2296
2333
|
|
|
2297
|
-
// bazel-out/
|
|
2298
|
-
import
|
|
2334
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/resource/src/loader.mjs
|
|
2335
|
+
import ts15 from "typescript";
|
|
2299
2336
|
var CSS_PREPROCESSOR_EXT = /(\.scss|\.sass|\.less|\.styl)$/;
|
|
2300
2337
|
var RESOURCE_MARKER = ".$ngresource$";
|
|
2301
2338
|
var RESOURCE_MARKER_TS = RESOURCE_MARKER + ".ts";
|
|
@@ -2405,7 +2442,7 @@ var AdapterResourceLoader = class {
|
|
|
2405
2442
|
return this.adapter.rootDirs.map((rootDir) => join(rootDir, segment));
|
|
2406
2443
|
}
|
|
2407
2444
|
getResolvedCandidateLocations(url, fromFile) {
|
|
2408
|
-
const failedLookup =
|
|
2445
|
+
const failedLookup = ts15.resolveModuleName(url + RESOURCE_MARKER, fromFile, this.options, this.lookupResolutionHost);
|
|
2409
2446
|
if (failedLookup.failedLookupLocations === void 0) {
|
|
2410
2447
|
throw new Error(`Internal error: expected to find failedLookupLocations during resolution of resource '${url}' in context of ${fromFile}`);
|
|
2411
2448
|
}
|
|
@@ -2440,7 +2477,7 @@ function createLookupResolutionHost(adapter) {
|
|
|
2440
2477
|
};
|
|
2441
2478
|
}
|
|
2442
2479
|
|
|
2443
|
-
// bazel-out/
|
|
2480
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/standalone.mjs
|
|
2444
2481
|
var StandaloneComponentScopeReader = class {
|
|
2445
2482
|
constructor(metaReader, localModuleReader, dtsModuleReader) {
|
|
2446
2483
|
this.metaReader = metaReader;
|
|
@@ -2536,11 +2573,11 @@ var StandaloneComponentScopeReader = class {
|
|
|
2536
2573
|
}
|
|
2537
2574
|
};
|
|
2538
2575
|
|
|
2539
|
-
// bazel-out/
|
|
2576
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
|
|
2540
2577
|
import { CssSelector as CssSelector2, DomElementSchemaRegistry as DomElementSchemaRegistry2, ExternalExpr as ExternalExpr2, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
|
|
2541
2578
|
|
|
2542
|
-
// bazel-out/
|
|
2543
|
-
import
|
|
2579
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/diagnostic.mjs
|
|
2580
|
+
import ts16 from "typescript";
|
|
2544
2581
|
function makeTemplateDiagnostic(templateId, mapping, span, category, code, messageText, relatedMessages) {
|
|
2545
2582
|
var _a;
|
|
2546
2583
|
if (mapping.type === "direct") {
|
|
@@ -2549,7 +2586,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
2549
2586
|
relatedInformation = [];
|
|
2550
2587
|
for (const relatedMessage of relatedMessages) {
|
|
2551
2588
|
relatedInformation.push({
|
|
2552
|
-
category:
|
|
2589
|
+
category: ts16.DiagnosticCategory.Message,
|
|
2553
2590
|
code: 0,
|
|
2554
2591
|
file: relatedMessage.sourceFile,
|
|
2555
2592
|
start: relatedMessage.start,
|
|
@@ -2578,7 +2615,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
2578
2615
|
if (relatedMessages !== void 0) {
|
|
2579
2616
|
for (const relatedMessage of relatedMessages) {
|
|
2580
2617
|
relatedInformation.push({
|
|
2581
|
-
category:
|
|
2618
|
+
category: ts16.DiagnosticCategory.Message,
|
|
2582
2619
|
code: 0,
|
|
2583
2620
|
file: relatedMessage.sourceFile,
|
|
2584
2621
|
start: relatedMessage.start,
|
|
@@ -2608,7 +2645,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
2608
2645
|
};
|
|
2609
2646
|
}
|
|
2610
2647
|
relatedInformation.push({
|
|
2611
|
-
category:
|
|
2648
|
+
category: ts16.DiagnosticCategory.Message,
|
|
2612
2649
|
code: 0,
|
|
2613
2650
|
file: componentSf,
|
|
2614
2651
|
start: mapping.node.getStart(),
|
|
@@ -2643,10 +2680,10 @@ function parseTemplateAsSourceFile(fileName, template) {
|
|
|
2643
2680
|
if (parseTemplateAsSourceFileForTest !== null) {
|
|
2644
2681
|
return parseTemplateAsSourceFileForTest(fileName, template);
|
|
2645
2682
|
}
|
|
2646
|
-
return
|
|
2683
|
+
return ts16.createSourceFile(fileName, template, ts16.ScriptTarget.Latest, false, ts16.ScriptKind.JSX);
|
|
2647
2684
|
}
|
|
2648
2685
|
|
|
2649
|
-
// bazel-out/
|
|
2686
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/id.mjs
|
|
2650
2687
|
var TEMPLATE_ID = Symbol("ngTemplateId");
|
|
2651
2688
|
var NEXT_TEMPLATE_ID = Symbol("ngNextTemplateId");
|
|
2652
2689
|
function getTemplateId(clazz) {
|
|
@@ -2663,17 +2700,17 @@ function allocateTemplateId(sf) {
|
|
|
2663
2700
|
return `tcb${sf[NEXT_TEMPLATE_ID]++}`;
|
|
2664
2701
|
}
|
|
2665
2702
|
|
|
2666
|
-
// bazel-out/
|
|
2703
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
2667
2704
|
import { EmptyExpr, ImplicitReceiver as ImplicitReceiver2, PropertyRead as PropertyRead2, PropertyWrite as PropertyWrite2, SafePropertyRead, TmplAstReference as TmplAstReference2, TmplAstTextAttribute } from "@angular/compiler";
|
|
2668
|
-
import
|
|
2705
|
+
import ts18 from "typescript";
|
|
2669
2706
|
|
|
2670
|
-
// bazel-out/
|
|
2707
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/comments.mjs
|
|
2671
2708
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan2 } from "@angular/compiler";
|
|
2672
|
-
import
|
|
2709
|
+
import ts17 from "typescript";
|
|
2673
2710
|
var parseSpanComment = /^(\d+),(\d+)$/;
|
|
2674
2711
|
function readSpanComment(node, sourceFile = node.getSourceFile()) {
|
|
2675
|
-
return
|
|
2676
|
-
if (kind !==
|
|
2712
|
+
return ts17.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
2713
|
+
if (kind !== ts17.SyntaxKind.MultiLineCommentTrivia) {
|
|
2677
2714
|
return null;
|
|
2678
2715
|
}
|
|
2679
2716
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -2697,25 +2734,25 @@ var ExpressionIdentifier;
|
|
|
2697
2734
|
ExpressionIdentifier2["VARIABLE_AS_EXPRESSION"] = "VAE";
|
|
2698
2735
|
})(ExpressionIdentifier || (ExpressionIdentifier = {}));
|
|
2699
2736
|
function addExpressionIdentifier(node, identifier) {
|
|
2700
|
-
|
|
2737
|
+
ts17.addSyntheticTrailingComment(
|
|
2701
2738
|
node,
|
|
2702
|
-
|
|
2739
|
+
ts17.SyntaxKind.MultiLineCommentTrivia,
|
|
2703
2740
|
`${CommentTriviaType.EXPRESSION_TYPE_IDENTIFIER}:${identifier}`,
|
|
2704
2741
|
false
|
|
2705
2742
|
);
|
|
2706
2743
|
}
|
|
2707
2744
|
var IGNORE_FOR_DIAGNOSTICS_MARKER = `${CommentTriviaType.DIAGNOSTIC}:ignore`;
|
|
2708
2745
|
function markIgnoreDiagnostics(node) {
|
|
2709
|
-
|
|
2746
|
+
ts17.addSyntheticTrailingComment(
|
|
2710
2747
|
node,
|
|
2711
|
-
|
|
2748
|
+
ts17.SyntaxKind.MultiLineCommentTrivia,
|
|
2712
2749
|
IGNORE_FOR_DIAGNOSTICS_MARKER,
|
|
2713
2750
|
false
|
|
2714
2751
|
);
|
|
2715
2752
|
}
|
|
2716
2753
|
function hasIgnoreForDiagnosticsMarker(node, sourceFile) {
|
|
2717
|
-
return
|
|
2718
|
-
if (kind !==
|
|
2754
|
+
return ts17.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
2755
|
+
if (kind !== ts17.SyntaxKind.MultiLineCommentTrivia) {
|
|
2719
2756
|
return null;
|
|
2720
2757
|
}
|
|
2721
2758
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -2789,8 +2826,8 @@ function findAllMatchingNodes(tcb, opts) {
|
|
|
2789
2826
|
return results;
|
|
2790
2827
|
}
|
|
2791
2828
|
function hasExpressionIdentifier(sourceFile, node, identifier) {
|
|
2792
|
-
return
|
|
2793
|
-
if (kind !==
|
|
2829
|
+
return ts17.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
2830
|
+
if (kind !== ts17.SyntaxKind.MultiLineCommentTrivia) {
|
|
2794
2831
|
return false;
|
|
2795
2832
|
}
|
|
2796
2833
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -2798,7 +2835,7 @@ function hasExpressionIdentifier(sourceFile, node, identifier) {
|
|
|
2798
2835
|
}) || false;
|
|
2799
2836
|
}
|
|
2800
2837
|
|
|
2801
|
-
// bazel-out/
|
|
2838
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
2802
2839
|
var CompletionEngine = class {
|
|
2803
2840
|
constructor(tcb, data, tcbPath, tcbIsShim) {
|
|
2804
2841
|
this.tcb = tcb;
|
|
@@ -2808,7 +2845,7 @@ var CompletionEngine = class {
|
|
|
2808
2845
|
this.templateContextCache = /* @__PURE__ */ new Map();
|
|
2809
2846
|
this.expressionCompletionCache = /* @__PURE__ */ new Map();
|
|
2810
2847
|
const globalRead = findFirstMatchingNode(this.tcb, {
|
|
2811
|
-
filter:
|
|
2848
|
+
filter: ts18.isPropertyAccessExpression,
|
|
2812
2849
|
withExpressionIdentifier: ExpressionIdentifier.COMPONENT_COMPLETION
|
|
2813
2850
|
});
|
|
2814
2851
|
if (globalRead !== null) {
|
|
@@ -2832,7 +2869,7 @@ var CompletionEngine = class {
|
|
|
2832
2869
|
let nodeContext = null;
|
|
2833
2870
|
if (node instanceof EmptyExpr) {
|
|
2834
2871
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
2835
|
-
filter:
|
|
2872
|
+
filter: ts18.isIdentifier,
|
|
2836
2873
|
withSpan: node.sourceSpan
|
|
2837
2874
|
});
|
|
2838
2875
|
if (nodeLocation !== null) {
|
|
@@ -2845,7 +2882,7 @@ var CompletionEngine = class {
|
|
|
2845
2882
|
}
|
|
2846
2883
|
if (node instanceof PropertyRead2 && node.receiver instanceof ImplicitReceiver2) {
|
|
2847
2884
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
2848
|
-
filter:
|
|
2885
|
+
filter: ts18.isPropertyAccessExpression,
|
|
2849
2886
|
withSpan: node.sourceSpan
|
|
2850
2887
|
});
|
|
2851
2888
|
if (nodeLocation) {
|
|
@@ -2869,21 +2906,21 @@ var CompletionEngine = class {
|
|
|
2869
2906
|
let tsExpr = null;
|
|
2870
2907
|
if (expr instanceof PropertyRead2 || expr instanceof PropertyWrite2) {
|
|
2871
2908
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
2872
|
-
filter:
|
|
2909
|
+
filter: ts18.isPropertyAccessExpression,
|
|
2873
2910
|
withSpan: expr.nameSpan
|
|
2874
2911
|
});
|
|
2875
2912
|
} else if (expr instanceof SafePropertyRead) {
|
|
2876
2913
|
const ternaryExpr = findFirstMatchingNode(this.tcb, {
|
|
2877
|
-
filter:
|
|
2914
|
+
filter: ts18.isParenthesizedExpression,
|
|
2878
2915
|
withSpan: expr.sourceSpan
|
|
2879
2916
|
});
|
|
2880
|
-
if (ternaryExpr === null || !
|
|
2917
|
+
if (ternaryExpr === null || !ts18.isConditionalExpression(ternaryExpr.expression)) {
|
|
2881
2918
|
return null;
|
|
2882
2919
|
}
|
|
2883
2920
|
const whenTrue = ternaryExpr.expression.whenTrue;
|
|
2884
|
-
if (
|
|
2921
|
+
if (ts18.isPropertyAccessExpression(whenTrue)) {
|
|
2885
2922
|
tsExpr = whenTrue;
|
|
2886
|
-
} else if (
|
|
2923
|
+
} else if (ts18.isCallExpression(whenTrue) && ts18.isPropertyAccessExpression(whenTrue.expression)) {
|
|
2887
2924
|
tsExpr = whenTrue.expression;
|
|
2888
2925
|
}
|
|
2889
2926
|
}
|
|
@@ -2905,15 +2942,15 @@ var CompletionEngine = class {
|
|
|
2905
2942
|
let tsExpr = null;
|
|
2906
2943
|
if (expr instanceof TmplAstTextAttribute) {
|
|
2907
2944
|
const strNode = findFirstMatchingNode(this.tcb, {
|
|
2908
|
-
filter:
|
|
2945
|
+
filter: ts18.isParenthesizedExpression,
|
|
2909
2946
|
withSpan: expr.sourceSpan
|
|
2910
2947
|
});
|
|
2911
|
-
if (strNode !== null &&
|
|
2948
|
+
if (strNode !== null && ts18.isStringLiteral(strNode.expression)) {
|
|
2912
2949
|
tsExpr = strNode.expression;
|
|
2913
2950
|
}
|
|
2914
2951
|
} else {
|
|
2915
2952
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
2916
|
-
filter: (n) =>
|
|
2953
|
+
filter: (n) => ts18.isStringLiteral(n) || ts18.isNumericLiteral(n),
|
|
2917
2954
|
withSpan: expr.sourceSpan
|
|
2918
2955
|
});
|
|
2919
2956
|
}
|
|
@@ -2921,7 +2958,7 @@ var CompletionEngine = class {
|
|
|
2921
2958
|
return null;
|
|
2922
2959
|
}
|
|
2923
2960
|
let positionInShimFile = tsExpr.getEnd();
|
|
2924
|
-
if (
|
|
2961
|
+
if (ts18.isStringLiteral(tsExpr)) {
|
|
2925
2962
|
positionInShimFile -= 1;
|
|
2926
2963
|
}
|
|
2927
2964
|
const res = {
|
|
@@ -2955,12 +2992,12 @@ var CompletionEngine = class {
|
|
|
2955
2992
|
}
|
|
2956
2993
|
};
|
|
2957
2994
|
|
|
2958
|
-
// bazel-out/
|
|
2959
|
-
import
|
|
2995
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
|
|
2996
|
+
import ts31 from "typescript";
|
|
2960
2997
|
|
|
2961
|
-
// bazel-out/
|
|
2998
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/dom.mjs
|
|
2962
2999
|
import { DomElementSchemaRegistry } from "@angular/compiler";
|
|
2963
|
-
import
|
|
3000
|
+
import ts19 from "typescript";
|
|
2964
3001
|
var REGISTRY = new DomElementSchemaRegistry();
|
|
2965
3002
|
var REMOVE_XHTML_REGEX = /^:xhtml:/;
|
|
2966
3003
|
var RegistryDomSchemaChecker = class {
|
|
@@ -2985,7 +3022,7 @@ var RegistryDomSchemaChecker = class {
|
|
|
2985
3022
|
} else {
|
|
2986
3023
|
errorMsg += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas2} of this component.`;
|
|
2987
3024
|
}
|
|
2988
|
-
const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan,
|
|
3025
|
+
const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan, ts19.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ELEMENT), errorMsg);
|
|
2989
3026
|
this._diagnostics.push(diag);
|
|
2990
3027
|
}
|
|
2991
3028
|
}
|
|
@@ -3005,16 +3042,16 @@ var RegistryDomSchemaChecker = class {
|
|
|
3005
3042
|
2. If '${element.name}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas2} of this component to suppress this message.
|
|
3006
3043
|
3. To allow any property add 'NO_ERRORS_SCHEMA' to the ${schemas2} of this component.`;
|
|
3007
3044
|
}
|
|
3008
|
-
const diag = makeTemplateDiagnostic(id, mapping, span,
|
|
3045
|
+
const diag = makeTemplateDiagnostic(id, mapping, span, ts19.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ATTRIBUTE), errorMsg);
|
|
3009
3046
|
this._diagnostics.push(diag);
|
|
3010
3047
|
}
|
|
3011
3048
|
}
|
|
3012
3049
|
};
|
|
3013
3050
|
|
|
3014
|
-
// bazel-out/
|
|
3015
|
-
import
|
|
3051
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
|
|
3052
|
+
import ts24 from "typescript";
|
|
3016
3053
|
|
|
3017
|
-
// bazel-out/
|
|
3054
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/reference_emit_environment.mjs
|
|
3018
3055
|
import { ExpressionType, ExternalExpr, TypeModifier } from "@angular/compiler";
|
|
3019
3056
|
var ReferenceEmitEnvironment = class {
|
|
3020
3057
|
constructor(importManager, refEmitter, reflector, contextFile) {
|
|
@@ -3045,87 +3082,87 @@ var ReferenceEmitEnvironment = class {
|
|
|
3045
3082
|
}
|
|
3046
3083
|
};
|
|
3047
3084
|
|
|
3048
|
-
// bazel-out/
|
|
3049
|
-
import
|
|
3085
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/ts_util.mjs
|
|
3086
|
+
import ts20 from "typescript";
|
|
3050
3087
|
var SAFE_TO_CAST_WITHOUT_PARENS = /* @__PURE__ */ new Set([
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3088
|
+
ts20.SyntaxKind.ParenthesizedExpression,
|
|
3089
|
+
ts20.SyntaxKind.Identifier,
|
|
3090
|
+
ts20.SyntaxKind.CallExpression,
|
|
3091
|
+
ts20.SyntaxKind.NonNullExpression,
|
|
3092
|
+
ts20.SyntaxKind.ElementAccessExpression,
|
|
3093
|
+
ts20.SyntaxKind.PropertyAccessExpression,
|
|
3094
|
+
ts20.SyntaxKind.ArrayLiteralExpression,
|
|
3095
|
+
ts20.SyntaxKind.ObjectLiteralExpression,
|
|
3096
|
+
ts20.SyntaxKind.StringLiteral,
|
|
3097
|
+
ts20.SyntaxKind.NumericLiteral,
|
|
3098
|
+
ts20.SyntaxKind.TrueKeyword,
|
|
3099
|
+
ts20.SyntaxKind.FalseKeyword,
|
|
3100
|
+
ts20.SyntaxKind.NullKeyword,
|
|
3101
|
+
ts20.SyntaxKind.UndefinedKeyword
|
|
3065
3102
|
]);
|
|
3066
3103
|
function tsCastToAny(expr) {
|
|
3067
3104
|
if (!SAFE_TO_CAST_WITHOUT_PARENS.has(expr.kind)) {
|
|
3068
|
-
expr =
|
|
3105
|
+
expr = ts20.factory.createParenthesizedExpression(expr);
|
|
3069
3106
|
}
|
|
3070
|
-
return
|
|
3107
|
+
return ts20.factory.createParenthesizedExpression(ts20.factory.createAsExpression(expr, ts20.factory.createKeywordTypeNode(ts20.SyntaxKind.AnyKeyword)));
|
|
3071
3108
|
}
|
|
3072
3109
|
function tsCreateElement(tagName) {
|
|
3073
|
-
const createElement =
|
|
3074
|
-
|
|
3110
|
+
const createElement = ts20.factory.createPropertyAccessExpression(
|
|
3111
|
+
ts20.factory.createIdentifier("document"),
|
|
3075
3112
|
"createElement"
|
|
3076
3113
|
);
|
|
3077
|
-
return
|
|
3114
|
+
return ts20.factory.createCallExpression(
|
|
3078
3115
|
createElement,
|
|
3079
3116
|
void 0,
|
|
3080
|
-
[
|
|
3117
|
+
[ts20.factory.createStringLiteral(tagName)]
|
|
3081
3118
|
);
|
|
3082
3119
|
}
|
|
3083
3120
|
function tsDeclareVariable(id, type) {
|
|
3084
3121
|
addExpressionIdentifier(type, ExpressionIdentifier.VARIABLE_AS_EXPRESSION);
|
|
3085
|
-
const initializer =
|
|
3086
|
-
const decl =
|
|
3122
|
+
const initializer = ts20.factory.createAsExpression(ts20.factory.createNonNullExpression(ts20.factory.createNull()), type);
|
|
3123
|
+
const decl = ts20.factory.createVariableDeclaration(
|
|
3087
3124
|
id,
|
|
3088
3125
|
void 0,
|
|
3089
3126
|
void 0,
|
|
3090
3127
|
initializer
|
|
3091
3128
|
);
|
|
3092
|
-
return
|
|
3129
|
+
return ts20.factory.createVariableStatement(
|
|
3093
3130
|
void 0,
|
|
3094
3131
|
[decl]
|
|
3095
3132
|
);
|
|
3096
3133
|
}
|
|
3097
3134
|
function tsCreateTypeQueryForCoercedInput(typeName, coercedInputName) {
|
|
3098
|
-
return
|
|
3135
|
+
return ts20.factory.createTypeQueryNode(ts20.factory.createQualifiedName(typeName, `ngAcceptInputType_${coercedInputName}`));
|
|
3099
3136
|
}
|
|
3100
3137
|
function tsCreateVariable(id, initializer) {
|
|
3101
|
-
const decl =
|
|
3138
|
+
const decl = ts20.factory.createVariableDeclaration(
|
|
3102
3139
|
id,
|
|
3103
3140
|
void 0,
|
|
3104
3141
|
void 0,
|
|
3105
3142
|
initializer
|
|
3106
3143
|
);
|
|
3107
|
-
return
|
|
3144
|
+
return ts20.factory.createVariableStatement(
|
|
3108
3145
|
void 0,
|
|
3109
3146
|
[decl]
|
|
3110
3147
|
);
|
|
3111
3148
|
}
|
|
3112
3149
|
function tsCallMethod(receiver, methodName, args = []) {
|
|
3113
|
-
const methodAccess =
|
|
3114
|
-
return
|
|
3150
|
+
const methodAccess = ts20.factory.createPropertyAccessExpression(receiver, methodName);
|
|
3151
|
+
return ts20.factory.createCallExpression(
|
|
3115
3152
|
methodAccess,
|
|
3116
3153
|
void 0,
|
|
3117
3154
|
args
|
|
3118
3155
|
);
|
|
3119
3156
|
}
|
|
3120
3157
|
function isAccessExpression(node) {
|
|
3121
|
-
return
|
|
3158
|
+
return ts20.isPropertyAccessExpression(node) || ts20.isElementAccessExpression(node);
|
|
3122
3159
|
}
|
|
3123
3160
|
function tsNumericExpression(value) {
|
|
3124
3161
|
if (value < 0) {
|
|
3125
|
-
const operand =
|
|
3126
|
-
return
|
|
3162
|
+
const operand = ts20.factory.createNumericLiteral(Math.abs(value));
|
|
3163
|
+
return ts20.factory.createPrefixUnaryExpression(ts20.SyntaxKind.MinusToken, operand);
|
|
3127
3164
|
}
|
|
3128
|
-
return
|
|
3165
|
+
return ts20.factory.createNumericLiteral(value);
|
|
3129
3166
|
}
|
|
3130
3167
|
function getImportString(imp) {
|
|
3131
3168
|
if (imp.qualifier === null) {
|
|
@@ -3135,16 +3172,16 @@ function getImportString(imp) {
|
|
|
3135
3172
|
}
|
|
3136
3173
|
}
|
|
3137
3174
|
|
|
3138
|
-
// bazel-out/
|
|
3175
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
3139
3176
|
import { ExpressionType as ExpressionType2, R3Identifiers as R3Identifiers2, WrappedNodeExpr } from "@angular/compiler";
|
|
3140
|
-
import
|
|
3177
|
+
import ts23 from "typescript";
|
|
3141
3178
|
|
|
3142
|
-
// bazel-out/
|
|
3179
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
3143
3180
|
import { R3Identifiers } from "@angular/compiler";
|
|
3144
|
-
import
|
|
3181
|
+
import ts22 from "typescript";
|
|
3145
3182
|
|
|
3146
|
-
// bazel-out/
|
|
3147
|
-
import
|
|
3183
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
|
|
3184
|
+
import ts21 from "typescript";
|
|
3148
3185
|
var TypeParameterEmitter = class {
|
|
3149
3186
|
constructor(typeParameters, reflector) {
|
|
3150
3187
|
this.typeParameters = typeParameters;
|
|
@@ -3181,11 +3218,11 @@ var TypeParameterEmitter = class {
|
|
|
3181
3218
|
return this.typeParameters.map((typeParam) => {
|
|
3182
3219
|
const constraint = typeParam.constraint !== void 0 ? emitter.emitType(typeParam.constraint) : void 0;
|
|
3183
3220
|
const defaultType = typeParam.default !== void 0 ? emitter.emitType(typeParam.default) : void 0;
|
|
3184
|
-
return
|
|
3221
|
+
return ts21.factory.updateTypeParameterDeclaration(typeParam, typeParam.modifiers, typeParam.name, constraint, defaultType);
|
|
3185
3222
|
});
|
|
3186
3223
|
}
|
|
3187
3224
|
resolveTypeReference(type) {
|
|
3188
|
-
const target =
|
|
3225
|
+
const target = ts21.isIdentifier(type.typeName) ? type.typeName : type.typeName.right;
|
|
3189
3226
|
const declaration = this.reflector.getDeclarationOfIdentifier(target);
|
|
3190
3227
|
if (declaration === null || declaration.node === null) {
|
|
3191
3228
|
return null;
|
|
@@ -3211,8 +3248,8 @@ var TypeParameterEmitter = class {
|
|
|
3211
3248
|
if (typeNode === null) {
|
|
3212
3249
|
return null;
|
|
3213
3250
|
}
|
|
3214
|
-
if (!
|
|
3215
|
-
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${
|
|
3251
|
+
if (!ts21.isTypeReferenceNode(typeNode)) {
|
|
3252
|
+
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts21.SyntaxKind[typeNode.kind]}.`);
|
|
3216
3253
|
}
|
|
3217
3254
|
return typeNode;
|
|
3218
3255
|
}
|
|
@@ -3221,7 +3258,7 @@ var TypeParameterEmitter = class {
|
|
|
3221
3258
|
}
|
|
3222
3259
|
};
|
|
3223
3260
|
|
|
3224
|
-
// bazel-out/
|
|
3261
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
3225
3262
|
var TCB_FILE_IMPORT_GRAPH_PREPARE_MODULES = [
|
|
3226
3263
|
R3Identifiers.InputSignalBrandWriteType.moduleName
|
|
3227
3264
|
];
|
|
@@ -3257,14 +3294,14 @@ function getTemplateMapping(shimSf, position, resolver, isDiagnosticRequest) {
|
|
|
3257
3294
|
}
|
|
3258
3295
|
function findTypeCheckBlock(file, id, isDiagnosticRequest) {
|
|
3259
3296
|
for (const stmt of file.statements) {
|
|
3260
|
-
if (
|
|
3297
|
+
if (ts22.isFunctionDeclaration(stmt) && getTemplateId2(stmt, file, isDiagnosticRequest) === id) {
|
|
3261
3298
|
return stmt;
|
|
3262
3299
|
}
|
|
3263
3300
|
}
|
|
3264
3301
|
return null;
|
|
3265
3302
|
}
|
|
3266
3303
|
function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
|
|
3267
|
-
while (node !== void 0 && !
|
|
3304
|
+
while (node !== void 0 && !ts22.isFunctionDeclaration(node)) {
|
|
3268
3305
|
if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticsRequest) {
|
|
3269
3306
|
return null;
|
|
3270
3307
|
}
|
|
@@ -3281,7 +3318,7 @@ function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
|
|
|
3281
3318
|
return null;
|
|
3282
3319
|
}
|
|
3283
3320
|
function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
|
|
3284
|
-
while (!
|
|
3321
|
+
while (!ts22.isFunctionDeclaration(node)) {
|
|
3285
3322
|
if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticRequest) {
|
|
3286
3323
|
return null;
|
|
3287
3324
|
}
|
|
@@ -3291,8 +3328,8 @@ function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
|
|
|
3291
3328
|
}
|
|
3292
3329
|
}
|
|
3293
3330
|
const start = node.getFullStart();
|
|
3294
|
-
return
|
|
3295
|
-
if (kind !==
|
|
3331
|
+
return ts22.forEachLeadingCommentRange(sourceFile.text, start, (pos, end, kind) => {
|
|
3332
|
+
if (kind !== ts22.SyntaxKind.MultiLineCommentTrivia) {
|
|
3296
3333
|
return null;
|
|
3297
3334
|
}
|
|
3298
3335
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -3309,32 +3346,32 @@ function checkIfGenericTypeBoundsCanBeEmitted(node, reflector, env) {
|
|
|
3309
3346
|
return emitter.canEmit((ref) => env.canReferenceType(ref));
|
|
3310
3347
|
}
|
|
3311
3348
|
|
|
3312
|
-
// bazel-out/
|
|
3349
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
3313
3350
|
function generateTypeCtorDeclarationFn(env, meta, nodeTypeRef, typeParams) {
|
|
3314
3351
|
const rawTypeArgs = typeParams !== void 0 ? generateGenericArgs(typeParams) : void 0;
|
|
3315
|
-
const rawType =
|
|
3352
|
+
const rawType = ts23.factory.createTypeReferenceNode(nodeTypeRef, rawTypeArgs);
|
|
3316
3353
|
const initParam = constructTypeCtorParameter(env, meta, rawType);
|
|
3317
3354
|
const typeParameters = typeParametersWithDefaultTypes(typeParams);
|
|
3318
3355
|
if (meta.body) {
|
|
3319
|
-
const fnType =
|
|
3356
|
+
const fnType = ts23.factory.createFunctionTypeNode(
|
|
3320
3357
|
typeParameters,
|
|
3321
3358
|
[initParam],
|
|
3322
3359
|
rawType
|
|
3323
3360
|
);
|
|
3324
|
-
const decl =
|
|
3361
|
+
const decl = ts23.factory.createVariableDeclaration(
|
|
3325
3362
|
meta.fnName,
|
|
3326
3363
|
void 0,
|
|
3327
3364
|
fnType,
|
|
3328
|
-
|
|
3365
|
+
ts23.factory.createNonNullExpression(ts23.factory.createNull())
|
|
3329
3366
|
);
|
|
3330
|
-
const declList =
|
|
3331
|
-
return
|
|
3367
|
+
const declList = ts23.factory.createVariableDeclarationList([decl], ts23.NodeFlags.Const);
|
|
3368
|
+
return ts23.factory.createVariableStatement(
|
|
3332
3369
|
void 0,
|
|
3333
3370
|
declList
|
|
3334
3371
|
);
|
|
3335
3372
|
} else {
|
|
3336
|
-
return
|
|
3337
|
-
[
|
|
3373
|
+
return ts23.factory.createFunctionDeclaration(
|
|
3374
|
+
[ts23.factory.createModifier(ts23.SyntaxKind.DeclareKeyword)],
|
|
3338
3375
|
void 0,
|
|
3339
3376
|
meta.fnName,
|
|
3340
3377
|
typeParameters,
|
|
@@ -3346,16 +3383,16 @@ function generateTypeCtorDeclarationFn(env, meta, nodeTypeRef, typeParams) {
|
|
|
3346
3383
|
}
|
|
3347
3384
|
function generateInlineTypeCtor(env, node, meta) {
|
|
3348
3385
|
const rawTypeArgs = node.typeParameters !== void 0 ? generateGenericArgs(node.typeParameters) : void 0;
|
|
3349
|
-
const rawType =
|
|
3386
|
+
const rawType = ts23.factory.createTypeReferenceNode(node.name, rawTypeArgs);
|
|
3350
3387
|
const initParam = constructTypeCtorParameter(env, meta, rawType);
|
|
3351
3388
|
let body = void 0;
|
|
3352
3389
|
if (meta.body) {
|
|
3353
|
-
body =
|
|
3354
|
-
|
|
3390
|
+
body = ts23.factory.createBlock([
|
|
3391
|
+
ts23.factory.createReturnStatement(ts23.factory.createNonNullExpression(ts23.factory.createNull()))
|
|
3355
3392
|
]);
|
|
3356
3393
|
}
|
|
3357
|
-
return
|
|
3358
|
-
[
|
|
3394
|
+
return ts23.factory.createMethodDeclaration(
|
|
3395
|
+
[ts23.factory.createModifier(ts23.SyntaxKind.StaticKeyword)],
|
|
3359
3396
|
void 0,
|
|
3360
3397
|
meta.fnName,
|
|
3361
3398
|
void 0,
|
|
@@ -3372,12 +3409,12 @@ function constructTypeCtorParameter(env, meta, rawType) {
|
|
|
3372
3409
|
const signalInputKeys = [];
|
|
3373
3410
|
for (const { classPropertyName, transform, isSignal: isSignal2 } of meta.fields.inputs) {
|
|
3374
3411
|
if (isSignal2) {
|
|
3375
|
-
signalInputKeys.push(
|
|
3412
|
+
signalInputKeys.push(ts23.factory.createLiteralTypeNode(ts23.factory.createStringLiteral(classPropertyName)));
|
|
3376
3413
|
} else if (!meta.coercedInputFields.has(classPropertyName)) {
|
|
3377
|
-
plainKeys.push(
|
|
3414
|
+
plainKeys.push(ts23.factory.createLiteralTypeNode(ts23.factory.createStringLiteral(classPropertyName)));
|
|
3378
3415
|
} else {
|
|
3379
3416
|
const coercionType = transform != null ? transform.type.node : tsCreateTypeQueryForCoercedInput(rawType.typeName, classPropertyName);
|
|
3380
|
-
coercedKeys.push(
|
|
3417
|
+
coercedKeys.push(ts23.factory.createPropertySignature(
|
|
3381
3418
|
void 0,
|
|
3382
3419
|
classPropertyName,
|
|
3383
3420
|
void 0,
|
|
@@ -3386,25 +3423,25 @@ function constructTypeCtorParameter(env, meta, rawType) {
|
|
|
3386
3423
|
}
|
|
3387
3424
|
}
|
|
3388
3425
|
if (plainKeys.length > 0) {
|
|
3389
|
-
const keyTypeUnion =
|
|
3390
|
-
initType =
|
|
3426
|
+
const keyTypeUnion = ts23.factory.createUnionTypeNode(plainKeys);
|
|
3427
|
+
initType = ts23.factory.createTypeReferenceNode("Pick", [rawType, keyTypeUnion]);
|
|
3391
3428
|
}
|
|
3392
3429
|
if (coercedKeys.length > 0) {
|
|
3393
|
-
const coercedLiteral =
|
|
3394
|
-
initType = initType !== null ?
|
|
3430
|
+
const coercedLiteral = ts23.factory.createTypeLiteralNode(coercedKeys);
|
|
3431
|
+
initType = initType !== null ? ts23.factory.createIntersectionTypeNode([initType, coercedLiteral]) : coercedLiteral;
|
|
3395
3432
|
}
|
|
3396
3433
|
if (signalInputKeys.length > 0) {
|
|
3397
|
-
const keyTypeUnion =
|
|
3434
|
+
const keyTypeUnion = ts23.factory.createUnionTypeNode(signalInputKeys);
|
|
3398
3435
|
const unwrapDirectiveSignalInputsExpr = env.referenceExternalType(R3Identifiers2.UnwrapDirectiveSignalInputs.moduleName, R3Identifiers2.UnwrapDirectiveSignalInputs.name, [
|
|
3399
3436
|
new ExpressionType2(new WrappedNodeExpr(rawType)),
|
|
3400
3437
|
new ExpressionType2(new WrappedNodeExpr(keyTypeUnion))
|
|
3401
3438
|
]);
|
|
3402
|
-
initType = initType !== null ?
|
|
3439
|
+
initType = initType !== null ? ts23.factory.createIntersectionTypeNode([initType, unwrapDirectiveSignalInputsExpr]) : unwrapDirectiveSignalInputsExpr;
|
|
3403
3440
|
}
|
|
3404
3441
|
if (initType === null) {
|
|
3405
|
-
initType =
|
|
3442
|
+
initType = ts23.factory.createTypeLiteralNode([]);
|
|
3406
3443
|
}
|
|
3407
|
-
return
|
|
3444
|
+
return ts23.factory.createParameterDeclaration(
|
|
3408
3445
|
void 0,
|
|
3409
3446
|
void 0,
|
|
3410
3447
|
"init",
|
|
@@ -3414,7 +3451,7 @@ function constructTypeCtorParameter(env, meta, rawType) {
|
|
|
3414
3451
|
);
|
|
3415
3452
|
}
|
|
3416
3453
|
function generateGenericArgs(params) {
|
|
3417
|
-
return params.map((param) =>
|
|
3454
|
+
return params.map((param) => ts23.factory.createTypeReferenceNode(param.name, void 0));
|
|
3418
3455
|
}
|
|
3419
3456
|
function requiresInlineTypeCtor(node, host, env) {
|
|
3420
3457
|
return !checkIfGenericTypeBoundsCanBeEmitted(node, host, env);
|
|
@@ -3425,14 +3462,14 @@ function typeParametersWithDefaultTypes(params) {
|
|
|
3425
3462
|
}
|
|
3426
3463
|
return params.map((param) => {
|
|
3427
3464
|
if (param.default === void 0) {
|
|
3428
|
-
return
|
|
3465
|
+
return ts23.factory.updateTypeParameterDeclaration(param, param.modifiers, param.name, param.constraint, ts23.factory.createKeywordTypeNode(ts23.SyntaxKind.AnyKeyword));
|
|
3429
3466
|
} else {
|
|
3430
3467
|
return param;
|
|
3431
3468
|
}
|
|
3432
3469
|
});
|
|
3433
3470
|
}
|
|
3434
3471
|
|
|
3435
|
-
// bazel-out/
|
|
3472
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
|
|
3436
3473
|
var Environment = class extends ReferenceEmitEnvironment {
|
|
3437
3474
|
constructor(config, importManager, refEmitter, reflector, contextFile) {
|
|
3438
3475
|
super(importManager, refEmitter, reflector, contextFile);
|
|
@@ -3454,13 +3491,13 @@ var Environment = class extends ReferenceEmitEnvironment {
|
|
|
3454
3491
|
}
|
|
3455
3492
|
if (requiresInlineTypeCtor(node, this.reflector, this)) {
|
|
3456
3493
|
const ref = this.reference(dirRef);
|
|
3457
|
-
const typeCtorExpr =
|
|
3494
|
+
const typeCtorExpr = ts24.factory.createPropertyAccessExpression(ref, "ngTypeCtor");
|
|
3458
3495
|
this.typeCtors.set(node, typeCtorExpr);
|
|
3459
3496
|
return typeCtorExpr;
|
|
3460
3497
|
} else {
|
|
3461
3498
|
const fnName = `_ctor${this.nextIds.typeCtor++}`;
|
|
3462
3499
|
const nodeTypeRef = this.referenceType(dirRef);
|
|
3463
|
-
if (!
|
|
3500
|
+
if (!ts24.isTypeReferenceNode(nodeTypeRef)) {
|
|
3464
3501
|
throw new Error(`Expected TypeReferenceNode from reference to ${dirRef.debugName}`);
|
|
3465
3502
|
}
|
|
3466
3503
|
const meta = {
|
|
@@ -3475,7 +3512,7 @@ var Environment = class extends ReferenceEmitEnvironment {
|
|
|
3475
3512
|
const typeParams = this.emitTypeParameters(node);
|
|
3476
3513
|
const typeCtor = generateTypeCtorDeclarationFn(this, meta, nodeTypeRef.typeName, typeParams);
|
|
3477
3514
|
this.typeCtorStatements.push(typeCtor);
|
|
3478
|
-
const fnId =
|
|
3515
|
+
const fnId = ts24.factory.createIdentifier(fnName);
|
|
3479
3516
|
this.typeCtors.set(node, fnId);
|
|
3480
3517
|
return fnId;
|
|
3481
3518
|
}
|
|
@@ -3485,7 +3522,7 @@ var Environment = class extends ReferenceEmitEnvironment {
|
|
|
3485
3522
|
return this.pipeInsts.get(ref.node);
|
|
3486
3523
|
}
|
|
3487
3524
|
const pipeType = this.referenceType(ref);
|
|
3488
|
-
const pipeInstId =
|
|
3525
|
+
const pipeInstId = ts24.factory.createIdentifier(`_pipe${this.nextIds.pipeInst++}`);
|
|
3489
3526
|
this.pipeInstStatements.push(tsDeclareVariable(pipeInstId, pipeType));
|
|
3490
3527
|
this.pipeInsts.set(ref.node, pipeInstId);
|
|
3491
3528
|
return pipeInstId;
|
|
@@ -3507,9 +3544,9 @@ var Environment = class extends ReferenceEmitEnvironment {
|
|
|
3507
3544
|
}
|
|
3508
3545
|
};
|
|
3509
3546
|
|
|
3510
|
-
// bazel-out/
|
|
3547
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/oob.mjs
|
|
3511
3548
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan3, TmplAstElement as TmplAstElement2, TmplAstForLoopBlock, TmplAstForLoopBlockEmpty } from "@angular/compiler";
|
|
3512
|
-
import
|
|
3549
|
+
import ts25 from "typescript";
|
|
3513
3550
|
var OutOfBandDiagnosticRecorderImpl = class {
|
|
3514
3551
|
constructor(resolver) {
|
|
3515
3552
|
this.resolver = resolver;
|
|
@@ -3523,7 +3560,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3523
3560
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
3524
3561
|
const value = ref.value.trim();
|
|
3525
3562
|
const errorMsg = `No directive found with exportAs '${value}'.`;
|
|
3526
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan,
|
|
3563
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REFERENCE_TARGET), errorMsg));
|
|
3527
3564
|
}
|
|
3528
3565
|
missingPipe(templateId, ast) {
|
|
3529
3566
|
if (this.recordedPipes.has(ast)) {
|
|
@@ -3535,7 +3572,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3535
3572
|
if (sourceSpan === null) {
|
|
3536
3573
|
throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
|
|
3537
3574
|
}
|
|
3538
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan,
|
|
3575
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_PIPE), errorMsg));
|
|
3539
3576
|
this.recordedPipes.add(ast);
|
|
3540
3577
|
}
|
|
3541
3578
|
deferredPipeUsedEagerly(templateId, ast) {
|
|
@@ -3548,7 +3585,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3548
3585
|
if (sourceSpan === null) {
|
|
3549
3586
|
throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
|
|
3550
3587
|
}
|
|
3551
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan,
|
|
3588
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_PIPE_USED_EAGERLY), errorMsg));
|
|
3552
3589
|
this.recordedPipes.add(ast);
|
|
3553
3590
|
}
|
|
3554
3591
|
deferredComponentUsedEagerly(templateId, element) {
|
|
@@ -3560,7 +3597,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3560
3597
|
if (sourceSpan === null) {
|
|
3561
3598
|
throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${element.name}'.`);
|
|
3562
3599
|
}
|
|
3563
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan,
|
|
3600
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_DIRECTIVE_USED_EAGERLY), errorMsg));
|
|
3564
3601
|
}
|
|
3565
3602
|
illegalAssignmentToTemplateVar(templateId, assignment, target) {
|
|
3566
3603
|
var _a, _b;
|
|
@@ -3570,7 +3607,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3570
3607
|
if (sourceSpan === null) {
|
|
3571
3608
|
throw new Error(`Assertion failure: no SourceLocation found for property binding.`);
|
|
3572
3609
|
}
|
|
3573
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan,
|
|
3610
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMsg, [{
|
|
3574
3611
|
text: `The variable ${assignment.name} is declared here.`,
|
|
3575
3612
|
start: ((_a = target.valueSpan) == null ? void 0 : _a.start.offset) || target.sourceSpan.start.offset,
|
|
3576
3613
|
end: ((_b = target.valueSpan) == null ? void 0 : _b.end.offset) || target.sourceSpan.end.offset,
|
|
@@ -3580,7 +3617,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3580
3617
|
duplicateTemplateVar(templateId, variable, firstDecl) {
|
|
3581
3618
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
3582
3619
|
const errorMsg = `Cannot redeclare variable '${variable.name}' as it was previously declared elsewhere for the same template.`;
|
|
3583
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, variable.sourceSpan,
|
|
3620
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, variable.sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DUPLICATE_VARIABLE_DECLARATION), errorMsg, [{
|
|
3584
3621
|
text: `The variable '${firstDecl.name}' was first declared here.`,
|
|
3585
3622
|
start: firstDecl.sourceSpan.start.offset,
|
|
3586
3623
|
end: firstDecl.sourceSpan.end.offset,
|
|
@@ -3619,7 +3656,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3619
3656
|
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.
|
|
3620
3657
|
|
|
3621
3658
|
Consider enabling the 'strictTemplates' option in your tsconfig.json for better type inference within this template.`;
|
|
3622
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, diagnosticVar.keySpan,
|
|
3659
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, diagnosticVar.keySpan, ts25.DiagnosticCategory.Suggestion, ngErrorCode(ErrorCode.SUGGEST_SUBOPTIMAL_TYPE_INFERENCE), message));
|
|
3623
3660
|
}
|
|
3624
3661
|
splitTwoWayBinding(templateId, input, output, inputConsumer, outputConsumer) {
|
|
3625
3662
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
@@ -3653,11 +3690,11 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
3653
3690
|
sourceFile: outputConsumer.name.getSourceFile()
|
|
3654
3691
|
});
|
|
3655
3692
|
}
|
|
3656
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, input.keySpan,
|
|
3693
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, input.keySpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SPLIT_TWO_WAY_BINDING), errorMsg, relatedMessages));
|
|
3657
3694
|
}
|
|
3658
3695
|
missingRequiredInputs(templateId, element, directiveName, isComponent, inputAliases) {
|
|
3659
3696
|
const message = `Required input${inputAliases.length === 1 ? "" : "s"} ${inputAliases.map((n) => `'${n}'`).join(", ")} from ${isComponent ? "component" : "directive"} ${directiveName} must be specified.`;
|
|
3660
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), element.startSourceSpan,
|
|
3697
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), element.startSourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REQUIRED_INPUTS), message));
|
|
3661
3698
|
}
|
|
3662
3699
|
illegalForLoopTrackAccess(templateId, block, access) {
|
|
3663
3700
|
const sourceSpan = this.resolver.toParseSourceSpan(templateId, access.sourceSpan);
|
|
@@ -3665,7 +3702,7 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
3665
3702
|
throw new Error(`Assertion failure: no SourceLocation found for property read.`);
|
|
3666
3703
|
}
|
|
3667
3704
|
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.`;
|
|
3668
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), sourceSpan,
|
|
3705
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.ILLEGAL_FOR_LOOP_TRACK_ACCESS), message));
|
|
3669
3706
|
}
|
|
3670
3707
|
inaccessibleDeferredTriggerElement(templateId, trigger) {
|
|
3671
3708
|
let message;
|
|
@@ -3676,7 +3713,7 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
3676
3713
|
Check that an element with #${trigger.reference} exists in the same template and it's accessible from the @defer block.
|
|
3677
3714
|
Deferred blocks can only access triggers in same view, a parent embedded view or the root view of the @placeholder block.`;
|
|
3678
3715
|
}
|
|
3679
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), trigger.sourceSpan,
|
|
3716
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), trigger.sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT), message));
|
|
3680
3717
|
}
|
|
3681
3718
|
controlFlowPreventingContentProjection(templateId, category, projectionNode, componentName, slotSelector, controlFlowNode, preservesWhitespaces) {
|
|
3682
3719
|
let blockName;
|
|
@@ -3709,8 +3746,8 @@ function makeInlineDiagnostic(templateId, code, node, messageText, relatedInform
|
|
|
3709
3746
|
};
|
|
3710
3747
|
}
|
|
3711
3748
|
|
|
3712
|
-
// bazel-out/
|
|
3713
|
-
import
|
|
3749
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/shim.mjs
|
|
3750
|
+
import ts26 from "typescript";
|
|
3714
3751
|
var TypeCheckShimGenerator = class {
|
|
3715
3752
|
constructor() {
|
|
3716
3753
|
this.extensionPrefix = "ngtypecheck";
|
|
@@ -3720,25 +3757,25 @@ var TypeCheckShimGenerator = class {
|
|
|
3720
3757
|
if (priorShimSf !== null) {
|
|
3721
3758
|
return priorShimSf;
|
|
3722
3759
|
}
|
|
3723
|
-
return
|
|
3760
|
+
return ts26.createSourceFile(genFilePath, "export const USED_FOR_NG_TYPE_CHECKING = true;", ts26.ScriptTarget.Latest, true, ts26.ScriptKind.TS);
|
|
3724
3761
|
}
|
|
3725
3762
|
static shimFor(fileName) {
|
|
3726
3763
|
return absoluteFrom(fileName.replace(/\.tsx?$/, ".ngtypecheck.ts"));
|
|
3727
3764
|
}
|
|
3728
3765
|
};
|
|
3729
3766
|
|
|
3730
|
-
// bazel-out/
|
|
3767
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
3731
3768
|
import { BindingPipe, Call as Call2, createCssSelectorFromNode, CssSelector, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver4, PropertyRead as PropertyRead4, PropertyWrite as PropertyWrite3, R3Identifiers as R3Identifiers3, SafeCall, SafePropertyRead as SafePropertyRead3, SelectorMatcher, ThisReceiver, TmplAstBoundAttribute, TmplAstBoundText, TmplAstDeferredBlock, TmplAstElement as TmplAstElement3, TmplAstForLoopBlock as TmplAstForLoopBlock2, TmplAstIcu, TmplAstIfBlock, TmplAstIfBlockBranch, TmplAstReference as TmplAstReference3, TmplAstSwitchBlock, TmplAstTemplate as TmplAstTemplate2, TmplAstText, TmplAstTextAttribute as TmplAstTextAttribute2, TmplAstVariable as TmplAstVariable2, TransplantedType } from "@angular/compiler";
|
|
3732
|
-
import
|
|
3769
|
+
import ts29 from "typescript";
|
|
3733
3770
|
|
|
3734
|
-
// bazel-out/
|
|
3771
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.mjs
|
|
3735
3772
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan4 } from "@angular/compiler";
|
|
3736
|
-
import
|
|
3773
|
+
import ts27 from "typescript";
|
|
3737
3774
|
function wrapForDiagnostics(expr) {
|
|
3738
|
-
return
|
|
3775
|
+
return ts27.factory.createParenthesizedExpression(expr);
|
|
3739
3776
|
}
|
|
3740
3777
|
function wrapForTypeChecker(expr) {
|
|
3741
|
-
return
|
|
3778
|
+
return ts27.factory.createParenthesizedExpression(expr);
|
|
3742
3779
|
}
|
|
3743
3780
|
function addParseSpanInfo(node, span) {
|
|
3744
3781
|
let commentText;
|
|
@@ -3747,10 +3784,10 @@ function addParseSpanInfo(node, span) {
|
|
|
3747
3784
|
} else {
|
|
3748
3785
|
commentText = `${span.start.offset},${span.end.offset}`;
|
|
3749
3786
|
}
|
|
3750
|
-
|
|
3787
|
+
ts27.addSyntheticTrailingComment(node, ts27.SyntaxKind.MultiLineCommentTrivia, commentText, false);
|
|
3751
3788
|
}
|
|
3752
3789
|
function addTemplateId(tcb, id) {
|
|
3753
|
-
|
|
3790
|
+
ts27.addSyntheticLeadingComment(tcb, ts27.SyntaxKind.MultiLineCommentTrivia, id, true);
|
|
3754
3791
|
}
|
|
3755
3792
|
function shouldReportDiagnostic(diagnostic) {
|
|
3756
3793
|
const { code } = diagnostic;
|
|
@@ -3777,34 +3814,34 @@ function translateDiagnostic(diagnostic, resolver) {
|
|
|
3777
3814
|
return makeTemplateDiagnostic(sourceLocation.id, templateSourceMapping, span, diagnostic.category, diagnostic.code, diagnostic.messageText);
|
|
3778
3815
|
}
|
|
3779
3816
|
|
|
3780
|
-
// bazel-out/
|
|
3817
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/expression.mjs
|
|
3781
3818
|
import { ASTWithSource as ASTWithSource2, Call, EmptyExpr as EmptyExpr2, PropertyRead as PropertyRead3, SafeKeyedRead, SafePropertyRead as SafePropertyRead2 } from "@angular/compiler";
|
|
3782
|
-
import
|
|
3783
|
-
var NULL_AS_ANY =
|
|
3784
|
-
var UNDEFINED =
|
|
3819
|
+
import ts28 from "typescript";
|
|
3820
|
+
var NULL_AS_ANY = ts28.factory.createAsExpression(ts28.factory.createNull(), ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
|
|
3821
|
+
var UNDEFINED = ts28.factory.createIdentifier("undefined");
|
|
3785
3822
|
var UNARY_OPS = /* @__PURE__ */ new Map([
|
|
3786
|
-
["+",
|
|
3787
|
-
["-",
|
|
3823
|
+
["+", ts28.SyntaxKind.PlusToken],
|
|
3824
|
+
["-", ts28.SyntaxKind.MinusToken]
|
|
3788
3825
|
]);
|
|
3789
3826
|
var BINARY_OPS = /* @__PURE__ */ new Map([
|
|
3790
|
-
["+",
|
|
3791
|
-
["-",
|
|
3792
|
-
["<",
|
|
3793
|
-
[">",
|
|
3794
|
-
["<=",
|
|
3795
|
-
[">=",
|
|
3796
|
-
["==",
|
|
3797
|
-
["===",
|
|
3798
|
-
["*",
|
|
3799
|
-
["/",
|
|
3800
|
-
["%",
|
|
3801
|
-
["!=",
|
|
3802
|
-
["!==",
|
|
3803
|
-
["||",
|
|
3804
|
-
["&&",
|
|
3805
|
-
["&",
|
|
3806
|
-
["|",
|
|
3807
|
-
["??",
|
|
3827
|
+
["+", ts28.SyntaxKind.PlusToken],
|
|
3828
|
+
["-", ts28.SyntaxKind.MinusToken],
|
|
3829
|
+
["<", ts28.SyntaxKind.LessThanToken],
|
|
3830
|
+
[">", ts28.SyntaxKind.GreaterThanToken],
|
|
3831
|
+
["<=", ts28.SyntaxKind.LessThanEqualsToken],
|
|
3832
|
+
[">=", ts28.SyntaxKind.GreaterThanEqualsToken],
|
|
3833
|
+
["==", ts28.SyntaxKind.EqualsEqualsToken],
|
|
3834
|
+
["===", ts28.SyntaxKind.EqualsEqualsEqualsToken],
|
|
3835
|
+
["*", ts28.SyntaxKind.AsteriskToken],
|
|
3836
|
+
["/", ts28.SyntaxKind.SlashToken],
|
|
3837
|
+
["%", ts28.SyntaxKind.PercentToken],
|
|
3838
|
+
["!=", ts28.SyntaxKind.ExclamationEqualsToken],
|
|
3839
|
+
["!==", ts28.SyntaxKind.ExclamationEqualsEqualsToken],
|
|
3840
|
+
["||", ts28.SyntaxKind.BarBarToken],
|
|
3841
|
+
["&&", ts28.SyntaxKind.AmpersandAmpersandToken],
|
|
3842
|
+
["&", ts28.SyntaxKind.AmpersandToken],
|
|
3843
|
+
["|", ts28.SyntaxKind.BarToken],
|
|
3844
|
+
["??", ts28.SyntaxKind.QuestionQuestionToken]
|
|
3808
3845
|
]);
|
|
3809
3846
|
function astToTypescript(ast, maybeResolve, config) {
|
|
3810
3847
|
const translator = new AstTranslator(maybeResolve, config);
|
|
@@ -3820,7 +3857,7 @@ var AstTranslator = class {
|
|
|
3820
3857
|
ast = ast.ast;
|
|
3821
3858
|
}
|
|
3822
3859
|
if (ast instanceof EmptyExpr2) {
|
|
3823
|
-
const res =
|
|
3860
|
+
const res = ts28.factory.createIdentifier("undefined");
|
|
3824
3861
|
addParseSpanInfo(res, ast.sourceSpan);
|
|
3825
3862
|
return res;
|
|
3826
3863
|
}
|
|
@@ -3836,7 +3873,7 @@ var AstTranslator = class {
|
|
|
3836
3873
|
if (op === void 0) {
|
|
3837
3874
|
throw new Error(`Unsupported Unary.operator: ${ast.operator}`);
|
|
3838
3875
|
}
|
|
3839
|
-
const node = wrapForDiagnostics(
|
|
3876
|
+
const node = wrapForDiagnostics(ts28.factory.createPrefixUnaryExpression(op, expr));
|
|
3840
3877
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3841
3878
|
return node;
|
|
3842
3879
|
}
|
|
@@ -3847,13 +3884,13 @@ var AstTranslator = class {
|
|
|
3847
3884
|
if (op === void 0) {
|
|
3848
3885
|
throw new Error(`Unsupported Binary.operation: ${ast.operation}`);
|
|
3849
3886
|
}
|
|
3850
|
-
const node =
|
|
3887
|
+
const node = ts28.factory.createBinaryExpression(lhs, op, rhs);
|
|
3851
3888
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3852
3889
|
return node;
|
|
3853
3890
|
}
|
|
3854
3891
|
visitChain(ast) {
|
|
3855
3892
|
const elements = ast.expressions.map((expr) => this.translate(expr));
|
|
3856
|
-
const node = wrapForDiagnostics(
|
|
3893
|
+
const node = wrapForDiagnostics(ts28.factory.createCommaListExpression(elements));
|
|
3857
3894
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3858
3895
|
return node;
|
|
3859
3896
|
}
|
|
@@ -3861,7 +3898,7 @@ var AstTranslator = class {
|
|
|
3861
3898
|
const condExpr = this.translate(ast.condition);
|
|
3862
3899
|
const trueExpr = this.translate(ast.trueExp);
|
|
3863
3900
|
const falseExpr = wrapForTypeChecker(this.translate(ast.falseExp));
|
|
3864
|
-
const node =
|
|
3901
|
+
const node = ts28.factory.createParenthesizedExpression(ts28.factory.createConditionalExpression(condExpr, void 0, trueExpr, void 0, falseExpr));
|
|
3865
3902
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3866
3903
|
return node;
|
|
3867
3904
|
}
|
|
@@ -3872,26 +3909,26 @@ var AstTranslator = class {
|
|
|
3872
3909
|
throw new Error("Method not implemented.");
|
|
3873
3910
|
}
|
|
3874
3911
|
visitInterpolation(ast) {
|
|
3875
|
-
return ast.expressions.reduce((lhs, ast2) =>
|
|
3912
|
+
return ast.expressions.reduce((lhs, ast2) => ts28.factory.createBinaryExpression(lhs, ts28.SyntaxKind.PlusToken, wrapForTypeChecker(this.translate(ast2))), ts28.factory.createStringLiteral(""));
|
|
3876
3913
|
}
|
|
3877
3914
|
visitKeyedRead(ast) {
|
|
3878
3915
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3879
3916
|
const key = this.translate(ast.key);
|
|
3880
|
-
const node =
|
|
3917
|
+
const node = ts28.factory.createElementAccessExpression(receiver, key);
|
|
3881
3918
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3882
3919
|
return node;
|
|
3883
3920
|
}
|
|
3884
3921
|
visitKeyedWrite(ast) {
|
|
3885
3922
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3886
|
-
const left =
|
|
3923
|
+
const left = ts28.factory.createElementAccessExpression(receiver, this.translate(ast.key));
|
|
3887
3924
|
const right = wrapForTypeChecker(this.translate(ast.value));
|
|
3888
|
-
const node = wrapForDiagnostics(
|
|
3925
|
+
const node = wrapForDiagnostics(ts28.factory.createBinaryExpression(left, ts28.SyntaxKind.EqualsToken, right));
|
|
3889
3926
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3890
3927
|
return node;
|
|
3891
3928
|
}
|
|
3892
3929
|
visitLiteralArray(ast) {
|
|
3893
3930
|
const elements = ast.expressions.map((expr) => this.translate(expr));
|
|
3894
|
-
const literal =
|
|
3931
|
+
const literal = ts28.factory.createArrayLiteralExpression(elements);
|
|
3895
3932
|
const node = this.config.strictLiteralTypes ? literal : tsCastToAny(literal);
|
|
3896
3933
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3897
3934
|
return node;
|
|
@@ -3899,9 +3936,9 @@ var AstTranslator = class {
|
|
|
3899
3936
|
visitLiteralMap(ast) {
|
|
3900
3937
|
const properties = ast.keys.map(({ key }, idx) => {
|
|
3901
3938
|
const value = this.translate(ast.values[idx]);
|
|
3902
|
-
return
|
|
3939
|
+
return ts28.factory.createPropertyAssignment(ts28.factory.createStringLiteral(key), value);
|
|
3903
3940
|
});
|
|
3904
|
-
const literal =
|
|
3941
|
+
const literal = ts28.factory.createObjectLiteralExpression(properties, true);
|
|
3905
3942
|
const node = this.config.strictLiteralTypes ? literal : tsCastToAny(literal);
|
|
3906
3943
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3907
3944
|
return node;
|
|
@@ -3909,15 +3946,15 @@ var AstTranslator = class {
|
|
|
3909
3946
|
visitLiteralPrimitive(ast) {
|
|
3910
3947
|
let node;
|
|
3911
3948
|
if (ast.value === void 0) {
|
|
3912
|
-
node =
|
|
3949
|
+
node = ts28.factory.createIdentifier("undefined");
|
|
3913
3950
|
} else if (ast.value === null) {
|
|
3914
|
-
node =
|
|
3951
|
+
node = ts28.factory.createNull();
|
|
3915
3952
|
} else if (typeof ast.value === "string") {
|
|
3916
|
-
node =
|
|
3953
|
+
node = ts28.factory.createStringLiteral(ast.value);
|
|
3917
3954
|
} else if (typeof ast.value === "number") {
|
|
3918
3955
|
node = tsNumericExpression(ast.value);
|
|
3919
3956
|
} else if (typeof ast.value === "boolean") {
|
|
3920
|
-
node = ast.value ?
|
|
3957
|
+
node = ast.value ? ts28.factory.createTrue() : ts28.factory.createFalse();
|
|
3921
3958
|
} else {
|
|
3922
3959
|
throw Error(`Unsupported AST value of type ${typeof ast.value}`);
|
|
3923
3960
|
}
|
|
@@ -3926,7 +3963,7 @@ var AstTranslator = class {
|
|
|
3926
3963
|
}
|
|
3927
3964
|
visitNonNullAssert(ast) {
|
|
3928
3965
|
const expr = wrapForDiagnostics(this.translate(ast.expression));
|
|
3929
|
-
const node =
|
|
3966
|
+
const node = ts28.factory.createNonNullExpression(expr);
|
|
3930
3967
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3931
3968
|
return node;
|
|
3932
3969
|
}
|
|
@@ -3935,13 +3972,13 @@ var AstTranslator = class {
|
|
|
3935
3972
|
}
|
|
3936
3973
|
visitPrefixNot(ast) {
|
|
3937
3974
|
const expression = wrapForDiagnostics(this.translate(ast.expression));
|
|
3938
|
-
const node =
|
|
3975
|
+
const node = ts28.factory.createLogicalNot(expression);
|
|
3939
3976
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3940
3977
|
return node;
|
|
3941
3978
|
}
|
|
3942
3979
|
visitPropertyRead(ast) {
|
|
3943
3980
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3944
|
-
const name =
|
|
3981
|
+
const name = ts28.factory.createPropertyAccessExpression(receiver, ast.name);
|
|
3945
3982
|
addParseSpanInfo(name, ast.nameSpan);
|
|
3946
3983
|
const node = wrapForDiagnostics(name);
|
|
3947
3984
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
@@ -3949,12 +3986,12 @@ var AstTranslator = class {
|
|
|
3949
3986
|
}
|
|
3950
3987
|
visitPropertyWrite(ast) {
|
|
3951
3988
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3952
|
-
const left =
|
|
3989
|
+
const left = ts28.factory.createPropertyAccessExpression(receiver, ast.name);
|
|
3953
3990
|
addParseSpanInfo(left, ast.nameSpan);
|
|
3954
3991
|
const leftWithPath = wrapForDiagnostics(left);
|
|
3955
3992
|
addParseSpanInfo(leftWithPath, ast.sourceSpan);
|
|
3956
3993
|
const right = wrapForTypeChecker(this.translate(ast.value));
|
|
3957
|
-
const node = wrapForDiagnostics(
|
|
3994
|
+
const node = wrapForDiagnostics(ts28.factory.createBinaryExpression(leftWithPath, ts28.SyntaxKind.EqualsToken, right));
|
|
3958
3995
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
3959
3996
|
return node;
|
|
3960
3997
|
}
|
|
@@ -3962,13 +3999,13 @@ var AstTranslator = class {
|
|
|
3962
3999
|
let node;
|
|
3963
4000
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
3964
4001
|
if (this.config.strictSafeNavigationTypes) {
|
|
3965
|
-
const expr =
|
|
4002
|
+
const expr = ts28.factory.createPropertyAccessExpression(ts28.factory.createNonNullExpression(receiver), ast.name);
|
|
3966
4003
|
addParseSpanInfo(expr, ast.nameSpan);
|
|
3967
|
-
node =
|
|
4004
|
+
node = ts28.factory.createParenthesizedExpression(ts28.factory.createConditionalExpression(NULL_AS_ANY, void 0, expr, void 0, UNDEFINED));
|
|
3968
4005
|
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
3969
|
-
node =
|
|
4006
|
+
node = ts28.factory.createPropertyAccessExpression(tsCastToAny(receiver), ast.name);
|
|
3970
4007
|
} else {
|
|
3971
|
-
const expr =
|
|
4008
|
+
const expr = ts28.factory.createPropertyAccessExpression(ts28.factory.createNonNullExpression(receiver), ast.name);
|
|
3972
4009
|
addParseSpanInfo(expr, ast.nameSpan);
|
|
3973
4010
|
node = tsCastToAny(expr);
|
|
3974
4011
|
}
|
|
@@ -3980,13 +4017,13 @@ var AstTranslator = class {
|
|
|
3980
4017
|
const key = this.translate(ast.key);
|
|
3981
4018
|
let node;
|
|
3982
4019
|
if (this.config.strictSafeNavigationTypes) {
|
|
3983
|
-
const expr =
|
|
4020
|
+
const expr = ts28.factory.createElementAccessExpression(ts28.factory.createNonNullExpression(receiver), key);
|
|
3984
4021
|
addParseSpanInfo(expr, ast.sourceSpan);
|
|
3985
|
-
node =
|
|
4022
|
+
node = ts28.factory.createParenthesizedExpression(ts28.factory.createConditionalExpression(NULL_AS_ANY, void 0, expr, void 0, UNDEFINED));
|
|
3986
4023
|
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
3987
|
-
node =
|
|
4024
|
+
node = ts28.factory.createElementAccessExpression(tsCastToAny(receiver), key);
|
|
3988
4025
|
} else {
|
|
3989
|
-
const expr =
|
|
4026
|
+
const expr = ts28.factory.createElementAccessExpression(ts28.factory.createNonNullExpression(receiver), key);
|
|
3990
4027
|
addParseSpanInfo(expr, ast.sourceSpan);
|
|
3991
4028
|
node = tsCastToAny(expr);
|
|
3992
4029
|
}
|
|
@@ -4003,7 +4040,7 @@ var AstTranslator = class {
|
|
|
4003
4040
|
expr = resolved;
|
|
4004
4041
|
} else {
|
|
4005
4042
|
const propertyReceiver = wrapForDiagnostics(this.translate(receiver.receiver));
|
|
4006
|
-
expr =
|
|
4043
|
+
expr = ts28.factory.createPropertyAccessExpression(propertyReceiver, receiver.name);
|
|
4007
4044
|
addParseSpanInfo(expr, receiver.nameSpan);
|
|
4008
4045
|
}
|
|
4009
4046
|
} else {
|
|
@@ -4013,7 +4050,7 @@ var AstTranslator = class {
|
|
|
4013
4050
|
if (ast.receiver instanceof SafePropertyRead2 || ast.receiver instanceof SafeKeyedRead) {
|
|
4014
4051
|
node = this.convertToSafeCall(ast, expr, args);
|
|
4015
4052
|
} else {
|
|
4016
|
-
node =
|
|
4053
|
+
node = ts28.factory.createCallExpression(expr, void 0, args);
|
|
4017
4054
|
}
|
|
4018
4055
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
4019
4056
|
return node;
|
|
@@ -4027,13 +4064,13 @@ var AstTranslator = class {
|
|
|
4027
4064
|
}
|
|
4028
4065
|
convertToSafeCall(ast, expr, args) {
|
|
4029
4066
|
if (this.config.strictSafeNavigationTypes) {
|
|
4030
|
-
const call =
|
|
4031
|
-
return
|
|
4067
|
+
const call = ts28.factory.createCallExpression(ts28.factory.createNonNullExpression(expr), void 0, args);
|
|
4068
|
+
return ts28.factory.createParenthesizedExpression(ts28.factory.createConditionalExpression(NULL_AS_ANY, void 0, call, void 0, UNDEFINED));
|
|
4032
4069
|
}
|
|
4033
4070
|
if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
4034
|
-
return
|
|
4071
|
+
return ts28.factory.createCallExpression(tsCastToAny(expr), void 0, args);
|
|
4035
4072
|
}
|
|
4036
|
-
return tsCastToAny(
|
|
4073
|
+
return tsCastToAny(ts28.factory.createCallExpression(ts28.factory.createNonNullExpression(expr), void 0, args));
|
|
4037
4074
|
}
|
|
4038
4075
|
};
|
|
4039
4076
|
var _VeSafeLhsInferenceBugDetector = class {
|
|
@@ -4110,7 +4147,7 @@ var VeSafeLhsInferenceBugDetector = _VeSafeLhsInferenceBugDetector;
|
|
|
4110
4147
|
_VeSafeLhsInferenceBugDetector.SINGLETON = new _VeSafeLhsInferenceBugDetector();
|
|
4111
4148
|
})();
|
|
4112
4149
|
|
|
4113
|
-
// bazel-out/
|
|
4150
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_semantics.mjs
|
|
4114
4151
|
import { ImplicitReceiver as ImplicitReceiver3, RecursiveAstVisitor as RecursiveAstVisitor2, TmplAstVariable } from "@angular/compiler";
|
|
4115
4152
|
var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
|
|
4116
4153
|
constructor(templateId, boundTarget, oob) {
|
|
@@ -4134,7 +4171,7 @@ var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
|
|
|
4134
4171
|
}
|
|
4135
4172
|
};
|
|
4136
4173
|
|
|
4137
|
-
// bazel-out/
|
|
4174
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
4138
4175
|
var TcbGenericContextBehavior;
|
|
4139
4176
|
(function(TcbGenericContextBehavior2) {
|
|
4140
4177
|
TcbGenericContextBehavior2[TcbGenericContextBehavior2["UseEmitter"] = 0] = "UseEmitter";
|
|
@@ -4145,7 +4182,7 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
4145
4182
|
const tcb = new Context(env, domSchemaChecker, oobRecorder, meta.id, meta.boundTarget, meta.pipes, meta.schemas, meta.isStandalone, meta.preserveWhitespaces);
|
|
4146
4183
|
const scope = Scope.forNodes(tcb, null, null, tcb.boundTarget.target.template, null);
|
|
4147
4184
|
const ctxRawType = env.referenceType(ref);
|
|
4148
|
-
if (!
|
|
4185
|
+
if (!ts29.isTypeReferenceNode(ctxRawType)) {
|
|
4149
4186
|
throw new Error(`Expected TypeReferenceNode when referencing the ctx param for ${ref.debugName}`);
|
|
4150
4187
|
}
|
|
4151
4188
|
let typeParameters = void 0;
|
|
@@ -4157,25 +4194,25 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
4157
4194
|
switch (genericContextBehavior) {
|
|
4158
4195
|
case TcbGenericContextBehavior.UseEmitter:
|
|
4159
4196
|
typeParameters = new TypeParameterEmitter(ref.node.typeParameters, env.reflector).emit((typeRef) => env.referenceType(typeRef));
|
|
4160
|
-
typeArguments = typeParameters.map((param) =>
|
|
4197
|
+
typeArguments = typeParameters.map((param) => ts29.factory.createTypeReferenceNode(param.name));
|
|
4161
4198
|
break;
|
|
4162
4199
|
case TcbGenericContextBehavior.CopyClassNodes:
|
|
4163
4200
|
typeParameters = [...ref.node.typeParameters];
|
|
4164
|
-
typeArguments = typeParameters.map((param) =>
|
|
4201
|
+
typeArguments = typeParameters.map((param) => ts29.factory.createTypeReferenceNode(param.name));
|
|
4165
4202
|
break;
|
|
4166
4203
|
case TcbGenericContextBehavior.FallbackToAny:
|
|
4167
|
-
typeArguments = ref.node.typeParameters.map(() =>
|
|
4204
|
+
typeArguments = ref.node.typeParameters.map(() => ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
|
|
4168
4205
|
break;
|
|
4169
4206
|
}
|
|
4170
4207
|
}
|
|
4171
4208
|
const paramList = [tcbThisParam(ctxRawType.typeName, typeArguments)];
|
|
4172
4209
|
const scopeStatements = scope.render();
|
|
4173
|
-
const innerBody =
|
|
4210
|
+
const innerBody = ts29.factory.createBlock([
|
|
4174
4211
|
...env.getPreludeStatements(),
|
|
4175
4212
|
...scopeStatements
|
|
4176
4213
|
]);
|
|
4177
|
-
const body =
|
|
4178
|
-
const fnDecl =
|
|
4214
|
+
const body = ts29.factory.createBlock([ts29.factory.createIfStatement(ts29.factory.createTrue(), innerBody, void 0)]);
|
|
4215
|
+
const fnDecl = ts29.factory.createFunctionDeclaration(
|
|
4179
4216
|
void 0,
|
|
4180
4217
|
void 0,
|
|
4181
4218
|
name,
|
|
@@ -4224,7 +4261,7 @@ var TcbTemplateVariableOp = class extends TcbOp {
|
|
|
4224
4261
|
execute() {
|
|
4225
4262
|
const ctx = this.scope.resolve(this.template);
|
|
4226
4263
|
const id = this.tcb.allocateId();
|
|
4227
|
-
const initializer =
|
|
4264
|
+
const initializer = ts29.factory.createPropertyAccessExpression(
|
|
4228
4265
|
ctx,
|
|
4229
4266
|
this.variable.value || "$implicit"
|
|
4230
4267
|
);
|
|
@@ -4250,7 +4287,7 @@ var TcbTemplateContextOp = class extends TcbOp {
|
|
|
4250
4287
|
}
|
|
4251
4288
|
execute() {
|
|
4252
4289
|
const ctx = this.tcb.allocateId();
|
|
4253
|
-
const type =
|
|
4290
|
+
const type = ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword);
|
|
4254
4291
|
this.scope.addStatement(tsDeclareVariable(ctx, type));
|
|
4255
4292
|
return ctx;
|
|
4256
4293
|
}
|
|
@@ -4303,16 +4340,16 @@ var TcbTemplateBodyOp = class extends TcbOp {
|
|
|
4303
4340
|
}
|
|
4304
4341
|
let guard = null;
|
|
4305
4342
|
if (directiveGuards.length > 0) {
|
|
4306
|
-
guard = directiveGuards.reduce((expr, dirGuard) =>
|
|
4343
|
+
guard = directiveGuards.reduce((expr, dirGuard) => ts29.factory.createBinaryExpression(expr, ts29.SyntaxKind.AmpersandAmpersandToken, dirGuard), directiveGuards.pop());
|
|
4307
4344
|
}
|
|
4308
4345
|
const tmplScope = Scope.forNodes(this.tcb, this.scope, this.template, this.template.children, guard);
|
|
4309
4346
|
const statements = tmplScope.render();
|
|
4310
4347
|
if (statements.length === 0) {
|
|
4311
4348
|
return null;
|
|
4312
4349
|
}
|
|
4313
|
-
let tmplBlock =
|
|
4350
|
+
let tmplBlock = ts29.factory.createBlock(statements);
|
|
4314
4351
|
if (guard !== null) {
|
|
4315
|
-
tmplBlock =
|
|
4352
|
+
tmplBlock = ts29.factory.createIfStatement(guard, tmplBlock);
|
|
4316
4353
|
}
|
|
4317
4354
|
this.scope.addStatement(tmplBlock);
|
|
4318
4355
|
return null;
|
|
@@ -4330,7 +4367,7 @@ var TcbExpressionOp = class extends TcbOp {
|
|
|
4330
4367
|
}
|
|
4331
4368
|
execute() {
|
|
4332
4369
|
const expr = tcbExpression(this.expression, this.tcb, this.scope);
|
|
4333
|
-
this.scope.addStatement(
|
|
4370
|
+
this.scope.addStatement(ts29.factory.createExpressionStatement(expr));
|
|
4334
4371
|
return null;
|
|
4335
4372
|
}
|
|
4336
4373
|
};
|
|
@@ -4352,11 +4389,11 @@ var TcbDirectiveTypeOpBase = class extends TcbOp {
|
|
|
4352
4389
|
if (this.dir.isGeneric === false || dirRef.node.typeParameters === void 0) {
|
|
4353
4390
|
type = rawType;
|
|
4354
4391
|
} else {
|
|
4355
|
-
if (!
|
|
4392
|
+
if (!ts29.isTypeReferenceNode(rawType)) {
|
|
4356
4393
|
throw new Error(`Expected TypeReferenceNode when referencing the type for ${this.dir.ref.debugName}`);
|
|
4357
4394
|
}
|
|
4358
|
-
const typeArguments = dirRef.node.typeParameters.map(() =>
|
|
4359
|
-
type =
|
|
4395
|
+
const typeArguments = dirRef.node.typeParameters.map(() => ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
|
|
4396
|
+
type = ts29.factory.createTypeReferenceNode(rawType.typeName, typeArguments);
|
|
4360
4397
|
}
|
|
4361
4398
|
const id = this.tcb.allocateId();
|
|
4362
4399
|
addExpressionIdentifier(id, ExpressionIdentifier.DIRECTIVE);
|
|
@@ -4397,11 +4434,11 @@ var TcbReferenceOp = class extends TcbOp {
|
|
|
4397
4434
|
const id = this.tcb.allocateId();
|
|
4398
4435
|
let initializer = this.target instanceof TmplAstTemplate2 || this.target instanceof TmplAstElement3 ? this.scope.resolve(this.target) : this.scope.resolve(this.host, this.target);
|
|
4399
4436
|
if (this.target instanceof TmplAstElement3 && !this.tcb.env.config.checkTypeOfDomReferences || !this.tcb.env.config.checkTypeOfNonDomReferences) {
|
|
4400
|
-
initializer =
|
|
4437
|
+
initializer = ts29.factory.createAsExpression(initializer, ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
|
|
4401
4438
|
} else if (this.target instanceof TmplAstTemplate2) {
|
|
4402
|
-
initializer =
|
|
4403
|
-
initializer =
|
|
4404
|
-
initializer =
|
|
4439
|
+
initializer = ts29.factory.createAsExpression(initializer, ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
|
|
4440
|
+
initializer = ts29.factory.createAsExpression(initializer, this.tcb.env.referenceExternalType("@angular/core", "TemplateRef", [DYNAMIC_TYPE]));
|
|
4441
|
+
initializer = ts29.factory.createParenthesizedExpression(initializer);
|
|
4405
4442
|
}
|
|
4406
4443
|
addParseSpanInfo(initializer, this.node.sourceSpan);
|
|
4407
4444
|
addParseSpanInfo(id, this.node.keySpan);
|
|
@@ -4500,7 +4537,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
4500
4537
|
type = this.tcb.env.referenceTransplantedType(new TransplantedType(transformType));
|
|
4501
4538
|
} else {
|
|
4502
4539
|
const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
|
|
4503
|
-
if (!
|
|
4540
|
+
if (!ts29.isTypeReferenceNode(dirTypeRef)) {
|
|
4504
4541
|
throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
|
|
4505
4542
|
}
|
|
4506
4543
|
type = tsCreateTypeQueryForCoercedInput(dirTypeRef.typeName, fieldName);
|
|
@@ -4516,10 +4553,10 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
4516
4553
|
}
|
|
4517
4554
|
const id = this.tcb.allocateId();
|
|
4518
4555
|
const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
|
|
4519
|
-
if (!
|
|
4556
|
+
if (!ts29.isTypeReferenceNode(dirTypeRef)) {
|
|
4520
4557
|
throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
|
|
4521
4558
|
}
|
|
4522
|
-
const type =
|
|
4559
|
+
const type = ts29.factory.createIndexedAccessTypeNode(ts29.factory.createTypeQueryNode(dirId), ts29.factory.createLiteralTypeNode(ts29.factory.createStringLiteral(fieldName)));
|
|
4523
4560
|
const temp = tsDeclareVariable(id, type);
|
|
4524
4561
|
this.scope.addStatement(temp);
|
|
4525
4562
|
target = id;
|
|
@@ -4527,14 +4564,14 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
4527
4564
|
if (dirId === null) {
|
|
4528
4565
|
dirId = this.scope.resolve(this.node, this.dir);
|
|
4529
4566
|
}
|
|
4530
|
-
target = this.dir.stringLiteralInputFields.has(fieldName) ?
|
|
4567
|
+
target = this.dir.stringLiteralInputFields.has(fieldName) ? ts29.factory.createElementAccessExpression(dirId, ts29.factory.createStringLiteral(fieldName)) : ts29.factory.createPropertyAccessExpression(dirId, ts29.factory.createIdentifier(fieldName));
|
|
4531
4568
|
}
|
|
4532
4569
|
if (isSignal2) {
|
|
4533
4570
|
const inputSignalBrandWriteSymbol = this.tcb.env.referenceExternalSymbol(R3Identifiers3.InputSignalBrandWriteType.moduleName, R3Identifiers3.InputSignalBrandWriteType.name);
|
|
4534
|
-
if (!
|
|
4571
|
+
if (!ts29.isIdentifier(inputSignalBrandWriteSymbol) && !ts29.isPropertyAccessExpression(inputSignalBrandWriteSymbol)) {
|
|
4535
4572
|
throw new Error(`Expected identifier or property access for reference to ${R3Identifiers3.InputSignalBrandWriteType.name}`);
|
|
4536
4573
|
}
|
|
4537
|
-
target =
|
|
4574
|
+
target = ts29.factory.createElementAccessExpression(target, inputSignalBrandWriteSymbol);
|
|
4538
4575
|
}
|
|
4539
4576
|
if (attr.attribute.keySpan !== void 0) {
|
|
4540
4577
|
addParseSpanInfo(target, attr.attribute.keySpan);
|
|
@@ -4542,13 +4579,13 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
4542
4579
|
if (isTwoWayBinding && this.tcb.env.config.allowSignalsInTwoWayBindings) {
|
|
4543
4580
|
assignment = unwrapWritableSignal(assignment, this.tcb);
|
|
4544
4581
|
}
|
|
4545
|
-
assignment =
|
|
4582
|
+
assignment = ts29.factory.createBinaryExpression(target, ts29.SyntaxKind.EqualsToken, assignment);
|
|
4546
4583
|
}
|
|
4547
4584
|
addParseSpanInfo(assignment, attr.attribute.sourceSpan);
|
|
4548
4585
|
if (!this.tcb.env.config.checkTypeOfAttributes && attr.attribute instanceof TmplAstTextAttribute2) {
|
|
4549
4586
|
markIgnoreDiagnostics(assignment);
|
|
4550
4587
|
}
|
|
4551
|
-
this.scope.addStatement(
|
|
4588
|
+
this.scope.addStatement(ts29.factory.createExpressionStatement(assignment));
|
|
4552
4589
|
}
|
|
4553
4590
|
this.checkRequiredInputs(seenRequiredInputs);
|
|
4554
4591
|
return null;
|
|
@@ -4579,7 +4616,7 @@ var TcbDirectiveCtorCircularFallbackOp = class extends TcbOp {
|
|
|
4579
4616
|
execute() {
|
|
4580
4617
|
const id = this.tcb.allocateId();
|
|
4581
4618
|
const typeCtor = this.tcb.env.typeCtorFor(this.dir);
|
|
4582
|
-
const circularPlaceholder =
|
|
4619
|
+
const circularPlaceholder = ts29.factory.createCallExpression(typeCtor, void 0, [ts29.factory.createNonNullExpression(ts29.factory.createNull())]);
|
|
4583
4620
|
this.scope.addStatement(tsCreateVariable(id, circularPlaceholder));
|
|
4584
4621
|
return id;
|
|
4585
4622
|
}
|
|
@@ -4621,7 +4658,7 @@ var TcbControlFlowContentProjectionOp = class extends TcbOp {
|
|
|
4621
4658
|
this.ngContentSelectors = ngContentSelectors;
|
|
4622
4659
|
this.componentName = componentName;
|
|
4623
4660
|
this.optional = false;
|
|
4624
|
-
this.category = tcb.env.config.controlFlowPreventingContentProjection === "error" ?
|
|
4661
|
+
this.category = tcb.env.config.controlFlowPreventingContentProjection === "error" ? ts29.DiagnosticCategory.Error : ts29.DiagnosticCategory.Warning;
|
|
4625
4662
|
}
|
|
4626
4663
|
execute() {
|
|
4627
4664
|
const controlFlowToCheck = this.findPotentialControlFlowNodes();
|
|
@@ -4720,15 +4757,15 @@ var TcbUnclaimedInputsOp = class extends TcbOp {
|
|
|
4720
4757
|
elId = this.scope.resolve(this.element);
|
|
4721
4758
|
}
|
|
4722
4759
|
const propertyName = (_a = ATTR_TO_PROP.get(binding.name)) != null ? _a : binding.name;
|
|
4723
|
-
const prop =
|
|
4724
|
-
const stmt =
|
|
4760
|
+
const prop = ts29.factory.createElementAccessExpression(elId, ts29.factory.createStringLiteral(propertyName));
|
|
4761
|
+
const stmt = ts29.factory.createBinaryExpression(prop, ts29.SyntaxKind.EqualsToken, wrapForDiagnostics(expr));
|
|
4725
4762
|
addParseSpanInfo(stmt, binding.sourceSpan);
|
|
4726
|
-
this.scope.addStatement(
|
|
4763
|
+
this.scope.addStatement(ts29.factory.createExpressionStatement(stmt));
|
|
4727
4764
|
} else {
|
|
4728
|
-
this.scope.addStatement(
|
|
4765
|
+
this.scope.addStatement(ts29.factory.createExpressionStatement(expr));
|
|
4729
4766
|
}
|
|
4730
4767
|
} else {
|
|
4731
|
-
this.scope.addStatement(
|
|
4768
|
+
this.scope.addStatement(ts29.factory.createExpressionStatement(expr));
|
|
4732
4769
|
}
|
|
4733
4770
|
}
|
|
4734
4771
|
return null;
|
|
@@ -4760,18 +4797,18 @@ var TcbDirectiveOutputsOp = class extends TcbOp {
|
|
|
4760
4797
|
if (dirId === null) {
|
|
4761
4798
|
dirId = this.scope.resolve(this.node, this.dir);
|
|
4762
4799
|
}
|
|
4763
|
-
const outputField =
|
|
4800
|
+
const outputField = ts29.factory.createElementAccessExpression(dirId, ts29.factory.createStringLiteral(field));
|
|
4764
4801
|
addParseSpanInfo(outputField, output.keySpan);
|
|
4765
4802
|
if (this.tcb.env.config.checkTypeOfOutputEvents) {
|
|
4766
4803
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
|
|
4767
|
-
const subscribeFn =
|
|
4768
|
-
const call =
|
|
4804
|
+
const subscribeFn = ts29.factory.createPropertyAccessExpression(outputField, "subscribe");
|
|
4805
|
+
const call = ts29.factory.createCallExpression(subscribeFn, void 0, [handler]);
|
|
4769
4806
|
addParseSpanInfo(call, output.sourceSpan);
|
|
4770
|
-
this.scope.addStatement(
|
|
4807
|
+
this.scope.addStatement(ts29.factory.createExpressionStatement(call));
|
|
4771
4808
|
} else {
|
|
4772
|
-
this.scope.addStatement(
|
|
4809
|
+
this.scope.addStatement(ts29.factory.createExpressionStatement(outputField));
|
|
4773
4810
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
4774
|
-
this.scope.addStatement(
|
|
4811
|
+
this.scope.addStatement(ts29.factory.createExpressionStatement(handler));
|
|
4775
4812
|
}
|
|
4776
4813
|
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
4777
4814
|
}
|
|
@@ -4804,24 +4841,24 @@ var TcbUnclaimedOutputsOp = class extends TcbOp {
|
|
|
4804
4841
|
if (output.type === 1) {
|
|
4805
4842
|
const eventType = this.tcb.env.config.checkTypeOfAnimationEvents ? this.tcb.env.referenceExternalType("@angular/animations", "AnimationEvent") : 1;
|
|
4806
4843
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, eventType);
|
|
4807
|
-
this.scope.addStatement(
|
|
4844
|
+
this.scope.addStatement(ts29.factory.createExpressionStatement(handler));
|
|
4808
4845
|
} else if (this.tcb.env.config.checkTypeOfDomEvents) {
|
|
4809
4846
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
|
|
4810
4847
|
if (elId === null) {
|
|
4811
4848
|
elId = this.scope.resolve(this.element);
|
|
4812
4849
|
}
|
|
4813
|
-
const propertyAccess =
|
|
4850
|
+
const propertyAccess = ts29.factory.createPropertyAccessExpression(elId, "addEventListener");
|
|
4814
4851
|
addParseSpanInfo(propertyAccess, output.keySpan);
|
|
4815
|
-
const call =
|
|
4852
|
+
const call = ts29.factory.createCallExpression(
|
|
4816
4853
|
propertyAccess,
|
|
4817
4854
|
void 0,
|
|
4818
|
-
[
|
|
4855
|
+
[ts29.factory.createStringLiteral(output.name), handler]
|
|
4819
4856
|
);
|
|
4820
4857
|
addParseSpanInfo(call, output.sourceSpan);
|
|
4821
|
-
this.scope.addStatement(
|
|
4858
|
+
this.scope.addStatement(ts29.factory.createExpressionStatement(call));
|
|
4822
4859
|
} else {
|
|
4823
4860
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
4824
|
-
this.scope.addStatement(
|
|
4861
|
+
this.scope.addStatement(ts29.factory.createExpressionStatement(handler));
|
|
4825
4862
|
}
|
|
4826
4863
|
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
4827
4864
|
}
|
|
@@ -4835,11 +4872,11 @@ var TcbComponentContextCompletionOp = class extends TcbOp {
|
|
|
4835
4872
|
this.optional = false;
|
|
4836
4873
|
}
|
|
4837
4874
|
execute() {
|
|
4838
|
-
const ctx =
|
|
4839
|
-
const ctxDot =
|
|
4875
|
+
const ctx = ts29.factory.createThis();
|
|
4876
|
+
const ctxDot = ts29.factory.createPropertyAccessExpression(ctx, "");
|
|
4840
4877
|
markIgnoreDiagnostics(ctxDot);
|
|
4841
4878
|
addExpressionIdentifier(ctxDot, ExpressionIdentifier.COMPONENT_COMPLETION);
|
|
4842
|
-
this.scope.addStatement(
|
|
4879
|
+
this.scope.addStatement(ts29.factory.createExpressionStatement(ctxDot));
|
|
4843
4880
|
return null;
|
|
4844
4881
|
}
|
|
4845
4882
|
};
|
|
@@ -4904,14 +4941,14 @@ var TcbIfOp = class extends TcbOp {
|
|
|
4904
4941
|
}
|
|
4905
4942
|
if (branch.expression === null) {
|
|
4906
4943
|
const branchScope = Scope.forNodes(this.tcb, this.scope, null, branch.children, this.generateBranchGuard(index));
|
|
4907
|
-
return
|
|
4944
|
+
return ts29.factory.createBlock(branchScope.render());
|
|
4908
4945
|
}
|
|
4909
4946
|
const expressionScope = Scope.forNodes(this.tcb, this.scope, branch, [], null);
|
|
4910
4947
|
expressionScope.render().forEach((stmt) => this.scope.addStatement(stmt));
|
|
4911
4948
|
this.expressionScopes.set(branch, expressionScope);
|
|
4912
4949
|
const expression = branch.expressionAlias === null ? tcbExpression(branch.expression, this.tcb, expressionScope) : expressionScope.resolve(branch.expressionAlias);
|
|
4913
4950
|
const bodyScope = Scope.forNodes(this.tcb, expressionScope, null, branch.children, this.generateBranchGuard(index));
|
|
4914
|
-
return
|
|
4951
|
+
return ts29.factory.createIfStatement(expression, ts29.factory.createBlock(bodyScope.render()), this.generateBranch(index + 1));
|
|
4915
4952
|
}
|
|
4916
4953
|
generateBranchGuard(index) {
|
|
4917
4954
|
let guard = null;
|
|
@@ -4931,8 +4968,8 @@ var TcbIfOp = class extends TcbOp {
|
|
|
4931
4968
|
} else {
|
|
4932
4969
|
expression = expressionScope.resolve(branch.expressionAlias);
|
|
4933
4970
|
}
|
|
4934
|
-
const comparisonExpression = i === index ? expression :
|
|
4935
|
-
guard = guard === null ? comparisonExpression :
|
|
4971
|
+
const comparisonExpression = i === index ? expression : ts29.factory.createPrefixUnaryExpression(ts29.SyntaxKind.ExclamationToken, ts29.factory.createParenthesizedExpression(expression));
|
|
4972
|
+
guard = guard === null ? comparisonExpression : ts29.factory.createBinaryExpression(guard, ts29.SyntaxKind.AmpersandAmpersandToken, comparisonExpression);
|
|
4936
4973
|
}
|
|
4937
4974
|
return guard;
|
|
4938
4975
|
}
|
|
@@ -4950,7 +4987,7 @@ var TcbSwitchOp = class extends TcbOp {
|
|
|
4950
4987
|
execute() {
|
|
4951
4988
|
const comparisonExpression = tcbExpression(this.block.expression, this.tcb, this.scope);
|
|
4952
4989
|
markIgnoreDiagnostics(comparisonExpression);
|
|
4953
|
-
const expression =
|
|
4990
|
+
const expression = ts29.factory.createParenthesizedExpression(comparisonExpression);
|
|
4954
4991
|
const root = this.generateCase(0, expression, null);
|
|
4955
4992
|
if (root !== void 0) {
|
|
4956
4993
|
this.scope.addStatement(root);
|
|
@@ -4961,7 +4998,7 @@ var TcbSwitchOp = class extends TcbOp {
|
|
|
4961
4998
|
if (index >= this.block.cases.length) {
|
|
4962
4999
|
if (defaultCase !== null) {
|
|
4963
5000
|
const defaultScope = Scope.forNodes(this.tcb, this.scope, null, defaultCase.children, this.generateGuard(defaultCase, switchValue));
|
|
4964
|
-
return
|
|
5001
|
+
return ts29.factory.createBlock(defaultScope.render());
|
|
4965
5002
|
}
|
|
4966
5003
|
return void 0;
|
|
4967
5004
|
}
|
|
@@ -4971,13 +5008,13 @@ var TcbSwitchOp = class extends TcbOp {
|
|
|
4971
5008
|
}
|
|
4972
5009
|
const caseScope = Scope.forNodes(this.tcb, this.scope, null, current.children, this.generateGuard(current, switchValue));
|
|
4973
5010
|
const caseValue = tcbExpression(current.expression, this.tcb, caseScope);
|
|
4974
|
-
return
|
|
5011
|
+
return ts29.factory.createIfStatement(ts29.factory.createBinaryExpression(switchValue, ts29.SyntaxKind.EqualsEqualsEqualsToken, caseValue), ts29.factory.createBlock(caseScope.render()), this.generateCase(index + 1, switchValue, defaultCase));
|
|
4975
5012
|
}
|
|
4976
5013
|
generateGuard(node, switchValue) {
|
|
4977
5014
|
if (node.expression !== null) {
|
|
4978
5015
|
const expression = tcbExpression(node.expression, this.tcb, this.scope);
|
|
4979
5016
|
markIgnoreDiagnostics(expression);
|
|
4980
|
-
return
|
|
5017
|
+
return ts29.factory.createBinaryExpression(switchValue, ts29.SyntaxKind.EqualsEqualsEqualsToken, expression);
|
|
4981
5018
|
}
|
|
4982
5019
|
let guard = null;
|
|
4983
5020
|
for (const current of this.block.cases) {
|
|
@@ -4986,11 +5023,11 @@ var TcbSwitchOp = class extends TcbOp {
|
|
|
4986
5023
|
}
|
|
4987
5024
|
const expression = tcbExpression(current.expression, this.tcb, this.scope);
|
|
4988
5025
|
markIgnoreDiagnostics(expression);
|
|
4989
|
-
const comparison =
|
|
5026
|
+
const comparison = ts29.factory.createBinaryExpression(switchValue, ts29.SyntaxKind.ExclamationEqualsEqualsToken, expression);
|
|
4990
5027
|
if (guard === null) {
|
|
4991
5028
|
guard = comparison;
|
|
4992
5029
|
} else {
|
|
4993
|
-
guard =
|
|
5030
|
+
guard = ts29.factory.createBinaryExpression(guard, ts29.SyntaxKind.AmpersandAmpersandToken, comparison);
|
|
4994
5031
|
}
|
|
4995
5032
|
}
|
|
4996
5033
|
return guard;
|
|
@@ -5009,23 +5046,23 @@ var TcbForOfOp = class extends TcbOp {
|
|
|
5009
5046
|
execute() {
|
|
5010
5047
|
const loopScope = Scope.forNodes(this.tcb, this.scope, this.block, this.block.children, null);
|
|
5011
5048
|
const initializerId = loopScope.resolve(this.block.item);
|
|
5012
|
-
if (!
|
|
5049
|
+
if (!ts29.isIdentifier(initializerId)) {
|
|
5013
5050
|
throw new Error(`Could not resolve for loop variable ${this.block.item.name} to an identifier`);
|
|
5014
5051
|
}
|
|
5015
|
-
const initializer =
|
|
5052
|
+
const initializer = ts29.factory.createVariableDeclarationList([ts29.factory.createVariableDeclaration(initializerId)], ts29.NodeFlags.Const);
|
|
5016
5053
|
addParseSpanInfo(initializer, this.block.item.keySpan);
|
|
5017
|
-
const expression =
|
|
5054
|
+
const expression = ts29.factory.createNonNullExpression(tcbExpression(this.block.expression, this.tcb, loopScope));
|
|
5018
5055
|
const trackTranslator = new TcbForLoopTrackTranslator(this.tcb, loopScope, this.block);
|
|
5019
5056
|
const trackExpression = trackTranslator.translate(this.block.trackBy);
|
|
5020
5057
|
const statements = [
|
|
5021
5058
|
...loopScope.render(),
|
|
5022
|
-
|
|
5059
|
+
ts29.factory.createExpressionStatement(trackExpression)
|
|
5023
5060
|
];
|
|
5024
|
-
this.scope.addStatement(
|
|
5061
|
+
this.scope.addStatement(ts29.factory.createForOfStatement(void 0, initializer, expression, ts29.factory.createBlock(statements)));
|
|
5025
5062
|
return null;
|
|
5026
5063
|
}
|
|
5027
5064
|
};
|
|
5028
|
-
var INFER_TYPE_FOR_CIRCULAR_OP_EXPR =
|
|
5065
|
+
var INFER_TYPE_FOR_CIRCULAR_OP_EXPR = ts29.factory.createNonNullExpression(ts29.factory.createNull());
|
|
5029
5066
|
var Context = class {
|
|
5030
5067
|
constructor(env, domSchemaChecker, oobRecorder, id, boundTarget, pipes, schemas, hostIsStandalone, hostPreserveWhitespaces) {
|
|
5031
5068
|
this.env = env;
|
|
@@ -5040,7 +5077,7 @@ var Context = class {
|
|
|
5040
5077
|
this.nextId = 1;
|
|
5041
5078
|
}
|
|
5042
5079
|
allocateId() {
|
|
5043
|
-
return
|
|
5080
|
+
return ts29.factory.createIdentifier(`_t${this.nextId++}`);
|
|
5044
5081
|
}
|
|
5045
5082
|
getPipeByName(name) {
|
|
5046
5083
|
if (!this.pipes.has(name)) {
|
|
@@ -5091,7 +5128,7 @@ var _Scope = class {
|
|
|
5091
5128
|
if (!this.forLoopContextVariableTypes.has(name)) {
|
|
5092
5129
|
throw new Error(`Unrecognized for loop context variable ${name}`);
|
|
5093
5130
|
}
|
|
5094
|
-
const type =
|
|
5131
|
+
const type = ts29.factory.createKeywordTypeNode(this.forLoopContextVariableTypes.get(name));
|
|
5095
5132
|
this.registerVariable(scope, variable, new TcbBlockImplicitVariableOp(tcb, scope, type, variable));
|
|
5096
5133
|
}
|
|
5097
5134
|
}
|
|
@@ -5108,16 +5145,16 @@ var _Scope = class {
|
|
|
5108
5145
|
const res = this.resolveLocal(node, directive);
|
|
5109
5146
|
if (res !== null) {
|
|
5110
5147
|
let clone;
|
|
5111
|
-
if (
|
|
5112
|
-
clone =
|
|
5113
|
-
} else if (
|
|
5114
|
-
clone =
|
|
5148
|
+
if (ts29.isIdentifier(res)) {
|
|
5149
|
+
clone = ts29.factory.createIdentifier(res.text);
|
|
5150
|
+
} else if (ts29.isNonNullExpression(res)) {
|
|
5151
|
+
clone = ts29.factory.createNonNullExpression(res.expression);
|
|
5115
5152
|
} else {
|
|
5116
5153
|
throw new Error(`Could not resolve ${node} to an Identifier or a NonNullExpression`);
|
|
5117
5154
|
}
|
|
5118
|
-
|
|
5155
|
+
ts29.setOriginalNode(clone, res);
|
|
5119
5156
|
clone.parent = clone.parent;
|
|
5120
|
-
return
|
|
5157
|
+
return ts29.setSyntheticTrailingComments(clone, []);
|
|
5121
5158
|
} else if (this.parent !== null) {
|
|
5122
5159
|
return this.parent.resolve(node, directive);
|
|
5123
5160
|
} else {
|
|
@@ -5144,7 +5181,7 @@ var _Scope = class {
|
|
|
5144
5181
|
} else if (parentGuards === null) {
|
|
5145
5182
|
return this.guard;
|
|
5146
5183
|
} else {
|
|
5147
|
-
return
|
|
5184
|
+
return ts29.factory.createBinaryExpression(parentGuards, ts29.SyntaxKind.AmpersandAmpersandToken, this.guard);
|
|
5148
5185
|
}
|
|
5149
5186
|
}
|
|
5150
5187
|
resolveLocal(ref, directive) {
|
|
@@ -5392,21 +5429,21 @@ var _Scope = class {
|
|
|
5392
5429
|
var Scope = _Scope;
|
|
5393
5430
|
(() => {
|
|
5394
5431
|
_Scope.forLoopContextVariableTypes = /* @__PURE__ */ new Map([
|
|
5395
|
-
["$first",
|
|
5396
|
-
["$last",
|
|
5397
|
-
["$even",
|
|
5398
|
-
["$odd",
|
|
5399
|
-
["$index",
|
|
5400
|
-
["$count",
|
|
5432
|
+
["$first", ts29.SyntaxKind.BooleanKeyword],
|
|
5433
|
+
["$last", ts29.SyntaxKind.BooleanKeyword],
|
|
5434
|
+
["$even", ts29.SyntaxKind.BooleanKeyword],
|
|
5435
|
+
["$odd", ts29.SyntaxKind.BooleanKeyword],
|
|
5436
|
+
["$index", ts29.SyntaxKind.NumberKeyword],
|
|
5437
|
+
["$count", ts29.SyntaxKind.NumberKeyword]
|
|
5401
5438
|
]);
|
|
5402
5439
|
})();
|
|
5403
5440
|
function tcbThisParam(name, typeArguments) {
|
|
5404
|
-
return
|
|
5441
|
+
return ts29.factory.createParameterDeclaration(
|
|
5405
5442
|
void 0,
|
|
5406
5443
|
void 0,
|
|
5407
5444
|
"this",
|
|
5408
5445
|
void 0,
|
|
5409
|
-
|
|
5446
|
+
ts29.factory.createTypeReferenceNode(name, typeArguments),
|
|
5410
5447
|
void 0
|
|
5411
5448
|
);
|
|
5412
5449
|
}
|
|
@@ -5431,11 +5468,11 @@ var TcbExpressionTranslator = class {
|
|
|
5431
5468
|
return null;
|
|
5432
5469
|
}
|
|
5433
5470
|
const expr = this.translate(ast.value);
|
|
5434
|
-
const result =
|
|
5471
|
+
const result = ts29.factory.createParenthesizedExpression(ts29.factory.createBinaryExpression(target, ts29.SyntaxKind.EqualsToken, expr));
|
|
5435
5472
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
5436
5473
|
return result;
|
|
5437
5474
|
} else if (ast instanceof ImplicitReceiver4) {
|
|
5438
|
-
return
|
|
5475
|
+
return ts29.factory.createThis();
|
|
5439
5476
|
} else if (ast instanceof BindingPipe) {
|
|
5440
5477
|
const expr = this.translate(ast.exp);
|
|
5441
5478
|
const pipeMeta = this.tcb.getPipeByName(ast.name);
|
|
@@ -5450,12 +5487,12 @@ var TcbExpressionTranslator = class {
|
|
|
5450
5487
|
pipe = this.tcb.env.pipeInst(pipeMeta.ref);
|
|
5451
5488
|
}
|
|
5452
5489
|
const args = ast.args.map((arg) => this.translate(arg));
|
|
5453
|
-
let methodAccess =
|
|
5490
|
+
let methodAccess = ts29.factory.createPropertyAccessExpression(pipe, "transform");
|
|
5454
5491
|
addParseSpanInfo(methodAccess, ast.nameSpan);
|
|
5455
5492
|
if (!this.tcb.env.config.checkTypeOfPipes) {
|
|
5456
|
-
methodAccess =
|
|
5493
|
+
methodAccess = ts29.factory.createAsExpression(methodAccess, ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
|
|
5457
5494
|
}
|
|
5458
|
-
const result =
|
|
5495
|
+
const result = ts29.factory.createCallExpression(
|
|
5459
5496
|
methodAccess,
|
|
5460
5497
|
void 0,
|
|
5461
5498
|
[expr, ...args]
|
|
@@ -5465,8 +5502,8 @@ var TcbExpressionTranslator = class {
|
|
|
5465
5502
|
} else if ((ast instanceof Call2 || ast instanceof SafeCall) && (ast.receiver instanceof PropertyRead4 || ast.receiver instanceof SafePropertyRead3)) {
|
|
5466
5503
|
if (ast.receiver.receiver instanceof ImplicitReceiver4 && !(ast.receiver.receiver instanceof ThisReceiver) && ast.receiver.name === "$any" && ast.args.length === 1) {
|
|
5467
5504
|
const expr = this.translate(ast.args[0]);
|
|
5468
|
-
const exprAsAny =
|
|
5469
|
-
const result =
|
|
5505
|
+
const exprAsAny = ts29.factory.createAsExpression(expr, ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
|
|
5506
|
+
const result = ts29.factory.createParenthesizedExpression(exprAsAny);
|
|
5470
5507
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
5471
5508
|
return result;
|
|
5472
5509
|
}
|
|
@@ -5477,7 +5514,7 @@ var TcbExpressionTranslator = class {
|
|
|
5477
5514
|
const method = wrapForDiagnostics(receiver);
|
|
5478
5515
|
addParseSpanInfo(method, ast.receiver.nameSpan);
|
|
5479
5516
|
const args = ast.args.map((arg) => this.translate(arg));
|
|
5480
|
-
const node =
|
|
5517
|
+
const node = ts29.factory.createCallExpression(method, void 0, args);
|
|
5481
5518
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
5482
5519
|
return node;
|
|
5483
5520
|
} else {
|
|
@@ -5497,23 +5534,23 @@ var TcbExpressionTranslator = class {
|
|
|
5497
5534
|
function tcbCallTypeCtor(dir, tcb, inputs) {
|
|
5498
5535
|
const typeCtor = tcb.env.typeCtorFor(dir);
|
|
5499
5536
|
const members = inputs.map((input) => {
|
|
5500
|
-
const propertyName =
|
|
5537
|
+
const propertyName = ts29.factory.createStringLiteral(input.field);
|
|
5501
5538
|
if (input.type === "binding") {
|
|
5502
5539
|
let expr = widenBinding(input.expression, tcb);
|
|
5503
5540
|
if (input.isTwoWayBinding && tcb.env.config.allowSignalsInTwoWayBindings) {
|
|
5504
5541
|
expr = unwrapWritableSignal(expr, tcb);
|
|
5505
5542
|
}
|
|
5506
|
-
const assignment =
|
|
5543
|
+
const assignment = ts29.factory.createPropertyAssignment(propertyName, wrapForDiagnostics(expr));
|
|
5507
5544
|
addParseSpanInfo(assignment, input.sourceSpan);
|
|
5508
5545
|
return assignment;
|
|
5509
5546
|
} else {
|
|
5510
|
-
return
|
|
5547
|
+
return ts29.factory.createPropertyAssignment(propertyName, NULL_AS_ANY);
|
|
5511
5548
|
}
|
|
5512
5549
|
});
|
|
5513
|
-
return
|
|
5550
|
+
return ts29.factory.createCallExpression(
|
|
5514
5551
|
typeCtor,
|
|
5515
5552
|
void 0,
|
|
5516
|
-
[
|
|
5553
|
+
[ts29.factory.createObjectLiteralExpression(members)]
|
|
5517
5554
|
);
|
|
5518
5555
|
}
|
|
5519
5556
|
function getBoundAttributes(directive, node) {
|
|
@@ -5550,17 +5587,17 @@ function translateInput(attr, tcb, scope) {
|
|
|
5550
5587
|
if (attr instanceof TmplAstBoundAttribute) {
|
|
5551
5588
|
return tcbExpression(attr.value, tcb, scope);
|
|
5552
5589
|
} else {
|
|
5553
|
-
return
|
|
5590
|
+
return ts29.factory.createStringLiteral(attr.value);
|
|
5554
5591
|
}
|
|
5555
5592
|
}
|
|
5556
5593
|
function widenBinding(expr, tcb) {
|
|
5557
5594
|
if (!tcb.env.config.checkTypeOfInputBindings) {
|
|
5558
5595
|
return tsCastToAny(expr);
|
|
5559
5596
|
} else if (!tcb.env.config.strictNullInputBindings) {
|
|
5560
|
-
if (
|
|
5597
|
+
if (ts29.isObjectLiteralExpression(expr) || ts29.isArrayLiteralExpression(expr)) {
|
|
5561
5598
|
return expr;
|
|
5562
5599
|
} else {
|
|
5563
|
-
return
|
|
5600
|
+
return ts29.factory.createNonNullExpression(expr);
|
|
5564
5601
|
}
|
|
5565
5602
|
} else {
|
|
5566
5603
|
return expr;
|
|
@@ -5568,7 +5605,7 @@ function widenBinding(expr, tcb) {
|
|
|
5568
5605
|
}
|
|
5569
5606
|
function unwrapWritableSignal(expression, tcb) {
|
|
5570
5607
|
const unwrapRef = tcb.env.referenceExternalSymbol(R3Identifiers3.unwrapWritableSignal.moduleName, R3Identifiers3.unwrapWritableSignal.name);
|
|
5571
|
-
return
|
|
5608
|
+
return ts29.factory.createCallExpression(unwrapRef, void 0, [expression]);
|
|
5572
5609
|
}
|
|
5573
5610
|
var EVENT_PARAMETER = "$event";
|
|
5574
5611
|
function tcbCreateEventHandler(event, tcb, scope, eventType) {
|
|
@@ -5577,16 +5614,16 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
|
|
|
5577
5614
|
if (eventType === 0) {
|
|
5578
5615
|
eventParamType = void 0;
|
|
5579
5616
|
} else if (eventType === 1) {
|
|
5580
|
-
eventParamType =
|
|
5617
|
+
eventParamType = ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword);
|
|
5581
5618
|
} else {
|
|
5582
5619
|
eventParamType = eventType;
|
|
5583
5620
|
}
|
|
5584
5621
|
const guards = scope.guards();
|
|
5585
|
-
let body =
|
|
5622
|
+
let body = ts29.factory.createExpressionStatement(handler);
|
|
5586
5623
|
if (guards !== null) {
|
|
5587
|
-
body =
|
|
5624
|
+
body = ts29.factory.createIfStatement(guards, body);
|
|
5588
5625
|
}
|
|
5589
|
-
const eventParam =
|
|
5626
|
+
const eventParam = ts29.factory.createParameterDeclaration(
|
|
5590
5627
|
void 0,
|
|
5591
5628
|
void 0,
|
|
5592
5629
|
EVENT_PARAMETER,
|
|
@@ -5594,13 +5631,13 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
|
|
|
5594
5631
|
eventParamType
|
|
5595
5632
|
);
|
|
5596
5633
|
addExpressionIdentifier(eventParam, ExpressionIdentifier.EVENT_PARAMETER);
|
|
5597
|
-
return
|
|
5634
|
+
return ts29.factory.createArrowFunction(
|
|
5598
5635
|
void 0,
|
|
5599
5636
|
void 0,
|
|
5600
5637
|
[eventParam],
|
|
5601
|
-
|
|
5638
|
+
ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword),
|
|
5602
5639
|
void 0,
|
|
5603
|
-
|
|
5640
|
+
ts29.factory.createBlock([body])
|
|
5604
5641
|
);
|
|
5605
5642
|
}
|
|
5606
5643
|
function tcbEventHandlerExpression(ast, tcb, scope) {
|
|
@@ -5629,7 +5666,7 @@ function isSplitTwoWayBinding(inputName, output, inputs, tcb) {
|
|
|
5629
5666
|
var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
|
|
5630
5667
|
resolve(ast) {
|
|
5631
5668
|
if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver4 && !(ast.receiver instanceof ThisReceiver) && ast.name === EVENT_PARAMETER) {
|
|
5632
|
-
const event =
|
|
5669
|
+
const event = ts29.factory.createIdentifier(EVENT_PARAMETER);
|
|
5633
5670
|
addParseSpanInfo(event, ast.nameSpan);
|
|
5634
5671
|
return event;
|
|
5635
5672
|
}
|
|
@@ -5652,34 +5689,34 @@ var TcbForLoopTrackTranslator = class extends TcbExpressionTranslator {
|
|
|
5652
5689
|
}
|
|
5653
5690
|
};
|
|
5654
5691
|
|
|
5655
|
-
// bazel-out/
|
|
5656
|
-
import
|
|
5692
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_file.mjs
|
|
5693
|
+
import ts30 from "typescript";
|
|
5657
5694
|
var TypeCheckFile = class extends Environment {
|
|
5658
5695
|
constructor(fileName, config, refEmitter, reflector, compilerHost) {
|
|
5659
|
-
super(config, new ImportManager(new NoopImportRewriter(), "i"), refEmitter, reflector,
|
|
5696
|
+
super(config, new ImportManager(new NoopImportRewriter(), "i"), refEmitter, reflector, ts30.createSourceFile(compilerHost.getCanonicalFileName(fileName), "", ts30.ScriptTarget.Latest, true));
|
|
5660
5697
|
this.fileName = fileName;
|
|
5661
5698
|
this.nextTcbId = 1;
|
|
5662
5699
|
this.tcbStatements = [];
|
|
5663
5700
|
}
|
|
5664
5701
|
addTypeCheckBlock(ref, meta, domSchemaChecker, oobRecorder, genericContextBehavior) {
|
|
5665
|
-
const fnId =
|
|
5702
|
+
const fnId = ts30.factory.createIdentifier(`_tcb${this.nextTcbId++}`);
|
|
5666
5703
|
const fn = generateTypeCheckBlock(this, ref, fnId, meta, domSchemaChecker, oobRecorder, genericContextBehavior);
|
|
5667
5704
|
this.tcbStatements.push(fn);
|
|
5668
5705
|
}
|
|
5669
5706
|
render(removeComments) {
|
|
5670
5707
|
ensureTypeCheckFilePreparationImports(this);
|
|
5671
5708
|
let source = this.importManager.getAllImports(this.contextFile.fileName).map(getImportString).join("\n") + "\n\n";
|
|
5672
|
-
const printer =
|
|
5709
|
+
const printer = ts30.createPrinter({ removeComments });
|
|
5673
5710
|
source += "\n";
|
|
5674
5711
|
for (const stmt of this.pipeInstStatements) {
|
|
5675
|
-
source += printer.printNode(
|
|
5712
|
+
source += printer.printNode(ts30.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
5676
5713
|
}
|
|
5677
5714
|
for (const stmt of this.typeCtorStatements) {
|
|
5678
|
-
source += printer.printNode(
|
|
5715
|
+
source += printer.printNode(ts30.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
5679
5716
|
}
|
|
5680
5717
|
source += "\n";
|
|
5681
5718
|
for (const stmt of this.tcbStatements) {
|
|
5682
|
-
source += printer.printNode(
|
|
5719
|
+
source += printer.printNode(ts30.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
5683
5720
|
}
|
|
5684
5721
|
source += "\nexport const IS_A_MODULE = true;\n";
|
|
5685
5722
|
return source;
|
|
@@ -5689,7 +5726,7 @@ var TypeCheckFile = class extends Environment {
|
|
|
5689
5726
|
}
|
|
5690
5727
|
};
|
|
5691
5728
|
|
|
5692
|
-
// bazel-out/
|
|
5729
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
|
|
5693
5730
|
var InliningMode;
|
|
5694
5731
|
(function(InliningMode2) {
|
|
5695
5732
|
InliningMode2[InliningMode2["InlineOps"] = 0] = "InlineOps";
|
|
@@ -5795,7 +5832,7 @@ var TypeCheckContextImpl = class {
|
|
|
5795
5832
|
const importManager = new ImportManager(new NoopImportRewriter(), "_i");
|
|
5796
5833
|
const ops = this.opMap.get(sf).sort(orderOps);
|
|
5797
5834
|
const textParts = splitStringAtPoints(sf.text, ops.map((op) => op.splitPoint));
|
|
5798
|
-
const printer =
|
|
5835
|
+
const printer = ts31.createPrinter({ omitTrailingSemicolon: true });
|
|
5799
5836
|
let code = textParts[0];
|
|
5800
5837
|
ops.forEach((op, idx) => {
|
|
5801
5838
|
const text = op.execute(importManager, sf, this.refEmitter, printer);
|
|
@@ -5876,7 +5913,7 @@ var TypeCheckContextImpl = class {
|
|
|
5876
5913
|
if (span.start.offset === span.end.offset) {
|
|
5877
5914
|
span.end.offset++;
|
|
5878
5915
|
}
|
|
5879
|
-
return makeTemplateDiagnostic(templateId, sourceMapping, span,
|
|
5916
|
+
return makeTemplateDiagnostic(templateId, sourceMapping, span, ts31.DiagnosticCategory.Error, ngErrorCode(ErrorCode.TEMPLATE_PARSE_ERROR), error.msg);
|
|
5880
5917
|
});
|
|
5881
5918
|
}
|
|
5882
5919
|
};
|
|
@@ -5894,9 +5931,9 @@ var InlineTcbOp = class {
|
|
|
5894
5931
|
}
|
|
5895
5932
|
execute(im, sf, refEmitter, printer) {
|
|
5896
5933
|
const env = new Environment(this.config, im, refEmitter, this.reflector, sf);
|
|
5897
|
-
const fnName =
|
|
5934
|
+
const fnName = ts31.factory.createIdentifier(`_tcb_${this.ref.node.pos}`);
|
|
5898
5935
|
const fn = generateTypeCheckBlock(env, this.ref, fnName, this.meta, this.domSchemaChecker, this.oobRecorder, TcbGenericContextBehavior.CopyClassNodes);
|
|
5899
|
-
return printer.printNode(
|
|
5936
|
+
return printer.printNode(ts31.EmitHint.Unspecified, fn, sf);
|
|
5900
5937
|
}
|
|
5901
5938
|
};
|
|
5902
5939
|
var TypeCtorOp = class {
|
|
@@ -5911,7 +5948,7 @@ var TypeCtorOp = class {
|
|
|
5911
5948
|
execute(im, sf, refEmitter, printer) {
|
|
5912
5949
|
const emitEnv = new ReferenceEmitEnvironment(im, refEmitter, this.reflector, sf);
|
|
5913
5950
|
const tcb = generateInlineTypeCtor(emitEnv, this.ref.node, this.meta);
|
|
5914
|
-
return printer.printNode(
|
|
5951
|
+
return printer.printNode(ts31.EmitHint.Unspecified, tcb, sf);
|
|
5915
5952
|
}
|
|
5916
5953
|
};
|
|
5917
5954
|
function orderOps(op1, op2) {
|
|
@@ -5929,10 +5966,10 @@ function splitStringAtPoints(str, points) {
|
|
|
5929
5966
|
return splits;
|
|
5930
5967
|
}
|
|
5931
5968
|
|
|
5932
|
-
// bazel-out/
|
|
5969
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/source.mjs
|
|
5933
5970
|
import { ParseLocation, ParseSourceSpan } from "@angular/compiler";
|
|
5934
5971
|
|
|
5935
|
-
// bazel-out/
|
|
5972
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/line_mappings.mjs
|
|
5936
5973
|
var LF_CHAR = 10;
|
|
5937
5974
|
var CR_CHAR = 13;
|
|
5938
5975
|
var LINE_SEP_CHAR = 8232;
|
|
@@ -5973,7 +6010,7 @@ function findClosestLineStartPosition(linesMap, position, low = 0, high = linesM
|
|
|
5973
6010
|
return low - 1;
|
|
5974
6011
|
}
|
|
5975
6012
|
|
|
5976
|
-
// bazel-out/
|
|
6013
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/source.mjs
|
|
5977
6014
|
var TemplateSource = class {
|
|
5978
6015
|
constructor(mapping, file) {
|
|
5979
6016
|
this.mapping = mapping;
|
|
@@ -6024,9 +6061,9 @@ var TemplateSourceManager = class {
|
|
|
6024
6061
|
}
|
|
6025
6062
|
};
|
|
6026
6063
|
|
|
6027
|
-
// bazel-out/
|
|
6064
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_symbol_builder.mjs
|
|
6028
6065
|
import { AST, ASTWithSource as ASTWithSource3, BindingPipe as BindingPipe2, PropertyRead as PropertyRead5, PropertyWrite as PropertyWrite4, R3Identifiers as R3Identifiers4, 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";
|
|
6029
|
-
import
|
|
6066
|
+
import ts32 from "typescript";
|
|
6030
6067
|
var SymbolBuilder = class {
|
|
6031
6068
|
constructor(tcbPath, tcbIsShim, typeCheckBlock, templateData, componentScopeReader, getTypeChecker) {
|
|
6032
6069
|
this.tcbPath = tcbPath;
|
|
@@ -6070,7 +6107,7 @@ var SymbolBuilder = class {
|
|
|
6070
6107
|
getSymbolOfElement(element) {
|
|
6071
6108
|
var _a;
|
|
6072
6109
|
const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
|
|
6073
|
-
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: elementSourceSpan, filter:
|
|
6110
|
+
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: elementSourceSpan, filter: ts32.isVariableDeclaration });
|
|
6074
6111
|
if (node === null) {
|
|
6075
6112
|
return null;
|
|
6076
6113
|
}
|
|
@@ -6090,12 +6127,12 @@ var SymbolBuilder = class {
|
|
|
6090
6127
|
var _a;
|
|
6091
6128
|
const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
|
|
6092
6129
|
const tcbSourceFile = this.typeCheckBlock.getSourceFile();
|
|
6093
|
-
const isDirectiveDeclaration = (node) => (
|
|
6130
|
+
const isDirectiveDeclaration = (node) => (ts32.isTypeNode(node) || ts32.isIdentifier(node)) && ts32.isVariableDeclaration(node.parent) && hasExpressionIdentifier(tcbSourceFile, node, ExpressionIdentifier.DIRECTIVE);
|
|
6094
6131
|
const nodes = findAllMatchingNodes(this.typeCheckBlock, { withSpan: elementSourceSpan, filter: isDirectiveDeclaration });
|
|
6095
6132
|
const symbols = [];
|
|
6096
6133
|
for (const node of nodes) {
|
|
6097
6134
|
const symbol = this.getSymbolOfTsNode(node.parent);
|
|
6098
|
-
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !
|
|
6135
|
+
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts32.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
|
|
6099
6136
|
continue;
|
|
6100
6137
|
}
|
|
6101
6138
|
const meta = this.getDirectiveMeta(element, symbol.tsSymbol.valueDeclaration);
|
|
@@ -6126,7 +6163,7 @@ var SymbolBuilder = class {
|
|
|
6126
6163
|
if (!isHostDirectiveMetaForGlobalMode(current)) {
|
|
6127
6164
|
throw new Error("Impossible state: typecheck code path in local compilation mode.");
|
|
6128
6165
|
}
|
|
6129
|
-
if (!
|
|
6166
|
+
if (!ts32.isClassDeclaration(current.directive.node)) {
|
|
6130
6167
|
continue;
|
|
6131
6168
|
}
|
|
6132
6169
|
const symbol = this.getSymbolOfTsNode(current.directive.node);
|
|
@@ -6199,17 +6236,17 @@ var SymbolBuilder = class {
|
|
|
6199
6236
|
if (!isAccessExpression(n)) {
|
|
6200
6237
|
return false;
|
|
6201
6238
|
}
|
|
6202
|
-
if (
|
|
6239
|
+
if (ts32.isPropertyAccessExpression(n)) {
|
|
6203
6240
|
return n.name.getText() === expectedAccess;
|
|
6204
6241
|
} else {
|
|
6205
|
-
return
|
|
6242
|
+
return ts32.isStringLiteral(n.argumentExpression) && n.argumentExpression.text === expectedAccess;
|
|
6206
6243
|
}
|
|
6207
6244
|
}
|
|
6208
6245
|
const outputFieldAccesses = findAllMatchingNodes(this.typeCheckBlock, { withSpan: eventBinding.keySpan, filter });
|
|
6209
6246
|
const bindings = [];
|
|
6210
6247
|
for (const outputFieldAccess of outputFieldAccesses) {
|
|
6211
6248
|
if (consumer instanceof TmplAstTemplate3 || consumer instanceof TmplAstElement4) {
|
|
6212
|
-
if (!
|
|
6249
|
+
if (!ts32.isPropertyAccessExpression(outputFieldAccess)) {
|
|
6213
6250
|
continue;
|
|
6214
6251
|
}
|
|
6215
6252
|
const addEventListener = outputFieldAccess.name;
|
|
@@ -6232,7 +6269,7 @@ var SymbolBuilder = class {
|
|
|
6232
6269
|
}
|
|
6233
6270
|
});
|
|
6234
6271
|
} else {
|
|
6235
|
-
if (!
|
|
6272
|
+
if (!ts32.isElementAccessExpression(outputFieldAccess)) {
|
|
6236
6273
|
continue;
|
|
6237
6274
|
}
|
|
6238
6275
|
const tsSymbol = this.getTypeChecker().getSymbolAtLocation(outputFieldAccess.argumentExpression);
|
|
@@ -6318,7 +6355,7 @@ var SymbolBuilder = class {
|
|
|
6318
6355
|
return null;
|
|
6319
6356
|
}
|
|
6320
6357
|
const [declaration] = tsSymbol.declarations;
|
|
6321
|
-
if (!
|
|
6358
|
+
if (!ts32.isVariableDeclaration(declaration) || !hasExpressionIdentifier(
|
|
6322
6359
|
declaration.getSourceFile(),
|
|
6323
6360
|
(_a = declaration.type) != null ? _a : declaration.name,
|
|
6324
6361
|
ExpressionIdentifier.DIRECTIVE
|
|
@@ -6326,7 +6363,7 @@ var SymbolBuilder = class {
|
|
|
6326
6363
|
return null;
|
|
6327
6364
|
}
|
|
6328
6365
|
const symbol = this.getSymbolOfTsNode(declaration);
|
|
6329
|
-
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !
|
|
6366
|
+
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts32.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
|
|
6330
6367
|
return null;
|
|
6331
6368
|
}
|
|
6332
6369
|
const ref = new Reference(symbol.tsSymbol.valueDeclaration);
|
|
@@ -6346,12 +6383,12 @@ var SymbolBuilder = class {
|
|
|
6346
6383
|
};
|
|
6347
6384
|
}
|
|
6348
6385
|
getSymbolOfVariable(variable) {
|
|
6349
|
-
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: variable.sourceSpan, filter:
|
|
6386
|
+
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: variable.sourceSpan, filter: ts32.isVariableDeclaration });
|
|
6350
6387
|
if (node === null) {
|
|
6351
6388
|
return null;
|
|
6352
6389
|
}
|
|
6353
6390
|
let nodeValueSymbol = null;
|
|
6354
|
-
if (
|
|
6391
|
+
if (ts32.isForOfStatement(node.parent.parent)) {
|
|
6355
6392
|
nodeValueSymbol = this.getSymbolOfTsNode(node);
|
|
6356
6393
|
} else if (node.initializer !== void 0) {
|
|
6357
6394
|
nodeValueSymbol = this.getSymbolOfTsNode(node.initializer);
|
|
@@ -6374,11 +6411,11 @@ var SymbolBuilder = class {
|
|
|
6374
6411
|
}
|
|
6375
6412
|
getSymbolOfReference(ref) {
|
|
6376
6413
|
const target = this.templateData.boundTarget.getReferenceTarget(ref);
|
|
6377
|
-
let node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: ref.sourceSpan, filter:
|
|
6414
|
+
let node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: ref.sourceSpan, filter: ts32.isVariableDeclaration });
|
|
6378
6415
|
if (node === null || target === null || node.initializer === void 0) {
|
|
6379
6416
|
return null;
|
|
6380
6417
|
}
|
|
6381
|
-
const originalDeclaration =
|
|
6418
|
+
const originalDeclaration = ts32.isParenthesizedExpression(node.initializer) && ts32.isAsExpression(node.initializer.expression) ? this.getTypeChecker().getSymbolAtLocation(node.name) : this.getTypeChecker().getSymbolAtLocation(node.initializer);
|
|
6382
6419
|
if (originalDeclaration === void 0 || originalDeclaration.valueDeclaration === void 0) {
|
|
6383
6420
|
return null;
|
|
6384
6421
|
}
|
|
@@ -6402,7 +6439,7 @@ var SymbolBuilder = class {
|
|
|
6402
6439
|
referenceVarLocation: referenceVarTcbLocation
|
|
6403
6440
|
};
|
|
6404
6441
|
} else {
|
|
6405
|
-
if (!
|
|
6442
|
+
if (!ts32.isClassDeclaration(target.directive.ref.node)) {
|
|
6406
6443
|
return null;
|
|
6407
6444
|
}
|
|
6408
6445
|
return {
|
|
@@ -6417,7 +6454,7 @@ var SymbolBuilder = class {
|
|
|
6417
6454
|
}
|
|
6418
6455
|
}
|
|
6419
6456
|
getSymbolOfPipe(expression) {
|
|
6420
|
-
const methodAccess = findFirstMatchingNode(this.typeCheckBlock, { withSpan: expression.nameSpan, filter:
|
|
6457
|
+
const methodAccess = findFirstMatchingNode(this.typeCheckBlock, { withSpan: expression.nameSpan, filter: ts32.isPropertyAccessExpression });
|
|
6421
6458
|
if (methodAccess === null) {
|
|
6422
6459
|
return null;
|
|
6423
6460
|
}
|
|
@@ -6457,7 +6494,7 @@ var SymbolBuilder = class {
|
|
|
6457
6494
|
}
|
|
6458
6495
|
let node = null;
|
|
6459
6496
|
if (expression instanceof PropertyRead5) {
|
|
6460
|
-
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter:
|
|
6497
|
+
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: ts32.isPropertyAccessExpression });
|
|
6461
6498
|
}
|
|
6462
6499
|
if (node === null) {
|
|
6463
6500
|
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: anyNodeFilter });
|
|
@@ -6465,10 +6502,10 @@ var SymbolBuilder = class {
|
|
|
6465
6502
|
if (node === null) {
|
|
6466
6503
|
return null;
|
|
6467
6504
|
}
|
|
6468
|
-
while (
|
|
6505
|
+
while (ts32.isParenthesizedExpression(node)) {
|
|
6469
6506
|
node = node.expression;
|
|
6470
6507
|
}
|
|
6471
|
-
if (expression instanceof SafePropertyRead4 &&
|
|
6508
|
+
if (expression instanceof SafePropertyRead4 && ts32.isConditionalExpression(node)) {
|
|
6472
6509
|
const whenTrueSymbol = this.getSymbolOfTsNode(node.whenTrue);
|
|
6473
6510
|
if (whenTrueSymbol === null) {
|
|
6474
6511
|
return null;
|
|
@@ -6485,11 +6522,11 @@ var SymbolBuilder = class {
|
|
|
6485
6522
|
}
|
|
6486
6523
|
getSymbolOfTsNode(node) {
|
|
6487
6524
|
var _a;
|
|
6488
|
-
while (
|
|
6525
|
+
while (ts32.isParenthesizedExpression(node)) {
|
|
6489
6526
|
node = node.expression;
|
|
6490
6527
|
}
|
|
6491
6528
|
let tsSymbol;
|
|
6492
|
-
if (
|
|
6529
|
+
if (ts32.isPropertyAccessExpression(node)) {
|
|
6493
6530
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.name);
|
|
6494
6531
|
} else {
|
|
6495
6532
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node);
|
|
@@ -6507,13 +6544,13 @@ var SymbolBuilder = class {
|
|
|
6507
6544
|
};
|
|
6508
6545
|
}
|
|
6509
6546
|
getTcbPositionForNode(node) {
|
|
6510
|
-
if (
|
|
6547
|
+
if (ts32.isTypeReferenceNode(node)) {
|
|
6511
6548
|
return this.getTcbPositionForNode(node.typeName);
|
|
6512
|
-
} else if (
|
|
6549
|
+
} else if (ts32.isQualifiedName(node)) {
|
|
6513
6550
|
return node.right.getStart();
|
|
6514
|
-
} else if (
|
|
6551
|
+
} else if (ts32.isPropertyAccessExpression(node)) {
|
|
6515
6552
|
return node.name.getStart();
|
|
6516
|
-
} else if (
|
|
6553
|
+
} else if (ts32.isElementAccessExpression(node)) {
|
|
6517
6554
|
return node.argumentExpression.getStart();
|
|
6518
6555
|
} else {
|
|
6519
6556
|
return node.getStart();
|
|
@@ -6527,13 +6564,13 @@ function sourceSpanEqual(a, b) {
|
|
|
6527
6564
|
return a.start.offset === b.start.offset && a.end.offset === b.end.offset;
|
|
6528
6565
|
}
|
|
6529
6566
|
function unwrapSignalInputWriteTAccessor(expr) {
|
|
6530
|
-
if (!
|
|
6567
|
+
if (!ts32.isElementAccessExpression(expr) || !ts32.isPropertyAccessExpression(expr.argumentExpression)) {
|
|
6531
6568
|
return null;
|
|
6532
6569
|
}
|
|
6533
|
-
if (!
|
|
6570
|
+
if (!ts32.isIdentifier(expr.argumentExpression.name) || expr.argumentExpression.name.text !== R3Identifiers4.InputSignalBrandWriteType.name) {
|
|
6534
6571
|
return null;
|
|
6535
6572
|
}
|
|
6536
|
-
if (!
|
|
6573
|
+
if (!ts32.isPropertyAccessExpression(expr.expression) && !ts32.isElementAccessExpression(expr.expression)) {
|
|
6537
6574
|
throw new Error("Unexpected expression for signal input write type.");
|
|
6538
6575
|
}
|
|
6539
6576
|
return {
|
|
@@ -6542,7 +6579,7 @@ function unwrapSignalInputWriteTAccessor(expr) {
|
|
|
6542
6579
|
};
|
|
6543
6580
|
}
|
|
6544
6581
|
|
|
6545
|
-
// bazel-out/
|
|
6582
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
|
|
6546
6583
|
var REGISTRY2 = new DomElementSchemaRegistry2();
|
|
6547
6584
|
var TemplateTypeCheckerImpl = class {
|
|
6548
6585
|
constructor(originalProgram, programDriver, typeCheckAdapter, config, refEmitter, reflector, compilerHost, priorBuild, metaReader, localMetaReader, ngModuleIndex, componentScopeReader, typeCheckScopeRegistry, perf) {
|
|
@@ -7239,10 +7276,10 @@ var SingleShimTypeCheckingHost = class extends SingleFileTypeCheckingHost {
|
|
|
7239
7276
|
}
|
|
7240
7277
|
};
|
|
7241
7278
|
|
|
7242
|
-
// bazel-out/
|
|
7279
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.mjs
|
|
7243
7280
|
import { Interpolation, PropertyRead as PropertyRead6 } from "@angular/compiler";
|
|
7244
7281
|
|
|
7245
|
-
// bazel-out/
|
|
7282
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/api/api.mjs
|
|
7246
7283
|
import { ASTWithSource as ASTWithSource4, RecursiveAstVisitor as RecursiveAstVisitor3, TmplAstBoundDeferredTrigger as TmplAstBoundDeferredTrigger2 } from "@angular/compiler";
|
|
7247
7284
|
var TemplateCheckWithVisitor = class {
|
|
7248
7285
|
run(ctx, component, template) {
|
|
@@ -7366,7 +7403,7 @@ var TemplateVisitor2 = class extends RecursiveAstVisitor3 {
|
|
|
7366
7403
|
}
|
|
7367
7404
|
};
|
|
7368
7405
|
|
|
7369
|
-
// bazel-out/
|
|
7406
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.mjs
|
|
7370
7407
|
var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
|
|
7371
7408
|
constructor() {
|
|
7372
7409
|
super(...arguments);
|
|
@@ -7403,7 +7440,7 @@ var factory = {
|
|
|
7403
7440
|
create: () => new InterpolatedSignalCheck()
|
|
7404
7441
|
};
|
|
7405
7442
|
|
|
7406
|
-
// bazel-out/
|
|
7443
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.mjs
|
|
7407
7444
|
import { TmplAstBoundEvent as TmplAstBoundEvent2 } from "@angular/compiler";
|
|
7408
7445
|
var InvalidBananaInBoxCheck = class extends TemplateCheckWithVisitor {
|
|
7409
7446
|
constructor() {
|
|
@@ -7429,7 +7466,7 @@ var factory2 = {
|
|
|
7429
7466
|
create: () => new InvalidBananaInBoxCheck()
|
|
7430
7467
|
};
|
|
7431
7468
|
|
|
7432
|
-
// bazel-out/
|
|
7469
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/missing_control_flow_directive/index.mjs
|
|
7433
7470
|
import { TmplAstTemplate as TmplAstTemplate4 } from "@angular/compiler";
|
|
7434
7471
|
var KNOWN_CONTROL_FLOW_DIRECTIVES = /* @__PURE__ */ new Map([
|
|
7435
7472
|
["ngIf", { directive: "NgIf", builtIn: "@if" }],
|
|
@@ -7474,7 +7511,7 @@ var factory3 = {
|
|
|
7474
7511
|
}
|
|
7475
7512
|
};
|
|
7476
7513
|
|
|
7477
|
-
// bazel-out/
|
|
7514
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/missing_ngforof_let/index.mjs
|
|
7478
7515
|
import { TmplAstTemplate as TmplAstTemplate5 } from "@angular/compiler";
|
|
7479
7516
|
var MissingNgForOfLetCheck = class extends TemplateCheckWithVisitor {
|
|
7480
7517
|
constructor() {
|
|
@@ -7507,9 +7544,9 @@ var factory4 = {
|
|
|
7507
7544
|
create: () => new MissingNgForOfLetCheck()
|
|
7508
7545
|
};
|
|
7509
7546
|
|
|
7510
|
-
// bazel-out/
|
|
7547
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.mjs
|
|
7511
7548
|
import { Binary } from "@angular/compiler";
|
|
7512
|
-
import
|
|
7549
|
+
import ts33 from "typescript";
|
|
7513
7550
|
var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
7514
7551
|
constructor() {
|
|
7515
7552
|
super(...arguments);
|
|
@@ -7523,7 +7560,7 @@ var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
7523
7560
|
return [];
|
|
7524
7561
|
}
|
|
7525
7562
|
const typeLeft = symbolLeft.tsType;
|
|
7526
|
-
if (typeLeft.flags & (
|
|
7563
|
+
if (typeLeft.flags & (ts33.TypeFlags.Any | ts33.TypeFlags.Unknown)) {
|
|
7527
7564
|
return [];
|
|
7528
7565
|
}
|
|
7529
7566
|
if (typeLeft.getNonNullableType() !== typeLeft)
|
|
@@ -7552,9 +7589,9 @@ var factory5 = {
|
|
|
7552
7589
|
}
|
|
7553
7590
|
};
|
|
7554
7591
|
|
|
7555
|
-
// bazel-out/
|
|
7592
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/optional_chain_not_nullable/index.mjs
|
|
7556
7593
|
import { SafeCall as SafeCall2, SafeKeyedRead as SafeKeyedRead2, SafePropertyRead as SafePropertyRead5 } from "@angular/compiler";
|
|
7557
|
-
import
|
|
7594
|
+
import ts34 from "typescript";
|
|
7558
7595
|
var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
7559
7596
|
constructor() {
|
|
7560
7597
|
super(...arguments);
|
|
@@ -7568,7 +7605,7 @@ var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
7568
7605
|
return [];
|
|
7569
7606
|
}
|
|
7570
7607
|
const typeLeft = symbolLeft.tsType;
|
|
7571
|
-
if (typeLeft.flags & (
|
|
7608
|
+
if (typeLeft.flags & (ts34.TypeFlags.Any | ts34.TypeFlags.Unknown)) {
|
|
7572
7609
|
return [];
|
|
7573
7610
|
}
|
|
7574
7611
|
if (typeLeft.getNonNullableType() !== typeLeft)
|
|
@@ -7598,7 +7635,7 @@ var factory6 = {
|
|
|
7598
7635
|
}
|
|
7599
7636
|
};
|
|
7600
7637
|
|
|
7601
|
-
// bazel-out/
|
|
7638
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/suffix_not_supported/index.mjs
|
|
7602
7639
|
import { TmplAstBoundAttribute as TmplAstBoundAttribute3 } from "@angular/compiler";
|
|
7603
7640
|
var STYLE_SUFFIXES = ["px", "%", "em"];
|
|
7604
7641
|
var SuffixNotSupportedCheck = class extends TemplateCheckWithVisitor {
|
|
@@ -7622,7 +7659,7 @@ var factory7 = {
|
|
|
7622
7659
|
create: () => new SuffixNotSupportedCheck()
|
|
7623
7660
|
};
|
|
7624
7661
|
|
|
7625
|
-
// bazel-out/
|
|
7662
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/text_attribute_not_binding/index.mjs
|
|
7626
7663
|
import { TmplAstTextAttribute as TmplAstTextAttribute4 } from "@angular/compiler";
|
|
7627
7664
|
var TextAttributeNotBindingSpec = class extends TemplateCheckWithVisitor {
|
|
7628
7665
|
constructor() {
|
|
@@ -7661,10 +7698,10 @@ var factory8 = {
|
|
|
7661
7698
|
create: () => new TextAttributeNotBindingSpec()
|
|
7662
7699
|
};
|
|
7663
7700
|
|
|
7664
|
-
// bazel-out/
|
|
7665
|
-
import
|
|
7701
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
|
|
7702
|
+
import ts35 from "typescript";
|
|
7666
7703
|
|
|
7667
|
-
// bazel-out/
|
|
7704
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/api/src/public_options.mjs
|
|
7668
7705
|
var DiagnosticCategoryLabel;
|
|
7669
7706
|
(function(DiagnosticCategoryLabel2) {
|
|
7670
7707
|
DiagnosticCategoryLabel2["Warning"] = "warning";
|
|
@@ -7672,7 +7709,7 @@ var DiagnosticCategoryLabel;
|
|
|
7672
7709
|
DiagnosticCategoryLabel2["Suppress"] = "suppress";
|
|
7673
7710
|
})(DiagnosticCategoryLabel || (DiagnosticCategoryLabel = {}));
|
|
7674
7711
|
|
|
7675
|
-
// bazel-out/
|
|
7712
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
|
|
7676
7713
|
var ExtendedTemplateCheckerImpl = class {
|
|
7677
7714
|
constructor(templateTypeChecker, typeChecker, templateCheckFactories, options) {
|
|
7678
7715
|
var _a, _b, _c, _d, _e;
|
|
@@ -7711,9 +7748,9 @@ var ExtendedTemplateCheckerImpl = class {
|
|
|
7711
7748
|
function diagnosticLabelToCategory(label) {
|
|
7712
7749
|
switch (label) {
|
|
7713
7750
|
case DiagnosticCategoryLabel.Warning:
|
|
7714
|
-
return
|
|
7751
|
+
return ts35.DiagnosticCategory.Warning;
|
|
7715
7752
|
case DiagnosticCategoryLabel.Error:
|
|
7716
|
-
return
|
|
7753
|
+
return ts35.DiagnosticCategory.Error;
|
|
7717
7754
|
case DiagnosticCategoryLabel.Suppress:
|
|
7718
7755
|
return null;
|
|
7719
7756
|
default:
|
|
@@ -7725,7 +7762,7 @@ function assertNever(value) {
|
|
|
7725
7762
|
${value}`);
|
|
7726
7763
|
}
|
|
7727
7764
|
|
|
7728
|
-
// bazel-out/
|
|
7765
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/index.mjs
|
|
7729
7766
|
var ALL_DIAGNOSTIC_FACTORIES = [
|
|
7730
7767
|
factory2,
|
|
7731
7768
|
factory5,
|
|
@@ -7741,7 +7778,7 @@ var SUPPORTED_DIAGNOSTIC_NAMES = /* @__PURE__ */ new Set([
|
|
|
7741
7778
|
...ALL_DIAGNOSTIC_FACTORIES.map((factory9) => factory9.name)
|
|
7742
7779
|
]);
|
|
7743
7780
|
|
|
7744
|
-
// bazel-out/
|
|
7781
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
7745
7782
|
var SHOULD_USE_TEMPLATE_PIPELINE = false;
|
|
7746
7783
|
var CompilationTicketKind;
|
|
7747
7784
|
(function(CompilationTicketKind2) {
|
|
@@ -7834,7 +7871,7 @@ var NgCompiler = class {
|
|
|
7834
7871
|
this.currentProgram = inputProgram;
|
|
7835
7872
|
this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
|
|
7836
7873
|
this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
|
|
7837
|
-
const moduleResolutionCache =
|
|
7874
|
+
const moduleResolutionCache = ts36.createModuleResolutionCache(
|
|
7838
7875
|
this.adapter.getCurrentDirectory(),
|
|
7839
7876
|
this.adapter.getCanonicalFileName.bind(this.adapter)
|
|
7840
7877
|
);
|
|
@@ -7878,7 +7915,7 @@ var NgCompiler = class {
|
|
|
7878
7915
|
}
|
|
7879
7916
|
for (const clazz of classesToUpdate) {
|
|
7880
7917
|
this.compilation.traitCompiler.updateResources(clazz);
|
|
7881
|
-
if (!
|
|
7918
|
+
if (!ts36.isClassDeclaration(clazz)) {
|
|
7882
7919
|
continue;
|
|
7883
7920
|
}
|
|
7884
7921
|
this.compilation.templateTypeChecker.invalidateClass(clazz);
|
|
@@ -8366,18 +8403,18 @@ function isAngularCorePackage(program) {
|
|
|
8366
8403
|
return false;
|
|
8367
8404
|
}
|
|
8368
8405
|
return r3Symbols.statements.some((stmt) => {
|
|
8369
|
-
if (!
|
|
8406
|
+
if (!ts36.isVariableStatement(stmt)) {
|
|
8370
8407
|
return false;
|
|
8371
8408
|
}
|
|
8372
|
-
const modifiers =
|
|
8373
|
-
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind ===
|
|
8409
|
+
const modifiers = ts36.getModifiers(stmt);
|
|
8410
|
+
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind === ts36.SyntaxKind.ExportKeyword)) {
|
|
8374
8411
|
return false;
|
|
8375
8412
|
}
|
|
8376
8413
|
return stmt.declarationList.declarations.some((decl) => {
|
|
8377
|
-
if (!
|
|
8414
|
+
if (!ts36.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
|
|
8378
8415
|
return false;
|
|
8379
8416
|
}
|
|
8380
|
-
if (decl.initializer === void 0 || decl.initializer.kind !==
|
|
8417
|
+
if (decl.initializer === void 0 || decl.initializer.kind !== ts36.SyntaxKind.TrueKeyword) {
|
|
8381
8418
|
return false;
|
|
8382
8419
|
}
|
|
8383
8420
|
return true;
|
|
@@ -8391,7 +8428,7 @@ function* verifyCompatibleTypeCheckOptions(options) {
|
|
|
8391
8428
|
var _a, _b, _c;
|
|
8392
8429
|
if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
|
|
8393
8430
|
yield makeConfigDiagnostic({
|
|
8394
|
-
category:
|
|
8431
|
+
category: ts36.DiagnosticCategory.Error,
|
|
8395
8432
|
code: ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK,
|
|
8396
8433
|
messageText: `
|
|
8397
8434
|
Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
|
|
@@ -8410,7 +8447,7 @@ https://angular.io/guide/template-typecheck
|
|
|
8410
8447
|
}
|
|
8411
8448
|
if (options.extendedDiagnostics && options.strictTemplates === false) {
|
|
8412
8449
|
yield makeConfigDiagnostic({
|
|
8413
|
-
category:
|
|
8450
|
+
category: ts36.DiagnosticCategory.Error,
|
|
8414
8451
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES,
|
|
8415
8452
|
messageText: `
|
|
8416
8453
|
Angular compiler option "extendedDiagnostics" is configured, however "strictTemplates" is disabled.
|
|
@@ -8427,7 +8464,7 @@ One of the following actions is required:
|
|
|
8427
8464
|
const defaultCategory = (_a = options.extendedDiagnostics) == null ? void 0 : _a.defaultCategory;
|
|
8428
8465
|
if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
|
|
8429
8466
|
yield makeConfigDiagnostic({
|
|
8430
|
-
category:
|
|
8467
|
+
category: ts36.DiagnosticCategory.Error,
|
|
8431
8468
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
8432
8469
|
messageText: `
|
|
8433
8470
|
Angular compiler option "extendedDiagnostics.defaultCategory" has an unknown diagnostic category: "${defaultCategory}".
|
|
@@ -8440,7 +8477,7 @@ ${allowedCategoryLabels.join("\n")}
|
|
|
8440
8477
|
for (const [checkName, category] of Object.entries((_c = (_b = options.extendedDiagnostics) == null ? void 0 : _b.checks) != null ? _c : {})) {
|
|
8441
8478
|
if (!SUPPORTED_DIAGNOSTIC_NAMES.has(checkName)) {
|
|
8442
8479
|
yield makeConfigDiagnostic({
|
|
8443
|
-
category:
|
|
8480
|
+
category: ts36.DiagnosticCategory.Error,
|
|
8444
8481
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK,
|
|
8445
8482
|
messageText: `
|
|
8446
8483
|
Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${checkName}".
|
|
@@ -8452,7 +8489,7 @@ ${Array.from(SUPPORTED_DIAGNOSTIC_NAMES).join("\n")}
|
|
|
8452
8489
|
}
|
|
8453
8490
|
if (!allowedCategoryLabels.includes(category)) {
|
|
8454
8491
|
yield makeConfigDiagnostic({
|
|
8455
|
-
category:
|
|
8492
|
+
category: ts36.DiagnosticCategory.Error,
|
|
8456
8493
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
8457
8494
|
messageText: `
|
|
8458
8495
|
Angular compiler option "extendedDiagnostics.checks['${checkName}']" has an unknown diagnostic category: "${category}".
|
|
@@ -8482,7 +8519,7 @@ var ReferenceGraphAdapter = class {
|
|
|
8482
8519
|
for (const { node } of references) {
|
|
8483
8520
|
let sourceFile = node.getSourceFile();
|
|
8484
8521
|
if (sourceFile === void 0) {
|
|
8485
|
-
sourceFile =
|
|
8522
|
+
sourceFile = ts36.getOriginalNode(node).getSourceFile();
|
|
8486
8523
|
}
|
|
8487
8524
|
if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
|
|
8488
8525
|
this.graph.add(source, node);
|
|
@@ -8529,8 +8566,8 @@ var Version = class {
|
|
|
8529
8566
|
}
|
|
8530
8567
|
};
|
|
8531
8568
|
|
|
8532
|
-
// bazel-out/
|
|
8533
|
-
import
|
|
8569
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
|
|
8570
|
+
import ts37 from "typescript";
|
|
8534
8571
|
var DelegatingCompilerHost2 = class {
|
|
8535
8572
|
get jsDocParsingMode() {
|
|
8536
8573
|
return this.delegate.jsDocParsingMode;
|
|
@@ -8615,7 +8652,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
8615
8652
|
entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
|
|
8616
8653
|
if (entryPoint === null) {
|
|
8617
8654
|
diagnostics.push({
|
|
8618
|
-
category:
|
|
8655
|
+
category: ts37.DiagnosticCategory.Error,
|
|
8619
8656
|
code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
|
|
8620
8657
|
file: void 0,
|
|
8621
8658
|
start: void 0,
|
|
@@ -8658,17 +8695,17 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
8658
8695
|
return this.fileNameToModuleName !== void 0 ? this : null;
|
|
8659
8696
|
}
|
|
8660
8697
|
createCachedResolveModuleNamesFunction() {
|
|
8661
|
-
const moduleResolutionCache =
|
|
8698
|
+
const moduleResolutionCache = ts37.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
|
|
8662
8699
|
return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
|
|
8663
8700
|
return moduleNames.map((moduleName) => {
|
|
8664
|
-
const module =
|
|
8701
|
+
const module = ts37.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
|
|
8665
8702
|
return module.resolvedModule;
|
|
8666
8703
|
});
|
|
8667
8704
|
};
|
|
8668
8705
|
}
|
|
8669
8706
|
};
|
|
8670
8707
|
|
|
8671
|
-
// bazel-out/
|
|
8708
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
8672
8709
|
var NgtscProgram = class {
|
|
8673
8710
|
constructor(rootNames, options, delegateHost, oldProgram) {
|
|
8674
8711
|
this.options = options;
|
|
@@ -8685,7 +8722,7 @@ var NgtscProgram = class {
|
|
|
8685
8722
|
if (reuseProgram !== void 0) {
|
|
8686
8723
|
retagAllTsFiles(reuseProgram);
|
|
8687
8724
|
}
|
|
8688
|
-
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () =>
|
|
8725
|
+
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts38.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
|
|
8689
8726
|
perfRecorder.phase(PerfPhase.Unaccounted);
|
|
8690
8727
|
perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
|
|
8691
8728
|
this.host.postProgramCreationCleanup();
|
|
@@ -8895,37 +8932,37 @@ function mergeEmitResults(emitResults) {
|
|
|
8895
8932
|
return { diagnostics, emitSkipped, emittedFiles };
|
|
8896
8933
|
}
|
|
8897
8934
|
|
|
8898
|
-
// bazel-out/
|
|
8935
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/program.mjs
|
|
8899
8936
|
function createProgram({ rootNames, options, host, oldProgram }) {
|
|
8900
8937
|
return new NgtscProgram(rootNames, options, host, oldProgram);
|
|
8901
8938
|
}
|
|
8902
8939
|
|
|
8903
|
-
// bazel-out/
|
|
8904
|
-
import
|
|
8940
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
8941
|
+
import ts40 from "typescript";
|
|
8905
8942
|
|
|
8906
|
-
// bazel-out/
|
|
8907
|
-
import
|
|
8943
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
|
|
8944
|
+
import ts39 from "typescript";
|
|
8908
8945
|
function createMessageDiagnostic(messageText) {
|
|
8909
8946
|
return {
|
|
8910
8947
|
file: void 0,
|
|
8911
8948
|
start: void 0,
|
|
8912
8949
|
length: void 0,
|
|
8913
|
-
category:
|
|
8950
|
+
category: ts39.DiagnosticCategory.Message,
|
|
8914
8951
|
messageText,
|
|
8915
8952
|
code: DEFAULT_ERROR_CODE,
|
|
8916
8953
|
source: SOURCE
|
|
8917
8954
|
};
|
|
8918
8955
|
}
|
|
8919
8956
|
|
|
8920
|
-
// bazel-out/
|
|
8957
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
8921
8958
|
var defaultFormatHost = {
|
|
8922
|
-
getCurrentDirectory: () =>
|
|
8959
|
+
getCurrentDirectory: () => ts40.sys.getCurrentDirectory(),
|
|
8923
8960
|
getCanonicalFileName: (fileName) => fileName,
|
|
8924
|
-
getNewLine: () =>
|
|
8961
|
+
getNewLine: () => ts40.sys.newLine
|
|
8925
8962
|
};
|
|
8926
8963
|
function formatDiagnostics(diags, host = defaultFormatHost) {
|
|
8927
8964
|
if (diags && diags.length) {
|
|
8928
|
-
return diags.map((diagnostic) => replaceTsWithNgInErrors(
|
|
8965
|
+
return diags.map((diagnostic) => replaceTsWithNgInErrors(ts40.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
|
|
8929
8966
|
} else {
|
|
8930
8967
|
return "";
|
|
8931
8968
|
}
|
|
@@ -8942,7 +8979,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
8942
8979
|
var _a;
|
|
8943
8980
|
try {
|
|
8944
8981
|
const fs = getFileSystem();
|
|
8945
|
-
const readConfigFile = (configFile) =>
|
|
8982
|
+
const readConfigFile = (configFile) => ts40.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
|
|
8946
8983
|
const readAngularCompilerOptions = (configFile, parentOptions = {}) => {
|
|
8947
8984
|
const { config: config2, error: error2 } = readConfigFile(configFile);
|
|
8948
8985
|
if (error2) {
|
|
@@ -8977,7 +9014,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
8977
9014
|
...existingOptions
|
|
8978
9015
|
};
|
|
8979
9016
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
8980
|
-
const { options, errors, fileNames: rootNames, projectReferences } =
|
|
9017
|
+
const { options, errors, fileNames: rootNames, projectReferences } = ts40.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
|
|
8981
9018
|
let emitFlags = EmitFlags.Default;
|
|
8982
9019
|
if (!(options["skipMetadataEmit"] || options["flatModuleOutFile"])) {
|
|
8983
9020
|
emitFlags |= EmitFlags.Metadata;
|
|
@@ -8988,7 +9025,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
8988
9025
|
return { project: projectFile, rootNames, projectReferences, options, errors, emitFlags };
|
|
8989
9026
|
} catch (e) {
|
|
8990
9027
|
const errors = [{
|
|
8991
|
-
category:
|
|
9028
|
+
category: ts40.DiagnosticCategory.Error,
|
|
8992
9029
|
messageText: (_a = e.stack) != null ? _a : e.message,
|
|
8993
9030
|
file: void 0,
|
|
8994
9031
|
start: void 0,
|
|
@@ -9002,7 +9039,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
9002
9039
|
function createParseConfigHost(host, fs = getFileSystem()) {
|
|
9003
9040
|
return {
|
|
9004
9041
|
fileExists: host.exists.bind(host),
|
|
9005
|
-
readDirectory:
|
|
9042
|
+
readDirectory: ts40.sys.readDirectory,
|
|
9006
9043
|
readFile: host.readFile.bind(host),
|
|
9007
9044
|
useCaseSensitiveFileNames: fs.isCaseSensitive()
|
|
9008
9045
|
};
|
|
@@ -9022,7 +9059,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
9022
9059
|
}
|
|
9023
9060
|
} else {
|
|
9024
9061
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
9025
|
-
const { resolvedModule } =
|
|
9062
|
+
const { resolvedModule } = ts40.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts40.ModuleResolutionKind.Node10, resolveJsonModule: true }, parseConfigHost);
|
|
9026
9063
|
if (resolvedModule) {
|
|
9027
9064
|
return absoluteFrom(resolvedModule.resolvedFileName);
|
|
9028
9065
|
}
|
|
@@ -9032,7 +9069,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
9032
9069
|
function exitCodeFromResult(diags) {
|
|
9033
9070
|
if (!diags)
|
|
9034
9071
|
return 0;
|
|
9035
|
-
if (diags.every((diag) => diag.category !==
|
|
9072
|
+
if (diags.every((diag) => diag.category !== ts40.DiagnosticCategory.Error)) {
|
|
9036
9073
|
return 0;
|
|
9037
9074
|
}
|
|
9038
9075
|
return diags.some((d) => d.source === "angular" && d.code === UNKNOWN_ERROR_CODE) ? 2 : 1;
|
|
@@ -9065,7 +9102,7 @@ function performCompilation({ rootNames, options, host, oldProgram, emitCallback
|
|
|
9065
9102
|
} catch (e) {
|
|
9066
9103
|
program = void 0;
|
|
9067
9104
|
allDiagnostics.push({
|
|
9068
|
-
category:
|
|
9105
|
+
category: ts40.DiagnosticCategory.Error,
|
|
9069
9106
|
messageText: (_a = e.stack) != null ? _a : e.message,
|
|
9070
9107
|
code: UNKNOWN_ERROR_CODE,
|
|
9071
9108
|
file: void 0,
|
|
@@ -9092,7 +9129,7 @@ function defaultGatherDiagnostics(program) {
|
|
|
9092
9129
|
return allDiagnostics;
|
|
9093
9130
|
}
|
|
9094
9131
|
function hasErrors(diags) {
|
|
9095
|
-
return diags.some((d) => d.category ===
|
|
9132
|
+
return diags.some((d) => d.category === ts40.DiagnosticCategory.Error);
|
|
9096
9133
|
}
|
|
9097
9134
|
|
|
9098
9135
|
export {
|
|
@@ -9130,4 +9167,4 @@ export {
|
|
|
9130
9167
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9131
9168
|
* found in the LICENSE file at https://angular.io/license
|
|
9132
9169
|
*/
|
|
9133
|
-
//# sourceMappingURL=chunk-
|
|
9170
|
+
//# sourceMappingURL=chunk-FUGV6LEW.js.map
|