@angular/core 16.2.10 → 16.2.12
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/esm2022/src/application_init.mjs +3 -2
- package/esm2022/src/application_ref.mjs +3 -3
- package/esm2022/src/di/r3_injector.mjs +6 -1
- package/esm2022/src/render3/debug/injector_profiler.mjs +26 -8
- package/esm2022/src/render3/util/injector_discovery_utils.mjs +26 -2
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/logger.mjs +3 -3
- package/fesm2022/core.mjs +147 -100
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +118 -96
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +4 -3
- package/package.json +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/ng-generate/standalone-migration/bundle.js +425 -430
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
|
@@ -21920,7 +21920,7 @@ function publishFacade(global) {
|
|
|
21920
21920
|
}
|
|
21921
21921
|
|
|
21922
21922
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
|
|
21923
|
-
var VERSION2 = new Version("16.2.
|
|
21923
|
+
var VERSION2 = new Version("16.2.12");
|
|
21924
21924
|
|
|
21925
21925
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
21926
21926
|
var _I18N_ATTR = "i18n";
|
|
@@ -23362,7 +23362,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION = "12.0.0";
|
|
|
23362
23362
|
function compileDeclareClassMetadata(metadata) {
|
|
23363
23363
|
const definitionMap = new DefinitionMap();
|
|
23364
23364
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
23365
|
-
definitionMap.set("version", literal("16.2.
|
|
23365
|
+
definitionMap.set("version", literal("16.2.12"));
|
|
23366
23366
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
23367
23367
|
definitionMap.set("type", metadata.type);
|
|
23368
23368
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -23433,7 +23433,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
23433
23433
|
const hasTransformFunctions = Object.values(meta.inputs).some((input) => input.transformFunction !== null);
|
|
23434
23434
|
const minVersion = hasTransformFunctions ? MINIMUM_PARTIAL_LINKER_VERSION2 : "14.0.0";
|
|
23435
23435
|
definitionMap.set("minVersion", literal(minVersion));
|
|
23436
|
-
definitionMap.set("version", literal("16.2.
|
|
23436
|
+
definitionMap.set("version", literal("16.2.12"));
|
|
23437
23437
|
definitionMap.set("type", meta.type.value);
|
|
23438
23438
|
if (meta.isStandalone) {
|
|
23439
23439
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -23618,7 +23618,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION3 = "12.0.0";
|
|
|
23618
23618
|
function compileDeclareFactoryFunction(meta) {
|
|
23619
23619
|
const definitionMap = new DefinitionMap();
|
|
23620
23620
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
|
|
23621
|
-
definitionMap.set("version", literal("16.2.
|
|
23621
|
+
definitionMap.set("version", literal("16.2.12"));
|
|
23622
23622
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
23623
23623
|
definitionMap.set("type", meta.type.value);
|
|
23624
23624
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -23641,7 +23641,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
23641
23641
|
function createInjectableDefinitionMap(meta) {
|
|
23642
23642
|
const definitionMap = new DefinitionMap();
|
|
23643
23643
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
|
|
23644
|
-
definitionMap.set("version", literal("16.2.
|
|
23644
|
+
definitionMap.set("version", literal("16.2.12"));
|
|
23645
23645
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
23646
23646
|
definitionMap.set("type", meta.type.value);
|
|
23647
23647
|
if (meta.providedIn !== void 0) {
|
|
@@ -23679,7 +23679,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
23679
23679
|
function createInjectorDefinitionMap(meta) {
|
|
23680
23680
|
const definitionMap = new DefinitionMap();
|
|
23681
23681
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
|
|
23682
|
-
definitionMap.set("version", literal("16.2.
|
|
23682
|
+
definitionMap.set("version", literal("16.2.12"));
|
|
23683
23683
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
23684
23684
|
definitionMap.set("type", meta.type.value);
|
|
23685
23685
|
definitionMap.set("providers", meta.providers);
|
|
@@ -23703,7 +23703,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
23703
23703
|
throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
|
|
23704
23704
|
}
|
|
23705
23705
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
|
|
23706
|
-
definitionMap.set("version", literal("16.2.
|
|
23706
|
+
definitionMap.set("version", literal("16.2.12"));
|
|
23707
23707
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
23708
23708
|
definitionMap.set("type", meta.type.value);
|
|
23709
23709
|
if (meta.bootstrap.length > 0) {
|
|
@@ -23738,7 +23738,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
23738
23738
|
function createPipeDefinitionMap(meta) {
|
|
23739
23739
|
const definitionMap = new DefinitionMap();
|
|
23740
23740
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION7));
|
|
23741
|
-
definitionMap.set("version", literal("16.2.
|
|
23741
|
+
definitionMap.set("version", literal("16.2.12"));
|
|
23742
23742
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
23743
23743
|
definitionMap.set("type", meta.type.value);
|
|
23744
23744
|
if (meta.isStandalone) {
|
|
@@ -23755,7 +23755,7 @@ function createPipeDefinitionMap(meta) {
|
|
|
23755
23755
|
publishFacade(_global);
|
|
23756
23756
|
|
|
23757
23757
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/version.mjs
|
|
23758
|
-
var VERSION3 = new Version("16.2.
|
|
23758
|
+
var VERSION3 = new Version("16.2.12");
|
|
23759
23759
|
|
|
23760
23760
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
23761
23761
|
var EmitFlags;
|
|
@@ -27853,7 +27853,7 @@ function compileInputTransformFields(inputs) {
|
|
|
27853
27853
|
}
|
|
27854
27854
|
|
|
27855
27855
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
|
|
27856
|
-
var
|
|
27856
|
+
var import_typescript54 = __toESM(require("typescript"), 1);
|
|
27857
27857
|
|
|
27858
27858
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
27859
27859
|
var import_typescript33 = __toESM(require("typescript"), 1);
|
|
@@ -29359,7 +29359,7 @@ function containsErrors(diagnostics) {
|
|
|
29359
29359
|
}
|
|
29360
29360
|
|
|
29361
29361
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
29362
|
-
var
|
|
29362
|
+
var import_typescript46 = __toESM(require("typescript"), 1);
|
|
29363
29363
|
|
|
29364
29364
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/context.mjs
|
|
29365
29365
|
var Context = class {
|
|
@@ -29644,8 +29644,83 @@ function createRange(span) {
|
|
|
29644
29644
|
};
|
|
29645
29645
|
}
|
|
29646
29646
|
|
|
29647
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/
|
|
29647
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_emitter.mjs
|
|
29648
29648
|
var import_typescript42 = __toESM(require("typescript"), 1);
|
|
29649
|
+
var INELIGIBLE = {};
|
|
29650
|
+
function canEmitType(type, canEmit) {
|
|
29651
|
+
return canEmitTypeWorker(type);
|
|
29652
|
+
function canEmitTypeWorker(type2) {
|
|
29653
|
+
return visitNode(type2) !== INELIGIBLE;
|
|
29654
|
+
}
|
|
29655
|
+
function visitNode(node) {
|
|
29656
|
+
if (import_typescript42.default.isImportTypeNode(node)) {
|
|
29657
|
+
return INELIGIBLE;
|
|
29658
|
+
}
|
|
29659
|
+
if (import_typescript42.default.isTypeReferenceNode(node) && !canEmitTypeReference(node)) {
|
|
29660
|
+
return INELIGIBLE;
|
|
29661
|
+
} else {
|
|
29662
|
+
return import_typescript42.default.forEachChild(node, visitNode);
|
|
29663
|
+
}
|
|
29664
|
+
}
|
|
29665
|
+
function canEmitTypeReference(type2) {
|
|
29666
|
+
if (!canEmit(type2)) {
|
|
29667
|
+
return false;
|
|
29668
|
+
}
|
|
29669
|
+
return type2.typeArguments === void 0 || type2.typeArguments.every(canEmitTypeWorker);
|
|
29670
|
+
}
|
|
29671
|
+
}
|
|
29672
|
+
var TypeEmitter = class {
|
|
29673
|
+
constructor(translator) {
|
|
29674
|
+
this.translator = translator;
|
|
29675
|
+
}
|
|
29676
|
+
emitType(type) {
|
|
29677
|
+
const typeReferenceTransformer = (context) => {
|
|
29678
|
+
const visitNode = (node) => {
|
|
29679
|
+
if (import_typescript42.default.isImportTypeNode(node)) {
|
|
29680
|
+
throw new Error("Unable to emit import type");
|
|
29681
|
+
}
|
|
29682
|
+
if (import_typescript42.default.isTypeReferenceNode(node)) {
|
|
29683
|
+
return this.emitTypeReference(node);
|
|
29684
|
+
} else if (import_typescript42.default.isLiteralExpression(node)) {
|
|
29685
|
+
let clone;
|
|
29686
|
+
if (import_typescript42.default.isStringLiteral(node)) {
|
|
29687
|
+
clone = import_typescript42.default.factory.createStringLiteral(node.text);
|
|
29688
|
+
} else if (import_typescript42.default.isNumericLiteral(node)) {
|
|
29689
|
+
clone = import_typescript42.default.factory.createNumericLiteral(node.text);
|
|
29690
|
+
} else if (import_typescript42.default.isBigIntLiteral(node)) {
|
|
29691
|
+
clone = import_typescript42.default.factory.createBigIntLiteral(node.text);
|
|
29692
|
+
} else if (import_typescript42.default.isNoSubstitutionTemplateLiteral(node)) {
|
|
29693
|
+
clone = import_typescript42.default.factory.createNoSubstitutionTemplateLiteral(node.text, node.rawText);
|
|
29694
|
+
} else if (import_typescript42.default.isRegularExpressionLiteral(node)) {
|
|
29695
|
+
clone = import_typescript42.default.factory.createRegularExpressionLiteral(node.text);
|
|
29696
|
+
} else {
|
|
29697
|
+
throw new Error(`Unsupported literal kind ${import_typescript42.default.SyntaxKind[node.kind]}`);
|
|
29698
|
+
}
|
|
29699
|
+
import_typescript42.default.setTextRange(clone, { pos: -1, end: -1 });
|
|
29700
|
+
return clone;
|
|
29701
|
+
} else {
|
|
29702
|
+
return import_typescript42.default.visitEachChild(node, visitNode, context);
|
|
29703
|
+
}
|
|
29704
|
+
};
|
|
29705
|
+
return (node) => import_typescript42.default.visitNode(node, visitNode, import_typescript42.default.isTypeNode);
|
|
29706
|
+
};
|
|
29707
|
+
return import_typescript42.default.transform(type, [typeReferenceTransformer]).transformed[0];
|
|
29708
|
+
}
|
|
29709
|
+
emitTypeReference(type) {
|
|
29710
|
+
const translatedType = this.translator(type);
|
|
29711
|
+
if (translatedType === null) {
|
|
29712
|
+
throw new Error("Unable to emit an unresolved reference");
|
|
29713
|
+
}
|
|
29714
|
+
let typeArguments = void 0;
|
|
29715
|
+
if (type.typeArguments !== void 0) {
|
|
29716
|
+
typeArguments = import_typescript42.default.factory.createNodeArray(type.typeArguments.map((typeArg) => this.emitType(typeArg)));
|
|
29717
|
+
}
|
|
29718
|
+
return import_typescript42.default.factory.updateTypeReferenceNode(type, translatedType.typeName, typeArguments);
|
|
29719
|
+
}
|
|
29720
|
+
};
|
|
29721
|
+
|
|
29722
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
|
|
29723
|
+
var import_typescript43 = __toESM(require("typescript"), 1);
|
|
29649
29724
|
function translateType(type, contextFile, reflector, refEmitter, imports) {
|
|
29650
29725
|
return type.visitType(new TypeTranslatorVisitor(imports, contextFile, reflector, refEmitter), new Context(false));
|
|
29651
29726
|
}
|
|
@@ -29659,16 +29734,16 @@ var TypeTranslatorVisitor = class {
|
|
|
29659
29734
|
visitBuiltinType(type, context) {
|
|
29660
29735
|
switch (type.name) {
|
|
29661
29736
|
case BuiltinTypeName.Bool:
|
|
29662
|
-
return
|
|
29737
|
+
return import_typescript43.default.factory.createKeywordTypeNode(import_typescript43.default.SyntaxKind.BooleanKeyword);
|
|
29663
29738
|
case BuiltinTypeName.Dynamic:
|
|
29664
|
-
return
|
|
29739
|
+
return import_typescript43.default.factory.createKeywordTypeNode(import_typescript43.default.SyntaxKind.AnyKeyword);
|
|
29665
29740
|
case BuiltinTypeName.Int:
|
|
29666
29741
|
case BuiltinTypeName.Number:
|
|
29667
|
-
return
|
|
29742
|
+
return import_typescript43.default.factory.createKeywordTypeNode(import_typescript43.default.SyntaxKind.NumberKeyword);
|
|
29668
29743
|
case BuiltinTypeName.String:
|
|
29669
|
-
return
|
|
29744
|
+
return import_typescript43.default.factory.createKeywordTypeNode(import_typescript43.default.SyntaxKind.StringKeyword);
|
|
29670
29745
|
case BuiltinTypeName.None:
|
|
29671
|
-
return
|
|
29746
|
+
return import_typescript43.default.factory.createKeywordTypeNode(import_typescript43.default.SyntaxKind.NeverKeyword);
|
|
29672
29747
|
default:
|
|
29673
29748
|
throw new Error(`Unsupported builtin type: ${BuiltinTypeName[type.name]}`);
|
|
29674
29749
|
}
|
|
@@ -29678,34 +29753,37 @@ var TypeTranslatorVisitor = class {
|
|
|
29678
29753
|
if (type.typeParams === null) {
|
|
29679
29754
|
return typeNode;
|
|
29680
29755
|
}
|
|
29681
|
-
if (!
|
|
29756
|
+
if (!import_typescript43.default.isTypeReferenceNode(typeNode)) {
|
|
29682
29757
|
throw new Error("An ExpressionType with type arguments must translate into a TypeReferenceNode");
|
|
29683
29758
|
} else if (typeNode.typeArguments !== void 0) {
|
|
29684
29759
|
throw new Error(`An ExpressionType with type arguments cannot have multiple levels of type arguments`);
|
|
29685
29760
|
}
|
|
29686
29761
|
const typeArgs = type.typeParams.map((param) => this.translateType(param, context));
|
|
29687
|
-
return
|
|
29762
|
+
return import_typescript43.default.factory.createTypeReferenceNode(typeNode.typeName, typeArgs);
|
|
29688
29763
|
}
|
|
29689
29764
|
visitArrayType(type, context) {
|
|
29690
|
-
return
|
|
29765
|
+
return import_typescript43.default.factory.createArrayTypeNode(this.translateType(type.of, context));
|
|
29691
29766
|
}
|
|
29692
29767
|
visitMapType(type, context) {
|
|
29693
|
-
const parameter =
|
|
29694
|
-
const typeArgs = type.valueType !== null ? this.translateType(type.valueType, context) :
|
|
29695
|
-
const indexSignature =
|
|
29696
|
-
return
|
|
29768
|
+
const parameter = import_typescript43.default.factory.createParameterDeclaration(void 0, void 0, "key", void 0, import_typescript43.default.factory.createKeywordTypeNode(import_typescript43.default.SyntaxKind.StringKeyword));
|
|
29769
|
+
const typeArgs = type.valueType !== null ? this.translateType(type.valueType, context) : import_typescript43.default.factory.createKeywordTypeNode(import_typescript43.default.SyntaxKind.UnknownKeyword);
|
|
29770
|
+
const indexSignature = import_typescript43.default.factory.createIndexSignature(void 0, [parameter], typeArgs);
|
|
29771
|
+
return import_typescript43.default.factory.createTypeLiteralNode([indexSignature]);
|
|
29697
29772
|
}
|
|
29698
29773
|
visitTransplantedType(ast, context) {
|
|
29699
|
-
|
|
29774
|
+
const node = ast.type instanceof Reference2 ? ast.type.node : ast.type;
|
|
29775
|
+
if (!import_typescript43.default.isTypeNode(node)) {
|
|
29700
29776
|
throw new Error(`A TransplantedType must wrap a TypeNode`);
|
|
29701
29777
|
}
|
|
29702
|
-
|
|
29778
|
+
const viaModule = ast.type instanceof Reference2 ? ast.type.bestGuessOwningModule : null;
|
|
29779
|
+
const emitter = new TypeEmitter((typeRef) => this.translateTypeReference(typeRef, context, viaModule));
|
|
29780
|
+
return emitter.emitType(node);
|
|
29703
29781
|
}
|
|
29704
29782
|
visitReadVarExpr(ast, context) {
|
|
29705
29783
|
if (ast.name === null) {
|
|
29706
29784
|
throw new Error(`ReadVarExpr with no variable name in type`);
|
|
29707
29785
|
}
|
|
29708
|
-
return
|
|
29786
|
+
return import_typescript43.default.factory.createTypeQueryNode(import_typescript43.default.factory.createIdentifier(ast.name));
|
|
29709
29787
|
}
|
|
29710
29788
|
visitWriteVarExpr(expr, context) {
|
|
29711
29789
|
throw new Error("Method not implemented.");
|
|
@@ -29727,15 +29805,15 @@ var TypeTranslatorVisitor = class {
|
|
|
29727
29805
|
}
|
|
29728
29806
|
visitLiteralExpr(ast, context) {
|
|
29729
29807
|
if (ast.value === null) {
|
|
29730
|
-
return
|
|
29808
|
+
return import_typescript43.default.factory.createLiteralTypeNode(import_typescript43.default.factory.createNull());
|
|
29731
29809
|
} else if (ast.value === void 0) {
|
|
29732
|
-
return
|
|
29810
|
+
return import_typescript43.default.factory.createKeywordTypeNode(import_typescript43.default.SyntaxKind.UndefinedKeyword);
|
|
29733
29811
|
} else if (typeof ast.value === "boolean") {
|
|
29734
|
-
return
|
|
29812
|
+
return import_typescript43.default.factory.createLiteralTypeNode(ast.value ? import_typescript43.default.factory.createTrue() : import_typescript43.default.factory.createFalse());
|
|
29735
29813
|
} else if (typeof ast.value === "number") {
|
|
29736
|
-
return
|
|
29814
|
+
return import_typescript43.default.factory.createLiteralTypeNode(import_typescript43.default.factory.createNumericLiteral(ast.value));
|
|
29737
29815
|
} else {
|
|
29738
|
-
return
|
|
29816
|
+
return import_typescript43.default.factory.createLiteralTypeNode(import_typescript43.default.factory.createStringLiteral(ast.value));
|
|
29739
29817
|
}
|
|
29740
29818
|
}
|
|
29741
29819
|
visitLocalizedString(ast, context) {
|
|
@@ -29746,10 +29824,10 @@ var TypeTranslatorVisitor = class {
|
|
|
29746
29824
|
throw new Error(`Import unknown module or symbol`);
|
|
29747
29825
|
}
|
|
29748
29826
|
const { moduleImport, symbol } = this.imports.generateNamedImport(ast.value.moduleName, ast.value.name);
|
|
29749
|
-
const symbolIdentifier =
|
|
29750
|
-
const typeName = moduleImport ?
|
|
29827
|
+
const symbolIdentifier = import_typescript43.default.factory.createIdentifier(symbol);
|
|
29828
|
+
const typeName = moduleImport ? import_typescript43.default.factory.createQualifiedName(moduleImport, symbolIdentifier) : symbolIdentifier;
|
|
29751
29829
|
const typeArguments = ast.typeParams !== null ? ast.typeParams.map((type) => this.translateType(type, context)) : void 0;
|
|
29752
|
-
return
|
|
29830
|
+
return import_typescript43.default.factory.createTypeReferenceNode(typeName, typeArguments);
|
|
29753
29831
|
}
|
|
29754
29832
|
visitConditionalExpr(ast, context) {
|
|
29755
29833
|
throw new Error("Method not implemented.");
|
|
@@ -29777,157 +29855,147 @@ var TypeTranslatorVisitor = class {
|
|
|
29777
29855
|
}
|
|
29778
29856
|
visitLiteralArrayExpr(ast, context) {
|
|
29779
29857
|
const values = ast.entries.map((expr) => this.translateExpression(expr, context));
|
|
29780
|
-
return
|
|
29858
|
+
return import_typescript43.default.factory.createTupleTypeNode(values);
|
|
29781
29859
|
}
|
|
29782
29860
|
visitLiteralMapExpr(ast, context) {
|
|
29783
29861
|
const entries = ast.entries.map((entry) => {
|
|
29784
29862
|
const { key, quoted } = entry;
|
|
29785
29863
|
const type = this.translateExpression(entry.value, context);
|
|
29786
|
-
return
|
|
29864
|
+
return import_typescript43.default.factory.createPropertySignature(
|
|
29787
29865
|
void 0,
|
|
29788
|
-
quoted ?
|
|
29866
|
+
quoted ? import_typescript43.default.factory.createStringLiteral(key) : key,
|
|
29789
29867
|
void 0,
|
|
29790
29868
|
type
|
|
29791
29869
|
);
|
|
29792
29870
|
});
|
|
29793
|
-
return
|
|
29871
|
+
return import_typescript43.default.factory.createTypeLiteralNode(entries);
|
|
29794
29872
|
}
|
|
29795
29873
|
visitCommaExpr(ast, context) {
|
|
29796
29874
|
throw new Error("Method not implemented.");
|
|
29797
29875
|
}
|
|
29798
29876
|
visitWrappedNodeExpr(ast, context) {
|
|
29799
29877
|
const node = ast.node;
|
|
29800
|
-
if (
|
|
29801
|
-
return
|
|
29802
|
-
} else if (
|
|
29878
|
+
if (import_typescript43.default.isEntityName(node)) {
|
|
29879
|
+
return import_typescript43.default.factory.createTypeReferenceNode(node, void 0);
|
|
29880
|
+
} else if (import_typescript43.default.isTypeNode(node)) {
|
|
29803
29881
|
return node;
|
|
29804
|
-
} else if (
|
|
29805
|
-
return
|
|
29882
|
+
} else if (import_typescript43.default.isLiteralExpression(node)) {
|
|
29883
|
+
return import_typescript43.default.factory.createLiteralTypeNode(node);
|
|
29806
29884
|
} else {
|
|
29807
|
-
throw new Error(`Unsupported WrappedNodeExpr in TypeTranslatorVisitor: ${
|
|
29885
|
+
throw new Error(`Unsupported WrappedNodeExpr in TypeTranslatorVisitor: ${import_typescript43.default.SyntaxKind[node.kind]}`);
|
|
29808
29886
|
}
|
|
29809
29887
|
}
|
|
29810
29888
|
visitTypeofExpr(ast, context) {
|
|
29811
29889
|
const typeNode = this.translateExpression(ast.expr, context);
|
|
29812
|
-
if (!
|
|
29890
|
+
if (!import_typescript43.default.isTypeReferenceNode(typeNode)) {
|
|
29813
29891
|
throw new Error(`The target of a typeof expression must be a type reference, but it was
|
|
29814
|
-
${
|
|
29892
|
+
${import_typescript43.default.SyntaxKind[typeNode.kind]}`);
|
|
29815
29893
|
}
|
|
29816
|
-
return
|
|
29894
|
+
return import_typescript43.default.factory.createTypeQueryNode(typeNode.typeName);
|
|
29817
29895
|
}
|
|
29818
29896
|
translateType(type, context) {
|
|
29819
29897
|
const typeNode = type.visitType(this, context);
|
|
29820
|
-
if (!
|
|
29821
|
-
throw new Error(`A Type must translate to a TypeNode, but was ${
|
|
29898
|
+
if (!import_typescript43.default.isTypeNode(typeNode)) {
|
|
29899
|
+
throw new Error(`A Type must translate to a TypeNode, but was ${import_typescript43.default.SyntaxKind[typeNode.kind]}`);
|
|
29822
29900
|
}
|
|
29823
29901
|
return typeNode;
|
|
29824
29902
|
}
|
|
29825
29903
|
translateExpression(expr, context) {
|
|
29826
29904
|
const typeNode = expr.visitExpression(this, context);
|
|
29827
|
-
if (!
|
|
29828
|
-
throw new Error(`An Expression must translate to a TypeNode, but was ${
|
|
29905
|
+
if (!import_typescript43.default.isTypeNode(typeNode)) {
|
|
29906
|
+
throw new Error(`An Expression must translate to a TypeNode, but was ${import_typescript43.default.SyntaxKind[typeNode.kind]}`);
|
|
29829
29907
|
}
|
|
29830
29908
|
return typeNode;
|
|
29831
29909
|
}
|
|
29832
|
-
|
|
29833
|
-
const
|
|
29910
|
+
translateTypeReference(type, context, viaModule) {
|
|
29911
|
+
const target = import_typescript43.default.isIdentifier(type.typeName) ? type.typeName : type.typeName.right;
|
|
29912
|
+
const declaration = this.reflector.getDeclarationOfIdentifier(target);
|
|
29834
29913
|
if (declaration === null) {
|
|
29835
|
-
throw new Error(`Unable to statically determine the declaration file of type node ${
|
|
29914
|
+
throw new Error(`Unable to statically determine the declaration file of type node ${target.text}`);
|
|
29836
29915
|
}
|
|
29837
|
-
|
|
29838
|
-
|
|
29839
|
-
|
|
29840
|
-
|
|
29841
|
-
|
|
29916
|
+
let owningModule2 = viaModule;
|
|
29917
|
+
if (declaration.viaModule !== null) {
|
|
29918
|
+
owningModule2 = {
|
|
29919
|
+
specifier: declaration.viaModule,
|
|
29920
|
+
resolutionContext: type.getSourceFile().fileName
|
|
29921
|
+
};
|
|
29842
29922
|
}
|
|
29843
|
-
|
|
29844
|
-
|
|
29923
|
+
const reference2 = new Reference2(declaration.node, owningModule2);
|
|
29924
|
+
const emittedType = this.refEmitter.emit(reference2, this.contextFile, ImportFlags.NoAliasing | ImportFlags.AllowTypeImports);
|
|
29925
|
+
assertSuccessfulReferenceEmit(emittedType, target, "type");
|
|
29926
|
+
const typeNode = this.translateExpression(emittedType.expression, context);
|
|
29927
|
+
if (!import_typescript43.default.isTypeReferenceNode(typeNode)) {
|
|
29928
|
+
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${import_typescript43.default.SyntaxKind[typeNode.kind]}.`);
|
|
29845
29929
|
}
|
|
29846
|
-
|
|
29847
|
-
return import_typescript42.default.factory.updateTypeReferenceNode(result, result.typeName, import_typescript42.default.factory.createNodeArray(translatedArgs));
|
|
29848
|
-
}
|
|
29849
|
-
translateTransplantedTypeNode(rootNode, context) {
|
|
29850
|
-
const factory8 = (transformContext) => (root) => {
|
|
29851
|
-
const walk = (node) => {
|
|
29852
|
-
if (import_typescript42.default.isTypeReferenceNode(node) && import_typescript42.default.isIdentifier(node.typeName)) {
|
|
29853
|
-
const translated = this.translateTransplantedTypeReferenceNode(node, context);
|
|
29854
|
-
if (translated !== node) {
|
|
29855
|
-
return translated;
|
|
29856
|
-
}
|
|
29857
|
-
}
|
|
29858
|
-
return import_typescript42.default.visitEachChild(node, walk, transformContext);
|
|
29859
|
-
};
|
|
29860
|
-
return import_typescript42.default.visitNode(root, walk);
|
|
29861
|
-
};
|
|
29862
|
-
return import_typescript42.default.transform(rootNode, [factory8]).transformed[0];
|
|
29930
|
+
return typeNode;
|
|
29863
29931
|
}
|
|
29864
29932
|
};
|
|
29865
29933
|
|
|
29866
29934
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.mjs
|
|
29867
|
-
var
|
|
29935
|
+
var import_typescript44 = __toESM(require("typescript"), 1);
|
|
29868
29936
|
var PureAnnotation;
|
|
29869
29937
|
(function(PureAnnotation2) {
|
|
29870
29938
|
PureAnnotation2["CLOSURE"] = "* @pureOrBreakMyCode ";
|
|
29871
29939
|
PureAnnotation2["TERSER"] = "@__PURE__";
|
|
29872
29940
|
})(PureAnnotation || (PureAnnotation = {}));
|
|
29873
29941
|
var UNARY_OPERATORS3 = {
|
|
29874
|
-
"+":
|
|
29875
|
-
"-":
|
|
29876
|
-
"!":
|
|
29942
|
+
"+": import_typescript44.default.SyntaxKind.PlusToken,
|
|
29943
|
+
"-": import_typescript44.default.SyntaxKind.MinusToken,
|
|
29944
|
+
"!": import_typescript44.default.SyntaxKind.ExclamationToken
|
|
29877
29945
|
};
|
|
29878
29946
|
var BINARY_OPERATORS4 = {
|
|
29879
|
-
"&&":
|
|
29880
|
-
">":
|
|
29881
|
-
">=":
|
|
29882
|
-
"&":
|
|
29883
|
-
"/":
|
|
29884
|
-
"==":
|
|
29885
|
-
"===":
|
|
29886
|
-
"<":
|
|
29887
|
-
"<=":
|
|
29888
|
-
"-":
|
|
29889
|
-
"%":
|
|
29890
|
-
"*":
|
|
29891
|
-
"!=":
|
|
29892
|
-
"!==":
|
|
29893
|
-
"||":
|
|
29894
|
-
"+":
|
|
29895
|
-
"??":
|
|
29947
|
+
"&&": import_typescript44.default.SyntaxKind.AmpersandAmpersandToken,
|
|
29948
|
+
">": import_typescript44.default.SyntaxKind.GreaterThanToken,
|
|
29949
|
+
">=": import_typescript44.default.SyntaxKind.GreaterThanEqualsToken,
|
|
29950
|
+
"&": import_typescript44.default.SyntaxKind.AmpersandToken,
|
|
29951
|
+
"/": import_typescript44.default.SyntaxKind.SlashToken,
|
|
29952
|
+
"==": import_typescript44.default.SyntaxKind.EqualsEqualsToken,
|
|
29953
|
+
"===": import_typescript44.default.SyntaxKind.EqualsEqualsEqualsToken,
|
|
29954
|
+
"<": import_typescript44.default.SyntaxKind.LessThanToken,
|
|
29955
|
+
"<=": import_typescript44.default.SyntaxKind.LessThanEqualsToken,
|
|
29956
|
+
"-": import_typescript44.default.SyntaxKind.MinusToken,
|
|
29957
|
+
"%": import_typescript44.default.SyntaxKind.PercentToken,
|
|
29958
|
+
"*": import_typescript44.default.SyntaxKind.AsteriskToken,
|
|
29959
|
+
"!=": import_typescript44.default.SyntaxKind.ExclamationEqualsToken,
|
|
29960
|
+
"!==": import_typescript44.default.SyntaxKind.ExclamationEqualsEqualsToken,
|
|
29961
|
+
"||": import_typescript44.default.SyntaxKind.BarBarToken,
|
|
29962
|
+
"+": import_typescript44.default.SyntaxKind.PlusToken,
|
|
29963
|
+
"??": import_typescript44.default.SyntaxKind.QuestionQuestionToken
|
|
29896
29964
|
};
|
|
29897
29965
|
var VAR_TYPES = {
|
|
29898
|
-
"const":
|
|
29899
|
-
"let":
|
|
29900
|
-
"var":
|
|
29966
|
+
"const": import_typescript44.default.NodeFlags.Const,
|
|
29967
|
+
"let": import_typescript44.default.NodeFlags.Let,
|
|
29968
|
+
"var": import_typescript44.default.NodeFlags.None
|
|
29901
29969
|
};
|
|
29902
29970
|
var TypeScriptAstFactory = class {
|
|
29903
29971
|
constructor(annotateForClosureCompiler) {
|
|
29904
29972
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
29905
29973
|
this.externalSourceFiles = /* @__PURE__ */ new Map();
|
|
29906
29974
|
this.attachComments = attachComments;
|
|
29907
|
-
this.createArrayLiteral =
|
|
29908
|
-
this.createElementAccess =
|
|
29909
|
-
this.createExpressionStatement =
|
|
29910
|
-
this.createIdentifier =
|
|
29911
|
-
this.createParenthesizedExpression =
|
|
29912
|
-
this.createPropertyAccess =
|
|
29913
|
-
this.createThrowStatement =
|
|
29914
|
-
this.createTypeOfExpression =
|
|
29975
|
+
this.createArrayLiteral = import_typescript44.default.factory.createArrayLiteralExpression;
|
|
29976
|
+
this.createElementAccess = import_typescript44.default.factory.createElementAccessExpression;
|
|
29977
|
+
this.createExpressionStatement = import_typescript44.default.factory.createExpressionStatement;
|
|
29978
|
+
this.createIdentifier = import_typescript44.default.factory.createIdentifier;
|
|
29979
|
+
this.createParenthesizedExpression = import_typescript44.default.factory.createParenthesizedExpression;
|
|
29980
|
+
this.createPropertyAccess = import_typescript44.default.factory.createPropertyAccessExpression;
|
|
29981
|
+
this.createThrowStatement = import_typescript44.default.factory.createThrowStatement;
|
|
29982
|
+
this.createTypeOfExpression = import_typescript44.default.factory.createTypeOfExpression;
|
|
29915
29983
|
}
|
|
29916
29984
|
createAssignment(target, value) {
|
|
29917
|
-
return
|
|
29985
|
+
return import_typescript44.default.factory.createBinaryExpression(target, import_typescript44.default.SyntaxKind.EqualsToken, value);
|
|
29918
29986
|
}
|
|
29919
29987
|
createBinaryExpression(leftOperand, operator, rightOperand) {
|
|
29920
|
-
return
|
|
29988
|
+
return import_typescript44.default.factory.createBinaryExpression(leftOperand, BINARY_OPERATORS4[operator], rightOperand);
|
|
29921
29989
|
}
|
|
29922
29990
|
createBlock(body) {
|
|
29923
|
-
return
|
|
29991
|
+
return import_typescript44.default.factory.createBlock(body);
|
|
29924
29992
|
}
|
|
29925
29993
|
createCallExpression(callee, args, pure) {
|
|
29926
|
-
const call2 =
|
|
29994
|
+
const call2 = import_typescript44.default.factory.createCallExpression(callee, void 0, args);
|
|
29927
29995
|
if (pure) {
|
|
29928
|
-
|
|
29996
|
+
import_typescript44.default.addSyntheticLeadingComment(
|
|
29929
29997
|
call2,
|
|
29930
|
-
|
|
29998
|
+
import_typescript44.default.SyntaxKind.MultiLineCommentTrivia,
|
|
29931
29999
|
this.annotateForClosureCompiler ? PureAnnotation.CLOSURE : PureAnnotation.TERSER,
|
|
29932
30000
|
false
|
|
29933
30001
|
);
|
|
@@ -29935,58 +30003,58 @@ var TypeScriptAstFactory = class {
|
|
|
29935
30003
|
return call2;
|
|
29936
30004
|
}
|
|
29937
30005
|
createConditional(condition, whenTrue, whenFalse) {
|
|
29938
|
-
return
|
|
30006
|
+
return import_typescript44.default.factory.createConditionalExpression(condition, void 0, whenTrue, void 0, whenFalse);
|
|
29939
30007
|
}
|
|
29940
30008
|
createDynamicImport(url) {
|
|
29941
|
-
return
|
|
29942
|
-
|
|
30009
|
+
return import_typescript44.default.factory.createCallExpression(
|
|
30010
|
+
import_typescript44.default.factory.createToken(import_typescript44.default.SyntaxKind.ImportKeyword),
|
|
29943
30011
|
void 0,
|
|
29944
|
-
[
|
|
30012
|
+
[import_typescript44.default.factory.createStringLiteral(url)]
|
|
29945
30013
|
);
|
|
29946
30014
|
}
|
|
29947
30015
|
createFunctionDeclaration(functionName, parameters, body) {
|
|
29948
|
-
if (!
|
|
29949
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
30016
|
+
if (!import_typescript44.default.isBlock(body)) {
|
|
30017
|
+
throw new Error(`Invalid syntax, expected a block, but got ${import_typescript44.default.SyntaxKind[body.kind]}.`);
|
|
29950
30018
|
}
|
|
29951
|
-
return
|
|
30019
|
+
return import_typescript44.default.factory.createFunctionDeclaration(void 0, void 0, functionName, void 0, parameters.map((param) => import_typescript44.default.factory.createParameterDeclaration(void 0, void 0, param)), void 0, body);
|
|
29952
30020
|
}
|
|
29953
30021
|
createFunctionExpression(functionName, parameters, body) {
|
|
29954
|
-
if (!
|
|
29955
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
30022
|
+
if (!import_typescript44.default.isBlock(body)) {
|
|
30023
|
+
throw new Error(`Invalid syntax, expected a block, but got ${import_typescript44.default.SyntaxKind[body.kind]}.`);
|
|
29956
30024
|
}
|
|
29957
|
-
return
|
|
30025
|
+
return import_typescript44.default.factory.createFunctionExpression(void 0, void 0, functionName != null ? functionName : void 0, void 0, parameters.map((param) => import_typescript44.default.factory.createParameterDeclaration(void 0, void 0, param)), void 0, body);
|
|
29958
30026
|
}
|
|
29959
30027
|
createIfStatement(condition, thenStatement, elseStatement) {
|
|
29960
|
-
return
|
|
30028
|
+
return import_typescript44.default.factory.createIfStatement(condition, thenStatement, elseStatement != null ? elseStatement : void 0);
|
|
29961
30029
|
}
|
|
29962
30030
|
createLiteral(value) {
|
|
29963
30031
|
if (value === void 0) {
|
|
29964
|
-
return
|
|
30032
|
+
return import_typescript44.default.factory.createIdentifier("undefined");
|
|
29965
30033
|
} else if (value === null) {
|
|
29966
|
-
return
|
|
30034
|
+
return import_typescript44.default.factory.createNull();
|
|
29967
30035
|
} else if (typeof value === "boolean") {
|
|
29968
|
-
return value ?
|
|
30036
|
+
return value ? import_typescript44.default.factory.createTrue() : import_typescript44.default.factory.createFalse();
|
|
29969
30037
|
} else if (typeof value === "number") {
|
|
29970
|
-
return
|
|
30038
|
+
return import_typescript44.default.factory.createNumericLiteral(value);
|
|
29971
30039
|
} else {
|
|
29972
|
-
return
|
|
30040
|
+
return import_typescript44.default.factory.createStringLiteral(value);
|
|
29973
30041
|
}
|
|
29974
30042
|
}
|
|
29975
30043
|
createNewExpression(expression, args) {
|
|
29976
|
-
return
|
|
30044
|
+
return import_typescript44.default.factory.createNewExpression(expression, void 0, args);
|
|
29977
30045
|
}
|
|
29978
30046
|
createObjectLiteral(properties) {
|
|
29979
|
-
return
|
|
30047
|
+
return import_typescript44.default.factory.createObjectLiteralExpression(properties.map((prop) => import_typescript44.default.factory.createPropertyAssignment(prop.quoted ? import_typescript44.default.factory.createStringLiteral(prop.propertyName) : import_typescript44.default.factory.createIdentifier(prop.propertyName), prop.value)));
|
|
29980
30048
|
}
|
|
29981
30049
|
createReturnStatement(expression) {
|
|
29982
|
-
return
|
|
30050
|
+
return import_typescript44.default.factory.createReturnStatement(expression != null ? expression : void 0);
|
|
29983
30051
|
}
|
|
29984
30052
|
createTaggedTemplate(tag, template2) {
|
|
29985
30053
|
let templateLiteral;
|
|
29986
30054
|
const length = template2.elements.length;
|
|
29987
30055
|
const head = template2.elements[0];
|
|
29988
30056
|
if (length === 1) {
|
|
29989
|
-
templateLiteral =
|
|
30057
|
+
templateLiteral = import_typescript44.default.factory.createNoSubstitutionTemplateLiteral(head.cooked, head.raw);
|
|
29990
30058
|
} else {
|
|
29991
30059
|
const spans = [];
|
|
29992
30060
|
for (let i = 1; i < length - 1; i++) {
|
|
@@ -29995,7 +30063,7 @@ var TypeScriptAstFactory = class {
|
|
|
29995
30063
|
if (range !== null) {
|
|
29996
30064
|
this.setSourceMapRange(middle, range);
|
|
29997
30065
|
}
|
|
29998
|
-
spans.push(
|
|
30066
|
+
spans.push(import_typescript44.default.factory.createTemplateSpan(template2.expressions[i - 1], middle));
|
|
29999
30067
|
}
|
|
30000
30068
|
const resolvedExpression = template2.expressions[length - 2];
|
|
30001
30069
|
const templatePart = template2.elements[length - 1];
|
|
@@ -30003,19 +30071,19 @@ var TypeScriptAstFactory = class {
|
|
|
30003
30071
|
if (templatePart.range !== null) {
|
|
30004
30072
|
this.setSourceMapRange(templateTail, templatePart.range);
|
|
30005
30073
|
}
|
|
30006
|
-
spans.push(
|
|
30007
|
-
templateLiteral =
|
|
30074
|
+
spans.push(import_typescript44.default.factory.createTemplateSpan(resolvedExpression, templateTail));
|
|
30075
|
+
templateLiteral = import_typescript44.default.factory.createTemplateExpression(import_typescript44.default.factory.createTemplateHead(head.cooked, head.raw), spans);
|
|
30008
30076
|
}
|
|
30009
30077
|
if (head.range !== null) {
|
|
30010
30078
|
this.setSourceMapRange(templateLiteral, head.range);
|
|
30011
30079
|
}
|
|
30012
|
-
return
|
|
30080
|
+
return import_typescript44.default.factory.createTaggedTemplateExpression(tag, void 0, templateLiteral);
|
|
30013
30081
|
}
|
|
30014
30082
|
createUnaryExpression(operator, operand) {
|
|
30015
|
-
return
|
|
30083
|
+
return import_typescript44.default.factory.createPrefixUnaryExpression(UNARY_OPERATORS3[operator], operand);
|
|
30016
30084
|
}
|
|
30017
30085
|
createVariableDeclaration(variableName, initializer, type) {
|
|
30018
|
-
return
|
|
30086
|
+
return import_typescript44.default.factory.createVariableStatement(void 0, import_typescript44.default.factory.createVariableDeclarationList([import_typescript44.default.factory.createVariableDeclaration(variableName, void 0, void 0, initializer != null ? initializer : void 0)], VAR_TYPES[type]));
|
|
30019
30087
|
}
|
|
30020
30088
|
setSourceMapRange(node, sourceMapRange) {
|
|
30021
30089
|
if (sourceMapRange === null) {
|
|
@@ -30023,31 +30091,31 @@ var TypeScriptAstFactory = class {
|
|
|
30023
30091
|
}
|
|
30024
30092
|
const url = sourceMapRange.url;
|
|
30025
30093
|
if (!this.externalSourceFiles.has(url)) {
|
|
30026
|
-
this.externalSourceFiles.set(url,
|
|
30094
|
+
this.externalSourceFiles.set(url, import_typescript44.default.createSourceMapSource(url, sourceMapRange.content, (pos) => pos));
|
|
30027
30095
|
}
|
|
30028
30096
|
const source = this.externalSourceFiles.get(url);
|
|
30029
|
-
|
|
30097
|
+
import_typescript44.default.setSourceMapRange(node, { pos: sourceMapRange.start.offset, end: sourceMapRange.end.offset, source });
|
|
30030
30098
|
return node;
|
|
30031
30099
|
}
|
|
30032
30100
|
};
|
|
30033
30101
|
function createTemplateMiddle(cooked, raw) {
|
|
30034
|
-
const node =
|
|
30035
|
-
node.kind =
|
|
30102
|
+
const node = import_typescript44.default.factory.createTemplateHead(cooked, raw);
|
|
30103
|
+
node.kind = import_typescript44.default.SyntaxKind.TemplateMiddle;
|
|
30036
30104
|
return node;
|
|
30037
30105
|
}
|
|
30038
30106
|
function createTemplateTail(cooked, raw) {
|
|
30039
|
-
const node =
|
|
30040
|
-
node.kind =
|
|
30107
|
+
const node = import_typescript44.default.factory.createTemplateHead(cooked, raw);
|
|
30108
|
+
node.kind = import_typescript44.default.SyntaxKind.TemplateTail;
|
|
30041
30109
|
return node;
|
|
30042
30110
|
}
|
|
30043
30111
|
function attachComments(statement, leadingComments) {
|
|
30044
30112
|
for (const comment of leadingComments) {
|
|
30045
|
-
const commentKind = comment.multiline ?
|
|
30113
|
+
const commentKind = comment.multiline ? import_typescript44.default.SyntaxKind.MultiLineCommentTrivia : import_typescript44.default.SyntaxKind.SingleLineCommentTrivia;
|
|
30046
30114
|
if (comment.multiline) {
|
|
30047
|
-
|
|
30115
|
+
import_typescript44.default.addSyntheticLeadingComment(statement, commentKind, comment.toString(), comment.trailingNewline);
|
|
30048
30116
|
} else {
|
|
30049
30117
|
for (const line of comment.toString().split("\n")) {
|
|
30050
|
-
|
|
30118
|
+
import_typescript44.default.addSyntheticLeadingComment(statement, commentKind, line, comment.trailingNewline);
|
|
30051
30119
|
}
|
|
30052
30120
|
}
|
|
30053
30121
|
}
|
|
@@ -30062,28 +30130,28 @@ function translateStatement(statement, imports, options = {}) {
|
|
|
30062
30130
|
}
|
|
30063
30131
|
|
|
30064
30132
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/utils.mjs
|
|
30065
|
-
var
|
|
30133
|
+
var import_typescript45 = __toESM(require("typescript"), 1);
|
|
30066
30134
|
function addImports(importManager, sf, extraStatements = []) {
|
|
30067
30135
|
const addedImports = importManager.getAllImports(sf.fileName).map((i) => {
|
|
30068
|
-
const qualifier =
|
|
30069
|
-
const importClause =
|
|
30136
|
+
const qualifier = import_typescript45.default.factory.createIdentifier(i.qualifier.text);
|
|
30137
|
+
const importClause = import_typescript45.default.factory.createImportClause(
|
|
30070
30138
|
false,
|
|
30071
30139
|
void 0,
|
|
30072
|
-
|
|
30140
|
+
import_typescript45.default.factory.createNamespaceImport(qualifier)
|
|
30073
30141
|
);
|
|
30074
|
-
const decl =
|
|
30142
|
+
const decl = import_typescript45.default.factory.createImportDeclaration(
|
|
30075
30143
|
void 0,
|
|
30076
30144
|
importClause,
|
|
30077
|
-
|
|
30145
|
+
import_typescript45.default.factory.createStringLiteral(i.specifier)
|
|
30078
30146
|
);
|
|
30079
|
-
|
|
30147
|
+
import_typescript45.default.setOriginalNode(i.qualifier, decl);
|
|
30080
30148
|
return decl;
|
|
30081
30149
|
});
|
|
30082
30150
|
const existingImports = sf.statements.filter((stmt) => isImportStatement(stmt));
|
|
30083
30151
|
const body = sf.statements.filter((stmt) => !isImportStatement(stmt));
|
|
30084
30152
|
if (addedImports.length > 0) {
|
|
30085
|
-
const fileoverviewAnchorStmt =
|
|
30086
|
-
return
|
|
30153
|
+
const fileoverviewAnchorStmt = import_typescript45.default.factory.createNotEmittedStatement(sf);
|
|
30154
|
+
return import_typescript45.default.factory.updateSourceFile(sf, import_typescript45.default.factory.createNodeArray([
|
|
30087
30155
|
fileoverviewAnchorStmt,
|
|
30088
30156
|
...existingImports,
|
|
30089
30157
|
...addedImports,
|
|
@@ -30094,7 +30162,7 @@ function addImports(importManager, sf, extraStatements = []) {
|
|
|
30094
30162
|
return sf;
|
|
30095
30163
|
}
|
|
30096
30164
|
function isImportStatement(stmt) {
|
|
30097
|
-
return
|
|
30165
|
+
return import_typescript45.default.isImportDeclaration(stmt) || import_typescript45.default.isImportEqualsDeclaration(stmt) || import_typescript45.default.isNamespaceImport(stmt);
|
|
30098
30166
|
}
|
|
30099
30167
|
|
|
30100
30168
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
@@ -30112,7 +30180,7 @@ var DtsTransformRegistry = class {
|
|
|
30112
30180
|
if (!sf.isDeclarationFile) {
|
|
30113
30181
|
return null;
|
|
30114
30182
|
}
|
|
30115
|
-
const originalSf =
|
|
30183
|
+
const originalSf = import_typescript46.default.getOriginalNode(sf);
|
|
30116
30184
|
let transforms = null;
|
|
30117
30185
|
if (this.ivyDeclarationTransforms.has(originalSf)) {
|
|
30118
30186
|
transforms = [];
|
|
@@ -30125,7 +30193,7 @@ function declarationTransformFactory(transformRegistry, reflector, refEmitter, i
|
|
|
30125
30193
|
return (context) => {
|
|
30126
30194
|
const transformer = new DtsTransformer(context, reflector, refEmitter, importRewriter, importPrefix);
|
|
30127
30195
|
return (fileOrBundle) => {
|
|
30128
|
-
if (
|
|
30196
|
+
if (import_typescript46.default.isBundle(fileOrBundle)) {
|
|
30129
30197
|
return fileOrBundle;
|
|
30130
30198
|
}
|
|
30131
30199
|
const transforms = transformRegistry.getAllTransforms(fileOrBundle);
|
|
@@ -30147,15 +30215,15 @@ var DtsTransformer = class {
|
|
|
30147
30215
|
transform(sf, transforms) {
|
|
30148
30216
|
const imports = new ImportManager(this.importRewriter, this.importPrefix);
|
|
30149
30217
|
const visitor = (node) => {
|
|
30150
|
-
if (
|
|
30218
|
+
if (import_typescript46.default.isClassDeclaration(node)) {
|
|
30151
30219
|
return this.transformClassDeclaration(node, transforms, imports);
|
|
30152
|
-
} else if (
|
|
30220
|
+
} else if (import_typescript46.default.isFunctionDeclaration(node)) {
|
|
30153
30221
|
return this.transformFunctionDeclaration(node, transforms, imports);
|
|
30154
30222
|
} else {
|
|
30155
|
-
return
|
|
30223
|
+
return import_typescript46.default.visitEachChild(node, visitor, this.ctx);
|
|
30156
30224
|
}
|
|
30157
30225
|
};
|
|
30158
|
-
sf =
|
|
30226
|
+
sf = import_typescript46.default.visitNode(sf, visitor, import_typescript46.default.isSourceFile) || sf;
|
|
30159
30227
|
return addImports(imports, sf);
|
|
30160
30228
|
}
|
|
30161
30229
|
transformClassDeclaration(clazz, transforms, imports) {
|
|
@@ -30183,7 +30251,7 @@ var DtsTransformer = class {
|
|
|
30183
30251
|
}
|
|
30184
30252
|
}
|
|
30185
30253
|
if (elementsChanged && clazz === newClazz) {
|
|
30186
|
-
newClazz =
|
|
30254
|
+
newClazz = import_typescript46.default.factory.updateClassDeclaration(
|
|
30187
30255
|
clazz,
|
|
30188
30256
|
clazz.modifiers,
|
|
30189
30257
|
clazz.name,
|
|
@@ -30212,16 +30280,16 @@ var IvyDeclarationDtsTransform = class {
|
|
|
30212
30280
|
this.declarationFields.set(decl, fields);
|
|
30213
30281
|
}
|
|
30214
30282
|
transformClass(clazz, members, reflector, refEmitter, imports) {
|
|
30215
|
-
const original =
|
|
30283
|
+
const original = import_typescript46.default.getOriginalNode(clazz);
|
|
30216
30284
|
if (!this.declarationFields.has(original)) {
|
|
30217
30285
|
return clazz;
|
|
30218
30286
|
}
|
|
30219
30287
|
const fields = this.declarationFields.get(original);
|
|
30220
30288
|
const newMembers = fields.map((decl) => {
|
|
30221
|
-
const modifiers = [
|
|
30289
|
+
const modifiers = [import_typescript46.default.factory.createModifier(import_typescript46.default.SyntaxKind.StaticKeyword)];
|
|
30222
30290
|
const typeRef = translateType(decl.type, original.getSourceFile(), reflector, refEmitter, imports);
|
|
30223
30291
|
markForEmitAsSingleLine(typeRef);
|
|
30224
|
-
return
|
|
30292
|
+
return import_typescript46.default.factory.createPropertyDeclaration(
|
|
30225
30293
|
modifiers,
|
|
30226
30294
|
decl.name,
|
|
30227
30295
|
void 0,
|
|
@@ -30229,7 +30297,7 @@ var IvyDeclarationDtsTransform = class {
|
|
|
30229
30297
|
void 0
|
|
30230
30298
|
);
|
|
30231
30299
|
});
|
|
30232
|
-
return
|
|
30300
|
+
return import_typescript46.default.factory.updateClassDeclaration(
|
|
30233
30301
|
clazz,
|
|
30234
30302
|
clazz.modifiers,
|
|
30235
30303
|
clazz.name,
|
|
@@ -30240,15 +30308,15 @@ var IvyDeclarationDtsTransform = class {
|
|
|
30240
30308
|
}
|
|
30241
30309
|
};
|
|
30242
30310
|
function markForEmitAsSingleLine(node) {
|
|
30243
|
-
|
|
30244
|
-
|
|
30311
|
+
import_typescript46.default.setEmitFlags(node, import_typescript46.default.EmitFlags.SingleLine);
|
|
30312
|
+
import_typescript46.default.forEachChild(node, markForEmitAsSingleLine);
|
|
30245
30313
|
}
|
|
30246
30314
|
|
|
30247
30315
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
30248
|
-
var
|
|
30316
|
+
var import_typescript48 = __toESM(require("typescript"), 1);
|
|
30249
30317
|
|
|
30250
30318
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
|
|
30251
|
-
var
|
|
30319
|
+
var import_typescript47 = __toESM(require("typescript"), 1);
|
|
30252
30320
|
function visit(node, visitor, context) {
|
|
30253
30321
|
return visitor._visit(node, context);
|
|
30254
30322
|
}
|
|
@@ -30272,13 +30340,13 @@ var Visitor = class {
|
|
|
30272
30340
|
}
|
|
30273
30341
|
_visit(node, context) {
|
|
30274
30342
|
let visitedNode = null;
|
|
30275
|
-
node =
|
|
30276
|
-
if (
|
|
30343
|
+
node = import_typescript47.default.visitEachChild(node, (child) => child && this._visit(child, context), context);
|
|
30344
|
+
if (import_typescript47.default.isClassDeclaration(node)) {
|
|
30277
30345
|
visitedNode = this._visitListEntryNode(node, (node2) => this.visitClassDeclaration(node2));
|
|
30278
30346
|
} else {
|
|
30279
30347
|
visitedNode = this.visitOtherNode(node);
|
|
30280
30348
|
}
|
|
30281
|
-
if (visitedNode && (
|
|
30349
|
+
if (visitedNode && (import_typescript47.default.isBlock(visitedNode) || import_typescript47.default.isSourceFile(visitedNode))) {
|
|
30282
30350
|
visitedNode = this._maybeProcessStatements(visitedNode);
|
|
30283
30351
|
}
|
|
30284
30352
|
return visitedNode;
|
|
@@ -30299,11 +30367,11 @@ var Visitor = class {
|
|
|
30299
30367
|
this._after.delete(stmt);
|
|
30300
30368
|
}
|
|
30301
30369
|
});
|
|
30302
|
-
const statementsArray =
|
|
30303
|
-
if (
|
|
30304
|
-
return
|
|
30370
|
+
const statementsArray = import_typescript47.default.factory.createNodeArray(newStatements, node.statements.hasTrailingComma);
|
|
30371
|
+
if (import_typescript47.default.isBlock(node)) {
|
|
30372
|
+
return import_typescript47.default.factory.updateBlock(node, statementsArray);
|
|
30305
30373
|
} else {
|
|
30306
|
-
return
|
|
30374
|
+
return import_typescript47.default.factory.updateSourceFile(node, statementsArray, node.isDeclarationFile, node.referencedFiles, node.typeReferenceDirectives, node.hasNoDefaultLib, node.libReferenceDirectives);
|
|
30307
30375
|
}
|
|
30308
30376
|
}
|
|
30309
30377
|
};
|
|
@@ -30367,11 +30435,11 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
30367
30435
|
continue;
|
|
30368
30436
|
}
|
|
30369
30437
|
const exprNode = translateExpression(field.initializer, this.importManager, translateOptions);
|
|
30370
|
-
const property2 =
|
|
30438
|
+
const property2 = import_typescript48.default.factory.createPropertyDeclaration([import_typescript48.default.factory.createToken(import_typescript48.default.SyntaxKind.StaticKeyword)], field.name, void 0, void 0, exprNode);
|
|
30371
30439
|
if (this.isClosureCompilerEnabled) {
|
|
30372
|
-
|
|
30440
|
+
import_typescript48.default.addSyntheticLeadingComment(
|
|
30373
30441
|
property2,
|
|
30374
|
-
|
|
30442
|
+
import_typescript48.default.SyntaxKind.MultiLineCommentTrivia,
|
|
30375
30443
|
"* @nocollapse ",
|
|
30376
30444
|
false
|
|
30377
30445
|
);
|
|
@@ -30379,13 +30447,13 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
30379
30447
|
field.statements.map((stmt) => translateStatement(stmt, this.importManager, translateOptions)).forEach((stmt) => statements.push(stmt));
|
|
30380
30448
|
members.push(property2);
|
|
30381
30449
|
}
|
|
30382
|
-
const filteredDecorators = maybeFilterDecorator(
|
|
30383
|
-
const nodeModifiers =
|
|
30450
|
+
const filteredDecorators = maybeFilterDecorator(import_typescript48.default.getDecorators(node), this.compilation.decoratorsFor(node));
|
|
30451
|
+
const nodeModifiers = import_typescript48.default.getModifiers(node);
|
|
30384
30452
|
let updatedModifiers;
|
|
30385
30453
|
if ((filteredDecorators == null ? void 0 : filteredDecorators.length) || (nodeModifiers == null ? void 0 : nodeModifiers.length)) {
|
|
30386
30454
|
updatedModifiers = [...filteredDecorators || [], ...nodeModifiers || []];
|
|
30387
30455
|
}
|
|
30388
|
-
node =
|
|
30456
|
+
node = import_typescript48.default.factory.updateClassDeclaration(
|
|
30389
30457
|
node,
|
|
30390
30458
|
updatedModifiers,
|
|
30391
30459
|
node.name,
|
|
@@ -30396,7 +30464,7 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
30396
30464
|
return { node, after: statements };
|
|
30397
30465
|
}
|
|
30398
30466
|
visitOtherNode(node) {
|
|
30399
|
-
if (
|
|
30467
|
+
if (import_typescript48.default.isImportDeclaration(node) && this.deferrableImports.has(node)) {
|
|
30400
30468
|
return null;
|
|
30401
30469
|
}
|
|
30402
30470
|
return node;
|
|
@@ -30414,7 +30482,7 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
30414
30482
|
}
|
|
30415
30483
|
}
|
|
30416
30484
|
_nonCoreDecoratorsOnly(node) {
|
|
30417
|
-
const decorators =
|
|
30485
|
+
const decorators = import_typescript48.default.getDecorators(node);
|
|
30418
30486
|
if (decorators === void 0) {
|
|
30419
30487
|
return void 0;
|
|
30420
30488
|
}
|
|
@@ -30431,22 +30499,22 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
30431
30499
|
return nodeArrayFromDecoratorsArray(filtered);
|
|
30432
30500
|
}
|
|
30433
30501
|
_stripAngularDecorators(node) {
|
|
30434
|
-
const modifiers =
|
|
30435
|
-
const nonCoreDecorators =
|
|
30502
|
+
const modifiers = import_typescript48.default.canHaveModifiers(node) ? import_typescript48.default.getModifiers(node) : void 0;
|
|
30503
|
+
const nonCoreDecorators = import_typescript48.default.canHaveDecorators(node) ? this._nonCoreDecoratorsOnly(node) : void 0;
|
|
30436
30504
|
const combinedModifiers = [...nonCoreDecorators || [], ...modifiers || []];
|
|
30437
|
-
if (
|
|
30438
|
-
node =
|
|
30439
|
-
} else if (
|
|
30440
|
-
node =
|
|
30441
|
-
} else if (
|
|
30442
|
-
node =
|
|
30443
|
-
} else if (
|
|
30444
|
-
node =
|
|
30445
|
-
} else if (
|
|
30446
|
-
node =
|
|
30447
|
-
} else if (
|
|
30505
|
+
if (import_typescript48.default.isParameter(node)) {
|
|
30506
|
+
node = import_typescript48.default.factory.updateParameterDeclaration(node, combinedModifiers, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer);
|
|
30507
|
+
} else if (import_typescript48.default.isMethodDeclaration(node)) {
|
|
30508
|
+
node = import_typescript48.default.factory.updateMethodDeclaration(node, combinedModifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body);
|
|
30509
|
+
} else if (import_typescript48.default.isPropertyDeclaration(node)) {
|
|
30510
|
+
node = import_typescript48.default.factory.updatePropertyDeclaration(node, combinedModifiers, node.name, node.questionToken, node.type, node.initializer);
|
|
30511
|
+
} else if (import_typescript48.default.isGetAccessor(node)) {
|
|
30512
|
+
node = import_typescript48.default.factory.updateGetAccessorDeclaration(node, combinedModifiers, node.name, node.parameters, node.type, node.body);
|
|
30513
|
+
} else if (import_typescript48.default.isSetAccessor(node)) {
|
|
30514
|
+
node = import_typescript48.default.factory.updateSetAccessorDeclaration(node, combinedModifiers, node.name, node.parameters, node.body);
|
|
30515
|
+
} else if (import_typescript48.default.isConstructorDeclaration(node)) {
|
|
30448
30516
|
const parameters = node.parameters.map((param) => this._stripAngularDecorators(param));
|
|
30449
|
-
node =
|
|
30517
|
+
node = import_typescript48.default.factory.updateConstructorDeclaration(node, modifiers, parameters, node.body);
|
|
30450
30518
|
}
|
|
30451
30519
|
return node;
|
|
30452
30520
|
}
|
|
@@ -30458,7 +30526,7 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
30458
30526
|
visit(file, compilationVisitor, context);
|
|
30459
30527
|
const transformationVisitor = new IvyTransformationVisitor(compilation, compilationVisitor.classCompilationMap, reflector, importManager, recordWrappedNode, isClosureCompilerEnabled, isCore, compilationVisitor.deferrableImports);
|
|
30460
30528
|
let sf = visit(file, transformationVisitor, context);
|
|
30461
|
-
const downlevelTranslatedCode = getLocalizeCompileTarget(context) <
|
|
30529
|
+
const downlevelTranslatedCode = getLocalizeCompileTarget(context) < import_typescript48.default.ScriptTarget.ES2015;
|
|
30462
30530
|
const constants = constantPool.statements.map((stmt) => translateStatement(stmt, importManager, {
|
|
30463
30531
|
recordWrappedNode,
|
|
30464
30532
|
downlevelTaggedTemplates: downlevelTranslatedCode,
|
|
@@ -30473,17 +30541,17 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
30473
30541
|
return sf;
|
|
30474
30542
|
}
|
|
30475
30543
|
function getLocalizeCompileTarget(context) {
|
|
30476
|
-
const target = context.getCompilerOptions().target ||
|
|
30477
|
-
return target !==
|
|
30544
|
+
const target = context.getCompilerOptions().target || import_typescript48.default.ScriptTarget.ES2015;
|
|
30545
|
+
return target !== import_typescript48.default.ScriptTarget.JSON ? target : import_typescript48.default.ScriptTarget.ES2015;
|
|
30478
30546
|
}
|
|
30479
30547
|
function getFileOverviewComment(statements) {
|
|
30480
30548
|
if (statements.length > 0) {
|
|
30481
30549
|
const host = statements[0];
|
|
30482
30550
|
let trailing = false;
|
|
30483
|
-
let comments =
|
|
30551
|
+
let comments = import_typescript48.default.getSyntheticLeadingComments(host);
|
|
30484
30552
|
if (!comments || comments.length === 0) {
|
|
30485
30553
|
trailing = true;
|
|
30486
|
-
comments =
|
|
30554
|
+
comments = import_typescript48.default.getSyntheticTrailingComments(host);
|
|
30487
30555
|
}
|
|
30488
30556
|
if (comments && comments.length > 0 && CLOSURE_FILE_OVERVIEW_REGEXP.test(comments[0].text)) {
|
|
30489
30557
|
return { comments, host, trailing };
|
|
@@ -30495,22 +30563,22 @@ function setFileOverviewComment(sf, fileoverview) {
|
|
|
30495
30563
|
const { comments, host, trailing } = fileoverview;
|
|
30496
30564
|
if (sf.statements.length > 0 && host !== sf.statements[0]) {
|
|
30497
30565
|
if (trailing) {
|
|
30498
|
-
|
|
30566
|
+
import_typescript48.default.setSyntheticTrailingComments(host, void 0);
|
|
30499
30567
|
} else {
|
|
30500
|
-
|
|
30568
|
+
import_typescript48.default.setSyntheticLeadingComments(host, void 0);
|
|
30501
30569
|
}
|
|
30502
|
-
|
|
30570
|
+
import_typescript48.default.setSyntheticLeadingComments(sf.statements[0], comments);
|
|
30503
30571
|
}
|
|
30504
30572
|
}
|
|
30505
30573
|
function maybeFilterDecorator(decorators, toRemove) {
|
|
30506
30574
|
if (decorators === void 0) {
|
|
30507
30575
|
return void 0;
|
|
30508
30576
|
}
|
|
30509
|
-
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) =>
|
|
30577
|
+
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) => import_typescript48.default.getOriginalNode(dec) === decToRemove) === void 0);
|
|
30510
30578
|
if (filtered.length === 0) {
|
|
30511
30579
|
return void 0;
|
|
30512
30580
|
}
|
|
30513
|
-
return
|
|
30581
|
+
return import_typescript48.default.factory.createNodeArray(filtered);
|
|
30514
30582
|
}
|
|
30515
30583
|
function isFromAngularCore(decorator) {
|
|
30516
30584
|
return decorator.import !== null && decorator.import.from === "@angular/core";
|
|
@@ -30524,7 +30592,7 @@ function createRecorderFn(defaultImportTracker) {
|
|
|
30524
30592
|
};
|
|
30525
30593
|
}
|
|
30526
30594
|
function nodeArrayFromDecoratorsArray(decorators) {
|
|
30527
|
-
const array =
|
|
30595
|
+
const array = import_typescript48.default.factory.createNodeArray(decorators);
|
|
30528
30596
|
if (array.length > 0) {
|
|
30529
30597
|
array.pos = decorators[0].pos;
|
|
30530
30598
|
array.end = decorators[decorators.length - 1].end;
|
|
@@ -30533,7 +30601,7 @@ function nodeArrayFromDecoratorsArray(decorators) {
|
|
|
30533
30601
|
}
|
|
30534
30602
|
|
|
30535
30603
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.mjs
|
|
30536
|
-
var
|
|
30604
|
+
var import_typescript49 = __toESM(require("typescript"), 1);
|
|
30537
30605
|
var EMPTY_OBJECT = {};
|
|
30538
30606
|
var QUERY_TYPES = /* @__PURE__ */ new Set([
|
|
30539
30607
|
"ContentChild",
|
|
@@ -30549,7 +30617,7 @@ function extractDirectiveMetadata(clazz, decorator, reflector, evaluator, refEmi
|
|
|
30549
30617
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, decorator.node, `Incorrect number of arguments to @${decorator.name} decorator`);
|
|
30550
30618
|
} else {
|
|
30551
30619
|
const meta = unwrapExpression(decorator.args[0]);
|
|
30552
|
-
if (!
|
|
30620
|
+
if (!import_typescript49.default.isObjectLiteralExpression(meta)) {
|
|
30553
30621
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `@${decorator.name} argument must be an object literal`);
|
|
30554
30622
|
}
|
|
30555
30623
|
directive = reflectObjectLiteral(meta);
|
|
@@ -30687,7 +30755,7 @@ function extractQueryMetadata(exprNode, name, args, propertyName, reflector, eva
|
|
|
30687
30755
|
let emitDistinctChangesOnly = emitDistinctChangesOnlyDefaultValue;
|
|
30688
30756
|
if (args.length === 2) {
|
|
30689
30757
|
const optionsExpr = unwrapExpression(args[1]);
|
|
30690
|
-
if (!
|
|
30758
|
+
if (!import_typescript49.default.isObjectLiteralExpression(optionsExpr)) {
|
|
30691
30759
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, optionsExpr, `@${name} options must be an object literal`);
|
|
30692
30760
|
}
|
|
30693
30761
|
const options = reflectObjectLiteral(optionsExpr);
|
|
@@ -30782,16 +30850,16 @@ function extractHostBindings2(members, evaluator, coreModule, metadata) {
|
|
|
30782
30850
|
}
|
|
30783
30851
|
function extractQueriesFromDecorator(queryData, reflector, evaluator, isCore) {
|
|
30784
30852
|
const content = [], view = [];
|
|
30785
|
-
if (!
|
|
30853
|
+
if (!import_typescript49.default.isObjectLiteralExpression(queryData)) {
|
|
30786
30854
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator queries metadata must be an object literal");
|
|
30787
30855
|
}
|
|
30788
30856
|
reflectObjectLiteral(queryData).forEach((queryExpr, propertyName) => {
|
|
30789
30857
|
queryExpr = unwrapExpression(queryExpr);
|
|
30790
|
-
if (!
|
|
30858
|
+
if (!import_typescript49.default.isNewExpression(queryExpr)) {
|
|
30791
30859
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
30792
30860
|
}
|
|
30793
|
-
const queryType =
|
|
30794
|
-
if (!
|
|
30861
|
+
const queryType = import_typescript49.default.isPropertyAccessExpression(queryExpr.expression) ? queryExpr.expression.name : queryExpr.expression;
|
|
30862
|
+
if (!import_typescript49.default.isIdentifier(queryType)) {
|
|
30795
30863
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
30796
30864
|
}
|
|
30797
30865
|
const type = reflector.getImportOfIdentifier(queryType);
|
|
@@ -30973,7 +31041,10 @@ function parseInputTransformFunction(clazz, classPropertyName, value, reflector,
|
|
|
30973
31041
|
}
|
|
30974
31042
|
const firstParam = ((_a2 = definition.parameters[0]) == null ? void 0 : _a2.name) === "this" ? definition.parameters[1] : definition.parameters[0];
|
|
30975
31043
|
if (!firstParam) {
|
|
30976
|
-
return {
|
|
31044
|
+
return {
|
|
31045
|
+
node,
|
|
31046
|
+
type: new Reference2(import_typescript49.default.factory.createKeywordTypeNode(import_typescript49.default.SyntaxKind.UnknownKeyword))
|
|
31047
|
+
};
|
|
30977
31048
|
}
|
|
30978
31049
|
if (!firstParam.type) {
|
|
30979
31050
|
throw createValueHasWrongTypeError(value.node, value, "Input transform function first parameter must have a type");
|
|
@@ -30982,11 +31053,12 @@ function parseInputTransformFunction(clazz, classPropertyName, value, reflector,
|
|
|
30982
31053
|
throw createValueHasWrongTypeError(value.node, value, "Input transform function first parameter cannot be a spread parameter");
|
|
30983
31054
|
}
|
|
30984
31055
|
assertEmittableInputType(firstParam.type, clazz.getSourceFile(), reflector, refEmitter);
|
|
30985
|
-
|
|
31056
|
+
const viaModule = value instanceof Reference2 ? value.bestGuessOwningModule : null;
|
|
31057
|
+
return { node, type: new Reference2(firstParam.type, viaModule) };
|
|
30986
31058
|
}
|
|
30987
31059
|
function assertEmittableInputType(type, contextFile, reflector, refEmitter) {
|
|
30988
31060
|
(function walk(node) {
|
|
30989
|
-
if (
|
|
31061
|
+
if (import_typescript49.default.isTypeReferenceNode(node) && import_typescript49.default.isIdentifier(node.typeName)) {
|
|
30990
31062
|
const declaration = reflector.getDeclarationOfIdentifier(node.typeName);
|
|
30991
31063
|
if (declaration !== null) {
|
|
30992
31064
|
if (declaration.node.getSourceFile() !== contextFile) {
|
|
@@ -31347,16 +31419,16 @@ var DirectiveDecoratorHandler = class {
|
|
|
31347
31419
|
};
|
|
31348
31420
|
|
|
31349
31421
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.mjs
|
|
31350
|
-
var
|
|
31422
|
+
var import_typescript51 = __toESM(require("typescript"), 1);
|
|
31351
31423
|
|
|
31352
31424
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/module_with_providers.mjs
|
|
31353
|
-
var
|
|
31425
|
+
var import_typescript50 = __toESM(require("typescript"), 1);
|
|
31354
31426
|
function createModuleWithProvidersResolver(reflector, isCore) {
|
|
31355
31427
|
function _reflectModuleFromTypeParam(type, node) {
|
|
31356
|
-
if (!
|
|
31428
|
+
if (!import_typescript50.default.isTypeReferenceNode(type)) {
|
|
31357
31429
|
return null;
|
|
31358
31430
|
}
|
|
31359
|
-
const typeName = type && (
|
|
31431
|
+
const typeName = type && (import_typescript50.default.isIdentifier(type.typeName) && type.typeName || import_typescript50.default.isQualifiedName(type.typeName) && type.typeName.right) || null;
|
|
31360
31432
|
if (typeName === null) {
|
|
31361
31433
|
return null;
|
|
31362
31434
|
}
|
|
@@ -31368,7 +31440,7 @@ function createModuleWithProvidersResolver(reflector, isCore) {
|
|
|
31368
31440
|
return null;
|
|
31369
31441
|
}
|
|
31370
31442
|
if (type.typeArguments === void 0 || type.typeArguments.length !== 1) {
|
|
31371
|
-
const parent =
|
|
31443
|
+
const parent = import_typescript50.default.isMethodDeclaration(node) && import_typescript50.default.isClassDeclaration(node.parent) ? node.parent : null;
|
|
31372
31444
|
const symbolName = (parent && parent.name ? parent.name.getText() + "." : "") + (node.name ? node.name.getText() : "anonymous");
|
|
31373
31445
|
throw new FatalDiagnosticError(ErrorCode.NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC, type, `${symbolName} returns a ModuleWithProviders type without a generic type argument. Please add a generic type argument to the ModuleWithProviders type. If this occurrence is in library code you don't control, please contact the library authors.`);
|
|
31374
31446
|
}
|
|
@@ -31376,13 +31448,13 @@ function createModuleWithProvidersResolver(reflector, isCore) {
|
|
|
31376
31448
|
return typeNodeToValueExpr(arg);
|
|
31377
31449
|
}
|
|
31378
31450
|
function _reflectModuleFromLiteralType(type) {
|
|
31379
|
-
if (!
|
|
31451
|
+
if (!import_typescript50.default.isIntersectionTypeNode(type)) {
|
|
31380
31452
|
return null;
|
|
31381
31453
|
}
|
|
31382
31454
|
for (const t of type.types) {
|
|
31383
|
-
if (
|
|
31455
|
+
if (import_typescript50.default.isTypeLiteralNode(t)) {
|
|
31384
31456
|
for (const m of t.members) {
|
|
31385
|
-
const ngModuleType =
|
|
31457
|
+
const ngModuleType = import_typescript50.default.isPropertySignature(m) && import_typescript50.default.isIdentifier(m.name) && m.name.text === "ngModule" && m.type || null;
|
|
31386
31458
|
const ngModuleExpression = ngModuleType && typeNodeToValueExpr(ngModuleType);
|
|
31387
31459
|
if (ngModuleExpression) {
|
|
31388
31460
|
return ngModuleExpression;
|
|
@@ -31526,8 +31598,8 @@ var NgModuleDecoratorHandler = class {
|
|
|
31526
31598
|
if (decorator.args === null || decorator.args.length > 1) {
|
|
31527
31599
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, decorator.node, `Incorrect number of arguments to @NgModule decorator`);
|
|
31528
31600
|
}
|
|
31529
|
-
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) :
|
|
31530
|
-
if (!
|
|
31601
|
+
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) : import_typescript51.default.factory.createObjectLiteralExpression([]);
|
|
31602
|
+
if (!import_typescript51.default.isObjectLiteralExpression(meta)) {
|
|
31531
31603
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@NgModule argument must be an object literal");
|
|
31532
31604
|
}
|
|
31533
31605
|
const ngModule = reflectObjectLiteral(meta);
|
|
@@ -31587,7 +31659,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
31587
31659
|
id = new WrappedNodeExpr(idExpr);
|
|
31588
31660
|
} else {
|
|
31589
31661
|
const diag = makeDiagnostic(ErrorCode.WARN_NGMODULE_ID_UNNECESSARY, idExpr, `Using 'module.id' for NgModule.id is a common anti-pattern that is ignored by the Angular compiler.`);
|
|
31590
|
-
diag.category =
|
|
31662
|
+
diag.category = import_typescript51.default.DiagnosticCategory.Warning;
|
|
31591
31663
|
diagnostics.push(diag);
|
|
31592
31664
|
}
|
|
31593
31665
|
}
|
|
@@ -31639,16 +31711,16 @@ var NgModuleDecoratorHandler = class {
|
|
|
31639
31711
|
}
|
|
31640
31712
|
const rawProviders = ngModule.has("providers") ? ngModule.get("providers") : null;
|
|
31641
31713
|
let wrappedProviders = null;
|
|
31642
|
-
if (rawProviders !== null && (!
|
|
31714
|
+
if (rawProviders !== null && (!import_typescript51.default.isArrayLiteralExpression(rawProviders) || rawProviders.elements.length > 0)) {
|
|
31643
31715
|
wrappedProviders = new WrappedNodeExpr(this.annotateForClosureCompiler ? wrapFunctionExpressionsInParens(rawProviders) : rawProviders);
|
|
31644
31716
|
}
|
|
31645
31717
|
const topLevelImports = [];
|
|
31646
31718
|
if (this.compilationMode !== CompilationMode.LOCAL && ngModule.has("imports")) {
|
|
31647
31719
|
const rawImports2 = unwrapExpression(ngModule.get("imports"));
|
|
31648
31720
|
let topLevelExpressions = [];
|
|
31649
|
-
if (
|
|
31721
|
+
if (import_typescript51.default.isArrayLiteralExpression(rawImports2)) {
|
|
31650
31722
|
for (const element2 of rawImports2.elements) {
|
|
31651
|
-
if (
|
|
31723
|
+
if (import_typescript51.default.isSpreadElement(element2)) {
|
|
31652
31724
|
topLevelExpressions.push(element2.expression);
|
|
31653
31725
|
continue;
|
|
31654
31726
|
}
|
|
@@ -31956,7 +32028,7 @@ function isNgModule(node, compilation) {
|
|
|
31956
32028
|
return !compilation.dependencies.some((dep) => dep.ref.node === node);
|
|
31957
32029
|
}
|
|
31958
32030
|
function isModuleIdExpression(expr) {
|
|
31959
|
-
return
|
|
32031
|
+
return import_typescript51.default.isPropertyAccessExpression(expr) && import_typescript51.default.isIdentifier(expr.expression) && expr.expression.text === "module" && expr.name.text === "id";
|
|
31960
32032
|
}
|
|
31961
32033
|
function makeStandaloneBootstrapDiagnostic(ngModuleClass, bootstrappedClassRef, rawBootstrapExpr) {
|
|
31962
32034
|
const componentClassName = bootstrappedClassRef.node.name.text;
|
|
@@ -31992,7 +32064,7 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
31992
32064
|
}
|
|
31993
32065
|
|
|
31994
32066
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/resources.mjs
|
|
31995
|
-
var
|
|
32067
|
+
var import_typescript53 = __toESM(require("typescript"), 1);
|
|
31996
32068
|
function getTemplateDeclarationNodeForError(declaration) {
|
|
31997
32069
|
return declaration.isInline ? declaration.expression : declaration.templateUrlExpression;
|
|
31998
32070
|
}
|
|
@@ -32004,7 +32076,7 @@ function extractTemplate(node, template2, evaluator, depTracker, resourceLoader,
|
|
|
32004
32076
|
let sourceMapping;
|
|
32005
32077
|
let escapedString = false;
|
|
32006
32078
|
let sourceMapUrl;
|
|
32007
|
-
if (
|
|
32079
|
+
if (import_typescript53.default.isStringLiteral(template2.expression) || import_typescript53.default.isNoSubstitutionTemplateLiteral(template2.expression)) {
|
|
32008
32080
|
sourceParseRange = getTemplateRange(template2.expression);
|
|
32009
32081
|
sourceStr = template2.expression.getSourceFile().text;
|
|
32010
32082
|
templateContent = template2.expression.text;
|
|
@@ -32176,7 +32248,7 @@ function preloadAndParseTemplate(evaluator, resourceLoader, depTracker, preanaly
|
|
|
32176
32248
|
}
|
|
32177
32249
|
function getTemplateRange(templateExpr) {
|
|
32178
32250
|
const startPos = templateExpr.getStart() + 1;
|
|
32179
|
-
const { line, character } =
|
|
32251
|
+
const { line, character } = import_typescript53.default.getLineAndCharacterOfPosition(templateExpr.getSourceFile(), startPos);
|
|
32180
32252
|
return {
|
|
32181
32253
|
startPos,
|
|
32182
32254
|
startLine: line,
|
|
@@ -32209,7 +32281,7 @@ function transformDecoratorResources(dec, component, styles, template2) {
|
|
|
32209
32281
|
const metadata = new Map(component);
|
|
32210
32282
|
if (metadata.has("templateUrl")) {
|
|
32211
32283
|
metadata.delete("templateUrl");
|
|
32212
|
-
metadata.set("template",
|
|
32284
|
+
metadata.set("template", import_typescript53.default.factory.createStringLiteral(template2.content));
|
|
32213
32285
|
}
|
|
32214
32286
|
if (metadata.has("styleUrls") || metadata.has("styles")) {
|
|
32215
32287
|
metadata.delete("styles");
|
|
@@ -32217,20 +32289,20 @@ function transformDecoratorResources(dec, component, styles, template2) {
|
|
|
32217
32289
|
if (styles.length > 0) {
|
|
32218
32290
|
const styleNodes = styles.reduce((result, style) => {
|
|
32219
32291
|
if (style.trim().length > 0) {
|
|
32220
|
-
result.push(
|
|
32292
|
+
result.push(import_typescript53.default.factory.createStringLiteral(style));
|
|
32221
32293
|
}
|
|
32222
32294
|
return result;
|
|
32223
32295
|
}, []);
|
|
32224
32296
|
if (styleNodes.length > 0) {
|
|
32225
|
-
metadata.set("styles",
|
|
32297
|
+
metadata.set("styles", import_typescript53.default.factory.createArrayLiteralExpression(styleNodes));
|
|
32226
32298
|
}
|
|
32227
32299
|
}
|
|
32228
32300
|
}
|
|
32229
32301
|
const newMetadataFields = [];
|
|
32230
32302
|
for (const [name, value] of metadata.entries()) {
|
|
32231
|
-
newMetadataFields.push(
|
|
32303
|
+
newMetadataFields.push(import_typescript53.default.factory.createPropertyAssignment(name, value));
|
|
32232
32304
|
}
|
|
32233
|
-
return __spreadProps(__spreadValues({}, dec), { args: [
|
|
32305
|
+
return __spreadProps(__spreadValues({}, dec), { args: [import_typescript53.default.factory.createObjectLiteralExpression(newMetadataFields)] });
|
|
32234
32306
|
}
|
|
32235
32307
|
function extractComponentStyleUrls(evaluator, component) {
|
|
32236
32308
|
if (!component.has("styleUrls")) {
|
|
@@ -32240,9 +32312,9 @@ function extractComponentStyleUrls(evaluator, component) {
|
|
|
32240
32312
|
}
|
|
32241
32313
|
function extractStyleUrlsFromExpression(evaluator, styleUrlsExpr) {
|
|
32242
32314
|
const styleUrls = [];
|
|
32243
|
-
if (
|
|
32315
|
+
if (import_typescript53.default.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
32244
32316
|
for (const styleUrlExpr of styleUrlsExpr.elements) {
|
|
32245
|
-
if (
|
|
32317
|
+
if (import_typescript53.default.isSpreadElement(styleUrlExpr)) {
|
|
32246
32318
|
styleUrls.push(...extractStyleUrlsFromExpression(evaluator, styleUrlExpr.expression));
|
|
32247
32319
|
} else {
|
|
32248
32320
|
const styleUrl = evaluator.evaluate(styleUrlExpr);
|
|
@@ -32274,10 +32346,10 @@ function extractStyleUrlsFromExpression(evaluator, styleUrlsExpr) {
|
|
|
32274
32346
|
function extractStyleResources(resourceLoader, component, containingFile) {
|
|
32275
32347
|
const styles = /* @__PURE__ */ new Set();
|
|
32276
32348
|
function stringLiteralElements(array) {
|
|
32277
|
-
return array.elements.filter((e) =>
|
|
32349
|
+
return array.elements.filter((e) => import_typescript53.default.isStringLiteralLike(e));
|
|
32278
32350
|
}
|
|
32279
32351
|
const styleUrlsExpr = component.get("styleUrls");
|
|
32280
|
-
if (styleUrlsExpr !== void 0 &&
|
|
32352
|
+
if (styleUrlsExpr !== void 0 && import_typescript53.default.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
32281
32353
|
for (const expression of stringLiteralElements(styleUrlsExpr)) {
|
|
32282
32354
|
try {
|
|
32283
32355
|
const resourceUrl = resourceLoader.resolve(expression.text, containingFile);
|
|
@@ -32287,7 +32359,7 @@ function extractStyleResources(resourceLoader, component, containingFile) {
|
|
|
32287
32359
|
}
|
|
32288
32360
|
}
|
|
32289
32361
|
const stylesExpr = component.get("styles");
|
|
32290
|
-
if (stylesExpr !== void 0 &&
|
|
32362
|
+
if (stylesExpr !== void 0 && import_typescript53.default.isArrayLiteralExpression(stylesExpr)) {
|
|
32291
32363
|
for (const expression of stringLiteralElements(stylesExpr)) {
|
|
32292
32364
|
styles.add({ path: null, expression });
|
|
32293
32365
|
}
|
|
@@ -32785,7 +32857,7 @@ var ComponentDecoratorHandler = class {
|
|
|
32785
32857
|
});
|
|
32786
32858
|
}
|
|
32787
32859
|
typeCheck(ctx, node, meta) {
|
|
32788
|
-
if (this.typeCheckScopeRegistry === null || !
|
|
32860
|
+
if (this.typeCheckScopeRegistry === null || !import_typescript54.default.isClassDeclaration(node)) {
|
|
32789
32861
|
return;
|
|
32790
32862
|
}
|
|
32791
32863
|
if (meta.isPoisoned && !this.usePoisonedData) {
|
|
@@ -33117,9 +33189,9 @@ var ComponentDecoratorHandler = class {
|
|
|
33117
33189
|
}
|
|
33118
33190
|
resolutionData.deferBlocks.set(deferBlock, deps);
|
|
33119
33191
|
}
|
|
33120
|
-
if (analysisData.meta.isStandalone && analysisData.rawImports !== null &&
|
|
33192
|
+
if (analysisData.meta.isStandalone && analysisData.rawImports !== null && import_typescript54.default.isArrayLiteralExpression(analysisData.rawImports)) {
|
|
33121
33193
|
for (const node of analysisData.rawImports.elements) {
|
|
33122
|
-
if (!
|
|
33194
|
+
if (!import_typescript54.default.isIdentifier(node)) {
|
|
33123
33195
|
continue;
|
|
33124
33196
|
}
|
|
33125
33197
|
const imp = this.reflector.getImportOfIdentifier(node);
|
|
@@ -33183,7 +33255,7 @@ function validateStandaloneImports(importRefs, importExpr2, metaReader, scopeRea
|
|
|
33183
33255
|
}
|
|
33184
33256
|
|
|
33185
33257
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
33186
|
-
var
|
|
33258
|
+
var import_typescript56 = __toESM(require("typescript"), 1);
|
|
33187
33259
|
var InjectableDecoratorHandler = class {
|
|
33188
33260
|
constructor(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, perf, includeClassMetadata, errorOnDuplicateProv = true) {
|
|
33189
33261
|
this.reflector = reflector;
|
|
@@ -33296,7 +33368,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
33296
33368
|
};
|
|
33297
33369
|
} else if (decorator.args.length === 1) {
|
|
33298
33370
|
const metaNode = decorator.args[0];
|
|
33299
|
-
if (!
|
|
33371
|
+
if (!import_typescript56.default.isObjectLiteralExpression(metaNode)) {
|
|
33300
33372
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, metaNode, `@Injectable argument must be an object literal`);
|
|
33301
33373
|
}
|
|
33302
33374
|
const meta = reflectObjectLiteral(metaNode);
|
|
@@ -33304,7 +33376,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
33304
33376
|
let deps = void 0;
|
|
33305
33377
|
if ((meta.has("useClass") || meta.has("useFactory")) && meta.has("deps")) {
|
|
33306
33378
|
const depsExpr = meta.get("deps");
|
|
33307
|
-
if (!
|
|
33379
|
+
if (!import_typescript56.default.isArrayLiteralExpression(depsExpr)) {
|
|
33308
33380
|
throw new FatalDiagnosticError(ErrorCode.VALUE_NOT_LITERAL, depsExpr, `@Injectable deps metadata must be an inline array`);
|
|
33309
33381
|
}
|
|
33310
33382
|
deps = depsExpr.elements.map((dep) => getDep(dep, reflector));
|
|
@@ -33389,12 +33461,12 @@ function getDep(dep, reflector) {
|
|
|
33389
33461
|
}
|
|
33390
33462
|
return true;
|
|
33391
33463
|
}
|
|
33392
|
-
if (
|
|
33464
|
+
if (import_typescript56.default.isArrayLiteralExpression(dep)) {
|
|
33393
33465
|
dep.elements.forEach((el) => {
|
|
33394
33466
|
let isDecorator = false;
|
|
33395
|
-
if (
|
|
33467
|
+
if (import_typescript56.default.isIdentifier(el)) {
|
|
33396
33468
|
isDecorator = maybeUpdateDecorator(el, reflector);
|
|
33397
|
-
} else if (
|
|
33469
|
+
} else if (import_typescript56.default.isNewExpression(el) && import_typescript56.default.isIdentifier(el.expression)) {
|
|
33398
33470
|
const token = el.arguments && el.arguments.length > 0 && el.arguments[0] || void 0;
|
|
33399
33471
|
isDecorator = maybeUpdateDecorator(el.expression, reflector, token);
|
|
33400
33472
|
}
|
|
@@ -33407,7 +33479,7 @@ function getDep(dep, reflector) {
|
|
|
33407
33479
|
}
|
|
33408
33480
|
|
|
33409
33481
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
|
|
33410
|
-
var
|
|
33482
|
+
var import_typescript57 = __toESM(require("typescript"), 1);
|
|
33411
33483
|
var PipeSymbol = class extends SemanticSymbol {
|
|
33412
33484
|
constructor(decl, name) {
|
|
33413
33485
|
super(decl);
|
|
@@ -33463,7 +33535,7 @@ var PipeDecoratorHandler = class {
|
|
|
33463
33535
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, decorator.node, "@Pipe must have exactly one argument");
|
|
33464
33536
|
}
|
|
33465
33537
|
const meta = unwrapExpression(decorator.args[0]);
|
|
33466
|
-
if (!
|
|
33538
|
+
if (!import_typescript57.default.isObjectLiteralExpression(meta)) {
|
|
33467
33539
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@Pipe must have a literal argument");
|
|
33468
33540
|
}
|
|
33469
33541
|
const pipe2 = reflectObjectLiteral(meta);
|
|
@@ -33628,7 +33700,7 @@ var Cycle = class {
|
|
|
33628
33700
|
};
|
|
33629
33701
|
|
|
33630
33702
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/imports.mjs
|
|
33631
|
-
var
|
|
33703
|
+
var import_typescript58 = __toESM(require("typescript"), 1);
|
|
33632
33704
|
var ImportGraph = class {
|
|
33633
33705
|
constructor(checker, perf) {
|
|
33634
33706
|
this.checker = checker;
|
|
@@ -33672,10 +33744,10 @@ var ImportGraph = class {
|
|
|
33672
33744
|
return this.perf.inPhase(PerfPhase.CycleDetection, () => {
|
|
33673
33745
|
const imports = /* @__PURE__ */ new Set();
|
|
33674
33746
|
for (const stmt of sf.statements) {
|
|
33675
|
-
if (!
|
|
33747
|
+
if (!import_typescript58.default.isImportDeclaration(stmt) && !import_typescript58.default.isExportDeclaration(stmt) || stmt.moduleSpecifier === void 0) {
|
|
33676
33748
|
continue;
|
|
33677
33749
|
}
|
|
33678
|
-
if (
|
|
33750
|
+
if (import_typescript58.default.isImportDeclaration(stmt) && stmt.importClause !== void 0 && isTypeOnlyImportClause(stmt.importClause)) {
|
|
33679
33751
|
continue;
|
|
33680
33752
|
}
|
|
33681
33753
|
const symbol = this.checker.getSymbolAtLocation(stmt.moduleSpecifier);
|
|
@@ -33683,7 +33755,7 @@ var ImportGraph = class {
|
|
|
33683
33755
|
continue;
|
|
33684
33756
|
}
|
|
33685
33757
|
const moduleFile = symbol.valueDeclaration;
|
|
33686
|
-
if (
|
|
33758
|
+
if (import_typescript58.default.isSourceFile(moduleFile) && isLocalFile(moduleFile)) {
|
|
33687
33759
|
imports.add(moduleFile);
|
|
33688
33760
|
}
|
|
33689
33761
|
}
|
|
@@ -33698,7 +33770,7 @@ function isTypeOnlyImportClause(node) {
|
|
|
33698
33770
|
if (node.isTypeOnly) {
|
|
33699
33771
|
return true;
|
|
33700
33772
|
}
|
|
33701
|
-
if (node.namedBindings !== void 0 &&
|
|
33773
|
+
if (node.namedBindings !== void 0 && import_typescript58.default.isNamedImports(node.namedBindings) && node.namedBindings.elements.every((specifier) => specifier.isTypeOnly)) {
|
|
33702
33774
|
return true;
|
|
33703
33775
|
}
|
|
33704
33776
|
return false;
|
|
@@ -33720,7 +33792,7 @@ var Found = class {
|
|
|
33720
33792
|
};
|
|
33721
33793
|
|
|
33722
33794
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/generator.mjs
|
|
33723
|
-
var
|
|
33795
|
+
var import_typescript59 = __toESM(require("typescript"), 1);
|
|
33724
33796
|
var FlatIndexGenerator = class {
|
|
33725
33797
|
constructor(entryPoint, relativeFlatIndexPath, moduleName) {
|
|
33726
33798
|
this.entryPoint = entryPoint;
|
|
@@ -33736,7 +33808,7 @@ var FlatIndexGenerator = class {
|
|
|
33736
33808
|
|
|
33737
33809
|
export * from '${relativeEntryPoint}';
|
|
33738
33810
|
`;
|
|
33739
|
-
const genFile =
|
|
33811
|
+
const genFile = import_typescript59.default.createSourceFile(this.flatIndexPath, contents, import_typescript59.default.ScriptTarget.ES2015, true, import_typescript59.default.ScriptKind.TS);
|
|
33740
33812
|
if (this.moduleName !== null) {
|
|
33741
33813
|
genFile.moduleName = this.moduleName;
|
|
33742
33814
|
}
|
|
@@ -33761,7 +33833,7 @@ function findFlatIndexEntryPoint(rootFiles) {
|
|
|
33761
33833
|
}
|
|
33762
33834
|
|
|
33763
33835
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/private_export_checker.mjs
|
|
33764
|
-
var
|
|
33836
|
+
var import_typescript61 = __toESM(require("typescript"), 1);
|
|
33765
33837
|
function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
33766
33838
|
const diagnostics = [];
|
|
33767
33839
|
const topLevelExports = /* @__PURE__ */ new Set();
|
|
@@ -33771,7 +33843,7 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
|
33771
33843
|
}
|
|
33772
33844
|
const exportedSymbols = checker.getExportsOfModule(moduleSymbol);
|
|
33773
33845
|
exportedSymbols.forEach((symbol) => {
|
|
33774
|
-
if (symbol.flags &
|
|
33846
|
+
if (symbol.flags & import_typescript61.default.SymbolFlags.Alias) {
|
|
33775
33847
|
symbol = checker.getAliasedSymbol(symbol);
|
|
33776
33848
|
}
|
|
33777
33849
|
const decl = symbol.valueDeclaration;
|
|
@@ -33795,7 +33867,7 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
|
33795
33867
|
visibleVia = transitivePath.map((seg) => getNameOfDeclaration(seg)).join(" -> ");
|
|
33796
33868
|
}
|
|
33797
33869
|
const diagnostic = __spreadProps(__spreadValues({
|
|
33798
|
-
category:
|
|
33870
|
+
category: import_typescript61.default.DiagnosticCategory.Error,
|
|
33799
33871
|
code: ngErrorCode(ErrorCode.SYMBOL_NOT_EXPORTED),
|
|
33800
33872
|
file: transitiveReference.getSourceFile()
|
|
33801
33873
|
}, getPosOfDeclaration(transitiveReference)), {
|
|
@@ -33815,7 +33887,7 @@ function getPosOfDeclaration(decl) {
|
|
|
33815
33887
|
};
|
|
33816
33888
|
}
|
|
33817
33889
|
function getIdentifierOfDeclaration(decl) {
|
|
33818
|
-
if ((
|
|
33890
|
+
if ((import_typescript61.default.isClassDeclaration(decl) || import_typescript61.default.isVariableDeclaration(decl) || import_typescript61.default.isFunctionDeclaration(decl)) && decl.name !== void 0 && import_typescript61.default.isIdentifier(decl.name)) {
|
|
33819
33891
|
return decl.name;
|
|
33820
33892
|
} else {
|
|
33821
33893
|
return null;
|
|
@@ -33827,13 +33899,13 @@ function getNameOfDeclaration(decl) {
|
|
|
33827
33899
|
}
|
|
33828
33900
|
function getDescriptorOfDeclaration(decl) {
|
|
33829
33901
|
switch (decl.kind) {
|
|
33830
|
-
case
|
|
33902
|
+
case import_typescript61.default.SyntaxKind.ClassDeclaration:
|
|
33831
33903
|
return "class";
|
|
33832
|
-
case
|
|
33904
|
+
case import_typescript61.default.SyntaxKind.FunctionDeclaration:
|
|
33833
33905
|
return "function";
|
|
33834
|
-
case
|
|
33906
|
+
case import_typescript61.default.SyntaxKind.VariableDeclaration:
|
|
33835
33907
|
return "variable";
|
|
33836
|
-
case
|
|
33908
|
+
case import_typescript61.default.SyntaxKind.EnumDeclaration:
|
|
33837
33909
|
return "enum";
|
|
33838
33910
|
default:
|
|
33839
33911
|
return "declaration";
|
|
@@ -33903,10 +33975,10 @@ var UpdateMode;
|
|
|
33903
33975
|
})(UpdateMode || (UpdateMode = {}));
|
|
33904
33976
|
|
|
33905
33977
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
33906
|
-
var
|
|
33978
|
+
var import_typescript65 = __toESM(require("typescript"), 1);
|
|
33907
33979
|
|
|
33908
33980
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
33909
|
-
var
|
|
33981
|
+
var import_typescript62 = __toESM(require("typescript"), 1);
|
|
33910
33982
|
|
|
33911
33983
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/expando.mjs
|
|
33912
33984
|
var NgExtension = Symbol("NgExtension");
|
|
@@ -34037,10 +34109,10 @@ var ShimAdapter = class {
|
|
|
34037
34109
|
}
|
|
34038
34110
|
const prefix = match[1];
|
|
34039
34111
|
let baseFileName = absoluteFrom(prefix + ".ts");
|
|
34040
|
-
let inputFile = this.delegate.getSourceFile(baseFileName,
|
|
34112
|
+
let inputFile = this.delegate.getSourceFile(baseFileName, import_typescript62.default.ScriptTarget.Latest);
|
|
34041
34113
|
if (inputFile === void 0) {
|
|
34042
34114
|
baseFileName = absoluteFrom(prefix + ".tsx");
|
|
34043
|
-
inputFile = this.delegate.getSourceFile(baseFileName,
|
|
34115
|
+
inputFile = this.delegate.getSourceFile(baseFileName, import_typescript62.default.ScriptTarget.Latest);
|
|
34044
34116
|
}
|
|
34045
34117
|
if (inputFile === void 0 || isShim(inputFile)) {
|
|
34046
34118
|
return void 0;
|
|
@@ -34195,7 +34267,7 @@ var TsCreateProgramDriver = class {
|
|
|
34195
34267
|
this.sfMap.clear();
|
|
34196
34268
|
}
|
|
34197
34269
|
for (const [filePath, { newText, originalFile }] of contents.entries()) {
|
|
34198
|
-
const sf =
|
|
34270
|
+
const sf = import_typescript65.default.createSourceFile(filePath, newText, import_typescript65.default.ScriptTarget.Latest, true);
|
|
34199
34271
|
if (originalFile !== null) {
|
|
34200
34272
|
sf[NgOriginalFile] = originalFile;
|
|
34201
34273
|
}
|
|
@@ -34204,7 +34276,7 @@ var TsCreateProgramDriver = class {
|
|
|
34204
34276
|
const host = new UpdatedProgramHost(this.sfMap, this.originalProgram, this.originalHost, this.shimExtensionPrefixes);
|
|
34205
34277
|
const oldProgram = this.program;
|
|
34206
34278
|
retagAllTsFiles(oldProgram);
|
|
34207
|
-
this.program =
|
|
34279
|
+
this.program = import_typescript65.default.createProgram({
|
|
34208
34280
|
host,
|
|
34209
34281
|
rootNames: this.program.getRootFileNames(),
|
|
34210
34282
|
options: this.options,
|
|
@@ -34919,7 +34991,7 @@ var NgModuleIndexImpl = class {
|
|
|
34919
34991
|
};
|
|
34920
34992
|
|
|
34921
34993
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/resource/src/loader.mjs
|
|
34922
|
-
var
|
|
34994
|
+
var import_typescript68 = __toESM(require("typescript"), 1);
|
|
34923
34995
|
var CSS_PREPROCESSOR_EXT = /(\.scss|\.sass|\.less|\.styl)$/;
|
|
34924
34996
|
var RESOURCE_MARKER = ".$ngresource$";
|
|
34925
34997
|
var RESOURCE_MARKER_TS = RESOURCE_MARKER + ".ts";
|
|
@@ -35031,7 +35103,7 @@ var AdapterResourceLoader = class {
|
|
|
35031
35103
|
return this.adapter.rootDirs.map((rootDir) => join(rootDir, segment));
|
|
35032
35104
|
}
|
|
35033
35105
|
getResolvedCandidateLocations(url, fromFile) {
|
|
35034
|
-
const failedLookup =
|
|
35106
|
+
const failedLookup = import_typescript68.default.resolveModuleName(url + RESOURCE_MARKER, fromFile, this.options, this.lookupResolutionHost);
|
|
35035
35107
|
if (failedLookup.failedLookupLocations === void 0) {
|
|
35036
35108
|
throw new Error(`Internal error: expected to find failedLookupLocations during resolution of resource '${url}' in context of ${fromFile}`);
|
|
35037
35109
|
}
|
|
@@ -35187,7 +35259,7 @@ var SymbolKind;
|
|
|
35187
35259
|
})(SymbolKind || (SymbolKind = {}));
|
|
35188
35260
|
|
|
35189
35261
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/diagnostic.mjs
|
|
35190
|
-
var
|
|
35262
|
+
var import_typescript69 = __toESM(require("typescript"), 1);
|
|
35191
35263
|
function makeTemplateDiagnostic(templateId, mapping, span, category, code, messageText, relatedMessages) {
|
|
35192
35264
|
var _a2;
|
|
35193
35265
|
if (mapping.type === "direct") {
|
|
@@ -35196,7 +35268,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
35196
35268
|
relatedInformation = [];
|
|
35197
35269
|
for (const relatedMessage of relatedMessages) {
|
|
35198
35270
|
relatedInformation.push({
|
|
35199
|
-
category:
|
|
35271
|
+
category: import_typescript69.default.DiagnosticCategory.Message,
|
|
35200
35272
|
code: 0,
|
|
35201
35273
|
file: relatedMessage.sourceFile,
|
|
35202
35274
|
start: relatedMessage.start,
|
|
@@ -35225,7 +35297,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
35225
35297
|
if (relatedMessages !== void 0) {
|
|
35226
35298
|
for (const relatedMessage of relatedMessages) {
|
|
35227
35299
|
relatedInformation.push({
|
|
35228
|
-
category:
|
|
35300
|
+
category: import_typescript69.default.DiagnosticCategory.Message,
|
|
35229
35301
|
code: 0,
|
|
35230
35302
|
file: relatedMessage.sourceFile,
|
|
35231
35303
|
start: relatedMessage.start,
|
|
@@ -35255,7 +35327,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
35255
35327
|
};
|
|
35256
35328
|
}
|
|
35257
35329
|
relatedInformation.push({
|
|
35258
|
-
category:
|
|
35330
|
+
category: import_typescript69.default.DiagnosticCategory.Message,
|
|
35259
35331
|
code: 0,
|
|
35260
35332
|
file: componentSf,
|
|
35261
35333
|
start: mapping.node.getStart(),
|
|
@@ -35290,7 +35362,7 @@ function parseTemplateAsSourceFile(fileName, template2) {
|
|
|
35290
35362
|
if (parseTemplateAsSourceFileForTest !== null) {
|
|
35291
35363
|
return parseTemplateAsSourceFileForTest(fileName, template2);
|
|
35292
35364
|
}
|
|
35293
|
-
return
|
|
35365
|
+
return import_typescript69.default.createSourceFile(fileName, template2, import_typescript69.default.ScriptTarget.Latest, false, import_typescript69.default.ScriptKind.JSX);
|
|
35294
35366
|
}
|
|
35295
35367
|
|
|
35296
35368
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/id.mjs
|
|
@@ -35311,14 +35383,14 @@ function allocateTemplateId(sf) {
|
|
|
35311
35383
|
}
|
|
35312
35384
|
|
|
35313
35385
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
35314
|
-
var
|
|
35386
|
+
var import_typescript71 = __toESM(require("typescript"), 1);
|
|
35315
35387
|
|
|
35316
35388
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/comments.mjs
|
|
35317
|
-
var
|
|
35389
|
+
var import_typescript70 = __toESM(require("typescript"), 1);
|
|
35318
35390
|
var parseSpanComment = /^(\d+),(\d+)$/;
|
|
35319
35391
|
function readSpanComment(node, sourceFile = node.getSourceFile()) {
|
|
35320
|
-
return
|
|
35321
|
-
if (kind !==
|
|
35392
|
+
return import_typescript70.default.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
35393
|
+
if (kind !== import_typescript70.default.SyntaxKind.MultiLineCommentTrivia) {
|
|
35322
35394
|
return null;
|
|
35323
35395
|
}
|
|
35324
35396
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -35341,25 +35413,25 @@ var ExpressionIdentifier;
|
|
|
35341
35413
|
ExpressionIdentifier2["EVENT_PARAMETER"] = "EP";
|
|
35342
35414
|
})(ExpressionIdentifier || (ExpressionIdentifier = {}));
|
|
35343
35415
|
function addExpressionIdentifier(node, identifier) {
|
|
35344
|
-
|
|
35416
|
+
import_typescript70.default.addSyntheticTrailingComment(
|
|
35345
35417
|
node,
|
|
35346
|
-
|
|
35418
|
+
import_typescript70.default.SyntaxKind.MultiLineCommentTrivia,
|
|
35347
35419
|
`${CommentTriviaType.EXPRESSION_TYPE_IDENTIFIER}:${identifier}`,
|
|
35348
35420
|
false
|
|
35349
35421
|
);
|
|
35350
35422
|
}
|
|
35351
35423
|
var IGNORE_FOR_DIAGNOSTICS_MARKER = `${CommentTriviaType.DIAGNOSTIC}:ignore`;
|
|
35352
35424
|
function markIgnoreDiagnostics(node) {
|
|
35353
|
-
|
|
35425
|
+
import_typescript70.default.addSyntheticTrailingComment(
|
|
35354
35426
|
node,
|
|
35355
|
-
|
|
35427
|
+
import_typescript70.default.SyntaxKind.MultiLineCommentTrivia,
|
|
35356
35428
|
IGNORE_FOR_DIAGNOSTICS_MARKER,
|
|
35357
35429
|
false
|
|
35358
35430
|
);
|
|
35359
35431
|
}
|
|
35360
35432
|
function hasIgnoreForDiagnosticsMarker(node, sourceFile) {
|
|
35361
|
-
return
|
|
35362
|
-
if (kind !==
|
|
35433
|
+
return import_typescript70.default.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
35434
|
+
if (kind !== import_typescript70.default.SyntaxKind.MultiLineCommentTrivia) {
|
|
35363
35435
|
return null;
|
|
35364
35436
|
}
|
|
35365
35437
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -35433,8 +35505,8 @@ function findAllMatchingNodes(tcb, opts) {
|
|
|
35433
35505
|
return results;
|
|
35434
35506
|
}
|
|
35435
35507
|
function hasExpressionIdentifier(sourceFile, node, identifier) {
|
|
35436
|
-
return
|
|
35437
|
-
if (kind !==
|
|
35508
|
+
return import_typescript70.default.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
35509
|
+
if (kind !== import_typescript70.default.SyntaxKind.MultiLineCommentTrivia) {
|
|
35438
35510
|
return false;
|
|
35439
35511
|
}
|
|
35440
35512
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -35452,7 +35524,7 @@ var CompletionEngine = class {
|
|
|
35452
35524
|
this.templateContextCache = /* @__PURE__ */ new Map();
|
|
35453
35525
|
this.expressionCompletionCache = /* @__PURE__ */ new Map();
|
|
35454
35526
|
const globalRead = findFirstMatchingNode(this.tcb, {
|
|
35455
|
-
filter:
|
|
35527
|
+
filter: import_typescript71.default.isPropertyAccessExpression,
|
|
35456
35528
|
withExpressionIdentifier: ExpressionIdentifier.COMPONENT_COMPLETION
|
|
35457
35529
|
});
|
|
35458
35530
|
if (globalRead !== null) {
|
|
@@ -35476,7 +35548,7 @@ var CompletionEngine = class {
|
|
|
35476
35548
|
let nodeContext = null;
|
|
35477
35549
|
if (node instanceof EmptyExpr) {
|
|
35478
35550
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
35479
|
-
filter:
|
|
35551
|
+
filter: import_typescript71.default.isIdentifier,
|
|
35480
35552
|
withSpan: node.sourceSpan
|
|
35481
35553
|
});
|
|
35482
35554
|
if (nodeLocation !== null) {
|
|
@@ -35489,7 +35561,7 @@ var CompletionEngine = class {
|
|
|
35489
35561
|
}
|
|
35490
35562
|
if (node instanceof PropertyRead && node.receiver instanceof ImplicitReceiver) {
|
|
35491
35563
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
35492
|
-
filter:
|
|
35564
|
+
filter: import_typescript71.default.isPropertyAccessExpression,
|
|
35493
35565
|
withSpan: node.sourceSpan
|
|
35494
35566
|
});
|
|
35495
35567
|
if (nodeLocation) {
|
|
@@ -35513,21 +35585,21 @@ var CompletionEngine = class {
|
|
|
35513
35585
|
let tsExpr = null;
|
|
35514
35586
|
if (expr instanceof PropertyRead || expr instanceof PropertyWrite) {
|
|
35515
35587
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
35516
|
-
filter:
|
|
35588
|
+
filter: import_typescript71.default.isPropertyAccessExpression,
|
|
35517
35589
|
withSpan: expr.nameSpan
|
|
35518
35590
|
});
|
|
35519
35591
|
} else if (expr instanceof SafePropertyRead) {
|
|
35520
35592
|
const ternaryExpr = findFirstMatchingNode(this.tcb, {
|
|
35521
|
-
filter:
|
|
35593
|
+
filter: import_typescript71.default.isParenthesizedExpression,
|
|
35522
35594
|
withSpan: expr.sourceSpan
|
|
35523
35595
|
});
|
|
35524
|
-
if (ternaryExpr === null || !
|
|
35596
|
+
if (ternaryExpr === null || !import_typescript71.default.isConditionalExpression(ternaryExpr.expression)) {
|
|
35525
35597
|
return null;
|
|
35526
35598
|
}
|
|
35527
35599
|
const whenTrue = ternaryExpr.expression.whenTrue;
|
|
35528
|
-
if (
|
|
35600
|
+
if (import_typescript71.default.isPropertyAccessExpression(whenTrue)) {
|
|
35529
35601
|
tsExpr = whenTrue;
|
|
35530
|
-
} else if (
|
|
35602
|
+
} else if (import_typescript71.default.isCallExpression(whenTrue) && import_typescript71.default.isPropertyAccessExpression(whenTrue.expression)) {
|
|
35531
35603
|
tsExpr = whenTrue.expression;
|
|
35532
35604
|
}
|
|
35533
35605
|
}
|
|
@@ -35549,15 +35621,15 @@ var CompletionEngine = class {
|
|
|
35549
35621
|
let tsExpr = null;
|
|
35550
35622
|
if (expr instanceof TextAttribute) {
|
|
35551
35623
|
const strNode = findFirstMatchingNode(this.tcb, {
|
|
35552
|
-
filter:
|
|
35624
|
+
filter: import_typescript71.default.isParenthesizedExpression,
|
|
35553
35625
|
withSpan: expr.sourceSpan
|
|
35554
35626
|
});
|
|
35555
|
-
if (strNode !== null &&
|
|
35627
|
+
if (strNode !== null && import_typescript71.default.isStringLiteral(strNode.expression)) {
|
|
35556
35628
|
tsExpr = strNode.expression;
|
|
35557
35629
|
}
|
|
35558
35630
|
} else {
|
|
35559
35631
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
35560
|
-
filter: (n) =>
|
|
35632
|
+
filter: (n) => import_typescript71.default.isStringLiteral(n) || import_typescript71.default.isNumericLiteral(n),
|
|
35561
35633
|
withSpan: expr.sourceSpan
|
|
35562
35634
|
});
|
|
35563
35635
|
}
|
|
@@ -35565,7 +35637,7 @@ var CompletionEngine = class {
|
|
|
35565
35637
|
return null;
|
|
35566
35638
|
}
|
|
35567
35639
|
let positionInShimFile = tsExpr.getEnd();
|
|
35568
|
-
if (
|
|
35640
|
+
if (import_typescript71.default.isStringLiteral(tsExpr)) {
|
|
35569
35641
|
positionInShimFile -= 1;
|
|
35570
35642
|
}
|
|
35571
35643
|
const res = {
|
|
@@ -35603,7 +35675,7 @@ var CompletionEngine = class {
|
|
|
35603
35675
|
var import_typescript85 = __toESM(require("typescript"), 1);
|
|
35604
35676
|
|
|
35605
35677
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/dom.mjs
|
|
35606
|
-
var
|
|
35678
|
+
var import_typescript72 = __toESM(require("typescript"), 1);
|
|
35607
35679
|
var REGISTRY = new DomElementSchemaRegistry();
|
|
35608
35680
|
var REMOVE_XHTML_REGEX = /^:xhtml:/;
|
|
35609
35681
|
var RegistryDomSchemaChecker = class {
|
|
@@ -35628,7 +35700,7 @@ var RegistryDomSchemaChecker = class {
|
|
|
35628
35700
|
} else {
|
|
35629
35701
|
errorMsg += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas2} of this component.`;
|
|
35630
35702
|
}
|
|
35631
|
-
const diag = makeTemplateDiagnostic(id, mapping, element2.startSourceSpan,
|
|
35703
|
+
const diag = makeTemplateDiagnostic(id, mapping, element2.startSourceSpan, import_typescript72.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ELEMENT), errorMsg);
|
|
35632
35704
|
this._diagnostics.push(diag);
|
|
35633
35705
|
}
|
|
35634
35706
|
}
|
|
@@ -35648,7 +35720,7 @@ var RegistryDomSchemaChecker = class {
|
|
|
35648
35720
|
2. If '${element2.name}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas2} of this component to suppress this message.
|
|
35649
35721
|
3. To allow any property add 'NO_ERRORS_SCHEMA' to the ${schemas2} of this component.`;
|
|
35650
35722
|
}
|
|
35651
|
-
const diag = makeTemplateDiagnostic(id, mapping, span,
|
|
35723
|
+
const diag = makeTemplateDiagnostic(id, mapping, span, import_typescript72.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ATTRIBUTE), errorMsg);
|
|
35652
35724
|
this._diagnostics.push(diag);
|
|
35653
35725
|
}
|
|
35654
35726
|
}
|
|
@@ -35658,77 +35730,77 @@ var RegistryDomSchemaChecker = class {
|
|
|
35658
35730
|
var import_typescript78 = __toESM(require("typescript"), 1);
|
|
35659
35731
|
|
|
35660
35732
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/ts_util.mjs
|
|
35661
|
-
var
|
|
35733
|
+
var import_typescript73 = __toESM(require("typescript"), 1);
|
|
35662
35734
|
var SAFE_TO_CAST_WITHOUT_PARENS = /* @__PURE__ */ new Set([
|
|
35663
|
-
|
|
35664
|
-
|
|
35665
|
-
|
|
35666
|
-
|
|
35667
|
-
|
|
35668
|
-
|
|
35669
|
-
|
|
35670
|
-
|
|
35671
|
-
|
|
35672
|
-
|
|
35673
|
-
|
|
35674
|
-
|
|
35675
|
-
|
|
35676
|
-
|
|
35735
|
+
import_typescript73.default.SyntaxKind.ParenthesizedExpression,
|
|
35736
|
+
import_typescript73.default.SyntaxKind.Identifier,
|
|
35737
|
+
import_typescript73.default.SyntaxKind.CallExpression,
|
|
35738
|
+
import_typescript73.default.SyntaxKind.NonNullExpression,
|
|
35739
|
+
import_typescript73.default.SyntaxKind.ElementAccessExpression,
|
|
35740
|
+
import_typescript73.default.SyntaxKind.PropertyAccessExpression,
|
|
35741
|
+
import_typescript73.default.SyntaxKind.ArrayLiteralExpression,
|
|
35742
|
+
import_typescript73.default.SyntaxKind.ObjectLiteralExpression,
|
|
35743
|
+
import_typescript73.default.SyntaxKind.StringLiteral,
|
|
35744
|
+
import_typescript73.default.SyntaxKind.NumericLiteral,
|
|
35745
|
+
import_typescript73.default.SyntaxKind.TrueKeyword,
|
|
35746
|
+
import_typescript73.default.SyntaxKind.FalseKeyword,
|
|
35747
|
+
import_typescript73.default.SyntaxKind.NullKeyword,
|
|
35748
|
+
import_typescript73.default.SyntaxKind.UndefinedKeyword
|
|
35677
35749
|
]);
|
|
35678
35750
|
function tsCastToAny(expr) {
|
|
35679
35751
|
if (!SAFE_TO_CAST_WITHOUT_PARENS.has(expr.kind)) {
|
|
35680
|
-
expr =
|
|
35752
|
+
expr = import_typescript73.default.factory.createParenthesizedExpression(expr);
|
|
35681
35753
|
}
|
|
35682
|
-
return
|
|
35754
|
+
return import_typescript73.default.factory.createParenthesizedExpression(import_typescript73.default.factory.createAsExpression(expr, import_typescript73.default.factory.createKeywordTypeNode(import_typescript73.default.SyntaxKind.AnyKeyword)));
|
|
35683
35755
|
}
|
|
35684
35756
|
function tsCreateElement(tagName) {
|
|
35685
|
-
const createElement =
|
|
35686
|
-
|
|
35757
|
+
const createElement = import_typescript73.default.factory.createPropertyAccessExpression(
|
|
35758
|
+
import_typescript73.default.factory.createIdentifier("document"),
|
|
35687
35759
|
"createElement"
|
|
35688
35760
|
);
|
|
35689
|
-
return
|
|
35761
|
+
return import_typescript73.default.factory.createCallExpression(
|
|
35690
35762
|
createElement,
|
|
35691
35763
|
void 0,
|
|
35692
|
-
[
|
|
35764
|
+
[import_typescript73.default.factory.createStringLiteral(tagName)]
|
|
35693
35765
|
);
|
|
35694
35766
|
}
|
|
35695
35767
|
function tsDeclareVariable(id, type) {
|
|
35696
|
-
const decl =
|
|
35768
|
+
const decl = import_typescript73.default.factory.createVariableDeclaration(
|
|
35697
35769
|
id,
|
|
35698
35770
|
void 0,
|
|
35699
35771
|
type,
|
|
35700
|
-
|
|
35772
|
+
import_typescript73.default.factory.createNonNullExpression(import_typescript73.default.factory.createNull())
|
|
35701
35773
|
);
|
|
35702
|
-
return
|
|
35774
|
+
return import_typescript73.default.factory.createVariableStatement(
|
|
35703
35775
|
void 0,
|
|
35704
35776
|
[decl]
|
|
35705
35777
|
);
|
|
35706
35778
|
}
|
|
35707
35779
|
function tsCreateTypeQueryForCoercedInput(typeName, coercedInputName) {
|
|
35708
|
-
return
|
|
35780
|
+
return import_typescript73.default.factory.createTypeQueryNode(import_typescript73.default.factory.createQualifiedName(typeName, `ngAcceptInputType_${coercedInputName}`));
|
|
35709
35781
|
}
|
|
35710
35782
|
function tsCreateVariable(id, initializer) {
|
|
35711
|
-
const decl =
|
|
35783
|
+
const decl = import_typescript73.default.factory.createVariableDeclaration(
|
|
35712
35784
|
id,
|
|
35713
35785
|
void 0,
|
|
35714
35786
|
void 0,
|
|
35715
35787
|
initializer
|
|
35716
35788
|
);
|
|
35717
|
-
return
|
|
35789
|
+
return import_typescript73.default.factory.createVariableStatement(
|
|
35718
35790
|
void 0,
|
|
35719
35791
|
[decl]
|
|
35720
35792
|
);
|
|
35721
35793
|
}
|
|
35722
35794
|
function tsCallMethod(receiver, methodName, args = []) {
|
|
35723
|
-
const methodAccess =
|
|
35724
|
-
return
|
|
35795
|
+
const methodAccess = import_typescript73.default.factory.createPropertyAccessExpression(receiver, methodName);
|
|
35796
|
+
return import_typescript73.default.factory.createCallExpression(
|
|
35725
35797
|
methodAccess,
|
|
35726
35798
|
void 0,
|
|
35727
35799
|
args
|
|
35728
35800
|
);
|
|
35729
35801
|
}
|
|
35730
35802
|
function isAccessExpression2(node) {
|
|
35731
|
-
return
|
|
35803
|
+
return import_typescript73.default.isPropertyAccessExpression(node) || import_typescript73.default.isElementAccessExpression(node);
|
|
35732
35804
|
}
|
|
35733
35805
|
|
|
35734
35806
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
@@ -35739,83 +35811,6 @@ var import_typescript75 = __toESM(require("typescript"), 1);
|
|
|
35739
35811
|
|
|
35740
35812
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
|
|
35741
35813
|
var import_typescript74 = __toESM(require("typescript"), 1);
|
|
35742
|
-
|
|
35743
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_emitter.mjs
|
|
35744
|
-
var import_typescript73 = __toESM(require("typescript"), 1);
|
|
35745
|
-
var INELIGIBLE = {};
|
|
35746
|
-
function canEmitType(type, canEmit) {
|
|
35747
|
-
return canEmitTypeWorker(type);
|
|
35748
|
-
function canEmitTypeWorker(type2) {
|
|
35749
|
-
return visitNode(type2) !== INELIGIBLE;
|
|
35750
|
-
}
|
|
35751
|
-
function visitNode(node) {
|
|
35752
|
-
if (import_typescript73.default.isImportTypeNode(node)) {
|
|
35753
|
-
return INELIGIBLE;
|
|
35754
|
-
}
|
|
35755
|
-
if (import_typescript73.default.isTypeReferenceNode(node) && !canEmitTypeReference(node)) {
|
|
35756
|
-
return INELIGIBLE;
|
|
35757
|
-
} else {
|
|
35758
|
-
return import_typescript73.default.forEachChild(node, visitNode);
|
|
35759
|
-
}
|
|
35760
|
-
}
|
|
35761
|
-
function canEmitTypeReference(type2) {
|
|
35762
|
-
if (!canEmit(type2)) {
|
|
35763
|
-
return false;
|
|
35764
|
-
}
|
|
35765
|
-
return type2.typeArguments === void 0 || type2.typeArguments.every(canEmitTypeWorker);
|
|
35766
|
-
}
|
|
35767
|
-
}
|
|
35768
|
-
var TypeEmitter = class {
|
|
35769
|
-
constructor(translator) {
|
|
35770
|
-
this.translator = translator;
|
|
35771
|
-
}
|
|
35772
|
-
emitType(type) {
|
|
35773
|
-
const typeReferenceTransformer = (context) => {
|
|
35774
|
-
const visitNode = (node) => {
|
|
35775
|
-
if (import_typescript73.default.isImportTypeNode(node)) {
|
|
35776
|
-
throw new Error("Unable to emit import type");
|
|
35777
|
-
}
|
|
35778
|
-
if (import_typescript73.default.isTypeReferenceNode(node)) {
|
|
35779
|
-
return this.emitTypeReference(node);
|
|
35780
|
-
} else if (import_typescript73.default.isLiteralExpression(node)) {
|
|
35781
|
-
let clone;
|
|
35782
|
-
if (import_typescript73.default.isStringLiteral(node)) {
|
|
35783
|
-
clone = import_typescript73.default.factory.createStringLiteral(node.text);
|
|
35784
|
-
} else if (import_typescript73.default.isNumericLiteral(node)) {
|
|
35785
|
-
clone = import_typescript73.default.factory.createNumericLiteral(node.text);
|
|
35786
|
-
} else if (import_typescript73.default.isBigIntLiteral(node)) {
|
|
35787
|
-
clone = import_typescript73.default.factory.createBigIntLiteral(node.text);
|
|
35788
|
-
} else if (import_typescript73.default.isNoSubstitutionTemplateLiteral(node)) {
|
|
35789
|
-
clone = import_typescript73.default.factory.createNoSubstitutionTemplateLiteral(node.text, node.rawText);
|
|
35790
|
-
} else if (import_typescript73.default.isRegularExpressionLiteral(node)) {
|
|
35791
|
-
clone = import_typescript73.default.factory.createRegularExpressionLiteral(node.text);
|
|
35792
|
-
} else {
|
|
35793
|
-
throw new Error(`Unsupported literal kind ${import_typescript73.default.SyntaxKind[node.kind]}`);
|
|
35794
|
-
}
|
|
35795
|
-
import_typescript73.default.setTextRange(clone, { pos: -1, end: -1 });
|
|
35796
|
-
return clone;
|
|
35797
|
-
} else {
|
|
35798
|
-
return import_typescript73.default.visitEachChild(node, visitNode, context);
|
|
35799
|
-
}
|
|
35800
|
-
};
|
|
35801
|
-
return (node) => import_typescript73.default.visitNode(node, visitNode, import_typescript73.default.isTypeNode);
|
|
35802
|
-
};
|
|
35803
|
-
return import_typescript73.default.transform(type, [typeReferenceTransformer]).transformed[0];
|
|
35804
|
-
}
|
|
35805
|
-
emitTypeReference(type) {
|
|
35806
|
-
const translatedType = this.translator(type);
|
|
35807
|
-
if (translatedType === null) {
|
|
35808
|
-
throw new Error("Unable to emit an unresolved reference");
|
|
35809
|
-
}
|
|
35810
|
-
let typeArguments = void 0;
|
|
35811
|
-
if (type.typeArguments !== void 0) {
|
|
35812
|
-
typeArguments = import_typescript73.default.factory.createNodeArray(type.typeArguments.map((typeArg) => this.emitType(typeArg)));
|
|
35813
|
-
}
|
|
35814
|
-
return import_typescript73.default.factory.updateTypeReferenceNode(type, translatedType.typeName, typeArguments);
|
|
35815
|
-
}
|
|
35816
|
-
};
|
|
35817
|
-
|
|
35818
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
|
|
35819
35814
|
var TypeParameterEmitter = class {
|
|
35820
35815
|
constructor(typeParameters, reflector) {
|
|
35821
35816
|
this.typeParameters = typeParameters;
|
|
@@ -36040,7 +36035,7 @@ function constructTypeCtorParameter(node, meta, rawType) {
|
|
|
36040
36035
|
void 0,
|
|
36041
36036
|
classPropertyName,
|
|
36042
36037
|
void 0,
|
|
36043
|
-
transform == null ? tsCreateTypeQueryForCoercedInput(rawType.typeName, classPropertyName) : transform.type
|
|
36038
|
+
transform == null ? tsCreateTypeQueryForCoercedInput(rawType.typeName, classPropertyName) : transform.type.node
|
|
36044
36039
|
));
|
|
36045
36040
|
}
|
|
36046
36041
|
}
|
|
@@ -37089,7 +37084,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
37089
37084
|
}
|
|
37090
37085
|
if (this.dir.coercedInputFields.has(fieldName)) {
|
|
37091
37086
|
let type;
|
|
37092
|
-
if (transformType) {
|
|
37087
|
+
if (transformType !== null) {
|
|
37093
37088
|
type = this.tcb.env.referenceTransplantedType(new TransplantedType(transformType));
|
|
37094
37089
|
} else {
|
|
37095
37090
|
const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
|