@angular/compiler-cli 18.0.0-next.0 → 18.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/{chunk-NB6ZWAGP.js → chunk-32GYU5L6.js} +60 -21
- package/bundles/chunk-32GYU5L6.js.map +6 -0
- package/bundles/{chunk-4A7ZWBEL.js → chunk-4CJL5R2P.js} +59 -57
- package/bundles/{chunk-4A7ZWBEL.js.map → chunk-4CJL5R2P.js.map} +1 -1
- package/bundles/{chunk-A46CQFUG.js → chunk-MTZKBEZU.js} +276 -245
- package/bundles/chunk-MTZKBEZU.js.map +6 -0
- package/bundles/{chunk-6X7GQ6BQ.js → chunk-NPXXJQN4.js} +603 -245
- package/bundles/chunk-NPXXJQN4.js.map +6 -0
- package/bundles/{chunk-64VF23SF.js → chunk-VFVLP7AO.js} +2 -2
- package/bundles/{chunk-SQY7XLGB.js → chunk-YMLYBTFV.js} +2225 -904
- package/bundles/chunk-YMLYBTFV.js.map +6 -0
- package/bundles/index.js +7 -5
- package/bundles/index.js.map +1 -1
- package/bundles/linker/babel/index.js +10 -3
- package/bundles/linker/babel/index.js.map +1 -1
- package/bundles/linker/index.js +2 -2
- package/bundles/private/migrations.js +2 -2
- package/bundles/private/tooling.js +3 -3
- package/bundles/src/bin/ng_xi18n.js +4 -4
- package/bundles/src/bin/ngc.js +4 -4
- package/bundles_metadata.json +1 -1
- package/index.d.ts +1 -0
- package/linker/babel/src/ast/babel_ast_host.d.ts +2 -1
- package/linker/src/ast/ast_host.d.ts +4 -0
- package/linker/src/ast/ast_value.d.ts +5 -0
- package/linker/src/ast/typescript/typescript_ast_host.d.ts +1 -0
- package/linker/src/file_linker/partial_linkers/partial_class_metadata_async_linker_1.d.ts +16 -0
- package/linker/src/file_linker/partial_linkers/partial_linker_selector.d.ts +1 -0
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/linker/src/file_linker/translator.d.ts +2 -2
- package/linker/src/linker_import_generator.d.ts +5 -5
- package/package.json +4 -4
- package/src/ngtsc/annotations/component/src/handler.d.ts +1 -1
- package/src/ngtsc/annotations/directive/index.d.ts +1 -0
- package/src/ngtsc/annotations/directive/src/initializer_function_access.d.ts +17 -0
- package/src/ngtsc/annotations/directive/src/initializer_functions.d.ts +10 -6
- package/src/ngtsc/annotations/directive/src/input_function.d.ts +4 -1
- package/src/ngtsc/annotations/directive/src/model_function.d.ts +4 -1
- package/src/ngtsc/annotations/directive/src/output_function.d.ts +4 -1
- package/src/ngtsc/annotations/directive/src/query_functions.d.ts +8 -2
- package/src/ngtsc/annotations/index.d.ts +1 -1
- package/src/ngtsc/core/src/core_version.d.ts +11 -0
- package/src/ngtsc/diagnostics/src/error_code.d.ts +19 -0
- package/src/ngtsc/docs/src/entities.d.ts +36 -1
- package/src/ngtsc/docs/src/function_extractor.d.ts +3 -2
- package/src/ngtsc/docs/src/initializer_api_function_extractor.d.ts +24 -0
- package/src/ngtsc/docs/src/internal.d.ts +8 -0
- package/src/ngtsc/imports/index.d.ts +1 -1
- package/src/ngtsc/imports/src/core.d.ts +0 -9
- package/src/ngtsc/imports/src/imported_symbols_tracker.d.ts +13 -0
- package/src/ngtsc/imports/src/patch_alias_reference_resolution.d.ts +3 -1
- package/src/ngtsc/reflection/src/host.d.ts +13 -3
- package/src/ngtsc/reflection/src/typescript.d.ts +8 -1
- package/src/ngtsc/reflection/src/util.d.ts +6 -1
- package/src/ngtsc/transform/index.d.ts +0 -1
- package/src/ngtsc/transform/src/declaration.d.ts +1 -1
- package/src/ngtsc/translator/index.d.ts +2 -2
- package/src/ngtsc/translator/src/api/import_generator.d.ts +22 -10
- package/src/ngtsc/translator/src/import_manager/check_unique_identifier_name.d.ts +13 -0
- package/src/ngtsc/translator/src/import_manager/import_manager.d.ts +94 -0
- package/src/ngtsc/translator/src/import_manager/import_typescript_transform.d.ts +17 -0
- package/src/ngtsc/translator/src/import_manager/reuse_generated_imports.d.ts +32 -0
- package/src/ngtsc/translator/src/import_manager/reuse_source_file_imports.d.ts +38 -0
- package/src/ngtsc/translator/src/translator.d.ts +3 -2
- package/src/ngtsc/translator/src/type_translator.d.ts +1 -1
- package/src/ngtsc/translator/src/typescript_translator.d.ts +2 -2
- package/src/ngtsc/typecheck/src/oob.d.ts +3 -3
- package/src/ngtsc/typecheck/src/reference_emit_environment.d.ts +1 -1
- package/src/ngtsc/typecheck/src/ts_util.d.ts +0 -2
- package/src/ngtsc/validation/index.d.ts +8 -0
- package/src/ngtsc/validation/src/rules/api.d.ts +24 -0
- package/src/ngtsc/validation/src/rules/initializer_api_usage_rule.d.ts +21 -0
- package/src/ngtsc/validation/src/source_file_validator.d.ts +22 -0
- package/src/transformers/jit_transforms/initializer_api_transforms/transform_api.d.ts +4 -4
- package/bundles/chunk-6X7GQ6BQ.js.map +0 -6
- package/bundles/chunk-A46CQFUG.js.map +0 -6
- package/bundles/chunk-NB6ZWAGP.js.map +0 -6
- package/bundles/chunk-SQY7XLGB.js.map +0 -6
- package/src/ngtsc/transform/src/utils.d.ts +0 -15
- package/src/ngtsc/translator/src/import_manager.d.ts +0 -47
- /package/bundles/{chunk-64VF23SF.js.map → chunk-VFVLP7AO.js.map} +0 -0
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
AmbientImport,
|
|
7
|
+
ClassMemberAccessLevel,
|
|
7
8
|
ClassMemberKind,
|
|
8
9
|
ErrorCode,
|
|
9
10
|
FatalDiagnosticError,
|
|
@@ -12,6 +13,7 @@ import {
|
|
|
12
13
|
Reference,
|
|
13
14
|
assertSuccessfulReferenceEmit,
|
|
14
15
|
attachDefaultImportDeclaration,
|
|
16
|
+
classMemberAccessLevelToString,
|
|
15
17
|
entityNameToValue,
|
|
16
18
|
filterToMembersWithDecorator,
|
|
17
19
|
getDefaultImportDeclaration,
|
|
@@ -21,16 +23,18 @@ import {
|
|
|
21
23
|
isFromDtsFile,
|
|
22
24
|
isNamedClassDeclaration,
|
|
23
25
|
makeDiagnostic,
|
|
26
|
+
makeDiagnosticChain,
|
|
24
27
|
makeRelatedInformation,
|
|
25
28
|
nodeDebugInfo,
|
|
26
29
|
nodeNameForError,
|
|
30
|
+
presetImportManagerForceNamespaceImports,
|
|
27
31
|
reflectObjectLiteral,
|
|
28
32
|
reflectTypeEntityToDeclaration,
|
|
29
33
|
translateExpression,
|
|
30
34
|
translateStatement,
|
|
31
35
|
translateType,
|
|
32
36
|
typeNodeToValueExpr
|
|
33
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-NPXXJQN4.js";
|
|
34
38
|
import {
|
|
35
39
|
PerfEvent,
|
|
36
40
|
PerfPhase
|
|
@@ -1352,7 +1356,7 @@ function createUnsuitableInjectionTokenError(clazz, error) {
|
|
|
1352
1356
|
}
|
|
1353
1357
|
|
|
1354
1358
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/diagnostics.mjs
|
|
1355
|
-
import
|
|
1359
|
+
import ts12 from "typescript";
|
|
1356
1360
|
|
|
1357
1361
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/api.mjs
|
|
1358
1362
|
var MetaKind;
|
|
@@ -2677,53 +2681,7 @@ function containsErrors(diagnostics) {
|
|
|
2677
2681
|
}
|
|
2678
2682
|
|
|
2679
2683
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
2680
|
-
import ts10 from "typescript";
|
|
2681
|
-
|
|
2682
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/utils.mjs
|
|
2683
2684
|
import ts9 from "typescript";
|
|
2684
|
-
function addImports(factory = ts9.factory, importManager, sf, extraStatements = []) {
|
|
2685
|
-
const addedImports = importManager.getAllImports(sf.fileName).map((i) => i.qualifier !== null ? createNamespaceImportDecl(i, factory) : createSideEffectImportDecl(i, factory));
|
|
2686
|
-
const existingImports = sf.statements.filter((stmt) => isImportStatement(stmt));
|
|
2687
|
-
const body = sf.statements.filter((stmt) => !isImportStatement(stmt));
|
|
2688
|
-
if (addedImports.length > 0) {
|
|
2689
|
-
const fileoverviewAnchorStmt = factory.createNotEmittedStatement(sf);
|
|
2690
|
-
return factory.updateSourceFile(sf, factory.createNodeArray([
|
|
2691
|
-
fileoverviewAnchorStmt,
|
|
2692
|
-
...existingImports,
|
|
2693
|
-
...addedImports,
|
|
2694
|
-
...extraStatements,
|
|
2695
|
-
...body
|
|
2696
|
-
]));
|
|
2697
|
-
}
|
|
2698
|
-
return sf;
|
|
2699
|
-
}
|
|
2700
|
-
function createNamespaceImportDecl(i, factory) {
|
|
2701
|
-
const qualifier = factory.createIdentifier(i.qualifier.text);
|
|
2702
|
-
const importClause = factory.createImportClause(
|
|
2703
|
-
false,
|
|
2704
|
-
void 0,
|
|
2705
|
-
factory.createNamespaceImport(qualifier)
|
|
2706
|
-
);
|
|
2707
|
-
const decl = factory.createImportDeclaration(
|
|
2708
|
-
void 0,
|
|
2709
|
-
importClause,
|
|
2710
|
-
factory.createStringLiteral(i.specifier)
|
|
2711
|
-
);
|
|
2712
|
-
ts9.setOriginalNode(i.qualifier, decl);
|
|
2713
|
-
return decl;
|
|
2714
|
-
}
|
|
2715
|
-
function createSideEffectImportDecl(i, factory) {
|
|
2716
|
-
return factory.createImportDeclaration(
|
|
2717
|
-
void 0,
|
|
2718
|
-
void 0,
|
|
2719
|
-
ts9.factory.createStringLiteral(i.specifier)
|
|
2720
|
-
);
|
|
2721
|
-
}
|
|
2722
|
-
function isImportStatement(stmt) {
|
|
2723
|
-
return ts9.isImportDeclaration(stmt) || ts9.isImportEqualsDeclaration(stmt) || ts9.isNamespaceImport(stmt);
|
|
2724
|
-
}
|
|
2725
|
-
|
|
2726
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
2727
2685
|
var DtsTransformRegistry = class {
|
|
2728
2686
|
constructor() {
|
|
2729
2687
|
this.ivyDeclarationTransforms = /* @__PURE__ */ new Map();
|
|
@@ -2738,7 +2696,7 @@ var DtsTransformRegistry = class {
|
|
|
2738
2696
|
if (!sf.isDeclarationFile) {
|
|
2739
2697
|
return null;
|
|
2740
2698
|
}
|
|
2741
|
-
const originalSf =
|
|
2699
|
+
const originalSf = ts9.getOriginalNode(sf);
|
|
2742
2700
|
let transforms = null;
|
|
2743
2701
|
if (this.ivyDeclarationTransforms.has(originalSf)) {
|
|
2744
2702
|
transforms = [];
|
|
@@ -2747,11 +2705,11 @@ var DtsTransformRegistry = class {
|
|
|
2747
2705
|
return transforms;
|
|
2748
2706
|
}
|
|
2749
2707
|
};
|
|
2750
|
-
function declarationTransformFactory(transformRegistry, reflector, refEmitter, importRewriter
|
|
2708
|
+
function declarationTransformFactory(transformRegistry, reflector, refEmitter, importRewriter) {
|
|
2751
2709
|
return (context) => {
|
|
2752
|
-
const transformer = new DtsTransformer(context, reflector, refEmitter, importRewriter
|
|
2710
|
+
const transformer = new DtsTransformer(context, reflector, refEmitter, importRewriter);
|
|
2753
2711
|
return (fileOrBundle) => {
|
|
2754
|
-
if (
|
|
2712
|
+
if (ts9.isBundle(fileOrBundle)) {
|
|
2755
2713
|
return fileOrBundle;
|
|
2756
2714
|
}
|
|
2757
2715
|
const transforms = transformRegistry.getAllTransforms(fileOrBundle);
|
|
@@ -2763,26 +2721,25 @@ function declarationTransformFactory(transformRegistry, reflector, refEmitter, i
|
|
|
2763
2721
|
};
|
|
2764
2722
|
}
|
|
2765
2723
|
var DtsTransformer = class {
|
|
2766
|
-
constructor(ctx, reflector, refEmitter, importRewriter
|
|
2724
|
+
constructor(ctx, reflector, refEmitter, importRewriter) {
|
|
2767
2725
|
this.ctx = ctx;
|
|
2768
2726
|
this.reflector = reflector;
|
|
2769
2727
|
this.refEmitter = refEmitter;
|
|
2770
2728
|
this.importRewriter = importRewriter;
|
|
2771
|
-
this.importPrefix = importPrefix;
|
|
2772
2729
|
}
|
|
2773
2730
|
transform(sf, transforms) {
|
|
2774
|
-
const imports = new ImportManager(this.importRewriter
|
|
2731
|
+
const imports = new ImportManager({ ...presetImportManagerForceNamespaceImports, rewriter: this.importRewriter });
|
|
2775
2732
|
const visitor = (node) => {
|
|
2776
|
-
if (
|
|
2733
|
+
if (ts9.isClassDeclaration(node)) {
|
|
2777
2734
|
return this.transformClassDeclaration(node, transforms, imports);
|
|
2778
|
-
} else if (
|
|
2735
|
+
} else if (ts9.isFunctionDeclaration(node)) {
|
|
2779
2736
|
return this.transformFunctionDeclaration(node, transforms, imports);
|
|
2780
2737
|
} else {
|
|
2781
|
-
return
|
|
2738
|
+
return ts9.visitEachChild(node, visitor, this.ctx);
|
|
2782
2739
|
}
|
|
2783
2740
|
};
|
|
2784
|
-
sf =
|
|
2785
|
-
return
|
|
2741
|
+
sf = ts9.visitNode(sf, visitor, ts9.isSourceFile) || sf;
|
|
2742
|
+
return imports.transformTsFile(this.ctx, sf);
|
|
2786
2743
|
}
|
|
2787
2744
|
transformClassDeclaration(clazz, transforms, imports) {
|
|
2788
2745
|
let elements = clazz.members;
|
|
@@ -2809,7 +2766,7 @@ var DtsTransformer = class {
|
|
|
2809
2766
|
}
|
|
2810
2767
|
}
|
|
2811
2768
|
if (elementsChanged && clazz === newClazz) {
|
|
2812
|
-
newClazz =
|
|
2769
|
+
newClazz = ts9.factory.updateClassDeclaration(
|
|
2813
2770
|
clazz,
|
|
2814
2771
|
clazz.modifiers,
|
|
2815
2772
|
clazz.name,
|
|
@@ -2838,16 +2795,16 @@ var IvyDeclarationDtsTransform = class {
|
|
|
2838
2795
|
this.declarationFields.set(decl, fields);
|
|
2839
2796
|
}
|
|
2840
2797
|
transformClass(clazz, members, reflector, refEmitter, imports) {
|
|
2841
|
-
const original =
|
|
2798
|
+
const original = ts9.getOriginalNode(clazz);
|
|
2842
2799
|
if (!this.declarationFields.has(original)) {
|
|
2843
2800
|
return clazz;
|
|
2844
2801
|
}
|
|
2845
2802
|
const fields = this.declarationFields.get(original);
|
|
2846
2803
|
const newMembers = fields.map((decl) => {
|
|
2847
|
-
const modifiers = [
|
|
2804
|
+
const modifiers = [ts9.factory.createModifier(ts9.SyntaxKind.StaticKeyword)];
|
|
2848
2805
|
const typeRef = translateType(decl.type, original.getSourceFile(), reflector, refEmitter, imports);
|
|
2849
2806
|
markForEmitAsSingleLine(typeRef);
|
|
2850
|
-
return
|
|
2807
|
+
return ts9.factory.createPropertyDeclaration(
|
|
2851
2808
|
modifiers,
|
|
2852
2809
|
decl.name,
|
|
2853
2810
|
void 0,
|
|
@@ -2855,7 +2812,7 @@ var IvyDeclarationDtsTransform = class {
|
|
|
2855
2812
|
void 0
|
|
2856
2813
|
);
|
|
2857
2814
|
});
|
|
2858
|
-
return
|
|
2815
|
+
return ts9.factory.updateClassDeclaration(
|
|
2859
2816
|
clazz,
|
|
2860
2817
|
clazz.modifiers,
|
|
2861
2818
|
clazz.name,
|
|
@@ -2866,16 +2823,16 @@ var IvyDeclarationDtsTransform = class {
|
|
|
2866
2823
|
}
|
|
2867
2824
|
};
|
|
2868
2825
|
function markForEmitAsSingleLine(node) {
|
|
2869
|
-
|
|
2870
|
-
|
|
2826
|
+
ts9.setEmitFlags(node, ts9.EmitFlags.SingleLine);
|
|
2827
|
+
ts9.forEachChild(node, markForEmitAsSingleLine);
|
|
2871
2828
|
}
|
|
2872
2829
|
|
|
2873
2830
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
2874
2831
|
import { ConstantPool } from "@angular/compiler";
|
|
2875
|
-
import
|
|
2832
|
+
import ts11 from "typescript";
|
|
2876
2833
|
|
|
2877
2834
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
|
|
2878
|
-
import
|
|
2835
|
+
import ts10 from "typescript";
|
|
2879
2836
|
function visit(node, visitor, context) {
|
|
2880
2837
|
return visitor._visit(node, context);
|
|
2881
2838
|
}
|
|
@@ -2899,13 +2856,13 @@ var Visitor = class {
|
|
|
2899
2856
|
}
|
|
2900
2857
|
_visit(node, context) {
|
|
2901
2858
|
let visitedNode = null;
|
|
2902
|
-
node =
|
|
2903
|
-
if (
|
|
2859
|
+
node = ts10.visitEachChild(node, (child) => child && this._visit(child, context), context);
|
|
2860
|
+
if (ts10.isClassDeclaration(node)) {
|
|
2904
2861
|
visitedNode = this._visitListEntryNode(node, (node2) => this.visitClassDeclaration(node2));
|
|
2905
2862
|
} else {
|
|
2906
2863
|
visitedNode = this.visitOtherNode(node);
|
|
2907
2864
|
}
|
|
2908
|
-
if (visitedNode && (
|
|
2865
|
+
if (visitedNode && (ts10.isBlock(visitedNode) || ts10.isSourceFile(visitedNode))) {
|
|
2909
2866
|
visitedNode = this._maybeProcessStatements(visitedNode);
|
|
2910
2867
|
}
|
|
2911
2868
|
return visitedNode;
|
|
@@ -2926,11 +2883,11 @@ var Visitor = class {
|
|
|
2926
2883
|
this._after.delete(stmt);
|
|
2927
2884
|
}
|
|
2928
2885
|
});
|
|
2929
|
-
const statementsArray =
|
|
2930
|
-
if (
|
|
2931
|
-
return
|
|
2886
|
+
const statementsArray = ts10.factory.createNodeArray(newStatements, node.statements.hasTrailingComma);
|
|
2887
|
+
if (ts10.isBlock(node)) {
|
|
2888
|
+
return ts10.factory.updateBlock(node, statementsArray);
|
|
2932
2889
|
} else {
|
|
2933
|
-
return
|
|
2890
|
+
return ts10.factory.updateSourceFile(node, statementsArray, node.isDeclarationFile, node.referencedFiles, node.typeReferenceDirectives, node.hasNoDefaultLib, node.libReferenceDirectives);
|
|
2934
2891
|
}
|
|
2935
2892
|
}
|
|
2936
2893
|
};
|
|
@@ -2989,30 +2946,31 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
2989
2946
|
};
|
|
2990
2947
|
const statements = [];
|
|
2991
2948
|
const members = [...node.members];
|
|
2949
|
+
const sourceFile = ts11.getOriginalNode(node).getSourceFile();
|
|
2992
2950
|
for (const field of this.classCompilationMap.get(node)) {
|
|
2993
2951
|
if (field.initializer === null) {
|
|
2994
2952
|
continue;
|
|
2995
2953
|
}
|
|
2996
|
-
const exprNode = translateExpression(field.initializer, this.importManager, translateOptions);
|
|
2997
|
-
const property =
|
|
2954
|
+
const exprNode = translateExpression(sourceFile, field.initializer, this.importManager, translateOptions);
|
|
2955
|
+
const property = ts11.factory.createPropertyDeclaration([ts11.factory.createToken(ts11.SyntaxKind.StaticKeyword)], field.name, void 0, void 0, exprNode);
|
|
2998
2956
|
if (this.isClosureCompilerEnabled) {
|
|
2999
|
-
|
|
2957
|
+
ts11.addSyntheticLeadingComment(
|
|
3000
2958
|
property,
|
|
3001
|
-
|
|
2959
|
+
ts11.SyntaxKind.MultiLineCommentTrivia,
|
|
3002
2960
|
"* @nocollapse ",
|
|
3003
2961
|
false
|
|
3004
2962
|
);
|
|
3005
2963
|
}
|
|
3006
|
-
field.statements.map((stmt) => translateStatement(stmt, this.importManager, translateOptions)).forEach((stmt) => statements.push(stmt));
|
|
2964
|
+
field.statements.map((stmt) => translateStatement(sourceFile, stmt, this.importManager, translateOptions)).forEach((stmt) => statements.push(stmt));
|
|
3007
2965
|
members.push(property);
|
|
3008
2966
|
}
|
|
3009
|
-
const filteredDecorators = maybeFilterDecorator(
|
|
3010
|
-
const nodeModifiers =
|
|
2967
|
+
const filteredDecorators = maybeFilterDecorator(ts11.getDecorators(node), this.compilation.decoratorsFor(node));
|
|
2968
|
+
const nodeModifiers = ts11.getModifiers(node);
|
|
3011
2969
|
let updatedModifiers;
|
|
3012
2970
|
if ((filteredDecorators == null ? void 0 : filteredDecorators.length) || (nodeModifiers == null ? void 0 : nodeModifiers.length)) {
|
|
3013
2971
|
updatedModifiers = [...filteredDecorators || [], ...nodeModifiers || []];
|
|
3014
2972
|
}
|
|
3015
|
-
node =
|
|
2973
|
+
node = ts11.factory.updateClassDeclaration(
|
|
3016
2974
|
node,
|
|
3017
2975
|
updatedModifiers,
|
|
3018
2976
|
node.name,
|
|
@@ -3023,7 +2981,7 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
3023
2981
|
return { node, after: statements };
|
|
3024
2982
|
}
|
|
3025
2983
|
visitOtherNode(node) {
|
|
3026
|
-
if (
|
|
2984
|
+
if (ts11.isImportDeclaration(node) && this.deferrableImports.has(node)) {
|
|
3027
2985
|
return null;
|
|
3028
2986
|
}
|
|
3029
2987
|
return node;
|
|
@@ -3041,7 +2999,7 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
3041
2999
|
}
|
|
3042
3000
|
}
|
|
3043
3001
|
_nonCoreDecoratorsOnly(node) {
|
|
3044
|
-
const decorators =
|
|
3002
|
+
const decorators = ts11.getDecorators(node);
|
|
3045
3003
|
if (decorators === void 0) {
|
|
3046
3004
|
return void 0;
|
|
3047
3005
|
}
|
|
@@ -3058,35 +3016,35 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
3058
3016
|
return nodeArrayFromDecoratorsArray(filtered);
|
|
3059
3017
|
}
|
|
3060
3018
|
_stripAngularDecorators(node) {
|
|
3061
|
-
const modifiers =
|
|
3062
|
-
const nonCoreDecorators =
|
|
3019
|
+
const modifiers = ts11.canHaveModifiers(node) ? ts11.getModifiers(node) : void 0;
|
|
3020
|
+
const nonCoreDecorators = ts11.canHaveDecorators(node) ? this._nonCoreDecoratorsOnly(node) : void 0;
|
|
3063
3021
|
const combinedModifiers = [...nonCoreDecorators || [], ...modifiers || []];
|
|
3064
|
-
if (
|
|
3065
|
-
node =
|
|
3066
|
-
} else if (
|
|
3067
|
-
node =
|
|
3068
|
-
} else if (
|
|
3069
|
-
node =
|
|
3070
|
-
} else if (
|
|
3071
|
-
node =
|
|
3072
|
-
} else if (
|
|
3073
|
-
node =
|
|
3074
|
-
} else if (
|
|
3022
|
+
if (ts11.isParameter(node)) {
|
|
3023
|
+
node = ts11.factory.updateParameterDeclaration(node, combinedModifiers, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer);
|
|
3024
|
+
} else if (ts11.isMethodDeclaration(node)) {
|
|
3025
|
+
node = ts11.factory.updateMethodDeclaration(node, combinedModifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body);
|
|
3026
|
+
} else if (ts11.isPropertyDeclaration(node)) {
|
|
3027
|
+
node = ts11.factory.updatePropertyDeclaration(node, combinedModifiers, node.name, node.questionToken, node.type, node.initializer);
|
|
3028
|
+
} else if (ts11.isGetAccessor(node)) {
|
|
3029
|
+
node = ts11.factory.updateGetAccessorDeclaration(node, combinedModifiers, node.name, node.parameters, node.type, node.body);
|
|
3030
|
+
} else if (ts11.isSetAccessor(node)) {
|
|
3031
|
+
node = ts11.factory.updateSetAccessorDeclaration(node, combinedModifiers, node.name, node.parameters, node.body);
|
|
3032
|
+
} else if (ts11.isConstructorDeclaration(node)) {
|
|
3075
3033
|
const parameters = node.parameters.map((param) => this._stripAngularDecorators(param));
|
|
3076
|
-
node =
|
|
3034
|
+
node = ts11.factory.updateConstructorDeclaration(node, modifiers, parameters, node.body);
|
|
3077
3035
|
}
|
|
3078
3036
|
return node;
|
|
3079
3037
|
}
|
|
3080
3038
|
};
|
|
3081
3039
|
function transformIvySourceFile(compilation, context, reflector, importRewriter, localCompilationExtraImportsTracker, file, isCore, isClosureCompilerEnabled, recordWrappedNode) {
|
|
3082
3040
|
const constantPool = new ConstantPool(isClosureCompilerEnabled);
|
|
3083
|
-
const importManager = new ImportManager(importRewriter);
|
|
3041
|
+
const importManager = new ImportManager({ ...presetImportManagerForceNamespaceImports, rewriter: importRewriter });
|
|
3084
3042
|
const compilationVisitor = new IvyCompilationVisitor(compilation, constantPool);
|
|
3085
3043
|
visit(file, compilationVisitor, context);
|
|
3086
3044
|
const transformationVisitor = new IvyTransformationVisitor(compilation, compilationVisitor.classCompilationMap, reflector, importManager, recordWrappedNode, isClosureCompilerEnabled, isCore, compilationVisitor.deferrableImports);
|
|
3087
3045
|
let sf = visit(file, transformationVisitor, context);
|
|
3088
|
-
const downlevelTranslatedCode = getLocalizeCompileTarget(context) <
|
|
3089
|
-
const constants = constantPool.statements.map((stmt) => translateStatement(stmt, importManager, {
|
|
3046
|
+
const downlevelTranslatedCode = getLocalizeCompileTarget(context) < ts11.ScriptTarget.ES2015;
|
|
3047
|
+
const constants = constantPool.statements.map((stmt) => translateStatement(file, stmt, importManager, {
|
|
3090
3048
|
recordWrappedNode,
|
|
3091
3049
|
downlevelTaggedTemplates: downlevelTranslatedCode,
|
|
3092
3050
|
downlevelVariableDeclarations: downlevelTranslatedCode,
|
|
@@ -3095,27 +3053,27 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
3095
3053
|
const fileOverviewMeta = isClosureCompilerEnabled ? getFileOverviewComment(sf.statements) : null;
|
|
3096
3054
|
if (localCompilationExtraImportsTracker !== null) {
|
|
3097
3055
|
for (const moduleName of localCompilationExtraImportsTracker.getImportsForFile(sf)) {
|
|
3098
|
-
importManager.
|
|
3056
|
+
importManager.addSideEffectImport(sf, moduleName);
|
|
3099
3057
|
}
|
|
3100
3058
|
}
|
|
3101
|
-
sf =
|
|
3059
|
+
sf = importManager.transformTsFile(context, sf, constants);
|
|
3102
3060
|
if (fileOverviewMeta !== null) {
|
|
3103
|
-
|
|
3061
|
+
sf = insertFileOverviewComment(sf, fileOverviewMeta);
|
|
3104
3062
|
}
|
|
3105
3063
|
return sf;
|
|
3106
3064
|
}
|
|
3107
3065
|
function getLocalizeCompileTarget(context) {
|
|
3108
|
-
const target = context.getCompilerOptions().target ||
|
|
3109
|
-
return target !==
|
|
3066
|
+
const target = context.getCompilerOptions().target || ts11.ScriptTarget.ES2015;
|
|
3067
|
+
return target !== ts11.ScriptTarget.JSON ? target : ts11.ScriptTarget.ES2015;
|
|
3110
3068
|
}
|
|
3111
3069
|
function getFileOverviewComment(statements) {
|
|
3112
3070
|
if (statements.length > 0) {
|
|
3113
3071
|
const host = statements[0];
|
|
3114
3072
|
let trailing = false;
|
|
3115
|
-
let comments =
|
|
3073
|
+
let comments = ts11.getSyntheticLeadingComments(host);
|
|
3116
3074
|
if (!comments || comments.length === 0) {
|
|
3117
3075
|
trailing = true;
|
|
3118
|
-
comments =
|
|
3076
|
+
comments = ts11.getSyntheticTrailingComments(host);
|
|
3119
3077
|
}
|
|
3120
3078
|
if (comments && comments.length > 0 && CLOSURE_FILE_OVERVIEW_REGEXP.test(comments[0].text)) {
|
|
3121
3079
|
return { comments, host, trailing };
|
|
@@ -3123,26 +3081,29 @@ function getFileOverviewComment(statements) {
|
|
|
3123
3081
|
}
|
|
3124
3082
|
return null;
|
|
3125
3083
|
}
|
|
3126
|
-
function
|
|
3084
|
+
function insertFileOverviewComment(sf, fileoverview) {
|
|
3127
3085
|
const { comments, host, trailing } = fileoverview;
|
|
3128
3086
|
if (sf.statements.length > 0 && host !== sf.statements[0]) {
|
|
3129
3087
|
if (trailing) {
|
|
3130
|
-
|
|
3088
|
+
ts11.setSyntheticTrailingComments(host, void 0);
|
|
3131
3089
|
} else {
|
|
3132
|
-
|
|
3090
|
+
ts11.setSyntheticLeadingComments(host, void 0);
|
|
3133
3091
|
}
|
|
3134
|
-
|
|
3092
|
+
const commentNode = ts11.factory.createNotEmittedStatement(sf);
|
|
3093
|
+
ts11.setSyntheticLeadingComments(commentNode, comments);
|
|
3094
|
+
return ts11.factory.updateSourceFile(sf, [commentNode, ...sf.statements], sf.isDeclarationFile, sf.referencedFiles, sf.typeReferenceDirectives, sf.hasNoDefaultLib, sf.libReferenceDirectives);
|
|
3135
3095
|
}
|
|
3096
|
+
return sf;
|
|
3136
3097
|
}
|
|
3137
3098
|
function maybeFilterDecorator(decorators, toRemove) {
|
|
3138
3099
|
if (decorators === void 0) {
|
|
3139
3100
|
return void 0;
|
|
3140
3101
|
}
|
|
3141
|
-
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) =>
|
|
3102
|
+
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) => ts11.getOriginalNode(dec) === decToRemove) === void 0);
|
|
3142
3103
|
if (filtered.length === 0) {
|
|
3143
3104
|
return void 0;
|
|
3144
3105
|
}
|
|
3145
|
-
return
|
|
3106
|
+
return ts11.factory.createNodeArray(filtered);
|
|
3146
3107
|
}
|
|
3147
3108
|
function isFromAngularCore(decorator) {
|
|
3148
3109
|
return decorator.import !== null && decorator.import.from === "@angular/core";
|
|
@@ -3156,7 +3117,7 @@ function createRecorderFn(defaultImportTracker) {
|
|
|
3156
3117
|
};
|
|
3157
3118
|
}
|
|
3158
3119
|
function nodeArrayFromDecoratorsArray(decorators) {
|
|
3159
|
-
const array =
|
|
3120
|
+
const array = ts11.factory.createNodeArray(decorators);
|
|
3160
3121
|
if (array.length > 0) {
|
|
3161
3122
|
array.pos = decorators[0].pos;
|
|
3162
3123
|
array.end = decorators[decorators.length - 1].end;
|
|
@@ -3193,11 +3154,11 @@ function createValueHasWrongTypeError(node, value, messageText) {
|
|
|
3193
3154
|
}
|
|
3194
3155
|
const chain = {
|
|
3195
3156
|
messageText,
|
|
3196
|
-
category:
|
|
3157
|
+
category: ts12.DiagnosticCategory.Error,
|
|
3197
3158
|
code: 0,
|
|
3198
3159
|
next: [{
|
|
3199
3160
|
messageText: chainedMessage,
|
|
3200
|
-
category:
|
|
3161
|
+
category: ts12.DiagnosticCategory.Message,
|
|
3201
3162
|
code: 0
|
|
3202
3163
|
}]
|
|
3203
3164
|
};
|
|
@@ -3373,7 +3334,7 @@ function assertLocalCompilationUnresolvedConst(compilationMode, value, nodeToHig
|
|
|
3373
3334
|
|
|
3374
3335
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/evaluation.mjs
|
|
3375
3336
|
import { ViewEncapsulation } from "@angular/compiler";
|
|
3376
|
-
import
|
|
3337
|
+
import ts13 from "typescript";
|
|
3377
3338
|
function resolveEnumValue(evaluator, metadata, field, enumSymbolName) {
|
|
3378
3339
|
let resolved = null;
|
|
3379
3340
|
if (metadata.has(field)) {
|
|
@@ -3415,7 +3376,7 @@ function resolveLiteral(decorator, literalCache) {
|
|
|
3415
3376
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, decorator.node, `Incorrect number of arguments to @${decorator.name} decorator`);
|
|
3416
3377
|
}
|
|
3417
3378
|
const meta = unwrapExpression(decorator.args[0]);
|
|
3418
|
-
if (!
|
|
3379
|
+
if (!ts13.isObjectLiteralExpression(meta)) {
|
|
3419
3380
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `Decorator argument must be literal.`);
|
|
3420
3381
|
}
|
|
3421
3382
|
literalCache.set(decorator, meta);
|
|
@@ -3473,7 +3434,7 @@ var InjectableClassRegistry = class {
|
|
|
3473
3434
|
|
|
3474
3435
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/metadata.mjs
|
|
3475
3436
|
import { ArrowFunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, WrappedNodeExpr as WrappedNodeExpr3 } from "@angular/compiler";
|
|
3476
|
-
import
|
|
3437
|
+
import ts14 from "typescript";
|
|
3477
3438
|
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
|
|
3478
3439
|
if (!reflection.isClass(clazz)) {
|
|
3479
3440
|
return null;
|
|
@@ -3487,7 +3448,7 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
3487
3448
|
if (ngClassDecorators.length === 0) {
|
|
3488
3449
|
return null;
|
|
3489
3450
|
}
|
|
3490
|
-
const metaDecorators = new WrappedNodeExpr3(
|
|
3451
|
+
const metaDecorators = new WrappedNodeExpr3(ts14.factory.createArrayLiteralExpression(ngClassDecorators));
|
|
3491
3452
|
let metaCtorParameters = null;
|
|
3492
3453
|
const classCtorParameters = reflection.getConstructorParameters(clazz);
|
|
3493
3454
|
if (classCtorParameters !== null) {
|
|
@@ -3505,7 +3466,7 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
3505
3466
|
return classMemberToMetadata((_a = member.nameNode) != null ? _a : member.name, member.decorators, isCore);
|
|
3506
3467
|
});
|
|
3507
3468
|
if (decoratedMembers.length > 0) {
|
|
3508
|
-
metaPropDecorators = new WrappedNodeExpr3(
|
|
3469
|
+
metaPropDecorators = new WrappedNodeExpr3(ts14.factory.createObjectLiteralExpression(decoratedMembers));
|
|
3509
3470
|
}
|
|
3510
3471
|
return {
|
|
3511
3472
|
type: new WrappedNodeExpr3(id),
|
|
@@ -3521,37 +3482,37 @@ function ctorParameterToMetadata(param, isCore) {
|
|
|
3521
3482
|
];
|
|
3522
3483
|
if (param.decorators !== null) {
|
|
3523
3484
|
const ngDecorators = param.decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
3524
|
-
const value = new WrappedNodeExpr3(
|
|
3485
|
+
const value = new WrappedNodeExpr3(ts14.factory.createArrayLiteralExpression(ngDecorators));
|
|
3525
3486
|
mapEntries.push({ key: "decorators", value, quoted: false });
|
|
3526
3487
|
}
|
|
3527
3488
|
return literalMap(mapEntries);
|
|
3528
3489
|
}
|
|
3529
3490
|
function classMemberToMetadata(name, decorators, isCore) {
|
|
3530
3491
|
const ngDecorators = decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
3531
|
-
const decoratorMeta =
|
|
3532
|
-
return
|
|
3492
|
+
const decoratorMeta = ts14.factory.createArrayLiteralExpression(ngDecorators);
|
|
3493
|
+
return ts14.factory.createPropertyAssignment(name, decoratorMeta);
|
|
3533
3494
|
}
|
|
3534
3495
|
function decoratorToMetadata(decorator, wrapFunctionsInParens) {
|
|
3535
3496
|
if (decorator.identifier === null) {
|
|
3536
3497
|
throw new Error("Illegal state: synthesized decorator cannot be emitted in class metadata.");
|
|
3537
3498
|
}
|
|
3538
3499
|
const properties = [
|
|
3539
|
-
|
|
3500
|
+
ts14.factory.createPropertyAssignment("type", decorator.identifier)
|
|
3540
3501
|
];
|
|
3541
3502
|
if (decorator.args !== null && decorator.args.length > 0) {
|
|
3542
3503
|
const args = decorator.args.map((arg) => {
|
|
3543
3504
|
return wrapFunctionsInParens ? wrapFunctionExpressionsInParens(arg) : arg;
|
|
3544
3505
|
});
|
|
3545
|
-
properties.push(
|
|
3506
|
+
properties.push(ts14.factory.createPropertyAssignment("args", ts14.factory.createArrayLiteralExpression(args)));
|
|
3546
3507
|
}
|
|
3547
|
-
return
|
|
3508
|
+
return ts14.factory.createObjectLiteralExpression(properties, true);
|
|
3548
3509
|
}
|
|
3549
3510
|
function isAngularDecorator2(decorator, isCore) {
|
|
3550
3511
|
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
3551
3512
|
}
|
|
3552
3513
|
function removeIdentifierReferences(node, names) {
|
|
3553
|
-
const result =
|
|
3554
|
-
return
|
|
3514
|
+
const result = ts14.transform(node, [(context) => (root) => ts14.visitNode(root, function walk(current) {
|
|
3515
|
+
return ts14.isIdentifier(current) && (typeof names === "string" ? current.text === names : names.has(current.text)) ? ts14.factory.createIdentifier(current.text) : ts14.visitEachChild(current, walk, context);
|
|
3555
3516
|
})]);
|
|
3556
3517
|
return result.transformed[0];
|
|
3557
3518
|
}
|
|
@@ -3638,11 +3599,11 @@ function compileInputTransformFields(inputs) {
|
|
|
3638
3599
|
}
|
|
3639
3600
|
|
|
3640
3601
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
|
|
3641
|
-
import { compileClassDebugInfo, compileComponentClassMetadata,
|
|
3642
|
-
import
|
|
3602
|
+
import { compileClassDebugInfo, compileComponentClassMetadata, compileComponentDeclareClassMetadata, compileComponentFromMetadata, compileDeclareComponentFromMetadata, compileDeferResolverFunction, CssSelector as CssSelector2, DEFAULT_INTERPOLATION_CONFIG as DEFAULT_INTERPOLATION_CONFIG2, DomElementSchemaRegistry, ExternalExpr as ExternalExpr6, FactoryTarget as FactoryTarget3, makeBindingParser as makeBindingParser2, outputAst as o2, R3TargetBinder, R3TemplateDependencyKind, SelectorMatcher as SelectorMatcher2, ViewEncapsulation as ViewEncapsulation2 } from "@angular/compiler";
|
|
3603
|
+
import ts26 from "typescript";
|
|
3643
3604
|
|
|
3644
3605
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
3645
|
-
import
|
|
3606
|
+
import ts15 from "typescript";
|
|
3646
3607
|
var SemanticSymbol = class {
|
|
3647
3608
|
constructor(decl) {
|
|
3648
3609
|
this.decl = decl;
|
|
@@ -3651,7 +3612,7 @@ var SemanticSymbol = class {
|
|
|
3651
3612
|
}
|
|
3652
3613
|
};
|
|
3653
3614
|
function getSymbolIdentifier(decl) {
|
|
3654
|
-
if (!
|
|
3615
|
+
if (!ts15.isSourceFile(decl.parent)) {
|
|
3655
3616
|
return null;
|
|
3656
3617
|
}
|
|
3657
3618
|
return decl.name.text;
|
|
@@ -3801,7 +3762,7 @@ function getImportPath(expr) {
|
|
|
3801
3762
|
}
|
|
3802
3763
|
|
|
3803
3764
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
3804
|
-
import
|
|
3765
|
+
import ts16 from "typescript";
|
|
3805
3766
|
|
|
3806
3767
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/util.mjs
|
|
3807
3768
|
function isSymbolEqual(a, b) {
|
|
@@ -3855,7 +3816,7 @@ function isSetEqual(a, b, equalityTester = referenceEquality) {
|
|
|
3855
3816
|
|
|
3856
3817
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
3857
3818
|
function extractSemanticTypeParameters(node) {
|
|
3858
|
-
if (!
|
|
3819
|
+
if (!ts16.isClassDeclaration(node) || node.typeParameters === void 0) {
|
|
3859
3820
|
return null;
|
|
3860
3821
|
}
|
|
3861
3822
|
return node.typeParameters.map((typeParam) => ({ hasGenericTypeBound: typeParam.constraint !== void 0 }));
|
|
@@ -3983,7 +3944,7 @@ var MetadataDtsModuleScopeResolver = class {
|
|
|
3983
3944
|
|
|
3984
3945
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/local.mjs
|
|
3985
3946
|
import { ExternalExpr as ExternalExpr3 } from "@angular/compiler";
|
|
3986
|
-
import
|
|
3947
|
+
import ts17 from "typescript";
|
|
3987
3948
|
|
|
3988
3949
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/util.mjs
|
|
3989
3950
|
function getDiagnosticNode(ref, rawExpr) {
|
|
@@ -4239,7 +4200,7 @@ var LocalModuleScopeRegistry = class {
|
|
|
4239
4200
|
}
|
|
4240
4201
|
getExportedScope(ref, diagnostics, ownerForErrors, type) {
|
|
4241
4202
|
if (ref.node.getSourceFile().isDeclarationFile) {
|
|
4242
|
-
if (!
|
|
4203
|
+
if (!ts17.isClassDeclaration(ref.node)) {
|
|
4243
4204
|
const code = type === "import" ? ErrorCode.NGMODULE_INVALID_IMPORT : ErrorCode.NGMODULE_INVALID_EXPORT;
|
|
4244
4205
|
diagnostics.push(makeDiagnostic(code, identifierOfNode(ref.node) || ref.node, `Appears in the NgModule.${type}s of ${nodeNameForError(ownerForErrors)}, but could not be resolved to an NgModule`));
|
|
4245
4206
|
return "invalid";
|
|
@@ -4352,7 +4313,7 @@ function reexportCollision(module, refA, refB) {
|
|
|
4352
4313
|
|
|
4353
4314
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/typecheck.mjs
|
|
4354
4315
|
import { CssSelector, SelectorMatcher } from "@angular/compiler";
|
|
4355
|
-
import
|
|
4316
|
+
import ts18 from "typescript";
|
|
4356
4317
|
var TypeCheckScopeRegistry = class {
|
|
4357
4318
|
constructor(scopeReader, metaReader, hostDirectivesResolver) {
|
|
4358
4319
|
this.scopeReader = scopeReader;
|
|
@@ -4395,8 +4356,8 @@ var TypeCheckScopeRegistry = class {
|
|
|
4395
4356
|
matcher.addSelectables(CssSelector.parse(meta.selector), [...this.hostDirectivesResolver.resolve(directiveMeta), directiveMeta]);
|
|
4396
4357
|
directives.push(directiveMeta);
|
|
4397
4358
|
} else if (meta.kind === MetaKind.Pipe) {
|
|
4398
|
-
if (!
|
|
4399
|
-
throw new Error(`Unexpected non-class declaration ${
|
|
4359
|
+
if (!ts18.isClassDeclaration(meta.ref.node)) {
|
|
4360
|
+
throw new Error(`Unexpected non-class declaration ${ts18.SyntaxKind[meta.ref.node.kind]} for pipe ${meta.ref.debugName}`);
|
|
4400
4361
|
}
|
|
4401
4362
|
pipes.set(meta.name, meta);
|
|
4402
4363
|
}
|
|
@@ -4433,32 +4394,39 @@ import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirect
|
|
|
4433
4394
|
|
|
4434
4395
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.mjs
|
|
4435
4396
|
import { createMayBeForwardRefExpression as createMayBeForwardRefExpression2, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr4, getSafePropertyAccessString, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr5 } from "@angular/compiler";
|
|
4436
|
-
import
|
|
4397
|
+
import ts22 from "typescript";
|
|
4398
|
+
|
|
4399
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/initializer_function_access.mjs
|
|
4400
|
+
function validateAccessOfInitializerApiMember({ api, call }, member) {
|
|
4401
|
+
if (!api.allowedAccessLevels.includes(member.accessLevel)) {
|
|
4402
|
+
throw new FatalDiagnosticError(ErrorCode.INITIALIZER_API_DISALLOWED_MEMBER_VISIBILITY, call, makeDiagnosticChain(`Cannot use "${api.functionName}" on a class member that is declared as ${classMemberAccessLevelToString(member.accessLevel)}.`, [makeDiagnosticChain(`Update the class field to be either: ` + api.allowedAccessLevels.map((l) => classMemberAccessLevelToString(l)).join(", "))]));
|
|
4403
|
+
}
|
|
4404
|
+
}
|
|
4437
4405
|
|
|
4438
4406
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/initializer_functions.mjs
|
|
4439
|
-
import
|
|
4440
|
-
function
|
|
4441
|
-
if (
|
|
4407
|
+
import ts19 from "typescript";
|
|
4408
|
+
function tryParseInitializerApi(functions, expression, reflector, importTracker) {
|
|
4409
|
+
if (!ts19.isCallExpression(expression)) {
|
|
4442
4410
|
return null;
|
|
4443
4411
|
}
|
|
4444
|
-
const
|
|
4445
|
-
const staticResult = parseTopLevelCall(call, functions, importTracker) || parseTopLevelRequiredCall(call, functions, importTracker) || parseTopLevelCallFromNamespace(call, functions, importTracker);
|
|
4412
|
+
const staticResult = parseTopLevelCall(expression, functions, importTracker) || parseTopLevelRequiredCall(expression, functions, importTracker) || parseTopLevelCallFromNamespace(expression, functions, importTracker);
|
|
4446
4413
|
if (staticResult === null) {
|
|
4447
4414
|
return null;
|
|
4448
4415
|
}
|
|
4449
|
-
const
|
|
4450
|
-
|
|
4416
|
+
const { api, apiReference, isRequired } = staticResult;
|
|
4417
|
+
const resolvedImport = reflector.getImportOfIdentifier(apiReference);
|
|
4418
|
+
if (resolvedImport === null || api.functionName !== resolvedImport.name || api.owningModule !== resolvedImport.from) {
|
|
4451
4419
|
return null;
|
|
4452
4420
|
}
|
|
4453
4421
|
return {
|
|
4454
|
-
api
|
|
4455
|
-
call,
|
|
4456
|
-
isRequired
|
|
4422
|
+
api,
|
|
4423
|
+
call: expression,
|
|
4424
|
+
isRequired
|
|
4457
4425
|
};
|
|
4458
4426
|
}
|
|
4459
4427
|
function parseTopLevelCall(call, functions, importTracker) {
|
|
4460
4428
|
const node = call.expression;
|
|
4461
|
-
if (!
|
|
4429
|
+
if (!ts19.isIdentifier(node)) {
|
|
4462
4430
|
return null;
|
|
4463
4431
|
}
|
|
4464
4432
|
const matchingApi = functions.find((fn) => importTracker.isPotentialReferenceToNamedImport(node, fn.functionName, fn.owningModule));
|
|
@@ -4469,7 +4437,7 @@ function parseTopLevelCall(call, functions, importTracker) {
|
|
|
4469
4437
|
}
|
|
4470
4438
|
function parseTopLevelRequiredCall(call, functions, importTracker) {
|
|
4471
4439
|
const node = call.expression;
|
|
4472
|
-
if (!
|
|
4440
|
+
if (!ts19.isPropertyAccessExpression(node) || !ts19.isIdentifier(node.expression) || node.name.text !== "required") {
|
|
4473
4441
|
return null;
|
|
4474
4442
|
}
|
|
4475
4443
|
const expression = node.expression;
|
|
@@ -4481,17 +4449,17 @@ function parseTopLevelRequiredCall(call, functions, importTracker) {
|
|
|
4481
4449
|
}
|
|
4482
4450
|
function parseTopLevelCallFromNamespace(call, functions, importTracker) {
|
|
4483
4451
|
const node = call.expression;
|
|
4484
|
-
if (!
|
|
4452
|
+
if (!ts19.isPropertyAccessExpression(node)) {
|
|
4485
4453
|
return null;
|
|
4486
4454
|
}
|
|
4487
4455
|
let apiReference = null;
|
|
4488
4456
|
let matchingApi = void 0;
|
|
4489
4457
|
let isRequired = false;
|
|
4490
|
-
if (
|
|
4458
|
+
if (ts19.isIdentifier(node.expression) && ts19.isIdentifier(node.name)) {
|
|
4491
4459
|
const namespaceRef = node.expression;
|
|
4492
4460
|
apiReference = node.name;
|
|
4493
4461
|
matchingApi = functions.find((fn) => node.name.text === fn.functionName && importTracker.isPotentialReferenceToNamespaceImport(namespaceRef, fn.owningModule));
|
|
4494
|
-
} else if (
|
|
4462
|
+
} else if (ts19.isPropertyAccessExpression(node.expression) && ts19.isIdentifier(node.expression.expression) && ts19.isIdentifier(node.expression.name) && node.name.text === "required") {
|
|
4495
4463
|
const potentialName = node.expression.name.text;
|
|
4496
4464
|
const namespaceRef = node.expression.expression;
|
|
4497
4465
|
apiReference = node.expression.name;
|
|
@@ -4505,16 +4473,16 @@ function parseTopLevelCallFromNamespace(call, functions, importTracker) {
|
|
|
4505
4473
|
}
|
|
4506
4474
|
|
|
4507
4475
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/input_output_parse_options.mjs
|
|
4508
|
-
import
|
|
4476
|
+
import ts20 from "typescript";
|
|
4509
4477
|
function parseAndValidateInputAndOutputOptions(optionsNode) {
|
|
4510
|
-
if (!
|
|
4478
|
+
if (!ts20.isObjectLiteralExpression(optionsNode)) {
|
|
4511
4479
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, optionsNode, "Argument needs to be an object literal that is statically analyzable.");
|
|
4512
4480
|
}
|
|
4513
4481
|
const options = reflectObjectLiteral(optionsNode);
|
|
4514
4482
|
let alias = void 0;
|
|
4515
4483
|
if (options.has("alias")) {
|
|
4516
4484
|
const aliasExpr = options.get("alias");
|
|
4517
|
-
if (!
|
|
4485
|
+
if (!ts20.isStringLiteralLike(aliasExpr)) {
|
|
4518
4486
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, aliasExpr, "Alias needs to be a string that is statically analyzable.");
|
|
4519
4487
|
}
|
|
4520
4488
|
alias = aliasExpr.text;
|
|
@@ -4523,12 +4491,25 @@ function parseAndValidateInputAndOutputOptions(optionsNode) {
|
|
|
4523
4491
|
}
|
|
4524
4492
|
|
|
4525
4493
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/input_function.mjs
|
|
4494
|
+
var INPUT_INITIALIZER_FN = {
|
|
4495
|
+
functionName: "input",
|
|
4496
|
+
owningModule: "@angular/core",
|
|
4497
|
+
allowedAccessLevels: [
|
|
4498
|
+
ClassMemberAccessLevel.PublicWritable,
|
|
4499
|
+
ClassMemberAccessLevel.PublicReadonly,
|
|
4500
|
+
ClassMemberAccessLevel.Protected
|
|
4501
|
+
]
|
|
4502
|
+
};
|
|
4526
4503
|
function tryParseSignalInputMapping(member, reflector, importTracker) {
|
|
4527
4504
|
var _a;
|
|
4528
|
-
|
|
4505
|
+
if (member.value === null) {
|
|
4506
|
+
return null;
|
|
4507
|
+
}
|
|
4508
|
+
const signalInput = tryParseInitializerApi([INPUT_INITIALIZER_FN], member.value, reflector, importTracker);
|
|
4529
4509
|
if (signalInput === null) {
|
|
4530
4510
|
return null;
|
|
4531
4511
|
}
|
|
4512
|
+
validateAccessOfInitializerApiMember(signalInput, member);
|
|
4532
4513
|
const optionsNode = signalInput.isRequired ? signalInput.call.arguments[0] : signalInput.call.arguments[1];
|
|
4533
4514
|
const options = optionsNode !== void 0 ? parseAndValidateInputAndOutputOptions(optionsNode) : null;
|
|
4534
4515
|
const classPropertyName = member.name;
|
|
@@ -4542,12 +4523,25 @@ function tryParseSignalInputMapping(member, reflector, importTracker) {
|
|
|
4542
4523
|
}
|
|
4543
4524
|
|
|
4544
4525
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/model_function.mjs
|
|
4526
|
+
var MODEL_INITIALIZER_FN = {
|
|
4527
|
+
functionName: "model",
|
|
4528
|
+
owningModule: "@angular/core",
|
|
4529
|
+
allowedAccessLevels: [
|
|
4530
|
+
ClassMemberAccessLevel.PublicWritable,
|
|
4531
|
+
ClassMemberAccessLevel.PublicReadonly,
|
|
4532
|
+
ClassMemberAccessLevel.Protected
|
|
4533
|
+
]
|
|
4534
|
+
};
|
|
4545
4535
|
function tryParseSignalModelMapping(member, reflector, importTracker) {
|
|
4546
4536
|
var _a;
|
|
4547
|
-
|
|
4537
|
+
if (member.value === null) {
|
|
4538
|
+
return null;
|
|
4539
|
+
}
|
|
4540
|
+
const model = tryParseInitializerApi([MODEL_INITIALIZER_FN], member.value, reflector, importTracker);
|
|
4548
4541
|
if (model === null) {
|
|
4549
4542
|
return null;
|
|
4550
4543
|
}
|
|
4544
|
+
validateAccessOfInitializerApiMember(model, member);
|
|
4551
4545
|
const optionsNode = model.isRequired ? model.call.arguments[0] : model.call.arguments[1];
|
|
4552
4546
|
const options = optionsNode !== void 0 ? parseAndValidateInputAndOutputOptions(optionsNode) : null;
|
|
4553
4547
|
const classPropertyName = member.name;
|
|
@@ -4570,18 +4564,36 @@ function tryParseSignalModelMapping(member, reflector, importTracker) {
|
|
|
4570
4564
|
}
|
|
4571
4565
|
|
|
4572
4566
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/output_function.mjs
|
|
4567
|
+
var allowedAccessLevels = [
|
|
4568
|
+
ClassMemberAccessLevel.PublicWritable,
|
|
4569
|
+
ClassMemberAccessLevel.PublicReadonly,
|
|
4570
|
+
ClassMemberAccessLevel.Protected
|
|
4571
|
+
];
|
|
4572
|
+
var OUTPUT_INITIALIZER_FNS = [
|
|
4573
|
+
{
|
|
4574
|
+
functionName: "output",
|
|
4575
|
+
owningModule: "@angular/core",
|
|
4576
|
+
allowedAccessLevels
|
|
4577
|
+
},
|
|
4578
|
+
{
|
|
4579
|
+
functionName: "outputFromObservable",
|
|
4580
|
+
owningModule: "@angular/core/rxjs-interop",
|
|
4581
|
+
allowedAccessLevels
|
|
4582
|
+
}
|
|
4583
|
+
];
|
|
4573
4584
|
function tryParseInitializerBasedOutput(member, reflector, importTracker) {
|
|
4574
4585
|
var _a;
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4586
|
+
if (member.value === null) {
|
|
4587
|
+
return null;
|
|
4588
|
+
}
|
|
4589
|
+
const output = tryParseInitializerApi(OUTPUT_INITIALIZER_FNS, member.value, reflector, importTracker);
|
|
4579
4590
|
if (output === null) {
|
|
4580
4591
|
return null;
|
|
4581
4592
|
}
|
|
4582
4593
|
if (output.isRequired) {
|
|
4583
4594
|
throw new FatalDiagnosticError(ErrorCode.INITIALIZER_API_NO_REQUIRED_FUNCTION, output.call, `Output does not support ".required()".`);
|
|
4584
4595
|
}
|
|
4596
|
+
validateAccessOfInitializerApiMember(output, member);
|
|
4585
4597
|
const optionsNode = output.api.functionName === "output" ? output.call.arguments[0] : output.call.arguments[1];
|
|
4586
4598
|
const options = optionsNode !== void 0 ? parseAndValidateInputAndOutputOptions(optionsNode) : null;
|
|
4587
4599
|
const classPropertyName = member.name;
|
|
@@ -4597,15 +4609,28 @@ function tryParseInitializerBasedOutput(member, reflector, importTracker) {
|
|
|
4597
4609
|
|
|
4598
4610
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/query_functions.mjs
|
|
4599
4611
|
import { createMayBeForwardRefExpression, outputAst as o } from "@angular/compiler";
|
|
4600
|
-
import
|
|
4612
|
+
import ts21 from "typescript";
|
|
4601
4613
|
var queryFunctionNames = ["viewChild", "viewChildren", "contentChild", "contentChildren"];
|
|
4614
|
+
var QUERY_INITIALIZER_FNS = queryFunctionNames.map((fnName) => ({
|
|
4615
|
+
functionName: fnName,
|
|
4616
|
+
owningModule: "@angular/core",
|
|
4617
|
+
allowedAccessLevels: [
|
|
4618
|
+
ClassMemberAccessLevel.PublicWritable,
|
|
4619
|
+
ClassMemberAccessLevel.PublicReadonly,
|
|
4620
|
+
ClassMemberAccessLevel.Protected,
|
|
4621
|
+
ClassMemberAccessLevel.Private
|
|
4622
|
+
]
|
|
4623
|
+
}));
|
|
4602
4624
|
var defaultDescendantsValue = (type) => type !== "contentChildren";
|
|
4603
4625
|
function tryParseSignalQueryFromInitializer(member, reflector, importTracker) {
|
|
4604
|
-
|
|
4605
|
-
|
|
4626
|
+
if (member.value === null) {
|
|
4627
|
+
return null;
|
|
4628
|
+
}
|
|
4629
|
+
const query = tryParseInitializerApi(QUERY_INITIALIZER_FNS, member.value, reflector, importTracker);
|
|
4606
4630
|
if (query === null) {
|
|
4607
4631
|
return null;
|
|
4608
4632
|
}
|
|
4633
|
+
validateAccessOfInitializerApiMember(query, member);
|
|
4609
4634
|
const { functionName } = query.api;
|
|
4610
4635
|
const isSingleQuery = functionName === "viewChild" || functionName === "contentChild";
|
|
4611
4636
|
const predicateNode = query.call.arguments[0];
|
|
@@ -4613,7 +4638,7 @@ function tryParseSignalQueryFromInitializer(member, reflector, importTracker) {
|
|
|
4613
4638
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, query.call, "No locator specified.");
|
|
4614
4639
|
}
|
|
4615
4640
|
const optionsNode = query.call.arguments[1];
|
|
4616
|
-
if (optionsNode !== void 0 && !
|
|
4641
|
+
if (optionsNode !== void 0 && !ts21.isObjectLiteralExpression(optionsNode)) {
|
|
4617
4642
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, optionsNode, "Argument needs to be an object literal.");
|
|
4618
4643
|
}
|
|
4619
4644
|
const options = optionsNode && reflectObjectLiteral(optionsNode);
|
|
@@ -4639,24 +4664,24 @@ function parseLocator(expression, reflector) {
|
|
|
4639
4664
|
if (unwrappedExpression !== null) {
|
|
4640
4665
|
expression = unwrappedExpression;
|
|
4641
4666
|
}
|
|
4642
|
-
if (
|
|
4667
|
+
if (ts21.isStringLiteralLike(expression)) {
|
|
4643
4668
|
return [expression.text];
|
|
4644
4669
|
}
|
|
4645
4670
|
return createMayBeForwardRefExpression(new o.WrappedNodeExpr(expression), unwrappedExpression !== null ? 2 : 0);
|
|
4646
4671
|
}
|
|
4647
4672
|
function parseReadOption(value) {
|
|
4648
|
-
if (
|
|
4673
|
+
if (ts21.isExpressionWithTypeArguments(value) || ts21.isParenthesizedExpression(value) || ts21.isAsExpression(value)) {
|
|
4649
4674
|
return parseReadOption(value.expression);
|
|
4650
4675
|
}
|
|
4651
|
-
if (
|
|
4676
|
+
if (ts21.isPropertyAccessExpression(value) && ts21.isIdentifier(value.expression) || ts21.isIdentifier(value)) {
|
|
4652
4677
|
return new o.WrappedNodeExpr(value);
|
|
4653
4678
|
}
|
|
4654
4679
|
throw new FatalDiagnosticError(ErrorCode.VALUE_NOT_LITERAL, value, `Query "read" option expected a literal class reference.`);
|
|
4655
4680
|
}
|
|
4656
4681
|
function parseDescendantsOption(value) {
|
|
4657
|
-
if (value.kind ===
|
|
4682
|
+
if (value.kind === ts21.SyntaxKind.TrueKeyword) {
|
|
4658
4683
|
return true;
|
|
4659
|
-
} else if (value.kind ===
|
|
4684
|
+
} else if (value.kind === ts21.SyntaxKind.FalseKeyword) {
|
|
4660
4685
|
return false;
|
|
4661
4686
|
}
|
|
4662
4687
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, value, `Expected "descendants" option to be a boolean literal.`);
|
|
@@ -4674,7 +4699,7 @@ function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, ev
|
|
|
4674
4699
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, decorator.node, `Incorrect number of arguments to @${decorator.name} decorator`);
|
|
4675
4700
|
} else {
|
|
4676
4701
|
const meta = unwrapExpression(decorator.args[0]);
|
|
4677
|
-
if (!
|
|
4702
|
+
if (!ts22.isObjectLiteralExpression(meta)) {
|
|
4678
4703
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `@${decorator.name} argument must be an object literal`);
|
|
4679
4704
|
}
|
|
4680
4705
|
directive = reflectObjectLiteral(meta);
|
|
@@ -4823,7 +4848,7 @@ function extractDecoratorQueryMetadata(exprNode, name, args, propertyName, refle
|
|
|
4823
4848
|
let emitDistinctChangesOnly = emitDistinctChangesOnlyDefaultValue;
|
|
4824
4849
|
if (args.length === 2) {
|
|
4825
4850
|
const optionsExpr = unwrapExpression(args[1]);
|
|
4826
|
-
if (!
|
|
4851
|
+
if (!ts22.isObjectLiteralExpression(optionsExpr)) {
|
|
4827
4852
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, optionsExpr, `@${name} options must be an object literal`);
|
|
4828
4853
|
}
|
|
4829
4854
|
const options = reflectObjectLiteral(optionsExpr);
|
|
@@ -4922,16 +4947,16 @@ function extractHostBindings(members, evaluator, coreModule, compilationMode, me
|
|
|
4922
4947
|
function extractQueriesFromDecorator(queryData, reflector, evaluator, isCore) {
|
|
4923
4948
|
const content = [];
|
|
4924
4949
|
const view = [];
|
|
4925
|
-
if (!
|
|
4950
|
+
if (!ts22.isObjectLiteralExpression(queryData)) {
|
|
4926
4951
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator queries metadata must be an object literal");
|
|
4927
4952
|
}
|
|
4928
4953
|
reflectObjectLiteral(queryData).forEach((queryExpr, propertyName) => {
|
|
4929
4954
|
queryExpr = unwrapExpression(queryExpr);
|
|
4930
|
-
if (!
|
|
4955
|
+
if (!ts22.isNewExpression(queryExpr)) {
|
|
4931
4956
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
4932
4957
|
}
|
|
4933
|
-
const queryType =
|
|
4934
|
-
if (!
|
|
4958
|
+
const queryType = ts22.isPropertyAccessExpression(queryExpr.expression) ? queryExpr.expression.name : queryExpr.expression;
|
|
4959
|
+
if (!ts22.isIdentifier(queryType)) {
|
|
4935
4960
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
4936
4961
|
}
|
|
4937
4962
|
const type = reflector.getImportOfIdentifier(queryType);
|
|
@@ -5179,7 +5204,7 @@ function parseDecoratorInputTransformFunction(clazz, classPropertyName, value, r
|
|
|
5179
5204
|
}
|
|
5180
5205
|
return {
|
|
5181
5206
|
node: node2,
|
|
5182
|
-
type: new Reference(
|
|
5207
|
+
type: new Reference(ts22.factory.createKeywordTypeNode(ts22.SyntaxKind.UnknownKeyword))
|
|
5183
5208
|
};
|
|
5184
5209
|
}
|
|
5185
5210
|
const definition = reflector.getDefinitionOfFunction(value.node);
|
|
@@ -5207,7 +5232,7 @@ function parseDecoratorInputTransformFunction(clazz, classPropertyName, value, r
|
|
|
5207
5232
|
if (!firstParam) {
|
|
5208
5233
|
return {
|
|
5209
5234
|
node,
|
|
5210
|
-
type: new Reference(
|
|
5235
|
+
type: new Reference(ts22.factory.createKeywordTypeNode(ts22.SyntaxKind.UnknownKeyword))
|
|
5211
5236
|
};
|
|
5212
5237
|
}
|
|
5213
5238
|
if (!firstParam.type) {
|
|
@@ -5222,7 +5247,7 @@ function parseDecoratorInputTransformFunction(clazz, classPropertyName, value, r
|
|
|
5222
5247
|
}
|
|
5223
5248
|
function assertEmittableInputType(type, contextFile, reflector, refEmitter) {
|
|
5224
5249
|
(function walk(node) {
|
|
5225
|
-
if (
|
|
5250
|
+
if (ts22.isTypeReferenceNode(node) && ts22.isIdentifier(node.typeName)) {
|
|
5226
5251
|
const declaration = reflector.getDeclarationOfIdentifier(node.typeName);
|
|
5227
5252
|
if (declaration !== null) {
|
|
5228
5253
|
if (declaration.node.getSourceFile() !== contextFile) {
|
|
@@ -5402,7 +5427,7 @@ function extractHostDirectives(rawHostDirectives, evaluator, compilationMode) {
|
|
|
5402
5427
|
let directive;
|
|
5403
5428
|
let nameForErrors = (fieldName) => "@Directive.hostDirectives";
|
|
5404
5429
|
if (compilationMode === CompilationMode.LOCAL && hostReference instanceof DynamicValue) {
|
|
5405
|
-
if (!
|
|
5430
|
+
if (!ts22.isIdentifier(hostReference.node) && !ts22.isPropertyAccessExpression(hostReference.node)) {
|
|
5406
5431
|
throw new FatalDiagnosticError(ErrorCode.LOCAL_COMPILATION_UNSUPPORTED_EXPRESSION, hostReference.node, `In local compilation mode, host directive cannot be an expression. Use an identifier instead`);
|
|
5407
5432
|
}
|
|
5408
5433
|
directive = new WrappedNodeExpr5(hostReference.node);
|
|
@@ -5732,16 +5757,16 @@ var DirectiveDecoratorHandler = class {
|
|
|
5732
5757
|
|
|
5733
5758
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.mjs
|
|
5734
5759
|
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, ExternalExpr as ExternalExpr5, FactoryTarget as FactoryTarget2, FunctionExpr, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2, R3Identifiers, R3NgModuleMetadataKind, R3SelectorScopeMode, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
5735
|
-
import
|
|
5760
|
+
import ts24 from "typescript";
|
|
5736
5761
|
|
|
5737
5762
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/module_with_providers.mjs
|
|
5738
|
-
import
|
|
5763
|
+
import ts23 from "typescript";
|
|
5739
5764
|
function createModuleWithProvidersResolver(reflector, isCore) {
|
|
5740
5765
|
function _reflectModuleFromTypeParam(type, node) {
|
|
5741
|
-
if (!
|
|
5766
|
+
if (!ts23.isTypeReferenceNode(type)) {
|
|
5742
5767
|
return null;
|
|
5743
5768
|
}
|
|
5744
|
-
const typeName = type && (
|
|
5769
|
+
const typeName = type && (ts23.isIdentifier(type.typeName) && type.typeName || ts23.isQualifiedName(type.typeName) && type.typeName.right) || null;
|
|
5745
5770
|
if (typeName === null) {
|
|
5746
5771
|
return null;
|
|
5747
5772
|
}
|
|
@@ -5753,7 +5778,7 @@ function createModuleWithProvidersResolver(reflector, isCore) {
|
|
|
5753
5778
|
return null;
|
|
5754
5779
|
}
|
|
5755
5780
|
if (type.typeArguments === void 0 || type.typeArguments.length !== 1) {
|
|
5756
|
-
const parent =
|
|
5781
|
+
const parent = ts23.isMethodDeclaration(node) && ts23.isClassDeclaration(node.parent) ? node.parent : null;
|
|
5757
5782
|
const symbolName = (parent && parent.name ? parent.name.getText() + "." : "") + (node.name ? node.name.getText() : "anonymous");
|
|
5758
5783
|
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.`);
|
|
5759
5784
|
}
|
|
@@ -5761,15 +5786,15 @@ function createModuleWithProvidersResolver(reflector, isCore) {
|
|
|
5761
5786
|
return typeNodeToValueExpr(arg);
|
|
5762
5787
|
}
|
|
5763
5788
|
function _reflectModuleFromLiteralType(type) {
|
|
5764
|
-
if (!
|
|
5789
|
+
if (!ts23.isIntersectionTypeNode(type)) {
|
|
5765
5790
|
return null;
|
|
5766
5791
|
}
|
|
5767
5792
|
for (const t of type.types) {
|
|
5768
|
-
if (
|
|
5793
|
+
if (ts23.isTypeLiteralNode(t)) {
|
|
5769
5794
|
for (const m of t.members) {
|
|
5770
|
-
const ngModuleType =
|
|
5795
|
+
const ngModuleType = ts23.isPropertySignature(m) && ts23.isIdentifier(m.name) && m.name.text === "ngModule" && m.type || null;
|
|
5771
5796
|
let ngModuleExpression = null;
|
|
5772
|
-
if (ngModuleType !== null &&
|
|
5797
|
+
if (ngModuleType !== null && ts23.isTypeQueryNode(ngModuleType)) {
|
|
5773
5798
|
ngModuleExpression = entityNameToValue(ngModuleType.exprName);
|
|
5774
5799
|
} else if (ngModuleType !== null) {
|
|
5775
5800
|
ngModuleExpression = typeNodeToValueExpr(ngModuleType);
|
|
@@ -5917,8 +5942,8 @@ var NgModuleDecoratorHandler = class {
|
|
|
5917
5942
|
if (decorator.args === null || decorator.args.length > 1) {
|
|
5918
5943
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, decorator.node, `Incorrect number of arguments to @NgModule decorator`);
|
|
5919
5944
|
}
|
|
5920
|
-
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) :
|
|
5921
|
-
if (!
|
|
5945
|
+
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) : ts24.factory.createObjectLiteralExpression([]);
|
|
5946
|
+
if (!ts24.isObjectLiteralExpression(meta)) {
|
|
5922
5947
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@NgModule argument must be an object literal");
|
|
5923
5948
|
}
|
|
5924
5949
|
const ngModule = reflectObjectLiteral(meta);
|
|
@@ -5991,7 +6016,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
5991
6016
|
id = new WrappedNodeExpr7(idExpr);
|
|
5992
6017
|
} else {
|
|
5993
6018
|
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.`);
|
|
5994
|
-
diag.category =
|
|
6019
|
+
diag.category = ts24.DiagnosticCategory.Warning;
|
|
5995
6020
|
diagnostics.push(diag);
|
|
5996
6021
|
}
|
|
5997
6022
|
}
|
|
@@ -6043,16 +6068,16 @@ var NgModuleDecoratorHandler = class {
|
|
|
6043
6068
|
}
|
|
6044
6069
|
const rawProviders = ngModule.has("providers") ? ngModule.get("providers") : null;
|
|
6045
6070
|
let wrappedProviders = null;
|
|
6046
|
-
if (rawProviders !== null && (!
|
|
6071
|
+
if (rawProviders !== null && (!ts24.isArrayLiteralExpression(rawProviders) || rawProviders.elements.length > 0)) {
|
|
6047
6072
|
wrappedProviders = new WrappedNodeExpr7(this.annotateForClosureCompiler ? wrapFunctionExpressionsInParens(rawProviders) : rawProviders);
|
|
6048
6073
|
}
|
|
6049
6074
|
const topLevelImports = [];
|
|
6050
6075
|
if (this.compilationMode !== CompilationMode.LOCAL && ngModule.has("imports")) {
|
|
6051
6076
|
const rawImports2 = unwrapExpression(ngModule.get("imports"));
|
|
6052
6077
|
let topLevelExpressions = [];
|
|
6053
|
-
if (
|
|
6078
|
+
if (ts24.isArrayLiteralExpression(rawImports2)) {
|
|
6054
6079
|
for (const element of rawImports2.elements) {
|
|
6055
|
-
if (
|
|
6080
|
+
if (ts24.isSpreadElement(element)) {
|
|
6056
6081
|
topLevelExpressions.push(element.expression);
|
|
6057
6082
|
continue;
|
|
6058
6083
|
}
|
|
@@ -6091,7 +6116,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
6091
6116
|
if (exp === null) {
|
|
6092
6117
|
continue;
|
|
6093
6118
|
}
|
|
6094
|
-
if (
|
|
6119
|
+
if (ts24.isArrayLiteralExpression(exp)) {
|
|
6095
6120
|
if (exp.elements) {
|
|
6096
6121
|
injectorMetadata.imports.push(...exp.elements.map((n) => new WrappedNodeExpr7(n)));
|
|
6097
6122
|
}
|
|
@@ -6405,7 +6430,7 @@ function isNgModule(node, compilation) {
|
|
|
6405
6430
|
return !compilation.dependencies.some((dep) => dep.ref.node === node);
|
|
6406
6431
|
}
|
|
6407
6432
|
function isModuleIdExpression(expr) {
|
|
6408
|
-
return
|
|
6433
|
+
return ts24.isPropertyAccessExpression(expr) && ts24.isIdentifier(expr.expression) && expr.expression.text === "module" && expr.name.text === "id";
|
|
6409
6434
|
}
|
|
6410
6435
|
function makeStandaloneBootstrapDiagnostic(ngModuleClass, bootstrappedClassRef, rawBootstrapExpr) {
|
|
6411
6436
|
const componentClassName = bootstrappedClassRef.node.name.text;
|
|
@@ -6442,7 +6467,7 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
6442
6467
|
|
|
6443
6468
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/resources.mjs
|
|
6444
6469
|
import { DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, ParseSourceFile as ParseSourceFile2, parseTemplate } from "@angular/compiler";
|
|
6445
|
-
import
|
|
6470
|
+
import ts25 from "typescript";
|
|
6446
6471
|
function getTemplateDeclarationNodeForError(declaration) {
|
|
6447
6472
|
return declaration.isInline ? declaration.expression : declaration.templateUrlExpression;
|
|
6448
6473
|
}
|
|
@@ -6454,7 +6479,7 @@ function extractTemplate(node, template, evaluator, depTracker, resourceLoader,
|
|
|
6454
6479
|
let sourceMapping;
|
|
6455
6480
|
let escapedString = false;
|
|
6456
6481
|
let sourceMapUrl;
|
|
6457
|
-
if (
|
|
6482
|
+
if (ts25.isStringLiteral(template.expression) || ts25.isNoSubstitutionTemplateLiteral(template.expression)) {
|
|
6458
6483
|
sourceParseRange = getTemplateRange(template.expression);
|
|
6459
6484
|
sourceStr = template.expression.getSourceFile().text;
|
|
6460
6485
|
templateContent = template.expression.text;
|
|
@@ -6631,7 +6656,7 @@ function preloadAndParseTemplate(evaluator, resourceLoader, depTracker, preanaly
|
|
|
6631
6656
|
}
|
|
6632
6657
|
function getTemplateRange(templateExpr) {
|
|
6633
6658
|
const startPos = templateExpr.getStart() + 1;
|
|
6634
|
-
const { line, character } =
|
|
6659
|
+
const { line, character } = ts25.getLineAndCharacterOfPosition(templateExpr.getSourceFile(), startPos);
|
|
6635
6660
|
return {
|
|
6636
6661
|
startPos,
|
|
6637
6662
|
startLine: line,
|
|
@@ -6664,7 +6689,7 @@ function transformDecoratorResources(dec, component, styles, template) {
|
|
|
6664
6689
|
const metadata = new Map(component);
|
|
6665
6690
|
if (metadata.has("templateUrl")) {
|
|
6666
6691
|
metadata.delete("templateUrl");
|
|
6667
|
-
metadata.set("template",
|
|
6692
|
+
metadata.set("template", ts25.factory.createStringLiteral(template.content));
|
|
6668
6693
|
}
|
|
6669
6694
|
if (metadata.has("styleUrls") || metadata.has("styleUrl") || metadata.has("styles")) {
|
|
6670
6695
|
metadata.delete("styles");
|
|
@@ -6673,20 +6698,20 @@ function transformDecoratorResources(dec, component, styles, template) {
|
|
|
6673
6698
|
if (styles.length > 0) {
|
|
6674
6699
|
const styleNodes = styles.reduce((result, style) => {
|
|
6675
6700
|
if (style.trim().length > 0) {
|
|
6676
|
-
result.push(
|
|
6701
|
+
result.push(ts25.factory.createStringLiteral(style));
|
|
6677
6702
|
}
|
|
6678
6703
|
return result;
|
|
6679
6704
|
}, []);
|
|
6680
6705
|
if (styleNodes.length > 0) {
|
|
6681
|
-
metadata.set("styles",
|
|
6706
|
+
metadata.set("styles", ts25.factory.createArrayLiteralExpression(styleNodes));
|
|
6682
6707
|
}
|
|
6683
6708
|
}
|
|
6684
6709
|
}
|
|
6685
6710
|
const newMetadataFields = [];
|
|
6686
6711
|
for (const [name, value] of metadata.entries()) {
|
|
6687
|
-
newMetadataFields.push(
|
|
6712
|
+
newMetadataFields.push(ts25.factory.createPropertyAssignment(name, value));
|
|
6688
6713
|
}
|
|
6689
|
-
return { ...dec, args: [
|
|
6714
|
+
return { ...dec, args: [ts25.factory.createObjectLiteralExpression(newMetadataFields)] };
|
|
6690
6715
|
}
|
|
6691
6716
|
function extractComponentStyleUrls(evaluator, component) {
|
|
6692
6717
|
const styleUrlsExpr = component.get("styleUrls");
|
|
@@ -6712,9 +6737,9 @@ function extractComponentStyleUrls(evaluator, component) {
|
|
|
6712
6737
|
}
|
|
6713
6738
|
function extractStyleUrlsFromExpression(evaluator, styleUrlsExpr) {
|
|
6714
6739
|
const styleUrls = [];
|
|
6715
|
-
if (
|
|
6740
|
+
if (ts25.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
6716
6741
|
for (const styleUrlExpr of styleUrlsExpr.elements) {
|
|
6717
|
-
if (
|
|
6742
|
+
if (ts25.isSpreadElement(styleUrlExpr)) {
|
|
6718
6743
|
styleUrls.push(...extractStyleUrlsFromExpression(evaluator, styleUrlExpr.expression));
|
|
6719
6744
|
} else {
|
|
6720
6745
|
const styleUrl = evaluator.evaluate(styleUrlExpr);
|
|
@@ -6746,18 +6771,18 @@ function extractStyleUrlsFromExpression(evaluator, styleUrlsExpr) {
|
|
|
6746
6771
|
function extractStyleResources(resourceLoader, component, containingFile) {
|
|
6747
6772
|
const styles = /* @__PURE__ */ new Set();
|
|
6748
6773
|
function stringLiteralElements(array) {
|
|
6749
|
-
return array.elements.filter((e) =>
|
|
6774
|
+
return array.elements.filter((e) => ts25.isStringLiteralLike(e));
|
|
6750
6775
|
}
|
|
6751
6776
|
const styleUrlExpr = component.get("styleUrl");
|
|
6752
6777
|
const styleUrlsExpr = component.get("styleUrls");
|
|
6753
|
-
if (styleUrlsExpr !== void 0 &&
|
|
6778
|
+
if (styleUrlsExpr !== void 0 && ts25.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
6754
6779
|
for (const expression of stringLiteralElements(styleUrlsExpr)) {
|
|
6755
6780
|
const resource = stringLiteralUrlToResource(resourceLoader, expression, containingFile);
|
|
6756
6781
|
if (resource !== null) {
|
|
6757
6782
|
styles.add(resource);
|
|
6758
6783
|
}
|
|
6759
6784
|
}
|
|
6760
|
-
} else if (styleUrlExpr !== void 0 &&
|
|
6785
|
+
} else if (styleUrlExpr !== void 0 && ts25.isStringLiteralLike(styleUrlExpr)) {
|
|
6761
6786
|
const resource = stringLiteralUrlToResource(resourceLoader, styleUrlExpr, containingFile);
|
|
6762
6787
|
if (resource !== null) {
|
|
6763
6788
|
styles.add(resource);
|
|
@@ -6765,11 +6790,11 @@ function extractStyleResources(resourceLoader, component, containingFile) {
|
|
|
6765
6790
|
}
|
|
6766
6791
|
const stylesExpr = component.get("styles");
|
|
6767
6792
|
if (stylesExpr !== void 0) {
|
|
6768
|
-
if (
|
|
6793
|
+
if (ts25.isArrayLiteralExpression(stylesExpr)) {
|
|
6769
6794
|
for (const expression of stringLiteralElements(stylesExpr)) {
|
|
6770
6795
|
styles.add({ path: null, expression });
|
|
6771
6796
|
}
|
|
6772
|
-
} else if (
|
|
6797
|
+
} else if (ts25.isStringLiteralLike(stylesExpr)) {
|
|
6773
6798
|
styles.add({ path: null, expression: stylesExpr });
|
|
6774
6799
|
}
|
|
6775
6800
|
}
|
|
@@ -7324,7 +7349,7 @@ var ComponentDecoratorHandler = class {
|
|
|
7324
7349
|
}
|
|
7325
7350
|
typeCheck(ctx, node, meta) {
|
|
7326
7351
|
var _a;
|
|
7327
|
-
if (this.typeCheckScopeRegistry === null || !
|
|
7352
|
+
if (this.typeCheckScopeRegistry === null || !ts26.isClassDeclaration(node)) {
|
|
7328
7353
|
return;
|
|
7329
7354
|
}
|
|
7330
7355
|
if (meta.isPoisoned && !this.usePoisonedData) {
|
|
@@ -7615,17 +7640,17 @@ var ComponentDecoratorHandler = class {
|
|
|
7615
7640
|
if (analysis.template.errors !== null && analysis.template.errors.length > 0) {
|
|
7616
7641
|
return [];
|
|
7617
7642
|
}
|
|
7618
|
-
const
|
|
7643
|
+
const perComponentDeferredDeps = this.resolveAllDeferredDependencies(resolution);
|
|
7619
7644
|
const meta = {
|
|
7620
7645
|
...analysis.meta,
|
|
7621
7646
|
...resolution,
|
|
7622
7647
|
defer: this.compileDeferBlocks(resolution)
|
|
7623
7648
|
};
|
|
7624
7649
|
const fac = compileNgFactoryDefField(toFactoryMetadata(meta, FactoryTarget3.Component));
|
|
7625
|
-
removeDeferrableTypesFromComponentDecorator(analysis,
|
|
7650
|
+
removeDeferrableTypesFromComponentDecorator(analysis, perComponentDeferredDeps);
|
|
7626
7651
|
const def = compileComponentFromMetadata(meta, pool, makeBindingParser2());
|
|
7627
7652
|
const inputTransformFields = compileInputTransformFields(analysis.inputs);
|
|
7628
|
-
const classMetadata = analysis.classMetadata !== null ? compileComponentClassMetadata(analysis.classMetadata,
|
|
7653
|
+
const classMetadata = analysis.classMetadata !== null ? compileComponentClassMetadata(analysis.classMetadata, perComponentDeferredDeps).toStmt() : null;
|
|
7629
7654
|
const debugInfo = analysis.classDebugInfo !== null ? compileClassDebugInfo(analysis.classDebugInfo).toStmt() : null;
|
|
7630
7655
|
const deferrableImports = this.deferredSymbolTracker.getDeferrableImportDecls();
|
|
7631
7656
|
return compileResults(fac, def, classMetadata, "\u0275cmp", inputTransformFields, deferrableImports, debugInfo);
|
|
@@ -7640,6 +7665,7 @@ var ComponentDecoratorHandler = class {
|
|
|
7640
7665
|
isInline: analysis.template.declaration.isInline,
|
|
7641
7666
|
inlineTemplateLiteralExpression: analysis.template.sourceMapping.type === "direct" ? new o2.WrappedNodeExpr(analysis.template.sourceMapping.node) : null
|
|
7642
7667
|
};
|
|
7668
|
+
const perComponentDeferredDeps = this.resolveAllDeferredDependencies(resolution);
|
|
7643
7669
|
const meta = {
|
|
7644
7670
|
...analysis.meta,
|
|
7645
7671
|
...resolution,
|
|
@@ -7648,8 +7674,9 @@ var ComponentDecoratorHandler = class {
|
|
|
7648
7674
|
const fac = compileDeclareFactory(toFactoryMetadata(meta, FactoryTarget3.Component));
|
|
7649
7675
|
const inputTransformFields = compileInputTransformFields(analysis.inputs);
|
|
7650
7676
|
const def = compileDeclareComponentFromMetadata(meta, analysis.template, templateInfo);
|
|
7651
|
-
const classMetadata = analysis.classMetadata !== null ?
|
|
7652
|
-
|
|
7677
|
+
const classMetadata = analysis.classMetadata !== null ? compileComponentDeclareClassMetadata(analysis.classMetadata, perComponentDeferredDeps).toStmt() : null;
|
|
7678
|
+
const deferrableImports = this.deferredSymbolTracker.getDeferrableImportDecls();
|
|
7679
|
+
return compileResults(fac, def, classMetadata, "\u0275cmp", inputTransformFields, deferrableImports);
|
|
7653
7680
|
}
|
|
7654
7681
|
compileLocal(node, analysis, resolution, pool) {
|
|
7655
7682
|
if (analysis.template.errors !== null && analysis.template.errors.length > 0) {
|
|
@@ -7682,7 +7709,7 @@ var ComponentDecoratorHandler = class {
|
|
|
7682
7709
|
}
|
|
7683
7710
|
return deferBlocks;
|
|
7684
7711
|
}
|
|
7685
|
-
|
|
7712
|
+
resolveAllDeferredDependencies(resolution) {
|
|
7686
7713
|
var _a;
|
|
7687
7714
|
const deferrableTypes = [];
|
|
7688
7715
|
for (const [_, deps] of resolution.deferPerBlockDependencies) {
|
|
@@ -7700,12 +7727,12 @@ var ComponentDecoratorHandler = class {
|
|
|
7700
7727
|
}
|
|
7701
7728
|
collectExplicitlyDeferredSymbols(rawDeferredImports) {
|
|
7702
7729
|
const deferredTypes = /* @__PURE__ */ new Map();
|
|
7703
|
-
if (!
|
|
7730
|
+
if (!ts26.isArrayLiteralExpression(rawDeferredImports)) {
|
|
7704
7731
|
return deferredTypes;
|
|
7705
7732
|
}
|
|
7706
7733
|
for (const element of rawDeferredImports.elements) {
|
|
7707
7734
|
const node = tryUnwrapForwardRef(element, this.reflector) || element;
|
|
7708
|
-
if (!
|
|
7735
|
+
if (!ts26.isIdentifier(node)) {
|
|
7709
7736
|
continue;
|
|
7710
7737
|
}
|
|
7711
7738
|
const imp = this.reflector.getImportOfIdentifier(node);
|
|
@@ -7772,12 +7799,12 @@ var ComponentDecoratorHandler = class {
|
|
|
7772
7799
|
}
|
|
7773
7800
|
}
|
|
7774
7801
|
registerDeferrableCandidates(componentClassDecl, importsExpr, isDeferredImport, allDeferredDecls, eagerlyUsedDecls, resolutionData) {
|
|
7775
|
-
if (!
|
|
7802
|
+
if (!ts26.isArrayLiteralExpression(importsExpr)) {
|
|
7776
7803
|
return;
|
|
7777
7804
|
}
|
|
7778
7805
|
for (const element of importsExpr.elements) {
|
|
7779
7806
|
const node = tryUnwrapForwardRef(element, this.reflector) || element;
|
|
7780
|
-
if (!
|
|
7807
|
+
if (!ts26.isIdentifier(node)) {
|
|
7781
7808
|
continue;
|
|
7782
7809
|
}
|
|
7783
7810
|
const imp = this.reflector.getImportOfIdentifier(node);
|
|
@@ -7829,7 +7856,7 @@ var ComponentDecoratorHandler = class {
|
|
|
7829
7856
|
throw new Error("Internal error: deferPerComponentDependencies must be present in PerComponent mode");
|
|
7830
7857
|
}
|
|
7831
7858
|
return {
|
|
7832
|
-
mode
|
|
7859
|
+
mode,
|
|
7833
7860
|
dependenciesFn: perComponentDeps.length === 0 ? null : compileDeferResolverFunction({ mode, dependencies: perComponentDeps })
|
|
7834
7861
|
};
|
|
7835
7862
|
}
|
|
@@ -7910,8 +7937,8 @@ function isDefaultImport(node) {
|
|
|
7910
7937
|
}
|
|
7911
7938
|
|
|
7912
7939
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
7913
|
-
import { compileClassMetadata as compileClassMetadata3, compileDeclareClassMetadata as
|
|
7914
|
-
import
|
|
7940
|
+
import { compileClassMetadata as compileClassMetadata3, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression3, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr8 } from "@angular/compiler";
|
|
7941
|
+
import ts27 from "typescript";
|
|
7915
7942
|
var InjectableDecoratorHandler = class {
|
|
7916
7943
|
constructor(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, perf, includeClassMetadata, compilationMode, errorOnDuplicateProv = true) {
|
|
7917
7944
|
this.reflector = reflector;
|
|
@@ -7983,7 +8010,7 @@ var InjectableDecoratorHandler = class {
|
|
|
7983
8010
|
return this.compile(compileNgFactoryDefField, (meta) => compileInjectable(meta, false), compileClassMetadata3, node, analysis);
|
|
7984
8011
|
}
|
|
7985
8012
|
compilePartial(node, analysis) {
|
|
7986
|
-
return this.compile(compileDeclareFactory, compileDeclareInjectableFromMetadata,
|
|
8013
|
+
return this.compile(compileDeclareFactory, compileDeclareInjectableFromMetadata, compileDeclareClassMetadata3, node, analysis);
|
|
7987
8014
|
}
|
|
7988
8015
|
compileLocal(node, analysis) {
|
|
7989
8016
|
return this.compile(compileNgFactoryDefField, (meta) => compileInjectable(meta, false), compileClassMetadata3, node, analysis);
|
|
@@ -8031,7 +8058,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
8031
8058
|
};
|
|
8032
8059
|
} else if (decorator.args.length === 1) {
|
|
8033
8060
|
const metaNode = decorator.args[0];
|
|
8034
|
-
if (!
|
|
8061
|
+
if (!ts27.isObjectLiteralExpression(metaNode)) {
|
|
8035
8062
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, metaNode, `@Injectable argument must be an object literal`);
|
|
8036
8063
|
}
|
|
8037
8064
|
const meta = reflectObjectLiteral(metaNode);
|
|
@@ -8039,7 +8066,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
8039
8066
|
let deps = void 0;
|
|
8040
8067
|
if ((meta.has("useClass") || meta.has("useFactory")) && meta.has("deps")) {
|
|
8041
8068
|
const depsExpr = meta.get("deps");
|
|
8042
|
-
if (!
|
|
8069
|
+
if (!ts27.isArrayLiteralExpression(depsExpr)) {
|
|
8043
8070
|
throw new FatalDiagnosticError(ErrorCode.VALUE_NOT_LITERAL, depsExpr, `@Injectable deps metadata must be an inline array`);
|
|
8044
8071
|
}
|
|
8045
8072
|
deps = depsExpr.elements.map((dep) => getDep(dep, reflector));
|
|
@@ -8124,12 +8151,12 @@ function getDep(dep, reflector) {
|
|
|
8124
8151
|
}
|
|
8125
8152
|
return true;
|
|
8126
8153
|
}
|
|
8127
|
-
if (
|
|
8154
|
+
if (ts27.isArrayLiteralExpression(dep)) {
|
|
8128
8155
|
dep.elements.forEach((el) => {
|
|
8129
8156
|
let isDecorator = false;
|
|
8130
|
-
if (
|
|
8157
|
+
if (ts27.isIdentifier(el)) {
|
|
8131
8158
|
isDecorator = maybeUpdateDecorator(el, reflector);
|
|
8132
|
-
} else if (
|
|
8159
|
+
} else if (ts27.isNewExpression(el) && ts27.isIdentifier(el.expression)) {
|
|
8133
8160
|
const token = el.arguments && el.arguments.length > 0 && el.arguments[0] || void 0;
|
|
8134
8161
|
isDecorator = maybeUpdateDecorator(el.expression, reflector, token);
|
|
8135
8162
|
}
|
|
@@ -8142,8 +8169,8 @@ function getDep(dep, reflector) {
|
|
|
8142
8169
|
}
|
|
8143
8170
|
|
|
8144
8171
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
|
|
8145
|
-
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as
|
|
8146
|
-
import
|
|
8172
|
+
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5 } from "@angular/compiler";
|
|
8173
|
+
import ts28 from "typescript";
|
|
8147
8174
|
var PipeSymbol = class extends SemanticSymbol {
|
|
8148
8175
|
constructor(decl, name) {
|
|
8149
8176
|
super(decl);
|
|
@@ -8201,7 +8228,7 @@ var PipeDecoratorHandler = class {
|
|
|
8201
8228
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, decorator.node, "@Pipe must have exactly one argument");
|
|
8202
8229
|
}
|
|
8203
8230
|
const meta = unwrapExpression(decorator.args[0]);
|
|
8204
|
-
if (!
|
|
8231
|
+
if (!ts28.isObjectLiteralExpression(meta)) {
|
|
8205
8232
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@Pipe must have a literal argument");
|
|
8206
8233
|
}
|
|
8207
8234
|
const pipe = reflectObjectLiteral(meta);
|
|
@@ -8287,7 +8314,7 @@ var PipeDecoratorHandler = class {
|
|
|
8287
8314
|
compilePartial(node, analysis) {
|
|
8288
8315
|
const fac = compileDeclareFactory(toFactoryMetadata(analysis.meta, FactoryTarget5.Pipe));
|
|
8289
8316
|
const def = compileDeclarePipeFromMetadata(analysis.meta);
|
|
8290
|
-
const classMetadata = analysis.classMetadata !== null ?
|
|
8317
|
+
const classMetadata = analysis.classMetadata !== null ? compileDeclareClassMetadata4(analysis.classMetadata).toStmt() : null;
|
|
8291
8318
|
return compileResults(fac, def, classMetadata, "\u0275pipe", null, null);
|
|
8292
8319
|
}
|
|
8293
8320
|
compileLocal(node, analysis) {
|
|
@@ -8317,7 +8344,6 @@ export {
|
|
|
8317
8344
|
CompilationMode,
|
|
8318
8345
|
aliasTransformFactory,
|
|
8319
8346
|
TraitCompiler,
|
|
8320
|
-
addImports,
|
|
8321
8347
|
DtsTransformRegistry,
|
|
8322
8348
|
declarationTransformFactory,
|
|
8323
8349
|
ivyTransformFactory,
|
|
@@ -8329,9 +8355,14 @@ export {
|
|
|
8329
8355
|
MetadataDtsModuleScopeResolver,
|
|
8330
8356
|
LocalModuleScopeRegistry,
|
|
8331
8357
|
TypeCheckScopeRegistry,
|
|
8358
|
+
tryParseInitializerApi,
|
|
8359
|
+
INPUT_INITIALIZER_FN,
|
|
8332
8360
|
tryParseSignalInputMapping,
|
|
8361
|
+
MODEL_INITIALIZER_FN,
|
|
8333
8362
|
tryParseSignalModelMapping,
|
|
8363
|
+
OUTPUT_INITIALIZER_FNS,
|
|
8334
8364
|
tryParseInitializerBasedOutput,
|
|
8365
|
+
QUERY_INITIALIZER_FNS,
|
|
8335
8366
|
tryParseSignalQueryFromInitializer,
|
|
8336
8367
|
queryDecoratorNames,
|
|
8337
8368
|
DirectiveDecoratorHandler,
|
|
@@ -8354,4 +8385,4 @@ export {
|
|
|
8354
8385
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8355
8386
|
* found in the LICENSE file at https://angular.io/license
|
|
8356
8387
|
*/
|
|
8357
|
-
//# sourceMappingURL=chunk-
|
|
8388
|
+
//# sourceMappingURL=chunk-MTZKBEZU.js.map
|