@angular/compiler-cli 17.1.2 → 17.2.0-next.1
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-24NMPW5I.js → chunk-6TQPEEA2.js} +12 -7
- package/bundles/chunk-6TQPEEA2.js.map +6 -0
- package/bundles/{chunk-TFBB265K.js → chunk-7HZQIUTO.js} +208 -154
- package/bundles/chunk-7HZQIUTO.js.map +6 -0
- package/bundles/{chunk-TKJ4KX5N.js → chunk-D6QFM4YJ.js} +4 -4
- package/bundles/{chunk-TKJ4KX5N.js.map → chunk-D6QFM4YJ.js.map} +1 -1
- package/bundles/{chunk-5YHUYFQ5.js → chunk-GJ7EAXBI.js} +107 -30
- package/bundles/chunk-GJ7EAXBI.js.map +6 -0
- package/bundles/{chunk-GKQNBAG5.js → chunk-IWZ4MO7Q.js} +529 -250
- package/bundles/chunk-IWZ4MO7Q.js.map +6 -0
- package/bundles/{chunk-MIB7EGOT.js → chunk-J2NE3BNR.js} +2 -2
- package/bundles/index.js +5 -5
- package/bundles/linker/babel/index.js +2 -2
- package/bundles/linker/index.js +2 -2
- package/bundles/private/migrations.js +2 -2
- package/bundles/private/tooling.js +3 -3
- package/bundles/src/bin/ng_xi18n.js +4 -4
- package/bundles/src/bin/ngc.js +4 -4
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +2 -1
- package/package.json +3 -3
- package/src/bin/ng_xi18n.d.ts +0 -1
- package/src/bin/ngc.d.ts +0 -1
- package/src/ngtsc/annotations/common/src/util.d.ts +5 -2
- package/src/ngtsc/annotations/component/src/handler.d.ts +4 -2
- package/src/ngtsc/annotations/directive/src/handler.d.ts +3 -1
- package/src/ngtsc/annotations/directive/src/initializer_functions.d.ts +44 -0
- package/src/ngtsc/annotations/directive/src/input_function.d.ts +1 -1
- package/src/ngtsc/annotations/directive/src/query_functions.d.ts +26 -0
- package/src/ngtsc/annotations/directive/src/shared.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_code.d.ts +24 -7
- 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/index.d.ts +1 -1
- package/src/ngtsc/metadata/src/api.d.ts +23 -3
- package/src/ngtsc/metadata/src/util.d.ts +2 -1
- 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/ts_util.d.ts +2 -0
- package/bundles/chunk-24NMPW5I.js.map +0 -6
- package/bundles/chunk-5YHUYFQ5.js.map +0 -6
- package/bundles/chunk-GKQNBAG5.js.map +0 -6
- package/bundles/chunk-TFBB265K.js.map +0 -6
- /package/bundles/{chunk-MIB7EGOT.js.map → chunk-J2NE3BNR.js.map} +0 -0
|
@@ -841,9 +841,9 @@ var ErrorCode;
|
|
|
841
841
|
ErrorCode2[ErrorCode2["DECORATOR_COLLISION"] = 1006] = "DECORATOR_COLLISION";
|
|
842
842
|
ErrorCode2[ErrorCode2["VALUE_HAS_WRONG_TYPE"] = 1010] = "VALUE_HAS_WRONG_TYPE";
|
|
843
843
|
ErrorCode2[ErrorCode2["VALUE_NOT_LITERAL"] = 1011] = "VALUE_NOT_LITERAL";
|
|
844
|
-
ErrorCode2[ErrorCode2["
|
|
845
|
-
ErrorCode2[ErrorCode2["
|
|
846
|
-
ErrorCode2[ErrorCode2["
|
|
844
|
+
ErrorCode2[ErrorCode2["INITIALIZER_API_WITH_DISALLOWED_DECORATOR"] = 1050] = "INITIALIZER_API_WITH_DISALLOWED_DECORATOR";
|
|
845
|
+
ErrorCode2[ErrorCode2["INITIALIZER_API_DECORATOR_METADATA_COLLISION"] = 1051] = "INITIALIZER_API_DECORATOR_METADATA_COLLISION";
|
|
846
|
+
ErrorCode2[ErrorCode2["INCORRECTLY_DECLARED_ON_STATIC_MEMBER"] = 1100] = "INCORRECTLY_DECLARED_ON_STATIC_MEMBER";
|
|
847
847
|
ErrorCode2[ErrorCode2["COMPONENT_MISSING_TEMPLATE"] = 2001] = "COMPONENT_MISSING_TEMPLATE";
|
|
848
848
|
ErrorCode2[ErrorCode2["PIPE_MISSING_NAME"] = 2002] = "PIPE_MISSING_NAME";
|
|
849
849
|
ErrorCode2[ErrorCode2["PARAM_MISSING_TOKEN"] = 2003] = "PARAM_MISSING_TOKEN";
|
|
@@ -916,6 +916,7 @@ var ErrorCode;
|
|
|
916
916
|
ErrorCode2[ErrorCode2["SUGGEST_SUBOPTIMAL_TYPE_INFERENCE"] = 10002] = "SUGGEST_SUBOPTIMAL_TYPE_INFERENCE";
|
|
917
917
|
ErrorCode2[ErrorCode2["LOCAL_COMPILATION_IMPORTED_TEMPLATE_STRING"] = 11001] = "LOCAL_COMPILATION_IMPORTED_TEMPLATE_STRING";
|
|
918
918
|
ErrorCode2[ErrorCode2["LOCAL_COMPILATION_IMPORTED_STYLES_STRING"] = 11002] = "LOCAL_COMPILATION_IMPORTED_STYLES_STRING";
|
|
919
|
+
ErrorCode2[ErrorCode2["LOCAL_COMPILATION_HOST_DIRECTIVE_INVALID"] = 11003] = "LOCAL_COMPILATION_HOST_DIRECTIVE_INVALID";
|
|
919
920
|
})(ErrorCode || (ErrorCode = {}));
|
|
920
921
|
|
|
921
922
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/docs.mjs
|
|
@@ -1597,6 +1598,53 @@ var DeferredSymbolTracker = class {
|
|
|
1597
1598
|
}
|
|
1598
1599
|
};
|
|
1599
1600
|
|
|
1601
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/local_compilation_extra_imports_tracker.mjs
|
|
1602
|
+
import ts10 from "typescript";
|
|
1603
|
+
var LocalCompilationExtraImportsTracker = class {
|
|
1604
|
+
constructor(typeChecker) {
|
|
1605
|
+
this.typeChecker = typeChecker;
|
|
1606
|
+
this.localImportsMap = /* @__PURE__ */ new Map();
|
|
1607
|
+
this.globalImportsSet = /* @__PURE__ */ new Set();
|
|
1608
|
+
}
|
|
1609
|
+
addImportForFile(sf, moduleName) {
|
|
1610
|
+
if (!this.localImportsMap.has(sf.fileName)) {
|
|
1611
|
+
this.localImportsMap.set(sf.fileName, /* @__PURE__ */ new Set());
|
|
1612
|
+
}
|
|
1613
|
+
this.localImportsMap.get(sf.fileName).add(moduleName);
|
|
1614
|
+
}
|
|
1615
|
+
addGlobalImportFromIdentifier(node) {
|
|
1616
|
+
var _a;
|
|
1617
|
+
let identifier = null;
|
|
1618
|
+
if (ts10.isIdentifier(node)) {
|
|
1619
|
+
identifier = node;
|
|
1620
|
+
} else if (ts10.isPropertyAccessExpression(node) && ts10.isIdentifier(node.expression)) {
|
|
1621
|
+
identifier = node.expression;
|
|
1622
|
+
}
|
|
1623
|
+
if (identifier === null) {
|
|
1624
|
+
return;
|
|
1625
|
+
}
|
|
1626
|
+
const sym = this.typeChecker.getSymbolAtLocation(identifier);
|
|
1627
|
+
if (!((_a = sym == null ? void 0 : sym.declarations) == null ? void 0 : _a.length)) {
|
|
1628
|
+
return;
|
|
1629
|
+
}
|
|
1630
|
+
const importClause = sym.declarations[0];
|
|
1631
|
+
const decl = getContainingImportDeclaration(importClause);
|
|
1632
|
+
if (decl !== null) {
|
|
1633
|
+
this.globalImportsSet.add(removeQuotations(decl.moduleSpecifier.getText()));
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
getImportsForFile(sf) {
|
|
1637
|
+
var _a;
|
|
1638
|
+
return [
|
|
1639
|
+
...this.globalImportsSet,
|
|
1640
|
+
...(_a = this.localImportsMap.get(sf.fileName)) != null ? _a : []
|
|
1641
|
+
];
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1644
|
+
function removeQuotations(s) {
|
|
1645
|
+
return s.substring(1, s.length - 1).trim();
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1600
1648
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/resolver.mjs
|
|
1601
1649
|
var ModuleResolver = class {
|
|
1602
1650
|
constructor(program, compilerOptions, host, moduleResolutionCache) {
|
|
@@ -1615,9 +1663,9 @@ var ModuleResolver = class {
|
|
|
1615
1663
|
};
|
|
1616
1664
|
|
|
1617
1665
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager.mjs
|
|
1618
|
-
import
|
|
1666
|
+
import ts11 from "typescript";
|
|
1619
1667
|
var ImportManager = class {
|
|
1620
|
-
constructor(rewriter = new NoopImportRewriter(), prefix = "i", factory =
|
|
1668
|
+
constructor(rewriter = new NoopImportRewriter(), prefix = "i", factory = ts11.factory) {
|
|
1621
1669
|
this.rewriter = rewriter;
|
|
1622
1670
|
this.prefix = prefix;
|
|
1623
1671
|
this.factory = factory;
|
|
@@ -1625,7 +1673,7 @@ var ImportManager = class {
|
|
|
1625
1673
|
this.nextIndex = 0;
|
|
1626
1674
|
}
|
|
1627
1675
|
generateNamespaceImport(moduleName) {
|
|
1628
|
-
if (!this.specifierToIdentifier.has(moduleName)) {
|
|
1676
|
+
if (!this.specifierToIdentifier.has(moduleName) || this.specifierToIdentifier.get(moduleName) === null) {
|
|
1629
1677
|
this.specifierToIdentifier.set(moduleName, this.factory.createIdentifier(`${this.prefix}${this.nextIndex++}`));
|
|
1630
1678
|
}
|
|
1631
1679
|
return this.specifierToIdentifier.get(moduleName);
|
|
@@ -1638,6 +1686,11 @@ var ImportManager = class {
|
|
|
1638
1686
|
const moduleImport = this.generateNamespaceImport(moduleName);
|
|
1639
1687
|
return { moduleImport, symbol };
|
|
1640
1688
|
}
|
|
1689
|
+
generateSideEffectImport(moduleName) {
|
|
1690
|
+
if (!this.specifierToIdentifier.has(moduleName)) {
|
|
1691
|
+
this.specifierToIdentifier.set(moduleName, null);
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1641
1694
|
getAllImports(contextPath) {
|
|
1642
1695
|
const imports = [];
|
|
1643
1696
|
for (const [originalSpecifier, qualifier] of this.specifierToIdentifier) {
|
|
@@ -1904,7 +1957,7 @@ function createRange(span) {
|
|
|
1904
1957
|
}
|
|
1905
1958
|
|
|
1906
1959
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_emitter.mjs
|
|
1907
|
-
import
|
|
1960
|
+
import ts12 from "typescript";
|
|
1908
1961
|
var INELIGIBLE = {};
|
|
1909
1962
|
function canEmitType(type, canEmit) {
|
|
1910
1963
|
return canEmitTypeWorker(type);
|
|
@@ -1912,13 +1965,13 @@ function canEmitType(type, canEmit) {
|
|
|
1912
1965
|
return visitNode(type2) !== INELIGIBLE;
|
|
1913
1966
|
}
|
|
1914
1967
|
function visitNode(node) {
|
|
1915
|
-
if (
|
|
1968
|
+
if (ts12.isImportTypeNode(node)) {
|
|
1916
1969
|
return INELIGIBLE;
|
|
1917
1970
|
}
|
|
1918
|
-
if (
|
|
1971
|
+
if (ts12.isTypeReferenceNode(node) && !canEmitTypeReference(node)) {
|
|
1919
1972
|
return INELIGIBLE;
|
|
1920
1973
|
} else {
|
|
1921
|
-
return
|
|
1974
|
+
return ts12.forEachChild(node, visitNode);
|
|
1922
1975
|
}
|
|
1923
1976
|
}
|
|
1924
1977
|
function canEmitTypeReference(type2) {
|
|
@@ -1935,35 +1988,35 @@ var TypeEmitter = class {
|
|
|
1935
1988
|
emitType(type) {
|
|
1936
1989
|
const typeReferenceTransformer = (context) => {
|
|
1937
1990
|
const visitNode = (node) => {
|
|
1938
|
-
if (
|
|
1991
|
+
if (ts12.isImportTypeNode(node)) {
|
|
1939
1992
|
throw new Error("Unable to emit import type");
|
|
1940
1993
|
}
|
|
1941
|
-
if (
|
|
1994
|
+
if (ts12.isTypeReferenceNode(node)) {
|
|
1942
1995
|
return this.emitTypeReference(node);
|
|
1943
|
-
} else if (
|
|
1996
|
+
} else if (ts12.isLiteralExpression(node)) {
|
|
1944
1997
|
let clone;
|
|
1945
|
-
if (
|
|
1946
|
-
clone =
|
|
1947
|
-
} else if (
|
|
1948
|
-
clone =
|
|
1949
|
-
} else if (
|
|
1950
|
-
clone =
|
|
1951
|
-
} else if (
|
|
1952
|
-
clone =
|
|
1953
|
-
} else if (
|
|
1954
|
-
clone =
|
|
1998
|
+
if (ts12.isStringLiteral(node)) {
|
|
1999
|
+
clone = ts12.factory.createStringLiteral(node.text);
|
|
2000
|
+
} else if (ts12.isNumericLiteral(node)) {
|
|
2001
|
+
clone = ts12.factory.createNumericLiteral(node.text);
|
|
2002
|
+
} else if (ts12.isBigIntLiteral(node)) {
|
|
2003
|
+
clone = ts12.factory.createBigIntLiteral(node.text);
|
|
2004
|
+
} else if (ts12.isNoSubstitutionTemplateLiteral(node)) {
|
|
2005
|
+
clone = ts12.factory.createNoSubstitutionTemplateLiteral(node.text, node.rawText);
|
|
2006
|
+
} else if (ts12.isRegularExpressionLiteral(node)) {
|
|
2007
|
+
clone = ts12.factory.createRegularExpressionLiteral(node.text);
|
|
1955
2008
|
} else {
|
|
1956
|
-
throw new Error(`Unsupported literal kind ${
|
|
2009
|
+
throw new Error(`Unsupported literal kind ${ts12.SyntaxKind[node.kind]}`);
|
|
1957
2010
|
}
|
|
1958
|
-
|
|
2011
|
+
ts12.setTextRange(clone, { pos: -1, end: -1 });
|
|
1959
2012
|
return clone;
|
|
1960
2013
|
} else {
|
|
1961
|
-
return
|
|
2014
|
+
return ts12.visitEachChild(node, visitNode, context);
|
|
1962
2015
|
}
|
|
1963
2016
|
};
|
|
1964
|
-
return (node) =>
|
|
2017
|
+
return (node) => ts12.visitNode(node, visitNode, ts12.isTypeNode);
|
|
1965
2018
|
};
|
|
1966
|
-
return
|
|
2019
|
+
return ts12.transform(type, [typeReferenceTransformer]).transformed[0];
|
|
1967
2020
|
}
|
|
1968
2021
|
emitTypeReference(type) {
|
|
1969
2022
|
const translatedType = this.translator(type);
|
|
@@ -1972,24 +2025,24 @@ var TypeEmitter = class {
|
|
|
1972
2025
|
}
|
|
1973
2026
|
let typeArguments = void 0;
|
|
1974
2027
|
if (type.typeArguments !== void 0) {
|
|
1975
|
-
typeArguments =
|
|
2028
|
+
typeArguments = ts12.factory.createNodeArray(type.typeArguments.map((typeArg) => this.emitType(typeArg)));
|
|
1976
2029
|
}
|
|
1977
|
-
return
|
|
2030
|
+
return ts12.factory.updateTypeReferenceNode(type, translatedType.typeName, typeArguments);
|
|
1978
2031
|
}
|
|
1979
2032
|
};
|
|
1980
2033
|
|
|
1981
2034
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
|
|
1982
2035
|
import * as o2 from "@angular/compiler";
|
|
1983
|
-
import
|
|
2036
|
+
import ts14 from "typescript";
|
|
1984
2037
|
|
|
1985
2038
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/ts_util.mjs
|
|
1986
|
-
import
|
|
2039
|
+
import ts13 from "typescript";
|
|
1987
2040
|
function tsNumericExpression(value) {
|
|
1988
2041
|
if (value < 0) {
|
|
1989
|
-
const operand =
|
|
1990
|
-
return
|
|
2042
|
+
const operand = ts13.factory.createNumericLiteral(Math.abs(value));
|
|
2043
|
+
return ts13.factory.createPrefixUnaryExpression(ts13.SyntaxKind.MinusToken, operand);
|
|
1991
2044
|
}
|
|
1992
|
-
return
|
|
2045
|
+
return ts13.factory.createNumericLiteral(value);
|
|
1993
2046
|
}
|
|
1994
2047
|
|
|
1995
2048
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
|
|
@@ -2006,16 +2059,16 @@ var TypeTranslatorVisitor = class {
|
|
|
2006
2059
|
visitBuiltinType(type, context) {
|
|
2007
2060
|
switch (type.name) {
|
|
2008
2061
|
case o2.BuiltinTypeName.Bool:
|
|
2009
|
-
return
|
|
2062
|
+
return ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.BooleanKeyword);
|
|
2010
2063
|
case o2.BuiltinTypeName.Dynamic:
|
|
2011
|
-
return
|
|
2064
|
+
return ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.AnyKeyword);
|
|
2012
2065
|
case o2.BuiltinTypeName.Int:
|
|
2013
2066
|
case o2.BuiltinTypeName.Number:
|
|
2014
|
-
return
|
|
2067
|
+
return ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.NumberKeyword);
|
|
2015
2068
|
case o2.BuiltinTypeName.String:
|
|
2016
|
-
return
|
|
2069
|
+
return ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.StringKeyword);
|
|
2017
2070
|
case o2.BuiltinTypeName.None:
|
|
2018
|
-
return
|
|
2071
|
+
return ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.NeverKeyword);
|
|
2019
2072
|
default:
|
|
2020
2073
|
throw new Error(`Unsupported builtin type: ${o2.BuiltinTypeName[type.name]}`);
|
|
2021
2074
|
}
|
|
@@ -2025,26 +2078,26 @@ var TypeTranslatorVisitor = class {
|
|
|
2025
2078
|
if (type.typeParams === null) {
|
|
2026
2079
|
return typeNode;
|
|
2027
2080
|
}
|
|
2028
|
-
if (!
|
|
2081
|
+
if (!ts14.isTypeReferenceNode(typeNode)) {
|
|
2029
2082
|
throw new Error("An ExpressionType with type arguments must translate into a TypeReferenceNode");
|
|
2030
2083
|
} else if (typeNode.typeArguments !== void 0) {
|
|
2031
2084
|
throw new Error(`An ExpressionType with type arguments cannot have multiple levels of type arguments`);
|
|
2032
2085
|
}
|
|
2033
2086
|
const typeArgs = type.typeParams.map((param) => this.translateType(param, context));
|
|
2034
|
-
return
|
|
2087
|
+
return ts14.factory.createTypeReferenceNode(typeNode.typeName, typeArgs);
|
|
2035
2088
|
}
|
|
2036
2089
|
visitArrayType(type, context) {
|
|
2037
|
-
return
|
|
2090
|
+
return ts14.factory.createArrayTypeNode(this.translateType(type.of, context));
|
|
2038
2091
|
}
|
|
2039
2092
|
visitMapType(type, context) {
|
|
2040
|
-
const parameter =
|
|
2041
|
-
const typeArgs = type.valueType !== null ? this.translateType(type.valueType, context) :
|
|
2042
|
-
const indexSignature =
|
|
2043
|
-
return
|
|
2093
|
+
const parameter = ts14.factory.createParameterDeclaration(void 0, void 0, "key", void 0, ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.StringKeyword));
|
|
2094
|
+
const typeArgs = type.valueType !== null ? this.translateType(type.valueType, context) : ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.UnknownKeyword);
|
|
2095
|
+
const indexSignature = ts14.factory.createIndexSignature(void 0, [parameter], typeArgs);
|
|
2096
|
+
return ts14.factory.createTypeLiteralNode([indexSignature]);
|
|
2044
2097
|
}
|
|
2045
2098
|
visitTransplantedType(ast, context) {
|
|
2046
2099
|
const node = ast.type instanceof Reference ? ast.type.node : ast.type;
|
|
2047
|
-
if (!
|
|
2100
|
+
if (!ts14.isTypeNode(node)) {
|
|
2048
2101
|
throw new Error(`A TransplantedType must wrap a TypeNode`);
|
|
2049
2102
|
}
|
|
2050
2103
|
const viaModule = ast.type instanceof Reference ? ast.type.bestGuessOwningModule : null;
|
|
@@ -2055,7 +2108,7 @@ var TypeTranslatorVisitor = class {
|
|
|
2055
2108
|
if (ast.name === null) {
|
|
2056
2109
|
throw new Error(`ReadVarExpr with no variable name in type`);
|
|
2057
2110
|
}
|
|
2058
|
-
return
|
|
2111
|
+
return ts14.factory.createTypeQueryNode(ts14.factory.createIdentifier(ast.name));
|
|
2059
2112
|
}
|
|
2060
2113
|
visitWriteVarExpr(expr, context) {
|
|
2061
2114
|
throw new Error("Method not implemented.");
|
|
@@ -2077,15 +2130,15 @@ var TypeTranslatorVisitor = class {
|
|
|
2077
2130
|
}
|
|
2078
2131
|
visitLiteralExpr(ast, context) {
|
|
2079
2132
|
if (ast.value === null) {
|
|
2080
|
-
return
|
|
2133
|
+
return ts14.factory.createLiteralTypeNode(ts14.factory.createNull());
|
|
2081
2134
|
} else if (ast.value === void 0) {
|
|
2082
|
-
return
|
|
2135
|
+
return ts14.factory.createKeywordTypeNode(ts14.SyntaxKind.UndefinedKeyword);
|
|
2083
2136
|
} else if (typeof ast.value === "boolean") {
|
|
2084
|
-
return
|
|
2137
|
+
return ts14.factory.createLiteralTypeNode(ast.value ? ts14.factory.createTrue() : ts14.factory.createFalse());
|
|
2085
2138
|
} else if (typeof ast.value === "number") {
|
|
2086
|
-
return
|
|
2139
|
+
return ts14.factory.createLiteralTypeNode(tsNumericExpression(ast.value));
|
|
2087
2140
|
} else {
|
|
2088
|
-
return
|
|
2141
|
+
return ts14.factory.createLiteralTypeNode(ts14.factory.createStringLiteral(ast.value));
|
|
2089
2142
|
}
|
|
2090
2143
|
}
|
|
2091
2144
|
visitLocalizedString(ast, context) {
|
|
@@ -2096,10 +2149,10 @@ var TypeTranslatorVisitor = class {
|
|
|
2096
2149
|
throw new Error(`Import unknown module or symbol`);
|
|
2097
2150
|
}
|
|
2098
2151
|
const { moduleImport, symbol } = this.imports.generateNamedImport(ast.value.moduleName, ast.value.name);
|
|
2099
|
-
const symbolIdentifier =
|
|
2100
|
-
const typeName = moduleImport ?
|
|
2152
|
+
const symbolIdentifier = ts14.factory.createIdentifier(symbol);
|
|
2153
|
+
const typeName = moduleImport ? ts14.factory.createQualifiedName(moduleImport, symbolIdentifier) : symbolIdentifier;
|
|
2101
2154
|
const typeArguments = ast.typeParams !== null ? ast.typeParams.map((type) => this.translateType(type, context)) : void 0;
|
|
2102
|
-
return
|
|
2155
|
+
return ts14.factory.createTypeReferenceNode(typeName, typeArguments);
|
|
2103
2156
|
}
|
|
2104
2157
|
visitConditionalExpr(ast, context) {
|
|
2105
2158
|
throw new Error("Method not implemented.");
|
|
@@ -2130,60 +2183,60 @@ var TypeTranslatorVisitor = class {
|
|
|
2130
2183
|
}
|
|
2131
2184
|
visitLiteralArrayExpr(ast, context) {
|
|
2132
2185
|
const values = ast.entries.map((expr) => this.translateExpression(expr, context));
|
|
2133
|
-
return
|
|
2186
|
+
return ts14.factory.createTupleTypeNode(values);
|
|
2134
2187
|
}
|
|
2135
2188
|
visitLiteralMapExpr(ast, context) {
|
|
2136
2189
|
const entries = ast.entries.map((entry) => {
|
|
2137
2190
|
const { key, quoted } = entry;
|
|
2138
2191
|
const type = this.translateExpression(entry.value, context);
|
|
2139
|
-
return
|
|
2192
|
+
return ts14.factory.createPropertySignature(
|
|
2140
2193
|
void 0,
|
|
2141
|
-
quoted ?
|
|
2194
|
+
quoted ? ts14.factory.createStringLiteral(key) : key,
|
|
2142
2195
|
void 0,
|
|
2143
2196
|
type
|
|
2144
2197
|
);
|
|
2145
2198
|
});
|
|
2146
|
-
return
|
|
2199
|
+
return ts14.factory.createTypeLiteralNode(entries);
|
|
2147
2200
|
}
|
|
2148
2201
|
visitCommaExpr(ast, context) {
|
|
2149
2202
|
throw new Error("Method not implemented.");
|
|
2150
2203
|
}
|
|
2151
2204
|
visitWrappedNodeExpr(ast, context) {
|
|
2152
2205
|
const node = ast.node;
|
|
2153
|
-
if (
|
|
2154
|
-
return
|
|
2155
|
-
} else if (
|
|
2206
|
+
if (ts14.isEntityName(node)) {
|
|
2207
|
+
return ts14.factory.createTypeReferenceNode(node, void 0);
|
|
2208
|
+
} else if (ts14.isTypeNode(node)) {
|
|
2156
2209
|
return node;
|
|
2157
|
-
} else if (
|
|
2158
|
-
return
|
|
2210
|
+
} else if (ts14.isLiteralExpression(node)) {
|
|
2211
|
+
return ts14.factory.createLiteralTypeNode(node);
|
|
2159
2212
|
} else {
|
|
2160
|
-
throw new Error(`Unsupported WrappedNodeExpr in TypeTranslatorVisitor: ${
|
|
2213
|
+
throw new Error(`Unsupported WrappedNodeExpr in TypeTranslatorVisitor: ${ts14.SyntaxKind[node.kind]}`);
|
|
2161
2214
|
}
|
|
2162
2215
|
}
|
|
2163
2216
|
visitTypeofExpr(ast, context) {
|
|
2164
2217
|
const typeNode = this.translateExpression(ast.expr, context);
|
|
2165
|
-
if (!
|
|
2218
|
+
if (!ts14.isTypeReferenceNode(typeNode)) {
|
|
2166
2219
|
throw new Error(`The target of a typeof expression must be a type reference, but it was
|
|
2167
|
-
${
|
|
2220
|
+
${ts14.SyntaxKind[typeNode.kind]}`);
|
|
2168
2221
|
}
|
|
2169
|
-
return
|
|
2222
|
+
return ts14.factory.createTypeQueryNode(typeNode.typeName);
|
|
2170
2223
|
}
|
|
2171
2224
|
translateType(type, context) {
|
|
2172
2225
|
const typeNode = type.visitType(this, context);
|
|
2173
|
-
if (!
|
|
2174
|
-
throw new Error(`A Type must translate to a TypeNode, but was ${
|
|
2226
|
+
if (!ts14.isTypeNode(typeNode)) {
|
|
2227
|
+
throw new Error(`A Type must translate to a TypeNode, but was ${ts14.SyntaxKind[typeNode.kind]}`);
|
|
2175
2228
|
}
|
|
2176
2229
|
return typeNode;
|
|
2177
2230
|
}
|
|
2178
2231
|
translateExpression(expr, context) {
|
|
2179
2232
|
const typeNode = expr.visitExpression(this, context);
|
|
2180
|
-
if (!
|
|
2181
|
-
throw new Error(`An Expression must translate to a TypeNode, but was ${
|
|
2233
|
+
if (!ts14.isTypeNode(typeNode)) {
|
|
2234
|
+
throw new Error(`An Expression must translate to a TypeNode, but was ${ts14.SyntaxKind[typeNode.kind]}`);
|
|
2182
2235
|
}
|
|
2183
2236
|
return typeNode;
|
|
2184
2237
|
}
|
|
2185
2238
|
translateTypeReference(type, context, viaModule) {
|
|
2186
|
-
const target =
|
|
2239
|
+
const target = ts14.isIdentifier(type.typeName) ? type.typeName : type.typeName.right;
|
|
2187
2240
|
const declaration = this.reflector.getDeclarationOfIdentifier(target);
|
|
2188
2241
|
if (declaration === null) {
|
|
2189
2242
|
throw new Error(`Unable to statically determine the declaration file of type node ${target.text}`);
|
|
@@ -2199,79 +2252,79 @@ var TypeTranslatorVisitor = class {
|
|
|
2199
2252
|
const emittedType = this.refEmitter.emit(reference, this.contextFile, ImportFlags.NoAliasing | ImportFlags.AllowTypeImports | ImportFlags.AllowAmbientReferences);
|
|
2200
2253
|
assertSuccessfulReferenceEmit(emittedType, target, "type");
|
|
2201
2254
|
const typeNode = this.translateExpression(emittedType.expression, context);
|
|
2202
|
-
if (!
|
|
2203
|
-
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${
|
|
2255
|
+
if (!ts14.isTypeReferenceNode(typeNode)) {
|
|
2256
|
+
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts14.SyntaxKind[typeNode.kind]}.`);
|
|
2204
2257
|
}
|
|
2205
2258
|
return typeNode;
|
|
2206
2259
|
}
|
|
2207
2260
|
};
|
|
2208
2261
|
|
|
2209
2262
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.mjs
|
|
2210
|
-
import
|
|
2263
|
+
import ts15 from "typescript";
|
|
2211
2264
|
var PureAnnotation;
|
|
2212
2265
|
(function(PureAnnotation2) {
|
|
2213
2266
|
PureAnnotation2["CLOSURE"] = "* @pureOrBreakMyCode ";
|
|
2214
2267
|
PureAnnotation2["TERSER"] = "@__PURE__";
|
|
2215
2268
|
})(PureAnnotation || (PureAnnotation = {}));
|
|
2216
2269
|
var UNARY_OPERATORS2 = {
|
|
2217
|
-
"+":
|
|
2218
|
-
"-":
|
|
2219
|
-
"!":
|
|
2270
|
+
"+": ts15.SyntaxKind.PlusToken,
|
|
2271
|
+
"-": ts15.SyntaxKind.MinusToken,
|
|
2272
|
+
"!": ts15.SyntaxKind.ExclamationToken
|
|
2220
2273
|
};
|
|
2221
2274
|
var BINARY_OPERATORS2 = {
|
|
2222
|
-
"&&":
|
|
2223
|
-
">":
|
|
2224
|
-
">=":
|
|
2225
|
-
"&":
|
|
2226
|
-
"|":
|
|
2227
|
-
"/":
|
|
2228
|
-
"==":
|
|
2229
|
-
"===":
|
|
2230
|
-
"<":
|
|
2231
|
-
"<=":
|
|
2232
|
-
"-":
|
|
2233
|
-
"%":
|
|
2234
|
-
"*":
|
|
2235
|
-
"!=":
|
|
2236
|
-
"!==":
|
|
2237
|
-
"||":
|
|
2238
|
-
"+":
|
|
2239
|
-
"??":
|
|
2275
|
+
"&&": ts15.SyntaxKind.AmpersandAmpersandToken,
|
|
2276
|
+
">": ts15.SyntaxKind.GreaterThanToken,
|
|
2277
|
+
">=": ts15.SyntaxKind.GreaterThanEqualsToken,
|
|
2278
|
+
"&": ts15.SyntaxKind.AmpersandToken,
|
|
2279
|
+
"|": ts15.SyntaxKind.BarToken,
|
|
2280
|
+
"/": ts15.SyntaxKind.SlashToken,
|
|
2281
|
+
"==": ts15.SyntaxKind.EqualsEqualsToken,
|
|
2282
|
+
"===": ts15.SyntaxKind.EqualsEqualsEqualsToken,
|
|
2283
|
+
"<": ts15.SyntaxKind.LessThanToken,
|
|
2284
|
+
"<=": ts15.SyntaxKind.LessThanEqualsToken,
|
|
2285
|
+
"-": ts15.SyntaxKind.MinusToken,
|
|
2286
|
+
"%": ts15.SyntaxKind.PercentToken,
|
|
2287
|
+
"*": ts15.SyntaxKind.AsteriskToken,
|
|
2288
|
+
"!=": ts15.SyntaxKind.ExclamationEqualsToken,
|
|
2289
|
+
"!==": ts15.SyntaxKind.ExclamationEqualsEqualsToken,
|
|
2290
|
+
"||": ts15.SyntaxKind.BarBarToken,
|
|
2291
|
+
"+": ts15.SyntaxKind.PlusToken,
|
|
2292
|
+
"??": ts15.SyntaxKind.QuestionQuestionToken
|
|
2240
2293
|
};
|
|
2241
2294
|
var VAR_TYPES = {
|
|
2242
|
-
"const":
|
|
2243
|
-
"let":
|
|
2244
|
-
"var":
|
|
2295
|
+
"const": ts15.NodeFlags.Const,
|
|
2296
|
+
"let": ts15.NodeFlags.Let,
|
|
2297
|
+
"var": ts15.NodeFlags.None
|
|
2245
2298
|
};
|
|
2246
2299
|
var TypeScriptAstFactory = class {
|
|
2247
2300
|
constructor(annotateForClosureCompiler) {
|
|
2248
2301
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
2249
2302
|
this.externalSourceFiles = /* @__PURE__ */ new Map();
|
|
2250
2303
|
this.attachComments = attachComments;
|
|
2251
|
-
this.createArrayLiteral =
|
|
2252
|
-
this.createElementAccess =
|
|
2253
|
-
this.createExpressionStatement =
|
|
2254
|
-
this.createIdentifier =
|
|
2255
|
-
this.createParenthesizedExpression =
|
|
2256
|
-
this.createPropertyAccess =
|
|
2257
|
-
this.createThrowStatement =
|
|
2258
|
-
this.createTypeOfExpression =
|
|
2304
|
+
this.createArrayLiteral = ts15.factory.createArrayLiteralExpression;
|
|
2305
|
+
this.createElementAccess = ts15.factory.createElementAccessExpression;
|
|
2306
|
+
this.createExpressionStatement = ts15.factory.createExpressionStatement;
|
|
2307
|
+
this.createIdentifier = ts15.factory.createIdentifier;
|
|
2308
|
+
this.createParenthesizedExpression = ts15.factory.createParenthesizedExpression;
|
|
2309
|
+
this.createPropertyAccess = ts15.factory.createPropertyAccessExpression;
|
|
2310
|
+
this.createThrowStatement = ts15.factory.createThrowStatement;
|
|
2311
|
+
this.createTypeOfExpression = ts15.factory.createTypeOfExpression;
|
|
2259
2312
|
}
|
|
2260
2313
|
createAssignment(target, value) {
|
|
2261
|
-
return
|
|
2314
|
+
return ts15.factory.createBinaryExpression(target, ts15.SyntaxKind.EqualsToken, value);
|
|
2262
2315
|
}
|
|
2263
2316
|
createBinaryExpression(leftOperand, operator, rightOperand) {
|
|
2264
|
-
return
|
|
2317
|
+
return ts15.factory.createBinaryExpression(leftOperand, BINARY_OPERATORS2[operator], rightOperand);
|
|
2265
2318
|
}
|
|
2266
2319
|
createBlock(body) {
|
|
2267
|
-
return
|
|
2320
|
+
return ts15.factory.createBlock(body);
|
|
2268
2321
|
}
|
|
2269
2322
|
createCallExpression(callee, args, pure) {
|
|
2270
|
-
const call =
|
|
2323
|
+
const call = ts15.factory.createCallExpression(callee, void 0, args);
|
|
2271
2324
|
if (pure) {
|
|
2272
|
-
|
|
2325
|
+
ts15.addSyntheticLeadingComment(
|
|
2273
2326
|
call,
|
|
2274
|
-
|
|
2327
|
+
ts15.SyntaxKind.MultiLineCommentTrivia,
|
|
2275
2328
|
this.annotateForClosureCompiler ? PureAnnotation.CLOSURE : PureAnnotation.TERSER,
|
|
2276
2329
|
false
|
|
2277
2330
|
);
|
|
@@ -2279,64 +2332,64 @@ var TypeScriptAstFactory = class {
|
|
|
2279
2332
|
return call;
|
|
2280
2333
|
}
|
|
2281
2334
|
createConditional(condition, whenTrue, whenFalse) {
|
|
2282
|
-
return
|
|
2335
|
+
return ts15.factory.createConditionalExpression(condition, void 0, whenTrue, void 0, whenFalse);
|
|
2283
2336
|
}
|
|
2284
2337
|
createDynamicImport(url) {
|
|
2285
|
-
return
|
|
2286
|
-
|
|
2338
|
+
return ts15.factory.createCallExpression(
|
|
2339
|
+
ts15.factory.createToken(ts15.SyntaxKind.ImportKeyword),
|
|
2287
2340
|
void 0,
|
|
2288
|
-
[
|
|
2341
|
+
[ts15.factory.createStringLiteral(url)]
|
|
2289
2342
|
);
|
|
2290
2343
|
}
|
|
2291
2344
|
createFunctionDeclaration(functionName, parameters, body) {
|
|
2292
|
-
if (!
|
|
2293
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
2345
|
+
if (!ts15.isBlock(body)) {
|
|
2346
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts15.SyntaxKind[body.kind]}.`);
|
|
2294
2347
|
}
|
|
2295
|
-
return
|
|
2348
|
+
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);
|
|
2296
2349
|
}
|
|
2297
2350
|
createFunctionExpression(functionName, parameters, body) {
|
|
2298
|
-
if (!
|
|
2299
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
2351
|
+
if (!ts15.isBlock(body)) {
|
|
2352
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts15.SyntaxKind[body.kind]}.`);
|
|
2300
2353
|
}
|
|
2301
|
-
return
|
|
2354
|
+
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);
|
|
2302
2355
|
}
|
|
2303
2356
|
createArrowFunctionExpression(parameters, body) {
|
|
2304
|
-
if (
|
|
2305
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
2357
|
+
if (ts15.isStatement(body) && !ts15.isBlock(body)) {
|
|
2358
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts15.SyntaxKind[body.kind]}.`);
|
|
2306
2359
|
}
|
|
2307
|
-
return
|
|
2360
|
+
return ts15.factory.createArrowFunction(void 0, void 0, parameters.map((param) => ts15.factory.createParameterDeclaration(void 0, void 0, param)), void 0, void 0, body);
|
|
2308
2361
|
}
|
|
2309
2362
|
createIfStatement(condition, thenStatement, elseStatement) {
|
|
2310
|
-
return
|
|
2363
|
+
return ts15.factory.createIfStatement(condition, thenStatement, elseStatement != null ? elseStatement : void 0);
|
|
2311
2364
|
}
|
|
2312
2365
|
createLiteral(value) {
|
|
2313
2366
|
if (value === void 0) {
|
|
2314
|
-
return
|
|
2367
|
+
return ts15.factory.createIdentifier("undefined");
|
|
2315
2368
|
} else if (value === null) {
|
|
2316
|
-
return
|
|
2369
|
+
return ts15.factory.createNull();
|
|
2317
2370
|
} else if (typeof value === "boolean") {
|
|
2318
|
-
return value ?
|
|
2371
|
+
return value ? ts15.factory.createTrue() : ts15.factory.createFalse();
|
|
2319
2372
|
} else if (typeof value === "number") {
|
|
2320
2373
|
return tsNumericExpression(value);
|
|
2321
2374
|
} else {
|
|
2322
|
-
return
|
|
2375
|
+
return ts15.factory.createStringLiteral(value);
|
|
2323
2376
|
}
|
|
2324
2377
|
}
|
|
2325
2378
|
createNewExpression(expression, args) {
|
|
2326
|
-
return
|
|
2379
|
+
return ts15.factory.createNewExpression(expression, void 0, args);
|
|
2327
2380
|
}
|
|
2328
2381
|
createObjectLiteral(properties) {
|
|
2329
|
-
return
|
|
2382
|
+
return ts15.factory.createObjectLiteralExpression(properties.map((prop) => ts15.factory.createPropertyAssignment(prop.quoted ? ts15.factory.createStringLiteral(prop.propertyName) : ts15.factory.createIdentifier(prop.propertyName), prop.value)));
|
|
2330
2383
|
}
|
|
2331
2384
|
createReturnStatement(expression) {
|
|
2332
|
-
return
|
|
2385
|
+
return ts15.factory.createReturnStatement(expression != null ? expression : void 0);
|
|
2333
2386
|
}
|
|
2334
2387
|
createTaggedTemplate(tag, template) {
|
|
2335
2388
|
let templateLiteral;
|
|
2336
2389
|
const length = template.elements.length;
|
|
2337
2390
|
const head = template.elements[0];
|
|
2338
2391
|
if (length === 1) {
|
|
2339
|
-
templateLiteral =
|
|
2392
|
+
templateLiteral = ts15.factory.createNoSubstitutionTemplateLiteral(head.cooked, head.raw);
|
|
2340
2393
|
} else {
|
|
2341
2394
|
const spans = [];
|
|
2342
2395
|
for (let i = 1; i < length - 1; i++) {
|
|
@@ -2345,7 +2398,7 @@ var TypeScriptAstFactory = class {
|
|
|
2345
2398
|
if (range !== null) {
|
|
2346
2399
|
this.setSourceMapRange(middle, range);
|
|
2347
2400
|
}
|
|
2348
|
-
spans.push(
|
|
2401
|
+
spans.push(ts15.factory.createTemplateSpan(template.expressions[i - 1], middle));
|
|
2349
2402
|
}
|
|
2350
2403
|
const resolvedExpression = template.expressions[length - 2];
|
|
2351
2404
|
const templatePart = template.elements[length - 1];
|
|
@@ -2353,19 +2406,19 @@ var TypeScriptAstFactory = class {
|
|
|
2353
2406
|
if (templatePart.range !== null) {
|
|
2354
2407
|
this.setSourceMapRange(templateTail, templatePart.range);
|
|
2355
2408
|
}
|
|
2356
|
-
spans.push(
|
|
2357
|
-
templateLiteral =
|
|
2409
|
+
spans.push(ts15.factory.createTemplateSpan(resolvedExpression, templateTail));
|
|
2410
|
+
templateLiteral = ts15.factory.createTemplateExpression(ts15.factory.createTemplateHead(head.cooked, head.raw), spans);
|
|
2358
2411
|
}
|
|
2359
2412
|
if (head.range !== null) {
|
|
2360
2413
|
this.setSourceMapRange(templateLiteral, head.range);
|
|
2361
2414
|
}
|
|
2362
|
-
return
|
|
2415
|
+
return ts15.factory.createTaggedTemplateExpression(tag, void 0, templateLiteral);
|
|
2363
2416
|
}
|
|
2364
2417
|
createUnaryExpression(operator, operand) {
|
|
2365
|
-
return
|
|
2418
|
+
return ts15.factory.createPrefixUnaryExpression(UNARY_OPERATORS2[operator], operand);
|
|
2366
2419
|
}
|
|
2367
2420
|
createVariableDeclaration(variableName, initializer, type) {
|
|
2368
|
-
return
|
|
2421
|
+
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]));
|
|
2369
2422
|
}
|
|
2370
2423
|
setSourceMapRange(node, sourceMapRange) {
|
|
2371
2424
|
if (sourceMapRange === null) {
|
|
@@ -2373,31 +2426,31 @@ var TypeScriptAstFactory = class {
|
|
|
2373
2426
|
}
|
|
2374
2427
|
const url = sourceMapRange.url;
|
|
2375
2428
|
if (!this.externalSourceFiles.has(url)) {
|
|
2376
|
-
this.externalSourceFiles.set(url,
|
|
2429
|
+
this.externalSourceFiles.set(url, ts15.createSourceMapSource(url, sourceMapRange.content, (pos) => pos));
|
|
2377
2430
|
}
|
|
2378
2431
|
const source = this.externalSourceFiles.get(url);
|
|
2379
|
-
|
|
2432
|
+
ts15.setSourceMapRange(node, { pos: sourceMapRange.start.offset, end: sourceMapRange.end.offset, source });
|
|
2380
2433
|
return node;
|
|
2381
2434
|
}
|
|
2382
2435
|
};
|
|
2383
2436
|
function createTemplateMiddle(cooked, raw) {
|
|
2384
|
-
const node =
|
|
2385
|
-
node.kind =
|
|
2437
|
+
const node = ts15.factory.createTemplateHead(cooked, raw);
|
|
2438
|
+
node.kind = ts15.SyntaxKind.TemplateMiddle;
|
|
2386
2439
|
return node;
|
|
2387
2440
|
}
|
|
2388
2441
|
function createTemplateTail(cooked, raw) {
|
|
2389
|
-
const node =
|
|
2390
|
-
node.kind =
|
|
2442
|
+
const node = ts15.factory.createTemplateHead(cooked, raw);
|
|
2443
|
+
node.kind = ts15.SyntaxKind.TemplateTail;
|
|
2391
2444
|
return node;
|
|
2392
2445
|
}
|
|
2393
2446
|
function attachComments(statement, leadingComments) {
|
|
2394
2447
|
for (const comment of leadingComments) {
|
|
2395
|
-
const commentKind = comment.multiline ?
|
|
2448
|
+
const commentKind = comment.multiline ? ts15.SyntaxKind.MultiLineCommentTrivia : ts15.SyntaxKind.SingleLineCommentTrivia;
|
|
2396
2449
|
if (comment.multiline) {
|
|
2397
|
-
|
|
2450
|
+
ts15.addSyntheticLeadingComment(statement, commentKind, comment.toString(), comment.trailingNewline);
|
|
2398
2451
|
} else {
|
|
2399
2452
|
for (const line of comment.toString().split("\n")) {
|
|
2400
|
-
|
|
2453
|
+
ts15.addSyntheticLeadingComment(statement, commentKind, line, comment.trailingNewline);
|
|
2401
2454
|
}
|
|
2402
2455
|
}
|
|
2403
2456
|
}
|
|
@@ -2466,6 +2519,7 @@ export {
|
|
|
2466
2519
|
filterToMembersWithDecorator,
|
|
2467
2520
|
reflectObjectLiteral,
|
|
2468
2521
|
DeferredSymbolTracker,
|
|
2522
|
+
LocalCompilationExtraImportsTracker,
|
|
2469
2523
|
Reference,
|
|
2470
2524
|
ModuleResolver,
|
|
2471
2525
|
Context,
|
|
@@ -2491,4 +2545,4 @@ export {
|
|
|
2491
2545
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2492
2546
|
* found in the LICENSE file at https://angular.io/license
|
|
2493
2547
|
*/
|
|
2494
|
-
//# sourceMappingURL=chunk-
|
|
2548
|
+
//# sourceMappingURL=chunk-7HZQIUTO.js.map
|