@angular/compiler-cli 13.2.0-next.1 → 13.2.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-TI3THPMZ.js → chunk-676MI6WZ.js} +39 -60
- package/bundles/chunk-676MI6WZ.js.map +6 -0
- package/bundles/{chunk-X46CEINM.js → chunk-7PY7XEFH.js} +9 -9
- package/bundles/chunk-7PY7XEFH.js.map +6 -0
- package/bundles/{chunk-AUFNJGZ6.js → chunk-A5PL3TE6.js} +9 -9
- package/bundles/chunk-A5PL3TE6.js.map +6 -0
- package/bundles/{chunk-PF3ZPGF5.js → chunk-ADHVDA4A.js} +12 -12
- package/bundles/{chunk-PF3ZPGF5.js.map → chunk-ADHVDA4A.js.map} +1 -1
- package/bundles/{chunk-J6CW3T62.js → chunk-GLCRIILX.js} +5 -5
- package/bundles/{chunk-J6CW3T62.js.map → chunk-GLCRIILX.js.map} +0 -0
- package/bundles/{chunk-FXVUPJ6A.js → chunk-L2JNRKLG.js} +358 -438
- package/bundles/chunk-L2JNRKLG.js.map +6 -0
- package/bundles/{chunk-P5ZW5MI4.js → chunk-L5DQYLOG.js} +505 -357
- package/bundles/chunk-L5DQYLOG.js.map +6 -0
- package/bundles/{chunk-DJRTTRF3.js → chunk-NU7DCJLY.js} +61 -63
- package/bundles/chunk-NU7DCJLY.js.map +6 -0
- package/bundles/{chunk-QFB4WK55.js → chunk-O4XVCXRT.js} +4 -4
- package/bundles/{chunk-QFB4WK55.js.map → chunk-O4XVCXRT.js.map} +0 -0
- package/bundles/{chunk-O5ZEI3UY.js → chunk-QBU7RUKB.js} +270 -100
- package/bundles/chunk-QBU7RUKB.js.map +6 -0
- package/bundles/{chunk-BPCUCINV.js → chunk-QDWL7SZJ.js} +2 -2
- package/bundles/{chunk-BPCUCINV.js.map → chunk-QDWL7SZJ.js.map} +0 -0
- package/bundles/{chunk-KWZNY2SK.js → chunk-QGM254OS.js} +96 -98
- package/bundles/chunk-QGM254OS.js.map +6 -0
- package/bundles/{chunk-JTYUTYS2.js → chunk-SKBLJA43.js} +3 -3
- package/bundles/{chunk-JTYUTYS2.js.map → chunk-SKBLJA43.js.map} +0 -0
- package/bundles/{chunk-OOIW53QX.js → chunk-UESD6FVI.js} +39 -41
- package/bundles/chunk-UESD6FVI.js.map +6 -0
- package/bundles/{chunk-XA5IZLLC.js → chunk-WQ3TNYTD.js} +6 -6
- package/bundles/{chunk-XA5IZLLC.js.map → chunk-WQ3TNYTD.js.map} +0 -0
- package/bundles/{chunk-W5CGOJQ4.js → chunk-ZWPDFY6U.js} +16 -20
- package/bundles/chunk-ZWPDFY6U.js.map +6 -0
- package/bundles/index.js +14 -14
- package/bundles/index.js.map +1 -1
- package/bundles/linker/babel/index.js +85 -85
- package/bundles/linker/babel/index.js.map +1 -1
- package/bundles/linker/index.js +5 -5
- package/bundles/ngcc/index.js +13 -13
- package/bundles/ngcc/main-ngcc.js +14 -14
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +14 -14
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +5 -5
- package/bundles/private/bazel.js +2 -2
- package/bundles/private/localize.js +4 -4
- package/bundles/private/migrations.js +6 -6
- package/bundles/private/tooling.js +3 -3
- package/bundles/src/bin/ng_xi18n.js +11 -11
- package/bundles/src/bin/ngc.js +11 -11
- package/bundles/src/bin/ngc.js.map +1 -1
- package/bundles_metadata.json +1 -1
- package/index.d.ts +2 -0
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/annotations/src/component.d.ts +2 -1
- package/src/ngtsc/annotations/src/util.d.ts +1 -1
- package/src/ngtsc/core/api/src/options.d.ts +3 -2
- package/src/ngtsc/core/api/src/public_options.d.ts +38 -0
- package/src/ngtsc/diagnostics/index.d.ts +2 -1
- package/src/ngtsc/diagnostics/src/error.d.ts +1 -0
- package/src/ngtsc/diagnostics/src/error_code.d.ts +7 -0
- package/src/ngtsc/diagnostics/src/error_details_base_url.d.ts +1 -1
- package/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.d.ts +21 -0
- package/src/ngtsc/file_system/src/compiler_host.d.ts +1 -0
- package/src/ngtsc/imports/index.d.ts +1 -1
- package/src/ngtsc/imports/src/emitter.d.ts +40 -8
- package/src/ngtsc/translator/src/translator.d.ts +0 -5
- package/src/ngtsc/translator/src/type_translator.d.ts +0 -2
- package/src/ngtsc/typecheck/extended/api/api.d.ts +30 -10
- package/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.d.ts +3 -14
- package/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.d.ts +3 -15
- package/src/ngtsc/typecheck/extended/index.d.ts +3 -0
- package/src/ngtsc/typecheck/extended/src/extended_template_checker.d.ts +5 -4
- package/src/ngtsc/typecheck/src/environment.d.ts +3 -1
- package/src/ngtsc/typecheck/src/tcb_util.d.ts +10 -2
- package/src/ngtsc/typecheck/src/type_constructor.d.ts +3 -2
- package/src/ngtsc/typecheck/src/type_emitter.d.ts +7 -21
- package/src/ngtsc/typecheck/src/type_parameter_emitter.d.ts +2 -2
- package/bundles/chunk-AUFNJGZ6.js.map +0 -6
- package/bundles/chunk-DJRTTRF3.js.map +0 -6
- package/bundles/chunk-FXVUPJ6A.js.map +0 -6
- package/bundles/chunk-KWZNY2SK.js.map +0 -6
- package/bundles/chunk-O5ZEI3UY.js.map +0 -6
- package/bundles/chunk-OOIW53QX.js.map +0 -6
- package/bundles/chunk-P5ZW5MI4.js.map +0 -6
- package/bundles/chunk-TI3THPMZ.js.map +0 -6
- package/bundles/chunk-W5CGOJQ4.js.map +0 -6
- package/bundles/chunk-X46CEINM.js.map +0 -6
|
@@ -13,37 +13,42 @@ import {
|
|
|
13
13
|
reflectObjectLiteral,
|
|
14
14
|
reflectTypeEntityToDeclaration,
|
|
15
15
|
typeNodeToValueExpr
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7PY7XEFH.js";
|
|
17
17
|
import {
|
|
18
|
+
ErrorCode,
|
|
19
|
+
FatalDiagnosticError,
|
|
18
20
|
ImportFlags,
|
|
19
21
|
ImportManager,
|
|
20
22
|
Reference,
|
|
23
|
+
assertSuccessfulReferenceEmit,
|
|
21
24
|
attachDefaultImportDeclaration,
|
|
22
25
|
createExportSpecifier,
|
|
23
26
|
getDefaultImportDeclaration,
|
|
24
27
|
getSourceFile,
|
|
25
28
|
identifierOfNode,
|
|
26
29
|
isDeclaration,
|
|
30
|
+
makeDiagnostic,
|
|
31
|
+
makeRelatedInformation,
|
|
27
32
|
nodeDebugInfo,
|
|
28
33
|
translateExpression,
|
|
29
34
|
translateStatement,
|
|
30
35
|
translateType
|
|
31
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-QBU7RUKB.js";
|
|
32
37
|
import {
|
|
33
38
|
absoluteFrom,
|
|
34
39
|
absoluteFromSourceFile,
|
|
35
40
|
relative
|
|
36
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-676MI6WZ.js";
|
|
37
42
|
import {
|
|
38
43
|
PerfEvent,
|
|
39
44
|
PerfPhase
|
|
40
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-GLCRIILX.js";
|
|
41
46
|
import {
|
|
42
47
|
__spreadProps,
|
|
43
48
|
__spreadValues
|
|
44
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-WQ3TNYTD.js";
|
|
45
50
|
|
|
46
|
-
// bazel-out/
|
|
51
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/dynamic.mjs
|
|
47
52
|
var DynamicValue = class {
|
|
48
53
|
constructor(node, reason, code) {
|
|
49
54
|
this.node = node;
|
|
@@ -128,10 +133,10 @@ var DynamicValue = class {
|
|
|
128
133
|
}
|
|
129
134
|
};
|
|
130
135
|
|
|
131
|
-
// bazel-out/
|
|
136
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
132
137
|
import ts from "typescript";
|
|
133
138
|
|
|
134
|
-
// bazel-out/
|
|
139
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/result.mjs
|
|
135
140
|
var ResolvedModule = class {
|
|
136
141
|
constructor(exports, evaluate) {
|
|
137
142
|
this.exports = exports;
|
|
@@ -144,7 +149,7 @@ var ResolvedModule = class {
|
|
|
144
149
|
return this.evaluate(this.exports.get(name));
|
|
145
150
|
}
|
|
146
151
|
getExports() {
|
|
147
|
-
const map = new Map();
|
|
152
|
+
const map = /* @__PURE__ */ new Map();
|
|
148
153
|
this.exports.forEach((decl, name) => {
|
|
149
154
|
map.set(name, this.evaluate(decl));
|
|
150
155
|
});
|
|
@@ -161,7 +166,7 @@ var EnumValue = class {
|
|
|
161
166
|
var KnownFn = class {
|
|
162
167
|
};
|
|
163
168
|
|
|
164
|
-
// bazel-out/
|
|
169
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/builtin.mjs
|
|
165
170
|
var ArraySliceBuiltinFn = class extends KnownFn {
|
|
166
171
|
constructor(lhs) {
|
|
167
172
|
super();
|
|
@@ -232,7 +237,7 @@ var ObjectAssignBuiltinFn = class extends KnownFn {
|
|
|
232
237
|
}
|
|
233
238
|
};
|
|
234
239
|
|
|
235
|
-
// bazel-out/
|
|
240
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/ts_helpers.mjs
|
|
236
241
|
var AssignHelperFn = class extends ObjectAssignBuiltinFn {
|
|
237
242
|
};
|
|
238
243
|
var SpreadHelperFn = class extends KnownFn {
|
|
@@ -285,8 +290,8 @@ var ReadHelperFn = class extends KnownFn {
|
|
|
285
290
|
}
|
|
286
291
|
};
|
|
287
292
|
|
|
288
|
-
// bazel-out/
|
|
289
|
-
var jsGlobalObjectValue = new Map([["assign", new ObjectAssignBuiltinFn()]]);
|
|
293
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/known_declaration.mjs
|
|
294
|
+
var jsGlobalObjectValue = /* @__PURE__ */ new Map([["assign", new ObjectAssignBuiltinFn()]]);
|
|
290
295
|
var assignTsHelperFn = new AssignHelperFn();
|
|
291
296
|
var spreadTsHelperFn = new SpreadHelperFn();
|
|
292
297
|
var spreadArrayTsHelperFn = new SpreadArrayHelperFn();
|
|
@@ -309,14 +314,14 @@ function resolveKnownDeclaration(decl) {
|
|
|
309
314
|
}
|
|
310
315
|
}
|
|
311
316
|
|
|
312
|
-
// bazel-out/
|
|
317
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
313
318
|
function literalBinaryOp(op) {
|
|
314
319
|
return { op, literal: true };
|
|
315
320
|
}
|
|
316
321
|
function referenceBinaryOp(op) {
|
|
317
322
|
return { op, literal: false };
|
|
318
323
|
}
|
|
319
|
-
var BINARY_OPERATORS = new Map([
|
|
324
|
+
var BINARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
320
325
|
[ts.SyntaxKind.PlusToken, literalBinaryOp((a, b) => a + b)],
|
|
321
326
|
[ts.SyntaxKind.MinusToken, literalBinaryOp((a, b) => a - b)],
|
|
322
327
|
[ts.SyntaxKind.AsteriskToken, literalBinaryOp((a, b) => a * b)],
|
|
@@ -340,7 +345,7 @@ var BINARY_OPERATORS = new Map([
|
|
|
340
345
|
[ts.SyntaxKind.AmpersandAmpersandToken, referenceBinaryOp((a, b) => a && b)],
|
|
341
346
|
[ts.SyntaxKind.BarBarToken, referenceBinaryOp((a, b) => a || b)]
|
|
342
347
|
]);
|
|
343
|
-
var UNARY_OPERATORS = new Map([
|
|
348
|
+
var UNARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
344
349
|
[ts.SyntaxKind.TildeToken, (a) => ~a],
|
|
345
350
|
[ts.SyntaxKind.MinusToken, (a) => -a],
|
|
346
351
|
[ts.SyntaxKind.PlusToken, (a) => +a],
|
|
@@ -418,7 +423,7 @@ var StaticInterpreter = class {
|
|
|
418
423
|
return array;
|
|
419
424
|
}
|
|
420
425
|
visitObjectLiteralExpression(node, context) {
|
|
421
|
-
const map = new Map();
|
|
426
|
+
const map = /* @__PURE__ */ new Map();
|
|
422
427
|
for (let i = 0; i < node.properties.length; i++) {
|
|
423
428
|
const property = node.properties[i];
|
|
424
429
|
if (ts.isPropertyAssignment(property)) {
|
|
@@ -531,7 +536,7 @@ var StaticInterpreter = class {
|
|
|
531
536
|
}
|
|
532
537
|
visitEnumDeclaration(node, context) {
|
|
533
538
|
const enumRef = this.getReference(node, context);
|
|
534
|
-
const map = new Map();
|
|
539
|
+
const map = /* @__PURE__ */ new Map();
|
|
535
540
|
node.members.forEach((member) => {
|
|
536
541
|
const name = this.stringNameFromPropertyName(member.name, context);
|
|
537
542
|
if (name !== void 0) {
|
|
@@ -688,7 +693,7 @@ var StaticInterpreter = class {
|
|
|
688
693
|
}
|
|
689
694
|
const ret = fn.body[0];
|
|
690
695
|
const args = this.evaluateFunctionArguments(node, context);
|
|
691
|
-
const newScope = new Map();
|
|
696
|
+
const newScope = /* @__PURE__ */ new Map();
|
|
692
697
|
const calleeContext = __spreadProps(__spreadValues({}, context), { scope: newScope });
|
|
693
698
|
fn.parameters.forEach((param, index) => {
|
|
694
699
|
let arg = args[index];
|
|
@@ -816,7 +821,7 @@ var StaticInterpreter = class {
|
|
|
816
821
|
}
|
|
817
822
|
getResolvedEnum(node, enumMembers, context) {
|
|
818
823
|
const enumRef = this.getReference(node, context);
|
|
819
|
-
const map = new Map();
|
|
824
|
+
const map = /* @__PURE__ */ new Map();
|
|
820
825
|
enumMembers.forEach((member) => {
|
|
821
826
|
const name = this.stringNameFromPropertyName(member.name, context);
|
|
822
827
|
if (name !== void 0) {
|
|
@@ -896,7 +901,7 @@ function owningModule(context, override = null) {
|
|
|
896
901
|
}
|
|
897
902
|
}
|
|
898
903
|
|
|
899
|
-
// bazel-out/
|
|
904
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interface.mjs
|
|
900
905
|
var PartialEvaluator = class {
|
|
901
906
|
constructor(host, checker, dependencyTracker) {
|
|
902
907
|
this.host = host;
|
|
@@ -910,133 +915,14 @@ var PartialEvaluator = class {
|
|
|
910
915
|
originatingFile: sourceFile,
|
|
911
916
|
absoluteModuleName: null,
|
|
912
917
|
resolutionContext: sourceFile.fileName,
|
|
913
|
-
scope: new Map(),
|
|
918
|
+
scope: /* @__PURE__ */ new Map(),
|
|
914
919
|
foreignFunctionResolver
|
|
915
920
|
});
|
|
916
921
|
}
|
|
917
922
|
};
|
|
918
923
|
|
|
919
|
-
// bazel-out/
|
|
920
|
-
import ts3 from "typescript";
|
|
921
|
-
|
|
922
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.mjs
|
|
923
|
-
var ErrorCode;
|
|
924
|
-
(function(ErrorCode2) {
|
|
925
|
-
ErrorCode2[ErrorCode2["DECORATOR_ARG_NOT_LITERAL"] = 1001] = "DECORATOR_ARG_NOT_LITERAL";
|
|
926
|
-
ErrorCode2[ErrorCode2["DECORATOR_ARITY_WRONG"] = 1002] = "DECORATOR_ARITY_WRONG";
|
|
927
|
-
ErrorCode2[ErrorCode2["DECORATOR_NOT_CALLED"] = 1003] = "DECORATOR_NOT_CALLED";
|
|
928
|
-
ErrorCode2[ErrorCode2["DECORATOR_ON_ANONYMOUS_CLASS"] = 1004] = "DECORATOR_ON_ANONYMOUS_CLASS";
|
|
929
|
-
ErrorCode2[ErrorCode2["DECORATOR_UNEXPECTED"] = 1005] = "DECORATOR_UNEXPECTED";
|
|
930
|
-
ErrorCode2[ErrorCode2["DECORATOR_COLLISION"] = 1006] = "DECORATOR_COLLISION";
|
|
931
|
-
ErrorCode2[ErrorCode2["VALUE_HAS_WRONG_TYPE"] = 1010] = "VALUE_HAS_WRONG_TYPE";
|
|
932
|
-
ErrorCode2[ErrorCode2["VALUE_NOT_LITERAL"] = 1011] = "VALUE_NOT_LITERAL";
|
|
933
|
-
ErrorCode2[ErrorCode2["COMPONENT_MISSING_TEMPLATE"] = 2001] = "COMPONENT_MISSING_TEMPLATE";
|
|
934
|
-
ErrorCode2[ErrorCode2["PIPE_MISSING_NAME"] = 2002] = "PIPE_MISSING_NAME";
|
|
935
|
-
ErrorCode2[ErrorCode2["PARAM_MISSING_TOKEN"] = 2003] = "PARAM_MISSING_TOKEN";
|
|
936
|
-
ErrorCode2[ErrorCode2["DIRECTIVE_MISSING_SELECTOR"] = 2004] = "DIRECTIVE_MISSING_SELECTOR";
|
|
937
|
-
ErrorCode2[ErrorCode2["UNDECORATED_PROVIDER"] = 2005] = "UNDECORATED_PROVIDER";
|
|
938
|
-
ErrorCode2[ErrorCode2["DIRECTIVE_INHERITS_UNDECORATED_CTOR"] = 2006] = "DIRECTIVE_INHERITS_UNDECORATED_CTOR";
|
|
939
|
-
ErrorCode2[ErrorCode2["UNDECORATED_CLASS_USING_ANGULAR_FEATURES"] = 2007] = "UNDECORATED_CLASS_USING_ANGULAR_FEATURES";
|
|
940
|
-
ErrorCode2[ErrorCode2["COMPONENT_RESOURCE_NOT_FOUND"] = 2008] = "COMPONENT_RESOURCE_NOT_FOUND";
|
|
941
|
-
ErrorCode2[ErrorCode2["COMPONENT_INVALID_SHADOW_DOM_SELECTOR"] = 2009] = "COMPONENT_INVALID_SHADOW_DOM_SELECTOR";
|
|
942
|
-
ErrorCode2[ErrorCode2["SYMBOL_NOT_EXPORTED"] = 3001] = "SYMBOL_NOT_EXPORTED";
|
|
943
|
-
ErrorCode2[ErrorCode2["SYMBOL_EXPORTED_UNDER_DIFFERENT_NAME"] = 3002] = "SYMBOL_EXPORTED_UNDER_DIFFERENT_NAME";
|
|
944
|
-
ErrorCode2[ErrorCode2["IMPORT_CYCLE_DETECTED"] = 3003] = "IMPORT_CYCLE_DETECTED";
|
|
945
|
-
ErrorCode2[ErrorCode2["CONFIG_FLAT_MODULE_NO_INDEX"] = 4001] = "CONFIG_FLAT_MODULE_NO_INDEX";
|
|
946
|
-
ErrorCode2[ErrorCode2["CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK"] = 4002] = "CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK";
|
|
947
|
-
ErrorCode2[ErrorCode2["HOST_BINDING_PARSE_ERROR"] = 5001] = "HOST_BINDING_PARSE_ERROR";
|
|
948
|
-
ErrorCode2[ErrorCode2["TEMPLATE_PARSE_ERROR"] = 5002] = "TEMPLATE_PARSE_ERROR";
|
|
949
|
-
ErrorCode2[ErrorCode2["NGMODULE_INVALID_DECLARATION"] = 6001] = "NGMODULE_INVALID_DECLARATION";
|
|
950
|
-
ErrorCode2[ErrorCode2["NGMODULE_INVALID_IMPORT"] = 6002] = "NGMODULE_INVALID_IMPORT";
|
|
951
|
-
ErrorCode2[ErrorCode2["NGMODULE_INVALID_EXPORT"] = 6003] = "NGMODULE_INVALID_EXPORT";
|
|
952
|
-
ErrorCode2[ErrorCode2["NGMODULE_INVALID_REEXPORT"] = 6004] = "NGMODULE_INVALID_REEXPORT";
|
|
953
|
-
ErrorCode2[ErrorCode2["NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC"] = 6005] = "NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC";
|
|
954
|
-
ErrorCode2[ErrorCode2["NGMODULE_REEXPORT_NAME_COLLISION"] = 6006] = "NGMODULE_REEXPORT_NAME_COLLISION";
|
|
955
|
-
ErrorCode2[ErrorCode2["NGMODULE_DECLARATION_NOT_UNIQUE"] = 6007] = "NGMODULE_DECLARATION_NOT_UNIQUE";
|
|
956
|
-
ErrorCode2[ErrorCode2["NGMODULE_VE_DEPENDENCY_ON_IVY_LIB"] = 6999] = "NGMODULE_VE_DEPENDENCY_ON_IVY_LIB";
|
|
957
|
-
ErrorCode2[ErrorCode2["SCHEMA_INVALID_ELEMENT"] = 8001] = "SCHEMA_INVALID_ELEMENT";
|
|
958
|
-
ErrorCode2[ErrorCode2["SCHEMA_INVALID_ATTRIBUTE"] = 8002] = "SCHEMA_INVALID_ATTRIBUTE";
|
|
959
|
-
ErrorCode2[ErrorCode2["MISSING_REFERENCE_TARGET"] = 8003] = "MISSING_REFERENCE_TARGET";
|
|
960
|
-
ErrorCode2[ErrorCode2["MISSING_PIPE"] = 8004] = "MISSING_PIPE";
|
|
961
|
-
ErrorCode2[ErrorCode2["WRITE_TO_READ_ONLY_VARIABLE"] = 8005] = "WRITE_TO_READ_ONLY_VARIABLE";
|
|
962
|
-
ErrorCode2[ErrorCode2["DUPLICATE_VARIABLE_DECLARATION"] = 8006] = "DUPLICATE_VARIABLE_DECLARATION";
|
|
963
|
-
ErrorCode2[ErrorCode2["SPLIT_TWO_WAY_BINDING"] = 8007] = "SPLIT_TWO_WAY_BINDING";
|
|
964
|
-
ErrorCode2[ErrorCode2["INVALID_BANANA_IN_BOX"] = 8101] = "INVALID_BANANA_IN_BOX";
|
|
965
|
-
ErrorCode2[ErrorCode2["NULLISH_COALESCING_NOT_NULLABLE"] = 8102] = "NULLISH_COALESCING_NOT_NULLABLE";
|
|
966
|
-
ErrorCode2[ErrorCode2["INLINE_TCB_REQUIRED"] = 8900] = "INLINE_TCB_REQUIRED";
|
|
967
|
-
ErrorCode2[ErrorCode2["INLINE_TYPE_CTOR_REQUIRED"] = 8901] = "INLINE_TYPE_CTOR_REQUIRED";
|
|
968
|
-
ErrorCode2[ErrorCode2["INJECTABLE_DUPLICATE_PROV"] = 9001] = "INJECTABLE_DUPLICATE_PROV";
|
|
969
|
-
ErrorCode2[ErrorCode2["SUGGEST_STRICT_TEMPLATES"] = 10001] = "SUGGEST_STRICT_TEMPLATES";
|
|
970
|
-
ErrorCode2[ErrorCode2["SUGGEST_SUBOPTIMAL_TYPE_INFERENCE"] = 10002] = "SUGGEST_SUBOPTIMAL_TYPE_INFERENCE";
|
|
971
|
-
})(ErrorCode || (ErrorCode = {}));
|
|
972
|
-
|
|
973
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/docs.mjs
|
|
974
|
-
var COMPILER_ERRORS_WITH_GUIDES = new Set([
|
|
975
|
-
ErrorCode.DECORATOR_ARG_NOT_LITERAL,
|
|
976
|
-
ErrorCode.IMPORT_CYCLE_DETECTED,
|
|
977
|
-
ErrorCode.PARAM_MISSING_TOKEN,
|
|
978
|
-
ErrorCode.SCHEMA_INVALID_ELEMENT,
|
|
979
|
-
ErrorCode.SCHEMA_INVALID_ATTRIBUTE,
|
|
980
|
-
ErrorCode.MISSING_REFERENCE_TARGET,
|
|
981
|
-
ErrorCode.COMPONENT_INVALID_SHADOW_DOM_SELECTOR
|
|
982
|
-
]);
|
|
983
|
-
|
|
984
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
924
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
|
|
985
925
|
import ts2 from "typescript";
|
|
986
|
-
|
|
987
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/util.mjs
|
|
988
|
-
var ERROR_CODE_MATCHER = /(\u001b\[\d+m ?)TS-99(\d+: ?\u001b\[\d+m)/g;
|
|
989
|
-
function replaceTsWithNgInErrors(errors) {
|
|
990
|
-
return errors.replace(ERROR_CODE_MATCHER, "$1NG$2");
|
|
991
|
-
}
|
|
992
|
-
function ngErrorCode(code) {
|
|
993
|
-
return parseInt("-99" + code);
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
997
|
-
var FatalDiagnosticError = class {
|
|
998
|
-
constructor(code, node, message, relatedInformation) {
|
|
999
|
-
this.code = code;
|
|
1000
|
-
this.node = node;
|
|
1001
|
-
this.message = message;
|
|
1002
|
-
this.relatedInformation = relatedInformation;
|
|
1003
|
-
this._isFatalDiagnosticError = true;
|
|
1004
|
-
}
|
|
1005
|
-
toDiagnostic() {
|
|
1006
|
-
return makeDiagnostic(this.code, this.node, this.message, this.relatedInformation);
|
|
1007
|
-
}
|
|
1008
|
-
};
|
|
1009
|
-
function makeDiagnostic(code, node, messageText, relatedInformation) {
|
|
1010
|
-
node = ts2.getOriginalNode(node);
|
|
1011
|
-
return {
|
|
1012
|
-
category: ts2.DiagnosticCategory.Error,
|
|
1013
|
-
code: ngErrorCode(code),
|
|
1014
|
-
file: ts2.getOriginalNode(node).getSourceFile(),
|
|
1015
|
-
start: node.getStart(void 0, false),
|
|
1016
|
-
length: node.getWidth(),
|
|
1017
|
-
messageText,
|
|
1018
|
-
relatedInformation
|
|
1019
|
-
};
|
|
1020
|
-
}
|
|
1021
|
-
function makeRelatedInformation(node, messageText) {
|
|
1022
|
-
node = ts2.getOriginalNode(node);
|
|
1023
|
-
return {
|
|
1024
|
-
category: ts2.DiagnosticCategory.Message,
|
|
1025
|
-
code: 0,
|
|
1026
|
-
file: node.getSourceFile(),
|
|
1027
|
-
start: node.getStart(),
|
|
1028
|
-
length: node.getWidth(),
|
|
1029
|
-
messageText
|
|
1030
|
-
};
|
|
1031
|
-
}
|
|
1032
|
-
function isFatalDiagnosticError(err) {
|
|
1033
|
-
return err._isFatalDiagnosticError === true;
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.mjs
|
|
1037
|
-
var ERROR_DETAILS_PAGE_BASE_URL = "https://angular.io/errors";
|
|
1038
|
-
|
|
1039
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
|
|
1040
926
|
function describeResolvedType(value, maxDepth = 1) {
|
|
1041
927
|
var _a, _b;
|
|
1042
928
|
if (value === null) {
|
|
@@ -1140,21 +1026,21 @@ function getContainerNode(node) {
|
|
|
1140
1026
|
let currentNode = node;
|
|
1141
1027
|
while (currentNode !== void 0) {
|
|
1142
1028
|
switch (currentNode.kind) {
|
|
1143
|
-
case
|
|
1144
|
-
case
|
|
1145
|
-
case
|
|
1146
|
-
case
|
|
1147
|
-
case
|
|
1148
|
-
case
|
|
1149
|
-
case
|
|
1150
|
-
case
|
|
1151
|
-
case
|
|
1152
|
-
case
|
|
1153
|
-
case
|
|
1154
|
-
case
|
|
1155
|
-
case
|
|
1156
|
-
case
|
|
1157
|
-
case
|
|
1029
|
+
case ts2.SyntaxKind.ExpressionStatement:
|
|
1030
|
+
case ts2.SyntaxKind.VariableStatement:
|
|
1031
|
+
case ts2.SyntaxKind.ReturnStatement:
|
|
1032
|
+
case ts2.SyntaxKind.IfStatement:
|
|
1033
|
+
case ts2.SyntaxKind.SwitchStatement:
|
|
1034
|
+
case ts2.SyntaxKind.DoStatement:
|
|
1035
|
+
case ts2.SyntaxKind.WhileStatement:
|
|
1036
|
+
case ts2.SyntaxKind.ForStatement:
|
|
1037
|
+
case ts2.SyntaxKind.ForInStatement:
|
|
1038
|
+
case ts2.SyntaxKind.ForOfStatement:
|
|
1039
|
+
case ts2.SyntaxKind.ContinueStatement:
|
|
1040
|
+
case ts2.SyntaxKind.BreakStatement:
|
|
1041
|
+
case ts2.SyntaxKind.ThrowStatement:
|
|
1042
|
+
case ts2.SyntaxKind.ObjectBindingPattern:
|
|
1043
|
+
case ts2.SyntaxKind.ArrayBindingPattern:
|
|
1158
1044
|
return currentNode;
|
|
1159
1045
|
}
|
|
1160
1046
|
currentNode = currentNode.parent;
|
|
@@ -1162,9 +1048,9 @@ function getContainerNode(node) {
|
|
|
1162
1048
|
return node.getSourceFile();
|
|
1163
1049
|
}
|
|
1164
1050
|
|
|
1165
|
-
// bazel-out/
|
|
1051
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/util.mjs
|
|
1166
1052
|
import { ExternalExpr, LiteralExpr, ParseLocation, ParseSourceFile, ParseSourceSpan, ReadPropExpr, WrappedNodeExpr } from "@angular/compiler";
|
|
1167
|
-
import
|
|
1053
|
+
import ts3 from "typescript";
|
|
1168
1054
|
function getConstructorDependencies(clazz, reflector, isCore) {
|
|
1169
1055
|
const deps = [];
|
|
1170
1056
|
const errors = [];
|
|
@@ -1201,10 +1087,10 @@ function getConstructorDependencies(clazz, reflector, isCore) {
|
|
|
1201
1087
|
}
|
|
1202
1088
|
const attributeName = dec.args[0];
|
|
1203
1089
|
token = new WrappedNodeExpr(attributeName);
|
|
1204
|
-
if (
|
|
1090
|
+
if (ts3.isStringLiteralLike(attributeName)) {
|
|
1205
1091
|
attributeNameType = new LiteralExpr(attributeName.text);
|
|
1206
1092
|
} else {
|
|
1207
|
-
attributeNameType = new WrappedNodeExpr(
|
|
1093
|
+
attributeNameType = new WrappedNodeExpr(ts3.createKeywordTypeNode(ts3.SyntaxKind.UnknownKeyword));
|
|
1208
1094
|
}
|
|
1209
1095
|
} else {
|
|
1210
1096
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_UNEXPECTED, Decorator.nodeForError(dec), `Unexpected decorator ${name} on parameter.`);
|
|
@@ -1314,20 +1200,24 @@ function createUnsuitableInjectionTokenError(clazz, error) {
|
|
|
1314
1200
|
}
|
|
1315
1201
|
const chain = {
|
|
1316
1202
|
messageText: `No suitable injection token for parameter '${param.name || index}' of class '${clazz.name.text}'.`,
|
|
1317
|
-
category:
|
|
1203
|
+
category: ts3.DiagnosticCategory.Error,
|
|
1318
1204
|
code: 0,
|
|
1319
1205
|
next: [{
|
|
1320
1206
|
messageText: chainMessage,
|
|
1321
|
-
category:
|
|
1207
|
+
category: ts3.DiagnosticCategory.Message,
|
|
1322
1208
|
code: 0
|
|
1323
1209
|
}]
|
|
1324
1210
|
};
|
|
1325
1211
|
return new FatalDiagnosticError(ErrorCode.PARAM_MISSING_TOKEN, param.nameNode, chain, hints);
|
|
1326
1212
|
}
|
|
1327
|
-
function toR3Reference(valueRef, typeRef, valueContext, typeContext, refEmitter) {
|
|
1213
|
+
function toR3Reference(origin, valueRef, typeRef, valueContext, typeContext, refEmitter) {
|
|
1214
|
+
const emittedValueRef = refEmitter.emit(valueRef, valueContext);
|
|
1215
|
+
assertSuccessfulReferenceEmit(emittedValueRef, origin, "class");
|
|
1216
|
+
const emittedTypeRef = refEmitter.emit(typeRef, typeContext, ImportFlags.ForceNewImport | ImportFlags.AllowTypeImports);
|
|
1217
|
+
assertSuccessfulReferenceEmit(emittedTypeRef, origin, "class");
|
|
1328
1218
|
return {
|
|
1329
|
-
value:
|
|
1330
|
-
type:
|
|
1219
|
+
value: emittedValueRef.expression,
|
|
1220
|
+
type: emittedTypeRef.expression
|
|
1331
1221
|
};
|
|
1332
1222
|
}
|
|
1333
1223
|
function isAngularCore(decorator) {
|
|
@@ -1348,23 +1238,23 @@ function isAngularDecorator(decorator, name, isCore) {
|
|
|
1348
1238
|
return false;
|
|
1349
1239
|
}
|
|
1350
1240
|
function unwrapExpression(node) {
|
|
1351
|
-
while (
|
|
1241
|
+
while (ts3.isAsExpression(node) || ts3.isParenthesizedExpression(node)) {
|
|
1352
1242
|
node = node.expression;
|
|
1353
1243
|
}
|
|
1354
1244
|
return node;
|
|
1355
1245
|
}
|
|
1356
1246
|
function expandForwardRef(arg) {
|
|
1357
1247
|
arg = unwrapExpression(arg);
|
|
1358
|
-
if (!
|
|
1248
|
+
if (!ts3.isArrowFunction(arg) && !ts3.isFunctionExpression(arg)) {
|
|
1359
1249
|
return null;
|
|
1360
1250
|
}
|
|
1361
1251
|
const body = arg.body;
|
|
1362
|
-
if (
|
|
1252
|
+
if (ts3.isBlock(body)) {
|
|
1363
1253
|
if (body.statements.length !== 1) {
|
|
1364
1254
|
return null;
|
|
1365
1255
|
}
|
|
1366
1256
|
const stmt = body.statements[0];
|
|
1367
|
-
if (!
|
|
1257
|
+
if (!ts3.isReturnStatement(stmt) || stmt.expression === void 0) {
|
|
1368
1258
|
return null;
|
|
1369
1259
|
}
|
|
1370
1260
|
return stmt.expression;
|
|
@@ -1374,11 +1264,11 @@ function expandForwardRef(arg) {
|
|
|
1374
1264
|
}
|
|
1375
1265
|
function tryUnwrapForwardRef(node, reflector) {
|
|
1376
1266
|
node = unwrapExpression(node);
|
|
1377
|
-
if (!
|
|
1267
|
+
if (!ts3.isCallExpression(node) || node.arguments.length !== 1) {
|
|
1378
1268
|
return null;
|
|
1379
1269
|
}
|
|
1380
|
-
const fn =
|
|
1381
|
-
if (!
|
|
1270
|
+
const fn = ts3.isPropertyAccessExpression(node.expression) ? node.expression.name : node.expression;
|
|
1271
|
+
if (!ts3.isIdentifier(fn)) {
|
|
1382
1272
|
return null;
|
|
1383
1273
|
}
|
|
1384
1274
|
const expr = expandForwardRef(node.arguments[0]);
|
|
@@ -1410,7 +1300,7 @@ function combineResolvers(resolvers) {
|
|
|
1410
1300
|
}
|
|
1411
1301
|
function isExpressionForwardReference(expr, context, contextSource) {
|
|
1412
1302
|
if (isWrappedTsNodeExpr(expr)) {
|
|
1413
|
-
const node =
|
|
1303
|
+
const node = ts3.getOriginalNode(expr.node);
|
|
1414
1304
|
return node.getSourceFile() === contextSource && context.pos < node.pos;
|
|
1415
1305
|
} else {
|
|
1416
1306
|
return false;
|
|
@@ -1433,16 +1323,16 @@ function readBaseClass(node, reflector, evaluator) {
|
|
|
1433
1323
|
}
|
|
1434
1324
|
var parensWrapperTransformerFactory = (context) => {
|
|
1435
1325
|
const visitor = (node) => {
|
|
1436
|
-
const visited =
|
|
1437
|
-
if (
|
|
1438
|
-
return
|
|
1326
|
+
const visited = ts3.visitEachChild(node, visitor, context);
|
|
1327
|
+
if (ts3.isArrowFunction(visited) || ts3.isFunctionExpression(visited)) {
|
|
1328
|
+
return ts3.createParen(visited);
|
|
1439
1329
|
}
|
|
1440
1330
|
return visited;
|
|
1441
1331
|
};
|
|
1442
|
-
return (node) =>
|
|
1332
|
+
return (node) => ts3.visitEachChild(node, visitor, context);
|
|
1443
1333
|
};
|
|
1444
1334
|
function wrapFunctionExpressionsInParens(expression) {
|
|
1445
|
-
return
|
|
1335
|
+
return ts3.transform(expression, [parensWrapperTransformerFactory]).transformed[0];
|
|
1446
1336
|
}
|
|
1447
1337
|
function makeDuplicateDeclarationError(node, data, kind) {
|
|
1448
1338
|
const context = [];
|
|
@@ -1456,7 +1346,7 @@ function makeDuplicateDeclarationError(node, data, kind) {
|
|
|
1456
1346
|
return makeDiagnostic(ErrorCode.NGMODULE_DECLARATION_NOT_UNIQUE, node.name, `The ${kind} '${node.name.text}' is declared by more than one NgModule.`, context);
|
|
1457
1347
|
}
|
|
1458
1348
|
function resolveProvidersRequiringFactory(rawProviders, reflector, evaluator) {
|
|
1459
|
-
const providers = new Set();
|
|
1349
|
+
const providers = /* @__PURE__ */ new Set();
|
|
1460
1350
|
const resolvedProviders = evaluator.evaluate(rawProviders);
|
|
1461
1351
|
if (!Array.isArray(resolvedProviders)) {
|
|
1462
1352
|
return providers;
|
|
@@ -1522,12 +1412,12 @@ function toFactoryMetadata(meta, target) {
|
|
|
1522
1412
|
};
|
|
1523
1413
|
}
|
|
1524
1414
|
|
|
1525
|
-
// bazel-out/
|
|
1415
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/component.mjs
|
|
1526
1416
|
import { compileClassMetadata as compileClassMetadata3, compileComponentFromMetadata, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareComponentFromMetadata, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DomElementSchemaRegistry, ExternalExpr as ExternalExpr5, FactoryTarget as FactoryTarget3, InterpolationConfig, makeBindingParser as makeBindingParser2, ParseSourceFile as ParseSourceFile2, parseTemplate, R3TargetBinder, SelectorMatcher, ViewEncapsulation, WrappedNodeExpr as WrappedNodeExpr5 } from "@angular/compiler";
|
|
1527
|
-
import
|
|
1417
|
+
import ts18 from "typescript";
|
|
1528
1418
|
|
|
1529
|
-
// bazel-out/
|
|
1530
|
-
import
|
|
1419
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
1420
|
+
import ts4 from "typescript";
|
|
1531
1421
|
var SemanticSymbol = class {
|
|
1532
1422
|
constructor(decl) {
|
|
1533
1423
|
this.decl = decl;
|
|
@@ -1536,13 +1426,13 @@ var SemanticSymbol = class {
|
|
|
1536
1426
|
}
|
|
1537
1427
|
};
|
|
1538
1428
|
function getSymbolIdentifier(decl) {
|
|
1539
|
-
if (!
|
|
1429
|
+
if (!ts4.isSourceFile(decl.parent)) {
|
|
1540
1430
|
return null;
|
|
1541
1431
|
}
|
|
1542
1432
|
return decl.name.text;
|
|
1543
1433
|
}
|
|
1544
1434
|
|
|
1545
|
-
// bazel-out/
|
|
1435
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/graph.mjs
|
|
1546
1436
|
import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
|
|
1547
1437
|
var OpaqueSymbol = class extends SemanticSymbol {
|
|
1548
1438
|
isPublicApiAffected() {
|
|
@@ -1554,14 +1444,14 @@ var OpaqueSymbol = class extends SemanticSymbol {
|
|
|
1554
1444
|
};
|
|
1555
1445
|
var SemanticDepGraph = class {
|
|
1556
1446
|
constructor() {
|
|
1557
|
-
this.files = new Map();
|
|
1558
|
-
this.symbolByDecl = new Map();
|
|
1447
|
+
this.files = /* @__PURE__ */ new Map();
|
|
1448
|
+
this.symbolByDecl = /* @__PURE__ */ new Map();
|
|
1559
1449
|
}
|
|
1560
1450
|
registerSymbol(symbol) {
|
|
1561
1451
|
this.symbolByDecl.set(symbol.decl, symbol);
|
|
1562
1452
|
if (symbol.identifier !== null) {
|
|
1563
1453
|
if (!this.files.has(symbol.path)) {
|
|
1564
|
-
this.files.set(symbol.path, new Map());
|
|
1454
|
+
this.files.set(symbol.path, /* @__PURE__ */ new Map());
|
|
1565
1455
|
}
|
|
1566
1456
|
this.files.get(symbol.path).set(symbol.identifier, symbol);
|
|
1567
1457
|
}
|
|
@@ -1594,7 +1484,7 @@ var SemanticDepGraphUpdater = class {
|
|
|
1594
1484
|
constructor(priorGraph) {
|
|
1595
1485
|
this.priorGraph = priorGraph;
|
|
1596
1486
|
this.newGraph = new SemanticDepGraph();
|
|
1597
|
-
this.opaqueSymbols = new Map();
|
|
1487
|
+
this.opaqueSymbols = /* @__PURE__ */ new Map();
|
|
1598
1488
|
}
|
|
1599
1489
|
registerSymbol(symbol) {
|
|
1600
1490
|
this.newGraph.registerSymbol(symbol);
|
|
@@ -1602,8 +1492,8 @@ var SemanticDepGraphUpdater = class {
|
|
|
1602
1492
|
finalize() {
|
|
1603
1493
|
if (this.priorGraph === null) {
|
|
1604
1494
|
return {
|
|
1605
|
-
needsEmit: new Set(),
|
|
1606
|
-
needsTypeCheckEmit: new Set(),
|
|
1495
|
+
needsEmit: /* @__PURE__ */ new Set(),
|
|
1496
|
+
needsTypeCheckEmit: /* @__PURE__ */ new Set(),
|
|
1607
1497
|
newGraph: this.newGraph
|
|
1608
1498
|
};
|
|
1609
1499
|
}
|
|
@@ -1616,14 +1506,14 @@ var SemanticDepGraphUpdater = class {
|
|
|
1616
1506
|
};
|
|
1617
1507
|
}
|
|
1618
1508
|
determineInvalidatedFiles(priorGraph) {
|
|
1619
|
-
const isPublicApiAffected = new Set();
|
|
1509
|
+
const isPublicApiAffected = /* @__PURE__ */ new Set();
|
|
1620
1510
|
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1621
1511
|
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
1622
1512
|
if (previousSymbol === null || symbol.isPublicApiAffected(previousSymbol)) {
|
|
1623
1513
|
isPublicApiAffected.add(symbol);
|
|
1624
1514
|
}
|
|
1625
1515
|
}
|
|
1626
|
-
const needsEmit = new Set();
|
|
1516
|
+
const needsEmit = /* @__PURE__ */ new Set();
|
|
1627
1517
|
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1628
1518
|
if (symbol.isEmitAffected === void 0) {
|
|
1629
1519
|
continue;
|
|
@@ -1636,14 +1526,14 @@ var SemanticDepGraphUpdater = class {
|
|
|
1636
1526
|
return needsEmit;
|
|
1637
1527
|
}
|
|
1638
1528
|
determineInvalidatedTypeCheckFiles(priorGraph) {
|
|
1639
|
-
const isTypeCheckApiAffected = new Set();
|
|
1529
|
+
const isTypeCheckApiAffected = /* @__PURE__ */ new Set();
|
|
1640
1530
|
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1641
1531
|
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
1642
1532
|
if (previousSymbol === null || symbol.isTypeCheckApiAffected(previousSymbol)) {
|
|
1643
1533
|
isTypeCheckApiAffected.add(symbol);
|
|
1644
1534
|
}
|
|
1645
1535
|
}
|
|
1646
|
-
const needsTypeCheckEmit = new Set();
|
|
1536
|
+
const needsTypeCheckEmit = /* @__PURE__ */ new Set();
|
|
1647
1537
|
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1648
1538
|
if (symbol.isTypeCheckBlockAffected === void 0) {
|
|
1649
1539
|
continue;
|
|
@@ -1685,10 +1575,10 @@ function getImportPath(expr) {
|
|
|
1685
1575
|
}
|
|
1686
1576
|
}
|
|
1687
1577
|
|
|
1688
|
-
// bazel-out/
|
|
1689
|
-
import
|
|
1578
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
1579
|
+
import ts5 from "typescript";
|
|
1690
1580
|
|
|
1691
|
-
// bazel-out/
|
|
1581
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/util.mjs
|
|
1692
1582
|
function isSymbolEqual(a, b) {
|
|
1693
1583
|
if (a.decl === b.decl) {
|
|
1694
1584
|
return true;
|
|
@@ -1738,9 +1628,9 @@ function isSetEqual(a, b, equalityTester = referenceEquality) {
|
|
|
1738
1628
|
return true;
|
|
1739
1629
|
}
|
|
1740
1630
|
|
|
1741
|
-
// bazel-out/
|
|
1631
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
1742
1632
|
function extractSemanticTypeParameters(node) {
|
|
1743
|
-
if (!
|
|
1633
|
+
if (!ts5.isClassDeclaration(node) || node.typeParameters === void 0) {
|
|
1744
1634
|
return null;
|
|
1745
1635
|
}
|
|
1746
1636
|
return node.typeParameters.map((typeParam) => ({ hasGenericTypeBound: typeParam.constraint !== void 0 }));
|
|
@@ -1758,27 +1648,27 @@ function isTypeParameterEqual(a, b) {
|
|
|
1758
1648
|
return a.hasGenericTypeBound === b.hasGenericTypeBound;
|
|
1759
1649
|
}
|
|
1760
1650
|
|
|
1761
|
-
// bazel-out/
|
|
1651
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/api.mjs
|
|
1762
1652
|
var MetaType;
|
|
1763
1653
|
(function(MetaType2) {
|
|
1764
1654
|
MetaType2[MetaType2["Pipe"] = 0] = "Pipe";
|
|
1765
1655
|
MetaType2[MetaType2["Directive"] = 1] = "Directive";
|
|
1766
1656
|
})(MetaType || (MetaType = {}));
|
|
1767
1657
|
|
|
1768
|
-
// bazel-out/
|
|
1769
|
-
import
|
|
1658
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1659
|
+
import ts7 from "typescript";
|
|
1770
1660
|
|
|
1771
|
-
// bazel-out/
|
|
1661
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/property_mapping.mjs
|
|
1772
1662
|
var ClassPropertyMapping = class {
|
|
1773
1663
|
constructor(forwardMap) {
|
|
1774
1664
|
this.forwardMap = forwardMap;
|
|
1775
1665
|
this.reverseMap = reverseMapFromForwardMap(forwardMap);
|
|
1776
1666
|
}
|
|
1777
1667
|
static empty() {
|
|
1778
|
-
return new ClassPropertyMapping(new Map());
|
|
1668
|
+
return new ClassPropertyMapping(/* @__PURE__ */ new Map());
|
|
1779
1669
|
}
|
|
1780
1670
|
static fromMappedObject(obj) {
|
|
1781
|
-
const forwardMap = new Map();
|
|
1671
|
+
const forwardMap = /* @__PURE__ */ new Map();
|
|
1782
1672
|
for (const classPropertyName of Object.keys(obj)) {
|
|
1783
1673
|
const value = obj[classPropertyName];
|
|
1784
1674
|
const bindingPropertyName = Array.isArray(value) ? value[0] : value;
|
|
@@ -1834,7 +1724,7 @@ var ClassPropertyMapping = class {
|
|
|
1834
1724
|
}
|
|
1835
1725
|
};
|
|
1836
1726
|
function reverseMapFromForwardMap(forwardMap) {
|
|
1837
|
-
const reverseMap = new Map();
|
|
1727
|
+
const reverseMap = /* @__PURE__ */ new Map();
|
|
1838
1728
|
for (const [_, inputOrOutput] of forwardMap) {
|
|
1839
1729
|
if (!reverseMap.has(inputOrOutput.bindingPropertyName)) {
|
|
1840
1730
|
reverseMap.set(inputOrOutput.bindingPropertyName, []);
|
|
@@ -1844,14 +1734,14 @@ function reverseMapFromForwardMap(forwardMap) {
|
|
|
1844
1734
|
return reverseMap;
|
|
1845
1735
|
}
|
|
1846
1736
|
|
|
1847
|
-
// bazel-out/
|
|
1848
|
-
import
|
|
1737
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/util.mjs
|
|
1738
|
+
import ts6 from "typescript";
|
|
1849
1739
|
function extractReferencesFromType(checker, def, bestGuessOwningModule) {
|
|
1850
|
-
if (!
|
|
1740
|
+
if (!ts6.isTupleTypeNode(def)) {
|
|
1851
1741
|
return [];
|
|
1852
1742
|
}
|
|
1853
1743
|
return def.elements.map((element) => {
|
|
1854
|
-
if (!
|
|
1744
|
+
if (!ts6.isTypeQueryNode(element)) {
|
|
1855
1745
|
throw new Error(`Expected TypeQueryNode: ${nodeDebugInfo(element)}`);
|
|
1856
1746
|
}
|
|
1857
1747
|
const type = element.exprName;
|
|
@@ -1867,18 +1757,18 @@ function extractReferencesFromType(checker, def, bestGuessOwningModule) {
|
|
|
1867
1757
|
});
|
|
1868
1758
|
}
|
|
1869
1759
|
function readStringType(type) {
|
|
1870
|
-
if (!
|
|
1760
|
+
if (!ts6.isLiteralTypeNode(type) || !ts6.isStringLiteral(type.literal)) {
|
|
1871
1761
|
return null;
|
|
1872
1762
|
}
|
|
1873
1763
|
return type.literal.text;
|
|
1874
1764
|
}
|
|
1875
1765
|
function readStringMapType(type) {
|
|
1876
|
-
if (!
|
|
1766
|
+
if (!ts6.isTypeLiteralNode(type)) {
|
|
1877
1767
|
return {};
|
|
1878
1768
|
}
|
|
1879
1769
|
const obj = {};
|
|
1880
1770
|
type.members.forEach((member) => {
|
|
1881
|
-
if (!
|
|
1771
|
+
if (!ts6.isPropertySignature(member) || member.type === void 0 || member.name === void 0 || !ts6.isStringLiteral(member.name)) {
|
|
1882
1772
|
return;
|
|
1883
1773
|
}
|
|
1884
1774
|
const value = readStringType(member.type);
|
|
@@ -1890,12 +1780,12 @@ function readStringMapType(type) {
|
|
|
1890
1780
|
return obj;
|
|
1891
1781
|
}
|
|
1892
1782
|
function readStringArrayType(type) {
|
|
1893
|
-
if (!
|
|
1783
|
+
if (!ts6.isTupleTypeNode(type)) {
|
|
1894
1784
|
return [];
|
|
1895
1785
|
}
|
|
1896
1786
|
const res = [];
|
|
1897
1787
|
type.elements.forEach((el) => {
|
|
1898
|
-
if (!
|
|
1788
|
+
if (!ts6.isLiteralTypeNode(el) || !ts6.isStringLiteral(el.literal)) {
|
|
1899
1789
|
return;
|
|
1900
1790
|
}
|
|
1901
1791
|
res.push(el.literal.text);
|
|
@@ -1908,9 +1798,9 @@ function extractDirectiveTypeCheckMeta(node, inputs, reflector) {
|
|
|
1908
1798
|
const ngTemplateGuards = staticMembers.map(extractTemplateGuard).filter((guard) => guard !== null);
|
|
1909
1799
|
const hasNgTemplateContextGuard = staticMembers.some((member) => member.kind === ClassMemberKind.Method && member.name === "ngTemplateContextGuard");
|
|
1910
1800
|
const coercedInputFields = new Set(staticMembers.map(extractCoercedInput).filter((inputName) => inputName !== null));
|
|
1911
|
-
const restrictedInputFields = new Set();
|
|
1912
|
-
const stringLiteralInputFields = new Set();
|
|
1913
|
-
const undeclaredInputFields = new Set();
|
|
1801
|
+
const restrictedInputFields = /* @__PURE__ */ new Set();
|
|
1802
|
+
const stringLiteralInputFields = /* @__PURE__ */ new Set();
|
|
1803
|
+
const undeclaredInputFields = /* @__PURE__ */ new Set();
|
|
1914
1804
|
for (const classPropertyName of inputs.classPropertyNames) {
|
|
1915
1805
|
const field = members.find((member) => member.name === classPropertyName);
|
|
1916
1806
|
if (field === void 0 || field.node === null) {
|
|
@@ -1920,7 +1810,7 @@ function extractDirectiveTypeCheckMeta(node, inputs, reflector) {
|
|
|
1920
1810
|
if (isRestricted(field.node)) {
|
|
1921
1811
|
restrictedInputFields.add(classPropertyName);
|
|
1922
1812
|
}
|
|
1923
|
-
if (field.nameNode !== null &&
|
|
1813
|
+
if (field.nameNode !== null && ts6.isStringLiteral(field.nameNode)) {
|
|
1924
1814
|
stringLiteralInputFields.add(classPropertyName);
|
|
1925
1815
|
}
|
|
1926
1816
|
}
|
|
@@ -1939,7 +1829,7 @@ function isRestricted(node) {
|
|
|
1939
1829
|
if (node.modifiers === void 0) {
|
|
1940
1830
|
return false;
|
|
1941
1831
|
}
|
|
1942
|
-
return node.modifiers.some((modifier) => modifier.kind ===
|
|
1832
|
+
return node.modifiers.some((modifier) => modifier.kind === ts6.SyntaxKind.PrivateKeyword || modifier.kind === ts6.SyntaxKind.ProtectedKeyword || modifier.kind === ts6.SyntaxKind.ReadonlyKeyword);
|
|
1943
1833
|
}
|
|
1944
1834
|
function extractTemplateGuard(member) {
|
|
1945
1835
|
if (!member.name.startsWith("ngTemplateGuard_")) {
|
|
@@ -1948,7 +1838,7 @@ function extractTemplateGuard(member) {
|
|
|
1948
1838
|
const inputName = afterUnderscore(member.name);
|
|
1949
1839
|
if (member.kind === ClassMemberKind.Property) {
|
|
1950
1840
|
let type = null;
|
|
1951
|
-
if (member.type !== null &&
|
|
1841
|
+
if (member.type !== null && ts6.isLiteralTypeNode(member.type) && ts6.isStringLiteral(member.type.literal)) {
|
|
1952
1842
|
type = member.type.literal.text;
|
|
1953
1843
|
}
|
|
1954
1844
|
if (type !== "binding") {
|
|
@@ -2011,7 +1901,7 @@ function hasInjectableFields(clazz, host) {
|
|
|
2011
1901
|
return members.some(({ isStatic, name }) => isStatic && (name === "\u0275prov" || name === "\u0275fac"));
|
|
2012
1902
|
}
|
|
2013
1903
|
|
|
2014
|
-
// bazel-out/
|
|
1904
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
2015
1905
|
var DtsMetadataReader = class {
|
|
2016
1906
|
constructor(checker, reflector) {
|
|
2017
1907
|
this.checker = checker;
|
|
@@ -2022,7 +1912,7 @@ var DtsMetadataReader = class {
|
|
|
2022
1912
|
const ngModuleDef = this.reflector.getMembersOfClass(clazz).find((member) => member.name === "\u0275mod" && member.isStatic);
|
|
2023
1913
|
if (ngModuleDef === void 0) {
|
|
2024
1914
|
return null;
|
|
2025
|
-
} else if (ngModuleDef.type === null || !
|
|
1915
|
+
} else if (ngModuleDef.type === null || !ts7.isTypeReferenceNode(ngModuleDef.type) || ngModuleDef.type.typeArguments === void 0 || ngModuleDef.type.typeArguments.length !== 4) {
|
|
2026
1916
|
return null;
|
|
2027
1917
|
}
|
|
2028
1918
|
const [_, declarationMetadata, importMetadata, exportMetadata] = ngModuleDef.type.typeArguments;
|
|
@@ -2040,7 +1930,7 @@ var DtsMetadataReader = class {
|
|
|
2040
1930
|
const def = this.reflector.getMembersOfClass(clazz).find((field) => field.isStatic && (field.name === "\u0275cmp" || field.name === "\u0275dir"));
|
|
2041
1931
|
if (def === void 0) {
|
|
2042
1932
|
return null;
|
|
2043
|
-
} else if (def.type === null || !
|
|
1933
|
+
} else if (def.type === null || !ts7.isTypeReferenceNode(def.type) || def.type.typeArguments === void 0 || def.type.typeArguments.length < 2) {
|
|
2044
1934
|
return null;
|
|
2045
1935
|
}
|
|
2046
1936
|
const isComponent = def.name === "\u0275cmp";
|
|
@@ -2063,18 +1953,19 @@ var DtsMetadataReader = class {
|
|
|
2063
1953
|
}, extractDirectiveTypeCheckMeta(clazz, inputs, this.reflector)), {
|
|
2064
1954
|
baseClass: readBaseClass2(clazz, this.checker, this.reflector),
|
|
2065
1955
|
isPoisoned: false,
|
|
2066
|
-
isStructural
|
|
1956
|
+
isStructural,
|
|
1957
|
+
animationTriggerNames: null
|
|
2067
1958
|
});
|
|
2068
1959
|
}
|
|
2069
1960
|
getPipeMetadata(ref) {
|
|
2070
1961
|
const def = this.reflector.getMembersOfClass(ref.node).find((field) => field.isStatic && field.name === "\u0275pipe");
|
|
2071
1962
|
if (def === void 0) {
|
|
2072
1963
|
return null;
|
|
2073
|
-
} else if (def.type === null || !
|
|
1964
|
+
} else if (def.type === null || !ts7.isTypeReferenceNode(def.type) || def.type.typeArguments === void 0 || def.type.typeArguments.length < 2) {
|
|
2074
1965
|
return null;
|
|
2075
1966
|
}
|
|
2076
1967
|
const type = def.type.typeArguments[1];
|
|
2077
|
-
if (!
|
|
1968
|
+
if (!ts7.isLiteralTypeNode(type) || !ts7.isStringLiteral(type.literal)) {
|
|
2078
1969
|
return null;
|
|
2079
1970
|
}
|
|
2080
1971
|
const name = type.literal.text;
|
|
@@ -2092,12 +1983,12 @@ function readBaseClass2(clazz, checker, reflector) {
|
|
|
2092
1983
|
}
|
|
2093
1984
|
if (clazz.heritageClauses !== void 0) {
|
|
2094
1985
|
for (const clause of clazz.heritageClauses) {
|
|
2095
|
-
if (clause.token ===
|
|
1986
|
+
if (clause.token === ts7.SyntaxKind.ExtendsKeyword) {
|
|
2096
1987
|
const baseExpr = clause.types[0].expression;
|
|
2097
1988
|
let symbol = checker.getSymbolAtLocation(baseExpr);
|
|
2098
1989
|
if (symbol === void 0) {
|
|
2099
1990
|
return "dynamic";
|
|
2100
|
-
} else if (symbol.flags &
|
|
1991
|
+
} else if (symbol.flags & ts7.SymbolFlags.Alias) {
|
|
2101
1992
|
symbol = checker.getAliasedSymbol(symbol);
|
|
2102
1993
|
}
|
|
2103
1994
|
if (symbol.valueDeclaration !== void 0 && isNamedClassDeclaration(symbol.valueDeclaration)) {
|
|
@@ -2111,7 +2002,7 @@ function readBaseClass2(clazz, checker, reflector) {
|
|
|
2111
2002
|
return null;
|
|
2112
2003
|
}
|
|
2113
2004
|
|
|
2114
|
-
// bazel-out/
|
|
2005
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/inheritance.mjs
|
|
2115
2006
|
function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
2116
2007
|
const topMeta = reader.getDirectiveMetadata(dir);
|
|
2117
2008
|
if (topMeta === null) {
|
|
@@ -2120,10 +2011,10 @@ function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
|
2120
2011
|
if (topMeta.baseClass === null) {
|
|
2121
2012
|
return topMeta;
|
|
2122
2013
|
}
|
|
2123
|
-
const coercedInputFields = new Set();
|
|
2124
|
-
const undeclaredInputFields = new Set();
|
|
2125
|
-
const restrictedInputFields = new Set();
|
|
2126
|
-
const stringLiteralInputFields = new Set();
|
|
2014
|
+
const coercedInputFields = /* @__PURE__ */ new Set();
|
|
2015
|
+
const undeclaredInputFields = /* @__PURE__ */ new Set();
|
|
2016
|
+
const restrictedInputFields = /* @__PURE__ */ new Set();
|
|
2017
|
+
const stringLiteralInputFields = /* @__PURE__ */ new Set();
|
|
2127
2018
|
let isDynamic = false;
|
|
2128
2019
|
let inputs = ClassPropertyMapping.empty();
|
|
2129
2020
|
let outputs = ClassPropertyMapping.empty();
|
|
@@ -2168,12 +2059,12 @@ function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
|
2168
2059
|
});
|
|
2169
2060
|
}
|
|
2170
2061
|
|
|
2171
|
-
// bazel-out/
|
|
2062
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/registry.mjs
|
|
2172
2063
|
var LocalMetadataRegistry = class {
|
|
2173
2064
|
constructor() {
|
|
2174
|
-
this.directives = new Map();
|
|
2175
|
-
this.ngModules = new Map();
|
|
2176
|
-
this.pipes = new Map();
|
|
2065
|
+
this.directives = /* @__PURE__ */ new Map();
|
|
2066
|
+
this.ngModules = /* @__PURE__ */ new Map();
|
|
2067
|
+
this.pipes = /* @__PURE__ */ new Map();
|
|
2177
2068
|
}
|
|
2178
2069
|
getDirectiveMetadata(ref) {
|
|
2179
2070
|
return this.directives.has(ref.node) ? this.directives.get(ref.node) : null;
|
|
@@ -2217,7 +2108,7 @@ var CompoundMetadataRegistry = class {
|
|
|
2217
2108
|
var InjectableClassRegistry = class {
|
|
2218
2109
|
constructor(host) {
|
|
2219
2110
|
this.host = host;
|
|
2220
|
-
this.classes = new Set();
|
|
2111
|
+
this.classes = /* @__PURE__ */ new Set();
|
|
2221
2112
|
}
|
|
2222
2113
|
registerInjectable(declaration) {
|
|
2223
2114
|
this.classes.add(declaration);
|
|
@@ -2227,17 +2118,17 @@ var InjectableClassRegistry = class {
|
|
|
2227
2118
|
}
|
|
2228
2119
|
};
|
|
2229
2120
|
|
|
2230
|
-
// bazel-out/
|
|
2121
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/resource_registry.mjs
|
|
2231
2122
|
var ResourceRegistry = class {
|
|
2232
2123
|
constructor() {
|
|
2233
|
-
this.externalTemplateToComponentsMap = new Map();
|
|
2234
|
-
this.componentToTemplateMap = new Map();
|
|
2235
|
-
this.componentToStylesMap = new Map();
|
|
2236
|
-
this.externalStyleToComponentsMap = new Map();
|
|
2124
|
+
this.externalTemplateToComponentsMap = /* @__PURE__ */ new Map();
|
|
2125
|
+
this.componentToTemplateMap = /* @__PURE__ */ new Map();
|
|
2126
|
+
this.componentToStylesMap = /* @__PURE__ */ new Map();
|
|
2127
|
+
this.externalStyleToComponentsMap = /* @__PURE__ */ new Map();
|
|
2237
2128
|
}
|
|
2238
2129
|
getComponentsWithTemplate(template) {
|
|
2239
2130
|
if (!this.externalTemplateToComponentsMap.has(template)) {
|
|
2240
|
-
return new Set();
|
|
2131
|
+
return /* @__PURE__ */ new Set();
|
|
2241
2132
|
}
|
|
2242
2133
|
return this.externalTemplateToComponentsMap.get(template);
|
|
2243
2134
|
}
|
|
@@ -2253,7 +2144,7 @@ var ResourceRegistry = class {
|
|
|
2253
2144
|
const { path } = templateResource;
|
|
2254
2145
|
if (path !== null) {
|
|
2255
2146
|
if (!this.externalTemplateToComponentsMap.has(path)) {
|
|
2256
|
-
this.externalTemplateToComponentsMap.set(path, new Set());
|
|
2147
|
+
this.externalTemplateToComponentsMap.set(path, /* @__PURE__ */ new Set());
|
|
2257
2148
|
}
|
|
2258
2149
|
this.externalTemplateToComponentsMap.get(path).add(component);
|
|
2259
2150
|
}
|
|
@@ -2268,11 +2159,11 @@ var ResourceRegistry = class {
|
|
|
2268
2159
|
registerStyle(styleResource, component) {
|
|
2269
2160
|
const { path } = styleResource;
|
|
2270
2161
|
if (!this.componentToStylesMap.has(component)) {
|
|
2271
|
-
this.componentToStylesMap.set(component, new Set());
|
|
2162
|
+
this.componentToStylesMap.set(component, /* @__PURE__ */ new Set());
|
|
2272
2163
|
}
|
|
2273
2164
|
if (path !== null) {
|
|
2274
2165
|
if (!this.externalStyleToComponentsMap.has(path)) {
|
|
2275
|
-
this.externalStyleToComponentsMap.set(path, new Set());
|
|
2166
|
+
this.externalStyleToComponentsMap.set(path, /* @__PURE__ */ new Set());
|
|
2276
2167
|
}
|
|
2277
2168
|
this.externalStyleToComponentsMap.get(path).add(component);
|
|
2278
2169
|
}
|
|
@@ -2280,19 +2171,19 @@ var ResourceRegistry = class {
|
|
|
2280
2171
|
}
|
|
2281
2172
|
getStyles(component) {
|
|
2282
2173
|
if (!this.componentToStylesMap.has(component)) {
|
|
2283
|
-
return new Set();
|
|
2174
|
+
return /* @__PURE__ */ new Set();
|
|
2284
2175
|
}
|
|
2285
2176
|
return this.componentToStylesMap.get(component);
|
|
2286
2177
|
}
|
|
2287
2178
|
getComponentsWithStyle(styleUrl) {
|
|
2288
2179
|
if (!this.externalStyleToComponentsMap.has(styleUrl)) {
|
|
2289
|
-
return new Set();
|
|
2180
|
+
return /* @__PURE__ */ new Set();
|
|
2290
2181
|
}
|
|
2291
2182
|
return this.externalStyleToComponentsMap.get(styleUrl);
|
|
2292
2183
|
}
|
|
2293
2184
|
};
|
|
2294
2185
|
|
|
2295
|
-
// bazel-out/
|
|
2186
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/api.mjs
|
|
2296
2187
|
var CompilationMode;
|
|
2297
2188
|
(function(CompilationMode2) {
|
|
2298
2189
|
CompilationMode2[CompilationMode2["FULL"] = 0] = "FULL";
|
|
@@ -2310,28 +2201,28 @@ var HandlerFlags;
|
|
|
2310
2201
|
HandlerFlags2[HandlerFlags2["FULL_INHERITANCE"] = 1] = "FULL_INHERITANCE";
|
|
2311
2202
|
})(HandlerFlags || (HandlerFlags = {}));
|
|
2312
2203
|
|
|
2313
|
-
// bazel-out/
|
|
2314
|
-
import
|
|
2204
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/alias.mjs
|
|
2205
|
+
import ts8 from "typescript";
|
|
2315
2206
|
function aliasTransformFactory(exportStatements) {
|
|
2316
2207
|
return (context) => {
|
|
2317
2208
|
return (file) => {
|
|
2318
|
-
if (
|
|
2209
|
+
if (ts8.isBundle(file) || !exportStatements.has(file.fileName)) {
|
|
2319
2210
|
return file;
|
|
2320
2211
|
}
|
|
2321
2212
|
const statements = [...file.statements];
|
|
2322
2213
|
exportStatements.get(file.fileName).forEach(([moduleName, symbolName], aliasName) => {
|
|
2323
|
-
const stmt =
|
|
2214
|
+
const stmt = ts8.createExportDeclaration(void 0, void 0, ts8.createNamedExports([createExportSpecifier(symbolName, aliasName)]), ts8.createStringLiteral(moduleName));
|
|
2324
2215
|
statements.push(stmt);
|
|
2325
2216
|
});
|
|
2326
|
-
return
|
|
2217
|
+
return ts8.updateSourceFileNode(file, statements);
|
|
2327
2218
|
};
|
|
2328
2219
|
};
|
|
2329
2220
|
}
|
|
2330
2221
|
|
|
2331
|
-
// bazel-out/
|
|
2332
|
-
import
|
|
2222
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
2223
|
+
import ts9 from "typescript";
|
|
2333
2224
|
|
|
2334
|
-
// bazel-out/
|
|
2225
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/trait.mjs
|
|
2335
2226
|
var TraitState;
|
|
2336
2227
|
(function(TraitState2) {
|
|
2337
2228
|
TraitState2[TraitState2["Pending"] = 0] = "Pending";
|
|
@@ -2386,7 +2277,7 @@ var TraitImpl = class {
|
|
|
2386
2277
|
}
|
|
2387
2278
|
};
|
|
2388
2279
|
|
|
2389
|
-
// bazel-out/
|
|
2280
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
2390
2281
|
var TraitCompiler = class {
|
|
2391
2282
|
constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater) {
|
|
2392
2283
|
this.handlers = handlers;
|
|
@@ -2397,11 +2288,11 @@ var TraitCompiler = class {
|
|
|
2397
2288
|
this.compilationMode = compilationMode;
|
|
2398
2289
|
this.dtsTransforms = dtsTransforms;
|
|
2399
2290
|
this.semanticDepGraphUpdater = semanticDepGraphUpdater;
|
|
2400
|
-
this.classes = new Map();
|
|
2401
|
-
this.fileToClasses = new Map();
|
|
2402
|
-
this.filesWithoutTraits = new Set();
|
|
2403
|
-
this.reexportMap = new Map();
|
|
2404
|
-
this.handlersByName = new Map();
|
|
2291
|
+
this.classes = /* @__PURE__ */ new Map();
|
|
2292
|
+
this.fileToClasses = /* @__PURE__ */ new Map();
|
|
2293
|
+
this.filesWithoutTraits = /* @__PURE__ */ new Set();
|
|
2294
|
+
this.reexportMap = /* @__PURE__ */ new Map();
|
|
2295
|
+
this.handlersByName = /* @__PURE__ */ new Map();
|
|
2405
2296
|
for (const handler of handlers) {
|
|
2406
2297
|
this.handlersByName.set(handler.name, handler);
|
|
2407
2298
|
}
|
|
@@ -2434,7 +2325,7 @@ var TraitCompiler = class {
|
|
|
2434
2325
|
if (this.reflector.isClass(node)) {
|
|
2435
2326
|
this.analyzeClass(node, preanalyze ? promises : null);
|
|
2436
2327
|
}
|
|
2437
|
-
|
|
2328
|
+
ts9.forEachChild(node, visit2);
|
|
2438
2329
|
};
|
|
2439
2330
|
visit2(sf);
|
|
2440
2331
|
if (preanalyze && promises.length > 0) {
|
|
@@ -2461,7 +2352,7 @@ var TraitCompiler = class {
|
|
|
2461
2352
|
return records;
|
|
2462
2353
|
}
|
|
2463
2354
|
getAnalyzedRecords() {
|
|
2464
|
-
const result = new Map();
|
|
2355
|
+
const result = /* @__PURE__ */ new Map();
|
|
2465
2356
|
for (const [sf, classes] of this.fileToClasses) {
|
|
2466
2357
|
const records = [];
|
|
2467
2358
|
for (const clazz of classes) {
|
|
@@ -2499,7 +2390,7 @@ var TraitCompiler = class {
|
|
|
2499
2390
|
this.classes.set(record.node, record);
|
|
2500
2391
|
const sf = record.node.getSourceFile();
|
|
2501
2392
|
if (!this.fileToClasses.has(sf)) {
|
|
2502
|
-
this.fileToClasses.set(sf, new Set());
|
|
2393
|
+
this.fileToClasses.set(sf, /* @__PURE__ */ new Set());
|
|
2503
2394
|
}
|
|
2504
2395
|
this.fileToClasses.get(sf).add(record.node);
|
|
2505
2396
|
}
|
|
@@ -2533,7 +2424,7 @@ var TraitCompiler = class {
|
|
|
2533
2424
|
this.classes.set(clazz, record);
|
|
2534
2425
|
const sf = clazz.getSourceFile();
|
|
2535
2426
|
if (!this.fileToClasses.has(sf)) {
|
|
2536
|
-
this.fileToClasses.set(sf, new Set());
|
|
2427
|
+
this.fileToClasses.set(sf, /* @__PURE__ */ new Set());
|
|
2537
2428
|
}
|
|
2538
2429
|
this.fileToClasses.get(sf).add(clazz);
|
|
2539
2430
|
} else {
|
|
@@ -2545,7 +2436,7 @@ var TraitCompiler = class {
|
|
|
2545
2436
|
}
|
|
2546
2437
|
if (isPrimaryHandler && record.hasPrimaryHandler) {
|
|
2547
2438
|
record.metaDiagnostics = [{
|
|
2548
|
-
category:
|
|
2439
|
+
category: ts9.DiagnosticCategory.Error,
|
|
2549
2440
|
code: Number("-99" + ErrorCode.DECORATOR_COLLISION),
|
|
2550
2441
|
file: getSourceFile(clazz),
|
|
2551
2442
|
start: clazz.getStart(void 0, false),
|
|
@@ -2662,7 +2553,7 @@ var TraitCompiler = class {
|
|
|
2662
2553
|
if (result.reexports !== void 0) {
|
|
2663
2554
|
const fileName = clazz.getSourceFile().fileName;
|
|
2664
2555
|
if (!this.reexportMap.has(fileName)) {
|
|
2665
|
-
this.reexportMap.set(fileName, new Map());
|
|
2556
|
+
this.reexportMap.set(fileName, /* @__PURE__ */ new Map());
|
|
2666
2557
|
}
|
|
2667
2558
|
const fileReexports = this.reexportMap.get(fileName);
|
|
2668
2559
|
for (const reexport of result.reexports) {
|
|
@@ -2753,7 +2644,7 @@ var TraitCompiler = class {
|
|
|
2753
2644
|
}
|
|
2754
2645
|
}
|
|
2755
2646
|
compile(clazz, constantPool) {
|
|
2756
|
-
const original =
|
|
2647
|
+
const original = ts9.getOriginalNode(clazz);
|
|
2757
2648
|
if (!this.reflector.isClass(clazz) || !this.reflector.isClass(original) || !this.classes.has(original)) {
|
|
2758
2649
|
return null;
|
|
2759
2650
|
}
|
|
@@ -2784,7 +2675,7 @@ var TraitCompiler = class {
|
|
|
2784
2675
|
return res.length > 0 ? res : null;
|
|
2785
2676
|
}
|
|
2786
2677
|
decoratorsFor(node) {
|
|
2787
|
-
const original =
|
|
2678
|
+
const original = ts9.getOriginalNode(node);
|
|
2788
2679
|
if (!this.reflector.isClass(original) || !this.classes.has(original)) {
|
|
2789
2680
|
return [];
|
|
2790
2681
|
}
|
|
@@ -2794,7 +2685,7 @@ var TraitCompiler = class {
|
|
|
2794
2685
|
if (trait.state !== TraitState.Resolved) {
|
|
2795
2686
|
continue;
|
|
2796
2687
|
}
|
|
2797
|
-
if (trait.detected.trigger !== null &&
|
|
2688
|
+
if (trait.detected.trigger !== null && ts9.isDecorator(trait.detected.trigger)) {
|
|
2798
2689
|
decorators.push(trait.detected.trigger);
|
|
2799
2690
|
}
|
|
2800
2691
|
}
|
|
@@ -2823,24 +2714,24 @@ var TraitCompiler = class {
|
|
|
2823
2714
|
}
|
|
2824
2715
|
};
|
|
2825
2716
|
|
|
2826
|
-
// bazel-out/
|
|
2827
|
-
import ts12 from "typescript";
|
|
2828
|
-
|
|
2829
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/utils.mjs
|
|
2717
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
2830
2718
|
import ts11 from "typescript";
|
|
2719
|
+
|
|
2720
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/utils.mjs
|
|
2721
|
+
import ts10 from "typescript";
|
|
2831
2722
|
function addImports(importManager, sf, extraStatements = []) {
|
|
2832
2723
|
const addedImports = importManager.getAllImports(sf.fileName).map((i) => {
|
|
2833
|
-
const qualifier =
|
|
2834
|
-
const importClause =
|
|
2835
|
-
const decl =
|
|
2836
|
-
|
|
2724
|
+
const qualifier = ts10.createIdentifier(i.qualifier.text);
|
|
2725
|
+
const importClause = ts10.createImportClause(void 0, ts10.createNamespaceImport(qualifier));
|
|
2726
|
+
const decl = ts10.createImportDeclaration(void 0, void 0, importClause, ts10.createLiteral(i.specifier));
|
|
2727
|
+
ts10.setOriginalNode(i.qualifier, decl);
|
|
2837
2728
|
return decl;
|
|
2838
2729
|
});
|
|
2839
2730
|
const existingImports = sf.statements.filter((stmt) => isImportStatement(stmt));
|
|
2840
2731
|
const body = sf.statements.filter((stmt) => !isImportStatement(stmt));
|
|
2841
2732
|
if (addedImports.length > 0) {
|
|
2842
|
-
const fileoverviewAnchorStmt =
|
|
2843
|
-
return
|
|
2733
|
+
const fileoverviewAnchorStmt = ts10.createNotEmittedStatement(sf);
|
|
2734
|
+
return ts10.updateSourceFileNode(sf, ts10.createNodeArray([
|
|
2844
2735
|
fileoverviewAnchorStmt,
|
|
2845
2736
|
...existingImports,
|
|
2846
2737
|
...addedImports,
|
|
@@ -2851,13 +2742,13 @@ function addImports(importManager, sf, extraStatements = []) {
|
|
|
2851
2742
|
return sf;
|
|
2852
2743
|
}
|
|
2853
2744
|
function isImportStatement(stmt) {
|
|
2854
|
-
return
|
|
2745
|
+
return ts10.isImportDeclaration(stmt) || ts10.isImportEqualsDeclaration(stmt) || ts10.isNamespaceImport(stmt);
|
|
2855
2746
|
}
|
|
2856
2747
|
|
|
2857
|
-
// bazel-out/
|
|
2748
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
2858
2749
|
var DtsTransformRegistry = class {
|
|
2859
2750
|
constructor() {
|
|
2860
|
-
this.ivyDeclarationTransforms = new Map();
|
|
2751
|
+
this.ivyDeclarationTransforms = /* @__PURE__ */ new Map();
|
|
2861
2752
|
}
|
|
2862
2753
|
getIvyDeclarationTransform(sf) {
|
|
2863
2754
|
if (!this.ivyDeclarationTransforms.has(sf)) {
|
|
@@ -2869,7 +2760,7 @@ var DtsTransformRegistry = class {
|
|
|
2869
2760
|
if (!sf.isDeclarationFile) {
|
|
2870
2761
|
return null;
|
|
2871
2762
|
}
|
|
2872
|
-
const originalSf =
|
|
2763
|
+
const originalSf = ts11.getOriginalNode(sf);
|
|
2873
2764
|
let transforms = null;
|
|
2874
2765
|
if (this.ivyDeclarationTransforms.has(originalSf)) {
|
|
2875
2766
|
transforms = [];
|
|
@@ -2882,7 +2773,7 @@ function declarationTransformFactory(transformRegistry, importRewriter, importPr
|
|
|
2882
2773
|
return (context) => {
|
|
2883
2774
|
const transformer = new DtsTransformer(context, importRewriter, importPrefix);
|
|
2884
2775
|
return (fileOrBundle) => {
|
|
2885
|
-
if (
|
|
2776
|
+
if (ts11.isBundle(fileOrBundle)) {
|
|
2886
2777
|
return fileOrBundle;
|
|
2887
2778
|
}
|
|
2888
2779
|
const transforms = transformRegistry.getAllTransforms(fileOrBundle);
|
|
@@ -2902,15 +2793,15 @@ var DtsTransformer = class {
|
|
|
2902
2793
|
transform(sf, transforms) {
|
|
2903
2794
|
const imports = new ImportManager(this.importRewriter, this.importPrefix);
|
|
2904
2795
|
const visitor = (node) => {
|
|
2905
|
-
if (
|
|
2796
|
+
if (ts11.isClassDeclaration(node)) {
|
|
2906
2797
|
return this.transformClassDeclaration(node, transforms, imports);
|
|
2907
|
-
} else if (
|
|
2798
|
+
} else if (ts11.isFunctionDeclaration(node)) {
|
|
2908
2799
|
return this.transformFunctionDeclaration(node, transforms, imports);
|
|
2909
2800
|
} else {
|
|
2910
|
-
return
|
|
2801
|
+
return ts11.visitEachChild(node, visitor, this.ctx);
|
|
2911
2802
|
}
|
|
2912
2803
|
};
|
|
2913
|
-
sf =
|
|
2804
|
+
sf = ts11.visitNode(sf, visitor);
|
|
2914
2805
|
return addImports(imports, sf);
|
|
2915
2806
|
}
|
|
2916
2807
|
transformClassDeclaration(clazz, transforms, imports) {
|
|
@@ -2938,7 +2829,7 @@ var DtsTransformer = class {
|
|
|
2938
2829
|
}
|
|
2939
2830
|
}
|
|
2940
2831
|
if (elementsChanged && clazz === newClazz) {
|
|
2941
|
-
newClazz =
|
|
2832
|
+
newClazz = ts11.updateClassDeclaration(clazz, clazz.decorators, clazz.modifiers, clazz.name, clazz.typeParameters, clazz.heritageClauses, elements);
|
|
2942
2833
|
}
|
|
2943
2834
|
return newClazz;
|
|
2944
2835
|
}
|
|
@@ -2954,44 +2845,44 @@ var DtsTransformer = class {
|
|
|
2954
2845
|
};
|
|
2955
2846
|
var IvyDeclarationDtsTransform = class {
|
|
2956
2847
|
constructor() {
|
|
2957
|
-
this.declarationFields = new Map();
|
|
2848
|
+
this.declarationFields = /* @__PURE__ */ new Map();
|
|
2958
2849
|
}
|
|
2959
2850
|
addFields(decl, fields) {
|
|
2960
2851
|
this.declarationFields.set(decl, fields);
|
|
2961
2852
|
}
|
|
2962
2853
|
transformClass(clazz, members, imports) {
|
|
2963
|
-
const original =
|
|
2854
|
+
const original = ts11.getOriginalNode(clazz);
|
|
2964
2855
|
if (!this.declarationFields.has(original)) {
|
|
2965
2856
|
return clazz;
|
|
2966
2857
|
}
|
|
2967
2858
|
const fields = this.declarationFields.get(original);
|
|
2968
2859
|
const newMembers = fields.map((decl) => {
|
|
2969
|
-
const modifiers = [
|
|
2860
|
+
const modifiers = [ts11.createModifier(ts11.SyntaxKind.StaticKeyword)];
|
|
2970
2861
|
const typeRef = translateType(decl.type, imports);
|
|
2971
2862
|
markForEmitAsSingleLine(typeRef);
|
|
2972
|
-
return
|
|
2863
|
+
return ts11.createProperty(void 0, modifiers, decl.name, void 0, typeRef, void 0);
|
|
2973
2864
|
});
|
|
2974
|
-
return
|
|
2865
|
+
return ts11.updateClassDeclaration(clazz, clazz.decorators, clazz.modifiers, clazz.name, clazz.typeParameters, clazz.heritageClauses, [...members, ...newMembers]);
|
|
2975
2866
|
}
|
|
2976
2867
|
};
|
|
2977
2868
|
function markForEmitAsSingleLine(node) {
|
|
2978
|
-
|
|
2979
|
-
|
|
2869
|
+
ts11.setEmitFlags(node, ts11.EmitFlags.SingleLine);
|
|
2870
|
+
ts11.forEachChild(node, markForEmitAsSingleLine);
|
|
2980
2871
|
}
|
|
2981
2872
|
|
|
2982
|
-
// bazel-out/
|
|
2873
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
2983
2874
|
import { ConstantPool } from "@angular/compiler";
|
|
2984
|
-
import ts14 from "typescript";
|
|
2985
|
-
|
|
2986
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
|
|
2987
2875
|
import ts13 from "typescript";
|
|
2876
|
+
|
|
2877
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
|
|
2878
|
+
import ts12 from "typescript";
|
|
2988
2879
|
function visit(node, visitor, context) {
|
|
2989
2880
|
return visitor._visit(node, context);
|
|
2990
2881
|
}
|
|
2991
2882
|
var Visitor = class {
|
|
2992
2883
|
constructor() {
|
|
2993
|
-
this._before = new Map();
|
|
2994
|
-
this._after = new Map();
|
|
2884
|
+
this._before = /* @__PURE__ */ new Map();
|
|
2885
|
+
this._after = /* @__PURE__ */ new Map();
|
|
2995
2886
|
}
|
|
2996
2887
|
_visitListEntryNode(node, visitor) {
|
|
2997
2888
|
const result = visitor(node);
|
|
@@ -3008,8 +2899,8 @@ var Visitor = class {
|
|
|
3008
2899
|
}
|
|
3009
2900
|
_visit(node, context) {
|
|
3010
2901
|
let visitedNode = null;
|
|
3011
|
-
node =
|
|
3012
|
-
if (
|
|
2902
|
+
node = ts12.visitEachChild(node, (child) => this._visit(child, context), context);
|
|
2903
|
+
if (ts12.isClassDeclaration(node)) {
|
|
3013
2904
|
visitedNode = this._visitListEntryNode(node, (node2) => this.visitClassDeclaration(node2));
|
|
3014
2905
|
} else {
|
|
3015
2906
|
visitedNode = this.visitOtherNode(node);
|
|
@@ -3023,7 +2914,7 @@ var Visitor = class {
|
|
|
3023
2914
|
if (node.statements.every((stmt) => !this._before.has(stmt) && !this._after.has(stmt))) {
|
|
3024
2915
|
return node;
|
|
3025
2916
|
}
|
|
3026
|
-
const clone =
|
|
2917
|
+
const clone = ts12.getMutableClone(node);
|
|
3027
2918
|
const newStatements = [];
|
|
3028
2919
|
clone.statements.forEach((stmt) => {
|
|
3029
2920
|
if (this._before.has(stmt)) {
|
|
@@ -3036,7 +2927,7 @@ var Visitor = class {
|
|
|
3036
2927
|
this._after.delete(stmt);
|
|
3037
2928
|
}
|
|
3038
2929
|
});
|
|
3039
|
-
clone.statements =
|
|
2930
|
+
clone.statements = ts12.createNodeArray(newStatements, node.statements.hasTrailingComma);
|
|
3040
2931
|
return clone;
|
|
3041
2932
|
}
|
|
3042
2933
|
};
|
|
@@ -3045,8 +2936,8 @@ function hasStatements(node) {
|
|
|
3045
2936
|
return block.statements !== void 0 && Array.isArray(block.statements);
|
|
3046
2937
|
}
|
|
3047
2938
|
|
|
3048
|
-
// bazel-out/
|
|
3049
|
-
var NO_DECORATORS = new Set();
|
|
2939
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
2940
|
+
var NO_DECORATORS = /* @__PURE__ */ new Set();
|
|
3050
2941
|
var CLOSURE_FILE_OVERVIEW_REGEXP = /\s+@fileoverview\s+/i;
|
|
3051
2942
|
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, perf, isCore, isClosureCompilerEnabled) {
|
|
3052
2943
|
const recordWrappedNode = createRecorderFn(defaultImportTracker);
|
|
@@ -3061,7 +2952,7 @@ var IvyCompilationVisitor = class extends Visitor {
|
|
|
3061
2952
|
super();
|
|
3062
2953
|
this.compilation = compilation;
|
|
3063
2954
|
this.constantPool = constantPool;
|
|
3064
|
-
this.classCompilationMap = new Map();
|
|
2955
|
+
this.classCompilationMap = /* @__PURE__ */ new Map();
|
|
3065
2956
|
}
|
|
3066
2957
|
visitClassDeclaration(node) {
|
|
3067
2958
|
const result = this.compilation.compile(node, this.constantPool);
|
|
@@ -3094,14 +2985,14 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
3094
2985
|
const members = [...node.members];
|
|
3095
2986
|
for (const field of this.classCompilationMap.get(node)) {
|
|
3096
2987
|
const exprNode = translateExpression(field.initializer, this.importManager, translateOptions);
|
|
3097
|
-
const property =
|
|
2988
|
+
const property = ts13.createProperty(void 0, [ts13.createToken(ts13.SyntaxKind.StaticKeyword)], field.name, void 0, void 0, exprNode);
|
|
3098
2989
|
if (this.isClosureCompilerEnabled) {
|
|
3099
|
-
|
|
2990
|
+
ts13.addSyntheticLeadingComment(property, ts13.SyntaxKind.MultiLineCommentTrivia, "* @nocollapse ", false);
|
|
3100
2991
|
}
|
|
3101
2992
|
field.statements.map((stmt) => translateStatement(stmt, this.importManager, translateOptions)).forEach((stmt) => statements.push(stmt));
|
|
3102
2993
|
members.push(property);
|
|
3103
2994
|
}
|
|
3104
|
-
node =
|
|
2995
|
+
node = ts13.updateClassDeclaration(node, maybeFilterDecorator(node.decorators, this.compilation.decoratorsFor(node)), node.modifiers, node.name, node.typeParameters, node.heritageClauses || [], members.map((member) => this._stripAngularDecorators(member)));
|
|
3105
2996
|
return { node, after: statements };
|
|
3106
2997
|
}
|
|
3107
2998
|
_angularCoreDecorators(decl) {
|
|
@@ -3130,25 +3021,25 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
3130
3021
|
if (filtered.length === 0) {
|
|
3131
3022
|
return void 0;
|
|
3132
3023
|
}
|
|
3133
|
-
const array =
|
|
3024
|
+
const array = ts13.createNodeArray(filtered);
|
|
3134
3025
|
array.pos = node.decorators.pos;
|
|
3135
3026
|
array.end = node.decorators.end;
|
|
3136
3027
|
return array;
|
|
3137
3028
|
}
|
|
3138
3029
|
_stripAngularDecorators(node) {
|
|
3139
|
-
if (
|
|
3140
|
-
node =
|
|
3141
|
-
} else if (
|
|
3142
|
-
node =
|
|
3143
|
-
} else if (
|
|
3144
|
-
node =
|
|
3145
|
-
} else if (
|
|
3146
|
-
node =
|
|
3147
|
-
} else if (
|
|
3148
|
-
node =
|
|
3149
|
-
} else if (
|
|
3030
|
+
if (ts13.isParameter(node)) {
|
|
3031
|
+
node = ts13.updateParameter(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer);
|
|
3032
|
+
} else if (ts13.isMethodDeclaration(node) && node.decorators !== void 0) {
|
|
3033
|
+
node = ts13.updateMethod(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body);
|
|
3034
|
+
} else if (ts13.isPropertyDeclaration(node) && node.decorators !== void 0) {
|
|
3035
|
+
node = ts13.updateProperty(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.questionToken, node.type, node.initializer);
|
|
3036
|
+
} else if (ts13.isGetAccessor(node)) {
|
|
3037
|
+
node = ts13.updateGetAccessor(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.parameters, node.type, node.body);
|
|
3038
|
+
} else if (ts13.isSetAccessor(node)) {
|
|
3039
|
+
node = ts13.updateSetAccessor(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.parameters, node.body);
|
|
3040
|
+
} else if (ts13.isConstructorDeclaration(node)) {
|
|
3150
3041
|
const parameters = node.parameters.map((param) => this._stripAngularDecorators(param));
|
|
3151
|
-
node =
|
|
3042
|
+
node = ts13.updateConstructor(node, node.decorators, node.modifiers, parameters, node.body);
|
|
3152
3043
|
}
|
|
3153
3044
|
return node;
|
|
3154
3045
|
}
|
|
@@ -3160,7 +3051,7 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
3160
3051
|
visit(file, compilationVisitor, context);
|
|
3161
3052
|
const transformationVisitor = new IvyTransformationVisitor(compilation, compilationVisitor.classCompilationMap, reflector, importManager, recordWrappedNode, isClosureCompilerEnabled, isCore);
|
|
3162
3053
|
let sf = visit(file, transformationVisitor, context);
|
|
3163
|
-
const downlevelTranslatedCode = getLocalizeCompileTarget(context) <
|
|
3054
|
+
const downlevelTranslatedCode = getLocalizeCompileTarget(context) < ts13.ScriptTarget.ES2015;
|
|
3164
3055
|
const constants = constantPool.statements.map((stmt) => translateStatement(stmt, importManager, {
|
|
3165
3056
|
recordWrappedNode,
|
|
3166
3057
|
downlevelTaggedTemplates: downlevelTranslatedCode,
|
|
@@ -3175,17 +3066,17 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
3175
3066
|
return sf;
|
|
3176
3067
|
}
|
|
3177
3068
|
function getLocalizeCompileTarget(context) {
|
|
3178
|
-
const target = context.getCompilerOptions().target ||
|
|
3179
|
-
return target !==
|
|
3069
|
+
const target = context.getCompilerOptions().target || ts13.ScriptTarget.ES2015;
|
|
3070
|
+
return target !== ts13.ScriptTarget.JSON ? target : ts13.ScriptTarget.ES2015;
|
|
3180
3071
|
}
|
|
3181
3072
|
function getFileOverviewComment(statements) {
|
|
3182
3073
|
if (statements.length > 0) {
|
|
3183
3074
|
const host = statements[0];
|
|
3184
3075
|
let trailing = false;
|
|
3185
|
-
let comments =
|
|
3076
|
+
let comments = ts13.getSyntheticLeadingComments(host);
|
|
3186
3077
|
if (!comments || comments.length === 0) {
|
|
3187
3078
|
trailing = true;
|
|
3188
|
-
comments =
|
|
3079
|
+
comments = ts13.getSyntheticTrailingComments(host);
|
|
3189
3080
|
}
|
|
3190
3081
|
if (comments && comments.length > 0 && CLOSURE_FILE_OVERVIEW_REGEXP.test(comments[0].text)) {
|
|
3191
3082
|
return { comments, host, trailing };
|
|
@@ -3197,22 +3088,22 @@ function setFileOverviewComment(sf, fileoverview) {
|
|
|
3197
3088
|
const { comments, host, trailing } = fileoverview;
|
|
3198
3089
|
if (sf.statements.length > 0 && host !== sf.statements[0]) {
|
|
3199
3090
|
if (trailing) {
|
|
3200
|
-
|
|
3091
|
+
ts13.setSyntheticTrailingComments(host, void 0);
|
|
3201
3092
|
} else {
|
|
3202
|
-
|
|
3093
|
+
ts13.setSyntheticLeadingComments(host, void 0);
|
|
3203
3094
|
}
|
|
3204
|
-
|
|
3095
|
+
ts13.setSyntheticLeadingComments(sf.statements[0], comments);
|
|
3205
3096
|
}
|
|
3206
3097
|
}
|
|
3207
3098
|
function maybeFilterDecorator(decorators, toRemove) {
|
|
3208
3099
|
if (decorators === void 0) {
|
|
3209
3100
|
return void 0;
|
|
3210
3101
|
}
|
|
3211
|
-
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) =>
|
|
3102
|
+
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) => ts13.getOriginalNode(dec) === decToRemove) === void 0);
|
|
3212
3103
|
if (filtered.length === 0) {
|
|
3213
3104
|
return void 0;
|
|
3214
3105
|
}
|
|
3215
|
-
return
|
|
3106
|
+
return ts13.createNodeArray(filtered);
|
|
3216
3107
|
}
|
|
3217
3108
|
function isFromAngularCore(decorator) {
|
|
3218
3109
|
return decorator.import !== null && decorator.import.from === "@angular/core";
|
|
@@ -3226,8 +3117,8 @@ function createRecorderFn(defaultImportTracker) {
|
|
|
3226
3117
|
};
|
|
3227
3118
|
}
|
|
3228
3119
|
|
|
3229
|
-
// bazel-out/
|
|
3230
|
-
import
|
|
3120
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/diagnostics.mjs
|
|
3121
|
+
import ts14 from "typescript";
|
|
3231
3122
|
function createValueHasWrongTypeError(node, value, messageText) {
|
|
3232
3123
|
var _a;
|
|
3233
3124
|
let chainedMessage;
|
|
@@ -3245,11 +3136,11 @@ function createValueHasWrongTypeError(node, value, messageText) {
|
|
|
3245
3136
|
}
|
|
3246
3137
|
const chain = {
|
|
3247
3138
|
messageText,
|
|
3248
|
-
category:
|
|
3139
|
+
category: ts14.DiagnosticCategory.Error,
|
|
3249
3140
|
code: 0,
|
|
3250
3141
|
next: [{
|
|
3251
3142
|
messageText: chainedMessage,
|
|
3252
|
-
category:
|
|
3143
|
+
category: ts14.DiagnosticCategory.Message,
|
|
3253
3144
|
code: 0
|
|
3254
3145
|
}]
|
|
3255
3146
|
};
|
|
@@ -3323,11 +3214,11 @@ function getInheritedUndecoratedCtorDiagnostic(node, baseClass, reader) {
|
|
|
3323
3214
|
return makeDiagnostic(ErrorCode.DIRECTIVE_INHERITS_UNDECORATED_CTOR, node.name, `The ${dirOrComp.toLowerCase()} ${node.name.text} inherits its constructor from ${baseClassName}, but the latter does not have an Angular decorator of its own. Dependency injection will not be able to resolve the parameters of ${baseClassName}'s constructor. Either add a @Directive decorator to ${baseClassName}, or add an explicit constructor to ${node.name.text}.`);
|
|
3324
3215
|
}
|
|
3325
3216
|
|
|
3326
|
-
// bazel-out/
|
|
3217
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
|
|
3327
3218
|
import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, createMayBeForwardRefExpression, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr3, FactoryTarget, getSafePropertyAccessString, makeBindingParser, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr3 } from "@angular/compiler";
|
|
3328
|
-
import
|
|
3219
|
+
import ts16 from "typescript";
|
|
3329
3220
|
|
|
3330
|
-
// bazel-out/
|
|
3221
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/factory.mjs
|
|
3331
3222
|
import { compileDeclareFactoryFunction, compileFactoryFunction } from "@angular/compiler";
|
|
3332
3223
|
function compileNgFactoryDefField(metadata) {
|
|
3333
3224
|
const res = compileFactoryFunction(metadata);
|
|
@@ -3338,9 +3229,9 @@ function compileDeclareFactory(metadata) {
|
|
|
3338
3229
|
return { name: "\u0275fac", initializer: res.expression, statements: res.statements, type: res.type };
|
|
3339
3230
|
}
|
|
3340
3231
|
|
|
3341
|
-
// bazel-out/
|
|
3232
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/metadata.mjs
|
|
3342
3233
|
import { FunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
|
|
3343
|
-
import
|
|
3234
|
+
import ts15 from "typescript";
|
|
3344
3235
|
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
|
|
3345
3236
|
if (!reflection.isClass(clazz)) {
|
|
3346
3237
|
return null;
|
|
@@ -3354,7 +3245,7 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
3354
3245
|
if (ngClassDecorators.length === 0) {
|
|
3355
3246
|
return null;
|
|
3356
3247
|
}
|
|
3357
|
-
const metaDecorators = new WrappedNodeExpr2(
|
|
3248
|
+
const metaDecorators = new WrappedNodeExpr2(ts15.createArrayLiteral(ngClassDecorators));
|
|
3358
3249
|
let metaCtorParameters = null;
|
|
3359
3250
|
const classCtorParameters = reflection.getConstructorParameters(clazz);
|
|
3360
3251
|
if (classCtorParameters !== null) {
|
|
@@ -3374,7 +3265,7 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
3374
3265
|
return classMemberToMetadata((_a = member.nameNode) != null ? _a : member.name, member.decorators, isCore);
|
|
3375
3266
|
});
|
|
3376
3267
|
if (decoratedMembers.length > 0) {
|
|
3377
|
-
metaPropDecorators = new WrappedNodeExpr2(
|
|
3268
|
+
metaPropDecorators = new WrappedNodeExpr2(ts15.createObjectLiteral(decoratedMembers));
|
|
3378
3269
|
}
|
|
3379
3270
|
return {
|
|
3380
3271
|
type: new WrappedNodeExpr2(id),
|
|
@@ -3390,43 +3281,43 @@ function ctorParameterToMetadata(param, isCore) {
|
|
|
3390
3281
|
];
|
|
3391
3282
|
if (param.decorators !== null) {
|
|
3392
3283
|
const ngDecorators = param.decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
3393
|
-
const value = new WrappedNodeExpr2(
|
|
3284
|
+
const value = new WrappedNodeExpr2(ts15.createArrayLiteral(ngDecorators));
|
|
3394
3285
|
mapEntries.push({ key: "decorators", value, quoted: false });
|
|
3395
3286
|
}
|
|
3396
3287
|
return literalMap(mapEntries);
|
|
3397
3288
|
}
|
|
3398
3289
|
function classMemberToMetadata(name, decorators, isCore) {
|
|
3399
3290
|
const ngDecorators = decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
3400
|
-
const decoratorMeta =
|
|
3401
|
-
return
|
|
3291
|
+
const decoratorMeta = ts15.createArrayLiteral(ngDecorators);
|
|
3292
|
+
return ts15.createPropertyAssignment(name, decoratorMeta);
|
|
3402
3293
|
}
|
|
3403
3294
|
function decoratorToMetadata(decorator, wrapFunctionsInParens) {
|
|
3404
3295
|
if (decorator.identifier === null) {
|
|
3405
3296
|
throw new Error("Illegal state: synthesized decorator cannot be emitted in class metadata.");
|
|
3406
3297
|
}
|
|
3407
3298
|
const properties = [
|
|
3408
|
-
|
|
3299
|
+
ts15.createPropertyAssignment("type", ts15.getMutableClone(decorator.identifier))
|
|
3409
3300
|
];
|
|
3410
3301
|
if (decorator.args !== null && decorator.args.length > 0) {
|
|
3411
3302
|
const args = decorator.args.map((arg) => {
|
|
3412
|
-
const expr =
|
|
3303
|
+
const expr = ts15.getMutableClone(arg);
|
|
3413
3304
|
return wrapFunctionsInParens ? wrapFunctionExpressionsInParens(expr) : expr;
|
|
3414
3305
|
});
|
|
3415
|
-
properties.push(
|
|
3306
|
+
properties.push(ts15.createPropertyAssignment("args", ts15.createArrayLiteral(args)));
|
|
3416
3307
|
}
|
|
3417
|
-
return
|
|
3308
|
+
return ts15.createObjectLiteral(properties, true);
|
|
3418
3309
|
}
|
|
3419
3310
|
function isAngularDecorator2(decorator, isCore) {
|
|
3420
3311
|
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
3421
3312
|
}
|
|
3422
3313
|
function removeIdentifierReferences(node, name) {
|
|
3423
|
-
const result =
|
|
3424
|
-
return
|
|
3314
|
+
const result = ts15.transform(node, [(context) => (root) => ts15.visitNode(root, function walk(current) {
|
|
3315
|
+
return ts15.isIdentifier(current) && current.text === name ? ts15.createIdentifier(current.text) : ts15.visitEachChild(current, walk, context);
|
|
3425
3316
|
})]);
|
|
3426
3317
|
return result.transformed[0];
|
|
3427
3318
|
}
|
|
3428
3319
|
|
|
3429
|
-
// bazel-out/
|
|
3320
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
|
|
3430
3321
|
var EMPTY_OBJECT = {};
|
|
3431
3322
|
var FIELD_DECORATORS = [
|
|
3432
3323
|
"Input",
|
|
@@ -3438,7 +3329,7 @@ var FIELD_DECORATORS = [
|
|
|
3438
3329
|
"HostBinding",
|
|
3439
3330
|
"HostListener"
|
|
3440
3331
|
];
|
|
3441
|
-
var LIFECYCLE_HOOKS = new Set([
|
|
3332
|
+
var LIFECYCLE_HOOKS = /* @__PURE__ */ new Set([
|
|
3442
3333
|
"ngOnChanges",
|
|
3443
3334
|
"ngOnInit",
|
|
3444
3335
|
"ngOnDestroy",
|
|
@@ -3595,7 +3486,8 @@ var DirectiveDecoratorHandler = class {
|
|
|
3595
3486
|
baseClass: analysis.baseClass
|
|
3596
3487
|
}, analysis.typeCheckMeta), {
|
|
3597
3488
|
isPoisoned: analysis.isPoisoned,
|
|
3598
|
-
isStructural: analysis.isStructural
|
|
3489
|
+
isStructural: analysis.isStructural,
|
|
3490
|
+
animationTriggerNames: null
|
|
3599
3491
|
}));
|
|
3600
3492
|
this.injectableRegistry.registerInjectable(node);
|
|
3601
3493
|
}
|
|
@@ -3641,12 +3533,12 @@ var DirectiveDecoratorHandler = class {
|
|
|
3641
3533
|
function extractDirectiveMetadata(clazz, decorator, reflector, evaluator, isCore, flags, annotateForClosureCompiler, defaultSelector = null) {
|
|
3642
3534
|
let directive;
|
|
3643
3535
|
if (decorator === null || decorator.args === null || decorator.args.length === 0) {
|
|
3644
|
-
directive = new Map();
|
|
3536
|
+
directive = /* @__PURE__ */ new Map();
|
|
3645
3537
|
} else if (decorator.args.length !== 1) {
|
|
3646
3538
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @${decorator.name} decorator`);
|
|
3647
3539
|
} else {
|
|
3648
3540
|
const meta = unwrapExpression(decorator.args[0]);
|
|
3649
|
-
if (!
|
|
3541
|
+
if (!ts16.isObjectLiteralExpression(meta)) {
|
|
3650
3542
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `@${decorator.name} argument must be an object literal`);
|
|
3651
3543
|
}
|
|
3652
3544
|
directive = reflectObjectLiteral(meta);
|
|
@@ -3757,7 +3649,7 @@ function extractQueryMetadata(exprNode, name, args, propertyName, reflector, eva
|
|
|
3757
3649
|
let emitDistinctChangesOnly = emitDistinctChangesOnlyDefaultValue;
|
|
3758
3650
|
if (args.length === 2) {
|
|
3759
3651
|
const optionsExpr = unwrapExpression(args[1]);
|
|
3760
|
-
if (!
|
|
3652
|
+
if (!ts16.isObjectLiteralExpression(optionsExpr)) {
|
|
3761
3653
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, optionsExpr, `@${name} options must be an object literal`);
|
|
3762
3654
|
}
|
|
3763
3655
|
const options = reflectObjectLiteral(optionsExpr);
|
|
@@ -3802,16 +3694,16 @@ function extractQueryMetadata(exprNode, name, args, propertyName, reflector, eva
|
|
|
3802
3694
|
}
|
|
3803
3695
|
function extractQueriesFromDecorator(queryData, reflector, evaluator, isCore) {
|
|
3804
3696
|
const content = [], view = [];
|
|
3805
|
-
if (!
|
|
3697
|
+
if (!ts16.isObjectLiteralExpression(queryData)) {
|
|
3806
3698
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator queries metadata must be an object literal");
|
|
3807
3699
|
}
|
|
3808
3700
|
reflectObjectLiteral(queryData).forEach((queryExpr, propertyName) => {
|
|
3809
3701
|
queryExpr = unwrapExpression(queryExpr);
|
|
3810
|
-
if (!
|
|
3702
|
+
if (!ts16.isNewExpression(queryExpr)) {
|
|
3811
3703
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
3812
3704
|
}
|
|
3813
|
-
const queryType =
|
|
3814
|
-
if (!
|
|
3705
|
+
const queryType = ts16.isPropertyAccessExpression(queryExpr.expression) ? queryExpr.expression.name : queryExpr.expression;
|
|
3706
|
+
if (!ts16.isIdentifier(queryType)) {
|
|
3815
3707
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
3816
3708
|
}
|
|
3817
3709
|
const type = reflector.getImportOfIdentifier(queryType);
|
|
@@ -3981,16 +3873,16 @@ function extractHostBindings(members, evaluator, coreModule, metadata) {
|
|
|
3981
3873
|
});
|
|
3982
3874
|
return bindings;
|
|
3983
3875
|
}
|
|
3984
|
-
var QUERY_TYPES = new Set([
|
|
3876
|
+
var QUERY_TYPES = /* @__PURE__ */ new Set([
|
|
3985
3877
|
"ContentChild",
|
|
3986
3878
|
"ContentChildren",
|
|
3987
3879
|
"ViewChild",
|
|
3988
3880
|
"ViewChildren"
|
|
3989
3881
|
]);
|
|
3990
3882
|
|
|
3991
|
-
// bazel-out/
|
|
3883
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/ng_module.mjs
|
|
3992
3884
|
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, CUSTOM_ELEMENTS_SCHEMA, ExternalExpr as ExternalExpr4, FactoryTarget as FactoryTarget2, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2, NO_ERRORS_SCHEMA, R3Identifiers, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
|
|
3993
|
-
import
|
|
3885
|
+
import ts17 from "typescript";
|
|
3994
3886
|
var NgModuleSymbol = class extends SemanticSymbol {
|
|
3995
3887
|
constructor() {
|
|
3996
3888
|
super(...arguments);
|
|
@@ -4073,8 +3965,8 @@ var NgModuleDecoratorHandler = class {
|
|
|
4073
3965
|
if (decorator.args === null || decorator.args.length > 1) {
|
|
4074
3966
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @NgModule decorator`);
|
|
4075
3967
|
}
|
|
4076
|
-
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) :
|
|
4077
|
-
if (!
|
|
3968
|
+
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) : ts17.createObjectLiteral([]);
|
|
3969
|
+
if (!ts17.isObjectLiteralExpression(meta)) {
|
|
4078
3970
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@NgModule argument must be an object literal");
|
|
4079
3971
|
}
|
|
4080
3972
|
const ngModule = reflectObjectLiteral(meta);
|
|
@@ -4155,10 +4047,10 @@ var NgModuleDecoratorHandler = class {
|
|
|
4155
4047
|
if (typeNode !== null) {
|
|
4156
4048
|
typeContext = typeNode.getSourceFile();
|
|
4157
4049
|
}
|
|
4158
|
-
const bootstrap = bootstrapRefs.map((bootstrap2) => this._toR3Reference(bootstrap2, valueContext, typeContext));
|
|
4159
|
-
const declarations = declarationRefs.map((decl) => this._toR3Reference(decl, valueContext, typeContext));
|
|
4160
|
-
const imports = importRefs.map((imp) => this._toR3Reference(imp, valueContext, typeContext));
|
|
4161
|
-
const exports = exportRefs.map((exp) => this._toR3Reference(exp, valueContext, typeContext));
|
|
4050
|
+
const bootstrap = bootstrapRefs.map((bootstrap2) => this._toR3Reference(bootstrap2.getOriginForDiagnostics(meta, node.name), bootstrap2, valueContext, typeContext));
|
|
4051
|
+
const declarations = declarationRefs.map((decl) => this._toR3Reference(decl.getOriginForDiagnostics(meta, node.name), decl, valueContext, typeContext));
|
|
4052
|
+
const imports = importRefs.map((imp) => this._toR3Reference(imp.getOriginForDiagnostics(meta, node.name), imp, valueContext, typeContext));
|
|
4053
|
+
const exports = exportRefs.map((exp) => this._toR3Reference(exp.getOriginForDiagnostics(meta, node.name), exp, valueContext, typeContext));
|
|
4162
4054
|
const isForwardReference = (ref) => isExpressionForwardReference(ref.value, node.name, valueContext);
|
|
4163
4055
|
const containsForwardDecls = bootstrap.some(isForwardReference) || declarations.some(isForwardReference) || imports.some(isForwardReference) || exports.some(isForwardReference);
|
|
4164
4056
|
const type = wrapTypeReference(this.reflector, node);
|
|
@@ -4254,7 +4146,9 @@ var NgModuleDecoratorHandler = class {
|
|
|
4254
4146
|
const context = getSourceFile(node);
|
|
4255
4147
|
for (const exportRef of analysis.exports) {
|
|
4256
4148
|
if (isNgModule(exportRef.node, scope.compilation)) {
|
|
4257
|
-
|
|
4149
|
+
const type = this.refEmitter.emit(exportRef, context);
|
|
4150
|
+
assertSuccessfulReferenceEmit(type, node, "NgModule");
|
|
4151
|
+
data.injectorImports.push(type.expression);
|
|
4258
4152
|
}
|
|
4259
4153
|
}
|
|
4260
4154
|
for (const decl of analysis.declarations) {
|
|
@@ -4307,11 +4201,21 @@ var NgModuleDecoratorHandler = class {
|
|
|
4307
4201
|
for (const decl of declarations) {
|
|
4308
4202
|
const remoteScope = this.scopeRegistry.getRemoteScope(decl.node);
|
|
4309
4203
|
if (remoteScope !== null) {
|
|
4310
|
-
const directives = remoteScope.directives.map((directive) =>
|
|
4311
|
-
|
|
4204
|
+
const directives = remoteScope.directives.map((directive) => {
|
|
4205
|
+
const type = this.refEmitter.emit(directive, context);
|
|
4206
|
+
assertSuccessfulReferenceEmit(type, node, "directive");
|
|
4207
|
+
return type.expression;
|
|
4208
|
+
});
|
|
4209
|
+
const pipes = remoteScope.pipes.map((pipe) => {
|
|
4210
|
+
const type = this.refEmitter.emit(pipe, context);
|
|
4211
|
+
assertSuccessfulReferenceEmit(type, node, "pipe");
|
|
4212
|
+
return type.expression;
|
|
4213
|
+
});
|
|
4312
4214
|
const directiveArray = new LiteralArrayExpr2(directives);
|
|
4313
4215
|
const pipesArray = new LiteralArrayExpr2(pipes);
|
|
4314
|
-
const
|
|
4216
|
+
const componentType = this.refEmitter.emit(decl, context);
|
|
4217
|
+
assertSuccessfulReferenceEmit(componentType, node, "component");
|
|
4218
|
+
const declExpr = componentType.expression;
|
|
4315
4219
|
const setComponentScope = new ExternalExpr4(R3Identifiers.setComponentScope);
|
|
4316
4220
|
const callExpr = new InvokeFunctionExpr(setComponentScope, [declExpr, directiveArray, pipesArray]);
|
|
4317
4221
|
ngModuleStatements.push(callExpr.toStmt());
|
|
@@ -4336,16 +4240,16 @@ var NgModuleDecoratorHandler = class {
|
|
|
4336
4240
|
];
|
|
4337
4241
|
return res;
|
|
4338
4242
|
}
|
|
4339
|
-
_toR3Reference(valueRef, valueContext, typeContext) {
|
|
4243
|
+
_toR3Reference(origin, valueRef, valueContext, typeContext) {
|
|
4340
4244
|
if (valueRef.hasOwningModuleGuess) {
|
|
4341
|
-
return toR3Reference(valueRef, valueRef, valueContext, valueContext, this.refEmitter);
|
|
4245
|
+
return toR3Reference(origin, valueRef, valueRef, valueContext, valueContext, this.refEmitter);
|
|
4342
4246
|
} else {
|
|
4343
4247
|
let typeRef = valueRef;
|
|
4344
4248
|
let typeNode = this.reflector.getDtsDeclaration(typeRef.node);
|
|
4345
4249
|
if (typeNode !== null && isNamedClassDeclaration(typeNode)) {
|
|
4346
4250
|
typeRef = new Reference(typeNode);
|
|
4347
4251
|
}
|
|
4348
|
-
return toR3Reference(valueRef, typeRef, valueContext, typeContext, this.refEmitter);
|
|
4252
|
+
return toR3Reference(origin, valueRef, typeRef, valueContext, typeContext, this.refEmitter);
|
|
4349
4253
|
}
|
|
4350
4254
|
}
|
|
4351
4255
|
_extractModuleFromModuleWithProvidersFn(node) {
|
|
@@ -4353,10 +4257,10 @@ var NgModuleDecoratorHandler = class {
|
|
|
4353
4257
|
return type && (this._reflectModuleFromTypeParam(type, node) || this._reflectModuleFromLiteralType(type));
|
|
4354
4258
|
}
|
|
4355
4259
|
_reflectModuleFromTypeParam(type, node) {
|
|
4356
|
-
if (!
|
|
4260
|
+
if (!ts17.isTypeReferenceNode(type)) {
|
|
4357
4261
|
return null;
|
|
4358
4262
|
}
|
|
4359
|
-
const typeName = type && (
|
|
4263
|
+
const typeName = type && (ts17.isIdentifier(type.typeName) && type.typeName || ts17.isQualifiedName(type.typeName) && type.typeName.right) || null;
|
|
4360
4264
|
if (typeName === null) {
|
|
4361
4265
|
return null;
|
|
4362
4266
|
}
|
|
@@ -4368,7 +4272,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
4368
4272
|
return null;
|
|
4369
4273
|
}
|
|
4370
4274
|
if (type.typeArguments === void 0 || type.typeArguments.length !== 1) {
|
|
4371
|
-
const parent =
|
|
4275
|
+
const parent = ts17.isMethodDeclaration(node) && ts17.isClassDeclaration(node.parent) ? node.parent : null;
|
|
4372
4276
|
const symbolName = (parent && parent.name ? parent.name.getText() + "." : "") + (node.name ? node.name.getText() : "anonymous");
|
|
4373
4277
|
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.`);
|
|
4374
4278
|
}
|
|
@@ -4376,13 +4280,13 @@ var NgModuleDecoratorHandler = class {
|
|
|
4376
4280
|
return typeNodeToValueExpr(arg);
|
|
4377
4281
|
}
|
|
4378
4282
|
_reflectModuleFromLiteralType(type) {
|
|
4379
|
-
if (!
|
|
4283
|
+
if (!ts17.isIntersectionTypeNode(type)) {
|
|
4380
4284
|
return null;
|
|
4381
4285
|
}
|
|
4382
4286
|
for (const t of type.types) {
|
|
4383
|
-
if (
|
|
4287
|
+
if (ts17.isTypeLiteralNode(t)) {
|
|
4384
4288
|
for (const m of t.members) {
|
|
4385
|
-
const ngModuleType =
|
|
4289
|
+
const ngModuleType = ts17.isPropertySignature(m) && ts17.isIdentifier(m.name) && m.name.text === "ngModule" && m.type || null;
|
|
4386
4290
|
const ngModuleExpression = ngModuleType && typeNodeToValueExpr(ngModuleType);
|
|
4387
4291
|
if (ngModuleExpression) {
|
|
4388
4292
|
return ngModuleExpression;
|
|
@@ -4422,8 +4326,8 @@ function isNgModule(node, compilation) {
|
|
|
4422
4326
|
return !compilation.directives.some((directive) => directive.ref.node === node) && !compilation.pipes.some((pipe) => pipe.ref.node === node);
|
|
4423
4327
|
}
|
|
4424
4328
|
|
|
4425
|
-
// bazel-out/
|
|
4426
|
-
var EMPTY_MAP = new Map();
|
|
4329
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/component.mjs
|
|
4330
|
+
var EMPTY_MAP = /* @__PURE__ */ new Map();
|
|
4427
4331
|
var EMPTY_ARRAY = [];
|
|
4428
4332
|
var ComponentSymbol = class extends DirectiveSymbol {
|
|
4429
4333
|
constructor() {
|
|
@@ -4485,10 +4389,10 @@ var ComponentDecoratorHandler = class {
|
|
|
4485
4389
|
this.semanticDepGraphUpdater = semanticDepGraphUpdater;
|
|
4486
4390
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
4487
4391
|
this.perf = perf;
|
|
4488
|
-
this.literalCache = new Map();
|
|
4392
|
+
this.literalCache = /* @__PURE__ */ new Map();
|
|
4489
4393
|
this.elementSchemaRegistry = new DomElementSchemaRegistry();
|
|
4490
|
-
this.preanalyzeTemplateCache = new Map();
|
|
4491
|
-
this.preanalyzeStylesCache = new Map();
|
|
4394
|
+
this.preanalyzeTemplateCache = /* @__PURE__ */ new Map();
|
|
4395
|
+
this.preanalyzeStylesCache = /* @__PURE__ */ new Map();
|
|
4492
4396
|
this.precedence = HandlerPrecedence.PRIMARY;
|
|
4493
4397
|
this.name = ComponentDecoratorHandler.name;
|
|
4494
4398
|
}
|
|
@@ -4563,8 +4467,12 @@ var ComponentDecoratorHandler = class {
|
|
|
4563
4467
|
const encapsulation = (_a = this._resolveEnumValue(component, "encapsulation", "ViewEncapsulation")) != null ? _a : ViewEncapsulation.Emulated;
|
|
4564
4468
|
const changeDetection = this._resolveEnumValue(component, "changeDetection", "ChangeDetectionStrategy");
|
|
4565
4469
|
let animations = null;
|
|
4470
|
+
let animationTriggerNames = null;
|
|
4566
4471
|
if (component.has("animations")) {
|
|
4567
4472
|
animations = new WrappedNodeExpr5(component.get("animations"));
|
|
4473
|
+
const animationsValue = this.evaluator.evaluate(component.get("animations"));
|
|
4474
|
+
animationTriggerNames = { includesDynamicAnimations: false, staticTriggerNames: [] };
|
|
4475
|
+
collectAnimationNames(animationsValue, animationTriggerNames);
|
|
4568
4476
|
}
|
|
4569
4477
|
const relativeContextFilePath = this.rootDirs.reduce((previous, rootDir) => {
|
|
4570
4478
|
const candidate = relative(absoluteFrom(rootDir), absoluteFrom(containingFile));
|
|
@@ -4680,7 +4588,8 @@ var ComponentDecoratorHandler = class {
|
|
|
4680
4588
|
styles: styleResources,
|
|
4681
4589
|
template: templateResource
|
|
4682
4590
|
},
|
|
4683
|
-
isPoisoned
|
|
4591
|
+
isPoisoned,
|
|
4592
|
+
animationTriggerNames
|
|
4684
4593
|
},
|
|
4685
4594
|
diagnostics
|
|
4686
4595
|
};
|
|
@@ -4708,7 +4617,8 @@ var ComponentDecoratorHandler = class {
|
|
|
4708
4617
|
baseClass: analysis.baseClass
|
|
4709
4618
|
}, analysis.typeCheckMeta), {
|
|
4710
4619
|
isPoisoned: analysis.isPoisoned,
|
|
4711
|
-
isStructural: false
|
|
4620
|
+
isStructural: false,
|
|
4621
|
+
animationTriggerNames: analysis.animationTriggerNames
|
|
4712
4622
|
}));
|
|
4713
4623
|
this.resourceRegistry.registerResources(analysis.resources, node);
|
|
4714
4624
|
this.injectableRegistry.registerInjectable(node);
|
|
@@ -4743,7 +4653,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4743
4653
|
});
|
|
4744
4654
|
}
|
|
4745
4655
|
typeCheck(ctx, node, meta) {
|
|
4746
|
-
if (this.typeCheckScopeRegistry === null || !
|
|
4656
|
+
if (this.typeCheckScopeRegistry === null || !ts18.isClassDeclaration(node)) {
|
|
4747
4657
|
return;
|
|
4748
4658
|
}
|
|
4749
4659
|
if (meta.isPoisoned && !this.usePoisonedData) {
|
|
@@ -4781,7 +4691,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4781
4691
|
matcher.addSelectables(CssSelector.parse(dir.selector), dir);
|
|
4782
4692
|
}
|
|
4783
4693
|
}
|
|
4784
|
-
const pipes = new Map();
|
|
4694
|
+
const pipes = /* @__PURE__ */ new Map();
|
|
4785
4695
|
for (const pipe of scope.compilation.pipes) {
|
|
4786
4696
|
pipes.set(pipe.name, pipe.ref);
|
|
4787
4697
|
}
|
|
@@ -4789,6 +4699,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4789
4699
|
const bound = binder.bind({ template: metadata.template.nodes });
|
|
4790
4700
|
const usedDirectives = bound.getUsedDirectives().map((directive) => {
|
|
4791
4701
|
const type = this.refEmitter.emit(directive.ref, context);
|
|
4702
|
+
assertSuccessfulReferenceEmit(type, node.name, directive.isComponent ? "component" : "directive");
|
|
4792
4703
|
return {
|
|
4793
4704
|
ref: directive.ref,
|
|
4794
4705
|
type: type.expression,
|
|
@@ -4807,6 +4718,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4807
4718
|
}
|
|
4808
4719
|
const pipe = pipes.get(pipeName);
|
|
4809
4720
|
const type = this.refEmitter.emit(pipe, context);
|
|
4721
|
+
assertSuccessfulReferenceEmit(type, node.name, "pipe");
|
|
4810
4722
|
usedPipes.push({
|
|
4811
4723
|
ref: pipe,
|
|
4812
4724
|
pipeName,
|
|
@@ -4818,14 +4730,14 @@ var ComponentDecoratorHandler = class {
|
|
|
4818
4730
|
symbol.usedDirectives = usedDirectives.map((dir) => this.semanticDepGraphUpdater.getSemanticReference(dir.ref.node, dir.type));
|
|
4819
4731
|
symbol.usedPipes = usedPipes.map((pipe) => this.semanticDepGraphUpdater.getSemanticReference(pipe.ref.node, pipe.expression));
|
|
4820
4732
|
}
|
|
4821
|
-
const cyclesFromDirectives = new Map();
|
|
4733
|
+
const cyclesFromDirectives = /* @__PURE__ */ new Map();
|
|
4822
4734
|
for (const usedDirective of usedDirectives) {
|
|
4823
4735
|
const cycle = this._checkForCyclicImport(usedDirective.importedFile, usedDirective.type, context);
|
|
4824
4736
|
if (cycle !== null) {
|
|
4825
4737
|
cyclesFromDirectives.set(usedDirective, cycle);
|
|
4826
4738
|
}
|
|
4827
4739
|
}
|
|
4828
|
-
const cyclesFromPipes = new Map();
|
|
4740
|
+
const cyclesFromPipes = /* @__PURE__ */ new Map();
|
|
4829
4741
|
for (const usedPipe of usedPipes) {
|
|
4830
4742
|
const cycle = this._checkForCyclicImport(usedPipe.importedFile, usedPipe.expression, context);
|
|
4831
4743
|
if (cycle !== null) {
|
|
@@ -4952,17 +4864,17 @@ var ComponentDecoratorHandler = class {
|
|
|
4952
4864
|
const metadata = new Map(component);
|
|
4953
4865
|
if (metadata.has("templateUrl")) {
|
|
4954
4866
|
metadata.delete("templateUrl");
|
|
4955
|
-
metadata.set("template",
|
|
4867
|
+
metadata.set("template", ts18.createStringLiteral(template.content));
|
|
4956
4868
|
}
|
|
4957
4869
|
if (metadata.has("styleUrls")) {
|
|
4958
4870
|
metadata.delete("styleUrls");
|
|
4959
|
-
metadata.set("styles",
|
|
4871
|
+
metadata.set("styles", ts18.createArrayLiteral(styles.map((s) => ts18.createStringLiteral(s))));
|
|
4960
4872
|
}
|
|
4961
4873
|
const newMetadataFields = [];
|
|
4962
4874
|
for (const [name, value] of metadata.entries()) {
|
|
4963
|
-
newMetadataFields.push(
|
|
4875
|
+
newMetadataFields.push(ts18.createPropertyAssignment(name, value));
|
|
4964
4876
|
}
|
|
4965
|
-
return __spreadProps(__spreadValues({}, dec), { args: [
|
|
4877
|
+
return __spreadProps(__spreadValues({}, dec), { args: [ts18.createObjectLiteral(newMetadataFields)] });
|
|
4966
4878
|
}
|
|
4967
4879
|
_resolveLiteral(decorator) {
|
|
4968
4880
|
if (this.literalCache.has(decorator)) {
|
|
@@ -4972,7 +4884,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4972
4884
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @Component decorator`);
|
|
4973
4885
|
}
|
|
4974
4886
|
const meta = unwrapExpression(decorator.args[0]);
|
|
4975
|
-
if (!
|
|
4887
|
+
if (!ts18.isObjectLiteralExpression(meta)) {
|
|
4976
4888
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `Decorator argument must be literal.`);
|
|
4977
4889
|
}
|
|
4978
4890
|
this.literalCache.set(decorator, meta);
|
|
@@ -4999,9 +4911,9 @@ var ComponentDecoratorHandler = class {
|
|
|
4999
4911
|
}
|
|
5000
4912
|
_extractStyleUrlsFromExpression(styleUrlsExpr) {
|
|
5001
4913
|
const styleUrls = [];
|
|
5002
|
-
if (
|
|
4914
|
+
if (ts18.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
5003
4915
|
for (const styleUrlExpr of styleUrlsExpr.elements) {
|
|
5004
|
-
if (
|
|
4916
|
+
if (ts18.isSpreadElement(styleUrlExpr)) {
|
|
5005
4917
|
styleUrls.push(...this._extractStyleUrlsFromExpression(styleUrlExpr.expression));
|
|
5006
4918
|
} else {
|
|
5007
4919
|
const styleUrl = this.evaluator.evaluate(styleUrlExpr);
|
|
@@ -5031,12 +4943,12 @@ var ComponentDecoratorHandler = class {
|
|
|
5031
4943
|
return styleUrls;
|
|
5032
4944
|
}
|
|
5033
4945
|
_extractStyleResources(component, containingFile) {
|
|
5034
|
-
const styles = new Set();
|
|
4946
|
+
const styles = /* @__PURE__ */ new Set();
|
|
5035
4947
|
function stringLiteralElements(array) {
|
|
5036
|
-
return array.elements.filter((e) =>
|
|
4948
|
+
return array.elements.filter((e) => ts18.isStringLiteralLike(e));
|
|
5037
4949
|
}
|
|
5038
4950
|
const styleUrlsExpr = component.get("styleUrls");
|
|
5039
|
-
if (styleUrlsExpr !== void 0 &&
|
|
4951
|
+
if (styleUrlsExpr !== void 0 && ts18.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
5040
4952
|
for (const expression of stringLiteralElements(styleUrlsExpr)) {
|
|
5041
4953
|
try {
|
|
5042
4954
|
const resourceUrl = this.resourceLoader.resolve(expression.text, containingFile);
|
|
@@ -5046,7 +4958,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5046
4958
|
}
|
|
5047
4959
|
}
|
|
5048
4960
|
const stylesExpr = component.get("styles");
|
|
5049
|
-
if (stylesExpr !== void 0 &&
|
|
4961
|
+
if (stylesExpr !== void 0 && ts18.isArrayLiteralExpression(stylesExpr)) {
|
|
5050
4962
|
for (const expression of stringLiteralElements(stylesExpr)) {
|
|
5051
4963
|
styles.add({ path: null, expression });
|
|
5052
4964
|
}
|
|
@@ -5091,7 +5003,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5091
5003
|
let sourceMapping;
|
|
5092
5004
|
let escapedString = false;
|
|
5093
5005
|
let sourceMapUrl;
|
|
5094
|
-
if (
|
|
5006
|
+
if (ts18.isStringLiteral(template.expression) || ts18.isNoSubstitutionTemplateLiteral(template.expression)) {
|
|
5095
5007
|
sourceParseRange = getTemplateRange(template.expression);
|
|
5096
5008
|
sourceStr = template.expression.getSourceFile().text;
|
|
5097
5009
|
templateContent = template.expression.text;
|
|
@@ -5265,7 +5177,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5265
5177
|
};
|
|
5266
5178
|
function getTemplateRange(templateExpr) {
|
|
5267
5179
|
const startPos = templateExpr.getStart() + 1;
|
|
5268
|
-
const { line, character } =
|
|
5180
|
+
const { line, character } = ts18.getLineAndCharacterOfPosition(templateExpr.getSourceFile(), startPos);
|
|
5269
5181
|
return {
|
|
5270
5182
|
startPos,
|
|
5271
5183
|
startLine: line,
|
|
@@ -5305,10 +5217,26 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
5305
5217
|
}
|
|
5306
5218
|
return null;
|
|
5307
5219
|
}
|
|
5220
|
+
function collectAnimationNames(value, animationTriggerNames) {
|
|
5221
|
+
if (value instanceof Map) {
|
|
5222
|
+
const name = value.get("name");
|
|
5223
|
+
if (typeof name === "string") {
|
|
5224
|
+
animationTriggerNames.staticTriggerNames.push(name);
|
|
5225
|
+
} else {
|
|
5226
|
+
animationTriggerNames.includesDynamicAnimations = true;
|
|
5227
|
+
}
|
|
5228
|
+
} else if (Array.isArray(value)) {
|
|
5229
|
+
for (const resolvedValue of value) {
|
|
5230
|
+
collectAnimationNames(resolvedValue, animationTriggerNames);
|
|
5231
|
+
}
|
|
5232
|
+
} else {
|
|
5233
|
+
animationTriggerNames.includesDynamicAnimations = true;
|
|
5234
|
+
}
|
|
5235
|
+
}
|
|
5308
5236
|
|
|
5309
|
-
// bazel-out/
|
|
5237
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
5310
5238
|
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression2, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr6 } from "@angular/compiler";
|
|
5311
|
-
import
|
|
5239
|
+
import ts19 from "typescript";
|
|
5312
5240
|
var InjectableDecoratorHandler = class {
|
|
5313
5241
|
constructor(reflector, isCore, strictCtorDeps, injectableRegistry, perf, errorOnDuplicateProv = true) {
|
|
5314
5242
|
this.reflector = reflector;
|
|
@@ -5399,7 +5327,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
5399
5327
|
};
|
|
5400
5328
|
} else if (decorator.args.length === 1) {
|
|
5401
5329
|
const metaNode = decorator.args[0];
|
|
5402
|
-
if (!
|
|
5330
|
+
if (!ts19.isObjectLiteralExpression(metaNode)) {
|
|
5403
5331
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, metaNode, `@Injectable argument must be an object literal`);
|
|
5404
5332
|
}
|
|
5405
5333
|
const meta = reflectObjectLiteral(metaNode);
|
|
@@ -5407,7 +5335,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
5407
5335
|
let deps = void 0;
|
|
5408
5336
|
if ((meta.has("useClass") || meta.has("useFactory")) && meta.has("deps")) {
|
|
5409
5337
|
const depsExpr = meta.get("deps");
|
|
5410
|
-
if (!
|
|
5338
|
+
if (!ts19.isArrayLiteralExpression(depsExpr)) {
|
|
5411
5339
|
throw new FatalDiagnosticError(ErrorCode.VALUE_NOT_LITERAL, depsExpr, `@Injectable deps metadata must be an inline array`);
|
|
5412
5340
|
}
|
|
5413
5341
|
deps = depsExpr.elements.map((dep) => getDep(dep, reflector));
|
|
@@ -5489,12 +5417,12 @@ function getDep(dep, reflector) {
|
|
|
5489
5417
|
}
|
|
5490
5418
|
return true;
|
|
5491
5419
|
}
|
|
5492
|
-
if (
|
|
5420
|
+
if (ts19.isArrayLiteralExpression(dep)) {
|
|
5493
5421
|
dep.elements.forEach((el) => {
|
|
5494
5422
|
let isDecorator = false;
|
|
5495
|
-
if (
|
|
5423
|
+
if (ts19.isIdentifier(el)) {
|
|
5496
5424
|
isDecorator = maybeUpdateDecorator(el, reflector);
|
|
5497
|
-
} else if (
|
|
5425
|
+
} else if (ts19.isNewExpression(el) && ts19.isIdentifier(el.expression)) {
|
|
5498
5426
|
const token = el.arguments && el.arguments.length > 0 && el.arguments[0] || void 0;
|
|
5499
5427
|
isDecorator = maybeUpdateDecorator(el.expression, reflector, token);
|
|
5500
5428
|
}
|
|
@@ -5506,9 +5434,9 @@ function getDep(dep, reflector) {
|
|
|
5506
5434
|
return meta;
|
|
5507
5435
|
}
|
|
5508
5436
|
|
|
5509
|
-
// bazel-out/
|
|
5437
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
|
|
5510
5438
|
import { compileClassMetadata as compileClassMetadata5, compileDeclareClassMetadata as compileDeclareClassMetadata5, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
5511
|
-
import
|
|
5439
|
+
import ts20 from "typescript";
|
|
5512
5440
|
var PipeSymbol = class extends SemanticSymbol {
|
|
5513
5441
|
constructor(decl, name) {
|
|
5514
5442
|
super(decl);
|
|
@@ -5563,7 +5491,7 @@ var PipeDecoratorHandler = class {
|
|
|
5563
5491
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), "@Pipe must have exactly one argument");
|
|
5564
5492
|
}
|
|
5565
5493
|
const meta = unwrapExpression(decorator.args[0]);
|
|
5566
|
-
if (!
|
|
5494
|
+
if (!ts20.isObjectLiteralExpression(meta)) {
|
|
5567
5495
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@Pipe must have a literal argument");
|
|
5568
5496
|
}
|
|
5569
5497
|
const pipe = reflectObjectLiteral(meta);
|
|
@@ -5631,21 +5559,13 @@ var PipeDecoratorHandler = class {
|
|
|
5631
5559
|
}
|
|
5632
5560
|
};
|
|
5633
5561
|
|
|
5634
|
-
// bazel-out/
|
|
5562
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/references_registry.mjs
|
|
5635
5563
|
var NoopReferencesRegistry = class {
|
|
5636
5564
|
add(source, ...references) {
|
|
5637
5565
|
}
|
|
5638
5566
|
};
|
|
5639
5567
|
|
|
5640
5568
|
export {
|
|
5641
|
-
ErrorCode,
|
|
5642
|
-
COMPILER_ERRORS_WITH_GUIDES,
|
|
5643
|
-
replaceTsWithNgInErrors,
|
|
5644
|
-
ngErrorCode,
|
|
5645
|
-
makeDiagnostic,
|
|
5646
|
-
makeRelatedInformation,
|
|
5647
|
-
isFatalDiagnosticError,
|
|
5648
|
-
ERROR_DETAILS_PAGE_BASE_URL,
|
|
5649
5569
|
SemanticDepGraphUpdater,
|
|
5650
5570
|
CompoundMetadataReader,
|
|
5651
5571
|
DtsMetadataReader,
|
|
@@ -5681,4 +5601,4 @@ export {
|
|
|
5681
5601
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5682
5602
|
* found in the LICENSE file at https://angular.io/license
|
|
5683
5603
|
*/
|
|
5684
|
-
//# sourceMappingURL=chunk-
|
|
5604
|
+
//# sourceMappingURL=chunk-L2JNRKLG.js.map
|