@angular/compiler-cli 17.2.1 → 17.2.3
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-UM6JO3VZ.js → chunk-75YFKYUJ.js} +7 -7
- package/bundles/{chunk-63UQIYTZ.js → chunk-FS75LCNP.js} +30 -30
- package/bundles/{chunk-KYE5EYIK.js → chunk-LWM7EW6L.js} +28 -28
- package/bundles/{chunk-KYE5EYIK.js.map → chunk-LWM7EW6L.js.map} +1 -1
- package/bundles/{chunk-PQBKKYRL.js → chunk-MV5DSSRA.js} +497 -492
- package/bundles/chunk-MV5DSSRA.js.map +6 -0
- package/bundles/{chunk-QLLRERNV.js → chunk-NQAH24UD.js} +5 -5
- package/bundles/{chunk-6VEEN3ZS.js → chunk-Q5Y7HH3O.js} +5 -5
- package/bundles/{chunk-64JBPJBS.js → chunk-R4KQI5XI.js} +5 -5
- package/bundles/{chunk-LYJKWJUC.js → chunk-SBDNBITT.js} +3 -3
- package/bundles/{chunk-KMYUI7UU.js → chunk-SGHI77T2.js} +595 -534
- package/bundles/chunk-SGHI77T2.js.map +6 -0
- package/bundles/{chunk-2WQIUGOU.js → chunk-WCD6LVCP.js} +7 -7
- package/bundles/{chunk-CVK4HV4K.js → chunk-YBXVKJOM.js} +248 -188
- package/bundles/{chunk-CVK4HV4K.js.map → chunk-YBXVKJOM.js.map} +3 -3
- 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/annotations/component/src/handler.d.ts +3 -2
- package/src/ngtsc/annotations/directive/src/handler.d.ts +3 -2
- package/src/ngtsc/annotations/directive/src/initializer_functions.d.ts +2 -3
- package/src/ngtsc/annotations/directive/src/input_function.d.ts +2 -1
- package/src/ngtsc/annotations/directive/src/model_function.d.ts +2 -1
- package/src/ngtsc/annotations/directive/src/output_function.d.ts +2 -1
- package/src/ngtsc/annotations/directive/src/query_functions.d.ts +2 -1
- package/src/ngtsc/annotations/directive/src/shared.d.ts +2 -2
- package/src/ngtsc/docs/src/constant_extractor.d.ts +2 -2
- package/src/ngtsc/imports/index.d.ts +1 -0
- package/src/ngtsc/imports/src/imported_symbols_tracker.d.ts +37 -0
- package/src/transformers/jit_transforms/initializer_api_transforms/transform.d.ts +2 -1
- package/src/transformers/jit_transforms/initializer_api_transforms/transform_api.d.ts +3 -2
- package/bundles/chunk-KMYUI7UU.js.map +0 -6
- package/bundles/chunk-PQBKKYRL.js.map +0 -6
- /package/bundles/{chunk-UM6JO3VZ.js.map → chunk-75YFKYUJ.js.map} +0 -0
- /package/bundles/{chunk-63UQIYTZ.js.map → chunk-FS75LCNP.js.map} +0 -0
- /package/bundles/{chunk-QLLRERNV.js.map → chunk-NQAH24UD.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-LYJKWJUC.js.map → chunk-SBDNBITT.js.map} +0 -0
- /package/bundles/{chunk-2WQIUGOU.js.map → chunk-WCD6LVCP.js.map} +0 -0
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
resolve,
|
|
13
13
|
stripExtension,
|
|
14
14
|
toRelativeImport
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-75YFKYUJ.js";
|
|
16
16
|
|
|
17
|
-
// bazel-out/
|
|
17
|
+
// bazel-out/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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;
|
|
@@ -661,7 +661,7 @@ function getExportedName(decl, originalId) {
|
|
|
661
661
|
}
|
|
662
662
|
var LocalExportedDeclarations = Symbol("LocalExportedDeclarations");
|
|
663
663
|
|
|
664
|
-
// bazel-out/
|
|
664
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/typescript.mjs
|
|
665
665
|
import ts5 from "typescript";
|
|
666
666
|
var TS = /\.tsx?$/i;
|
|
667
667
|
var D_TS = /\.d\.ts$/i;
|
|
@@ -762,7 +762,7 @@ function toUnredirectedSourceFile(sf) {
|
|
|
762
762
|
return redirectInfo.unredirected;
|
|
763
763
|
}
|
|
764
764
|
|
|
765
|
-
// bazel-out/
|
|
765
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/references.mjs
|
|
766
766
|
var Reference = class {
|
|
767
767
|
constructor(node, bestGuessOwningModule = null) {
|
|
768
768
|
this.node = node;
|
|
@@ -831,14 +831,14 @@ var Reference = class {
|
|
|
831
831
|
}
|
|
832
832
|
};
|
|
833
833
|
|
|
834
|
-
// bazel-out/
|
|
834
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/alias.mjs
|
|
835
835
|
import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
|
|
836
836
|
|
|
837
|
-
// bazel-out/
|
|
837
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
|
|
838
838
|
import { ExternalExpr, ExternalReference, WrappedNodeExpr } from "@angular/compiler";
|
|
839
839
|
import ts7 from "typescript";
|
|
840
840
|
|
|
841
|
-
// bazel-out/
|
|
841
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.mjs
|
|
842
842
|
var ErrorCode;
|
|
843
843
|
(function(ErrorCode2) {
|
|
844
844
|
ErrorCode2[ErrorCode2["DECORATOR_ARG_NOT_LITERAL"] = 1001] = "DECORATOR_ARG_NOT_LITERAL";
|
|
@@ -926,7 +926,7 @@ var ErrorCode;
|
|
|
926
926
|
ErrorCode2[ErrorCode2["LOCAL_COMPILATION_EXPRESSION_FOR_HOST_DIRECTIVE"] = 11003] = "LOCAL_COMPILATION_EXPRESSION_FOR_HOST_DIRECTIVE";
|
|
927
927
|
})(ErrorCode || (ErrorCode = {}));
|
|
928
928
|
|
|
929
|
-
// bazel-out/
|
|
929
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/docs.mjs
|
|
930
930
|
var COMPILER_ERRORS_WITH_GUIDES = /* @__PURE__ */ new Set([
|
|
931
931
|
ErrorCode.DECORATOR_ARG_NOT_LITERAL,
|
|
932
932
|
ErrorCode.IMPORT_CYCLE_DETECTED,
|
|
@@ -938,10 +938,10 @@ var COMPILER_ERRORS_WITH_GUIDES = /* @__PURE__ */ new Set([
|
|
|
938
938
|
ErrorCode.WARN_NGMODULE_ID_UNNECESSARY
|
|
939
939
|
]);
|
|
940
940
|
|
|
941
|
-
// bazel-out/
|
|
941
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
942
942
|
import ts6 from "typescript";
|
|
943
943
|
|
|
944
|
-
// bazel-out/
|
|
944
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/util.mjs
|
|
945
945
|
var ERROR_CODE_MATCHER = /(\u001b\[\d+m ?)TS-99(\d+: ?\u001b\[\d+m)/g;
|
|
946
946
|
function replaceTsWithNgInErrors(errors) {
|
|
947
947
|
return errors.replace(ERROR_CODE_MATCHER, "$1NG$2");
|
|
@@ -950,7 +950,7 @@ function ngErrorCode(code) {
|
|
|
950
950
|
return parseInt("-99" + code);
|
|
951
951
|
}
|
|
952
952
|
|
|
953
|
-
// bazel-out/
|
|
953
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
954
954
|
var FatalDiagnosticError = class extends Error {
|
|
955
955
|
constructor(code, node, diagnosticMessage, relatedInformation) {
|
|
956
956
|
super(`FatalDiagnosticError #${code}: ${diagnosticMessage}`);
|
|
@@ -1012,10 +1012,10 @@ function isFatalDiagnosticError(err) {
|
|
|
1012
1012
|
return err._isFatalDiagnosticError === true;
|
|
1013
1013
|
}
|
|
1014
1014
|
|
|
1015
|
-
// bazel-out/
|
|
1015
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.mjs
|
|
1016
1016
|
var ERROR_DETAILS_PAGE_BASE_URL = "https://angular.io/errors";
|
|
1017
1017
|
|
|
1018
|
-
// bazel-out/
|
|
1018
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.mjs
|
|
1019
1019
|
var ExtendedTemplateDiagnosticName;
|
|
1020
1020
|
(function(ExtendedTemplateDiagnosticName2) {
|
|
1021
1021
|
ExtendedTemplateDiagnosticName2["INVALID_BANANA_IN_BOX"] = "invalidBananaInBox";
|
|
@@ -1030,7 +1030,7 @@ var ExtendedTemplateDiagnosticName;
|
|
|
1030
1030
|
ExtendedTemplateDiagnosticName2["CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION"] = "controlFlowPreventingContentProjection";
|
|
1031
1031
|
})(ExtendedTemplateDiagnosticName || (ExtendedTemplateDiagnosticName = {}));
|
|
1032
1032
|
|
|
1033
|
-
// bazel-out/
|
|
1033
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/find_export.mjs
|
|
1034
1034
|
function findExportedNameOfNode(target, file, reflector) {
|
|
1035
1035
|
const exports = reflector.getExportsOfModule(file);
|
|
1036
1036
|
if (exports === null) {
|
|
@@ -1050,7 +1050,7 @@ function findExportedNameOfNode(target, file, reflector) {
|
|
|
1050
1050
|
return foundExportName;
|
|
1051
1051
|
}
|
|
1052
1052
|
|
|
1053
|
-
// bazel-out/
|
|
1053
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
|
|
1054
1054
|
var ImportFlags;
|
|
1055
1055
|
(function(ImportFlags2) {
|
|
1056
1056
|
ImportFlags2[ImportFlags2["None"] = 0] = "None";
|
|
@@ -1279,7 +1279,7 @@ var UnifiedModulesStrategy = class {
|
|
|
1279
1279
|
}
|
|
1280
1280
|
};
|
|
1281
1281
|
|
|
1282
|
-
// bazel-out/
|
|
1282
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/alias.mjs
|
|
1283
1283
|
var CHARS_TO_ESCAPE = /[^a-zA-Z0-9/_]/g;
|
|
1284
1284
|
var UnifiedModulesAliasingHost = class {
|
|
1285
1285
|
constructor(unifiedModulesHost) {
|
|
@@ -1346,7 +1346,7 @@ var AliasStrategy = class {
|
|
|
1346
1346
|
}
|
|
1347
1347
|
};
|
|
1348
1348
|
|
|
1349
|
-
// bazel-out/
|
|
1349
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/path.mjs
|
|
1350
1350
|
function relativePathBetween(from, to) {
|
|
1351
1351
|
const relativePath = stripExtension(relative(dirname(resolve(from)), resolve(to)));
|
|
1352
1352
|
return relativePath !== "" ? toRelativeImport(relativePath) : null;
|
|
@@ -1355,7 +1355,7 @@ function normalizeSeparators(path) {
|
|
|
1355
1355
|
return path.replace(/\\/g, "/");
|
|
1356
1356
|
}
|
|
1357
1357
|
|
|
1358
|
-
// bazel-out/
|
|
1358
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/core.mjs
|
|
1359
1359
|
var NoopImportRewriter = class {
|
|
1360
1360
|
shouldImportSymbol(symbol, specifier) {
|
|
1361
1361
|
return true;
|
|
@@ -1414,7 +1414,7 @@ function validateAndRewriteCoreSymbol(name) {
|
|
|
1414
1414
|
return CORE_SUPPORTED_SYMBOLS.get(name);
|
|
1415
1415
|
}
|
|
1416
1416
|
|
|
1417
|
-
// bazel-out/
|
|
1417
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/patch_alias_reference_resolution.mjs
|
|
1418
1418
|
import ts8 from "typescript";
|
|
1419
1419
|
var patchedReferencedAliasesSymbol = Symbol("patchedReferencedAliases");
|
|
1420
1420
|
function loadIsReferencedAliasDeclarationPatch(context) {
|
|
@@ -1449,7 +1449,7 @@ function throwIncompatibleTransformationContextError() {
|
|
|
1449
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.");
|
|
1450
1450
|
}
|
|
1451
1451
|
|
|
1452
|
-
// bazel-out/
|
|
1452
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/default.mjs
|
|
1453
1453
|
var DefaultImportDeclaration = Symbol("DefaultImportDeclaration");
|
|
1454
1454
|
function attachDefaultImportDeclaration(expr, importDecl) {
|
|
1455
1455
|
expr[DefaultImportDeclaration] = importDecl;
|
|
@@ -1490,7 +1490,7 @@ var DefaultImportTracker = class {
|
|
|
1490
1490
|
}
|
|
1491
1491
|
};
|
|
1492
1492
|
|
|
1493
|
-
// bazel-out/
|
|
1493
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/deferred_symbol_tracker.mjs
|
|
1494
1494
|
import ts9 from "typescript";
|
|
1495
1495
|
var AssumeEager = "AssumeEager";
|
|
1496
1496
|
var DeferredSymbolTracker = class {
|
|
@@ -1611,8 +1611,67 @@ var DeferredSymbolTracker = class {
|
|
|
1611
1611
|
}
|
|
1612
1612
|
};
|
|
1613
1613
|
|
|
1614
|
-
// bazel-out/
|
|
1614
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/imported_symbols_tracker.mjs
|
|
1615
1615
|
import ts10 from "typescript";
|
|
1616
|
+
var ImportedSymbolsTracker = class {
|
|
1617
|
+
constructor() {
|
|
1618
|
+
this.fileToNamedImports = /* @__PURE__ */ new WeakMap();
|
|
1619
|
+
this.fileToNamespaceImports = /* @__PURE__ */ new WeakMap();
|
|
1620
|
+
}
|
|
1621
|
+
isPotentialReferenceToNamedImport(node, exportedName, moduleName) {
|
|
1622
|
+
const sourceFile = node.getSourceFile();
|
|
1623
|
+
this.scanImports(sourceFile);
|
|
1624
|
+
const fileImports = this.fileToNamedImports.get(sourceFile);
|
|
1625
|
+
const moduleImports = fileImports.get(moduleName);
|
|
1626
|
+
const symbolImports = moduleImports == null ? void 0 : moduleImports.get(exportedName);
|
|
1627
|
+
return symbolImports !== void 0 && symbolImports.has(node.text);
|
|
1628
|
+
}
|
|
1629
|
+
isPotentialReferenceToNamespaceImport(node, moduleName) {
|
|
1630
|
+
var _a, _b;
|
|
1631
|
+
const sourceFile = node.getSourceFile();
|
|
1632
|
+
this.scanImports(sourceFile);
|
|
1633
|
+
const namespaces = this.fileToNamespaceImports.get(sourceFile);
|
|
1634
|
+
return (_b = (_a = namespaces.get(moduleName)) == null ? void 0 : _a.has(node.text)) != null ? _b : false;
|
|
1635
|
+
}
|
|
1636
|
+
scanImports(sourceFile) {
|
|
1637
|
+
var _a, _b;
|
|
1638
|
+
if (this.fileToNamedImports.has(sourceFile) && this.fileToNamespaceImports.has(sourceFile)) {
|
|
1639
|
+
return;
|
|
1640
|
+
}
|
|
1641
|
+
const namedImports = /* @__PURE__ */ new Map();
|
|
1642
|
+
const namespaceImports = /* @__PURE__ */ new Map();
|
|
1643
|
+
this.fileToNamedImports.set(sourceFile, namedImports);
|
|
1644
|
+
this.fileToNamespaceImports.set(sourceFile, namespaceImports);
|
|
1645
|
+
for (const stmt of sourceFile.statements) {
|
|
1646
|
+
if (!ts10.isImportDeclaration(stmt) || !ts10.isStringLiteralLike(stmt.moduleSpecifier) || ((_a = stmt.importClause) == null ? void 0 : _a.namedBindings) === void 0) {
|
|
1647
|
+
continue;
|
|
1648
|
+
}
|
|
1649
|
+
const moduleName = stmt.moduleSpecifier.text;
|
|
1650
|
+
if (ts10.isNamespaceImport(stmt.importClause.namedBindings)) {
|
|
1651
|
+
if (!namespaceImports.has(moduleName)) {
|
|
1652
|
+
namespaceImports.set(moduleName, /* @__PURE__ */ new Set());
|
|
1653
|
+
}
|
|
1654
|
+
namespaceImports.get(moduleName).add(stmt.importClause.namedBindings.name.text);
|
|
1655
|
+
} else {
|
|
1656
|
+
for (const element of stmt.importClause.namedBindings.elements) {
|
|
1657
|
+
const localName = element.name.text;
|
|
1658
|
+
const exportedName = element.propertyName === void 0 ? localName : element.propertyName.text;
|
|
1659
|
+
if (!namedImports.has(moduleName)) {
|
|
1660
|
+
namedImports.set(moduleName, /* @__PURE__ */ new Map());
|
|
1661
|
+
}
|
|
1662
|
+
const localNames = namedImports.get(moduleName);
|
|
1663
|
+
if (!localNames.has(exportedName)) {
|
|
1664
|
+
localNames.set(exportedName, /* @__PURE__ */ new Set());
|
|
1665
|
+
}
|
|
1666
|
+
(_b = localNames.get(exportedName)) == null ? void 0 : _b.add(localName);
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
};
|
|
1672
|
+
|
|
1673
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/local_compilation_extra_imports_tracker.mjs
|
|
1674
|
+
import ts11 from "typescript";
|
|
1616
1675
|
var LocalCompilationExtraImportsTracker = class {
|
|
1617
1676
|
constructor(typeChecker) {
|
|
1618
1677
|
this.typeChecker = typeChecker;
|
|
@@ -1628,9 +1687,9 @@ var LocalCompilationExtraImportsTracker = class {
|
|
|
1628
1687
|
addGlobalImportFromIdentifier(node) {
|
|
1629
1688
|
var _a;
|
|
1630
1689
|
let identifier = null;
|
|
1631
|
-
if (
|
|
1690
|
+
if (ts11.isIdentifier(node)) {
|
|
1632
1691
|
identifier = node;
|
|
1633
|
-
} else if (
|
|
1692
|
+
} else if (ts11.isPropertyAccessExpression(node) && ts11.isIdentifier(node.expression)) {
|
|
1634
1693
|
identifier = node.expression;
|
|
1635
1694
|
}
|
|
1636
1695
|
if (identifier === null) {
|
|
@@ -1658,7 +1717,7 @@ function removeQuotations(s) {
|
|
|
1658
1717
|
return s.substring(1, s.length - 1).trim();
|
|
1659
1718
|
}
|
|
1660
1719
|
|
|
1661
|
-
// bazel-out/
|
|
1720
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/resolver.mjs
|
|
1662
1721
|
var ModuleResolver = class {
|
|
1663
1722
|
constructor(program, compilerOptions, host, moduleResolutionCache) {
|
|
1664
1723
|
this.program = program;
|
|
@@ -1675,10 +1734,10 @@ var ModuleResolver = class {
|
|
|
1675
1734
|
}
|
|
1676
1735
|
};
|
|
1677
1736
|
|
|
1678
|
-
// bazel-out/
|
|
1679
|
-
import
|
|
1737
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager.mjs
|
|
1738
|
+
import ts12 from "typescript";
|
|
1680
1739
|
var ImportManager = class {
|
|
1681
|
-
constructor(rewriter = new NoopImportRewriter(), prefix = "i", factory =
|
|
1740
|
+
constructor(rewriter = new NoopImportRewriter(), prefix = "i", factory = ts12.factory) {
|
|
1682
1741
|
this.rewriter = rewriter;
|
|
1683
1742
|
this.prefix = prefix;
|
|
1684
1743
|
this.factory = factory;
|
|
@@ -1717,7 +1776,7 @@ var ImportManager = class {
|
|
|
1717
1776
|
}
|
|
1718
1777
|
};
|
|
1719
1778
|
|
|
1720
|
-
// bazel-out/
|
|
1779
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/context.mjs
|
|
1721
1780
|
var Context = class {
|
|
1722
1781
|
constructor(isStatement) {
|
|
1723
1782
|
this.isStatement = isStatement;
|
|
@@ -1730,7 +1789,7 @@ var Context = class {
|
|
|
1730
1789
|
}
|
|
1731
1790
|
};
|
|
1732
1791
|
|
|
1733
|
-
// bazel-out/
|
|
1792
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/translator.mjs
|
|
1734
1793
|
import * as o from "@angular/compiler";
|
|
1735
1794
|
var UNARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
1736
1795
|
[o.UnaryOperator.Minus, "-"],
|
|
@@ -1969,8 +2028,8 @@ function createRange(span) {
|
|
|
1969
2028
|
};
|
|
1970
2029
|
}
|
|
1971
2030
|
|
|
1972
|
-
// bazel-out/
|
|
1973
|
-
import
|
|
2031
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_emitter.mjs
|
|
2032
|
+
import ts13 from "typescript";
|
|
1974
2033
|
var INELIGIBLE = {};
|
|
1975
2034
|
function canEmitType(type, canEmit) {
|
|
1976
2035
|
return canEmitTypeWorker(type);
|
|
@@ -1978,13 +2037,13 @@ function canEmitType(type, canEmit) {
|
|
|
1978
2037
|
return visitNode(type2) !== INELIGIBLE;
|
|
1979
2038
|
}
|
|
1980
2039
|
function visitNode(node) {
|
|
1981
|
-
if (
|
|
2040
|
+
if (ts13.isImportTypeNode(node)) {
|
|
1982
2041
|
return INELIGIBLE;
|
|
1983
2042
|
}
|
|
1984
|
-
if (
|
|
2043
|
+
if (ts13.isTypeReferenceNode(node) && !canEmitTypeReference(node)) {
|
|
1985
2044
|
return INELIGIBLE;
|
|
1986
2045
|
} else {
|
|
1987
|
-
return
|
|
2046
|
+
return ts13.forEachChild(node, visitNode);
|
|
1988
2047
|
}
|
|
1989
2048
|
}
|
|
1990
2049
|
function canEmitTypeReference(type2) {
|
|
@@ -2001,35 +2060,35 @@ var TypeEmitter = class {
|
|
|
2001
2060
|
emitType(type) {
|
|
2002
2061
|
const typeReferenceTransformer = (context) => {
|
|
2003
2062
|
const visitNode = (node) => {
|
|
2004
|
-
if (
|
|
2063
|
+
if (ts13.isImportTypeNode(node)) {
|
|
2005
2064
|
throw new Error("Unable to emit import type");
|
|
2006
2065
|
}
|
|
2007
|
-
if (
|
|
2066
|
+
if (ts13.isTypeReferenceNode(node)) {
|
|
2008
2067
|
return this.emitTypeReference(node);
|
|
2009
|
-
} else if (
|
|
2068
|
+
} else if (ts13.isLiteralExpression(node)) {
|
|
2010
2069
|
let clone;
|
|
2011
|
-
if (
|
|
2012
|
-
clone =
|
|
2013
|
-
} else if (
|
|
2014
|
-
clone =
|
|
2015
|
-
} else if (
|
|
2016
|
-
clone =
|
|
2017
|
-
} else if (
|
|
2018
|
-
clone =
|
|
2019
|
-
} else if (
|
|
2020
|
-
clone =
|
|
2070
|
+
if (ts13.isStringLiteral(node)) {
|
|
2071
|
+
clone = ts13.factory.createStringLiteral(node.text);
|
|
2072
|
+
} else if (ts13.isNumericLiteral(node)) {
|
|
2073
|
+
clone = ts13.factory.createNumericLiteral(node.text);
|
|
2074
|
+
} else if (ts13.isBigIntLiteral(node)) {
|
|
2075
|
+
clone = ts13.factory.createBigIntLiteral(node.text);
|
|
2076
|
+
} else if (ts13.isNoSubstitutionTemplateLiteral(node)) {
|
|
2077
|
+
clone = ts13.factory.createNoSubstitutionTemplateLiteral(node.text, node.rawText);
|
|
2078
|
+
} else if (ts13.isRegularExpressionLiteral(node)) {
|
|
2079
|
+
clone = ts13.factory.createRegularExpressionLiteral(node.text);
|
|
2021
2080
|
} else {
|
|
2022
|
-
throw new Error(`Unsupported literal kind ${
|
|
2081
|
+
throw new Error(`Unsupported literal kind ${ts13.SyntaxKind[node.kind]}`);
|
|
2023
2082
|
}
|
|
2024
|
-
|
|
2083
|
+
ts13.setTextRange(clone, { pos: -1, end: -1 });
|
|
2025
2084
|
return clone;
|
|
2026
2085
|
} else {
|
|
2027
|
-
return
|
|
2086
|
+
return ts13.visitEachChild(node, visitNode, context);
|
|
2028
2087
|
}
|
|
2029
2088
|
};
|
|
2030
|
-
return (node) =>
|
|
2089
|
+
return (node) => ts13.visitNode(node, visitNode, ts13.isTypeNode);
|
|
2031
2090
|
};
|
|
2032
|
-
return
|
|
2091
|
+
return ts13.transform(type, [typeReferenceTransformer]).transformed[0];
|
|
2033
2092
|
}
|
|
2034
2093
|
emitTypeReference(type) {
|
|
2035
2094
|
const translatedType = this.translator(type);
|
|
@@ -2038,27 +2097,27 @@ var TypeEmitter = class {
|
|
|
2038
2097
|
}
|
|
2039
2098
|
let typeArguments = void 0;
|
|
2040
2099
|
if (type.typeArguments !== void 0) {
|
|
2041
|
-
typeArguments =
|
|
2100
|
+
typeArguments = ts13.factory.createNodeArray(type.typeArguments.map((typeArg) => this.emitType(typeArg)));
|
|
2042
2101
|
}
|
|
2043
|
-
return
|
|
2102
|
+
return ts13.factory.updateTypeReferenceNode(type, translatedType.typeName, typeArguments);
|
|
2044
2103
|
}
|
|
2045
2104
|
};
|
|
2046
2105
|
|
|
2047
|
-
// bazel-out/
|
|
2106
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
|
|
2048
2107
|
import * as o2 from "@angular/compiler";
|
|
2049
|
-
import
|
|
2108
|
+
import ts15 from "typescript";
|
|
2050
2109
|
|
|
2051
|
-
// bazel-out/
|
|
2052
|
-
import
|
|
2110
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/ts_util.mjs
|
|
2111
|
+
import ts14 from "typescript";
|
|
2053
2112
|
function tsNumericExpression(value) {
|
|
2054
2113
|
if (value < 0) {
|
|
2055
|
-
const operand =
|
|
2056
|
-
return
|
|
2114
|
+
const operand = ts14.factory.createNumericLiteral(Math.abs(value));
|
|
2115
|
+
return ts14.factory.createPrefixUnaryExpression(ts14.SyntaxKind.MinusToken, operand);
|
|
2057
2116
|
}
|
|
2058
|
-
return
|
|
2117
|
+
return ts14.factory.createNumericLiteral(value);
|
|
2059
2118
|
}
|
|
2060
2119
|
|
|
2061
|
-
// bazel-out/
|
|
2120
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
|
|
2062
2121
|
function translateType(type, contextFile, reflector, refEmitter, imports) {
|
|
2063
2122
|
return type.visitType(new TypeTranslatorVisitor(imports, contextFile, reflector, refEmitter), new Context(false));
|
|
2064
2123
|
}
|
|
@@ -2072,16 +2131,16 @@ var TypeTranslatorVisitor = class {
|
|
|
2072
2131
|
visitBuiltinType(type, context) {
|
|
2073
2132
|
switch (type.name) {
|
|
2074
2133
|
case o2.BuiltinTypeName.Bool:
|
|
2075
|
-
return
|
|
2134
|
+
return ts15.factory.createKeywordTypeNode(ts15.SyntaxKind.BooleanKeyword);
|
|
2076
2135
|
case o2.BuiltinTypeName.Dynamic:
|
|
2077
|
-
return
|
|
2136
|
+
return ts15.factory.createKeywordTypeNode(ts15.SyntaxKind.AnyKeyword);
|
|
2078
2137
|
case o2.BuiltinTypeName.Int:
|
|
2079
2138
|
case o2.BuiltinTypeName.Number:
|
|
2080
|
-
return
|
|
2139
|
+
return ts15.factory.createKeywordTypeNode(ts15.SyntaxKind.NumberKeyword);
|
|
2081
2140
|
case o2.BuiltinTypeName.String:
|
|
2082
|
-
return
|
|
2141
|
+
return ts15.factory.createKeywordTypeNode(ts15.SyntaxKind.StringKeyword);
|
|
2083
2142
|
case o2.BuiltinTypeName.None:
|
|
2084
|
-
return
|
|
2143
|
+
return ts15.factory.createKeywordTypeNode(ts15.SyntaxKind.NeverKeyword);
|
|
2085
2144
|
default:
|
|
2086
2145
|
throw new Error(`Unsupported builtin type: ${o2.BuiltinTypeName[type.name]}`);
|
|
2087
2146
|
}
|
|
@@ -2091,26 +2150,26 @@ var TypeTranslatorVisitor = class {
|
|
|
2091
2150
|
if (type.typeParams === null) {
|
|
2092
2151
|
return typeNode;
|
|
2093
2152
|
}
|
|
2094
|
-
if (!
|
|
2153
|
+
if (!ts15.isTypeReferenceNode(typeNode)) {
|
|
2095
2154
|
throw new Error("An ExpressionType with type arguments must translate into a TypeReferenceNode");
|
|
2096
2155
|
} else if (typeNode.typeArguments !== void 0) {
|
|
2097
2156
|
throw new Error(`An ExpressionType with type arguments cannot have multiple levels of type arguments`);
|
|
2098
2157
|
}
|
|
2099
2158
|
const typeArgs = type.typeParams.map((param) => this.translateType(param, context));
|
|
2100
|
-
return
|
|
2159
|
+
return ts15.factory.createTypeReferenceNode(typeNode.typeName, typeArgs);
|
|
2101
2160
|
}
|
|
2102
2161
|
visitArrayType(type, context) {
|
|
2103
|
-
return
|
|
2162
|
+
return ts15.factory.createArrayTypeNode(this.translateType(type.of, context));
|
|
2104
2163
|
}
|
|
2105
2164
|
visitMapType(type, context) {
|
|
2106
|
-
const parameter =
|
|
2107
|
-
const typeArgs = type.valueType !== null ? this.translateType(type.valueType, context) :
|
|
2108
|
-
const indexSignature =
|
|
2109
|
-
return
|
|
2165
|
+
const parameter = ts15.factory.createParameterDeclaration(void 0, void 0, "key", void 0, ts15.factory.createKeywordTypeNode(ts15.SyntaxKind.StringKeyword));
|
|
2166
|
+
const typeArgs = type.valueType !== null ? this.translateType(type.valueType, context) : ts15.factory.createKeywordTypeNode(ts15.SyntaxKind.UnknownKeyword);
|
|
2167
|
+
const indexSignature = ts15.factory.createIndexSignature(void 0, [parameter], typeArgs);
|
|
2168
|
+
return ts15.factory.createTypeLiteralNode([indexSignature]);
|
|
2110
2169
|
}
|
|
2111
2170
|
visitTransplantedType(ast, context) {
|
|
2112
2171
|
const node = ast.type instanceof Reference ? ast.type.node : ast.type;
|
|
2113
|
-
if (!
|
|
2172
|
+
if (!ts15.isTypeNode(node)) {
|
|
2114
2173
|
throw new Error(`A TransplantedType must wrap a TypeNode`);
|
|
2115
2174
|
}
|
|
2116
2175
|
const viaModule = ast.type instanceof Reference ? ast.type.bestGuessOwningModule : null;
|
|
@@ -2121,7 +2180,7 @@ var TypeTranslatorVisitor = class {
|
|
|
2121
2180
|
if (ast.name === null) {
|
|
2122
2181
|
throw new Error(`ReadVarExpr with no variable name in type`);
|
|
2123
2182
|
}
|
|
2124
|
-
return
|
|
2183
|
+
return ts15.factory.createTypeQueryNode(ts15.factory.createIdentifier(ast.name));
|
|
2125
2184
|
}
|
|
2126
2185
|
visitWriteVarExpr(expr, context) {
|
|
2127
2186
|
throw new Error("Method not implemented.");
|
|
@@ -2143,15 +2202,15 @@ var TypeTranslatorVisitor = class {
|
|
|
2143
2202
|
}
|
|
2144
2203
|
visitLiteralExpr(ast, context) {
|
|
2145
2204
|
if (ast.value === null) {
|
|
2146
|
-
return
|
|
2205
|
+
return ts15.factory.createLiteralTypeNode(ts15.factory.createNull());
|
|
2147
2206
|
} else if (ast.value === void 0) {
|
|
2148
|
-
return
|
|
2207
|
+
return ts15.factory.createKeywordTypeNode(ts15.SyntaxKind.UndefinedKeyword);
|
|
2149
2208
|
} else if (typeof ast.value === "boolean") {
|
|
2150
|
-
return
|
|
2209
|
+
return ts15.factory.createLiteralTypeNode(ast.value ? ts15.factory.createTrue() : ts15.factory.createFalse());
|
|
2151
2210
|
} else if (typeof ast.value === "number") {
|
|
2152
|
-
return
|
|
2211
|
+
return ts15.factory.createLiteralTypeNode(tsNumericExpression(ast.value));
|
|
2153
2212
|
} else {
|
|
2154
|
-
return
|
|
2213
|
+
return ts15.factory.createLiteralTypeNode(ts15.factory.createStringLiteral(ast.value));
|
|
2155
2214
|
}
|
|
2156
2215
|
}
|
|
2157
2216
|
visitLocalizedString(ast, context) {
|
|
@@ -2162,10 +2221,10 @@ var TypeTranslatorVisitor = class {
|
|
|
2162
2221
|
throw new Error(`Import unknown module or symbol`);
|
|
2163
2222
|
}
|
|
2164
2223
|
const { moduleImport, symbol } = this.imports.generateNamedImport(ast.value.moduleName, ast.value.name);
|
|
2165
|
-
const symbolIdentifier =
|
|
2166
|
-
const typeName = moduleImport ?
|
|
2224
|
+
const symbolIdentifier = ts15.factory.createIdentifier(symbol);
|
|
2225
|
+
const typeName = moduleImport ? ts15.factory.createQualifiedName(moduleImport, symbolIdentifier) : symbolIdentifier;
|
|
2167
2226
|
const typeArguments = ast.typeParams !== null ? ast.typeParams.map((type) => this.translateType(type, context)) : void 0;
|
|
2168
|
-
return
|
|
2227
|
+
return ts15.factory.createTypeReferenceNode(typeName, typeArguments);
|
|
2169
2228
|
}
|
|
2170
2229
|
visitConditionalExpr(ast, context) {
|
|
2171
2230
|
throw new Error("Method not implemented.");
|
|
@@ -2196,60 +2255,60 @@ var TypeTranslatorVisitor = class {
|
|
|
2196
2255
|
}
|
|
2197
2256
|
visitLiteralArrayExpr(ast, context) {
|
|
2198
2257
|
const values = ast.entries.map((expr) => this.translateExpression(expr, context));
|
|
2199
|
-
return
|
|
2258
|
+
return ts15.factory.createTupleTypeNode(values);
|
|
2200
2259
|
}
|
|
2201
2260
|
visitLiteralMapExpr(ast, context) {
|
|
2202
2261
|
const entries = ast.entries.map((entry) => {
|
|
2203
2262
|
const { key, quoted } = entry;
|
|
2204
2263
|
const type = this.translateExpression(entry.value, context);
|
|
2205
|
-
return
|
|
2264
|
+
return ts15.factory.createPropertySignature(
|
|
2206
2265
|
void 0,
|
|
2207
|
-
quoted ?
|
|
2266
|
+
quoted ? ts15.factory.createStringLiteral(key) : key,
|
|
2208
2267
|
void 0,
|
|
2209
2268
|
type
|
|
2210
2269
|
);
|
|
2211
2270
|
});
|
|
2212
|
-
return
|
|
2271
|
+
return ts15.factory.createTypeLiteralNode(entries);
|
|
2213
2272
|
}
|
|
2214
2273
|
visitCommaExpr(ast, context) {
|
|
2215
2274
|
throw new Error("Method not implemented.");
|
|
2216
2275
|
}
|
|
2217
2276
|
visitWrappedNodeExpr(ast, context) {
|
|
2218
2277
|
const node = ast.node;
|
|
2219
|
-
if (
|
|
2220
|
-
return
|
|
2221
|
-
} else if (
|
|
2278
|
+
if (ts15.isEntityName(node)) {
|
|
2279
|
+
return ts15.factory.createTypeReferenceNode(node, void 0);
|
|
2280
|
+
} else if (ts15.isTypeNode(node)) {
|
|
2222
2281
|
return node;
|
|
2223
|
-
} else if (
|
|
2224
|
-
return
|
|
2282
|
+
} else if (ts15.isLiteralExpression(node)) {
|
|
2283
|
+
return ts15.factory.createLiteralTypeNode(node);
|
|
2225
2284
|
} else {
|
|
2226
|
-
throw new Error(`Unsupported WrappedNodeExpr in TypeTranslatorVisitor: ${
|
|
2285
|
+
throw new Error(`Unsupported WrappedNodeExpr in TypeTranslatorVisitor: ${ts15.SyntaxKind[node.kind]}`);
|
|
2227
2286
|
}
|
|
2228
2287
|
}
|
|
2229
2288
|
visitTypeofExpr(ast, context) {
|
|
2230
2289
|
const typeNode = this.translateExpression(ast.expr, context);
|
|
2231
|
-
if (!
|
|
2290
|
+
if (!ts15.isTypeReferenceNode(typeNode)) {
|
|
2232
2291
|
throw new Error(`The target of a typeof expression must be a type reference, but it was
|
|
2233
|
-
${
|
|
2292
|
+
${ts15.SyntaxKind[typeNode.kind]}`);
|
|
2234
2293
|
}
|
|
2235
|
-
return
|
|
2294
|
+
return ts15.factory.createTypeQueryNode(typeNode.typeName);
|
|
2236
2295
|
}
|
|
2237
2296
|
translateType(type, context) {
|
|
2238
2297
|
const typeNode = type.visitType(this, context);
|
|
2239
|
-
if (!
|
|
2240
|
-
throw new Error(`A Type must translate to a TypeNode, but was ${
|
|
2298
|
+
if (!ts15.isTypeNode(typeNode)) {
|
|
2299
|
+
throw new Error(`A Type must translate to a TypeNode, but was ${ts15.SyntaxKind[typeNode.kind]}`);
|
|
2241
2300
|
}
|
|
2242
2301
|
return typeNode;
|
|
2243
2302
|
}
|
|
2244
2303
|
translateExpression(expr, context) {
|
|
2245
2304
|
const typeNode = expr.visitExpression(this, context);
|
|
2246
|
-
if (!
|
|
2247
|
-
throw new Error(`An Expression must translate to a TypeNode, but was ${
|
|
2305
|
+
if (!ts15.isTypeNode(typeNode)) {
|
|
2306
|
+
throw new Error(`An Expression must translate to a TypeNode, but was ${ts15.SyntaxKind[typeNode.kind]}`);
|
|
2248
2307
|
}
|
|
2249
2308
|
return typeNode;
|
|
2250
2309
|
}
|
|
2251
2310
|
translateTypeReference(type, context, viaModule) {
|
|
2252
|
-
const target =
|
|
2311
|
+
const target = ts15.isIdentifier(type.typeName) ? type.typeName : type.typeName.right;
|
|
2253
2312
|
const declaration = this.reflector.getDeclarationOfIdentifier(target);
|
|
2254
2313
|
if (declaration === null) {
|
|
2255
2314
|
throw new Error(`Unable to statically determine the declaration file of type node ${target.text}`);
|
|
@@ -2265,79 +2324,79 @@ var TypeTranslatorVisitor = class {
|
|
|
2265
2324
|
const emittedType = this.refEmitter.emit(reference, this.contextFile, ImportFlags.NoAliasing | ImportFlags.AllowTypeImports | ImportFlags.AllowAmbientReferences);
|
|
2266
2325
|
assertSuccessfulReferenceEmit(emittedType, target, "type");
|
|
2267
2326
|
const typeNode = this.translateExpression(emittedType.expression, context);
|
|
2268
|
-
if (!
|
|
2269
|
-
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${
|
|
2327
|
+
if (!ts15.isTypeReferenceNode(typeNode)) {
|
|
2328
|
+
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts15.SyntaxKind[typeNode.kind]}.`);
|
|
2270
2329
|
}
|
|
2271
2330
|
return typeNode;
|
|
2272
2331
|
}
|
|
2273
2332
|
};
|
|
2274
2333
|
|
|
2275
|
-
// bazel-out/
|
|
2276
|
-
import
|
|
2334
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.mjs
|
|
2335
|
+
import ts16 from "typescript";
|
|
2277
2336
|
var PureAnnotation;
|
|
2278
2337
|
(function(PureAnnotation2) {
|
|
2279
2338
|
PureAnnotation2["CLOSURE"] = "* @pureOrBreakMyCode ";
|
|
2280
2339
|
PureAnnotation2["TERSER"] = "@__PURE__";
|
|
2281
2340
|
})(PureAnnotation || (PureAnnotation = {}));
|
|
2282
2341
|
var UNARY_OPERATORS2 = {
|
|
2283
|
-
"+":
|
|
2284
|
-
"-":
|
|
2285
|
-
"!":
|
|
2342
|
+
"+": ts16.SyntaxKind.PlusToken,
|
|
2343
|
+
"-": ts16.SyntaxKind.MinusToken,
|
|
2344
|
+
"!": ts16.SyntaxKind.ExclamationToken
|
|
2286
2345
|
};
|
|
2287
2346
|
var BINARY_OPERATORS2 = {
|
|
2288
|
-
"&&":
|
|
2289
|
-
">":
|
|
2290
|
-
">=":
|
|
2291
|
-
"&":
|
|
2292
|
-
"|":
|
|
2293
|
-
"/":
|
|
2294
|
-
"==":
|
|
2295
|
-
"===":
|
|
2296
|
-
"<":
|
|
2297
|
-
"<=":
|
|
2298
|
-
"-":
|
|
2299
|
-
"%":
|
|
2300
|
-
"*":
|
|
2301
|
-
"!=":
|
|
2302
|
-
"!==":
|
|
2303
|
-
"||":
|
|
2304
|
-
"+":
|
|
2305
|
-
"??":
|
|
2347
|
+
"&&": ts16.SyntaxKind.AmpersandAmpersandToken,
|
|
2348
|
+
">": ts16.SyntaxKind.GreaterThanToken,
|
|
2349
|
+
">=": ts16.SyntaxKind.GreaterThanEqualsToken,
|
|
2350
|
+
"&": ts16.SyntaxKind.AmpersandToken,
|
|
2351
|
+
"|": ts16.SyntaxKind.BarToken,
|
|
2352
|
+
"/": ts16.SyntaxKind.SlashToken,
|
|
2353
|
+
"==": ts16.SyntaxKind.EqualsEqualsToken,
|
|
2354
|
+
"===": ts16.SyntaxKind.EqualsEqualsEqualsToken,
|
|
2355
|
+
"<": ts16.SyntaxKind.LessThanToken,
|
|
2356
|
+
"<=": ts16.SyntaxKind.LessThanEqualsToken,
|
|
2357
|
+
"-": ts16.SyntaxKind.MinusToken,
|
|
2358
|
+
"%": ts16.SyntaxKind.PercentToken,
|
|
2359
|
+
"*": ts16.SyntaxKind.AsteriskToken,
|
|
2360
|
+
"!=": ts16.SyntaxKind.ExclamationEqualsToken,
|
|
2361
|
+
"!==": ts16.SyntaxKind.ExclamationEqualsEqualsToken,
|
|
2362
|
+
"||": ts16.SyntaxKind.BarBarToken,
|
|
2363
|
+
"+": ts16.SyntaxKind.PlusToken,
|
|
2364
|
+
"??": ts16.SyntaxKind.QuestionQuestionToken
|
|
2306
2365
|
};
|
|
2307
2366
|
var VAR_TYPES = {
|
|
2308
|
-
"const":
|
|
2309
|
-
"let":
|
|
2310
|
-
"var":
|
|
2367
|
+
"const": ts16.NodeFlags.Const,
|
|
2368
|
+
"let": ts16.NodeFlags.Let,
|
|
2369
|
+
"var": ts16.NodeFlags.None
|
|
2311
2370
|
};
|
|
2312
2371
|
var TypeScriptAstFactory = class {
|
|
2313
2372
|
constructor(annotateForClosureCompiler) {
|
|
2314
2373
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
2315
2374
|
this.externalSourceFiles = /* @__PURE__ */ new Map();
|
|
2316
2375
|
this.attachComments = attachComments;
|
|
2317
|
-
this.createArrayLiteral =
|
|
2318
|
-
this.createElementAccess =
|
|
2319
|
-
this.createExpressionStatement =
|
|
2320
|
-
this.createIdentifier =
|
|
2321
|
-
this.createParenthesizedExpression =
|
|
2322
|
-
this.createPropertyAccess =
|
|
2323
|
-
this.createThrowStatement =
|
|
2324
|
-
this.createTypeOfExpression =
|
|
2376
|
+
this.createArrayLiteral = ts16.factory.createArrayLiteralExpression;
|
|
2377
|
+
this.createElementAccess = ts16.factory.createElementAccessExpression;
|
|
2378
|
+
this.createExpressionStatement = ts16.factory.createExpressionStatement;
|
|
2379
|
+
this.createIdentifier = ts16.factory.createIdentifier;
|
|
2380
|
+
this.createParenthesizedExpression = ts16.factory.createParenthesizedExpression;
|
|
2381
|
+
this.createPropertyAccess = ts16.factory.createPropertyAccessExpression;
|
|
2382
|
+
this.createThrowStatement = ts16.factory.createThrowStatement;
|
|
2383
|
+
this.createTypeOfExpression = ts16.factory.createTypeOfExpression;
|
|
2325
2384
|
}
|
|
2326
2385
|
createAssignment(target, value) {
|
|
2327
|
-
return
|
|
2386
|
+
return ts16.factory.createBinaryExpression(target, ts16.SyntaxKind.EqualsToken, value);
|
|
2328
2387
|
}
|
|
2329
2388
|
createBinaryExpression(leftOperand, operator, rightOperand) {
|
|
2330
|
-
return
|
|
2389
|
+
return ts16.factory.createBinaryExpression(leftOperand, BINARY_OPERATORS2[operator], rightOperand);
|
|
2331
2390
|
}
|
|
2332
2391
|
createBlock(body) {
|
|
2333
|
-
return
|
|
2392
|
+
return ts16.factory.createBlock(body);
|
|
2334
2393
|
}
|
|
2335
2394
|
createCallExpression(callee, args, pure) {
|
|
2336
|
-
const call =
|
|
2395
|
+
const call = ts16.factory.createCallExpression(callee, void 0, args);
|
|
2337
2396
|
if (pure) {
|
|
2338
|
-
|
|
2397
|
+
ts16.addSyntheticLeadingComment(
|
|
2339
2398
|
call,
|
|
2340
|
-
|
|
2399
|
+
ts16.SyntaxKind.MultiLineCommentTrivia,
|
|
2341
2400
|
this.annotateForClosureCompiler ? PureAnnotation.CLOSURE : PureAnnotation.TERSER,
|
|
2342
2401
|
false
|
|
2343
2402
|
);
|
|
@@ -2345,64 +2404,64 @@ var TypeScriptAstFactory = class {
|
|
|
2345
2404
|
return call;
|
|
2346
2405
|
}
|
|
2347
2406
|
createConditional(condition, whenTrue, whenFalse) {
|
|
2348
|
-
return
|
|
2407
|
+
return ts16.factory.createConditionalExpression(condition, void 0, whenTrue, void 0, whenFalse);
|
|
2349
2408
|
}
|
|
2350
2409
|
createDynamicImport(url) {
|
|
2351
|
-
return
|
|
2352
|
-
|
|
2410
|
+
return ts16.factory.createCallExpression(
|
|
2411
|
+
ts16.factory.createToken(ts16.SyntaxKind.ImportKeyword),
|
|
2353
2412
|
void 0,
|
|
2354
|
-
[
|
|
2413
|
+
[ts16.factory.createStringLiteral(url)]
|
|
2355
2414
|
);
|
|
2356
2415
|
}
|
|
2357
2416
|
createFunctionDeclaration(functionName, parameters, body) {
|
|
2358
|
-
if (!
|
|
2359
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
2417
|
+
if (!ts16.isBlock(body)) {
|
|
2418
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts16.SyntaxKind[body.kind]}.`);
|
|
2360
2419
|
}
|
|
2361
|
-
return
|
|
2420
|
+
return ts16.factory.createFunctionDeclaration(void 0, void 0, functionName, void 0, parameters.map((param) => ts16.factory.createParameterDeclaration(void 0, void 0, param)), void 0, body);
|
|
2362
2421
|
}
|
|
2363
2422
|
createFunctionExpression(functionName, parameters, body) {
|
|
2364
|
-
if (!
|
|
2365
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
2423
|
+
if (!ts16.isBlock(body)) {
|
|
2424
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts16.SyntaxKind[body.kind]}.`);
|
|
2366
2425
|
}
|
|
2367
|
-
return
|
|
2426
|
+
return ts16.factory.createFunctionExpression(void 0, void 0, functionName != null ? functionName : void 0, void 0, parameters.map((param) => ts16.factory.createParameterDeclaration(void 0, void 0, param)), void 0, body);
|
|
2368
2427
|
}
|
|
2369
2428
|
createArrowFunctionExpression(parameters, body) {
|
|
2370
|
-
if (
|
|
2371
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
2429
|
+
if (ts16.isStatement(body) && !ts16.isBlock(body)) {
|
|
2430
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts16.SyntaxKind[body.kind]}.`);
|
|
2372
2431
|
}
|
|
2373
|
-
return
|
|
2432
|
+
return ts16.factory.createArrowFunction(void 0, void 0, parameters.map((param) => ts16.factory.createParameterDeclaration(void 0, void 0, param)), void 0, void 0, body);
|
|
2374
2433
|
}
|
|
2375
2434
|
createIfStatement(condition, thenStatement, elseStatement) {
|
|
2376
|
-
return
|
|
2435
|
+
return ts16.factory.createIfStatement(condition, thenStatement, elseStatement != null ? elseStatement : void 0);
|
|
2377
2436
|
}
|
|
2378
2437
|
createLiteral(value) {
|
|
2379
2438
|
if (value === void 0) {
|
|
2380
|
-
return
|
|
2439
|
+
return ts16.factory.createIdentifier("undefined");
|
|
2381
2440
|
} else if (value === null) {
|
|
2382
|
-
return
|
|
2441
|
+
return ts16.factory.createNull();
|
|
2383
2442
|
} else if (typeof value === "boolean") {
|
|
2384
|
-
return value ?
|
|
2443
|
+
return value ? ts16.factory.createTrue() : ts16.factory.createFalse();
|
|
2385
2444
|
} else if (typeof value === "number") {
|
|
2386
2445
|
return tsNumericExpression(value);
|
|
2387
2446
|
} else {
|
|
2388
|
-
return
|
|
2447
|
+
return ts16.factory.createStringLiteral(value);
|
|
2389
2448
|
}
|
|
2390
2449
|
}
|
|
2391
2450
|
createNewExpression(expression, args) {
|
|
2392
|
-
return
|
|
2451
|
+
return ts16.factory.createNewExpression(expression, void 0, args);
|
|
2393
2452
|
}
|
|
2394
2453
|
createObjectLiteral(properties) {
|
|
2395
|
-
return
|
|
2454
|
+
return ts16.factory.createObjectLiteralExpression(properties.map((prop) => ts16.factory.createPropertyAssignment(prop.quoted ? ts16.factory.createStringLiteral(prop.propertyName) : ts16.factory.createIdentifier(prop.propertyName), prop.value)));
|
|
2396
2455
|
}
|
|
2397
2456
|
createReturnStatement(expression) {
|
|
2398
|
-
return
|
|
2457
|
+
return ts16.factory.createReturnStatement(expression != null ? expression : void 0);
|
|
2399
2458
|
}
|
|
2400
2459
|
createTaggedTemplate(tag, template) {
|
|
2401
2460
|
let templateLiteral;
|
|
2402
2461
|
const length = template.elements.length;
|
|
2403
2462
|
const head = template.elements[0];
|
|
2404
2463
|
if (length === 1) {
|
|
2405
|
-
templateLiteral =
|
|
2464
|
+
templateLiteral = ts16.factory.createNoSubstitutionTemplateLiteral(head.cooked, head.raw);
|
|
2406
2465
|
} else {
|
|
2407
2466
|
const spans = [];
|
|
2408
2467
|
for (let i = 1; i < length - 1; i++) {
|
|
@@ -2411,7 +2470,7 @@ var TypeScriptAstFactory = class {
|
|
|
2411
2470
|
if (range !== null) {
|
|
2412
2471
|
this.setSourceMapRange(middle, range);
|
|
2413
2472
|
}
|
|
2414
|
-
spans.push(
|
|
2473
|
+
spans.push(ts16.factory.createTemplateSpan(template.expressions[i - 1], middle));
|
|
2415
2474
|
}
|
|
2416
2475
|
const resolvedExpression = template.expressions[length - 2];
|
|
2417
2476
|
const templatePart = template.elements[length - 1];
|
|
@@ -2419,19 +2478,19 @@ var TypeScriptAstFactory = class {
|
|
|
2419
2478
|
if (templatePart.range !== null) {
|
|
2420
2479
|
this.setSourceMapRange(templateTail, templatePart.range);
|
|
2421
2480
|
}
|
|
2422
|
-
spans.push(
|
|
2423
|
-
templateLiteral =
|
|
2481
|
+
spans.push(ts16.factory.createTemplateSpan(resolvedExpression, templateTail));
|
|
2482
|
+
templateLiteral = ts16.factory.createTemplateExpression(ts16.factory.createTemplateHead(head.cooked, head.raw), spans);
|
|
2424
2483
|
}
|
|
2425
2484
|
if (head.range !== null) {
|
|
2426
2485
|
this.setSourceMapRange(templateLiteral, head.range);
|
|
2427
2486
|
}
|
|
2428
|
-
return
|
|
2487
|
+
return ts16.factory.createTaggedTemplateExpression(tag, void 0, templateLiteral);
|
|
2429
2488
|
}
|
|
2430
2489
|
createUnaryExpression(operator, operand) {
|
|
2431
|
-
return
|
|
2490
|
+
return ts16.factory.createPrefixUnaryExpression(UNARY_OPERATORS2[operator], operand);
|
|
2432
2491
|
}
|
|
2433
2492
|
createVariableDeclaration(variableName, initializer, type) {
|
|
2434
|
-
return
|
|
2493
|
+
return ts16.factory.createVariableStatement(void 0, ts16.factory.createVariableDeclarationList([ts16.factory.createVariableDeclaration(variableName, void 0, void 0, initializer != null ? initializer : void 0)], VAR_TYPES[type]));
|
|
2435
2494
|
}
|
|
2436
2495
|
setSourceMapRange(node, sourceMapRange) {
|
|
2437
2496
|
if (sourceMapRange === null) {
|
|
@@ -2439,37 +2498,37 @@ var TypeScriptAstFactory = class {
|
|
|
2439
2498
|
}
|
|
2440
2499
|
const url = sourceMapRange.url;
|
|
2441
2500
|
if (!this.externalSourceFiles.has(url)) {
|
|
2442
|
-
this.externalSourceFiles.set(url,
|
|
2501
|
+
this.externalSourceFiles.set(url, ts16.createSourceMapSource(url, sourceMapRange.content, (pos) => pos));
|
|
2443
2502
|
}
|
|
2444
2503
|
const source = this.externalSourceFiles.get(url);
|
|
2445
|
-
|
|
2504
|
+
ts16.setSourceMapRange(node, { pos: sourceMapRange.start.offset, end: sourceMapRange.end.offset, source });
|
|
2446
2505
|
return node;
|
|
2447
2506
|
}
|
|
2448
2507
|
};
|
|
2449
2508
|
function createTemplateMiddle(cooked, raw) {
|
|
2450
|
-
const node =
|
|
2451
|
-
node.kind =
|
|
2509
|
+
const node = ts16.factory.createTemplateHead(cooked, raw);
|
|
2510
|
+
node.kind = ts16.SyntaxKind.TemplateMiddle;
|
|
2452
2511
|
return node;
|
|
2453
2512
|
}
|
|
2454
2513
|
function createTemplateTail(cooked, raw) {
|
|
2455
|
-
const node =
|
|
2456
|
-
node.kind =
|
|
2514
|
+
const node = ts16.factory.createTemplateHead(cooked, raw);
|
|
2515
|
+
node.kind = ts16.SyntaxKind.TemplateTail;
|
|
2457
2516
|
return node;
|
|
2458
2517
|
}
|
|
2459
2518
|
function attachComments(statement, leadingComments) {
|
|
2460
2519
|
for (const comment of leadingComments) {
|
|
2461
|
-
const commentKind = comment.multiline ?
|
|
2520
|
+
const commentKind = comment.multiline ? ts16.SyntaxKind.MultiLineCommentTrivia : ts16.SyntaxKind.SingleLineCommentTrivia;
|
|
2462
2521
|
if (comment.multiline) {
|
|
2463
|
-
|
|
2522
|
+
ts16.addSyntheticLeadingComment(statement, commentKind, comment.toString(), comment.trailingNewline);
|
|
2464
2523
|
} else {
|
|
2465
2524
|
for (const line of comment.toString().split("\n")) {
|
|
2466
|
-
|
|
2525
|
+
ts16.addSyntheticLeadingComment(statement, commentKind, line, comment.trailingNewline);
|
|
2467
2526
|
}
|
|
2468
2527
|
}
|
|
2469
2528
|
}
|
|
2470
2529
|
}
|
|
2471
2530
|
|
|
2472
|
-
// bazel-out/
|
|
2531
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_translator.mjs
|
|
2473
2532
|
function translateExpression(expression, imports, options = {}) {
|
|
2474
2533
|
return expression.visitExpression(new ExpressionTranslatorVisitor(new TypeScriptAstFactory(options.annotateForClosureCompiler === true), imports, options), new Context(false));
|
|
2475
2534
|
}
|
|
@@ -2533,6 +2592,7 @@ export {
|
|
|
2533
2592
|
filterToMembersWithDecorator,
|
|
2534
2593
|
reflectObjectLiteral,
|
|
2535
2594
|
DeferredSymbolTracker,
|
|
2595
|
+
ImportedSymbolsTracker,
|
|
2536
2596
|
LocalCompilationExtraImportsTracker,
|
|
2537
2597
|
Reference,
|
|
2538
2598
|
ModuleResolver,
|
|
@@ -2559,4 +2619,4 @@ export {
|
|
|
2559
2619
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2560
2620
|
* found in the LICENSE file at https://angular.io/license
|
|
2561
2621
|
*/
|
|
2562
|
-
//# sourceMappingURL=chunk-
|
|
2622
|
+
//# sourceMappingURL=chunk-YBXVKJOM.js.map
|