@angular/compiler-cli 13.2.0-next.0 → 13.2.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/{chunk-GX2C4BSM.js → chunk-3XJZ4ZZZ.js} +801 -1044
- package/bundles/chunk-3XJZ4ZZZ.js.map +6 -0
- package/bundles/{chunk-UAY4RXGC.js → chunk-4QCYPOMC.js} +61 -63
- package/bundles/chunk-4QCYPOMC.js.map +6 -0
- package/bundles/{chunk-TI3THPMZ.js → chunk-676MI6WZ.js} +39 -60
- package/bundles/chunk-676MI6WZ.js.map +6 -0
- package/bundles/{chunk-5QEO6HSG.js → chunk-7PY7XEFH.js} +9 -9
- package/bundles/chunk-7PY7XEFH.js.map +6 -0
- package/bundles/{chunk-GZLU7SCP.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-P2Q3CTKO.js → chunk-DH7A3OBN.js} +16 -20
- package/bundles/chunk-DH7A3OBN.js.map +6 -0
- 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-FUXNWM54.js → chunk-LMCFGUUV.js} +772 -438
- package/bundles/chunk-LMCFGUUV.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-BXWQHEIB.js → chunk-OOEI5KQH.js} +221 -176
- package/bundles/chunk-OOEI5KQH.js.map +6 -0
- package/bundles/{chunk-C2DR5MYL.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-JTYUTYS2.js → chunk-SKBLJA43.js} +3 -3
- package/bundles/{chunk-JTYUTYS2.js.map → chunk-SKBLJA43.js.map} +0 -0
- package/bundles/{chunk-5NGMSHHH.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/index.js +16 -15
- 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/adjust_cjs_umd_exports.d.ts +17 -0
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/ngcc/src/packages/source_file_cache.d.ts +2 -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/core/src/host.d.ts +1 -1
- 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/program_driver/src/ts_create_program_driver.d.ts +1 -1
- 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/src/ngtsc/util/src/typescript.d.ts +0 -5
- package/bundles/chunk-5NGMSHHH.js.map +0 -6
- package/bundles/chunk-5QEO6HSG.js.map +0 -6
- package/bundles/chunk-BXWQHEIB.js.map +0 -6
- package/bundles/chunk-C2DR5MYL.js.map +0 -6
- package/bundles/chunk-FUXNWM54.js.map +0 -6
- package/bundles/chunk-GX2C4BSM.js.map +0 -6
- package/bundles/chunk-GZLU7SCP.js.map +0 -6
- package/bundles/chunk-P2Q3CTKO.js.map +0 -6
- package/bundles/chunk-TI3THPMZ.js.map +0 -6
- package/bundles/chunk-UAY4RXGC.js.map +0 -6
|
@@ -13,37 +13,45 @@ 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
|
+
isDtsPath,
|
|
31
|
+
isNonDeclarationTsPath,
|
|
32
|
+
makeDiagnostic,
|
|
33
|
+
makeRelatedInformation,
|
|
27
34
|
nodeDebugInfo,
|
|
28
35
|
translateExpression,
|
|
29
36
|
translateStatement,
|
|
30
37
|
translateType
|
|
31
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-QBU7RUKB.js";
|
|
32
39
|
import {
|
|
33
40
|
absoluteFrom,
|
|
34
41
|
absoluteFromSourceFile,
|
|
42
|
+
basename,
|
|
35
43
|
relative
|
|
36
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-676MI6WZ.js";
|
|
37
45
|
import {
|
|
38
46
|
PerfEvent,
|
|
39
47
|
PerfPhase
|
|
40
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-GLCRIILX.js";
|
|
41
49
|
import {
|
|
42
50
|
__spreadProps,
|
|
43
51
|
__spreadValues
|
|
44
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-WQ3TNYTD.js";
|
|
45
53
|
|
|
46
|
-
// bazel-out/
|
|
54
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/dynamic.mjs
|
|
47
55
|
var DynamicValue = class {
|
|
48
56
|
constructor(node, reason, code) {
|
|
49
57
|
this.node = node;
|
|
@@ -128,10 +136,10 @@ var DynamicValue = class {
|
|
|
128
136
|
}
|
|
129
137
|
};
|
|
130
138
|
|
|
131
|
-
// bazel-out/
|
|
139
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
132
140
|
import ts from "typescript";
|
|
133
141
|
|
|
134
|
-
// bazel-out/
|
|
142
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/result.mjs
|
|
135
143
|
var ResolvedModule = class {
|
|
136
144
|
constructor(exports, evaluate) {
|
|
137
145
|
this.exports = exports;
|
|
@@ -144,7 +152,7 @@ var ResolvedModule = class {
|
|
|
144
152
|
return this.evaluate(this.exports.get(name));
|
|
145
153
|
}
|
|
146
154
|
getExports() {
|
|
147
|
-
const map = new Map();
|
|
155
|
+
const map = /* @__PURE__ */ new Map();
|
|
148
156
|
this.exports.forEach((decl, name) => {
|
|
149
157
|
map.set(name, this.evaluate(decl));
|
|
150
158
|
});
|
|
@@ -161,7 +169,7 @@ var EnumValue = class {
|
|
|
161
169
|
var KnownFn = class {
|
|
162
170
|
};
|
|
163
171
|
|
|
164
|
-
// bazel-out/
|
|
172
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/builtin.mjs
|
|
165
173
|
var ArraySliceBuiltinFn = class extends KnownFn {
|
|
166
174
|
constructor(lhs) {
|
|
167
175
|
super();
|
|
@@ -232,7 +240,7 @@ var ObjectAssignBuiltinFn = class extends KnownFn {
|
|
|
232
240
|
}
|
|
233
241
|
};
|
|
234
242
|
|
|
235
|
-
// bazel-out/
|
|
243
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/ts_helpers.mjs
|
|
236
244
|
var AssignHelperFn = class extends ObjectAssignBuiltinFn {
|
|
237
245
|
};
|
|
238
246
|
var SpreadHelperFn = class extends KnownFn {
|
|
@@ -285,8 +293,8 @@ var ReadHelperFn = class extends KnownFn {
|
|
|
285
293
|
}
|
|
286
294
|
};
|
|
287
295
|
|
|
288
|
-
// bazel-out/
|
|
289
|
-
var jsGlobalObjectValue = new Map([["assign", new ObjectAssignBuiltinFn()]]);
|
|
296
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/known_declaration.mjs
|
|
297
|
+
var jsGlobalObjectValue = /* @__PURE__ */ new Map([["assign", new ObjectAssignBuiltinFn()]]);
|
|
290
298
|
var assignTsHelperFn = new AssignHelperFn();
|
|
291
299
|
var spreadTsHelperFn = new SpreadHelperFn();
|
|
292
300
|
var spreadArrayTsHelperFn = new SpreadArrayHelperFn();
|
|
@@ -309,14 +317,14 @@ function resolveKnownDeclaration(decl) {
|
|
|
309
317
|
}
|
|
310
318
|
}
|
|
311
319
|
|
|
312
|
-
// bazel-out/
|
|
320
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
313
321
|
function literalBinaryOp(op) {
|
|
314
322
|
return { op, literal: true };
|
|
315
323
|
}
|
|
316
324
|
function referenceBinaryOp(op) {
|
|
317
325
|
return { op, literal: false };
|
|
318
326
|
}
|
|
319
|
-
var BINARY_OPERATORS = new Map([
|
|
327
|
+
var BINARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
320
328
|
[ts.SyntaxKind.PlusToken, literalBinaryOp((a, b) => a + b)],
|
|
321
329
|
[ts.SyntaxKind.MinusToken, literalBinaryOp((a, b) => a - b)],
|
|
322
330
|
[ts.SyntaxKind.AsteriskToken, literalBinaryOp((a, b) => a * b)],
|
|
@@ -340,7 +348,7 @@ var BINARY_OPERATORS = new Map([
|
|
|
340
348
|
[ts.SyntaxKind.AmpersandAmpersandToken, referenceBinaryOp((a, b) => a && b)],
|
|
341
349
|
[ts.SyntaxKind.BarBarToken, referenceBinaryOp((a, b) => a || b)]
|
|
342
350
|
]);
|
|
343
|
-
var UNARY_OPERATORS = new Map([
|
|
351
|
+
var UNARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
344
352
|
[ts.SyntaxKind.TildeToken, (a) => ~a],
|
|
345
353
|
[ts.SyntaxKind.MinusToken, (a) => -a],
|
|
346
354
|
[ts.SyntaxKind.PlusToken, (a) => +a],
|
|
@@ -418,7 +426,7 @@ var StaticInterpreter = class {
|
|
|
418
426
|
return array;
|
|
419
427
|
}
|
|
420
428
|
visitObjectLiteralExpression(node, context) {
|
|
421
|
-
const map = new Map();
|
|
429
|
+
const map = /* @__PURE__ */ new Map();
|
|
422
430
|
for (let i = 0; i < node.properties.length; i++) {
|
|
423
431
|
const property = node.properties[i];
|
|
424
432
|
if (ts.isPropertyAssignment(property)) {
|
|
@@ -531,7 +539,7 @@ var StaticInterpreter = class {
|
|
|
531
539
|
}
|
|
532
540
|
visitEnumDeclaration(node, context) {
|
|
533
541
|
const enumRef = this.getReference(node, context);
|
|
534
|
-
const map = new Map();
|
|
542
|
+
const map = /* @__PURE__ */ new Map();
|
|
535
543
|
node.members.forEach((member) => {
|
|
536
544
|
const name = this.stringNameFromPropertyName(member.name, context);
|
|
537
545
|
if (name !== void 0) {
|
|
@@ -688,7 +696,7 @@ var StaticInterpreter = class {
|
|
|
688
696
|
}
|
|
689
697
|
const ret = fn.body[0];
|
|
690
698
|
const args = this.evaluateFunctionArguments(node, context);
|
|
691
|
-
const newScope = new Map();
|
|
699
|
+
const newScope = /* @__PURE__ */ new Map();
|
|
692
700
|
const calleeContext = __spreadProps(__spreadValues({}, context), { scope: newScope });
|
|
693
701
|
fn.parameters.forEach((param, index) => {
|
|
694
702
|
let arg = args[index];
|
|
@@ -816,7 +824,7 @@ var StaticInterpreter = class {
|
|
|
816
824
|
}
|
|
817
825
|
getResolvedEnum(node, enumMembers, context) {
|
|
818
826
|
const enumRef = this.getReference(node, context);
|
|
819
|
-
const map = new Map();
|
|
827
|
+
const map = /* @__PURE__ */ new Map();
|
|
820
828
|
enumMembers.forEach((member) => {
|
|
821
829
|
const name = this.stringNameFromPropertyName(member.name, context);
|
|
822
830
|
if (name !== void 0) {
|
|
@@ -896,7 +904,7 @@ function owningModule(context, override = null) {
|
|
|
896
904
|
}
|
|
897
905
|
}
|
|
898
906
|
|
|
899
|
-
// bazel-out/
|
|
907
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interface.mjs
|
|
900
908
|
var PartialEvaluator = class {
|
|
901
909
|
constructor(host, checker, dependencyTracker) {
|
|
902
910
|
this.host = host;
|
|
@@ -910,133 +918,14 @@ var PartialEvaluator = class {
|
|
|
910
918
|
originatingFile: sourceFile,
|
|
911
919
|
absoluteModuleName: null,
|
|
912
920
|
resolutionContext: sourceFile.fileName,
|
|
913
|
-
scope: new Map(),
|
|
921
|
+
scope: /* @__PURE__ */ new Map(),
|
|
914
922
|
foreignFunctionResolver
|
|
915
923
|
});
|
|
916
924
|
}
|
|
917
925
|
};
|
|
918
926
|
|
|
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
|
|
927
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
|
|
985
928
|
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
929
|
function describeResolvedType(value, maxDepth = 1) {
|
|
1041
930
|
var _a, _b;
|
|
1042
931
|
if (value === null) {
|
|
@@ -1140,21 +1029,21 @@ function getContainerNode(node) {
|
|
|
1140
1029
|
let currentNode = node;
|
|
1141
1030
|
while (currentNode !== void 0) {
|
|
1142
1031
|
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
|
|
1032
|
+
case ts2.SyntaxKind.ExpressionStatement:
|
|
1033
|
+
case ts2.SyntaxKind.VariableStatement:
|
|
1034
|
+
case ts2.SyntaxKind.ReturnStatement:
|
|
1035
|
+
case ts2.SyntaxKind.IfStatement:
|
|
1036
|
+
case ts2.SyntaxKind.SwitchStatement:
|
|
1037
|
+
case ts2.SyntaxKind.DoStatement:
|
|
1038
|
+
case ts2.SyntaxKind.WhileStatement:
|
|
1039
|
+
case ts2.SyntaxKind.ForStatement:
|
|
1040
|
+
case ts2.SyntaxKind.ForInStatement:
|
|
1041
|
+
case ts2.SyntaxKind.ForOfStatement:
|
|
1042
|
+
case ts2.SyntaxKind.ContinueStatement:
|
|
1043
|
+
case ts2.SyntaxKind.BreakStatement:
|
|
1044
|
+
case ts2.SyntaxKind.ThrowStatement:
|
|
1045
|
+
case ts2.SyntaxKind.ObjectBindingPattern:
|
|
1046
|
+
case ts2.SyntaxKind.ArrayBindingPattern:
|
|
1158
1047
|
return currentNode;
|
|
1159
1048
|
}
|
|
1160
1049
|
currentNode = currentNode.parent;
|
|
@@ -1162,9 +1051,9 @@ function getContainerNode(node) {
|
|
|
1162
1051
|
return node.getSourceFile();
|
|
1163
1052
|
}
|
|
1164
1053
|
|
|
1165
|
-
// bazel-out/
|
|
1054
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/util.mjs
|
|
1166
1055
|
import { ExternalExpr, LiteralExpr, ParseLocation, ParseSourceFile, ParseSourceSpan, ReadPropExpr, WrappedNodeExpr } from "@angular/compiler";
|
|
1167
|
-
import
|
|
1056
|
+
import ts3 from "typescript";
|
|
1168
1057
|
function getConstructorDependencies(clazz, reflector, isCore) {
|
|
1169
1058
|
const deps = [];
|
|
1170
1059
|
const errors = [];
|
|
@@ -1201,10 +1090,10 @@ function getConstructorDependencies(clazz, reflector, isCore) {
|
|
|
1201
1090
|
}
|
|
1202
1091
|
const attributeName = dec.args[0];
|
|
1203
1092
|
token = new WrappedNodeExpr(attributeName);
|
|
1204
|
-
if (
|
|
1093
|
+
if (ts3.isStringLiteralLike(attributeName)) {
|
|
1205
1094
|
attributeNameType = new LiteralExpr(attributeName.text);
|
|
1206
1095
|
} else {
|
|
1207
|
-
attributeNameType = new WrappedNodeExpr(
|
|
1096
|
+
attributeNameType = new WrappedNodeExpr(ts3.createKeywordTypeNode(ts3.SyntaxKind.UnknownKeyword));
|
|
1208
1097
|
}
|
|
1209
1098
|
} else {
|
|
1210
1099
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_UNEXPECTED, Decorator.nodeForError(dec), `Unexpected decorator ${name} on parameter.`);
|
|
@@ -1314,20 +1203,24 @@ function createUnsuitableInjectionTokenError(clazz, error) {
|
|
|
1314
1203
|
}
|
|
1315
1204
|
const chain = {
|
|
1316
1205
|
messageText: `No suitable injection token for parameter '${param.name || index}' of class '${clazz.name.text}'.`,
|
|
1317
|
-
category:
|
|
1206
|
+
category: ts3.DiagnosticCategory.Error,
|
|
1318
1207
|
code: 0,
|
|
1319
1208
|
next: [{
|
|
1320
1209
|
messageText: chainMessage,
|
|
1321
|
-
category:
|
|
1210
|
+
category: ts3.DiagnosticCategory.Message,
|
|
1322
1211
|
code: 0
|
|
1323
1212
|
}]
|
|
1324
1213
|
};
|
|
1325
1214
|
return new FatalDiagnosticError(ErrorCode.PARAM_MISSING_TOKEN, param.nameNode, chain, hints);
|
|
1326
1215
|
}
|
|
1327
|
-
function toR3Reference(valueRef, typeRef, valueContext, typeContext, refEmitter) {
|
|
1216
|
+
function toR3Reference(origin, valueRef, typeRef, valueContext, typeContext, refEmitter) {
|
|
1217
|
+
const emittedValueRef = refEmitter.emit(valueRef, valueContext);
|
|
1218
|
+
assertSuccessfulReferenceEmit(emittedValueRef, origin, "class");
|
|
1219
|
+
const emittedTypeRef = refEmitter.emit(typeRef, typeContext, ImportFlags.ForceNewImport | ImportFlags.AllowTypeImports);
|
|
1220
|
+
assertSuccessfulReferenceEmit(emittedTypeRef, origin, "class");
|
|
1328
1221
|
return {
|
|
1329
|
-
value:
|
|
1330
|
-
type:
|
|
1222
|
+
value: emittedValueRef.expression,
|
|
1223
|
+
type: emittedTypeRef.expression
|
|
1331
1224
|
};
|
|
1332
1225
|
}
|
|
1333
1226
|
function isAngularCore(decorator) {
|
|
@@ -1348,23 +1241,23 @@ function isAngularDecorator(decorator, name, isCore) {
|
|
|
1348
1241
|
return false;
|
|
1349
1242
|
}
|
|
1350
1243
|
function unwrapExpression(node) {
|
|
1351
|
-
while (
|
|
1244
|
+
while (ts3.isAsExpression(node) || ts3.isParenthesizedExpression(node)) {
|
|
1352
1245
|
node = node.expression;
|
|
1353
1246
|
}
|
|
1354
1247
|
return node;
|
|
1355
1248
|
}
|
|
1356
1249
|
function expandForwardRef(arg) {
|
|
1357
1250
|
arg = unwrapExpression(arg);
|
|
1358
|
-
if (!
|
|
1251
|
+
if (!ts3.isArrowFunction(arg) && !ts3.isFunctionExpression(arg)) {
|
|
1359
1252
|
return null;
|
|
1360
1253
|
}
|
|
1361
1254
|
const body = arg.body;
|
|
1362
|
-
if (
|
|
1255
|
+
if (ts3.isBlock(body)) {
|
|
1363
1256
|
if (body.statements.length !== 1) {
|
|
1364
1257
|
return null;
|
|
1365
1258
|
}
|
|
1366
1259
|
const stmt = body.statements[0];
|
|
1367
|
-
if (!
|
|
1260
|
+
if (!ts3.isReturnStatement(stmt) || stmt.expression === void 0) {
|
|
1368
1261
|
return null;
|
|
1369
1262
|
}
|
|
1370
1263
|
return stmt.expression;
|
|
@@ -1374,11 +1267,11 @@ function expandForwardRef(arg) {
|
|
|
1374
1267
|
}
|
|
1375
1268
|
function tryUnwrapForwardRef(node, reflector) {
|
|
1376
1269
|
node = unwrapExpression(node);
|
|
1377
|
-
if (!
|
|
1270
|
+
if (!ts3.isCallExpression(node) || node.arguments.length !== 1) {
|
|
1378
1271
|
return null;
|
|
1379
1272
|
}
|
|
1380
|
-
const fn =
|
|
1381
|
-
if (!
|
|
1273
|
+
const fn = ts3.isPropertyAccessExpression(node.expression) ? node.expression.name : node.expression;
|
|
1274
|
+
if (!ts3.isIdentifier(fn)) {
|
|
1382
1275
|
return null;
|
|
1383
1276
|
}
|
|
1384
1277
|
const expr = expandForwardRef(node.arguments[0]);
|
|
@@ -1410,7 +1303,7 @@ function combineResolvers(resolvers) {
|
|
|
1410
1303
|
}
|
|
1411
1304
|
function isExpressionForwardReference(expr, context, contextSource) {
|
|
1412
1305
|
if (isWrappedTsNodeExpr(expr)) {
|
|
1413
|
-
const node =
|
|
1306
|
+
const node = ts3.getOriginalNode(expr.node);
|
|
1414
1307
|
return node.getSourceFile() === contextSource && context.pos < node.pos;
|
|
1415
1308
|
} else {
|
|
1416
1309
|
return false;
|
|
@@ -1433,16 +1326,16 @@ function readBaseClass(node, reflector, evaluator) {
|
|
|
1433
1326
|
}
|
|
1434
1327
|
var parensWrapperTransformerFactory = (context) => {
|
|
1435
1328
|
const visitor = (node) => {
|
|
1436
|
-
const visited =
|
|
1437
|
-
if (
|
|
1438
|
-
return
|
|
1329
|
+
const visited = ts3.visitEachChild(node, visitor, context);
|
|
1330
|
+
if (ts3.isArrowFunction(visited) || ts3.isFunctionExpression(visited)) {
|
|
1331
|
+
return ts3.createParen(visited);
|
|
1439
1332
|
}
|
|
1440
1333
|
return visited;
|
|
1441
1334
|
};
|
|
1442
|
-
return (node) =>
|
|
1335
|
+
return (node) => ts3.visitEachChild(node, visitor, context);
|
|
1443
1336
|
};
|
|
1444
1337
|
function wrapFunctionExpressionsInParens(expression) {
|
|
1445
|
-
return
|
|
1338
|
+
return ts3.transform(expression, [parensWrapperTransformerFactory]).transformed[0];
|
|
1446
1339
|
}
|
|
1447
1340
|
function makeDuplicateDeclarationError(node, data, kind) {
|
|
1448
1341
|
const context = [];
|
|
@@ -1456,7 +1349,7 @@ function makeDuplicateDeclarationError(node, data, kind) {
|
|
|
1456
1349
|
return makeDiagnostic(ErrorCode.NGMODULE_DECLARATION_NOT_UNIQUE, node.name, `The ${kind} '${node.name.text}' is declared by more than one NgModule.`, context);
|
|
1457
1350
|
}
|
|
1458
1351
|
function resolveProvidersRequiringFactory(rawProviders, reflector, evaluator) {
|
|
1459
|
-
const providers = new Set();
|
|
1352
|
+
const providers = /* @__PURE__ */ new Set();
|
|
1460
1353
|
const resolvedProviders = evaluator.evaluate(rawProviders);
|
|
1461
1354
|
if (!Array.isArray(resolvedProviders)) {
|
|
1462
1355
|
return providers;
|
|
@@ -1522,12 +1415,12 @@ function toFactoryMetadata(meta, target) {
|
|
|
1522
1415
|
};
|
|
1523
1416
|
}
|
|
1524
1417
|
|
|
1525
|
-
// bazel-out/
|
|
1418
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/component.mjs
|
|
1526
1419
|
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
|
|
1420
|
+
import ts21 from "typescript";
|
|
1528
1421
|
|
|
1529
|
-
// bazel-out/
|
|
1530
|
-
import
|
|
1422
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
1423
|
+
import ts4 from "typescript";
|
|
1531
1424
|
var SemanticSymbol = class {
|
|
1532
1425
|
constructor(decl) {
|
|
1533
1426
|
this.decl = decl;
|
|
@@ -1536,13 +1429,13 @@ var SemanticSymbol = class {
|
|
|
1536
1429
|
}
|
|
1537
1430
|
};
|
|
1538
1431
|
function getSymbolIdentifier(decl) {
|
|
1539
|
-
if (!
|
|
1432
|
+
if (!ts4.isSourceFile(decl.parent)) {
|
|
1540
1433
|
return null;
|
|
1541
1434
|
}
|
|
1542
1435
|
return decl.name.text;
|
|
1543
1436
|
}
|
|
1544
1437
|
|
|
1545
|
-
// bazel-out/
|
|
1438
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/graph.mjs
|
|
1546
1439
|
import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
|
|
1547
1440
|
var OpaqueSymbol = class extends SemanticSymbol {
|
|
1548
1441
|
isPublicApiAffected() {
|
|
@@ -1554,14 +1447,14 @@ var OpaqueSymbol = class extends SemanticSymbol {
|
|
|
1554
1447
|
};
|
|
1555
1448
|
var SemanticDepGraph = class {
|
|
1556
1449
|
constructor() {
|
|
1557
|
-
this.files = new Map();
|
|
1558
|
-
this.symbolByDecl = new Map();
|
|
1450
|
+
this.files = /* @__PURE__ */ new Map();
|
|
1451
|
+
this.symbolByDecl = /* @__PURE__ */ new Map();
|
|
1559
1452
|
}
|
|
1560
1453
|
registerSymbol(symbol) {
|
|
1561
1454
|
this.symbolByDecl.set(symbol.decl, symbol);
|
|
1562
1455
|
if (symbol.identifier !== null) {
|
|
1563
1456
|
if (!this.files.has(symbol.path)) {
|
|
1564
|
-
this.files.set(symbol.path, new Map());
|
|
1457
|
+
this.files.set(symbol.path, /* @__PURE__ */ new Map());
|
|
1565
1458
|
}
|
|
1566
1459
|
this.files.get(symbol.path).set(symbol.identifier, symbol);
|
|
1567
1460
|
}
|
|
@@ -1594,7 +1487,7 @@ var SemanticDepGraphUpdater = class {
|
|
|
1594
1487
|
constructor(priorGraph) {
|
|
1595
1488
|
this.priorGraph = priorGraph;
|
|
1596
1489
|
this.newGraph = new SemanticDepGraph();
|
|
1597
|
-
this.opaqueSymbols = new Map();
|
|
1490
|
+
this.opaqueSymbols = /* @__PURE__ */ new Map();
|
|
1598
1491
|
}
|
|
1599
1492
|
registerSymbol(symbol) {
|
|
1600
1493
|
this.newGraph.registerSymbol(symbol);
|
|
@@ -1602,8 +1495,8 @@ var SemanticDepGraphUpdater = class {
|
|
|
1602
1495
|
finalize() {
|
|
1603
1496
|
if (this.priorGraph === null) {
|
|
1604
1497
|
return {
|
|
1605
|
-
needsEmit: new Set(),
|
|
1606
|
-
needsTypeCheckEmit: new Set(),
|
|
1498
|
+
needsEmit: /* @__PURE__ */ new Set(),
|
|
1499
|
+
needsTypeCheckEmit: /* @__PURE__ */ new Set(),
|
|
1607
1500
|
newGraph: this.newGraph
|
|
1608
1501
|
};
|
|
1609
1502
|
}
|
|
@@ -1616,14 +1509,14 @@ var SemanticDepGraphUpdater = class {
|
|
|
1616
1509
|
};
|
|
1617
1510
|
}
|
|
1618
1511
|
determineInvalidatedFiles(priorGraph) {
|
|
1619
|
-
const isPublicApiAffected = new Set();
|
|
1512
|
+
const isPublicApiAffected = /* @__PURE__ */ new Set();
|
|
1620
1513
|
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1621
1514
|
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
1622
1515
|
if (previousSymbol === null || symbol.isPublicApiAffected(previousSymbol)) {
|
|
1623
1516
|
isPublicApiAffected.add(symbol);
|
|
1624
1517
|
}
|
|
1625
1518
|
}
|
|
1626
|
-
const needsEmit = new Set();
|
|
1519
|
+
const needsEmit = /* @__PURE__ */ new Set();
|
|
1627
1520
|
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1628
1521
|
if (symbol.isEmitAffected === void 0) {
|
|
1629
1522
|
continue;
|
|
@@ -1636,14 +1529,14 @@ var SemanticDepGraphUpdater = class {
|
|
|
1636
1529
|
return needsEmit;
|
|
1637
1530
|
}
|
|
1638
1531
|
determineInvalidatedTypeCheckFiles(priorGraph) {
|
|
1639
|
-
const isTypeCheckApiAffected = new Set();
|
|
1532
|
+
const isTypeCheckApiAffected = /* @__PURE__ */ new Set();
|
|
1640
1533
|
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1641
1534
|
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
1642
1535
|
if (previousSymbol === null || symbol.isTypeCheckApiAffected(previousSymbol)) {
|
|
1643
1536
|
isTypeCheckApiAffected.add(symbol);
|
|
1644
1537
|
}
|
|
1645
1538
|
}
|
|
1646
|
-
const needsTypeCheckEmit = new Set();
|
|
1539
|
+
const needsTypeCheckEmit = /* @__PURE__ */ new Set();
|
|
1647
1540
|
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1648
1541
|
if (symbol.isTypeCheckBlockAffected === void 0) {
|
|
1649
1542
|
continue;
|
|
@@ -1685,10 +1578,10 @@ function getImportPath(expr) {
|
|
|
1685
1578
|
}
|
|
1686
1579
|
}
|
|
1687
1580
|
|
|
1688
|
-
// bazel-out/
|
|
1689
|
-
import
|
|
1581
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
1582
|
+
import ts5 from "typescript";
|
|
1690
1583
|
|
|
1691
|
-
// bazel-out/
|
|
1584
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/util.mjs
|
|
1692
1585
|
function isSymbolEqual(a, b) {
|
|
1693
1586
|
if (a.decl === b.decl) {
|
|
1694
1587
|
return true;
|
|
@@ -1738,9 +1631,9 @@ function isSetEqual(a, b, equalityTester = referenceEquality) {
|
|
|
1738
1631
|
return true;
|
|
1739
1632
|
}
|
|
1740
1633
|
|
|
1741
|
-
// bazel-out/
|
|
1634
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
1742
1635
|
function extractSemanticTypeParameters(node) {
|
|
1743
|
-
if (!
|
|
1636
|
+
if (!ts5.isClassDeclaration(node) || node.typeParameters === void 0) {
|
|
1744
1637
|
return null;
|
|
1745
1638
|
}
|
|
1746
1639
|
return node.typeParameters.map((typeParam) => ({ hasGenericTypeBound: typeParam.constraint !== void 0 }));
|
|
@@ -1758,27 +1651,27 @@ function isTypeParameterEqual(a, b) {
|
|
|
1758
1651
|
return a.hasGenericTypeBound === b.hasGenericTypeBound;
|
|
1759
1652
|
}
|
|
1760
1653
|
|
|
1761
|
-
// bazel-out/
|
|
1654
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/api.mjs
|
|
1762
1655
|
var MetaType;
|
|
1763
1656
|
(function(MetaType2) {
|
|
1764
1657
|
MetaType2[MetaType2["Pipe"] = 0] = "Pipe";
|
|
1765
1658
|
MetaType2[MetaType2["Directive"] = 1] = "Directive";
|
|
1766
1659
|
})(MetaType || (MetaType = {}));
|
|
1767
1660
|
|
|
1768
|
-
// bazel-out/
|
|
1769
|
-
import
|
|
1661
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1662
|
+
import ts7 from "typescript";
|
|
1770
1663
|
|
|
1771
|
-
// bazel-out/
|
|
1664
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/property_mapping.mjs
|
|
1772
1665
|
var ClassPropertyMapping = class {
|
|
1773
1666
|
constructor(forwardMap) {
|
|
1774
1667
|
this.forwardMap = forwardMap;
|
|
1775
1668
|
this.reverseMap = reverseMapFromForwardMap(forwardMap);
|
|
1776
1669
|
}
|
|
1777
1670
|
static empty() {
|
|
1778
|
-
return new ClassPropertyMapping(new Map());
|
|
1671
|
+
return new ClassPropertyMapping(/* @__PURE__ */ new Map());
|
|
1779
1672
|
}
|
|
1780
1673
|
static fromMappedObject(obj) {
|
|
1781
|
-
const forwardMap = new Map();
|
|
1674
|
+
const forwardMap = /* @__PURE__ */ new Map();
|
|
1782
1675
|
for (const classPropertyName of Object.keys(obj)) {
|
|
1783
1676
|
const value = obj[classPropertyName];
|
|
1784
1677
|
const bindingPropertyName = Array.isArray(value) ? value[0] : value;
|
|
@@ -1834,7 +1727,7 @@ var ClassPropertyMapping = class {
|
|
|
1834
1727
|
}
|
|
1835
1728
|
};
|
|
1836
1729
|
function reverseMapFromForwardMap(forwardMap) {
|
|
1837
|
-
const reverseMap = new Map();
|
|
1730
|
+
const reverseMap = /* @__PURE__ */ new Map();
|
|
1838
1731
|
for (const [_, inputOrOutput] of forwardMap) {
|
|
1839
1732
|
if (!reverseMap.has(inputOrOutput.bindingPropertyName)) {
|
|
1840
1733
|
reverseMap.set(inputOrOutput.bindingPropertyName, []);
|
|
@@ -1844,14 +1737,14 @@ function reverseMapFromForwardMap(forwardMap) {
|
|
|
1844
1737
|
return reverseMap;
|
|
1845
1738
|
}
|
|
1846
1739
|
|
|
1847
|
-
// bazel-out/
|
|
1848
|
-
import
|
|
1740
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/util.mjs
|
|
1741
|
+
import ts6 from "typescript";
|
|
1849
1742
|
function extractReferencesFromType(checker, def, bestGuessOwningModule) {
|
|
1850
|
-
if (!
|
|
1743
|
+
if (!ts6.isTupleTypeNode(def)) {
|
|
1851
1744
|
return [];
|
|
1852
1745
|
}
|
|
1853
1746
|
return def.elements.map((element) => {
|
|
1854
|
-
if (!
|
|
1747
|
+
if (!ts6.isTypeQueryNode(element)) {
|
|
1855
1748
|
throw new Error(`Expected TypeQueryNode: ${nodeDebugInfo(element)}`);
|
|
1856
1749
|
}
|
|
1857
1750
|
const type = element.exprName;
|
|
@@ -1867,18 +1760,18 @@ function extractReferencesFromType(checker, def, bestGuessOwningModule) {
|
|
|
1867
1760
|
});
|
|
1868
1761
|
}
|
|
1869
1762
|
function readStringType(type) {
|
|
1870
|
-
if (!
|
|
1763
|
+
if (!ts6.isLiteralTypeNode(type) || !ts6.isStringLiteral(type.literal)) {
|
|
1871
1764
|
return null;
|
|
1872
1765
|
}
|
|
1873
1766
|
return type.literal.text;
|
|
1874
1767
|
}
|
|
1875
1768
|
function readStringMapType(type) {
|
|
1876
|
-
if (!
|
|
1769
|
+
if (!ts6.isTypeLiteralNode(type)) {
|
|
1877
1770
|
return {};
|
|
1878
1771
|
}
|
|
1879
1772
|
const obj = {};
|
|
1880
1773
|
type.members.forEach((member) => {
|
|
1881
|
-
if (!
|
|
1774
|
+
if (!ts6.isPropertySignature(member) || member.type === void 0 || member.name === void 0 || !ts6.isStringLiteral(member.name)) {
|
|
1882
1775
|
return;
|
|
1883
1776
|
}
|
|
1884
1777
|
const value = readStringType(member.type);
|
|
@@ -1890,12 +1783,12 @@ function readStringMapType(type) {
|
|
|
1890
1783
|
return obj;
|
|
1891
1784
|
}
|
|
1892
1785
|
function readStringArrayType(type) {
|
|
1893
|
-
if (!
|
|
1786
|
+
if (!ts6.isTupleTypeNode(type)) {
|
|
1894
1787
|
return [];
|
|
1895
1788
|
}
|
|
1896
1789
|
const res = [];
|
|
1897
1790
|
type.elements.forEach((el) => {
|
|
1898
|
-
if (!
|
|
1791
|
+
if (!ts6.isLiteralTypeNode(el) || !ts6.isStringLiteral(el.literal)) {
|
|
1899
1792
|
return;
|
|
1900
1793
|
}
|
|
1901
1794
|
res.push(el.literal.text);
|
|
@@ -1908,9 +1801,9 @@ function extractDirectiveTypeCheckMeta(node, inputs, reflector) {
|
|
|
1908
1801
|
const ngTemplateGuards = staticMembers.map(extractTemplateGuard).filter((guard) => guard !== null);
|
|
1909
1802
|
const hasNgTemplateContextGuard = staticMembers.some((member) => member.kind === ClassMemberKind.Method && member.name === "ngTemplateContextGuard");
|
|
1910
1803
|
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();
|
|
1804
|
+
const restrictedInputFields = /* @__PURE__ */ new Set();
|
|
1805
|
+
const stringLiteralInputFields = /* @__PURE__ */ new Set();
|
|
1806
|
+
const undeclaredInputFields = /* @__PURE__ */ new Set();
|
|
1914
1807
|
for (const classPropertyName of inputs.classPropertyNames) {
|
|
1915
1808
|
const field = members.find((member) => member.name === classPropertyName);
|
|
1916
1809
|
if (field === void 0 || field.node === null) {
|
|
@@ -1920,7 +1813,7 @@ function extractDirectiveTypeCheckMeta(node, inputs, reflector) {
|
|
|
1920
1813
|
if (isRestricted(field.node)) {
|
|
1921
1814
|
restrictedInputFields.add(classPropertyName);
|
|
1922
1815
|
}
|
|
1923
|
-
if (field.nameNode !== null &&
|
|
1816
|
+
if (field.nameNode !== null && ts6.isStringLiteral(field.nameNode)) {
|
|
1924
1817
|
stringLiteralInputFields.add(classPropertyName);
|
|
1925
1818
|
}
|
|
1926
1819
|
}
|
|
@@ -1939,7 +1832,7 @@ function isRestricted(node) {
|
|
|
1939
1832
|
if (node.modifiers === void 0) {
|
|
1940
1833
|
return false;
|
|
1941
1834
|
}
|
|
1942
|
-
return node.modifiers.some((modifier) => modifier.kind ===
|
|
1835
|
+
return node.modifiers.some((modifier) => modifier.kind === ts6.SyntaxKind.PrivateKeyword || modifier.kind === ts6.SyntaxKind.ProtectedKeyword || modifier.kind === ts6.SyntaxKind.ReadonlyKeyword);
|
|
1943
1836
|
}
|
|
1944
1837
|
function extractTemplateGuard(member) {
|
|
1945
1838
|
if (!member.name.startsWith("ngTemplateGuard_")) {
|
|
@@ -1948,7 +1841,7 @@ function extractTemplateGuard(member) {
|
|
|
1948
1841
|
const inputName = afterUnderscore(member.name);
|
|
1949
1842
|
if (member.kind === ClassMemberKind.Property) {
|
|
1950
1843
|
let type = null;
|
|
1951
|
-
if (member.type !== null &&
|
|
1844
|
+
if (member.type !== null && ts6.isLiteralTypeNode(member.type) && ts6.isStringLiteral(member.type.literal)) {
|
|
1952
1845
|
type = member.type.literal.text;
|
|
1953
1846
|
}
|
|
1954
1847
|
if (type !== "binding") {
|
|
@@ -2011,7 +1904,7 @@ function hasInjectableFields(clazz, host) {
|
|
|
2011
1904
|
return members.some(({ isStatic, name }) => isStatic && (name === "\u0275prov" || name === "\u0275fac"));
|
|
2012
1905
|
}
|
|
2013
1906
|
|
|
2014
|
-
// bazel-out/
|
|
1907
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
2015
1908
|
var DtsMetadataReader = class {
|
|
2016
1909
|
constructor(checker, reflector) {
|
|
2017
1910
|
this.checker = checker;
|
|
@@ -2022,7 +1915,7 @@ var DtsMetadataReader = class {
|
|
|
2022
1915
|
const ngModuleDef = this.reflector.getMembersOfClass(clazz).find((member) => member.name === "\u0275mod" && member.isStatic);
|
|
2023
1916
|
if (ngModuleDef === void 0) {
|
|
2024
1917
|
return null;
|
|
2025
|
-
} else if (ngModuleDef.type === null || !
|
|
1918
|
+
} else if (ngModuleDef.type === null || !ts7.isTypeReferenceNode(ngModuleDef.type) || ngModuleDef.type.typeArguments === void 0 || ngModuleDef.type.typeArguments.length !== 4) {
|
|
2026
1919
|
return null;
|
|
2027
1920
|
}
|
|
2028
1921
|
const [_, declarationMetadata, importMetadata, exportMetadata] = ngModuleDef.type.typeArguments;
|
|
@@ -2040,7 +1933,7 @@ var DtsMetadataReader = class {
|
|
|
2040
1933
|
const def = this.reflector.getMembersOfClass(clazz).find((field) => field.isStatic && (field.name === "\u0275cmp" || field.name === "\u0275dir"));
|
|
2041
1934
|
if (def === void 0) {
|
|
2042
1935
|
return null;
|
|
2043
|
-
} else if (def.type === null || !
|
|
1936
|
+
} else if (def.type === null || !ts7.isTypeReferenceNode(def.type) || def.type.typeArguments === void 0 || def.type.typeArguments.length < 2) {
|
|
2044
1937
|
return null;
|
|
2045
1938
|
}
|
|
2046
1939
|
const isComponent = def.name === "\u0275cmp";
|
|
@@ -2063,18 +1956,19 @@ var DtsMetadataReader = class {
|
|
|
2063
1956
|
}, extractDirectiveTypeCheckMeta(clazz, inputs, this.reflector)), {
|
|
2064
1957
|
baseClass: readBaseClass2(clazz, this.checker, this.reflector),
|
|
2065
1958
|
isPoisoned: false,
|
|
2066
|
-
isStructural
|
|
1959
|
+
isStructural,
|
|
1960
|
+
animationTriggerNames: null
|
|
2067
1961
|
});
|
|
2068
1962
|
}
|
|
2069
1963
|
getPipeMetadata(ref) {
|
|
2070
1964
|
const def = this.reflector.getMembersOfClass(ref.node).find((field) => field.isStatic && field.name === "\u0275pipe");
|
|
2071
1965
|
if (def === void 0) {
|
|
2072
1966
|
return null;
|
|
2073
|
-
} else if (def.type === null || !
|
|
1967
|
+
} else if (def.type === null || !ts7.isTypeReferenceNode(def.type) || def.type.typeArguments === void 0 || def.type.typeArguments.length < 2) {
|
|
2074
1968
|
return null;
|
|
2075
1969
|
}
|
|
2076
1970
|
const type = def.type.typeArguments[1];
|
|
2077
|
-
if (!
|
|
1971
|
+
if (!ts7.isLiteralTypeNode(type) || !ts7.isStringLiteral(type.literal)) {
|
|
2078
1972
|
return null;
|
|
2079
1973
|
}
|
|
2080
1974
|
const name = type.literal.text;
|
|
@@ -2092,12 +1986,12 @@ function readBaseClass2(clazz, checker, reflector) {
|
|
|
2092
1986
|
}
|
|
2093
1987
|
if (clazz.heritageClauses !== void 0) {
|
|
2094
1988
|
for (const clause of clazz.heritageClauses) {
|
|
2095
|
-
if (clause.token ===
|
|
1989
|
+
if (clause.token === ts7.SyntaxKind.ExtendsKeyword) {
|
|
2096
1990
|
const baseExpr = clause.types[0].expression;
|
|
2097
1991
|
let symbol = checker.getSymbolAtLocation(baseExpr);
|
|
2098
1992
|
if (symbol === void 0) {
|
|
2099
1993
|
return "dynamic";
|
|
2100
|
-
} else if (symbol.flags &
|
|
1994
|
+
} else if (symbol.flags & ts7.SymbolFlags.Alias) {
|
|
2101
1995
|
symbol = checker.getAliasedSymbol(symbol);
|
|
2102
1996
|
}
|
|
2103
1997
|
if (symbol.valueDeclaration !== void 0 && isNamedClassDeclaration(symbol.valueDeclaration)) {
|
|
@@ -2111,7 +2005,7 @@ function readBaseClass2(clazz, checker, reflector) {
|
|
|
2111
2005
|
return null;
|
|
2112
2006
|
}
|
|
2113
2007
|
|
|
2114
|
-
// bazel-out/
|
|
2008
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/inheritance.mjs
|
|
2115
2009
|
function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
2116
2010
|
const topMeta = reader.getDirectiveMetadata(dir);
|
|
2117
2011
|
if (topMeta === null) {
|
|
@@ -2120,10 +2014,10 @@ function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
|
2120
2014
|
if (topMeta.baseClass === null) {
|
|
2121
2015
|
return topMeta;
|
|
2122
2016
|
}
|
|
2123
|
-
const coercedInputFields = new Set();
|
|
2124
|
-
const undeclaredInputFields = new Set();
|
|
2125
|
-
const restrictedInputFields = new Set();
|
|
2126
|
-
const stringLiteralInputFields = new Set();
|
|
2017
|
+
const coercedInputFields = /* @__PURE__ */ new Set();
|
|
2018
|
+
const undeclaredInputFields = /* @__PURE__ */ new Set();
|
|
2019
|
+
const restrictedInputFields = /* @__PURE__ */ new Set();
|
|
2020
|
+
const stringLiteralInputFields = /* @__PURE__ */ new Set();
|
|
2127
2021
|
let isDynamic = false;
|
|
2128
2022
|
let inputs = ClassPropertyMapping.empty();
|
|
2129
2023
|
let outputs = ClassPropertyMapping.empty();
|
|
@@ -2168,12 +2062,12 @@ function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
|
2168
2062
|
});
|
|
2169
2063
|
}
|
|
2170
2064
|
|
|
2171
|
-
// bazel-out/
|
|
2065
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/registry.mjs
|
|
2172
2066
|
var LocalMetadataRegistry = class {
|
|
2173
2067
|
constructor() {
|
|
2174
|
-
this.directives = new Map();
|
|
2175
|
-
this.ngModules = new Map();
|
|
2176
|
-
this.pipes = new Map();
|
|
2068
|
+
this.directives = /* @__PURE__ */ new Map();
|
|
2069
|
+
this.ngModules = /* @__PURE__ */ new Map();
|
|
2070
|
+
this.pipes = /* @__PURE__ */ new Map();
|
|
2177
2071
|
}
|
|
2178
2072
|
getDirectiveMetadata(ref) {
|
|
2179
2073
|
return this.directives.has(ref.node) ? this.directives.get(ref.node) : null;
|
|
@@ -2217,7 +2111,7 @@ var CompoundMetadataRegistry = class {
|
|
|
2217
2111
|
var InjectableClassRegistry = class {
|
|
2218
2112
|
constructor(host) {
|
|
2219
2113
|
this.host = host;
|
|
2220
|
-
this.classes = new Set();
|
|
2114
|
+
this.classes = /* @__PURE__ */ new Set();
|
|
2221
2115
|
}
|
|
2222
2116
|
registerInjectable(declaration) {
|
|
2223
2117
|
this.classes.add(declaration);
|
|
@@ -2227,17 +2121,17 @@ var InjectableClassRegistry = class {
|
|
|
2227
2121
|
}
|
|
2228
2122
|
};
|
|
2229
2123
|
|
|
2230
|
-
// bazel-out/
|
|
2124
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/resource_registry.mjs
|
|
2231
2125
|
var ResourceRegistry = class {
|
|
2232
2126
|
constructor() {
|
|
2233
|
-
this.externalTemplateToComponentsMap = new Map();
|
|
2234
|
-
this.componentToTemplateMap = new Map();
|
|
2235
|
-
this.componentToStylesMap = new Map();
|
|
2236
|
-
this.externalStyleToComponentsMap = new Map();
|
|
2127
|
+
this.externalTemplateToComponentsMap = /* @__PURE__ */ new Map();
|
|
2128
|
+
this.componentToTemplateMap = /* @__PURE__ */ new Map();
|
|
2129
|
+
this.componentToStylesMap = /* @__PURE__ */ new Map();
|
|
2130
|
+
this.externalStyleToComponentsMap = /* @__PURE__ */ new Map();
|
|
2237
2131
|
}
|
|
2238
2132
|
getComponentsWithTemplate(template) {
|
|
2239
2133
|
if (!this.externalTemplateToComponentsMap.has(template)) {
|
|
2240
|
-
return new Set();
|
|
2134
|
+
return /* @__PURE__ */ new Set();
|
|
2241
2135
|
}
|
|
2242
2136
|
return this.externalTemplateToComponentsMap.get(template);
|
|
2243
2137
|
}
|
|
@@ -2253,7 +2147,7 @@ var ResourceRegistry = class {
|
|
|
2253
2147
|
const { path } = templateResource;
|
|
2254
2148
|
if (path !== null) {
|
|
2255
2149
|
if (!this.externalTemplateToComponentsMap.has(path)) {
|
|
2256
|
-
this.externalTemplateToComponentsMap.set(path, new Set());
|
|
2150
|
+
this.externalTemplateToComponentsMap.set(path, /* @__PURE__ */ new Set());
|
|
2257
2151
|
}
|
|
2258
2152
|
this.externalTemplateToComponentsMap.get(path).add(component);
|
|
2259
2153
|
}
|
|
@@ -2268,11 +2162,11 @@ var ResourceRegistry = class {
|
|
|
2268
2162
|
registerStyle(styleResource, component) {
|
|
2269
2163
|
const { path } = styleResource;
|
|
2270
2164
|
if (!this.componentToStylesMap.has(component)) {
|
|
2271
|
-
this.componentToStylesMap.set(component, new Set());
|
|
2165
|
+
this.componentToStylesMap.set(component, /* @__PURE__ */ new Set());
|
|
2272
2166
|
}
|
|
2273
2167
|
if (path !== null) {
|
|
2274
2168
|
if (!this.externalStyleToComponentsMap.has(path)) {
|
|
2275
|
-
this.externalStyleToComponentsMap.set(path, new Set());
|
|
2169
|
+
this.externalStyleToComponentsMap.set(path, /* @__PURE__ */ new Set());
|
|
2276
2170
|
}
|
|
2277
2171
|
this.externalStyleToComponentsMap.get(path).add(component);
|
|
2278
2172
|
}
|
|
@@ -2280,19 +2174,19 @@ var ResourceRegistry = class {
|
|
|
2280
2174
|
}
|
|
2281
2175
|
getStyles(component) {
|
|
2282
2176
|
if (!this.componentToStylesMap.has(component)) {
|
|
2283
|
-
return new Set();
|
|
2177
|
+
return /* @__PURE__ */ new Set();
|
|
2284
2178
|
}
|
|
2285
2179
|
return this.componentToStylesMap.get(component);
|
|
2286
2180
|
}
|
|
2287
2181
|
getComponentsWithStyle(styleUrl) {
|
|
2288
2182
|
if (!this.externalStyleToComponentsMap.has(styleUrl)) {
|
|
2289
|
-
return new Set();
|
|
2183
|
+
return /* @__PURE__ */ new Set();
|
|
2290
2184
|
}
|
|
2291
2185
|
return this.externalStyleToComponentsMap.get(styleUrl);
|
|
2292
2186
|
}
|
|
2293
2187
|
};
|
|
2294
2188
|
|
|
2295
|
-
// bazel-out/
|
|
2189
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/api.mjs
|
|
2296
2190
|
var CompilationMode;
|
|
2297
2191
|
(function(CompilationMode2) {
|
|
2298
2192
|
CompilationMode2[CompilationMode2["FULL"] = 0] = "FULL";
|
|
@@ -2310,28 +2204,426 @@ var HandlerFlags;
|
|
|
2310
2204
|
HandlerFlags2[HandlerFlags2["FULL_INHERITANCE"] = 1] = "FULL_INHERITANCE";
|
|
2311
2205
|
})(HandlerFlags || (HandlerFlags = {}));
|
|
2312
2206
|
|
|
2313
|
-
// bazel-out/
|
|
2314
|
-
import
|
|
2207
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/alias.mjs
|
|
2208
|
+
import ts8 from "typescript";
|
|
2315
2209
|
function aliasTransformFactory(exportStatements) {
|
|
2316
2210
|
return (context) => {
|
|
2317
2211
|
return (file) => {
|
|
2318
|
-
if (
|
|
2212
|
+
if (ts8.isBundle(file) || !exportStatements.has(file.fileName)) {
|
|
2319
2213
|
return file;
|
|
2320
2214
|
}
|
|
2321
2215
|
const statements = [...file.statements];
|
|
2322
2216
|
exportStatements.get(file.fileName).forEach(([moduleName, symbolName], aliasName) => {
|
|
2323
|
-
const stmt =
|
|
2217
|
+
const stmt = ts8.createExportDeclaration(void 0, void 0, ts8.createNamedExports([createExportSpecifier(symbolName, aliasName)]), ts8.createStringLiteral(moduleName));
|
|
2324
2218
|
statements.push(stmt);
|
|
2325
2219
|
});
|
|
2326
|
-
return
|
|
2220
|
+
return ts8.updateSourceFileNode(file, statements);
|
|
2327
2221
|
};
|
|
2328
2222
|
};
|
|
2329
2223
|
}
|
|
2330
2224
|
|
|
2331
|
-
// bazel-out/
|
|
2225
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
2226
|
+
import ts12 from "typescript";
|
|
2227
|
+
|
|
2228
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
2229
|
+
import ts9 from "typescript";
|
|
2230
|
+
|
|
2231
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/expando.mjs
|
|
2232
|
+
var NgExtension = Symbol("NgExtension");
|
|
2233
|
+
function isExtended(sf) {
|
|
2234
|
+
return sf[NgExtension] !== void 0;
|
|
2235
|
+
}
|
|
2236
|
+
function sfExtensionData(sf) {
|
|
2237
|
+
const extSf = sf;
|
|
2238
|
+
if (extSf[NgExtension] !== void 0) {
|
|
2239
|
+
return extSf[NgExtension];
|
|
2240
|
+
}
|
|
2241
|
+
const extension = {
|
|
2242
|
+
isTopLevelShim: false,
|
|
2243
|
+
fileShim: null,
|
|
2244
|
+
originalReferencedFiles: null,
|
|
2245
|
+
taggedReferenceFiles: null
|
|
2246
|
+
};
|
|
2247
|
+
extSf[NgExtension] = extension;
|
|
2248
|
+
return extension;
|
|
2249
|
+
}
|
|
2250
|
+
function isFileShimSourceFile(sf) {
|
|
2251
|
+
return isExtended(sf) && sf[NgExtension].fileShim !== null;
|
|
2252
|
+
}
|
|
2253
|
+
function isShim(sf) {
|
|
2254
|
+
return isExtended(sf) && (sf[NgExtension].fileShim !== null || sf[NgExtension].isTopLevelShim);
|
|
2255
|
+
}
|
|
2256
|
+
function copyFileShimData(from, to) {
|
|
2257
|
+
if (!isFileShimSourceFile(from)) {
|
|
2258
|
+
return;
|
|
2259
|
+
}
|
|
2260
|
+
sfExtensionData(to).fileShim = sfExtensionData(from).fileShim;
|
|
2261
|
+
}
|
|
2262
|
+
function untagAllTsFiles(program) {
|
|
2263
|
+
for (const sf of program.getSourceFiles()) {
|
|
2264
|
+
untagTsFile(sf);
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
function retagAllTsFiles(program) {
|
|
2268
|
+
for (const sf of program.getSourceFiles()) {
|
|
2269
|
+
retagTsFile(sf);
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
function untagTsFile(sf) {
|
|
2273
|
+
if (sf.isDeclarationFile || !isExtended(sf)) {
|
|
2274
|
+
return;
|
|
2275
|
+
}
|
|
2276
|
+
const ext = sfExtensionData(sf);
|
|
2277
|
+
if (ext.originalReferencedFiles !== null) {
|
|
2278
|
+
sf.referencedFiles = ext.originalReferencedFiles;
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
function retagTsFile(sf) {
|
|
2282
|
+
if (sf.isDeclarationFile || !isExtended(sf)) {
|
|
2283
|
+
return;
|
|
2284
|
+
}
|
|
2285
|
+
const ext = sfExtensionData(sf);
|
|
2286
|
+
if (ext.taggedReferenceFiles !== null) {
|
|
2287
|
+
sf.referencedFiles = ext.taggedReferenceFiles;
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/util.mjs
|
|
2292
|
+
var TS_EXTENSIONS = /\.tsx?$/i;
|
|
2293
|
+
function makeShimFileName(fileName, suffix) {
|
|
2294
|
+
return absoluteFrom(fileName.replace(TS_EXTENSIONS, suffix));
|
|
2295
|
+
}
|
|
2296
|
+
function generatedModuleName(originalModuleName, originalFileName, genSuffix) {
|
|
2297
|
+
let moduleName;
|
|
2298
|
+
if (originalFileName.endsWith("/index.ts")) {
|
|
2299
|
+
moduleName = originalModuleName + "/index" + genSuffix;
|
|
2300
|
+
} else {
|
|
2301
|
+
moduleName = originalModuleName + genSuffix;
|
|
2302
|
+
}
|
|
2303
|
+
return moduleName;
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
2307
|
+
var ShimAdapter = class {
|
|
2308
|
+
constructor(delegate, tsRootFiles, topLevelGenerators, perFileGenerators, oldProgram) {
|
|
2309
|
+
this.delegate = delegate;
|
|
2310
|
+
this.shims = /* @__PURE__ */ new Map();
|
|
2311
|
+
this.priorShims = /* @__PURE__ */ new Map();
|
|
2312
|
+
this.notShims = /* @__PURE__ */ new Set();
|
|
2313
|
+
this.generators = [];
|
|
2314
|
+
this.ignoreForEmit = /* @__PURE__ */ new Set();
|
|
2315
|
+
this.extensionPrefixes = [];
|
|
2316
|
+
for (const gen of perFileGenerators) {
|
|
2317
|
+
const pattern = `^(.*)\\.${gen.extensionPrefix}\\.ts$`;
|
|
2318
|
+
const regexp = new RegExp(pattern, "i");
|
|
2319
|
+
this.generators.push({
|
|
2320
|
+
generator: gen,
|
|
2321
|
+
test: regexp,
|
|
2322
|
+
suffix: `.${gen.extensionPrefix}.ts`
|
|
2323
|
+
});
|
|
2324
|
+
this.extensionPrefixes.push(gen.extensionPrefix);
|
|
2325
|
+
}
|
|
2326
|
+
const extraInputFiles = [];
|
|
2327
|
+
for (const gen of topLevelGenerators) {
|
|
2328
|
+
const sf = gen.makeTopLevelShim();
|
|
2329
|
+
sfExtensionData(sf).isTopLevelShim = true;
|
|
2330
|
+
if (!gen.shouldEmit) {
|
|
2331
|
+
this.ignoreForEmit.add(sf);
|
|
2332
|
+
}
|
|
2333
|
+
const fileName = absoluteFromSourceFile(sf);
|
|
2334
|
+
this.shims.set(fileName, sf);
|
|
2335
|
+
extraInputFiles.push(fileName);
|
|
2336
|
+
}
|
|
2337
|
+
for (const rootFile of tsRootFiles) {
|
|
2338
|
+
for (const gen of this.generators) {
|
|
2339
|
+
extraInputFiles.push(makeShimFileName(rootFile, gen.suffix));
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
this.extraInputFiles = extraInputFiles;
|
|
2343
|
+
if (oldProgram !== null) {
|
|
2344
|
+
for (const oldSf of oldProgram.getSourceFiles()) {
|
|
2345
|
+
if (oldSf.isDeclarationFile || !isFileShimSourceFile(oldSf)) {
|
|
2346
|
+
continue;
|
|
2347
|
+
}
|
|
2348
|
+
this.priorShims.set(absoluteFromSourceFile(oldSf), oldSf);
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
maybeGenerate(fileName) {
|
|
2353
|
+
if (this.notShims.has(fileName)) {
|
|
2354
|
+
return null;
|
|
2355
|
+
} else if (this.shims.has(fileName)) {
|
|
2356
|
+
return this.shims.get(fileName);
|
|
2357
|
+
}
|
|
2358
|
+
if (isDtsPath(fileName)) {
|
|
2359
|
+
this.notShims.add(fileName);
|
|
2360
|
+
return null;
|
|
2361
|
+
}
|
|
2362
|
+
for (const record of this.generators) {
|
|
2363
|
+
const match = record.test.exec(fileName);
|
|
2364
|
+
if (match === null) {
|
|
2365
|
+
continue;
|
|
2366
|
+
}
|
|
2367
|
+
const prefix = match[1];
|
|
2368
|
+
let baseFileName = absoluteFrom(prefix + ".ts");
|
|
2369
|
+
if (!this.delegate.fileExists(baseFileName)) {
|
|
2370
|
+
baseFileName = absoluteFrom(prefix + ".tsx");
|
|
2371
|
+
if (!this.delegate.fileExists(baseFileName)) {
|
|
2372
|
+
return void 0;
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
const inputFile = this.delegate.getSourceFile(baseFileName, ts9.ScriptTarget.Latest);
|
|
2376
|
+
if (inputFile === void 0 || isShim(inputFile)) {
|
|
2377
|
+
return void 0;
|
|
2378
|
+
}
|
|
2379
|
+
return this.generateSpecific(fileName, record.generator, inputFile);
|
|
2380
|
+
}
|
|
2381
|
+
this.notShims.add(fileName);
|
|
2382
|
+
return null;
|
|
2383
|
+
}
|
|
2384
|
+
generateSpecific(fileName, generator, inputFile) {
|
|
2385
|
+
let priorShimSf = null;
|
|
2386
|
+
if (this.priorShims.has(fileName)) {
|
|
2387
|
+
priorShimSf = this.priorShims.get(fileName);
|
|
2388
|
+
this.priorShims.delete(fileName);
|
|
2389
|
+
}
|
|
2390
|
+
const shimSf = generator.generateShimForFile(inputFile, fileName, priorShimSf);
|
|
2391
|
+
sfExtensionData(shimSf).fileShim = {
|
|
2392
|
+
extension: generator.extensionPrefix,
|
|
2393
|
+
generatedFrom: absoluteFromSourceFile(inputFile)
|
|
2394
|
+
};
|
|
2395
|
+
if (!generator.shouldEmit) {
|
|
2396
|
+
this.ignoreForEmit.add(shimSf);
|
|
2397
|
+
}
|
|
2398
|
+
this.shims.set(fileName, shimSf);
|
|
2399
|
+
return shimSf;
|
|
2400
|
+
}
|
|
2401
|
+
};
|
|
2402
|
+
|
|
2403
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/factory_generator.mjs
|
|
2332
2404
|
import ts10 from "typescript";
|
|
2405
|
+
var TS_DTS_SUFFIX = /(\.d)?\.ts$/;
|
|
2406
|
+
var STRIP_NG_FACTORY = /(.*)NgFactory$/;
|
|
2407
|
+
var FactoryGenerator = class {
|
|
2408
|
+
constructor() {
|
|
2409
|
+
this.sourceInfo = /* @__PURE__ */ new Map();
|
|
2410
|
+
this.sourceToFactorySymbols = /* @__PURE__ */ new Map();
|
|
2411
|
+
this.shouldEmit = true;
|
|
2412
|
+
this.extensionPrefix = "ngfactory";
|
|
2413
|
+
}
|
|
2414
|
+
generateShimForFile(sf, genFilePath) {
|
|
2415
|
+
const absoluteSfPath = absoluteFromSourceFile(sf);
|
|
2416
|
+
const relativePathToSource = "./" + basename(sf.fileName).replace(TS_DTS_SUFFIX, "");
|
|
2417
|
+
const symbolNames = sf.statements.filter(ts10.isClassDeclaration).filter((decl) => isExported(decl) && decl.decorators !== void 0 && decl.name !== void 0).map((decl) => decl.name.text);
|
|
2418
|
+
let sourceText = "";
|
|
2419
|
+
const leadingComment = getFileoverviewComment(sf);
|
|
2420
|
+
if (leadingComment !== null) {
|
|
2421
|
+
sourceText = leadingComment + "\n\n";
|
|
2422
|
+
}
|
|
2423
|
+
if (symbolNames.length > 0) {
|
|
2424
|
+
const varLines = symbolNames.map((name) => `export const ${name}NgFactory: i0.\u0275NgModuleFactory<any> = new i0.\u0275NgModuleFactory(${name});`);
|
|
2425
|
+
sourceText += [
|
|
2426
|
+
`import * as i0 from '@angular/core';`,
|
|
2427
|
+
`import {${symbolNames.join(", ")}} from '${relativePathToSource}';`,
|
|
2428
|
+
...varLines
|
|
2429
|
+
].join("\n");
|
|
2430
|
+
}
|
|
2431
|
+
sourceText += "\nexport const \u0275NonEmptyModule = true;";
|
|
2432
|
+
const genFile = ts10.createSourceFile(genFilePath, sourceText, sf.languageVersion, true, ts10.ScriptKind.TS);
|
|
2433
|
+
if (sf.moduleName !== void 0) {
|
|
2434
|
+
genFile.moduleName = generatedModuleName(sf.moduleName, sf.fileName, ".ngfactory");
|
|
2435
|
+
}
|
|
2436
|
+
const moduleSymbols = /* @__PURE__ */ new Map();
|
|
2437
|
+
this.sourceToFactorySymbols.set(absoluteSfPath, moduleSymbols);
|
|
2438
|
+
this.sourceInfo.set(genFilePath, {
|
|
2439
|
+
sourceFilePath: absoluteSfPath,
|
|
2440
|
+
moduleSymbols
|
|
2441
|
+
});
|
|
2442
|
+
return genFile;
|
|
2443
|
+
}
|
|
2444
|
+
track(sf, moduleInfo) {
|
|
2445
|
+
if (this.sourceToFactorySymbols.has(sf.fileName)) {
|
|
2446
|
+
this.sourceToFactorySymbols.get(sf.fileName).set(moduleInfo.name, moduleInfo);
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
};
|
|
2450
|
+
function isExported(decl) {
|
|
2451
|
+
return decl.modifiers !== void 0 && decl.modifiers.some((mod) => mod.kind == ts10.SyntaxKind.ExportKeyword);
|
|
2452
|
+
}
|
|
2453
|
+
function generatedFactoryTransform(factoryMap, importRewriter) {
|
|
2454
|
+
return (context) => {
|
|
2455
|
+
return (file) => {
|
|
2456
|
+
return transformFactorySourceFile(factoryMap, context, importRewriter, file);
|
|
2457
|
+
};
|
|
2458
|
+
};
|
|
2459
|
+
}
|
|
2460
|
+
function transformFactorySourceFile(factoryMap, context, importRewriter, file) {
|
|
2461
|
+
if (!factoryMap.has(file.fileName)) {
|
|
2462
|
+
return file;
|
|
2463
|
+
}
|
|
2464
|
+
const { moduleSymbols, sourceFilePath } = factoryMap.get(file.fileName);
|
|
2465
|
+
const transformedStatements = [];
|
|
2466
|
+
let nonEmptyExport = null;
|
|
2467
|
+
const coreImportIdentifiers = /* @__PURE__ */ new Set();
|
|
2468
|
+
for (const stmt of file.statements) {
|
|
2469
|
+
if (ts10.isImportDeclaration(stmt) && ts10.isStringLiteral(stmt.moduleSpecifier) && stmt.moduleSpecifier.text === "@angular/core") {
|
|
2470
|
+
const rewrittenModuleSpecifier = importRewriter.rewriteSpecifier("@angular/core", sourceFilePath);
|
|
2471
|
+
if (rewrittenModuleSpecifier !== stmt.moduleSpecifier.text) {
|
|
2472
|
+
transformedStatements.push(ts10.updateImportDeclaration(stmt, stmt.decorators, stmt.modifiers, stmt.importClause, ts10.createStringLiteral(rewrittenModuleSpecifier), void 0));
|
|
2473
|
+
if (stmt.importClause !== void 0 && stmt.importClause.namedBindings !== void 0 && ts10.isNamespaceImport(stmt.importClause.namedBindings)) {
|
|
2474
|
+
coreImportIdentifiers.add(stmt.importClause.namedBindings.name.text);
|
|
2475
|
+
}
|
|
2476
|
+
} else {
|
|
2477
|
+
transformedStatements.push(stmt);
|
|
2478
|
+
}
|
|
2479
|
+
} else if (ts10.isVariableStatement(stmt) && stmt.declarationList.declarations.length === 1) {
|
|
2480
|
+
const decl = stmt.declarationList.declarations[0];
|
|
2481
|
+
if (ts10.isIdentifier(decl.name)) {
|
|
2482
|
+
if (decl.name.text === "\u0275NonEmptyModule") {
|
|
2483
|
+
nonEmptyExport = stmt;
|
|
2484
|
+
continue;
|
|
2485
|
+
}
|
|
2486
|
+
const match = STRIP_NG_FACTORY.exec(decl.name.text);
|
|
2487
|
+
const module = match ? moduleSymbols.get(match[1]) : null;
|
|
2488
|
+
if (module) {
|
|
2489
|
+
const moduleIsTreeShakable = !module.hasId;
|
|
2490
|
+
const newStmt = !moduleIsTreeShakable ? stmt : updateInitializers(stmt, (init) => init ? wrapInNoSideEffects(init) : void 0);
|
|
2491
|
+
transformedStatements.push(newStmt);
|
|
2492
|
+
}
|
|
2493
|
+
} else {
|
|
2494
|
+
transformedStatements.push(stmt);
|
|
2495
|
+
}
|
|
2496
|
+
} else {
|
|
2497
|
+
transformedStatements.push(stmt);
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
if (!transformedStatements.some(ts10.isVariableStatement) && nonEmptyExport !== null) {
|
|
2501
|
+
transformedStatements.push(nonEmptyExport);
|
|
2502
|
+
}
|
|
2503
|
+
file = ts10.updateSourceFileNode(file, transformedStatements);
|
|
2504
|
+
if (coreImportIdentifiers.size > 0) {
|
|
2505
|
+
const visit2 = (node) => {
|
|
2506
|
+
node = ts10.visitEachChild(node, (child) => visit2(child), context);
|
|
2507
|
+
if (ts10.isPropertyAccessExpression(node) && ts10.isIdentifier(node.expression) && coreImportIdentifiers.has(node.expression.text)) {
|
|
2508
|
+
const rewrittenSymbol = importRewriter.rewriteSymbol(node.name.text, "@angular/core");
|
|
2509
|
+
if (rewrittenSymbol !== node.name.text) {
|
|
2510
|
+
const updated = ts10.updatePropertyAccess(node, node.expression, ts10.createIdentifier(rewrittenSymbol));
|
|
2511
|
+
node = updated;
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2514
|
+
return node;
|
|
2515
|
+
};
|
|
2516
|
+
file = visit2(file);
|
|
2517
|
+
}
|
|
2518
|
+
return file;
|
|
2519
|
+
}
|
|
2520
|
+
function getFileoverviewComment(sourceFile) {
|
|
2521
|
+
const text = sourceFile.getFullText();
|
|
2522
|
+
const trivia = text.substring(0, sourceFile.getStart());
|
|
2523
|
+
const leadingComments = ts10.getLeadingCommentRanges(trivia, 0);
|
|
2524
|
+
if (!leadingComments || leadingComments.length === 0) {
|
|
2525
|
+
return null;
|
|
2526
|
+
}
|
|
2527
|
+
const comment = leadingComments[0];
|
|
2528
|
+
if (comment.kind !== ts10.SyntaxKind.MultiLineCommentTrivia) {
|
|
2529
|
+
return null;
|
|
2530
|
+
}
|
|
2531
|
+
if (text.substring(comment.end, comment.end + 2) !== "\n\n") {
|
|
2532
|
+
return null;
|
|
2533
|
+
}
|
|
2534
|
+
const commentText = text.substring(comment.pos, comment.end);
|
|
2535
|
+
if (commentText.indexOf("@license") !== -1) {
|
|
2536
|
+
return null;
|
|
2537
|
+
}
|
|
2538
|
+
return commentText;
|
|
2539
|
+
}
|
|
2540
|
+
function wrapInNoSideEffects(expr) {
|
|
2541
|
+
const noSideEffects = ts10.createPropertyAccess(ts10.createIdentifier("i0"), "\u0275noSideEffects");
|
|
2542
|
+
return ts10.createCall(noSideEffects, [], [
|
|
2543
|
+
ts10.createFunctionExpression([], void 0, void 0, [], [], void 0, ts10.createBlock([
|
|
2544
|
+
ts10.createReturn(expr)
|
|
2545
|
+
]))
|
|
2546
|
+
]);
|
|
2547
|
+
}
|
|
2548
|
+
function updateInitializers(stmt, update) {
|
|
2549
|
+
return ts10.updateVariableStatement(stmt, stmt.modifiers, ts10.updateVariableDeclarationList(stmt.declarationList, stmt.declarationList.declarations.map((decl) => ts10.updateVariableDeclaration(decl, decl.name, decl.type, update(decl.initializer)))));
|
|
2550
|
+
}
|
|
2333
2551
|
|
|
2334
|
-
// bazel-out/
|
|
2552
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/reference_tagger.mjs
|
|
2553
|
+
var ShimReferenceTagger = class {
|
|
2554
|
+
constructor(shimExtensions) {
|
|
2555
|
+
this.tagged = /* @__PURE__ */ new Set();
|
|
2556
|
+
this.enabled = true;
|
|
2557
|
+
this.suffixes = shimExtensions.map((extension) => `.${extension}.ts`);
|
|
2558
|
+
}
|
|
2559
|
+
tag(sf) {
|
|
2560
|
+
if (!this.enabled || sf.isDeclarationFile || isShim(sf) || this.tagged.has(sf) || !isNonDeclarationTsPath(sf.fileName)) {
|
|
2561
|
+
return;
|
|
2562
|
+
}
|
|
2563
|
+
const ext = sfExtensionData(sf);
|
|
2564
|
+
if (ext.originalReferencedFiles === null) {
|
|
2565
|
+
ext.originalReferencedFiles = sf.referencedFiles;
|
|
2566
|
+
}
|
|
2567
|
+
const referencedFiles = [...ext.originalReferencedFiles];
|
|
2568
|
+
const sfPath = absoluteFromSourceFile(sf);
|
|
2569
|
+
for (const suffix of this.suffixes) {
|
|
2570
|
+
referencedFiles.push({
|
|
2571
|
+
fileName: makeShimFileName(sfPath, suffix),
|
|
2572
|
+
pos: 0,
|
|
2573
|
+
end: 0
|
|
2574
|
+
});
|
|
2575
|
+
}
|
|
2576
|
+
ext.taggedReferenceFiles = referencedFiles;
|
|
2577
|
+
sf.referencedFiles = referencedFiles;
|
|
2578
|
+
this.tagged.add(sf);
|
|
2579
|
+
}
|
|
2580
|
+
finalize() {
|
|
2581
|
+
this.enabled = false;
|
|
2582
|
+
this.tagged.clear();
|
|
2583
|
+
}
|
|
2584
|
+
};
|
|
2585
|
+
|
|
2586
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/summary_generator.mjs
|
|
2587
|
+
import ts11 from "typescript";
|
|
2588
|
+
var SummaryGenerator = class {
|
|
2589
|
+
constructor() {
|
|
2590
|
+
this.shouldEmit = true;
|
|
2591
|
+
this.extensionPrefix = "ngsummary";
|
|
2592
|
+
}
|
|
2593
|
+
generateShimForFile(sf, genFilePath) {
|
|
2594
|
+
const symbolNames = [];
|
|
2595
|
+
for (const stmt of sf.statements) {
|
|
2596
|
+
if (ts11.isClassDeclaration(stmt)) {
|
|
2597
|
+
if (!isExported2(stmt) || stmt.decorators === void 0 || stmt.name === void 0) {
|
|
2598
|
+
continue;
|
|
2599
|
+
}
|
|
2600
|
+
symbolNames.push(stmt.name.text);
|
|
2601
|
+
} else if (ts11.isExportDeclaration(stmt)) {
|
|
2602
|
+
if (stmt.exportClause === void 0 || stmt.moduleSpecifier !== void 0 || !ts11.isNamedExports(stmt.exportClause)) {
|
|
2603
|
+
continue;
|
|
2604
|
+
}
|
|
2605
|
+
for (const specifier of stmt.exportClause.elements) {
|
|
2606
|
+
symbolNames.push(specifier.name.text);
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
}
|
|
2610
|
+
const varLines = symbolNames.map((name) => `export const ${name}NgSummary: any = null;`);
|
|
2611
|
+
if (varLines.length === 0) {
|
|
2612
|
+
varLines.push(`export const \u0275empty = null;`);
|
|
2613
|
+
}
|
|
2614
|
+
const sourceText = varLines.join("\n");
|
|
2615
|
+
const genFile = ts11.createSourceFile(genFilePath, sourceText, sf.languageVersion, true, ts11.ScriptKind.TS);
|
|
2616
|
+
if (sf.moduleName !== void 0) {
|
|
2617
|
+
genFile.moduleName = generatedModuleName(sf.moduleName, sf.fileName, ".ngsummary");
|
|
2618
|
+
}
|
|
2619
|
+
return genFile;
|
|
2620
|
+
}
|
|
2621
|
+
};
|
|
2622
|
+
function isExported2(decl) {
|
|
2623
|
+
return decl.modifiers !== void 0 && decl.modifiers.some((mod) => mod.kind == ts11.SyntaxKind.ExportKeyword);
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/trait.mjs
|
|
2335
2627
|
var TraitState;
|
|
2336
2628
|
(function(TraitState2) {
|
|
2337
2629
|
TraitState2[TraitState2["Pending"] = 0] = "Pending";
|
|
@@ -2386,7 +2678,7 @@ var TraitImpl = class {
|
|
|
2386
2678
|
}
|
|
2387
2679
|
};
|
|
2388
2680
|
|
|
2389
|
-
// bazel-out/
|
|
2681
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
2390
2682
|
var TraitCompiler = class {
|
|
2391
2683
|
constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater) {
|
|
2392
2684
|
this.handlers = handlers;
|
|
@@ -2397,11 +2689,11 @@ var TraitCompiler = class {
|
|
|
2397
2689
|
this.compilationMode = compilationMode;
|
|
2398
2690
|
this.dtsTransforms = dtsTransforms;
|
|
2399
2691
|
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();
|
|
2692
|
+
this.classes = /* @__PURE__ */ new Map();
|
|
2693
|
+
this.fileToClasses = /* @__PURE__ */ new Map();
|
|
2694
|
+
this.filesWithoutTraits = /* @__PURE__ */ new Set();
|
|
2695
|
+
this.reexportMap = /* @__PURE__ */ new Map();
|
|
2696
|
+
this.handlersByName = /* @__PURE__ */ new Map();
|
|
2405
2697
|
for (const handler of handlers) {
|
|
2406
2698
|
this.handlersByName.set(handler.name, handler);
|
|
2407
2699
|
}
|
|
@@ -2413,7 +2705,7 @@ var TraitCompiler = class {
|
|
|
2413
2705
|
return this.analyze(sf, true);
|
|
2414
2706
|
}
|
|
2415
2707
|
analyze(sf, preanalyze) {
|
|
2416
|
-
if (sf.isDeclarationFile) {
|
|
2708
|
+
if (sf.isDeclarationFile || isShim(sf)) {
|
|
2417
2709
|
return void 0;
|
|
2418
2710
|
}
|
|
2419
2711
|
const promises = [];
|
|
@@ -2434,9 +2726,12 @@ var TraitCompiler = class {
|
|
|
2434
2726
|
if (this.reflector.isClass(node)) {
|
|
2435
2727
|
this.analyzeClass(node, preanalyze ? promises : null);
|
|
2436
2728
|
}
|
|
2437
|
-
|
|
2729
|
+
ts12.forEachChild(node, visit2);
|
|
2438
2730
|
};
|
|
2439
2731
|
visit2(sf);
|
|
2732
|
+
if (!this.fileToClasses.has(sf)) {
|
|
2733
|
+
this.filesWithoutTraits.add(sf);
|
|
2734
|
+
}
|
|
2440
2735
|
if (preanalyze && promises.length > 0) {
|
|
2441
2736
|
return Promise.all(promises).then(() => void 0);
|
|
2442
2737
|
} else {
|
|
@@ -2461,7 +2756,7 @@ var TraitCompiler = class {
|
|
|
2461
2756
|
return records;
|
|
2462
2757
|
}
|
|
2463
2758
|
getAnalyzedRecords() {
|
|
2464
|
-
const result = new Map();
|
|
2759
|
+
const result = /* @__PURE__ */ new Map();
|
|
2465
2760
|
for (const [sf, classes] of this.fileToClasses) {
|
|
2466
2761
|
const records = [];
|
|
2467
2762
|
for (const clazz of classes) {
|
|
@@ -2499,7 +2794,7 @@ var TraitCompiler = class {
|
|
|
2499
2794
|
this.classes.set(record.node, record);
|
|
2500
2795
|
const sf = record.node.getSourceFile();
|
|
2501
2796
|
if (!this.fileToClasses.has(sf)) {
|
|
2502
|
-
this.fileToClasses.set(sf, new Set());
|
|
2797
|
+
this.fileToClasses.set(sf, /* @__PURE__ */ new Set());
|
|
2503
2798
|
}
|
|
2504
2799
|
this.fileToClasses.get(sf).add(record.node);
|
|
2505
2800
|
}
|
|
@@ -2533,7 +2828,7 @@ var TraitCompiler = class {
|
|
|
2533
2828
|
this.classes.set(clazz, record);
|
|
2534
2829
|
const sf = clazz.getSourceFile();
|
|
2535
2830
|
if (!this.fileToClasses.has(sf)) {
|
|
2536
|
-
this.fileToClasses.set(sf, new Set());
|
|
2831
|
+
this.fileToClasses.set(sf, /* @__PURE__ */ new Set());
|
|
2537
2832
|
}
|
|
2538
2833
|
this.fileToClasses.get(sf).add(clazz);
|
|
2539
2834
|
} else {
|
|
@@ -2545,7 +2840,7 @@ var TraitCompiler = class {
|
|
|
2545
2840
|
}
|
|
2546
2841
|
if (isPrimaryHandler && record.hasPrimaryHandler) {
|
|
2547
2842
|
record.metaDiagnostics = [{
|
|
2548
|
-
category:
|
|
2843
|
+
category: ts12.DiagnosticCategory.Error,
|
|
2549
2844
|
code: Number("-99" + ErrorCode.DECORATOR_COLLISION),
|
|
2550
2845
|
file: getSourceFile(clazz),
|
|
2551
2846
|
start: clazz.getStart(void 0, false),
|
|
@@ -2662,7 +2957,7 @@ var TraitCompiler = class {
|
|
|
2662
2957
|
if (result.reexports !== void 0) {
|
|
2663
2958
|
const fileName = clazz.getSourceFile().fileName;
|
|
2664
2959
|
if (!this.reexportMap.has(fileName)) {
|
|
2665
|
-
this.reexportMap.set(fileName, new Map());
|
|
2960
|
+
this.reexportMap.set(fileName, /* @__PURE__ */ new Map());
|
|
2666
2961
|
}
|
|
2667
2962
|
const fileReexports = this.reexportMap.get(fileName);
|
|
2668
2963
|
for (const reexport of result.reexports) {
|
|
@@ -2753,7 +3048,7 @@ var TraitCompiler = class {
|
|
|
2753
3048
|
}
|
|
2754
3049
|
}
|
|
2755
3050
|
compile(clazz, constantPool) {
|
|
2756
|
-
const original =
|
|
3051
|
+
const original = ts12.getOriginalNode(clazz);
|
|
2757
3052
|
if (!this.reflector.isClass(clazz) || !this.reflector.isClass(original) || !this.classes.has(original)) {
|
|
2758
3053
|
return null;
|
|
2759
3054
|
}
|
|
@@ -2784,7 +3079,7 @@ var TraitCompiler = class {
|
|
|
2784
3079
|
return res.length > 0 ? res : null;
|
|
2785
3080
|
}
|
|
2786
3081
|
decoratorsFor(node) {
|
|
2787
|
-
const original =
|
|
3082
|
+
const original = ts12.getOriginalNode(node);
|
|
2788
3083
|
if (!this.reflector.isClass(original) || !this.classes.has(original)) {
|
|
2789
3084
|
return [];
|
|
2790
3085
|
}
|
|
@@ -2794,7 +3089,7 @@ var TraitCompiler = class {
|
|
|
2794
3089
|
if (trait.state !== TraitState.Resolved) {
|
|
2795
3090
|
continue;
|
|
2796
3091
|
}
|
|
2797
|
-
if (trait.detected.trigger !== null &&
|
|
3092
|
+
if (trait.detected.trigger !== null && ts12.isDecorator(trait.detected.trigger)) {
|
|
2798
3093
|
decorators.push(trait.detected.trigger);
|
|
2799
3094
|
}
|
|
2800
3095
|
}
|
|
@@ -2823,24 +3118,24 @@ var TraitCompiler = class {
|
|
|
2823
3118
|
}
|
|
2824
3119
|
};
|
|
2825
3120
|
|
|
2826
|
-
// bazel-out/
|
|
2827
|
-
import
|
|
3121
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
3122
|
+
import ts14 from "typescript";
|
|
2828
3123
|
|
|
2829
|
-
// bazel-out/
|
|
2830
|
-
import
|
|
3124
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/utils.mjs
|
|
3125
|
+
import ts13 from "typescript";
|
|
2831
3126
|
function addImports(importManager, sf, extraStatements = []) {
|
|
2832
3127
|
const addedImports = importManager.getAllImports(sf.fileName).map((i) => {
|
|
2833
|
-
const qualifier =
|
|
2834
|
-
const importClause =
|
|
2835
|
-
const decl =
|
|
2836
|
-
|
|
3128
|
+
const qualifier = ts13.createIdentifier(i.qualifier.text);
|
|
3129
|
+
const importClause = ts13.createImportClause(void 0, ts13.createNamespaceImport(qualifier));
|
|
3130
|
+
const decl = ts13.createImportDeclaration(void 0, void 0, importClause, ts13.createLiteral(i.specifier));
|
|
3131
|
+
ts13.setOriginalNode(i.qualifier, decl);
|
|
2837
3132
|
return decl;
|
|
2838
3133
|
});
|
|
2839
3134
|
const existingImports = sf.statements.filter((stmt) => isImportStatement(stmt));
|
|
2840
3135
|
const body = sf.statements.filter((stmt) => !isImportStatement(stmt));
|
|
2841
3136
|
if (addedImports.length > 0) {
|
|
2842
|
-
const fileoverviewAnchorStmt =
|
|
2843
|
-
return
|
|
3137
|
+
const fileoverviewAnchorStmt = ts13.createNotEmittedStatement(sf);
|
|
3138
|
+
return ts13.updateSourceFileNode(sf, ts13.createNodeArray([
|
|
2844
3139
|
fileoverviewAnchorStmt,
|
|
2845
3140
|
...existingImports,
|
|
2846
3141
|
...addedImports,
|
|
@@ -2851,13 +3146,13 @@ function addImports(importManager, sf, extraStatements = []) {
|
|
|
2851
3146
|
return sf;
|
|
2852
3147
|
}
|
|
2853
3148
|
function isImportStatement(stmt) {
|
|
2854
|
-
return
|
|
3149
|
+
return ts13.isImportDeclaration(stmt) || ts13.isImportEqualsDeclaration(stmt) || ts13.isNamespaceImport(stmt);
|
|
2855
3150
|
}
|
|
2856
3151
|
|
|
2857
|
-
// bazel-out/
|
|
3152
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
2858
3153
|
var DtsTransformRegistry = class {
|
|
2859
3154
|
constructor() {
|
|
2860
|
-
this.ivyDeclarationTransforms = new Map();
|
|
3155
|
+
this.ivyDeclarationTransforms = /* @__PURE__ */ new Map();
|
|
2861
3156
|
}
|
|
2862
3157
|
getIvyDeclarationTransform(sf) {
|
|
2863
3158
|
if (!this.ivyDeclarationTransforms.has(sf)) {
|
|
@@ -2869,7 +3164,7 @@ var DtsTransformRegistry = class {
|
|
|
2869
3164
|
if (!sf.isDeclarationFile) {
|
|
2870
3165
|
return null;
|
|
2871
3166
|
}
|
|
2872
|
-
const originalSf =
|
|
3167
|
+
const originalSf = ts14.getOriginalNode(sf);
|
|
2873
3168
|
let transforms = null;
|
|
2874
3169
|
if (this.ivyDeclarationTransforms.has(originalSf)) {
|
|
2875
3170
|
transforms = [];
|
|
@@ -2882,7 +3177,7 @@ function declarationTransformFactory(transformRegistry, importRewriter, importPr
|
|
|
2882
3177
|
return (context) => {
|
|
2883
3178
|
const transformer = new DtsTransformer(context, importRewriter, importPrefix);
|
|
2884
3179
|
return (fileOrBundle) => {
|
|
2885
|
-
if (
|
|
3180
|
+
if (ts14.isBundle(fileOrBundle)) {
|
|
2886
3181
|
return fileOrBundle;
|
|
2887
3182
|
}
|
|
2888
3183
|
const transforms = transformRegistry.getAllTransforms(fileOrBundle);
|
|
@@ -2902,15 +3197,15 @@ var DtsTransformer = class {
|
|
|
2902
3197
|
transform(sf, transforms) {
|
|
2903
3198
|
const imports = new ImportManager(this.importRewriter, this.importPrefix);
|
|
2904
3199
|
const visitor = (node) => {
|
|
2905
|
-
if (
|
|
3200
|
+
if (ts14.isClassDeclaration(node)) {
|
|
2906
3201
|
return this.transformClassDeclaration(node, transforms, imports);
|
|
2907
|
-
} else if (
|
|
3202
|
+
} else if (ts14.isFunctionDeclaration(node)) {
|
|
2908
3203
|
return this.transformFunctionDeclaration(node, transforms, imports);
|
|
2909
3204
|
} else {
|
|
2910
|
-
return
|
|
3205
|
+
return ts14.visitEachChild(node, visitor, this.ctx);
|
|
2911
3206
|
}
|
|
2912
3207
|
};
|
|
2913
|
-
sf =
|
|
3208
|
+
sf = ts14.visitNode(sf, visitor);
|
|
2914
3209
|
return addImports(imports, sf);
|
|
2915
3210
|
}
|
|
2916
3211
|
transformClassDeclaration(clazz, transforms, imports) {
|
|
@@ -2938,7 +3233,7 @@ var DtsTransformer = class {
|
|
|
2938
3233
|
}
|
|
2939
3234
|
}
|
|
2940
3235
|
if (elementsChanged && clazz === newClazz) {
|
|
2941
|
-
newClazz =
|
|
3236
|
+
newClazz = ts14.updateClassDeclaration(clazz, clazz.decorators, clazz.modifiers, clazz.name, clazz.typeParameters, clazz.heritageClauses, elements);
|
|
2942
3237
|
}
|
|
2943
3238
|
return newClazz;
|
|
2944
3239
|
}
|
|
@@ -2954,44 +3249,44 @@ var DtsTransformer = class {
|
|
|
2954
3249
|
};
|
|
2955
3250
|
var IvyDeclarationDtsTransform = class {
|
|
2956
3251
|
constructor() {
|
|
2957
|
-
this.declarationFields = new Map();
|
|
3252
|
+
this.declarationFields = /* @__PURE__ */ new Map();
|
|
2958
3253
|
}
|
|
2959
3254
|
addFields(decl, fields) {
|
|
2960
3255
|
this.declarationFields.set(decl, fields);
|
|
2961
3256
|
}
|
|
2962
3257
|
transformClass(clazz, members, imports) {
|
|
2963
|
-
const original =
|
|
3258
|
+
const original = ts14.getOriginalNode(clazz);
|
|
2964
3259
|
if (!this.declarationFields.has(original)) {
|
|
2965
3260
|
return clazz;
|
|
2966
3261
|
}
|
|
2967
3262
|
const fields = this.declarationFields.get(original);
|
|
2968
3263
|
const newMembers = fields.map((decl) => {
|
|
2969
|
-
const modifiers = [
|
|
3264
|
+
const modifiers = [ts14.createModifier(ts14.SyntaxKind.StaticKeyword)];
|
|
2970
3265
|
const typeRef = translateType(decl.type, imports);
|
|
2971
3266
|
markForEmitAsSingleLine(typeRef);
|
|
2972
|
-
return
|
|
3267
|
+
return ts14.createProperty(void 0, modifiers, decl.name, void 0, typeRef, void 0);
|
|
2973
3268
|
});
|
|
2974
|
-
return
|
|
3269
|
+
return ts14.updateClassDeclaration(clazz, clazz.decorators, clazz.modifiers, clazz.name, clazz.typeParameters, clazz.heritageClauses, [...members, ...newMembers]);
|
|
2975
3270
|
}
|
|
2976
3271
|
};
|
|
2977
3272
|
function markForEmitAsSingleLine(node) {
|
|
2978
|
-
|
|
2979
|
-
|
|
3273
|
+
ts14.setEmitFlags(node, ts14.EmitFlags.SingleLine);
|
|
3274
|
+
ts14.forEachChild(node, markForEmitAsSingleLine);
|
|
2980
3275
|
}
|
|
2981
3276
|
|
|
2982
|
-
// bazel-out/
|
|
3277
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
2983
3278
|
import { ConstantPool } from "@angular/compiler";
|
|
2984
|
-
import
|
|
3279
|
+
import ts16 from "typescript";
|
|
2985
3280
|
|
|
2986
|
-
// bazel-out/
|
|
2987
|
-
import
|
|
3281
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
|
|
3282
|
+
import ts15 from "typescript";
|
|
2988
3283
|
function visit(node, visitor, context) {
|
|
2989
3284
|
return visitor._visit(node, context);
|
|
2990
3285
|
}
|
|
2991
3286
|
var Visitor = class {
|
|
2992
3287
|
constructor() {
|
|
2993
|
-
this._before = new Map();
|
|
2994
|
-
this._after = new Map();
|
|
3288
|
+
this._before = /* @__PURE__ */ new Map();
|
|
3289
|
+
this._after = /* @__PURE__ */ new Map();
|
|
2995
3290
|
}
|
|
2996
3291
|
_visitListEntryNode(node, visitor) {
|
|
2997
3292
|
const result = visitor(node);
|
|
@@ -3008,8 +3303,8 @@ var Visitor = class {
|
|
|
3008
3303
|
}
|
|
3009
3304
|
_visit(node, context) {
|
|
3010
3305
|
let visitedNode = null;
|
|
3011
|
-
node =
|
|
3012
|
-
if (
|
|
3306
|
+
node = ts15.visitEachChild(node, (child) => this._visit(child, context), context);
|
|
3307
|
+
if (ts15.isClassDeclaration(node)) {
|
|
3013
3308
|
visitedNode = this._visitListEntryNode(node, (node2) => this.visitClassDeclaration(node2));
|
|
3014
3309
|
} else {
|
|
3015
3310
|
visitedNode = this.visitOtherNode(node);
|
|
@@ -3023,7 +3318,7 @@ var Visitor = class {
|
|
|
3023
3318
|
if (node.statements.every((stmt) => !this._before.has(stmt) && !this._after.has(stmt))) {
|
|
3024
3319
|
return node;
|
|
3025
3320
|
}
|
|
3026
|
-
const clone =
|
|
3321
|
+
const clone = ts15.getMutableClone(node);
|
|
3027
3322
|
const newStatements = [];
|
|
3028
3323
|
clone.statements.forEach((stmt) => {
|
|
3029
3324
|
if (this._before.has(stmt)) {
|
|
@@ -3036,7 +3331,7 @@ var Visitor = class {
|
|
|
3036
3331
|
this._after.delete(stmt);
|
|
3037
3332
|
}
|
|
3038
3333
|
});
|
|
3039
|
-
clone.statements =
|
|
3334
|
+
clone.statements = ts15.createNodeArray(newStatements, node.statements.hasTrailingComma);
|
|
3040
3335
|
return clone;
|
|
3041
3336
|
}
|
|
3042
3337
|
};
|
|
@@ -3045,8 +3340,8 @@ function hasStatements(node) {
|
|
|
3045
3340
|
return block.statements !== void 0 && Array.isArray(block.statements);
|
|
3046
3341
|
}
|
|
3047
3342
|
|
|
3048
|
-
// bazel-out/
|
|
3049
|
-
var NO_DECORATORS = new Set();
|
|
3343
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
3344
|
+
var NO_DECORATORS = /* @__PURE__ */ new Set();
|
|
3050
3345
|
var CLOSURE_FILE_OVERVIEW_REGEXP = /\s+@fileoverview\s+/i;
|
|
3051
3346
|
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, perf, isCore, isClosureCompilerEnabled) {
|
|
3052
3347
|
const recordWrappedNode = createRecorderFn(defaultImportTracker);
|
|
@@ -3061,7 +3356,7 @@ var IvyCompilationVisitor = class extends Visitor {
|
|
|
3061
3356
|
super();
|
|
3062
3357
|
this.compilation = compilation;
|
|
3063
3358
|
this.constantPool = constantPool;
|
|
3064
|
-
this.classCompilationMap = new Map();
|
|
3359
|
+
this.classCompilationMap = /* @__PURE__ */ new Map();
|
|
3065
3360
|
}
|
|
3066
3361
|
visitClassDeclaration(node) {
|
|
3067
3362
|
const result = this.compilation.compile(node, this.constantPool);
|
|
@@ -3094,14 +3389,14 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
3094
3389
|
const members = [...node.members];
|
|
3095
3390
|
for (const field of this.classCompilationMap.get(node)) {
|
|
3096
3391
|
const exprNode = translateExpression(field.initializer, this.importManager, translateOptions);
|
|
3097
|
-
const property =
|
|
3392
|
+
const property = ts16.createProperty(void 0, [ts16.createToken(ts16.SyntaxKind.StaticKeyword)], field.name, void 0, void 0, exprNode);
|
|
3098
3393
|
if (this.isClosureCompilerEnabled) {
|
|
3099
|
-
|
|
3394
|
+
ts16.addSyntheticLeadingComment(property, ts16.SyntaxKind.MultiLineCommentTrivia, "* @nocollapse ", false);
|
|
3100
3395
|
}
|
|
3101
3396
|
field.statements.map((stmt) => translateStatement(stmt, this.importManager, translateOptions)).forEach((stmt) => statements.push(stmt));
|
|
3102
3397
|
members.push(property);
|
|
3103
3398
|
}
|
|
3104
|
-
node =
|
|
3399
|
+
node = ts16.updateClassDeclaration(node, maybeFilterDecorator(node.decorators, this.compilation.decoratorsFor(node)), node.modifiers, node.name, node.typeParameters, node.heritageClauses || [], members.map((member) => this._stripAngularDecorators(member)));
|
|
3105
3400
|
return { node, after: statements };
|
|
3106
3401
|
}
|
|
3107
3402
|
_angularCoreDecorators(decl) {
|
|
@@ -3130,25 +3425,25 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
3130
3425
|
if (filtered.length === 0) {
|
|
3131
3426
|
return void 0;
|
|
3132
3427
|
}
|
|
3133
|
-
const array =
|
|
3428
|
+
const array = ts16.createNodeArray(filtered);
|
|
3134
3429
|
array.pos = node.decorators.pos;
|
|
3135
3430
|
array.end = node.decorators.end;
|
|
3136
3431
|
return array;
|
|
3137
3432
|
}
|
|
3138
3433
|
_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 (
|
|
3434
|
+
if (ts16.isParameter(node)) {
|
|
3435
|
+
node = ts16.updateParameter(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer);
|
|
3436
|
+
} else if (ts16.isMethodDeclaration(node) && node.decorators !== void 0) {
|
|
3437
|
+
node = ts16.updateMethod(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body);
|
|
3438
|
+
} else if (ts16.isPropertyDeclaration(node) && node.decorators !== void 0) {
|
|
3439
|
+
node = ts16.updateProperty(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.questionToken, node.type, node.initializer);
|
|
3440
|
+
} else if (ts16.isGetAccessor(node)) {
|
|
3441
|
+
node = ts16.updateGetAccessor(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.parameters, node.type, node.body);
|
|
3442
|
+
} else if (ts16.isSetAccessor(node)) {
|
|
3443
|
+
node = ts16.updateSetAccessor(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.parameters, node.body);
|
|
3444
|
+
} else if (ts16.isConstructorDeclaration(node)) {
|
|
3150
3445
|
const parameters = node.parameters.map((param) => this._stripAngularDecorators(param));
|
|
3151
|
-
node =
|
|
3446
|
+
node = ts16.updateConstructor(node, node.decorators, node.modifiers, parameters, node.body);
|
|
3152
3447
|
}
|
|
3153
3448
|
return node;
|
|
3154
3449
|
}
|
|
@@ -3160,7 +3455,7 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
3160
3455
|
visit(file, compilationVisitor, context);
|
|
3161
3456
|
const transformationVisitor = new IvyTransformationVisitor(compilation, compilationVisitor.classCompilationMap, reflector, importManager, recordWrappedNode, isClosureCompilerEnabled, isCore);
|
|
3162
3457
|
let sf = visit(file, transformationVisitor, context);
|
|
3163
|
-
const downlevelTranslatedCode = getLocalizeCompileTarget(context) <
|
|
3458
|
+
const downlevelTranslatedCode = getLocalizeCompileTarget(context) < ts16.ScriptTarget.ES2015;
|
|
3164
3459
|
const constants = constantPool.statements.map((stmt) => translateStatement(stmt, importManager, {
|
|
3165
3460
|
recordWrappedNode,
|
|
3166
3461
|
downlevelTaggedTemplates: downlevelTranslatedCode,
|
|
@@ -3175,17 +3470,17 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
3175
3470
|
return sf;
|
|
3176
3471
|
}
|
|
3177
3472
|
function getLocalizeCompileTarget(context) {
|
|
3178
|
-
const target = context.getCompilerOptions().target ||
|
|
3179
|
-
return target !==
|
|
3473
|
+
const target = context.getCompilerOptions().target || ts16.ScriptTarget.ES2015;
|
|
3474
|
+
return target !== ts16.ScriptTarget.JSON ? target : ts16.ScriptTarget.ES2015;
|
|
3180
3475
|
}
|
|
3181
3476
|
function getFileOverviewComment(statements) {
|
|
3182
3477
|
if (statements.length > 0) {
|
|
3183
3478
|
const host = statements[0];
|
|
3184
3479
|
let trailing = false;
|
|
3185
|
-
let comments =
|
|
3480
|
+
let comments = ts16.getSyntheticLeadingComments(host);
|
|
3186
3481
|
if (!comments || comments.length === 0) {
|
|
3187
3482
|
trailing = true;
|
|
3188
|
-
comments =
|
|
3483
|
+
comments = ts16.getSyntheticTrailingComments(host);
|
|
3189
3484
|
}
|
|
3190
3485
|
if (comments && comments.length > 0 && CLOSURE_FILE_OVERVIEW_REGEXP.test(comments[0].text)) {
|
|
3191
3486
|
return { comments, host, trailing };
|
|
@@ -3197,22 +3492,22 @@ function setFileOverviewComment(sf, fileoverview) {
|
|
|
3197
3492
|
const { comments, host, trailing } = fileoverview;
|
|
3198
3493
|
if (sf.statements.length > 0 && host !== sf.statements[0]) {
|
|
3199
3494
|
if (trailing) {
|
|
3200
|
-
|
|
3495
|
+
ts16.setSyntheticTrailingComments(host, void 0);
|
|
3201
3496
|
} else {
|
|
3202
|
-
|
|
3497
|
+
ts16.setSyntheticLeadingComments(host, void 0);
|
|
3203
3498
|
}
|
|
3204
|
-
|
|
3499
|
+
ts16.setSyntheticLeadingComments(sf.statements[0], comments);
|
|
3205
3500
|
}
|
|
3206
3501
|
}
|
|
3207
3502
|
function maybeFilterDecorator(decorators, toRemove) {
|
|
3208
3503
|
if (decorators === void 0) {
|
|
3209
3504
|
return void 0;
|
|
3210
3505
|
}
|
|
3211
|
-
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) =>
|
|
3506
|
+
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) => ts16.getOriginalNode(dec) === decToRemove) === void 0);
|
|
3212
3507
|
if (filtered.length === 0) {
|
|
3213
3508
|
return void 0;
|
|
3214
3509
|
}
|
|
3215
|
-
return
|
|
3510
|
+
return ts16.createNodeArray(filtered);
|
|
3216
3511
|
}
|
|
3217
3512
|
function isFromAngularCore(decorator) {
|
|
3218
3513
|
return decorator.import !== null && decorator.import.from === "@angular/core";
|
|
@@ -3226,8 +3521,8 @@ function createRecorderFn(defaultImportTracker) {
|
|
|
3226
3521
|
};
|
|
3227
3522
|
}
|
|
3228
3523
|
|
|
3229
|
-
// bazel-out/
|
|
3230
|
-
import
|
|
3524
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/diagnostics.mjs
|
|
3525
|
+
import ts17 from "typescript";
|
|
3231
3526
|
function createValueHasWrongTypeError(node, value, messageText) {
|
|
3232
3527
|
var _a;
|
|
3233
3528
|
let chainedMessage;
|
|
@@ -3245,11 +3540,11 @@ function createValueHasWrongTypeError(node, value, messageText) {
|
|
|
3245
3540
|
}
|
|
3246
3541
|
const chain = {
|
|
3247
3542
|
messageText,
|
|
3248
|
-
category:
|
|
3543
|
+
category: ts17.DiagnosticCategory.Error,
|
|
3249
3544
|
code: 0,
|
|
3250
3545
|
next: [{
|
|
3251
3546
|
messageText: chainedMessage,
|
|
3252
|
-
category:
|
|
3547
|
+
category: ts17.DiagnosticCategory.Message,
|
|
3253
3548
|
code: 0
|
|
3254
3549
|
}]
|
|
3255
3550
|
};
|
|
@@ -3323,11 +3618,11 @@ function getInheritedUndecoratedCtorDiagnostic(node, baseClass, reader) {
|
|
|
3323
3618
|
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
3619
|
}
|
|
3325
3620
|
|
|
3326
|
-
// bazel-out/
|
|
3621
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
|
|
3327
3622
|
import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, createMayBeForwardRefExpression, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr3, FactoryTarget, getSafePropertyAccessString, makeBindingParser, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr3 } from "@angular/compiler";
|
|
3328
|
-
import
|
|
3623
|
+
import ts19 from "typescript";
|
|
3329
3624
|
|
|
3330
|
-
// bazel-out/
|
|
3625
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/factory.mjs
|
|
3331
3626
|
import { compileDeclareFactoryFunction, compileFactoryFunction } from "@angular/compiler";
|
|
3332
3627
|
function compileNgFactoryDefField(metadata) {
|
|
3333
3628
|
const res = compileFactoryFunction(metadata);
|
|
@@ -3338,9 +3633,9 @@ function compileDeclareFactory(metadata) {
|
|
|
3338
3633
|
return { name: "\u0275fac", initializer: res.expression, statements: res.statements, type: res.type };
|
|
3339
3634
|
}
|
|
3340
3635
|
|
|
3341
|
-
// bazel-out/
|
|
3636
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/metadata.mjs
|
|
3342
3637
|
import { FunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
|
|
3343
|
-
import
|
|
3638
|
+
import ts18 from "typescript";
|
|
3344
3639
|
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
|
|
3345
3640
|
if (!reflection.isClass(clazz)) {
|
|
3346
3641
|
return null;
|
|
@@ -3354,7 +3649,7 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
3354
3649
|
if (ngClassDecorators.length === 0) {
|
|
3355
3650
|
return null;
|
|
3356
3651
|
}
|
|
3357
|
-
const metaDecorators = new WrappedNodeExpr2(
|
|
3652
|
+
const metaDecorators = new WrappedNodeExpr2(ts18.createArrayLiteral(ngClassDecorators));
|
|
3358
3653
|
let metaCtorParameters = null;
|
|
3359
3654
|
const classCtorParameters = reflection.getConstructorParameters(clazz);
|
|
3360
3655
|
if (classCtorParameters !== null) {
|
|
@@ -3374,7 +3669,7 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
3374
3669
|
return classMemberToMetadata((_a = member.nameNode) != null ? _a : member.name, member.decorators, isCore);
|
|
3375
3670
|
});
|
|
3376
3671
|
if (decoratedMembers.length > 0) {
|
|
3377
|
-
metaPropDecorators = new WrappedNodeExpr2(
|
|
3672
|
+
metaPropDecorators = new WrappedNodeExpr2(ts18.createObjectLiteral(decoratedMembers));
|
|
3378
3673
|
}
|
|
3379
3674
|
return {
|
|
3380
3675
|
type: new WrappedNodeExpr2(id),
|
|
@@ -3390,43 +3685,43 @@ function ctorParameterToMetadata(param, isCore) {
|
|
|
3390
3685
|
];
|
|
3391
3686
|
if (param.decorators !== null) {
|
|
3392
3687
|
const ngDecorators = param.decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
3393
|
-
const value = new WrappedNodeExpr2(
|
|
3688
|
+
const value = new WrappedNodeExpr2(ts18.createArrayLiteral(ngDecorators));
|
|
3394
3689
|
mapEntries.push({ key: "decorators", value, quoted: false });
|
|
3395
3690
|
}
|
|
3396
3691
|
return literalMap(mapEntries);
|
|
3397
3692
|
}
|
|
3398
3693
|
function classMemberToMetadata(name, decorators, isCore) {
|
|
3399
3694
|
const ngDecorators = decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
3400
|
-
const decoratorMeta =
|
|
3401
|
-
return
|
|
3695
|
+
const decoratorMeta = ts18.createArrayLiteral(ngDecorators);
|
|
3696
|
+
return ts18.createPropertyAssignment(name, decoratorMeta);
|
|
3402
3697
|
}
|
|
3403
3698
|
function decoratorToMetadata(decorator, wrapFunctionsInParens) {
|
|
3404
3699
|
if (decorator.identifier === null) {
|
|
3405
3700
|
throw new Error("Illegal state: synthesized decorator cannot be emitted in class metadata.");
|
|
3406
3701
|
}
|
|
3407
3702
|
const properties = [
|
|
3408
|
-
|
|
3703
|
+
ts18.createPropertyAssignment("type", ts18.getMutableClone(decorator.identifier))
|
|
3409
3704
|
];
|
|
3410
3705
|
if (decorator.args !== null && decorator.args.length > 0) {
|
|
3411
3706
|
const args = decorator.args.map((arg) => {
|
|
3412
|
-
const expr =
|
|
3707
|
+
const expr = ts18.getMutableClone(arg);
|
|
3413
3708
|
return wrapFunctionsInParens ? wrapFunctionExpressionsInParens(expr) : expr;
|
|
3414
3709
|
});
|
|
3415
|
-
properties.push(
|
|
3710
|
+
properties.push(ts18.createPropertyAssignment("args", ts18.createArrayLiteral(args)));
|
|
3416
3711
|
}
|
|
3417
|
-
return
|
|
3712
|
+
return ts18.createObjectLiteral(properties, true);
|
|
3418
3713
|
}
|
|
3419
3714
|
function isAngularDecorator2(decorator, isCore) {
|
|
3420
3715
|
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
3421
3716
|
}
|
|
3422
3717
|
function removeIdentifierReferences(node, name) {
|
|
3423
|
-
const result =
|
|
3424
|
-
return
|
|
3718
|
+
const result = ts18.transform(node, [(context) => (root) => ts18.visitNode(root, function walk(current) {
|
|
3719
|
+
return ts18.isIdentifier(current) && current.text === name ? ts18.createIdentifier(current.text) : ts18.visitEachChild(current, walk, context);
|
|
3425
3720
|
})]);
|
|
3426
3721
|
return result.transformed[0];
|
|
3427
3722
|
}
|
|
3428
3723
|
|
|
3429
|
-
// bazel-out/
|
|
3724
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
|
|
3430
3725
|
var EMPTY_OBJECT = {};
|
|
3431
3726
|
var FIELD_DECORATORS = [
|
|
3432
3727
|
"Input",
|
|
@@ -3438,7 +3733,7 @@ var FIELD_DECORATORS = [
|
|
|
3438
3733
|
"HostBinding",
|
|
3439
3734
|
"HostListener"
|
|
3440
3735
|
];
|
|
3441
|
-
var LIFECYCLE_HOOKS = new Set([
|
|
3736
|
+
var LIFECYCLE_HOOKS = /* @__PURE__ */ new Set([
|
|
3442
3737
|
"ngOnChanges",
|
|
3443
3738
|
"ngOnInit",
|
|
3444
3739
|
"ngOnDestroy",
|
|
@@ -3595,7 +3890,8 @@ var DirectiveDecoratorHandler = class {
|
|
|
3595
3890
|
baseClass: analysis.baseClass
|
|
3596
3891
|
}, analysis.typeCheckMeta), {
|
|
3597
3892
|
isPoisoned: analysis.isPoisoned,
|
|
3598
|
-
isStructural: analysis.isStructural
|
|
3893
|
+
isStructural: analysis.isStructural,
|
|
3894
|
+
animationTriggerNames: null
|
|
3599
3895
|
}));
|
|
3600
3896
|
this.injectableRegistry.registerInjectable(node);
|
|
3601
3897
|
}
|
|
@@ -3641,12 +3937,12 @@ var DirectiveDecoratorHandler = class {
|
|
|
3641
3937
|
function extractDirectiveMetadata(clazz, decorator, reflector, evaluator, isCore, flags, annotateForClosureCompiler, defaultSelector = null) {
|
|
3642
3938
|
let directive;
|
|
3643
3939
|
if (decorator === null || decorator.args === null || decorator.args.length === 0) {
|
|
3644
|
-
directive = new Map();
|
|
3940
|
+
directive = /* @__PURE__ */ new Map();
|
|
3645
3941
|
} else if (decorator.args.length !== 1) {
|
|
3646
3942
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @${decorator.name} decorator`);
|
|
3647
3943
|
} else {
|
|
3648
3944
|
const meta = unwrapExpression(decorator.args[0]);
|
|
3649
|
-
if (!
|
|
3945
|
+
if (!ts19.isObjectLiteralExpression(meta)) {
|
|
3650
3946
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `@${decorator.name} argument must be an object literal`);
|
|
3651
3947
|
}
|
|
3652
3948
|
directive = reflectObjectLiteral(meta);
|
|
@@ -3757,7 +4053,7 @@ function extractQueryMetadata(exprNode, name, args, propertyName, reflector, eva
|
|
|
3757
4053
|
let emitDistinctChangesOnly = emitDistinctChangesOnlyDefaultValue;
|
|
3758
4054
|
if (args.length === 2) {
|
|
3759
4055
|
const optionsExpr = unwrapExpression(args[1]);
|
|
3760
|
-
if (!
|
|
4056
|
+
if (!ts19.isObjectLiteralExpression(optionsExpr)) {
|
|
3761
4057
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, optionsExpr, `@${name} options must be an object literal`);
|
|
3762
4058
|
}
|
|
3763
4059
|
const options = reflectObjectLiteral(optionsExpr);
|
|
@@ -3802,16 +4098,16 @@ function extractQueryMetadata(exprNode, name, args, propertyName, reflector, eva
|
|
|
3802
4098
|
}
|
|
3803
4099
|
function extractQueriesFromDecorator(queryData, reflector, evaluator, isCore) {
|
|
3804
4100
|
const content = [], view = [];
|
|
3805
|
-
if (!
|
|
4101
|
+
if (!ts19.isObjectLiteralExpression(queryData)) {
|
|
3806
4102
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator queries metadata must be an object literal");
|
|
3807
4103
|
}
|
|
3808
4104
|
reflectObjectLiteral(queryData).forEach((queryExpr, propertyName) => {
|
|
3809
4105
|
queryExpr = unwrapExpression(queryExpr);
|
|
3810
|
-
if (!
|
|
4106
|
+
if (!ts19.isNewExpression(queryExpr)) {
|
|
3811
4107
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
3812
4108
|
}
|
|
3813
|
-
const queryType =
|
|
3814
|
-
if (!
|
|
4109
|
+
const queryType = ts19.isPropertyAccessExpression(queryExpr.expression) ? queryExpr.expression.name : queryExpr.expression;
|
|
4110
|
+
if (!ts19.isIdentifier(queryType)) {
|
|
3815
4111
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
3816
4112
|
}
|
|
3817
4113
|
const type = reflector.getImportOfIdentifier(queryType);
|
|
@@ -3981,16 +4277,16 @@ function extractHostBindings(members, evaluator, coreModule, metadata) {
|
|
|
3981
4277
|
});
|
|
3982
4278
|
return bindings;
|
|
3983
4279
|
}
|
|
3984
|
-
var QUERY_TYPES = new Set([
|
|
4280
|
+
var QUERY_TYPES = /* @__PURE__ */ new Set([
|
|
3985
4281
|
"ContentChild",
|
|
3986
4282
|
"ContentChildren",
|
|
3987
4283
|
"ViewChild",
|
|
3988
4284
|
"ViewChildren"
|
|
3989
4285
|
]);
|
|
3990
4286
|
|
|
3991
|
-
// bazel-out/
|
|
4287
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/ng_module.mjs
|
|
3992
4288
|
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
|
|
4289
|
+
import ts20 from "typescript";
|
|
3994
4290
|
var NgModuleSymbol = class extends SemanticSymbol {
|
|
3995
4291
|
constructor() {
|
|
3996
4292
|
super(...arguments);
|
|
@@ -4073,8 +4369,8 @@ var NgModuleDecoratorHandler = class {
|
|
|
4073
4369
|
if (decorator.args === null || decorator.args.length > 1) {
|
|
4074
4370
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @NgModule decorator`);
|
|
4075
4371
|
}
|
|
4076
|
-
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) :
|
|
4077
|
-
if (!
|
|
4372
|
+
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) : ts20.createObjectLiteral([]);
|
|
4373
|
+
if (!ts20.isObjectLiteralExpression(meta)) {
|
|
4078
4374
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@NgModule argument must be an object literal");
|
|
4079
4375
|
}
|
|
4080
4376
|
const ngModule = reflectObjectLiteral(meta);
|
|
@@ -4155,10 +4451,10 @@ var NgModuleDecoratorHandler = class {
|
|
|
4155
4451
|
if (typeNode !== null) {
|
|
4156
4452
|
typeContext = typeNode.getSourceFile();
|
|
4157
4453
|
}
|
|
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));
|
|
4454
|
+
const bootstrap = bootstrapRefs.map((bootstrap2) => this._toR3Reference(bootstrap2.getOriginForDiagnostics(meta, node.name), bootstrap2, valueContext, typeContext));
|
|
4455
|
+
const declarations = declarationRefs.map((decl) => this._toR3Reference(decl.getOriginForDiagnostics(meta, node.name), decl, valueContext, typeContext));
|
|
4456
|
+
const imports = importRefs.map((imp) => this._toR3Reference(imp.getOriginForDiagnostics(meta, node.name), imp, valueContext, typeContext));
|
|
4457
|
+
const exports = exportRefs.map((exp) => this._toR3Reference(exp.getOriginForDiagnostics(meta, node.name), exp, valueContext, typeContext));
|
|
4162
4458
|
const isForwardReference = (ref) => isExpressionForwardReference(ref.value, node.name, valueContext);
|
|
4163
4459
|
const containsForwardDecls = bootstrap.some(isForwardReference) || declarations.some(isForwardReference) || imports.some(isForwardReference) || exports.some(isForwardReference);
|
|
4164
4460
|
const type = wrapTypeReference(this.reflector, node);
|
|
@@ -4254,7 +4550,9 @@ var NgModuleDecoratorHandler = class {
|
|
|
4254
4550
|
const context = getSourceFile(node);
|
|
4255
4551
|
for (const exportRef of analysis.exports) {
|
|
4256
4552
|
if (isNgModule(exportRef.node, scope.compilation)) {
|
|
4257
|
-
|
|
4553
|
+
const type = this.refEmitter.emit(exportRef, context);
|
|
4554
|
+
assertSuccessfulReferenceEmit(type, node, "NgModule");
|
|
4555
|
+
data.injectorImports.push(type.expression);
|
|
4258
4556
|
}
|
|
4259
4557
|
}
|
|
4260
4558
|
for (const decl of analysis.declarations) {
|
|
@@ -4307,11 +4605,21 @@ var NgModuleDecoratorHandler = class {
|
|
|
4307
4605
|
for (const decl of declarations) {
|
|
4308
4606
|
const remoteScope = this.scopeRegistry.getRemoteScope(decl.node);
|
|
4309
4607
|
if (remoteScope !== null) {
|
|
4310
|
-
const directives = remoteScope.directives.map((directive) =>
|
|
4311
|
-
|
|
4608
|
+
const directives = remoteScope.directives.map((directive) => {
|
|
4609
|
+
const type = this.refEmitter.emit(directive, context);
|
|
4610
|
+
assertSuccessfulReferenceEmit(type, node, "directive");
|
|
4611
|
+
return type.expression;
|
|
4612
|
+
});
|
|
4613
|
+
const pipes = remoteScope.pipes.map((pipe) => {
|
|
4614
|
+
const type = this.refEmitter.emit(pipe, context);
|
|
4615
|
+
assertSuccessfulReferenceEmit(type, node, "pipe");
|
|
4616
|
+
return type.expression;
|
|
4617
|
+
});
|
|
4312
4618
|
const directiveArray = new LiteralArrayExpr2(directives);
|
|
4313
4619
|
const pipesArray = new LiteralArrayExpr2(pipes);
|
|
4314
|
-
const
|
|
4620
|
+
const componentType = this.refEmitter.emit(decl, context);
|
|
4621
|
+
assertSuccessfulReferenceEmit(componentType, node, "component");
|
|
4622
|
+
const declExpr = componentType.expression;
|
|
4315
4623
|
const setComponentScope = new ExternalExpr4(R3Identifiers.setComponentScope);
|
|
4316
4624
|
const callExpr = new InvokeFunctionExpr(setComponentScope, [declExpr, directiveArray, pipesArray]);
|
|
4317
4625
|
ngModuleStatements.push(callExpr.toStmt());
|
|
@@ -4336,16 +4644,16 @@ var NgModuleDecoratorHandler = class {
|
|
|
4336
4644
|
];
|
|
4337
4645
|
return res;
|
|
4338
4646
|
}
|
|
4339
|
-
_toR3Reference(valueRef, valueContext, typeContext) {
|
|
4647
|
+
_toR3Reference(origin, valueRef, valueContext, typeContext) {
|
|
4340
4648
|
if (valueRef.hasOwningModuleGuess) {
|
|
4341
|
-
return toR3Reference(valueRef, valueRef, valueContext, valueContext, this.refEmitter);
|
|
4649
|
+
return toR3Reference(origin, valueRef, valueRef, valueContext, valueContext, this.refEmitter);
|
|
4342
4650
|
} else {
|
|
4343
4651
|
let typeRef = valueRef;
|
|
4344
4652
|
let typeNode = this.reflector.getDtsDeclaration(typeRef.node);
|
|
4345
4653
|
if (typeNode !== null && isNamedClassDeclaration(typeNode)) {
|
|
4346
4654
|
typeRef = new Reference(typeNode);
|
|
4347
4655
|
}
|
|
4348
|
-
return toR3Reference(valueRef, typeRef, valueContext, typeContext, this.refEmitter);
|
|
4656
|
+
return toR3Reference(origin, valueRef, typeRef, valueContext, typeContext, this.refEmitter);
|
|
4349
4657
|
}
|
|
4350
4658
|
}
|
|
4351
4659
|
_extractModuleFromModuleWithProvidersFn(node) {
|
|
@@ -4353,10 +4661,10 @@ var NgModuleDecoratorHandler = class {
|
|
|
4353
4661
|
return type && (this._reflectModuleFromTypeParam(type, node) || this._reflectModuleFromLiteralType(type));
|
|
4354
4662
|
}
|
|
4355
4663
|
_reflectModuleFromTypeParam(type, node) {
|
|
4356
|
-
if (!
|
|
4664
|
+
if (!ts20.isTypeReferenceNode(type)) {
|
|
4357
4665
|
return null;
|
|
4358
4666
|
}
|
|
4359
|
-
const typeName = type && (
|
|
4667
|
+
const typeName = type && (ts20.isIdentifier(type.typeName) && type.typeName || ts20.isQualifiedName(type.typeName) && type.typeName.right) || null;
|
|
4360
4668
|
if (typeName === null) {
|
|
4361
4669
|
return null;
|
|
4362
4670
|
}
|
|
@@ -4368,7 +4676,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
4368
4676
|
return null;
|
|
4369
4677
|
}
|
|
4370
4678
|
if (type.typeArguments === void 0 || type.typeArguments.length !== 1) {
|
|
4371
|
-
const parent =
|
|
4679
|
+
const parent = ts20.isMethodDeclaration(node) && ts20.isClassDeclaration(node.parent) ? node.parent : null;
|
|
4372
4680
|
const symbolName = (parent && parent.name ? parent.name.getText() + "." : "") + (node.name ? node.name.getText() : "anonymous");
|
|
4373
4681
|
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
4682
|
}
|
|
@@ -4376,13 +4684,13 @@ var NgModuleDecoratorHandler = class {
|
|
|
4376
4684
|
return typeNodeToValueExpr(arg);
|
|
4377
4685
|
}
|
|
4378
4686
|
_reflectModuleFromLiteralType(type) {
|
|
4379
|
-
if (!
|
|
4687
|
+
if (!ts20.isIntersectionTypeNode(type)) {
|
|
4380
4688
|
return null;
|
|
4381
4689
|
}
|
|
4382
4690
|
for (const t of type.types) {
|
|
4383
|
-
if (
|
|
4691
|
+
if (ts20.isTypeLiteralNode(t)) {
|
|
4384
4692
|
for (const m of t.members) {
|
|
4385
|
-
const ngModuleType =
|
|
4693
|
+
const ngModuleType = ts20.isPropertySignature(m) && ts20.isIdentifier(m.name) && m.name.text === "ngModule" && m.type || null;
|
|
4386
4694
|
const ngModuleExpression = ngModuleType && typeNodeToValueExpr(ngModuleType);
|
|
4387
4695
|
if (ngModuleExpression) {
|
|
4388
4696
|
return ngModuleExpression;
|
|
@@ -4422,8 +4730,8 @@ function isNgModule(node, compilation) {
|
|
|
4422
4730
|
return !compilation.directives.some((directive) => directive.ref.node === node) && !compilation.pipes.some((pipe) => pipe.ref.node === node);
|
|
4423
4731
|
}
|
|
4424
4732
|
|
|
4425
|
-
// bazel-out/
|
|
4426
|
-
var EMPTY_MAP = new Map();
|
|
4733
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/component.mjs
|
|
4734
|
+
var EMPTY_MAP = /* @__PURE__ */ new Map();
|
|
4427
4735
|
var EMPTY_ARRAY = [];
|
|
4428
4736
|
var ComponentSymbol = class extends DirectiveSymbol {
|
|
4429
4737
|
constructor() {
|
|
@@ -4485,10 +4793,10 @@ var ComponentDecoratorHandler = class {
|
|
|
4485
4793
|
this.semanticDepGraphUpdater = semanticDepGraphUpdater;
|
|
4486
4794
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
4487
4795
|
this.perf = perf;
|
|
4488
|
-
this.literalCache = new Map();
|
|
4796
|
+
this.literalCache = /* @__PURE__ */ new Map();
|
|
4489
4797
|
this.elementSchemaRegistry = new DomElementSchemaRegistry();
|
|
4490
|
-
this.preanalyzeTemplateCache = new Map();
|
|
4491
|
-
this.preanalyzeStylesCache = new Map();
|
|
4798
|
+
this.preanalyzeTemplateCache = /* @__PURE__ */ new Map();
|
|
4799
|
+
this.preanalyzeStylesCache = /* @__PURE__ */ new Map();
|
|
4492
4800
|
this.precedence = HandlerPrecedence.PRIMARY;
|
|
4493
4801
|
this.name = ComponentDecoratorHandler.name;
|
|
4494
4802
|
}
|
|
@@ -4563,8 +4871,12 @@ var ComponentDecoratorHandler = class {
|
|
|
4563
4871
|
const encapsulation = (_a = this._resolveEnumValue(component, "encapsulation", "ViewEncapsulation")) != null ? _a : ViewEncapsulation.Emulated;
|
|
4564
4872
|
const changeDetection = this._resolveEnumValue(component, "changeDetection", "ChangeDetectionStrategy");
|
|
4565
4873
|
let animations = null;
|
|
4874
|
+
let animationTriggerNames = null;
|
|
4566
4875
|
if (component.has("animations")) {
|
|
4567
4876
|
animations = new WrappedNodeExpr5(component.get("animations"));
|
|
4877
|
+
const animationsValue = this.evaluator.evaluate(component.get("animations"));
|
|
4878
|
+
animationTriggerNames = { includesDynamicAnimations: false, staticTriggerNames: [] };
|
|
4879
|
+
collectAnimationNames(animationsValue, animationTriggerNames);
|
|
4568
4880
|
}
|
|
4569
4881
|
const relativeContextFilePath = this.rootDirs.reduce((previous, rootDir) => {
|
|
4570
4882
|
const candidate = relative(absoluteFrom(rootDir), absoluteFrom(containingFile));
|
|
@@ -4680,7 +4992,8 @@ var ComponentDecoratorHandler = class {
|
|
|
4680
4992
|
styles: styleResources,
|
|
4681
4993
|
template: templateResource
|
|
4682
4994
|
},
|
|
4683
|
-
isPoisoned
|
|
4995
|
+
isPoisoned,
|
|
4996
|
+
animationTriggerNames
|
|
4684
4997
|
},
|
|
4685
4998
|
diagnostics
|
|
4686
4999
|
};
|
|
@@ -4708,7 +5021,8 @@ var ComponentDecoratorHandler = class {
|
|
|
4708
5021
|
baseClass: analysis.baseClass
|
|
4709
5022
|
}, analysis.typeCheckMeta), {
|
|
4710
5023
|
isPoisoned: analysis.isPoisoned,
|
|
4711
|
-
isStructural: false
|
|
5024
|
+
isStructural: false,
|
|
5025
|
+
animationTriggerNames: analysis.animationTriggerNames
|
|
4712
5026
|
}));
|
|
4713
5027
|
this.resourceRegistry.registerResources(analysis.resources, node);
|
|
4714
5028
|
this.injectableRegistry.registerInjectable(node);
|
|
@@ -4743,7 +5057,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4743
5057
|
});
|
|
4744
5058
|
}
|
|
4745
5059
|
typeCheck(ctx, node, meta) {
|
|
4746
|
-
if (this.typeCheckScopeRegistry === null || !
|
|
5060
|
+
if (this.typeCheckScopeRegistry === null || !ts21.isClassDeclaration(node)) {
|
|
4747
5061
|
return;
|
|
4748
5062
|
}
|
|
4749
5063
|
if (meta.isPoisoned && !this.usePoisonedData) {
|
|
@@ -4781,7 +5095,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4781
5095
|
matcher.addSelectables(CssSelector.parse(dir.selector), dir);
|
|
4782
5096
|
}
|
|
4783
5097
|
}
|
|
4784
|
-
const pipes = new Map();
|
|
5098
|
+
const pipes = /* @__PURE__ */ new Map();
|
|
4785
5099
|
for (const pipe of scope.compilation.pipes) {
|
|
4786
5100
|
pipes.set(pipe.name, pipe.ref);
|
|
4787
5101
|
}
|
|
@@ -4789,6 +5103,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4789
5103
|
const bound = binder.bind({ template: metadata.template.nodes });
|
|
4790
5104
|
const usedDirectives = bound.getUsedDirectives().map((directive) => {
|
|
4791
5105
|
const type = this.refEmitter.emit(directive.ref, context);
|
|
5106
|
+
assertSuccessfulReferenceEmit(type, node.name, directive.isComponent ? "component" : "directive");
|
|
4792
5107
|
return {
|
|
4793
5108
|
ref: directive.ref,
|
|
4794
5109
|
type: type.expression,
|
|
@@ -4807,6 +5122,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4807
5122
|
}
|
|
4808
5123
|
const pipe = pipes.get(pipeName);
|
|
4809
5124
|
const type = this.refEmitter.emit(pipe, context);
|
|
5125
|
+
assertSuccessfulReferenceEmit(type, node.name, "pipe");
|
|
4810
5126
|
usedPipes.push({
|
|
4811
5127
|
ref: pipe,
|
|
4812
5128
|
pipeName,
|
|
@@ -4818,14 +5134,14 @@ var ComponentDecoratorHandler = class {
|
|
|
4818
5134
|
symbol.usedDirectives = usedDirectives.map((dir) => this.semanticDepGraphUpdater.getSemanticReference(dir.ref.node, dir.type));
|
|
4819
5135
|
symbol.usedPipes = usedPipes.map((pipe) => this.semanticDepGraphUpdater.getSemanticReference(pipe.ref.node, pipe.expression));
|
|
4820
5136
|
}
|
|
4821
|
-
const cyclesFromDirectives = new Map();
|
|
5137
|
+
const cyclesFromDirectives = /* @__PURE__ */ new Map();
|
|
4822
5138
|
for (const usedDirective of usedDirectives) {
|
|
4823
5139
|
const cycle = this._checkForCyclicImport(usedDirective.importedFile, usedDirective.type, context);
|
|
4824
5140
|
if (cycle !== null) {
|
|
4825
5141
|
cyclesFromDirectives.set(usedDirective, cycle);
|
|
4826
5142
|
}
|
|
4827
5143
|
}
|
|
4828
|
-
const cyclesFromPipes = new Map();
|
|
5144
|
+
const cyclesFromPipes = /* @__PURE__ */ new Map();
|
|
4829
5145
|
for (const usedPipe of usedPipes) {
|
|
4830
5146
|
const cycle = this._checkForCyclicImport(usedPipe.importedFile, usedPipe.expression, context);
|
|
4831
5147
|
if (cycle !== null) {
|
|
@@ -4952,17 +5268,17 @@ var ComponentDecoratorHandler = class {
|
|
|
4952
5268
|
const metadata = new Map(component);
|
|
4953
5269
|
if (metadata.has("templateUrl")) {
|
|
4954
5270
|
metadata.delete("templateUrl");
|
|
4955
|
-
metadata.set("template",
|
|
5271
|
+
metadata.set("template", ts21.createStringLiteral(template.content));
|
|
4956
5272
|
}
|
|
4957
5273
|
if (metadata.has("styleUrls")) {
|
|
4958
5274
|
metadata.delete("styleUrls");
|
|
4959
|
-
metadata.set("styles",
|
|
5275
|
+
metadata.set("styles", ts21.createArrayLiteral(styles.map((s) => ts21.createStringLiteral(s))));
|
|
4960
5276
|
}
|
|
4961
5277
|
const newMetadataFields = [];
|
|
4962
5278
|
for (const [name, value] of metadata.entries()) {
|
|
4963
|
-
newMetadataFields.push(
|
|
5279
|
+
newMetadataFields.push(ts21.createPropertyAssignment(name, value));
|
|
4964
5280
|
}
|
|
4965
|
-
return __spreadProps(__spreadValues({}, dec), { args: [
|
|
5281
|
+
return __spreadProps(__spreadValues({}, dec), { args: [ts21.createObjectLiteral(newMetadataFields)] });
|
|
4966
5282
|
}
|
|
4967
5283
|
_resolveLiteral(decorator) {
|
|
4968
5284
|
if (this.literalCache.has(decorator)) {
|
|
@@ -4972,7 +5288,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4972
5288
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @Component decorator`);
|
|
4973
5289
|
}
|
|
4974
5290
|
const meta = unwrapExpression(decorator.args[0]);
|
|
4975
|
-
if (!
|
|
5291
|
+
if (!ts21.isObjectLiteralExpression(meta)) {
|
|
4976
5292
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `Decorator argument must be literal.`);
|
|
4977
5293
|
}
|
|
4978
5294
|
this.literalCache.set(decorator, meta);
|
|
@@ -4999,9 +5315,9 @@ var ComponentDecoratorHandler = class {
|
|
|
4999
5315
|
}
|
|
5000
5316
|
_extractStyleUrlsFromExpression(styleUrlsExpr) {
|
|
5001
5317
|
const styleUrls = [];
|
|
5002
|
-
if (
|
|
5318
|
+
if (ts21.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
5003
5319
|
for (const styleUrlExpr of styleUrlsExpr.elements) {
|
|
5004
|
-
if (
|
|
5320
|
+
if (ts21.isSpreadElement(styleUrlExpr)) {
|
|
5005
5321
|
styleUrls.push(...this._extractStyleUrlsFromExpression(styleUrlExpr.expression));
|
|
5006
5322
|
} else {
|
|
5007
5323
|
const styleUrl = this.evaluator.evaluate(styleUrlExpr);
|
|
@@ -5031,12 +5347,12 @@ var ComponentDecoratorHandler = class {
|
|
|
5031
5347
|
return styleUrls;
|
|
5032
5348
|
}
|
|
5033
5349
|
_extractStyleResources(component, containingFile) {
|
|
5034
|
-
const styles = new Set();
|
|
5350
|
+
const styles = /* @__PURE__ */ new Set();
|
|
5035
5351
|
function stringLiteralElements(array) {
|
|
5036
|
-
return array.elements.filter((e) =>
|
|
5352
|
+
return array.elements.filter((e) => ts21.isStringLiteralLike(e));
|
|
5037
5353
|
}
|
|
5038
5354
|
const styleUrlsExpr = component.get("styleUrls");
|
|
5039
|
-
if (styleUrlsExpr !== void 0 &&
|
|
5355
|
+
if (styleUrlsExpr !== void 0 && ts21.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
5040
5356
|
for (const expression of stringLiteralElements(styleUrlsExpr)) {
|
|
5041
5357
|
try {
|
|
5042
5358
|
const resourceUrl = this.resourceLoader.resolve(expression.text, containingFile);
|
|
@@ -5046,7 +5362,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5046
5362
|
}
|
|
5047
5363
|
}
|
|
5048
5364
|
const stylesExpr = component.get("styles");
|
|
5049
|
-
if (stylesExpr !== void 0 &&
|
|
5365
|
+
if (stylesExpr !== void 0 && ts21.isArrayLiteralExpression(stylesExpr)) {
|
|
5050
5366
|
for (const expression of stringLiteralElements(stylesExpr)) {
|
|
5051
5367
|
styles.add({ path: null, expression });
|
|
5052
5368
|
}
|
|
@@ -5091,7 +5407,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5091
5407
|
let sourceMapping;
|
|
5092
5408
|
let escapedString = false;
|
|
5093
5409
|
let sourceMapUrl;
|
|
5094
|
-
if (
|
|
5410
|
+
if (ts21.isStringLiteral(template.expression) || ts21.isNoSubstitutionTemplateLiteral(template.expression)) {
|
|
5095
5411
|
sourceParseRange = getTemplateRange(template.expression);
|
|
5096
5412
|
sourceStr = template.expression.getSourceFile().text;
|
|
5097
5413
|
templateContent = template.expression.text;
|
|
@@ -5265,7 +5581,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5265
5581
|
};
|
|
5266
5582
|
function getTemplateRange(templateExpr) {
|
|
5267
5583
|
const startPos = templateExpr.getStart() + 1;
|
|
5268
|
-
const { line, character } =
|
|
5584
|
+
const { line, character } = ts21.getLineAndCharacterOfPosition(templateExpr.getSourceFile(), startPos);
|
|
5269
5585
|
return {
|
|
5270
5586
|
startPos,
|
|
5271
5587
|
startLine: line,
|
|
@@ -5305,10 +5621,26 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
5305
5621
|
}
|
|
5306
5622
|
return null;
|
|
5307
5623
|
}
|
|
5624
|
+
function collectAnimationNames(value, animationTriggerNames) {
|
|
5625
|
+
if (value instanceof Map) {
|
|
5626
|
+
const name = value.get("name");
|
|
5627
|
+
if (typeof name === "string") {
|
|
5628
|
+
animationTriggerNames.staticTriggerNames.push(name);
|
|
5629
|
+
} else {
|
|
5630
|
+
animationTriggerNames.includesDynamicAnimations = true;
|
|
5631
|
+
}
|
|
5632
|
+
} else if (Array.isArray(value)) {
|
|
5633
|
+
for (const resolvedValue of value) {
|
|
5634
|
+
collectAnimationNames(resolvedValue, animationTriggerNames);
|
|
5635
|
+
}
|
|
5636
|
+
} else {
|
|
5637
|
+
animationTriggerNames.includesDynamicAnimations = true;
|
|
5638
|
+
}
|
|
5639
|
+
}
|
|
5308
5640
|
|
|
5309
|
-
// bazel-out/
|
|
5641
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
5310
5642
|
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
|
|
5643
|
+
import ts22 from "typescript";
|
|
5312
5644
|
var InjectableDecoratorHandler = class {
|
|
5313
5645
|
constructor(reflector, isCore, strictCtorDeps, injectableRegistry, perf, errorOnDuplicateProv = true) {
|
|
5314
5646
|
this.reflector = reflector;
|
|
@@ -5399,7 +5731,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
5399
5731
|
};
|
|
5400
5732
|
} else if (decorator.args.length === 1) {
|
|
5401
5733
|
const metaNode = decorator.args[0];
|
|
5402
|
-
if (!
|
|
5734
|
+
if (!ts22.isObjectLiteralExpression(metaNode)) {
|
|
5403
5735
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, metaNode, `@Injectable argument must be an object literal`);
|
|
5404
5736
|
}
|
|
5405
5737
|
const meta = reflectObjectLiteral(metaNode);
|
|
@@ -5407,7 +5739,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
5407
5739
|
let deps = void 0;
|
|
5408
5740
|
if ((meta.has("useClass") || meta.has("useFactory")) && meta.has("deps")) {
|
|
5409
5741
|
const depsExpr = meta.get("deps");
|
|
5410
|
-
if (!
|
|
5742
|
+
if (!ts22.isArrayLiteralExpression(depsExpr)) {
|
|
5411
5743
|
throw new FatalDiagnosticError(ErrorCode.VALUE_NOT_LITERAL, depsExpr, `@Injectable deps metadata must be an inline array`);
|
|
5412
5744
|
}
|
|
5413
5745
|
deps = depsExpr.elements.map((dep) => getDep(dep, reflector));
|
|
@@ -5489,12 +5821,12 @@ function getDep(dep, reflector) {
|
|
|
5489
5821
|
}
|
|
5490
5822
|
return true;
|
|
5491
5823
|
}
|
|
5492
|
-
if (
|
|
5824
|
+
if (ts22.isArrayLiteralExpression(dep)) {
|
|
5493
5825
|
dep.elements.forEach((el) => {
|
|
5494
5826
|
let isDecorator = false;
|
|
5495
|
-
if (
|
|
5827
|
+
if (ts22.isIdentifier(el)) {
|
|
5496
5828
|
isDecorator = maybeUpdateDecorator(el, reflector);
|
|
5497
|
-
} else if (
|
|
5829
|
+
} else if (ts22.isNewExpression(el) && ts22.isIdentifier(el.expression)) {
|
|
5498
5830
|
const token = el.arguments && el.arguments.length > 0 && el.arguments[0] || void 0;
|
|
5499
5831
|
isDecorator = maybeUpdateDecorator(el.expression, reflector, token);
|
|
5500
5832
|
}
|
|
@@ -5506,9 +5838,9 @@ function getDep(dep, reflector) {
|
|
|
5506
5838
|
return meta;
|
|
5507
5839
|
}
|
|
5508
5840
|
|
|
5509
|
-
// bazel-out/
|
|
5841
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
|
|
5510
5842
|
import { compileClassMetadata as compileClassMetadata5, compileDeclareClassMetadata as compileDeclareClassMetadata5, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
5511
|
-
import
|
|
5843
|
+
import ts23 from "typescript";
|
|
5512
5844
|
var PipeSymbol = class extends SemanticSymbol {
|
|
5513
5845
|
constructor(decl, name) {
|
|
5514
5846
|
super(decl);
|
|
@@ -5563,7 +5895,7 @@ var PipeDecoratorHandler = class {
|
|
|
5563
5895
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), "@Pipe must have exactly one argument");
|
|
5564
5896
|
}
|
|
5565
5897
|
const meta = unwrapExpression(decorator.args[0]);
|
|
5566
|
-
if (!
|
|
5898
|
+
if (!ts23.isObjectLiteralExpression(meta)) {
|
|
5567
5899
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@Pipe must have a literal argument");
|
|
5568
5900
|
}
|
|
5569
5901
|
const pipe = reflectObjectLiteral(meta);
|
|
@@ -5631,21 +5963,13 @@ var PipeDecoratorHandler = class {
|
|
|
5631
5963
|
}
|
|
5632
5964
|
};
|
|
5633
5965
|
|
|
5634
|
-
// bazel-out/
|
|
5966
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/references_registry.mjs
|
|
5635
5967
|
var NoopReferencesRegistry = class {
|
|
5636
5968
|
add(source, ...references) {
|
|
5637
5969
|
}
|
|
5638
5970
|
};
|
|
5639
5971
|
|
|
5640
5972
|
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
5973
|
SemanticDepGraphUpdater,
|
|
5650
5974
|
CompoundMetadataReader,
|
|
5651
5975
|
DtsMetadataReader,
|
|
@@ -5660,6 +5984,15 @@ export {
|
|
|
5660
5984
|
CompilationMode,
|
|
5661
5985
|
HandlerFlags,
|
|
5662
5986
|
aliasTransformFactory,
|
|
5987
|
+
isShim,
|
|
5988
|
+
copyFileShimData,
|
|
5989
|
+
untagAllTsFiles,
|
|
5990
|
+
retagAllTsFiles,
|
|
5991
|
+
ShimAdapter,
|
|
5992
|
+
FactoryGenerator,
|
|
5993
|
+
generatedFactoryTransform,
|
|
5994
|
+
ShimReferenceTagger,
|
|
5995
|
+
SummaryGenerator,
|
|
5663
5996
|
TraitState,
|
|
5664
5997
|
TraitCompiler,
|
|
5665
5998
|
DtsTransformRegistry,
|
|
@@ -5681,4 +6014,5 @@ export {
|
|
|
5681
6014
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5682
6015
|
* found in the LICENSE file at https://angular.io/license
|
|
5683
6016
|
*/
|
|
5684
|
-
|
|
6017
|
+
// Closure Compiler ignores @suppress and similar if the comment contains @license.
|
|
6018
|
+
//# sourceMappingURL=chunk-LMCFGUUV.js.map
|