@angular/compiler-cli 17.2.0-next.0 → 17.2.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/{chunk-WCD6LVCP.js → chunk-2WQIUGOU.js} +7 -7
- package/bundles/{chunk-6RVHVK7X.js → chunk-63UQIYTZ.js} +37 -33
- package/bundles/chunk-63UQIYTZ.js.map +6 -0
- package/bundles/{chunk-R4KQI5XI.js → chunk-64JBPJBS.js} +5 -5
- package/bundles/{chunk-Q5Y7HH3O.js → chunk-6VEEN3ZS.js} +5 -5
- package/bundles/{chunk-U6M6KQUQ.js → chunk-CVK4HV4K.js} +261 -194
- package/bundles/chunk-CVK4HV4K.js.map +6 -0
- package/bundles/{chunk-VYUC5NTT.js → chunk-JIFH6OZK.js} +273 -179
- package/bundles/chunk-JIFH6OZK.js.map +6 -0
- package/bundles/{chunk-455YOO3E.js → chunk-KYE5EYIK.js} +181 -59
- package/bundles/chunk-KYE5EYIK.js.map +6 -0
- package/bundles/{chunk-SBDNBITT.js → chunk-LYJKWJUC.js} +3 -3
- package/bundles/{chunk-YJ2WTOVI.js → chunk-PQBKKYRL.js} +2761 -2545
- package/bundles/chunk-PQBKKYRL.js.map +6 -0
- package/bundles/{chunk-QPMYDNZG.js → chunk-UM6JO3VZ.js} +9 -9
- package/bundles/{chunk-QPMYDNZG.js.map → chunk-UM6JO3VZ.js.map} +1 -1
- package/bundles/{chunk-SIMT2UHI.js → chunk-VVX2ZXGV.js} +5 -5
- package/bundles/index.js +17 -13
- package/bundles/index.js.map +1 -1
- package/bundles/linker/babel/index.js +12 -12
- package/bundles/linker/index.js +4 -4
- package/bundles/ngcc/index.js +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 -7
- package/bundles/src/bin/ng_xi18n.js +10 -10
- package/bundles/src/bin/ngc.js +8 -8
- package/bundles_metadata.json +1 -1
- package/index.d.ts +1 -0
- package/linker/src/file_linker/partial_linkers/util.d.ts +2 -1
- package/package.json +3 -3
- package/private/tooling.d.ts +4 -21
- package/src/ngtsc/annotations/common/src/diagnostics.d.ts +11 -0
- package/src/ngtsc/annotations/component/src/handler.d.ts +4 -2
- package/src/ngtsc/annotations/component/src/metadata.d.ts +4 -1
- package/src/ngtsc/annotations/directive/index.d.ts +3 -0
- package/src/ngtsc/annotations/directive/src/handler.d.ts +3 -1
- package/src/ngtsc/annotations/directive/src/initializer_functions.d.ts +1 -1
- package/src/ngtsc/annotations/directive/src/input_output_parse_options.d.ts +18 -0
- package/src/ngtsc/annotations/directive/src/model_function.d.ts +13 -0
- package/src/ngtsc/annotations/directive/src/output_function.d.ts +18 -0
- package/src/ngtsc/annotations/directive/src/query_functions.d.ts +1 -2
- package/src/ngtsc/annotations/directive/src/shared.d.ts +5 -2
- package/src/ngtsc/annotations/index.d.ts +2 -2
- package/src/ngtsc/annotations/ng_module/src/handler.d.ts +3 -2
- package/src/ngtsc/annotations/src/pipe.d.ts +2 -1
- package/src/ngtsc/core/api/src/public_options.d.ts +10 -0
- package/src/ngtsc/diagnostics/src/error.d.ts +4 -3
- package/src/ngtsc/diagnostics/src/error_code.d.ts +9 -11
- package/src/ngtsc/docs/src/entities.d.ts +1 -0
- package/src/ngtsc/docs/src/function_extractor.d.ts +3 -2
- package/src/ngtsc/imports/index.d.ts +1 -0
- package/src/ngtsc/imports/src/local_compilation_extra_imports_tracker.d.ts +56 -0
- package/src/ngtsc/metadata/src/api.d.ts +9 -0
- package/src/ngtsc/reflection/src/typescript.d.ts +1 -2
- package/src/ngtsc/transform/src/transform.d.ts +2 -2
- package/src/ngtsc/translator/index.d.ts +1 -1
- package/src/ngtsc/translator/src/import_manager.d.ts +19 -2
- package/src/ngtsc/typecheck/src/comments.d.ts +2 -1
- package/src/ngtsc/typecheck/src/ts_util.d.ts +2 -0
- package/src/transformers/jit_transforms/index.d.ts +21 -1
- package/src/transformers/jit_transforms/{signal_inputs_metadata_transform.d.ts → initializer_api_transforms/input_function.d.ts} +5 -6
- package/src/transformers/jit_transforms/initializer_api_transforms/model_function.d.ts +13 -0
- package/src/transformers/jit_transforms/initializer_api_transforms/output_function.d.ts +19 -0
- package/src/transformers/jit_transforms/initializer_api_transforms/query_functions.d.ts +20 -0
- package/src/transformers/jit_transforms/initializer_api_transforms/transform.d.ts +17 -0
- package/src/transformers/jit_transforms/initializer_api_transforms/transform_api.d.ts +23 -0
- package/bundles/chunk-455YOO3E.js.map +0 -6
- package/bundles/chunk-6RVHVK7X.js.map +0 -6
- package/bundles/chunk-U6M6KQUQ.js.map +0 -6
- package/bundles/chunk-VYUC5NTT.js.map +0 -6
- package/bundles/chunk-YJ2WTOVI.js.map +0 -6
- /package/bundles/{chunk-WCD6LVCP.js.map → chunk-2WQIUGOU.js.map} +0 -0
- /package/bundles/{chunk-R4KQI5XI.js.map → chunk-64JBPJBS.js.map} +0 -0
- /package/bundles/{chunk-Q5Y7HH3O.js.map → chunk-6VEEN3ZS.js.map} +0 -0
- /package/bundles/{chunk-SBDNBITT.js.map → chunk-LYJKWJUC.js.map} +0 -0
- /package/bundles/{chunk-SIMT2UHI.js.map → chunk-VVX2ZXGV.js.map} +0 -0
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
resolve,
|
|
13
13
|
stripExtension,
|
|
14
14
|
toRelativeImport
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UM6JO3VZ.js";
|
|
16
16
|
|
|
17
|
-
// bazel-out/
|
|
17
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/typescript.mjs
|
|
18
18
|
import ts4 from "typescript";
|
|
19
19
|
|
|
20
|
-
// bazel-out/
|
|
20
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/host.mjs
|
|
21
21
|
import ts from "typescript";
|
|
22
22
|
function isDecoratorIdentifier(exp) {
|
|
23
23
|
return ts.isIdentifier(exp) || ts.isPropertyAccessExpression(exp) && ts.isIdentifier(exp.expression) && ts.isIdentifier(exp.name);
|
|
@@ -32,7 +32,7 @@ var ClassMemberKind;
|
|
|
32
32
|
})(ClassMemberKind || (ClassMemberKind = {}));
|
|
33
33
|
var AmbientImport = {};
|
|
34
34
|
|
|
35
|
-
// bazel-out/
|
|
35
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/type_to_value.mjs
|
|
36
36
|
import ts2 from "typescript";
|
|
37
37
|
function typeToValue(typeNode, checker, isLocalCompilation) {
|
|
38
38
|
var _a, _b;
|
|
@@ -205,7 +205,7 @@ function extractModuleName(node) {
|
|
|
205
205
|
return node.moduleSpecifier.text;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
// bazel-out/
|
|
208
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/util.mjs
|
|
209
209
|
import ts3 from "typescript";
|
|
210
210
|
function isNamedClassDeclaration(node) {
|
|
211
211
|
return ts3.isClassDeclaration(node) && isIdentifier(node.name);
|
|
@@ -214,7 +214,7 @@ function isIdentifier(node) {
|
|
|
214
214
|
return node !== void 0 && ts3.isIdentifier(node);
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
// bazel-out/
|
|
217
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/typescript.mjs
|
|
218
218
|
var TypeScriptReflectionHost = class {
|
|
219
219
|
constructor(checker, isLocalCompilation = false) {
|
|
220
220
|
this.checker = checker;
|
|
@@ -647,14 +647,21 @@ function getFarLeftIdentifier(propertyAccess) {
|
|
|
647
647
|
return ts4.isIdentifier(propertyAccess.expression) ? propertyAccess.expression : null;
|
|
648
648
|
}
|
|
649
649
|
function getContainingImportDeclaration(node) {
|
|
650
|
-
|
|
650
|
+
let parent = node.parent;
|
|
651
|
+
while (parent && !ts4.isSourceFile(parent)) {
|
|
652
|
+
if (ts4.isImportDeclaration(parent)) {
|
|
653
|
+
return parent;
|
|
654
|
+
}
|
|
655
|
+
parent = parent.parent;
|
|
656
|
+
}
|
|
657
|
+
return null;
|
|
651
658
|
}
|
|
652
659
|
function getExportedName(decl, originalId) {
|
|
653
660
|
return ts4.isImportSpecifier(decl) ? (decl.propertyName !== void 0 ? decl.propertyName : decl.name).text : originalId.text;
|
|
654
661
|
}
|
|
655
662
|
var LocalExportedDeclarations = Symbol("LocalExportedDeclarations");
|
|
656
663
|
|
|
657
|
-
// bazel-out/
|
|
664
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/typescript.mjs
|
|
658
665
|
import ts5 from "typescript";
|
|
659
666
|
var TS = /\.tsx?$/i;
|
|
660
667
|
var D_TS = /\.d\.ts$/i;
|
|
@@ -755,7 +762,7 @@ function toUnredirectedSourceFile(sf) {
|
|
|
755
762
|
return redirectInfo.unredirected;
|
|
756
763
|
}
|
|
757
764
|
|
|
758
|
-
// bazel-out/
|
|
765
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/references.mjs
|
|
759
766
|
var Reference = class {
|
|
760
767
|
constructor(node, bestGuessOwningModule = null) {
|
|
761
768
|
this.node = node;
|
|
@@ -824,14 +831,14 @@ var Reference = class {
|
|
|
824
831
|
}
|
|
825
832
|
};
|
|
826
833
|
|
|
827
|
-
// bazel-out/
|
|
834
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/alias.mjs
|
|
828
835
|
import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
|
|
829
836
|
|
|
830
|
-
// bazel-out/
|
|
837
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
|
|
831
838
|
import { ExternalExpr, ExternalReference, WrappedNodeExpr } from "@angular/compiler";
|
|
832
839
|
import ts7 from "typescript";
|
|
833
840
|
|
|
834
|
-
// bazel-out/
|
|
841
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.mjs
|
|
835
842
|
var ErrorCode;
|
|
836
843
|
(function(ErrorCode2) {
|
|
837
844
|
ErrorCode2[ErrorCode2["DECORATOR_ARG_NOT_LITERAL"] = 1001] = "DECORATOR_ARG_NOT_LITERAL";
|
|
@@ -843,6 +850,7 @@ var ErrorCode;
|
|
|
843
850
|
ErrorCode2[ErrorCode2["VALUE_NOT_LITERAL"] = 1011] = "VALUE_NOT_LITERAL";
|
|
844
851
|
ErrorCode2[ErrorCode2["INITIALIZER_API_WITH_DISALLOWED_DECORATOR"] = 1050] = "INITIALIZER_API_WITH_DISALLOWED_DECORATOR";
|
|
845
852
|
ErrorCode2[ErrorCode2["INITIALIZER_API_DECORATOR_METADATA_COLLISION"] = 1051] = "INITIALIZER_API_DECORATOR_METADATA_COLLISION";
|
|
853
|
+
ErrorCode2[ErrorCode2["INITIALIZER_API_NO_REQUIRED_FUNCTION"] = 1052] = "INITIALIZER_API_NO_REQUIRED_FUNCTION";
|
|
846
854
|
ErrorCode2[ErrorCode2["INCORRECTLY_DECLARED_ON_STATIC_MEMBER"] = 1100] = "INCORRECTLY_DECLARED_ON_STATIC_MEMBER";
|
|
847
855
|
ErrorCode2[ErrorCode2["COMPONENT_MISSING_TEMPLATE"] = 2001] = "COMPONENT_MISSING_TEMPLATE";
|
|
848
856
|
ErrorCode2[ErrorCode2["PIPE_MISSING_NAME"] = 2002] = "PIPE_MISSING_NAME";
|
|
@@ -914,12 +922,11 @@ var ErrorCode;
|
|
|
914
922
|
ErrorCode2[ErrorCode2["INJECTABLE_DUPLICATE_PROV"] = 9001] = "INJECTABLE_DUPLICATE_PROV";
|
|
915
923
|
ErrorCode2[ErrorCode2["SUGGEST_STRICT_TEMPLATES"] = 10001] = "SUGGEST_STRICT_TEMPLATES";
|
|
916
924
|
ErrorCode2[ErrorCode2["SUGGEST_SUBOPTIMAL_TYPE_INFERENCE"] = 10002] = "SUGGEST_SUBOPTIMAL_TYPE_INFERENCE";
|
|
917
|
-
ErrorCode2[ErrorCode2["
|
|
918
|
-
ErrorCode2[ErrorCode2["
|
|
919
|
-
ErrorCode2[ErrorCode2["LOCAL_COMPILATION_HOST_DIRECTIVE_INVALID"] = 11003] = "LOCAL_COMPILATION_HOST_DIRECTIVE_INVALID";
|
|
925
|
+
ErrorCode2[ErrorCode2["LOCAL_COMPILATION_UNRESOLVED_CONST"] = 11001] = "LOCAL_COMPILATION_UNRESOLVED_CONST";
|
|
926
|
+
ErrorCode2[ErrorCode2["LOCAL_COMPILATION_EXPRESSION_FOR_HOST_DIRECTIVE"] = 11003] = "LOCAL_COMPILATION_EXPRESSION_FOR_HOST_DIRECTIVE";
|
|
920
927
|
})(ErrorCode || (ErrorCode = {}));
|
|
921
928
|
|
|
922
|
-
// bazel-out/
|
|
929
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/docs.mjs
|
|
923
930
|
var COMPILER_ERRORS_WITH_GUIDES = /* @__PURE__ */ new Set([
|
|
924
931
|
ErrorCode.DECORATOR_ARG_NOT_LITERAL,
|
|
925
932
|
ErrorCode.IMPORT_CYCLE_DETECTED,
|
|
@@ -931,10 +938,10 @@ var COMPILER_ERRORS_WITH_GUIDES = /* @__PURE__ */ new Set([
|
|
|
931
938
|
ErrorCode.WARN_NGMODULE_ID_UNNECESSARY
|
|
932
939
|
]);
|
|
933
940
|
|
|
934
|
-
// bazel-out/
|
|
941
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
935
942
|
import ts6 from "typescript";
|
|
936
943
|
|
|
937
|
-
// bazel-out/
|
|
944
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/util.mjs
|
|
938
945
|
var ERROR_CODE_MATCHER = /(\u001b\[\d+m ?)TS-99(\d+: ?\u001b\[\d+m)/g;
|
|
939
946
|
function replaceTsWithNgInErrors(errors) {
|
|
940
947
|
return errors.replace(ERROR_CODE_MATCHER, "$1NG$2");
|
|
@@ -943,17 +950,20 @@ function ngErrorCode(code) {
|
|
|
943
950
|
return parseInt("-99" + code);
|
|
944
951
|
}
|
|
945
952
|
|
|
946
|
-
// bazel-out/
|
|
947
|
-
var FatalDiagnosticError = class {
|
|
948
|
-
constructor(code, node,
|
|
953
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
954
|
+
var FatalDiagnosticError = class extends Error {
|
|
955
|
+
constructor(code, node, diagnosticMessage, relatedInformation) {
|
|
956
|
+
super(`FatalDiagnosticError #${code}: ${diagnosticMessage}`);
|
|
949
957
|
this.code = code;
|
|
950
958
|
this.node = node;
|
|
951
|
-
this.
|
|
959
|
+
this.diagnosticMessage = diagnosticMessage;
|
|
952
960
|
this.relatedInformation = relatedInformation;
|
|
961
|
+
this.message = null;
|
|
953
962
|
this._isFatalDiagnosticError = true;
|
|
963
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
954
964
|
}
|
|
955
965
|
toDiagnostic() {
|
|
956
|
-
return makeDiagnostic(this.code, this.node, this.
|
|
966
|
+
return makeDiagnostic(this.code, this.node, this.diagnosticMessage, this.relatedInformation);
|
|
957
967
|
}
|
|
958
968
|
};
|
|
959
969
|
function makeDiagnostic(code, node, messageText, relatedInformation) {
|
|
@@ -998,11 +1008,14 @@ function addDiagnosticChain(messageText, add) {
|
|
|
998
1008
|
}
|
|
999
1009
|
return messageText;
|
|
1000
1010
|
}
|
|
1011
|
+
function isFatalDiagnosticError(err) {
|
|
1012
|
+
return err._isFatalDiagnosticError === true;
|
|
1013
|
+
}
|
|
1001
1014
|
|
|
1002
|
-
// bazel-out/
|
|
1015
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.mjs
|
|
1003
1016
|
var ERROR_DETAILS_PAGE_BASE_URL = "https://angular.io/errors";
|
|
1004
1017
|
|
|
1005
|
-
// bazel-out/
|
|
1018
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.mjs
|
|
1006
1019
|
var ExtendedTemplateDiagnosticName;
|
|
1007
1020
|
(function(ExtendedTemplateDiagnosticName2) {
|
|
1008
1021
|
ExtendedTemplateDiagnosticName2["INVALID_BANANA_IN_BOX"] = "invalidBananaInBox";
|
|
@@ -1017,7 +1030,7 @@ var ExtendedTemplateDiagnosticName;
|
|
|
1017
1030
|
ExtendedTemplateDiagnosticName2["CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION"] = "controlFlowPreventingContentProjection";
|
|
1018
1031
|
})(ExtendedTemplateDiagnosticName || (ExtendedTemplateDiagnosticName = {}));
|
|
1019
1032
|
|
|
1020
|
-
// bazel-out/
|
|
1033
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/find_export.mjs
|
|
1021
1034
|
function findExportedNameOfNode(target, file, reflector) {
|
|
1022
1035
|
const exports = reflector.getExportsOfModule(file);
|
|
1023
1036
|
if (exports === null) {
|
|
@@ -1037,7 +1050,7 @@ function findExportedNameOfNode(target, file, reflector) {
|
|
|
1037
1050
|
return foundExportName;
|
|
1038
1051
|
}
|
|
1039
1052
|
|
|
1040
|
-
// bazel-out/
|
|
1053
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
|
|
1041
1054
|
var ImportFlags;
|
|
1042
1055
|
(function(ImportFlags2) {
|
|
1043
1056
|
ImportFlags2[ImportFlags2["None"] = 0] = "None";
|
|
@@ -1266,7 +1279,7 @@ var UnifiedModulesStrategy = class {
|
|
|
1266
1279
|
}
|
|
1267
1280
|
};
|
|
1268
1281
|
|
|
1269
|
-
// bazel-out/
|
|
1282
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/alias.mjs
|
|
1270
1283
|
var CHARS_TO_ESCAPE = /[^a-zA-Z0-9/_]/g;
|
|
1271
1284
|
var UnifiedModulesAliasingHost = class {
|
|
1272
1285
|
constructor(unifiedModulesHost) {
|
|
@@ -1333,7 +1346,7 @@ var AliasStrategy = class {
|
|
|
1333
1346
|
}
|
|
1334
1347
|
};
|
|
1335
1348
|
|
|
1336
|
-
// bazel-out/
|
|
1349
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/path.mjs
|
|
1337
1350
|
function relativePathBetween(from, to) {
|
|
1338
1351
|
const relativePath = stripExtension(relative(dirname(resolve(from)), resolve(to)));
|
|
1339
1352
|
return relativePath !== "" ? toRelativeImport(relativePath) : null;
|
|
@@ -1342,7 +1355,7 @@ function normalizeSeparators(path) {
|
|
|
1342
1355
|
return path.replace(/\\/g, "/");
|
|
1343
1356
|
}
|
|
1344
1357
|
|
|
1345
|
-
// bazel-out/
|
|
1358
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/core.mjs
|
|
1346
1359
|
var NoopImportRewriter = class {
|
|
1347
1360
|
shouldImportSymbol(symbol, specifier) {
|
|
1348
1361
|
return true;
|
|
@@ -1401,7 +1414,7 @@ function validateAndRewriteCoreSymbol(name) {
|
|
|
1401
1414
|
return CORE_SUPPORTED_SYMBOLS.get(name);
|
|
1402
1415
|
}
|
|
1403
1416
|
|
|
1404
|
-
// bazel-out/
|
|
1417
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/patch_alias_reference_resolution.mjs
|
|
1405
1418
|
import ts8 from "typescript";
|
|
1406
1419
|
var patchedReferencedAliasesSymbol = Symbol("patchedReferencedAliases");
|
|
1407
1420
|
function loadIsReferencedAliasDeclarationPatch(context) {
|
|
@@ -1436,7 +1449,7 @@ function throwIncompatibleTransformationContextError() {
|
|
|
1436
1449
|
throw Error("Angular compiler is incompatible with this version of the TypeScript compiler.\n\nIf you recently updated TypeScript and this issue surfaces now, consider downgrading.\n\nPlease report an issue on the Angular repositories when this issue surfaces and you are using a supposedly compatible TypeScript version.");
|
|
1437
1450
|
}
|
|
1438
1451
|
|
|
1439
|
-
// bazel-out/
|
|
1452
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/default.mjs
|
|
1440
1453
|
var DefaultImportDeclaration = Symbol("DefaultImportDeclaration");
|
|
1441
1454
|
function attachDefaultImportDeclaration(expr, importDecl) {
|
|
1442
1455
|
expr[DefaultImportDeclaration] = importDecl;
|
|
@@ -1477,7 +1490,7 @@ var DefaultImportTracker = class {
|
|
|
1477
1490
|
}
|
|
1478
1491
|
};
|
|
1479
1492
|
|
|
1480
|
-
// bazel-out/
|
|
1493
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/deferred_symbol_tracker.mjs
|
|
1481
1494
|
import ts9 from "typescript";
|
|
1482
1495
|
var AssumeEager = "AssumeEager";
|
|
1483
1496
|
var DeferredSymbolTracker = class {
|
|
@@ -1598,7 +1611,54 @@ var DeferredSymbolTracker = class {
|
|
|
1598
1611
|
}
|
|
1599
1612
|
};
|
|
1600
1613
|
|
|
1601
|
-
// bazel-out/
|
|
1614
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/local_compilation_extra_imports_tracker.mjs
|
|
1615
|
+
import ts10 from "typescript";
|
|
1616
|
+
var LocalCompilationExtraImportsTracker = class {
|
|
1617
|
+
constructor(typeChecker) {
|
|
1618
|
+
this.typeChecker = typeChecker;
|
|
1619
|
+
this.localImportsMap = /* @__PURE__ */ new Map();
|
|
1620
|
+
this.globalImportsSet = /* @__PURE__ */ new Set();
|
|
1621
|
+
}
|
|
1622
|
+
addImportForFile(sf, moduleName) {
|
|
1623
|
+
if (!this.localImportsMap.has(sf.fileName)) {
|
|
1624
|
+
this.localImportsMap.set(sf.fileName, /* @__PURE__ */ new Set());
|
|
1625
|
+
}
|
|
1626
|
+
this.localImportsMap.get(sf.fileName).add(moduleName);
|
|
1627
|
+
}
|
|
1628
|
+
addGlobalImportFromIdentifier(node) {
|
|
1629
|
+
var _a;
|
|
1630
|
+
let identifier = null;
|
|
1631
|
+
if (ts10.isIdentifier(node)) {
|
|
1632
|
+
identifier = node;
|
|
1633
|
+
} else if (ts10.isPropertyAccessExpression(node) && ts10.isIdentifier(node.expression)) {
|
|
1634
|
+
identifier = node.expression;
|
|
1635
|
+
}
|
|
1636
|
+
if (identifier === null) {
|
|
1637
|
+
return;
|
|
1638
|
+
}
|
|
1639
|
+
const sym = this.typeChecker.getSymbolAtLocation(identifier);
|
|
1640
|
+
if (!((_a = sym == null ? void 0 : sym.declarations) == null ? void 0 : _a.length)) {
|
|
1641
|
+
return;
|
|
1642
|
+
}
|
|
1643
|
+
const importClause = sym.declarations[0];
|
|
1644
|
+
const decl = getContainingImportDeclaration(importClause);
|
|
1645
|
+
if (decl !== null) {
|
|
1646
|
+
this.globalImportsSet.add(removeQuotations(decl.moduleSpecifier.getText()));
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
getImportsForFile(sf) {
|
|
1650
|
+
var _a;
|
|
1651
|
+
return [
|
|
1652
|
+
...this.globalImportsSet,
|
|
1653
|
+
...(_a = this.localImportsMap.get(sf.fileName)) != null ? _a : []
|
|
1654
|
+
];
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
function removeQuotations(s) {
|
|
1658
|
+
return s.substring(1, s.length - 1).trim();
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/resolver.mjs
|
|
1602
1662
|
var ModuleResolver = class {
|
|
1603
1663
|
constructor(program, compilerOptions, host, moduleResolutionCache) {
|
|
1604
1664
|
this.program = program;
|
|
@@ -1615,10 +1675,10 @@ var ModuleResolver = class {
|
|
|
1615
1675
|
}
|
|
1616
1676
|
};
|
|
1617
1677
|
|
|
1618
|
-
// bazel-out/
|
|
1619
|
-
import
|
|
1678
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager.mjs
|
|
1679
|
+
import ts11 from "typescript";
|
|
1620
1680
|
var ImportManager = class {
|
|
1621
|
-
constructor(rewriter = new NoopImportRewriter(), prefix = "i", factory =
|
|
1681
|
+
constructor(rewriter = new NoopImportRewriter(), prefix = "i", factory = ts11.factory) {
|
|
1622
1682
|
this.rewriter = rewriter;
|
|
1623
1683
|
this.prefix = prefix;
|
|
1624
1684
|
this.factory = factory;
|
|
@@ -1626,7 +1686,7 @@ var ImportManager = class {
|
|
|
1626
1686
|
this.nextIndex = 0;
|
|
1627
1687
|
}
|
|
1628
1688
|
generateNamespaceImport(moduleName) {
|
|
1629
|
-
if (!this.specifierToIdentifier.has(moduleName)) {
|
|
1689
|
+
if (!this.specifierToIdentifier.has(moduleName) || this.specifierToIdentifier.get(moduleName) === null) {
|
|
1630
1690
|
this.specifierToIdentifier.set(moduleName, this.factory.createIdentifier(`${this.prefix}${this.nextIndex++}`));
|
|
1631
1691
|
}
|
|
1632
1692
|
return this.specifierToIdentifier.get(moduleName);
|
|
@@ -1639,6 +1699,11 @@ var ImportManager = class {
|
|
|
1639
1699
|
const moduleImport = this.generateNamespaceImport(moduleName);
|
|
1640
1700
|
return { moduleImport, symbol };
|
|
1641
1701
|
}
|
|
1702
|
+
generateSideEffectImport(moduleName) {
|
|
1703
|
+
if (!this.specifierToIdentifier.has(moduleName)) {
|
|
1704
|
+
this.specifierToIdentifier.set(moduleName, null);
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1642
1707
|
getAllImports(contextPath) {
|
|
1643
1708
|
const imports = [];
|
|
1644
1709
|
for (const [originalSpecifier, qualifier] of this.specifierToIdentifier) {
|
|
@@ -1652,7 +1717,7 @@ var ImportManager = class {
|
|
|
1652
1717
|
}
|
|
1653
1718
|
};
|
|
1654
1719
|
|
|
1655
|
-
// bazel-out/
|
|
1720
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/context.mjs
|
|
1656
1721
|
var Context = class {
|
|
1657
1722
|
constructor(isStatement) {
|
|
1658
1723
|
this.isStatement = isStatement;
|
|
@@ -1665,7 +1730,7 @@ var Context = class {
|
|
|
1665
1730
|
}
|
|
1666
1731
|
};
|
|
1667
1732
|
|
|
1668
|
-
// bazel-out/
|
|
1733
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/translator.mjs
|
|
1669
1734
|
import * as o from "@angular/compiler";
|
|
1670
1735
|
var UNARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
1671
1736
|
[o.UnaryOperator.Minus, "-"],
|
|
@@ -1904,8 +1969,8 @@ function createRange(span) {
|
|
|
1904
1969
|
};
|
|
1905
1970
|
}
|
|
1906
1971
|
|
|
1907
|
-
// bazel-out/
|
|
1908
|
-
import
|
|
1972
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_emitter.mjs
|
|
1973
|
+
import ts12 from "typescript";
|
|
1909
1974
|
var INELIGIBLE = {};
|
|
1910
1975
|
function canEmitType(type, canEmit) {
|
|
1911
1976
|
return canEmitTypeWorker(type);
|
|
@@ -1913,13 +1978,13 @@ function canEmitType(type, canEmit) {
|
|
|
1913
1978
|
return visitNode(type2) !== INELIGIBLE;
|
|
1914
1979
|
}
|
|
1915
1980
|
function visitNode(node) {
|
|
1916
|
-
if (
|
|
1981
|
+
if (ts12.isImportTypeNode(node)) {
|
|
1917
1982
|
return INELIGIBLE;
|
|
1918
1983
|
}
|
|
1919
|
-
if (
|
|
1984
|
+
if (ts12.isTypeReferenceNode(node) && !canEmitTypeReference(node)) {
|
|
1920
1985
|
return INELIGIBLE;
|
|
1921
1986
|
} else {
|
|
1922
|
-
return
|
|
1987
|
+
return ts12.forEachChild(node, visitNode);
|
|
1923
1988
|
}
|
|
1924
1989
|
}
|
|
1925
1990
|
function canEmitTypeReference(type2) {
|
|
@@ -1936,35 +2001,35 @@ var TypeEmitter = class {
|
|
|
1936
2001
|
emitType(type) {
|
|
1937
2002
|
const typeReferenceTransformer = (context) => {
|
|
1938
2003
|
const visitNode = (node) => {
|
|
1939
|
-
if (
|
|
2004
|
+
if (ts12.isImportTypeNode(node)) {
|
|
1940
2005
|
throw new Error("Unable to emit import type");
|
|
1941
2006
|
}
|
|
1942
|
-
if (
|
|
2007
|
+
if (ts12.isTypeReferenceNode(node)) {
|
|
1943
2008
|
return this.emitTypeReference(node);
|
|
1944
|
-
} else if (
|
|
2009
|
+
} else if (ts12.isLiteralExpression(node)) {
|
|
1945
2010
|
let clone;
|
|
1946
|
-
if (
|
|
1947
|
-
clone =
|
|
1948
|
-
} else if (
|
|
1949
|
-
clone =
|
|
1950
|
-
} else if (
|
|
1951
|
-
clone =
|
|
1952
|
-
} else if (
|
|
1953
|
-
clone =
|
|
1954
|
-
} else if (
|
|
1955
|
-
clone =
|
|
2011
|
+
if (ts12.isStringLiteral(node)) {
|
|
2012
|
+
clone = ts12.factory.createStringLiteral(node.text);
|
|
2013
|
+
} else if (ts12.isNumericLiteral(node)) {
|
|
2014
|
+
clone = ts12.factory.createNumericLiteral(node.text);
|
|
2015
|
+
} else if (ts12.isBigIntLiteral(node)) {
|
|
2016
|
+
clone = ts12.factory.createBigIntLiteral(node.text);
|
|
2017
|
+
} else if (ts12.isNoSubstitutionTemplateLiteral(node)) {
|
|
2018
|
+
clone = ts12.factory.createNoSubstitutionTemplateLiteral(node.text, node.rawText);
|
|
2019
|
+
} else if (ts12.isRegularExpressionLiteral(node)) {
|
|
2020
|
+
clone = ts12.factory.createRegularExpressionLiteral(node.text);
|
|
1956
2021
|
} else {
|
|
1957
|
-
throw new Error(`Unsupported literal kind ${
|
|
2022
|
+
throw new Error(`Unsupported literal kind ${ts12.SyntaxKind[node.kind]}`);
|
|
1958
2023
|
}
|
|
1959
|
-
|
|
2024
|
+
ts12.setTextRange(clone, { pos: -1, end: -1 });
|
|
1960
2025
|
return clone;
|
|
1961
2026
|
} else {
|
|
1962
|
-
return
|
|
2027
|
+
return ts12.visitEachChild(node, visitNode, context);
|
|
1963
2028
|
}
|
|
1964
2029
|
};
|
|
1965
|
-
return (node) =>
|
|
2030
|
+
return (node) => ts12.visitNode(node, visitNode, ts12.isTypeNode);
|
|
1966
2031
|
};
|
|
1967
|
-
return
|
|
2032
|
+
return ts12.transform(type, [typeReferenceTransformer]).transformed[0];
|
|
1968
2033
|
}
|
|
1969
2034
|
emitTypeReference(type) {
|
|
1970
2035
|
const translatedType = this.translator(type);
|
|
@@ -1973,27 +2038,27 @@ var TypeEmitter = class {
|
|
|
1973
2038
|
}
|
|
1974
2039
|
let typeArguments = void 0;
|
|
1975
2040
|
if (type.typeArguments !== void 0) {
|
|
1976
|
-
typeArguments =
|
|
2041
|
+
typeArguments = ts12.factory.createNodeArray(type.typeArguments.map((typeArg) => this.emitType(typeArg)));
|
|
1977
2042
|
}
|
|
1978
|
-
return
|
|
2043
|
+
return ts12.factory.updateTypeReferenceNode(type, translatedType.typeName, typeArguments);
|
|
1979
2044
|
}
|
|
1980
2045
|
};
|
|
1981
2046
|
|
|
1982
|
-
// bazel-out/
|
|
2047
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
|
|
1983
2048
|
import * as o2 from "@angular/compiler";
|
|
1984
|
-
import
|
|
2049
|
+
import ts14 from "typescript";
|
|
1985
2050
|
|
|
1986
|
-
// bazel-out/
|
|
1987
|
-
import
|
|
2051
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/ts_util.mjs
|
|
2052
|
+
import ts13 from "typescript";
|
|
1988
2053
|
function tsNumericExpression(value) {
|
|
1989
2054
|
if (value < 0) {
|
|
1990
|
-
const operand =
|
|
1991
|
-
return
|
|
2055
|
+
const operand = ts13.factory.createNumericLiteral(Math.abs(value));
|
|
2056
|
+
return ts13.factory.createPrefixUnaryExpression(ts13.SyntaxKind.MinusToken, operand);
|
|
1992
2057
|
}
|
|
1993
|
-
return
|
|
2058
|
+
return ts13.factory.createNumericLiteral(value);
|
|
1994
2059
|
}
|
|
1995
2060
|
|
|
1996
|
-
// bazel-out/
|
|
2061
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
|
|
1997
2062
|
function translateType(type, contextFile, reflector, refEmitter, imports) {
|
|
1998
2063
|
return type.visitType(new TypeTranslatorVisitor(imports, contextFile, reflector, refEmitter), new Context(false));
|
|
1999
2064
|
}
|
|
@@ -2007,16 +2072,16 @@ var TypeTranslatorVisitor = class {
|
|
|
2007
2072
|
visitBuiltinType(type, context) {
|
|
2008
2073
|
switch (type.name) {
|
|
2009
2074
|
case o2.BuiltinTypeName.Bool:
|
|
2010
|
-
return
|
|
2075
|
+
return ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.BooleanKeyword);
|
|
2011
2076
|
case o2.BuiltinTypeName.Dynamic:
|
|
2012
|
-
return
|
|
2077
|
+
return ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.AnyKeyword);
|
|
2013
2078
|
case o2.BuiltinTypeName.Int:
|
|
2014
2079
|
case o2.BuiltinTypeName.Number:
|
|
2015
|
-
return
|
|
2080
|
+
return ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.NumberKeyword);
|
|
2016
2081
|
case o2.BuiltinTypeName.String:
|
|
2017
|
-
return
|
|
2082
|
+
return ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.StringKeyword);
|
|
2018
2083
|
case o2.BuiltinTypeName.None:
|
|
2019
|
-
return
|
|
2084
|
+
return ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.NeverKeyword);
|
|
2020
2085
|
default:
|
|
2021
2086
|
throw new Error(`Unsupported builtin type: ${o2.BuiltinTypeName[type.name]}`);
|
|
2022
2087
|
}
|
|
@@ -2026,26 +2091,26 @@ var TypeTranslatorVisitor = class {
|
|
|
2026
2091
|
if (type.typeParams === null) {
|
|
2027
2092
|
return typeNode;
|
|
2028
2093
|
}
|
|
2029
|
-
if (!
|
|
2094
|
+
if (!ts14.isTypeReferenceNode(typeNode)) {
|
|
2030
2095
|
throw new Error("An ExpressionType with type arguments must translate into a TypeReferenceNode");
|
|
2031
2096
|
} else if (typeNode.typeArguments !== void 0) {
|
|
2032
2097
|
throw new Error(`An ExpressionType with type arguments cannot have multiple levels of type arguments`);
|
|
2033
2098
|
}
|
|
2034
2099
|
const typeArgs = type.typeParams.map((param) => this.translateType(param, context));
|
|
2035
|
-
return
|
|
2100
|
+
return ts14.factory.createTypeReferenceNode(typeNode.typeName, typeArgs);
|
|
2036
2101
|
}
|
|
2037
2102
|
visitArrayType(type, context) {
|
|
2038
|
-
return
|
|
2103
|
+
return ts14.factory.createArrayTypeNode(this.translateType(type.of, context));
|
|
2039
2104
|
}
|
|
2040
2105
|
visitMapType(type, context) {
|
|
2041
|
-
const parameter =
|
|
2042
|
-
const typeArgs = type.valueType !== null ? this.translateType(type.valueType, context) :
|
|
2043
|
-
const indexSignature =
|
|
2044
|
-
return
|
|
2106
|
+
const parameter = ts14.factory.createParameterDeclaration(void 0, void 0, "key", void 0, ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.StringKeyword));
|
|
2107
|
+
const typeArgs = type.valueType !== null ? this.translateType(type.valueType, context) : ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.UnknownKeyword);
|
|
2108
|
+
const indexSignature = ts14.factory.createIndexSignature(void 0, [parameter], typeArgs);
|
|
2109
|
+
return ts14.factory.createTypeLiteralNode([indexSignature]);
|
|
2045
2110
|
}
|
|
2046
2111
|
visitTransplantedType(ast, context) {
|
|
2047
2112
|
const node = ast.type instanceof Reference ? ast.type.node : ast.type;
|
|
2048
|
-
if (!
|
|
2113
|
+
if (!ts14.isTypeNode(node)) {
|
|
2049
2114
|
throw new Error(`A TransplantedType must wrap a TypeNode`);
|
|
2050
2115
|
}
|
|
2051
2116
|
const viaModule = ast.type instanceof Reference ? ast.type.bestGuessOwningModule : null;
|
|
@@ -2056,7 +2121,7 @@ var TypeTranslatorVisitor = class {
|
|
|
2056
2121
|
if (ast.name === null) {
|
|
2057
2122
|
throw new Error(`ReadVarExpr with no variable name in type`);
|
|
2058
2123
|
}
|
|
2059
|
-
return
|
|
2124
|
+
return ts14.factory.createTypeQueryNode(ts14.factory.createIdentifier(ast.name));
|
|
2060
2125
|
}
|
|
2061
2126
|
visitWriteVarExpr(expr, context) {
|
|
2062
2127
|
throw new Error("Method not implemented.");
|
|
@@ -2078,15 +2143,15 @@ var TypeTranslatorVisitor = class {
|
|
|
2078
2143
|
}
|
|
2079
2144
|
visitLiteralExpr(ast, context) {
|
|
2080
2145
|
if (ast.value === null) {
|
|
2081
|
-
return
|
|
2146
|
+
return ts14.factory.createLiteralTypeNode(ts14.factory.createNull());
|
|
2082
2147
|
} else if (ast.value === void 0) {
|
|
2083
|
-
return
|
|
2148
|
+
return ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.UndefinedKeyword);
|
|
2084
2149
|
} else if (typeof ast.value === "boolean") {
|
|
2085
|
-
return
|
|
2150
|
+
return ts14.factory.createLiteralTypeNode(ast.value ? ts14.factory.createTrue() : ts14.factory.createFalse());
|
|
2086
2151
|
} else if (typeof ast.value === "number") {
|
|
2087
|
-
return
|
|
2152
|
+
return ts14.factory.createLiteralTypeNode(tsNumericExpression(ast.value));
|
|
2088
2153
|
} else {
|
|
2089
|
-
return
|
|
2154
|
+
return ts14.factory.createLiteralTypeNode(ts14.factory.createStringLiteral(ast.value));
|
|
2090
2155
|
}
|
|
2091
2156
|
}
|
|
2092
2157
|
visitLocalizedString(ast, context) {
|
|
@@ -2097,10 +2162,10 @@ var TypeTranslatorVisitor = class {
|
|
|
2097
2162
|
throw new Error(`Import unknown module or symbol`);
|
|
2098
2163
|
}
|
|
2099
2164
|
const { moduleImport, symbol } = this.imports.generateNamedImport(ast.value.moduleName, ast.value.name);
|
|
2100
|
-
const symbolIdentifier =
|
|
2101
|
-
const typeName = moduleImport ?
|
|
2165
|
+
const symbolIdentifier = ts14.factory.createIdentifier(symbol);
|
|
2166
|
+
const typeName = moduleImport ? ts14.factory.createQualifiedName(moduleImport, symbolIdentifier) : symbolIdentifier;
|
|
2102
2167
|
const typeArguments = ast.typeParams !== null ? ast.typeParams.map((type) => this.translateType(type, context)) : void 0;
|
|
2103
|
-
return
|
|
2168
|
+
return ts14.factory.createTypeReferenceNode(typeName, typeArguments);
|
|
2104
2169
|
}
|
|
2105
2170
|
visitConditionalExpr(ast, context) {
|
|
2106
2171
|
throw new Error("Method not implemented.");
|
|
@@ -2131,60 +2196,60 @@ var TypeTranslatorVisitor = class {
|
|
|
2131
2196
|
}
|
|
2132
2197
|
visitLiteralArrayExpr(ast, context) {
|
|
2133
2198
|
const values = ast.entries.map((expr) => this.translateExpression(expr, context));
|
|
2134
|
-
return
|
|
2199
|
+
return ts14.factory.createTupleTypeNode(values);
|
|
2135
2200
|
}
|
|
2136
2201
|
visitLiteralMapExpr(ast, context) {
|
|
2137
2202
|
const entries = ast.entries.map((entry) => {
|
|
2138
2203
|
const { key, quoted } = entry;
|
|
2139
2204
|
const type = this.translateExpression(entry.value, context);
|
|
2140
|
-
return
|
|
2205
|
+
return ts14.factory.createPropertySignature(
|
|
2141
2206
|
void 0,
|
|
2142
|
-
quoted ?
|
|
2207
|
+
quoted ? ts14.factory.createStringLiteral(key) : key,
|
|
2143
2208
|
void 0,
|
|
2144
2209
|
type
|
|
2145
2210
|
);
|
|
2146
2211
|
});
|
|
2147
|
-
return
|
|
2212
|
+
return ts14.factory.createTypeLiteralNode(entries);
|
|
2148
2213
|
}
|
|
2149
2214
|
visitCommaExpr(ast, context) {
|
|
2150
2215
|
throw new Error("Method not implemented.");
|
|
2151
2216
|
}
|
|
2152
2217
|
visitWrappedNodeExpr(ast, context) {
|
|
2153
2218
|
const node = ast.node;
|
|
2154
|
-
if (
|
|
2155
|
-
return
|
|
2156
|
-
} else if (
|
|
2219
|
+
if (ts14.isEntityName(node)) {
|
|
2220
|
+
return ts14.factory.createTypeReferenceNode(node, void 0);
|
|
2221
|
+
} else if (ts14.isTypeNode(node)) {
|
|
2157
2222
|
return node;
|
|
2158
|
-
} else if (
|
|
2159
|
-
return
|
|
2223
|
+
} else if (ts14.isLiteralExpression(node)) {
|
|
2224
|
+
return ts14.factory.createLiteralTypeNode(node);
|
|
2160
2225
|
} else {
|
|
2161
|
-
throw new Error(`Unsupported WrappedNodeExpr in TypeTranslatorVisitor: ${
|
|
2226
|
+
throw new Error(`Unsupported WrappedNodeExpr in TypeTranslatorVisitor: ${ts14.SyntaxKind[node.kind]}`);
|
|
2162
2227
|
}
|
|
2163
2228
|
}
|
|
2164
2229
|
visitTypeofExpr(ast, context) {
|
|
2165
2230
|
const typeNode = this.translateExpression(ast.expr, context);
|
|
2166
|
-
if (!
|
|
2231
|
+
if (!ts14.isTypeReferenceNode(typeNode)) {
|
|
2167
2232
|
throw new Error(`The target of a typeof expression must be a type reference, but it was
|
|
2168
|
-
${
|
|
2233
|
+
${ts14.SyntaxKind[typeNode.kind]}`);
|
|
2169
2234
|
}
|
|
2170
|
-
return
|
|
2235
|
+
return ts14.factory.createTypeQueryNode(typeNode.typeName);
|
|
2171
2236
|
}
|
|
2172
2237
|
translateType(type, context) {
|
|
2173
2238
|
const typeNode = type.visitType(this, context);
|
|
2174
|
-
if (!
|
|
2175
|
-
throw new Error(`A Type must translate to a TypeNode, but was ${
|
|
2239
|
+
if (!ts14.isTypeNode(typeNode)) {
|
|
2240
|
+
throw new Error(`A Type must translate to a TypeNode, but was ${ts14.SyntaxKind[typeNode.kind]}`);
|
|
2176
2241
|
}
|
|
2177
2242
|
return typeNode;
|
|
2178
2243
|
}
|
|
2179
2244
|
translateExpression(expr, context) {
|
|
2180
2245
|
const typeNode = expr.visitExpression(this, context);
|
|
2181
|
-
if (!
|
|
2182
|
-
throw new Error(`An Expression must translate to a TypeNode, but was ${
|
|
2246
|
+
if (!ts14.isTypeNode(typeNode)) {
|
|
2247
|
+
throw new Error(`An Expression must translate to a TypeNode, but was ${ts14.SyntaxKind[typeNode.kind]}`);
|
|
2183
2248
|
}
|
|
2184
2249
|
return typeNode;
|
|
2185
2250
|
}
|
|
2186
2251
|
translateTypeReference(type, context, viaModule) {
|
|
2187
|
-
const target =
|
|
2252
|
+
const target = ts14.isIdentifier(type.typeName) ? type.typeName : type.typeName.right;
|
|
2188
2253
|
const declaration = this.reflector.getDeclarationOfIdentifier(target);
|
|
2189
2254
|
if (declaration === null) {
|
|
2190
2255
|
throw new Error(`Unable to statically determine the declaration file of type node ${target.text}`);
|
|
@@ -2200,79 +2265,79 @@ var TypeTranslatorVisitor = class {
|
|
|
2200
2265
|
const emittedType = this.refEmitter.emit(reference, this.contextFile, ImportFlags.NoAliasing | ImportFlags.AllowTypeImports | ImportFlags.AllowAmbientReferences);
|
|
2201
2266
|
assertSuccessfulReferenceEmit(emittedType, target, "type");
|
|
2202
2267
|
const typeNode = this.translateExpression(emittedType.expression, context);
|
|
2203
|
-
if (!
|
|
2204
|
-
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${
|
|
2268
|
+
if (!ts14.isTypeReferenceNode(typeNode)) {
|
|
2269
|
+
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts14.SyntaxKind[typeNode.kind]}.`);
|
|
2205
2270
|
}
|
|
2206
2271
|
return typeNode;
|
|
2207
2272
|
}
|
|
2208
2273
|
};
|
|
2209
2274
|
|
|
2210
|
-
// bazel-out/
|
|
2211
|
-
import
|
|
2275
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.mjs
|
|
2276
|
+
import ts15 from "typescript";
|
|
2212
2277
|
var PureAnnotation;
|
|
2213
2278
|
(function(PureAnnotation2) {
|
|
2214
2279
|
PureAnnotation2["CLOSURE"] = "* @pureOrBreakMyCode ";
|
|
2215
2280
|
PureAnnotation2["TERSER"] = "@__PURE__";
|
|
2216
2281
|
})(PureAnnotation || (PureAnnotation = {}));
|
|
2217
2282
|
var UNARY_OPERATORS2 = {
|
|
2218
|
-
"+":
|
|
2219
|
-
"-":
|
|
2220
|
-
"!":
|
|
2283
|
+
"+": ts15.SyntaxKind.PlusToken,
|
|
2284
|
+
"-": ts15.SyntaxKind.MinusToken,
|
|
2285
|
+
"!": ts15.SyntaxKind.ExclamationToken
|
|
2221
2286
|
};
|
|
2222
2287
|
var BINARY_OPERATORS2 = {
|
|
2223
|
-
"&&":
|
|
2224
|
-
">":
|
|
2225
|
-
">=":
|
|
2226
|
-
"&":
|
|
2227
|
-
"|":
|
|
2228
|
-
"/":
|
|
2229
|
-
"==":
|
|
2230
|
-
"===":
|
|
2231
|
-
"<":
|
|
2232
|
-
"<=":
|
|
2233
|
-
"-":
|
|
2234
|
-
"%":
|
|
2235
|
-
"*":
|
|
2236
|
-
"!=":
|
|
2237
|
-
"!==":
|
|
2238
|
-
"||":
|
|
2239
|
-
"+":
|
|
2240
|
-
"??":
|
|
2288
|
+
"&&": ts15.SyntaxKind.AmpersandAmpersandToken,
|
|
2289
|
+
">": ts15.SyntaxKind.GreaterThanToken,
|
|
2290
|
+
">=": ts15.SyntaxKind.GreaterThanEqualsToken,
|
|
2291
|
+
"&": ts15.SyntaxKind.AmpersandToken,
|
|
2292
|
+
"|": ts15.SyntaxKind.BarToken,
|
|
2293
|
+
"/": ts15.SyntaxKind.SlashToken,
|
|
2294
|
+
"==": ts15.SyntaxKind.EqualsEqualsToken,
|
|
2295
|
+
"===": ts15.SyntaxKind.EqualsEqualsEqualsToken,
|
|
2296
|
+
"<": ts15.SyntaxKind.LessThanToken,
|
|
2297
|
+
"<=": ts15.SyntaxKind.LessThanEqualsToken,
|
|
2298
|
+
"-": ts15.SyntaxKind.MinusToken,
|
|
2299
|
+
"%": ts15.SyntaxKind.PercentToken,
|
|
2300
|
+
"*": ts15.SyntaxKind.AsteriskToken,
|
|
2301
|
+
"!=": ts15.SyntaxKind.ExclamationEqualsToken,
|
|
2302
|
+
"!==": ts15.SyntaxKind.ExclamationEqualsEqualsToken,
|
|
2303
|
+
"||": ts15.SyntaxKind.BarBarToken,
|
|
2304
|
+
"+": ts15.SyntaxKind.PlusToken,
|
|
2305
|
+
"??": ts15.SyntaxKind.QuestionQuestionToken
|
|
2241
2306
|
};
|
|
2242
2307
|
var VAR_TYPES = {
|
|
2243
|
-
"const":
|
|
2244
|
-
"let":
|
|
2245
|
-
"var":
|
|
2308
|
+
"const": ts15.NodeFlags.Const,
|
|
2309
|
+
"let": ts15.NodeFlags.Let,
|
|
2310
|
+
"var": ts15.NodeFlags.None
|
|
2246
2311
|
};
|
|
2247
2312
|
var TypeScriptAstFactory = class {
|
|
2248
2313
|
constructor(annotateForClosureCompiler) {
|
|
2249
2314
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
2250
2315
|
this.externalSourceFiles = /* @__PURE__ */ new Map();
|
|
2251
2316
|
this.attachComments = attachComments;
|
|
2252
|
-
this.createArrayLiteral =
|
|
2253
|
-
this.createElementAccess =
|
|
2254
|
-
this.createExpressionStatement =
|
|
2255
|
-
this.createIdentifier =
|
|
2256
|
-
this.createParenthesizedExpression =
|
|
2257
|
-
this.createPropertyAccess =
|
|
2258
|
-
this.createThrowStatement =
|
|
2259
|
-
this.createTypeOfExpression =
|
|
2317
|
+
this.createArrayLiteral = ts15.factory.createArrayLiteralExpression;
|
|
2318
|
+
this.createElementAccess = ts15.factory.createElementAccessExpression;
|
|
2319
|
+
this.createExpressionStatement = ts15.factory.createExpressionStatement;
|
|
2320
|
+
this.createIdentifier = ts15.factory.createIdentifier;
|
|
2321
|
+
this.createParenthesizedExpression = ts15.factory.createParenthesizedExpression;
|
|
2322
|
+
this.createPropertyAccess = ts15.factory.createPropertyAccessExpression;
|
|
2323
|
+
this.createThrowStatement = ts15.factory.createThrowStatement;
|
|
2324
|
+
this.createTypeOfExpression = ts15.factory.createTypeOfExpression;
|
|
2260
2325
|
}
|
|
2261
2326
|
createAssignment(target, value) {
|
|
2262
|
-
return
|
|
2327
|
+
return ts15.factory.createBinaryExpression(target, ts15.SyntaxKind.EqualsToken, value);
|
|
2263
2328
|
}
|
|
2264
2329
|
createBinaryExpression(leftOperand, operator, rightOperand) {
|
|
2265
|
-
return
|
|
2330
|
+
return ts15.factory.createBinaryExpression(leftOperand, BINARY_OPERATORS2[operator], rightOperand);
|
|
2266
2331
|
}
|
|
2267
2332
|
createBlock(body) {
|
|
2268
|
-
return
|
|
2333
|
+
return ts15.factory.createBlock(body);
|
|
2269
2334
|
}
|
|
2270
2335
|
createCallExpression(callee, args, pure) {
|
|
2271
|
-
const call =
|
|
2336
|
+
const call = ts15.factory.createCallExpression(callee, void 0, args);
|
|
2272
2337
|
if (pure) {
|
|
2273
|
-
|
|
2338
|
+
ts15.addSyntheticLeadingComment(
|
|
2274
2339
|
call,
|
|
2275
|
-
|
|
2340
|
+
ts15.SyntaxKind.MultiLineCommentTrivia,
|
|
2276
2341
|
this.annotateForClosureCompiler ? PureAnnotation.CLOSURE : PureAnnotation.TERSER,
|
|
2277
2342
|
false
|
|
2278
2343
|
);
|
|
@@ -2280,64 +2345,64 @@ var TypeScriptAstFactory = class {
|
|
|
2280
2345
|
return call;
|
|
2281
2346
|
}
|
|
2282
2347
|
createConditional(condition, whenTrue, whenFalse) {
|
|
2283
|
-
return
|
|
2348
|
+
return ts15.factory.createConditionalExpression(condition, void 0, whenTrue, void 0, whenFalse);
|
|
2284
2349
|
}
|
|
2285
2350
|
createDynamicImport(url) {
|
|
2286
|
-
return
|
|
2287
|
-
|
|
2351
|
+
return ts15.factory.createCallExpression(
|
|
2352
|
+
ts15.factory.createToken(ts15.SyntaxKind.ImportKeyword),
|
|
2288
2353
|
void 0,
|
|
2289
|
-
[
|
|
2354
|
+
[ts15.factory.createStringLiteral(url)]
|
|
2290
2355
|
);
|
|
2291
2356
|
}
|
|
2292
2357
|
createFunctionDeclaration(functionName, parameters, body) {
|
|
2293
|
-
if (!
|
|
2294
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
2358
|
+
if (!ts15.isBlock(body)) {
|
|
2359
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts15.SyntaxKind[body.kind]}.`);
|
|
2295
2360
|
}
|
|
2296
|
-
return
|
|
2361
|
+
return ts15.factory.createFunctionDeclaration(void 0, void 0, functionName, void 0, parameters.map((param) => ts15.factory.createParameterDeclaration(void 0, void 0, param)), void 0, body);
|
|
2297
2362
|
}
|
|
2298
2363
|
createFunctionExpression(functionName, parameters, body) {
|
|
2299
|
-
if (!
|
|
2300
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
2364
|
+
if (!ts15.isBlock(body)) {
|
|
2365
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts15.SyntaxKind[body.kind]}.`);
|
|
2301
2366
|
}
|
|
2302
|
-
return
|
|
2367
|
+
return ts15.factory.createFunctionExpression(void 0, void 0, functionName != null ? functionName : void 0, void 0, parameters.map((param) => ts15.factory.createParameterDeclaration(void 0, void 0, param)), void 0, body);
|
|
2303
2368
|
}
|
|
2304
2369
|
createArrowFunctionExpression(parameters, body) {
|
|
2305
|
-
if (
|
|
2306
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
2370
|
+
if (ts15.isStatement(body) && !ts15.isBlock(body)) {
|
|
2371
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts15.SyntaxKind[body.kind]}.`);
|
|
2307
2372
|
}
|
|
2308
|
-
return
|
|
2373
|
+
return ts15.factory.createArrowFunction(void 0, void 0, parameters.map((param) => ts15.factory.createParameterDeclaration(void 0, void 0, param)), void 0, void 0, body);
|
|
2309
2374
|
}
|
|
2310
2375
|
createIfStatement(condition, thenStatement, elseStatement) {
|
|
2311
|
-
return
|
|
2376
|
+
return ts15.factory.createIfStatement(condition, thenStatement, elseStatement != null ? elseStatement : void 0);
|
|
2312
2377
|
}
|
|
2313
2378
|
createLiteral(value) {
|
|
2314
2379
|
if (value === void 0) {
|
|
2315
|
-
return
|
|
2380
|
+
return ts15.factory.createIdentifier("undefined");
|
|
2316
2381
|
} else if (value === null) {
|
|
2317
|
-
return
|
|
2382
|
+
return ts15.factory.createNull();
|
|
2318
2383
|
} else if (typeof value === "boolean") {
|
|
2319
|
-
return value ?
|
|
2384
|
+
return value ? ts15.factory.createTrue() : ts15.factory.createFalse();
|
|
2320
2385
|
} else if (typeof value === "number") {
|
|
2321
2386
|
return tsNumericExpression(value);
|
|
2322
2387
|
} else {
|
|
2323
|
-
return
|
|
2388
|
+
return ts15.factory.createStringLiteral(value);
|
|
2324
2389
|
}
|
|
2325
2390
|
}
|
|
2326
2391
|
createNewExpression(expression, args) {
|
|
2327
|
-
return
|
|
2392
|
+
return ts15.factory.createNewExpression(expression, void 0, args);
|
|
2328
2393
|
}
|
|
2329
2394
|
createObjectLiteral(properties) {
|
|
2330
|
-
return
|
|
2395
|
+
return ts15.factory.createObjectLiteralExpression(properties.map((prop) => ts15.factory.createPropertyAssignment(prop.quoted ? ts15.factory.createStringLiteral(prop.propertyName) : ts15.factory.createIdentifier(prop.propertyName), prop.value)));
|
|
2331
2396
|
}
|
|
2332
2397
|
createReturnStatement(expression) {
|
|
2333
|
-
return
|
|
2398
|
+
return ts15.factory.createReturnStatement(expression != null ? expression : void 0);
|
|
2334
2399
|
}
|
|
2335
2400
|
createTaggedTemplate(tag, template) {
|
|
2336
2401
|
let templateLiteral;
|
|
2337
2402
|
const length = template.elements.length;
|
|
2338
2403
|
const head = template.elements[0];
|
|
2339
2404
|
if (length === 1) {
|
|
2340
|
-
templateLiteral =
|
|
2405
|
+
templateLiteral = ts15.factory.createNoSubstitutionTemplateLiteral(head.cooked, head.raw);
|
|
2341
2406
|
} else {
|
|
2342
2407
|
const spans = [];
|
|
2343
2408
|
for (let i = 1; i < length - 1; i++) {
|
|
@@ -2346,7 +2411,7 @@ var TypeScriptAstFactory = class {
|
|
|
2346
2411
|
if (range !== null) {
|
|
2347
2412
|
this.setSourceMapRange(middle, range);
|
|
2348
2413
|
}
|
|
2349
|
-
spans.push(
|
|
2414
|
+
spans.push(ts15.factory.createTemplateSpan(template.expressions[i - 1], middle));
|
|
2350
2415
|
}
|
|
2351
2416
|
const resolvedExpression = template.expressions[length - 2];
|
|
2352
2417
|
const templatePart = template.elements[length - 1];
|
|
@@ -2354,19 +2419,19 @@ var TypeScriptAstFactory = class {
|
|
|
2354
2419
|
if (templatePart.range !== null) {
|
|
2355
2420
|
this.setSourceMapRange(templateTail, templatePart.range);
|
|
2356
2421
|
}
|
|
2357
|
-
spans.push(
|
|
2358
|
-
templateLiteral =
|
|
2422
|
+
spans.push(ts15.factory.createTemplateSpan(resolvedExpression, templateTail));
|
|
2423
|
+
templateLiteral = ts15.factory.createTemplateExpression(ts15.factory.createTemplateHead(head.cooked, head.raw), spans);
|
|
2359
2424
|
}
|
|
2360
2425
|
if (head.range !== null) {
|
|
2361
2426
|
this.setSourceMapRange(templateLiteral, head.range);
|
|
2362
2427
|
}
|
|
2363
|
-
return
|
|
2428
|
+
return ts15.factory.createTaggedTemplateExpression(tag, void 0, templateLiteral);
|
|
2364
2429
|
}
|
|
2365
2430
|
createUnaryExpression(operator, operand) {
|
|
2366
|
-
return
|
|
2431
|
+
return ts15.factory.createPrefixUnaryExpression(UNARY_OPERATORS2[operator], operand);
|
|
2367
2432
|
}
|
|
2368
2433
|
createVariableDeclaration(variableName, initializer, type) {
|
|
2369
|
-
return
|
|
2434
|
+
return ts15.factory.createVariableStatement(void 0, ts15.factory.createVariableDeclarationList([ts15.factory.createVariableDeclaration(variableName, void 0, void 0, initializer != null ? initializer : void 0)], VAR_TYPES[type]));
|
|
2370
2435
|
}
|
|
2371
2436
|
setSourceMapRange(node, sourceMapRange) {
|
|
2372
2437
|
if (sourceMapRange === null) {
|
|
@@ -2374,37 +2439,37 @@ var TypeScriptAstFactory = class {
|
|
|
2374
2439
|
}
|
|
2375
2440
|
const url = sourceMapRange.url;
|
|
2376
2441
|
if (!this.externalSourceFiles.has(url)) {
|
|
2377
|
-
this.externalSourceFiles.set(url,
|
|
2442
|
+
this.externalSourceFiles.set(url, ts15.createSourceMapSource(url, sourceMapRange.content, (pos) => pos));
|
|
2378
2443
|
}
|
|
2379
2444
|
const source = this.externalSourceFiles.get(url);
|
|
2380
|
-
|
|
2445
|
+
ts15.setSourceMapRange(node, { pos: sourceMapRange.start.offset, end: sourceMapRange.end.offset, source });
|
|
2381
2446
|
return node;
|
|
2382
2447
|
}
|
|
2383
2448
|
};
|
|
2384
2449
|
function createTemplateMiddle(cooked, raw) {
|
|
2385
|
-
const node =
|
|
2386
|
-
node.kind =
|
|
2450
|
+
const node = ts15.factory.createTemplateHead(cooked, raw);
|
|
2451
|
+
node.kind = ts15.SyntaxKind.TemplateMiddle;
|
|
2387
2452
|
return node;
|
|
2388
2453
|
}
|
|
2389
2454
|
function createTemplateTail(cooked, raw) {
|
|
2390
|
-
const node =
|
|
2391
|
-
node.kind =
|
|
2455
|
+
const node = ts15.factory.createTemplateHead(cooked, raw);
|
|
2456
|
+
node.kind = ts15.SyntaxKind.TemplateTail;
|
|
2392
2457
|
return node;
|
|
2393
2458
|
}
|
|
2394
2459
|
function attachComments(statement, leadingComments) {
|
|
2395
2460
|
for (const comment of leadingComments) {
|
|
2396
|
-
const commentKind = comment.multiline ?
|
|
2461
|
+
const commentKind = comment.multiline ? ts15.SyntaxKind.MultiLineCommentTrivia : ts15.SyntaxKind.SingleLineCommentTrivia;
|
|
2397
2462
|
if (comment.multiline) {
|
|
2398
|
-
|
|
2463
|
+
ts15.addSyntheticLeadingComment(statement, commentKind, comment.toString(), comment.trailingNewline);
|
|
2399
2464
|
} else {
|
|
2400
2465
|
for (const line of comment.toString().split("\n")) {
|
|
2401
|
-
|
|
2466
|
+
ts15.addSyntheticLeadingComment(statement, commentKind, line, comment.trailingNewline);
|
|
2402
2467
|
}
|
|
2403
2468
|
}
|
|
2404
2469
|
}
|
|
2405
2470
|
}
|
|
2406
2471
|
|
|
2407
|
-
// bazel-out/
|
|
2472
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_translator.mjs
|
|
2408
2473
|
function translateExpression(expression, imports, options = {}) {
|
|
2409
2474
|
return expression.visitExpression(new ExpressionTranslatorVisitor(new TypeScriptAstFactory(options.annotateForClosureCompiler === true), imports, options), new Context(false));
|
|
2410
2475
|
}
|
|
@@ -2422,6 +2487,7 @@ export {
|
|
|
2422
2487
|
makeDiagnosticChain,
|
|
2423
2488
|
makeRelatedInformation,
|
|
2424
2489
|
addDiagnosticChain,
|
|
2490
|
+
isFatalDiagnosticError,
|
|
2425
2491
|
ERROR_DETAILS_PAGE_BASE_URL,
|
|
2426
2492
|
ExtendedTemplateDiagnosticName,
|
|
2427
2493
|
isSymbolWithValueDeclaration,
|
|
@@ -2467,6 +2533,7 @@ export {
|
|
|
2467
2533
|
filterToMembersWithDecorator,
|
|
2468
2534
|
reflectObjectLiteral,
|
|
2469
2535
|
DeferredSymbolTracker,
|
|
2536
|
+
LocalCompilationExtraImportsTracker,
|
|
2470
2537
|
Reference,
|
|
2471
2538
|
ModuleResolver,
|
|
2472
2539
|
Context,
|
|
@@ -2492,4 +2559,4 @@ export {
|
|
|
2492
2559
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2493
2560
|
* found in the LICENSE file at https://angular.io/license
|
|
2494
2561
|
*/
|
|
2495
|
-
//# sourceMappingURL=chunk-
|
|
2562
|
+
//# sourceMappingURL=chunk-CVK4HV4K.js.map
|