@angular/compiler-cli 13.1.0-next.3 → 13.1.3
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-UMUIU7TE.js → chunk-7UHLQOIO.js} +4 -4
- package/bundles/{chunk-UMUIU7TE.js.map → chunk-7UHLQOIO.js.map} +0 -0
- package/bundles/{chunk-QDWL7SZJ.js → chunk-BPCUCINV.js} +2 -2
- package/bundles/{chunk-QDWL7SZJ.js.map → chunk-BPCUCINV.js.map} +0 -0
- package/bundles/{chunk-COAETSNP.js → chunk-CKZCKW5B.js} +785 -1129
- package/bundles/chunk-CKZCKW5B.js.map +6 -0
- package/bundles/{chunk-GLCRIILX.js → chunk-J6CW3T62.js} +5 -5
- package/bundles/{chunk-GLCRIILX.js.map → chunk-J6CW3T62.js.map} +0 -0
- package/bundles/{chunk-SKBLJA43.js → chunk-JTYUTYS2.js} +3 -3
- package/bundles/{chunk-SKBLJA43.js.map → chunk-JTYUTYS2.js.map} +0 -0
- package/bundles/{chunk-UIKTHF6Z.js → chunk-K5FPDA5B.js} +61 -63
- package/bundles/chunk-K5FPDA5B.js.map +6 -0
- package/bundles/{chunk-MFCLQBFK.js → chunk-KU4D2JVX.js} +39 -41
- package/bundles/chunk-KU4D2JVX.js.map +6 -0
- package/bundles/{chunk-7HVF6UHR.js → chunk-KXVQ4SSM.js} +24 -22
- package/bundles/chunk-KXVQ4SSM.js.map +6 -0
- package/bundles/{chunk-IESRH26X.js → chunk-L23I4NJT.js} +744 -434
- package/bundles/chunk-L23I4NJT.js.map +6 -0
- package/bundles/{chunk-QL6ZC3U3.js → chunk-RDTZZXLZ.js} +12 -12
- package/bundles/{chunk-QL6ZC3U3.js.map → chunk-RDTZZXLZ.js.map} +1 -1
- package/bundles/{chunk-EP5JHXG2.js → chunk-RGGJJ7ZZ.js} +39 -60
- package/bundles/chunk-RGGJJ7ZZ.js.map +6 -0
- package/bundles/{chunk-JJMLEEKA.js → chunk-RNVIUKDY.js} +9 -9
- package/bundles/chunk-RNVIUKDY.js.map +6 -0
- package/bundles/{chunk-HDZS2JG2.js → chunk-VUEDWBJP.js} +270 -100
- package/bundles/chunk-VUEDWBJP.js.map +6 -0
- package/bundles/{chunk-XA5IZLLC.js → chunk-WQ3TNYTD.js} +6 -6
- package/bundles/{chunk-XA5IZLLC.js.map → chunk-WQ3TNYTD.js.map} +0 -0
- package/bundles/{chunk-4EDYFHXN.js → chunk-XXMNTCYN.js} +9 -9
- package/bundles/chunk-XXMNTCYN.js.map +6 -0
- package/bundles/{chunk-7HBAJSZA.js → chunk-ZLL7BXGD.js} +228 -190
- package/bundles/chunk-ZLL7BXGD.js.map +6 -0
- package/bundles/index.js +16 -30
- package/bundles/index.js.map +2 -2
- 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 -2
- 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/main.d.ts +3 -3
- 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.d.ts +3 -6
- 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/src/perform_compile.d.ts +5 -10
- package/src/perform_watch.d.ts +4 -4
- package/src/transformers/api.d.ts +3 -30
- package/src/transformers/util.d.ts +4 -6
- package/bundles/chunk-4EDYFHXN.js.map +0 -6
- package/bundles/chunk-7HBAJSZA.js.map +0 -6
- package/bundles/chunk-7HVF6UHR.js.map +0 -6
- package/bundles/chunk-COAETSNP.js.map +0 -6
- package/bundles/chunk-EP5JHXG2.js.map +0 -6
- package/bundles/chunk-HDZS2JG2.js.map +0 -6
- package/bundles/chunk-IESRH26X.js.map +0 -6
- package/bundles/chunk-JJMLEEKA.js.map +0 -6
- package/bundles/chunk-MFCLQBFK.js.map +0 -6
- package/bundles/chunk-UIKTHF6Z.js.map +0 -6
|
@@ -13,37 +13,45 @@ import {
|
|
|
13
13
|
reflectObjectLiteral,
|
|
14
14
|
reflectTypeEntityToDeclaration,
|
|
15
15
|
typeNodeToValueExpr
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XXMNTCYN.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-VUEDWBJP.js";
|
|
32
39
|
import {
|
|
33
40
|
absoluteFrom,
|
|
34
41
|
absoluteFromSourceFile,
|
|
42
|
+
basename,
|
|
35
43
|
relative
|
|
36
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-RGGJJ7ZZ.js";
|
|
37
45
|
import {
|
|
38
46
|
PerfEvent,
|
|
39
47
|
PerfPhase
|
|
40
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-J6CW3T62.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/darwin-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/darwin-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/darwin-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/darwin-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/darwin-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/darwin-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/darwin-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/darwin-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/k8-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/k8-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/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
927
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
|
|
985
928
|
import ts2 from "typescript";
|
|
986
|
-
|
|
987
|
-
// bazel-out/k8-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/k8-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/k8-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/k8-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/darwin-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/darwin-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/darwin-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/darwin-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/darwin-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/darwin-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/darwin-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/darwin-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/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1662
|
+
import ts7 from "typescript";
|
|
1770
1663
|
|
|
1771
|
-
// bazel-out/
|
|
1664
|
+
// bazel-out/darwin-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/darwin-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/darwin-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";
|
|
@@ -2070,11 +1963,11 @@ var DtsMetadataReader = class {
|
|
|
2070
1963
|
const def = this.reflector.getMembersOfClass(ref.node).find((field) => field.isStatic && field.name === "\u0275pipe");
|
|
2071
1964
|
if (def === void 0) {
|
|
2072
1965
|
return null;
|
|
2073
|
-
} else if (def.type === null || !
|
|
1966
|
+
} else if (def.type === null || !ts7.isTypeReferenceNode(def.type) || def.type.typeArguments === void 0 || def.type.typeArguments.length < 2) {
|
|
2074
1967
|
return null;
|
|
2075
1968
|
}
|
|
2076
1969
|
const type = def.type.typeArguments[1];
|
|
2077
|
-
if (!
|
|
1970
|
+
if (!ts7.isLiteralTypeNode(type) || !ts7.isStringLiteral(type.literal)) {
|
|
2078
1971
|
return null;
|
|
2079
1972
|
}
|
|
2080
1973
|
const name = type.literal.text;
|
|
@@ -2092,12 +1985,12 @@ function readBaseClass2(clazz, checker, reflector) {
|
|
|
2092
1985
|
}
|
|
2093
1986
|
if (clazz.heritageClauses !== void 0) {
|
|
2094
1987
|
for (const clause of clazz.heritageClauses) {
|
|
2095
|
-
if (clause.token ===
|
|
1988
|
+
if (clause.token === ts7.SyntaxKind.ExtendsKeyword) {
|
|
2096
1989
|
const baseExpr = clause.types[0].expression;
|
|
2097
1990
|
let symbol = checker.getSymbolAtLocation(baseExpr);
|
|
2098
1991
|
if (symbol === void 0) {
|
|
2099
1992
|
return "dynamic";
|
|
2100
|
-
} else if (symbol.flags &
|
|
1993
|
+
} else if (symbol.flags & ts7.SymbolFlags.Alias) {
|
|
2101
1994
|
symbol = checker.getAliasedSymbol(symbol);
|
|
2102
1995
|
}
|
|
2103
1996
|
if (symbol.valueDeclaration !== void 0 && isNamedClassDeclaration(symbol.valueDeclaration)) {
|
|
@@ -2111,7 +2004,7 @@ function readBaseClass2(clazz, checker, reflector) {
|
|
|
2111
2004
|
return null;
|
|
2112
2005
|
}
|
|
2113
2006
|
|
|
2114
|
-
// bazel-out/
|
|
2007
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/inheritance.mjs
|
|
2115
2008
|
function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
2116
2009
|
const topMeta = reader.getDirectiveMetadata(dir);
|
|
2117
2010
|
if (topMeta === null) {
|
|
@@ -2120,10 +2013,10 @@ function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
|
2120
2013
|
if (topMeta.baseClass === null) {
|
|
2121
2014
|
return topMeta;
|
|
2122
2015
|
}
|
|
2123
|
-
const coercedInputFields = new Set();
|
|
2124
|
-
const undeclaredInputFields = new Set();
|
|
2125
|
-
const restrictedInputFields = new Set();
|
|
2126
|
-
const stringLiteralInputFields = new Set();
|
|
2016
|
+
const coercedInputFields = /* @__PURE__ */ new Set();
|
|
2017
|
+
const undeclaredInputFields = /* @__PURE__ */ new Set();
|
|
2018
|
+
const restrictedInputFields = /* @__PURE__ */ new Set();
|
|
2019
|
+
const stringLiteralInputFields = /* @__PURE__ */ new Set();
|
|
2127
2020
|
let isDynamic = false;
|
|
2128
2021
|
let inputs = ClassPropertyMapping.empty();
|
|
2129
2022
|
let outputs = ClassPropertyMapping.empty();
|
|
@@ -2168,12 +2061,12 @@ function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
|
2168
2061
|
});
|
|
2169
2062
|
}
|
|
2170
2063
|
|
|
2171
|
-
// bazel-out/
|
|
2064
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/registry.mjs
|
|
2172
2065
|
var LocalMetadataRegistry = class {
|
|
2173
2066
|
constructor() {
|
|
2174
|
-
this.directives = new Map();
|
|
2175
|
-
this.ngModules = new Map();
|
|
2176
|
-
this.pipes = new Map();
|
|
2067
|
+
this.directives = /* @__PURE__ */ new Map();
|
|
2068
|
+
this.ngModules = /* @__PURE__ */ new Map();
|
|
2069
|
+
this.pipes = /* @__PURE__ */ new Map();
|
|
2177
2070
|
}
|
|
2178
2071
|
getDirectiveMetadata(ref) {
|
|
2179
2072
|
return this.directives.has(ref.node) ? this.directives.get(ref.node) : null;
|
|
@@ -2217,7 +2110,7 @@ var CompoundMetadataRegistry = class {
|
|
|
2217
2110
|
var InjectableClassRegistry = class {
|
|
2218
2111
|
constructor(host) {
|
|
2219
2112
|
this.host = host;
|
|
2220
|
-
this.classes = new Set();
|
|
2113
|
+
this.classes = /* @__PURE__ */ new Set();
|
|
2221
2114
|
}
|
|
2222
2115
|
registerInjectable(declaration) {
|
|
2223
2116
|
this.classes.add(declaration);
|
|
@@ -2227,17 +2120,17 @@ var InjectableClassRegistry = class {
|
|
|
2227
2120
|
}
|
|
2228
2121
|
};
|
|
2229
2122
|
|
|
2230
|
-
// bazel-out/
|
|
2123
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/resource_registry.mjs
|
|
2231
2124
|
var ResourceRegistry = class {
|
|
2232
2125
|
constructor() {
|
|
2233
|
-
this.externalTemplateToComponentsMap = new Map();
|
|
2234
|
-
this.componentToTemplateMap = new Map();
|
|
2235
|
-
this.componentToStylesMap = new Map();
|
|
2236
|
-
this.externalStyleToComponentsMap = new Map();
|
|
2126
|
+
this.externalTemplateToComponentsMap = /* @__PURE__ */ new Map();
|
|
2127
|
+
this.componentToTemplateMap = /* @__PURE__ */ new Map();
|
|
2128
|
+
this.componentToStylesMap = /* @__PURE__ */ new Map();
|
|
2129
|
+
this.externalStyleToComponentsMap = /* @__PURE__ */ new Map();
|
|
2237
2130
|
}
|
|
2238
2131
|
getComponentsWithTemplate(template) {
|
|
2239
2132
|
if (!this.externalTemplateToComponentsMap.has(template)) {
|
|
2240
|
-
return new Set();
|
|
2133
|
+
return /* @__PURE__ */ new Set();
|
|
2241
2134
|
}
|
|
2242
2135
|
return this.externalTemplateToComponentsMap.get(template);
|
|
2243
2136
|
}
|
|
@@ -2253,7 +2146,7 @@ var ResourceRegistry = class {
|
|
|
2253
2146
|
const { path } = templateResource;
|
|
2254
2147
|
if (path !== null) {
|
|
2255
2148
|
if (!this.externalTemplateToComponentsMap.has(path)) {
|
|
2256
|
-
this.externalTemplateToComponentsMap.set(path, new Set());
|
|
2149
|
+
this.externalTemplateToComponentsMap.set(path, /* @__PURE__ */ new Set());
|
|
2257
2150
|
}
|
|
2258
2151
|
this.externalTemplateToComponentsMap.get(path).add(component);
|
|
2259
2152
|
}
|
|
@@ -2268,11 +2161,11 @@ var ResourceRegistry = class {
|
|
|
2268
2161
|
registerStyle(styleResource, component) {
|
|
2269
2162
|
const { path } = styleResource;
|
|
2270
2163
|
if (!this.componentToStylesMap.has(component)) {
|
|
2271
|
-
this.componentToStylesMap.set(component, new Set());
|
|
2164
|
+
this.componentToStylesMap.set(component, /* @__PURE__ */ new Set());
|
|
2272
2165
|
}
|
|
2273
2166
|
if (path !== null) {
|
|
2274
2167
|
if (!this.externalStyleToComponentsMap.has(path)) {
|
|
2275
|
-
this.externalStyleToComponentsMap.set(path, new Set());
|
|
2168
|
+
this.externalStyleToComponentsMap.set(path, /* @__PURE__ */ new Set());
|
|
2276
2169
|
}
|
|
2277
2170
|
this.externalStyleToComponentsMap.get(path).add(component);
|
|
2278
2171
|
}
|
|
@@ -2280,19 +2173,19 @@ var ResourceRegistry = class {
|
|
|
2280
2173
|
}
|
|
2281
2174
|
getStyles(component) {
|
|
2282
2175
|
if (!this.componentToStylesMap.has(component)) {
|
|
2283
|
-
return new Set();
|
|
2176
|
+
return /* @__PURE__ */ new Set();
|
|
2284
2177
|
}
|
|
2285
2178
|
return this.componentToStylesMap.get(component);
|
|
2286
2179
|
}
|
|
2287
2180
|
getComponentsWithStyle(styleUrl) {
|
|
2288
2181
|
if (!this.externalStyleToComponentsMap.has(styleUrl)) {
|
|
2289
|
-
return new Set();
|
|
2182
|
+
return /* @__PURE__ */ new Set();
|
|
2290
2183
|
}
|
|
2291
2184
|
return this.externalStyleToComponentsMap.get(styleUrl);
|
|
2292
2185
|
}
|
|
2293
2186
|
};
|
|
2294
2187
|
|
|
2295
|
-
// bazel-out/
|
|
2188
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/api.mjs
|
|
2296
2189
|
var CompilationMode;
|
|
2297
2190
|
(function(CompilationMode2) {
|
|
2298
2191
|
CompilationMode2[CompilationMode2["FULL"] = 0] = "FULL";
|
|
@@ -2310,28 +2203,426 @@ var HandlerFlags;
|
|
|
2310
2203
|
HandlerFlags2[HandlerFlags2["FULL_INHERITANCE"] = 1] = "FULL_INHERITANCE";
|
|
2311
2204
|
})(HandlerFlags || (HandlerFlags = {}));
|
|
2312
2205
|
|
|
2313
|
-
// bazel-out/
|
|
2314
|
-
import
|
|
2206
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/alias.mjs
|
|
2207
|
+
import ts8 from "typescript";
|
|
2315
2208
|
function aliasTransformFactory(exportStatements) {
|
|
2316
2209
|
return (context) => {
|
|
2317
2210
|
return (file) => {
|
|
2318
|
-
if (
|
|
2211
|
+
if (ts8.isBundle(file) || !exportStatements.has(file.fileName)) {
|
|
2319
2212
|
return file;
|
|
2320
2213
|
}
|
|
2321
2214
|
const statements = [...file.statements];
|
|
2322
2215
|
exportStatements.get(file.fileName).forEach(([moduleName, symbolName], aliasName) => {
|
|
2323
|
-
const stmt =
|
|
2216
|
+
const stmt = ts8.createExportDeclaration(void 0, void 0, ts8.createNamedExports([createExportSpecifier(symbolName, aliasName)]), ts8.createStringLiteral(moduleName));
|
|
2324
2217
|
statements.push(stmt);
|
|
2325
2218
|
});
|
|
2326
|
-
return
|
|
2219
|
+
return ts8.updateSourceFileNode(file, statements);
|
|
2327
2220
|
};
|
|
2328
2221
|
};
|
|
2329
2222
|
}
|
|
2330
2223
|
|
|
2331
|
-
// bazel-out/
|
|
2224
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
2225
|
+
import ts12 from "typescript";
|
|
2226
|
+
|
|
2227
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
2228
|
+
import ts9 from "typescript";
|
|
2229
|
+
|
|
2230
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/expando.mjs
|
|
2231
|
+
var NgExtension = Symbol("NgExtension");
|
|
2232
|
+
function isExtended(sf) {
|
|
2233
|
+
return sf[NgExtension] !== void 0;
|
|
2234
|
+
}
|
|
2235
|
+
function sfExtensionData(sf) {
|
|
2236
|
+
const extSf = sf;
|
|
2237
|
+
if (extSf[NgExtension] !== void 0) {
|
|
2238
|
+
return extSf[NgExtension];
|
|
2239
|
+
}
|
|
2240
|
+
const extension = {
|
|
2241
|
+
isTopLevelShim: false,
|
|
2242
|
+
fileShim: null,
|
|
2243
|
+
originalReferencedFiles: null,
|
|
2244
|
+
taggedReferenceFiles: null
|
|
2245
|
+
};
|
|
2246
|
+
extSf[NgExtension] = extension;
|
|
2247
|
+
return extension;
|
|
2248
|
+
}
|
|
2249
|
+
function isFileShimSourceFile(sf) {
|
|
2250
|
+
return isExtended(sf) && sf[NgExtension].fileShim !== null;
|
|
2251
|
+
}
|
|
2252
|
+
function isShim(sf) {
|
|
2253
|
+
return isExtended(sf) && (sf[NgExtension].fileShim !== null || sf[NgExtension].isTopLevelShim);
|
|
2254
|
+
}
|
|
2255
|
+
function copyFileShimData(from, to) {
|
|
2256
|
+
if (!isFileShimSourceFile(from)) {
|
|
2257
|
+
return;
|
|
2258
|
+
}
|
|
2259
|
+
sfExtensionData(to).fileShim = sfExtensionData(from).fileShim;
|
|
2260
|
+
}
|
|
2261
|
+
function untagAllTsFiles(program) {
|
|
2262
|
+
for (const sf of program.getSourceFiles()) {
|
|
2263
|
+
untagTsFile(sf);
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
function retagAllTsFiles(program) {
|
|
2267
|
+
for (const sf of program.getSourceFiles()) {
|
|
2268
|
+
retagTsFile(sf);
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
function untagTsFile(sf) {
|
|
2272
|
+
if (sf.isDeclarationFile || !isExtended(sf)) {
|
|
2273
|
+
return;
|
|
2274
|
+
}
|
|
2275
|
+
const ext = sfExtensionData(sf);
|
|
2276
|
+
if (ext.originalReferencedFiles !== null) {
|
|
2277
|
+
sf.referencedFiles = ext.originalReferencedFiles;
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
function retagTsFile(sf) {
|
|
2281
|
+
if (sf.isDeclarationFile || !isExtended(sf)) {
|
|
2282
|
+
return;
|
|
2283
|
+
}
|
|
2284
|
+
const ext = sfExtensionData(sf);
|
|
2285
|
+
if (ext.taggedReferenceFiles !== null) {
|
|
2286
|
+
sf.referencedFiles = ext.taggedReferenceFiles;
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/util.mjs
|
|
2291
|
+
var TS_EXTENSIONS = /\.tsx?$/i;
|
|
2292
|
+
function makeShimFileName(fileName, suffix) {
|
|
2293
|
+
return absoluteFrom(fileName.replace(TS_EXTENSIONS, suffix));
|
|
2294
|
+
}
|
|
2295
|
+
function generatedModuleName(originalModuleName, originalFileName, genSuffix) {
|
|
2296
|
+
let moduleName;
|
|
2297
|
+
if (originalFileName.endsWith("/index.ts")) {
|
|
2298
|
+
moduleName = originalModuleName + "/index" + genSuffix;
|
|
2299
|
+
} else {
|
|
2300
|
+
moduleName = originalModuleName + genSuffix;
|
|
2301
|
+
}
|
|
2302
|
+
return moduleName;
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
2306
|
+
var ShimAdapter = class {
|
|
2307
|
+
constructor(delegate, tsRootFiles, topLevelGenerators, perFileGenerators, oldProgram) {
|
|
2308
|
+
this.delegate = delegate;
|
|
2309
|
+
this.shims = /* @__PURE__ */ new Map();
|
|
2310
|
+
this.priorShims = /* @__PURE__ */ new Map();
|
|
2311
|
+
this.notShims = /* @__PURE__ */ new Set();
|
|
2312
|
+
this.generators = [];
|
|
2313
|
+
this.ignoreForEmit = /* @__PURE__ */ new Set();
|
|
2314
|
+
this.extensionPrefixes = [];
|
|
2315
|
+
for (const gen of perFileGenerators) {
|
|
2316
|
+
const pattern = `^(.*)\\.${gen.extensionPrefix}\\.ts$`;
|
|
2317
|
+
const regexp = new RegExp(pattern, "i");
|
|
2318
|
+
this.generators.push({
|
|
2319
|
+
generator: gen,
|
|
2320
|
+
test: regexp,
|
|
2321
|
+
suffix: `.${gen.extensionPrefix}.ts`
|
|
2322
|
+
});
|
|
2323
|
+
this.extensionPrefixes.push(gen.extensionPrefix);
|
|
2324
|
+
}
|
|
2325
|
+
const extraInputFiles = [];
|
|
2326
|
+
for (const gen of topLevelGenerators) {
|
|
2327
|
+
const sf = gen.makeTopLevelShim();
|
|
2328
|
+
sfExtensionData(sf).isTopLevelShim = true;
|
|
2329
|
+
if (!gen.shouldEmit) {
|
|
2330
|
+
this.ignoreForEmit.add(sf);
|
|
2331
|
+
}
|
|
2332
|
+
const fileName = absoluteFromSourceFile(sf);
|
|
2333
|
+
this.shims.set(fileName, sf);
|
|
2334
|
+
extraInputFiles.push(fileName);
|
|
2335
|
+
}
|
|
2336
|
+
for (const rootFile of tsRootFiles) {
|
|
2337
|
+
for (const gen of this.generators) {
|
|
2338
|
+
extraInputFiles.push(makeShimFileName(rootFile, gen.suffix));
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
this.extraInputFiles = extraInputFiles;
|
|
2342
|
+
if (oldProgram !== null) {
|
|
2343
|
+
for (const oldSf of oldProgram.getSourceFiles()) {
|
|
2344
|
+
if (oldSf.isDeclarationFile || !isFileShimSourceFile(oldSf)) {
|
|
2345
|
+
continue;
|
|
2346
|
+
}
|
|
2347
|
+
this.priorShims.set(absoluteFromSourceFile(oldSf), oldSf);
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
maybeGenerate(fileName) {
|
|
2352
|
+
if (this.notShims.has(fileName)) {
|
|
2353
|
+
return null;
|
|
2354
|
+
} else if (this.shims.has(fileName)) {
|
|
2355
|
+
return this.shims.get(fileName);
|
|
2356
|
+
}
|
|
2357
|
+
if (isDtsPath(fileName)) {
|
|
2358
|
+
this.notShims.add(fileName);
|
|
2359
|
+
return null;
|
|
2360
|
+
}
|
|
2361
|
+
for (const record of this.generators) {
|
|
2362
|
+
const match = record.test.exec(fileName);
|
|
2363
|
+
if (match === null) {
|
|
2364
|
+
continue;
|
|
2365
|
+
}
|
|
2366
|
+
const prefix = match[1];
|
|
2367
|
+
let baseFileName = absoluteFrom(prefix + ".ts");
|
|
2368
|
+
if (!this.delegate.fileExists(baseFileName)) {
|
|
2369
|
+
baseFileName = absoluteFrom(prefix + ".tsx");
|
|
2370
|
+
if (!this.delegate.fileExists(baseFileName)) {
|
|
2371
|
+
return void 0;
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
const inputFile = this.delegate.getSourceFile(baseFileName, ts9.ScriptTarget.Latest);
|
|
2375
|
+
if (inputFile === void 0 || isShim(inputFile)) {
|
|
2376
|
+
return void 0;
|
|
2377
|
+
}
|
|
2378
|
+
return this.generateSpecific(fileName, record.generator, inputFile);
|
|
2379
|
+
}
|
|
2380
|
+
this.notShims.add(fileName);
|
|
2381
|
+
return null;
|
|
2382
|
+
}
|
|
2383
|
+
generateSpecific(fileName, generator, inputFile) {
|
|
2384
|
+
let priorShimSf = null;
|
|
2385
|
+
if (this.priorShims.has(fileName)) {
|
|
2386
|
+
priorShimSf = this.priorShims.get(fileName);
|
|
2387
|
+
this.priorShims.delete(fileName);
|
|
2388
|
+
}
|
|
2389
|
+
const shimSf = generator.generateShimForFile(inputFile, fileName, priorShimSf);
|
|
2390
|
+
sfExtensionData(shimSf).fileShim = {
|
|
2391
|
+
extension: generator.extensionPrefix,
|
|
2392
|
+
generatedFrom: absoluteFromSourceFile(inputFile)
|
|
2393
|
+
};
|
|
2394
|
+
if (!generator.shouldEmit) {
|
|
2395
|
+
this.ignoreForEmit.add(shimSf);
|
|
2396
|
+
}
|
|
2397
|
+
this.shims.set(fileName, shimSf);
|
|
2398
|
+
return shimSf;
|
|
2399
|
+
}
|
|
2400
|
+
};
|
|
2401
|
+
|
|
2402
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/factory_generator.mjs
|
|
2332
2403
|
import ts10 from "typescript";
|
|
2404
|
+
var TS_DTS_SUFFIX = /(\.d)?\.ts$/;
|
|
2405
|
+
var STRIP_NG_FACTORY = /(.*)NgFactory$/;
|
|
2406
|
+
var FactoryGenerator = class {
|
|
2407
|
+
constructor() {
|
|
2408
|
+
this.sourceInfo = /* @__PURE__ */ new Map();
|
|
2409
|
+
this.sourceToFactorySymbols = /* @__PURE__ */ new Map();
|
|
2410
|
+
this.shouldEmit = true;
|
|
2411
|
+
this.extensionPrefix = "ngfactory";
|
|
2412
|
+
}
|
|
2413
|
+
generateShimForFile(sf, genFilePath) {
|
|
2414
|
+
const absoluteSfPath = absoluteFromSourceFile(sf);
|
|
2415
|
+
const relativePathToSource = "./" + basename(sf.fileName).replace(TS_DTS_SUFFIX, "");
|
|
2416
|
+
const symbolNames = sf.statements.filter(ts10.isClassDeclaration).filter((decl) => isExported(decl) && decl.decorators !== void 0 && decl.name !== void 0).map((decl) => decl.name.text);
|
|
2417
|
+
let sourceText = "";
|
|
2418
|
+
const leadingComment = getFileoverviewComment(sf);
|
|
2419
|
+
if (leadingComment !== null) {
|
|
2420
|
+
sourceText = leadingComment + "\n\n";
|
|
2421
|
+
}
|
|
2422
|
+
if (symbolNames.length > 0) {
|
|
2423
|
+
const varLines = symbolNames.map((name) => `export const ${name}NgFactory: i0.\u0275NgModuleFactory<any> = new i0.\u0275NgModuleFactory(${name});`);
|
|
2424
|
+
sourceText += [
|
|
2425
|
+
`import * as i0 from '@angular/core';`,
|
|
2426
|
+
`import {${symbolNames.join(", ")}} from '${relativePathToSource}';`,
|
|
2427
|
+
...varLines
|
|
2428
|
+
].join("\n");
|
|
2429
|
+
}
|
|
2430
|
+
sourceText += "\nexport const \u0275NonEmptyModule = true;";
|
|
2431
|
+
const genFile = ts10.createSourceFile(genFilePath, sourceText, sf.languageVersion, true, ts10.ScriptKind.TS);
|
|
2432
|
+
if (sf.moduleName !== void 0) {
|
|
2433
|
+
genFile.moduleName = generatedModuleName(sf.moduleName, sf.fileName, ".ngfactory");
|
|
2434
|
+
}
|
|
2435
|
+
const moduleSymbols = /* @__PURE__ */ new Map();
|
|
2436
|
+
this.sourceToFactorySymbols.set(absoluteSfPath, moduleSymbols);
|
|
2437
|
+
this.sourceInfo.set(genFilePath, {
|
|
2438
|
+
sourceFilePath: absoluteSfPath,
|
|
2439
|
+
moduleSymbols
|
|
2440
|
+
});
|
|
2441
|
+
return genFile;
|
|
2442
|
+
}
|
|
2443
|
+
track(sf, moduleInfo) {
|
|
2444
|
+
if (this.sourceToFactorySymbols.has(sf.fileName)) {
|
|
2445
|
+
this.sourceToFactorySymbols.get(sf.fileName).set(moduleInfo.name, moduleInfo);
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
};
|
|
2449
|
+
function isExported(decl) {
|
|
2450
|
+
return decl.modifiers !== void 0 && decl.modifiers.some((mod) => mod.kind == ts10.SyntaxKind.ExportKeyword);
|
|
2451
|
+
}
|
|
2452
|
+
function generatedFactoryTransform(factoryMap, importRewriter) {
|
|
2453
|
+
return (context) => {
|
|
2454
|
+
return (file) => {
|
|
2455
|
+
return transformFactorySourceFile(factoryMap, context, importRewriter, file);
|
|
2456
|
+
};
|
|
2457
|
+
};
|
|
2458
|
+
}
|
|
2459
|
+
function transformFactorySourceFile(factoryMap, context, importRewriter, file) {
|
|
2460
|
+
if (!factoryMap.has(file.fileName)) {
|
|
2461
|
+
return file;
|
|
2462
|
+
}
|
|
2463
|
+
const { moduleSymbols, sourceFilePath } = factoryMap.get(file.fileName);
|
|
2464
|
+
const transformedStatements = [];
|
|
2465
|
+
let nonEmptyExport = null;
|
|
2466
|
+
const coreImportIdentifiers = /* @__PURE__ */ new Set();
|
|
2467
|
+
for (const stmt of file.statements) {
|
|
2468
|
+
if (ts10.isImportDeclaration(stmt) && ts10.isStringLiteral(stmt.moduleSpecifier) && stmt.moduleSpecifier.text === "@angular/core") {
|
|
2469
|
+
const rewrittenModuleSpecifier = importRewriter.rewriteSpecifier("@angular/core", sourceFilePath);
|
|
2470
|
+
if (rewrittenModuleSpecifier !== stmt.moduleSpecifier.text) {
|
|
2471
|
+
transformedStatements.push(ts10.updateImportDeclaration(stmt, stmt.decorators, stmt.modifiers, stmt.importClause, ts10.createStringLiteral(rewrittenModuleSpecifier), void 0));
|
|
2472
|
+
if (stmt.importClause !== void 0 && stmt.importClause.namedBindings !== void 0 && ts10.isNamespaceImport(stmt.importClause.namedBindings)) {
|
|
2473
|
+
coreImportIdentifiers.add(stmt.importClause.namedBindings.name.text);
|
|
2474
|
+
}
|
|
2475
|
+
} else {
|
|
2476
|
+
transformedStatements.push(stmt);
|
|
2477
|
+
}
|
|
2478
|
+
} else if (ts10.isVariableStatement(stmt) && stmt.declarationList.declarations.length === 1) {
|
|
2479
|
+
const decl = stmt.declarationList.declarations[0];
|
|
2480
|
+
if (ts10.isIdentifier(decl.name)) {
|
|
2481
|
+
if (decl.name.text === "\u0275NonEmptyModule") {
|
|
2482
|
+
nonEmptyExport = stmt;
|
|
2483
|
+
continue;
|
|
2484
|
+
}
|
|
2485
|
+
const match = STRIP_NG_FACTORY.exec(decl.name.text);
|
|
2486
|
+
const module = match ? moduleSymbols.get(match[1]) : null;
|
|
2487
|
+
if (module) {
|
|
2488
|
+
const moduleIsTreeShakable = !module.hasId;
|
|
2489
|
+
const newStmt = !moduleIsTreeShakable ? stmt : updateInitializers(stmt, (init) => init ? wrapInNoSideEffects(init) : void 0);
|
|
2490
|
+
transformedStatements.push(newStmt);
|
|
2491
|
+
}
|
|
2492
|
+
} else {
|
|
2493
|
+
transformedStatements.push(stmt);
|
|
2494
|
+
}
|
|
2495
|
+
} else {
|
|
2496
|
+
transformedStatements.push(stmt);
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
if (!transformedStatements.some(ts10.isVariableStatement) && nonEmptyExport !== null) {
|
|
2500
|
+
transformedStatements.push(nonEmptyExport);
|
|
2501
|
+
}
|
|
2502
|
+
file = ts10.updateSourceFileNode(file, transformedStatements);
|
|
2503
|
+
if (coreImportIdentifiers.size > 0) {
|
|
2504
|
+
const visit2 = (node) => {
|
|
2505
|
+
node = ts10.visitEachChild(node, (child) => visit2(child), context);
|
|
2506
|
+
if (ts10.isPropertyAccessExpression(node) && ts10.isIdentifier(node.expression) && coreImportIdentifiers.has(node.expression.text)) {
|
|
2507
|
+
const rewrittenSymbol = importRewriter.rewriteSymbol(node.name.text, "@angular/core");
|
|
2508
|
+
if (rewrittenSymbol !== node.name.text) {
|
|
2509
|
+
const updated = ts10.updatePropertyAccess(node, node.expression, ts10.createIdentifier(rewrittenSymbol));
|
|
2510
|
+
node = updated;
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2513
|
+
return node;
|
|
2514
|
+
};
|
|
2515
|
+
file = visit2(file);
|
|
2516
|
+
}
|
|
2517
|
+
return file;
|
|
2518
|
+
}
|
|
2519
|
+
function getFileoverviewComment(sourceFile) {
|
|
2520
|
+
const text = sourceFile.getFullText();
|
|
2521
|
+
const trivia = text.substring(0, sourceFile.getStart());
|
|
2522
|
+
const leadingComments = ts10.getLeadingCommentRanges(trivia, 0);
|
|
2523
|
+
if (!leadingComments || leadingComments.length === 0) {
|
|
2524
|
+
return null;
|
|
2525
|
+
}
|
|
2526
|
+
const comment = leadingComments[0];
|
|
2527
|
+
if (comment.kind !== ts10.SyntaxKind.MultiLineCommentTrivia) {
|
|
2528
|
+
return null;
|
|
2529
|
+
}
|
|
2530
|
+
if (text.substring(comment.end, comment.end + 2) !== "\n\n") {
|
|
2531
|
+
return null;
|
|
2532
|
+
}
|
|
2533
|
+
const commentText = text.substring(comment.pos, comment.end);
|
|
2534
|
+
if (commentText.indexOf("@license") !== -1) {
|
|
2535
|
+
return null;
|
|
2536
|
+
}
|
|
2537
|
+
return commentText;
|
|
2538
|
+
}
|
|
2539
|
+
function wrapInNoSideEffects(expr) {
|
|
2540
|
+
const noSideEffects = ts10.createPropertyAccess(ts10.createIdentifier("i0"), "\u0275noSideEffects");
|
|
2541
|
+
return ts10.createCall(noSideEffects, [], [
|
|
2542
|
+
ts10.createFunctionExpression([], void 0, void 0, [], [], void 0, ts10.createBlock([
|
|
2543
|
+
ts10.createReturn(expr)
|
|
2544
|
+
]))
|
|
2545
|
+
]);
|
|
2546
|
+
}
|
|
2547
|
+
function updateInitializers(stmt, update) {
|
|
2548
|
+
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)))));
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/reference_tagger.mjs
|
|
2552
|
+
var ShimReferenceTagger = class {
|
|
2553
|
+
constructor(shimExtensions) {
|
|
2554
|
+
this.tagged = /* @__PURE__ */ new Set();
|
|
2555
|
+
this.enabled = true;
|
|
2556
|
+
this.suffixes = shimExtensions.map((extension) => `.${extension}.ts`);
|
|
2557
|
+
}
|
|
2558
|
+
tag(sf) {
|
|
2559
|
+
if (!this.enabled || sf.isDeclarationFile || isShim(sf) || this.tagged.has(sf) || !isNonDeclarationTsPath(sf.fileName)) {
|
|
2560
|
+
return;
|
|
2561
|
+
}
|
|
2562
|
+
const ext = sfExtensionData(sf);
|
|
2563
|
+
if (ext.originalReferencedFiles === null) {
|
|
2564
|
+
ext.originalReferencedFiles = sf.referencedFiles;
|
|
2565
|
+
}
|
|
2566
|
+
const referencedFiles = [...ext.originalReferencedFiles];
|
|
2567
|
+
const sfPath = absoluteFromSourceFile(sf);
|
|
2568
|
+
for (const suffix of this.suffixes) {
|
|
2569
|
+
referencedFiles.push({
|
|
2570
|
+
fileName: makeShimFileName(sfPath, suffix),
|
|
2571
|
+
pos: 0,
|
|
2572
|
+
end: 0
|
|
2573
|
+
});
|
|
2574
|
+
}
|
|
2575
|
+
ext.taggedReferenceFiles = referencedFiles;
|
|
2576
|
+
sf.referencedFiles = referencedFiles;
|
|
2577
|
+
this.tagged.add(sf);
|
|
2578
|
+
}
|
|
2579
|
+
finalize() {
|
|
2580
|
+
this.enabled = false;
|
|
2581
|
+
this.tagged.clear();
|
|
2582
|
+
}
|
|
2583
|
+
};
|
|
2333
2584
|
|
|
2334
|
-
// bazel-out/
|
|
2585
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/summary_generator.mjs
|
|
2586
|
+
import ts11 from "typescript";
|
|
2587
|
+
var SummaryGenerator = class {
|
|
2588
|
+
constructor() {
|
|
2589
|
+
this.shouldEmit = true;
|
|
2590
|
+
this.extensionPrefix = "ngsummary";
|
|
2591
|
+
}
|
|
2592
|
+
generateShimForFile(sf, genFilePath) {
|
|
2593
|
+
const symbolNames = [];
|
|
2594
|
+
for (const stmt of sf.statements) {
|
|
2595
|
+
if (ts11.isClassDeclaration(stmt)) {
|
|
2596
|
+
if (!isExported2(stmt) || stmt.decorators === void 0 || stmt.name === void 0) {
|
|
2597
|
+
continue;
|
|
2598
|
+
}
|
|
2599
|
+
symbolNames.push(stmt.name.text);
|
|
2600
|
+
} else if (ts11.isExportDeclaration(stmt)) {
|
|
2601
|
+
if (stmt.exportClause === void 0 || stmt.moduleSpecifier !== void 0 || !ts11.isNamedExports(stmt.exportClause)) {
|
|
2602
|
+
continue;
|
|
2603
|
+
}
|
|
2604
|
+
for (const specifier of stmt.exportClause.elements) {
|
|
2605
|
+
symbolNames.push(specifier.name.text);
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
const varLines = symbolNames.map((name) => `export const ${name}NgSummary: any = null;`);
|
|
2610
|
+
if (varLines.length === 0) {
|
|
2611
|
+
varLines.push(`export const \u0275empty = null;`);
|
|
2612
|
+
}
|
|
2613
|
+
const sourceText = varLines.join("\n");
|
|
2614
|
+
const genFile = ts11.createSourceFile(genFilePath, sourceText, sf.languageVersion, true, ts11.ScriptKind.TS);
|
|
2615
|
+
if (sf.moduleName !== void 0) {
|
|
2616
|
+
genFile.moduleName = generatedModuleName(sf.moduleName, sf.fileName, ".ngsummary");
|
|
2617
|
+
}
|
|
2618
|
+
return genFile;
|
|
2619
|
+
}
|
|
2620
|
+
};
|
|
2621
|
+
function isExported2(decl) {
|
|
2622
|
+
return decl.modifiers !== void 0 && decl.modifiers.some((mod) => mod.kind == ts11.SyntaxKind.ExportKeyword);
|
|
2623
|
+
}
|
|
2624
|
+
|
|
2625
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/trait.mjs
|
|
2335
2626
|
var TraitState;
|
|
2336
2627
|
(function(TraitState2) {
|
|
2337
2628
|
TraitState2[TraitState2["Pending"] = 0] = "Pending";
|
|
@@ -2386,7 +2677,7 @@ var TraitImpl = class {
|
|
|
2386
2677
|
}
|
|
2387
2678
|
};
|
|
2388
2679
|
|
|
2389
|
-
// bazel-out/
|
|
2680
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
2390
2681
|
var TraitCompiler = class {
|
|
2391
2682
|
constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater) {
|
|
2392
2683
|
this.handlers = handlers;
|
|
@@ -2397,11 +2688,11 @@ var TraitCompiler = class {
|
|
|
2397
2688
|
this.compilationMode = compilationMode;
|
|
2398
2689
|
this.dtsTransforms = dtsTransforms;
|
|
2399
2690
|
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();
|
|
2691
|
+
this.classes = /* @__PURE__ */ new Map();
|
|
2692
|
+
this.fileToClasses = /* @__PURE__ */ new Map();
|
|
2693
|
+
this.filesWithoutTraits = /* @__PURE__ */ new Set();
|
|
2694
|
+
this.reexportMap = /* @__PURE__ */ new Map();
|
|
2695
|
+
this.handlersByName = /* @__PURE__ */ new Map();
|
|
2405
2696
|
for (const handler of handlers) {
|
|
2406
2697
|
this.handlersByName.set(handler.name, handler);
|
|
2407
2698
|
}
|
|
@@ -2413,7 +2704,7 @@ var TraitCompiler = class {
|
|
|
2413
2704
|
return this.analyze(sf, true);
|
|
2414
2705
|
}
|
|
2415
2706
|
analyze(sf, preanalyze) {
|
|
2416
|
-
if (sf.isDeclarationFile) {
|
|
2707
|
+
if (sf.isDeclarationFile || isShim(sf)) {
|
|
2417
2708
|
return void 0;
|
|
2418
2709
|
}
|
|
2419
2710
|
const promises = [];
|
|
@@ -2434,9 +2725,12 @@ var TraitCompiler = class {
|
|
|
2434
2725
|
if (this.reflector.isClass(node)) {
|
|
2435
2726
|
this.analyzeClass(node, preanalyze ? promises : null);
|
|
2436
2727
|
}
|
|
2437
|
-
|
|
2728
|
+
ts12.forEachChild(node, visit2);
|
|
2438
2729
|
};
|
|
2439
2730
|
visit2(sf);
|
|
2731
|
+
if (!this.fileToClasses.has(sf)) {
|
|
2732
|
+
this.filesWithoutTraits.add(sf);
|
|
2733
|
+
}
|
|
2440
2734
|
if (preanalyze && promises.length > 0) {
|
|
2441
2735
|
return Promise.all(promises).then(() => void 0);
|
|
2442
2736
|
} else {
|
|
@@ -2461,7 +2755,7 @@ var TraitCompiler = class {
|
|
|
2461
2755
|
return records;
|
|
2462
2756
|
}
|
|
2463
2757
|
getAnalyzedRecords() {
|
|
2464
|
-
const result = new Map();
|
|
2758
|
+
const result = /* @__PURE__ */ new Map();
|
|
2465
2759
|
for (const [sf, classes] of this.fileToClasses) {
|
|
2466
2760
|
const records = [];
|
|
2467
2761
|
for (const clazz of classes) {
|
|
@@ -2499,7 +2793,7 @@ var TraitCompiler = class {
|
|
|
2499
2793
|
this.classes.set(record.node, record);
|
|
2500
2794
|
const sf = record.node.getSourceFile();
|
|
2501
2795
|
if (!this.fileToClasses.has(sf)) {
|
|
2502
|
-
this.fileToClasses.set(sf, new Set());
|
|
2796
|
+
this.fileToClasses.set(sf, /* @__PURE__ */ new Set());
|
|
2503
2797
|
}
|
|
2504
2798
|
this.fileToClasses.get(sf).add(record.node);
|
|
2505
2799
|
}
|
|
@@ -2533,7 +2827,7 @@ var TraitCompiler = class {
|
|
|
2533
2827
|
this.classes.set(clazz, record);
|
|
2534
2828
|
const sf = clazz.getSourceFile();
|
|
2535
2829
|
if (!this.fileToClasses.has(sf)) {
|
|
2536
|
-
this.fileToClasses.set(sf, new Set());
|
|
2830
|
+
this.fileToClasses.set(sf, /* @__PURE__ */ new Set());
|
|
2537
2831
|
}
|
|
2538
2832
|
this.fileToClasses.get(sf).add(clazz);
|
|
2539
2833
|
} else {
|
|
@@ -2545,7 +2839,7 @@ var TraitCompiler = class {
|
|
|
2545
2839
|
}
|
|
2546
2840
|
if (isPrimaryHandler && record.hasPrimaryHandler) {
|
|
2547
2841
|
record.metaDiagnostics = [{
|
|
2548
|
-
category:
|
|
2842
|
+
category: ts12.DiagnosticCategory.Error,
|
|
2549
2843
|
code: Number("-99" + ErrorCode.DECORATOR_COLLISION),
|
|
2550
2844
|
file: getSourceFile(clazz),
|
|
2551
2845
|
start: clazz.getStart(void 0, false),
|
|
@@ -2662,7 +2956,7 @@ var TraitCompiler = class {
|
|
|
2662
2956
|
if (result.reexports !== void 0) {
|
|
2663
2957
|
const fileName = clazz.getSourceFile().fileName;
|
|
2664
2958
|
if (!this.reexportMap.has(fileName)) {
|
|
2665
|
-
this.reexportMap.set(fileName, new Map());
|
|
2959
|
+
this.reexportMap.set(fileName, /* @__PURE__ */ new Map());
|
|
2666
2960
|
}
|
|
2667
2961
|
const fileReexports = this.reexportMap.get(fileName);
|
|
2668
2962
|
for (const reexport of result.reexports) {
|
|
@@ -2753,7 +3047,7 @@ var TraitCompiler = class {
|
|
|
2753
3047
|
}
|
|
2754
3048
|
}
|
|
2755
3049
|
compile(clazz, constantPool) {
|
|
2756
|
-
const original =
|
|
3050
|
+
const original = ts12.getOriginalNode(clazz);
|
|
2757
3051
|
if (!this.reflector.isClass(clazz) || !this.reflector.isClass(original) || !this.classes.has(original)) {
|
|
2758
3052
|
return null;
|
|
2759
3053
|
}
|
|
@@ -2784,7 +3078,7 @@ var TraitCompiler = class {
|
|
|
2784
3078
|
return res.length > 0 ? res : null;
|
|
2785
3079
|
}
|
|
2786
3080
|
decoratorsFor(node) {
|
|
2787
|
-
const original =
|
|
3081
|
+
const original = ts12.getOriginalNode(node);
|
|
2788
3082
|
if (!this.reflector.isClass(original) || !this.classes.has(original)) {
|
|
2789
3083
|
return [];
|
|
2790
3084
|
}
|
|
@@ -2794,7 +3088,7 @@ var TraitCompiler = class {
|
|
|
2794
3088
|
if (trait.state !== TraitState.Resolved) {
|
|
2795
3089
|
continue;
|
|
2796
3090
|
}
|
|
2797
|
-
if (trait.detected.trigger !== null &&
|
|
3091
|
+
if (trait.detected.trigger !== null && ts12.isDecorator(trait.detected.trigger)) {
|
|
2798
3092
|
decorators.push(trait.detected.trigger);
|
|
2799
3093
|
}
|
|
2800
3094
|
}
|
|
@@ -2823,24 +3117,24 @@ var TraitCompiler = class {
|
|
|
2823
3117
|
}
|
|
2824
3118
|
};
|
|
2825
3119
|
|
|
2826
|
-
// bazel-out/
|
|
2827
|
-
import
|
|
3120
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
3121
|
+
import ts14 from "typescript";
|
|
2828
3122
|
|
|
2829
|
-
// bazel-out/
|
|
2830
|
-
import
|
|
3123
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/utils.mjs
|
|
3124
|
+
import ts13 from "typescript";
|
|
2831
3125
|
function addImports(importManager, sf, extraStatements = []) {
|
|
2832
3126
|
const addedImports = importManager.getAllImports(sf.fileName).map((i) => {
|
|
2833
|
-
const qualifier =
|
|
2834
|
-
const importClause =
|
|
2835
|
-
const decl =
|
|
2836
|
-
|
|
3127
|
+
const qualifier = ts13.createIdentifier(i.qualifier.text);
|
|
3128
|
+
const importClause = ts13.createImportClause(void 0, ts13.createNamespaceImport(qualifier));
|
|
3129
|
+
const decl = ts13.createImportDeclaration(void 0, void 0, importClause, ts13.createLiteral(i.specifier));
|
|
3130
|
+
ts13.setOriginalNode(i.qualifier, decl);
|
|
2837
3131
|
return decl;
|
|
2838
3132
|
});
|
|
2839
3133
|
const existingImports = sf.statements.filter((stmt) => isImportStatement(stmt));
|
|
2840
3134
|
const body = sf.statements.filter((stmt) => !isImportStatement(stmt));
|
|
2841
3135
|
if (addedImports.length > 0) {
|
|
2842
|
-
const fileoverviewAnchorStmt =
|
|
2843
|
-
return
|
|
3136
|
+
const fileoverviewAnchorStmt = ts13.createNotEmittedStatement(sf);
|
|
3137
|
+
return ts13.updateSourceFileNode(sf, ts13.createNodeArray([
|
|
2844
3138
|
fileoverviewAnchorStmt,
|
|
2845
3139
|
...existingImports,
|
|
2846
3140
|
...addedImports,
|
|
@@ -2851,13 +3145,13 @@ function addImports(importManager, sf, extraStatements = []) {
|
|
|
2851
3145
|
return sf;
|
|
2852
3146
|
}
|
|
2853
3147
|
function isImportStatement(stmt) {
|
|
2854
|
-
return
|
|
3148
|
+
return ts13.isImportDeclaration(stmt) || ts13.isImportEqualsDeclaration(stmt) || ts13.isNamespaceImport(stmt);
|
|
2855
3149
|
}
|
|
2856
3150
|
|
|
2857
|
-
// bazel-out/
|
|
3151
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
2858
3152
|
var DtsTransformRegistry = class {
|
|
2859
3153
|
constructor() {
|
|
2860
|
-
this.ivyDeclarationTransforms = new Map();
|
|
3154
|
+
this.ivyDeclarationTransforms = /* @__PURE__ */ new Map();
|
|
2861
3155
|
}
|
|
2862
3156
|
getIvyDeclarationTransform(sf) {
|
|
2863
3157
|
if (!this.ivyDeclarationTransforms.has(sf)) {
|
|
@@ -2869,7 +3163,7 @@ var DtsTransformRegistry = class {
|
|
|
2869
3163
|
if (!sf.isDeclarationFile) {
|
|
2870
3164
|
return null;
|
|
2871
3165
|
}
|
|
2872
|
-
const originalSf =
|
|
3166
|
+
const originalSf = ts14.getOriginalNode(sf);
|
|
2873
3167
|
let transforms = null;
|
|
2874
3168
|
if (this.ivyDeclarationTransforms.has(originalSf)) {
|
|
2875
3169
|
transforms = [];
|
|
@@ -2882,7 +3176,7 @@ function declarationTransformFactory(transformRegistry, importRewriter, importPr
|
|
|
2882
3176
|
return (context) => {
|
|
2883
3177
|
const transformer = new DtsTransformer(context, importRewriter, importPrefix);
|
|
2884
3178
|
return (fileOrBundle) => {
|
|
2885
|
-
if (
|
|
3179
|
+
if (ts14.isBundle(fileOrBundle)) {
|
|
2886
3180
|
return fileOrBundle;
|
|
2887
3181
|
}
|
|
2888
3182
|
const transforms = transformRegistry.getAllTransforms(fileOrBundle);
|
|
@@ -2902,15 +3196,15 @@ var DtsTransformer = class {
|
|
|
2902
3196
|
transform(sf, transforms) {
|
|
2903
3197
|
const imports = new ImportManager(this.importRewriter, this.importPrefix);
|
|
2904
3198
|
const visitor = (node) => {
|
|
2905
|
-
if (
|
|
3199
|
+
if (ts14.isClassDeclaration(node)) {
|
|
2906
3200
|
return this.transformClassDeclaration(node, transforms, imports);
|
|
2907
|
-
} else if (
|
|
3201
|
+
} else if (ts14.isFunctionDeclaration(node)) {
|
|
2908
3202
|
return this.transformFunctionDeclaration(node, transforms, imports);
|
|
2909
3203
|
} else {
|
|
2910
|
-
return
|
|
3204
|
+
return ts14.visitEachChild(node, visitor, this.ctx);
|
|
2911
3205
|
}
|
|
2912
3206
|
};
|
|
2913
|
-
sf =
|
|
3207
|
+
sf = ts14.visitNode(sf, visitor);
|
|
2914
3208
|
return addImports(imports, sf);
|
|
2915
3209
|
}
|
|
2916
3210
|
transformClassDeclaration(clazz, transforms, imports) {
|
|
@@ -2938,7 +3232,7 @@ var DtsTransformer = class {
|
|
|
2938
3232
|
}
|
|
2939
3233
|
}
|
|
2940
3234
|
if (elementsChanged && clazz === newClazz) {
|
|
2941
|
-
newClazz =
|
|
3235
|
+
newClazz = ts14.updateClassDeclaration(clazz, clazz.decorators, clazz.modifiers, clazz.name, clazz.typeParameters, clazz.heritageClauses, elements);
|
|
2942
3236
|
}
|
|
2943
3237
|
return newClazz;
|
|
2944
3238
|
}
|
|
@@ -2954,44 +3248,44 @@ var DtsTransformer = class {
|
|
|
2954
3248
|
};
|
|
2955
3249
|
var IvyDeclarationDtsTransform = class {
|
|
2956
3250
|
constructor() {
|
|
2957
|
-
this.declarationFields = new Map();
|
|
3251
|
+
this.declarationFields = /* @__PURE__ */ new Map();
|
|
2958
3252
|
}
|
|
2959
3253
|
addFields(decl, fields) {
|
|
2960
3254
|
this.declarationFields.set(decl, fields);
|
|
2961
3255
|
}
|
|
2962
3256
|
transformClass(clazz, members, imports) {
|
|
2963
|
-
const original =
|
|
3257
|
+
const original = ts14.getOriginalNode(clazz);
|
|
2964
3258
|
if (!this.declarationFields.has(original)) {
|
|
2965
3259
|
return clazz;
|
|
2966
3260
|
}
|
|
2967
3261
|
const fields = this.declarationFields.get(original);
|
|
2968
3262
|
const newMembers = fields.map((decl) => {
|
|
2969
|
-
const modifiers = [
|
|
3263
|
+
const modifiers = [ts14.createModifier(ts14.SyntaxKind.StaticKeyword)];
|
|
2970
3264
|
const typeRef = translateType(decl.type, imports);
|
|
2971
3265
|
markForEmitAsSingleLine(typeRef);
|
|
2972
|
-
return
|
|
3266
|
+
return ts14.createProperty(void 0, modifiers, decl.name, void 0, typeRef, void 0);
|
|
2973
3267
|
});
|
|
2974
|
-
return
|
|
3268
|
+
return ts14.updateClassDeclaration(clazz, clazz.decorators, clazz.modifiers, clazz.name, clazz.typeParameters, clazz.heritageClauses, [...members, ...newMembers]);
|
|
2975
3269
|
}
|
|
2976
3270
|
};
|
|
2977
3271
|
function markForEmitAsSingleLine(node) {
|
|
2978
|
-
|
|
2979
|
-
|
|
3272
|
+
ts14.setEmitFlags(node, ts14.EmitFlags.SingleLine);
|
|
3273
|
+
ts14.forEachChild(node, markForEmitAsSingleLine);
|
|
2980
3274
|
}
|
|
2981
3275
|
|
|
2982
|
-
// bazel-out/
|
|
3276
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
2983
3277
|
import { ConstantPool } from "@angular/compiler";
|
|
2984
|
-
import
|
|
3278
|
+
import ts16 from "typescript";
|
|
2985
3279
|
|
|
2986
|
-
// bazel-out/
|
|
2987
|
-
import
|
|
3280
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
|
|
3281
|
+
import ts15 from "typescript";
|
|
2988
3282
|
function visit(node, visitor, context) {
|
|
2989
3283
|
return visitor._visit(node, context);
|
|
2990
3284
|
}
|
|
2991
3285
|
var Visitor = class {
|
|
2992
3286
|
constructor() {
|
|
2993
|
-
this._before = new Map();
|
|
2994
|
-
this._after = new Map();
|
|
3287
|
+
this._before = /* @__PURE__ */ new Map();
|
|
3288
|
+
this._after = /* @__PURE__ */ new Map();
|
|
2995
3289
|
}
|
|
2996
3290
|
_visitListEntryNode(node, visitor) {
|
|
2997
3291
|
const result = visitor(node);
|
|
@@ -3008,8 +3302,8 @@ var Visitor = class {
|
|
|
3008
3302
|
}
|
|
3009
3303
|
_visit(node, context) {
|
|
3010
3304
|
let visitedNode = null;
|
|
3011
|
-
node =
|
|
3012
|
-
if (
|
|
3305
|
+
node = ts15.visitEachChild(node, (child) => this._visit(child, context), context);
|
|
3306
|
+
if (ts15.isClassDeclaration(node)) {
|
|
3013
3307
|
visitedNode = this._visitListEntryNode(node, (node2) => this.visitClassDeclaration(node2));
|
|
3014
3308
|
} else {
|
|
3015
3309
|
visitedNode = this.visitOtherNode(node);
|
|
@@ -3023,7 +3317,7 @@ var Visitor = class {
|
|
|
3023
3317
|
if (node.statements.every((stmt) => !this._before.has(stmt) && !this._after.has(stmt))) {
|
|
3024
3318
|
return node;
|
|
3025
3319
|
}
|
|
3026
|
-
const clone =
|
|
3320
|
+
const clone = ts15.getMutableClone(node);
|
|
3027
3321
|
const newStatements = [];
|
|
3028
3322
|
clone.statements.forEach((stmt) => {
|
|
3029
3323
|
if (this._before.has(stmt)) {
|
|
@@ -3036,7 +3330,7 @@ var Visitor = class {
|
|
|
3036
3330
|
this._after.delete(stmt);
|
|
3037
3331
|
}
|
|
3038
3332
|
});
|
|
3039
|
-
clone.statements =
|
|
3333
|
+
clone.statements = ts15.createNodeArray(newStatements, node.statements.hasTrailingComma);
|
|
3040
3334
|
return clone;
|
|
3041
3335
|
}
|
|
3042
3336
|
};
|
|
@@ -3045,8 +3339,8 @@ function hasStatements(node) {
|
|
|
3045
3339
|
return block.statements !== void 0 && Array.isArray(block.statements);
|
|
3046
3340
|
}
|
|
3047
3341
|
|
|
3048
|
-
// bazel-out/
|
|
3049
|
-
var NO_DECORATORS = new Set();
|
|
3342
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
3343
|
+
var NO_DECORATORS = /* @__PURE__ */ new Set();
|
|
3050
3344
|
var CLOSURE_FILE_OVERVIEW_REGEXP = /\s+@fileoverview\s+/i;
|
|
3051
3345
|
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, perf, isCore, isClosureCompilerEnabled) {
|
|
3052
3346
|
const recordWrappedNode = createRecorderFn(defaultImportTracker);
|
|
@@ -3061,7 +3355,7 @@ var IvyCompilationVisitor = class extends Visitor {
|
|
|
3061
3355
|
super();
|
|
3062
3356
|
this.compilation = compilation;
|
|
3063
3357
|
this.constantPool = constantPool;
|
|
3064
|
-
this.classCompilationMap = new Map();
|
|
3358
|
+
this.classCompilationMap = /* @__PURE__ */ new Map();
|
|
3065
3359
|
}
|
|
3066
3360
|
visitClassDeclaration(node) {
|
|
3067
3361
|
const result = this.compilation.compile(node, this.constantPool);
|
|
@@ -3094,14 +3388,14 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
3094
3388
|
const members = [...node.members];
|
|
3095
3389
|
for (const field of this.classCompilationMap.get(node)) {
|
|
3096
3390
|
const exprNode = translateExpression(field.initializer, this.importManager, translateOptions);
|
|
3097
|
-
const property =
|
|
3391
|
+
const property = ts16.createProperty(void 0, [ts16.createToken(ts16.SyntaxKind.StaticKeyword)], field.name, void 0, void 0, exprNode);
|
|
3098
3392
|
if (this.isClosureCompilerEnabled) {
|
|
3099
|
-
|
|
3393
|
+
ts16.addSyntheticLeadingComment(property, ts16.SyntaxKind.MultiLineCommentTrivia, "* @nocollapse ", false);
|
|
3100
3394
|
}
|
|
3101
3395
|
field.statements.map((stmt) => translateStatement(stmt, this.importManager, translateOptions)).forEach((stmt) => statements.push(stmt));
|
|
3102
3396
|
members.push(property);
|
|
3103
3397
|
}
|
|
3104
|
-
node =
|
|
3398
|
+
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
3399
|
return { node, after: statements };
|
|
3106
3400
|
}
|
|
3107
3401
|
_angularCoreDecorators(decl) {
|
|
@@ -3130,25 +3424,25 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
3130
3424
|
if (filtered.length === 0) {
|
|
3131
3425
|
return void 0;
|
|
3132
3426
|
}
|
|
3133
|
-
const array =
|
|
3427
|
+
const array = ts16.createNodeArray(filtered);
|
|
3134
3428
|
array.pos = node.decorators.pos;
|
|
3135
3429
|
array.end = node.decorators.end;
|
|
3136
3430
|
return array;
|
|
3137
3431
|
}
|
|
3138
3432
|
_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 (
|
|
3433
|
+
if (ts16.isParameter(node)) {
|
|
3434
|
+
node = ts16.updateParameter(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer);
|
|
3435
|
+
} else if (ts16.isMethodDeclaration(node) && node.decorators !== void 0) {
|
|
3436
|
+
node = ts16.updateMethod(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body);
|
|
3437
|
+
} else if (ts16.isPropertyDeclaration(node) && node.decorators !== void 0) {
|
|
3438
|
+
node = ts16.updateProperty(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.questionToken, node.type, node.initializer);
|
|
3439
|
+
} else if (ts16.isGetAccessor(node)) {
|
|
3440
|
+
node = ts16.updateGetAccessor(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.parameters, node.type, node.body);
|
|
3441
|
+
} else if (ts16.isSetAccessor(node)) {
|
|
3442
|
+
node = ts16.updateSetAccessor(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.parameters, node.body);
|
|
3443
|
+
} else if (ts16.isConstructorDeclaration(node)) {
|
|
3150
3444
|
const parameters = node.parameters.map((param) => this._stripAngularDecorators(param));
|
|
3151
|
-
node =
|
|
3445
|
+
node = ts16.updateConstructor(node, node.decorators, node.modifiers, parameters, node.body);
|
|
3152
3446
|
}
|
|
3153
3447
|
return node;
|
|
3154
3448
|
}
|
|
@@ -3160,7 +3454,7 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
3160
3454
|
visit(file, compilationVisitor, context);
|
|
3161
3455
|
const transformationVisitor = new IvyTransformationVisitor(compilation, compilationVisitor.classCompilationMap, reflector, importManager, recordWrappedNode, isClosureCompilerEnabled, isCore);
|
|
3162
3456
|
let sf = visit(file, transformationVisitor, context);
|
|
3163
|
-
const downlevelTranslatedCode = getLocalizeCompileTarget(context) <
|
|
3457
|
+
const downlevelTranslatedCode = getLocalizeCompileTarget(context) < ts16.ScriptTarget.ES2015;
|
|
3164
3458
|
const constants = constantPool.statements.map((stmt) => translateStatement(stmt, importManager, {
|
|
3165
3459
|
recordWrappedNode,
|
|
3166
3460
|
downlevelTaggedTemplates: downlevelTranslatedCode,
|
|
@@ -3175,17 +3469,17 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
3175
3469
|
return sf;
|
|
3176
3470
|
}
|
|
3177
3471
|
function getLocalizeCompileTarget(context) {
|
|
3178
|
-
const target = context.getCompilerOptions().target ||
|
|
3179
|
-
return target !==
|
|
3472
|
+
const target = context.getCompilerOptions().target || ts16.ScriptTarget.ES2015;
|
|
3473
|
+
return target !== ts16.ScriptTarget.JSON ? target : ts16.ScriptTarget.ES2015;
|
|
3180
3474
|
}
|
|
3181
3475
|
function getFileOverviewComment(statements) {
|
|
3182
3476
|
if (statements.length > 0) {
|
|
3183
3477
|
const host = statements[0];
|
|
3184
3478
|
let trailing = false;
|
|
3185
|
-
let comments =
|
|
3479
|
+
let comments = ts16.getSyntheticLeadingComments(host);
|
|
3186
3480
|
if (!comments || comments.length === 0) {
|
|
3187
3481
|
trailing = true;
|
|
3188
|
-
comments =
|
|
3482
|
+
comments = ts16.getSyntheticTrailingComments(host);
|
|
3189
3483
|
}
|
|
3190
3484
|
if (comments && comments.length > 0 && CLOSURE_FILE_OVERVIEW_REGEXP.test(comments[0].text)) {
|
|
3191
3485
|
return { comments, host, trailing };
|
|
@@ -3197,22 +3491,22 @@ function setFileOverviewComment(sf, fileoverview) {
|
|
|
3197
3491
|
const { comments, host, trailing } = fileoverview;
|
|
3198
3492
|
if (sf.statements.length > 0 && host !== sf.statements[0]) {
|
|
3199
3493
|
if (trailing) {
|
|
3200
|
-
|
|
3494
|
+
ts16.setSyntheticTrailingComments(host, void 0);
|
|
3201
3495
|
} else {
|
|
3202
|
-
|
|
3496
|
+
ts16.setSyntheticLeadingComments(host, void 0);
|
|
3203
3497
|
}
|
|
3204
|
-
|
|
3498
|
+
ts16.setSyntheticLeadingComments(sf.statements[0], comments);
|
|
3205
3499
|
}
|
|
3206
3500
|
}
|
|
3207
3501
|
function maybeFilterDecorator(decorators, toRemove) {
|
|
3208
3502
|
if (decorators === void 0) {
|
|
3209
3503
|
return void 0;
|
|
3210
3504
|
}
|
|
3211
|
-
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) =>
|
|
3505
|
+
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) => ts16.getOriginalNode(dec) === decToRemove) === void 0);
|
|
3212
3506
|
if (filtered.length === 0) {
|
|
3213
3507
|
return void 0;
|
|
3214
3508
|
}
|
|
3215
|
-
return
|
|
3509
|
+
return ts16.createNodeArray(filtered);
|
|
3216
3510
|
}
|
|
3217
3511
|
function isFromAngularCore(decorator) {
|
|
3218
3512
|
return decorator.import !== null && decorator.import.from === "@angular/core";
|
|
@@ -3226,8 +3520,8 @@ function createRecorderFn(defaultImportTracker) {
|
|
|
3226
3520
|
};
|
|
3227
3521
|
}
|
|
3228
3522
|
|
|
3229
|
-
// bazel-out/
|
|
3230
|
-
import
|
|
3523
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/diagnostics.mjs
|
|
3524
|
+
import ts17 from "typescript";
|
|
3231
3525
|
function createValueHasWrongTypeError(node, value, messageText) {
|
|
3232
3526
|
var _a;
|
|
3233
3527
|
let chainedMessage;
|
|
@@ -3245,11 +3539,11 @@ function createValueHasWrongTypeError(node, value, messageText) {
|
|
|
3245
3539
|
}
|
|
3246
3540
|
const chain = {
|
|
3247
3541
|
messageText,
|
|
3248
|
-
category:
|
|
3542
|
+
category: ts17.DiagnosticCategory.Error,
|
|
3249
3543
|
code: 0,
|
|
3250
3544
|
next: [{
|
|
3251
3545
|
messageText: chainedMessage,
|
|
3252
|
-
category:
|
|
3546
|
+
category: ts17.DiagnosticCategory.Message,
|
|
3253
3547
|
code: 0
|
|
3254
3548
|
}]
|
|
3255
3549
|
};
|
|
@@ -3323,11 +3617,11 @@ function getInheritedUndecoratedCtorDiagnostic(node, baseClass, reader) {
|
|
|
3323
3617
|
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
3618
|
}
|
|
3325
3619
|
|
|
3326
|
-
// bazel-out/
|
|
3620
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
|
|
3327
3621
|
import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, createMayBeForwardRefExpression, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr3, FactoryTarget, getSafePropertyAccessString, makeBindingParser, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr3 } from "@angular/compiler";
|
|
3328
|
-
import
|
|
3622
|
+
import ts19 from "typescript";
|
|
3329
3623
|
|
|
3330
|
-
// bazel-out/
|
|
3624
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/factory.mjs
|
|
3331
3625
|
import { compileDeclareFactoryFunction, compileFactoryFunction } from "@angular/compiler";
|
|
3332
3626
|
function compileNgFactoryDefField(metadata) {
|
|
3333
3627
|
const res = compileFactoryFunction(metadata);
|
|
@@ -3338,9 +3632,9 @@ function compileDeclareFactory(metadata) {
|
|
|
3338
3632
|
return { name: "\u0275fac", initializer: res.expression, statements: res.statements, type: res.type };
|
|
3339
3633
|
}
|
|
3340
3634
|
|
|
3341
|
-
// bazel-out/
|
|
3635
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/metadata.mjs
|
|
3342
3636
|
import { FunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
|
|
3343
|
-
import
|
|
3637
|
+
import ts18 from "typescript";
|
|
3344
3638
|
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
|
|
3345
3639
|
if (!reflection.isClass(clazz)) {
|
|
3346
3640
|
return null;
|
|
@@ -3354,7 +3648,7 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
3354
3648
|
if (ngClassDecorators.length === 0) {
|
|
3355
3649
|
return null;
|
|
3356
3650
|
}
|
|
3357
|
-
const metaDecorators = new WrappedNodeExpr2(
|
|
3651
|
+
const metaDecorators = new WrappedNodeExpr2(ts18.createArrayLiteral(ngClassDecorators));
|
|
3358
3652
|
let metaCtorParameters = null;
|
|
3359
3653
|
const classCtorParameters = reflection.getConstructorParameters(clazz);
|
|
3360
3654
|
if (classCtorParameters !== null) {
|
|
@@ -3374,7 +3668,7 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
3374
3668
|
return classMemberToMetadata((_a = member.nameNode) != null ? _a : member.name, member.decorators, isCore);
|
|
3375
3669
|
});
|
|
3376
3670
|
if (decoratedMembers.length > 0) {
|
|
3377
|
-
metaPropDecorators = new WrappedNodeExpr2(
|
|
3671
|
+
metaPropDecorators = new WrappedNodeExpr2(ts18.createObjectLiteral(decoratedMembers));
|
|
3378
3672
|
}
|
|
3379
3673
|
return {
|
|
3380
3674
|
type: new WrappedNodeExpr2(id),
|
|
@@ -3390,43 +3684,43 @@ function ctorParameterToMetadata(param, isCore) {
|
|
|
3390
3684
|
];
|
|
3391
3685
|
if (param.decorators !== null) {
|
|
3392
3686
|
const ngDecorators = param.decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
3393
|
-
const value = new WrappedNodeExpr2(
|
|
3687
|
+
const value = new WrappedNodeExpr2(ts18.createArrayLiteral(ngDecorators));
|
|
3394
3688
|
mapEntries.push({ key: "decorators", value, quoted: false });
|
|
3395
3689
|
}
|
|
3396
3690
|
return literalMap(mapEntries);
|
|
3397
3691
|
}
|
|
3398
3692
|
function classMemberToMetadata(name, decorators, isCore) {
|
|
3399
3693
|
const ngDecorators = decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
3400
|
-
const decoratorMeta =
|
|
3401
|
-
return
|
|
3694
|
+
const decoratorMeta = ts18.createArrayLiteral(ngDecorators);
|
|
3695
|
+
return ts18.createPropertyAssignment(name, decoratorMeta);
|
|
3402
3696
|
}
|
|
3403
3697
|
function decoratorToMetadata(decorator, wrapFunctionsInParens) {
|
|
3404
3698
|
if (decorator.identifier === null) {
|
|
3405
3699
|
throw new Error("Illegal state: synthesized decorator cannot be emitted in class metadata.");
|
|
3406
3700
|
}
|
|
3407
3701
|
const properties = [
|
|
3408
|
-
|
|
3702
|
+
ts18.createPropertyAssignment("type", ts18.getMutableClone(decorator.identifier))
|
|
3409
3703
|
];
|
|
3410
3704
|
if (decorator.args !== null && decorator.args.length > 0) {
|
|
3411
3705
|
const args = decorator.args.map((arg) => {
|
|
3412
|
-
const expr =
|
|
3706
|
+
const expr = ts18.getMutableClone(arg);
|
|
3413
3707
|
return wrapFunctionsInParens ? wrapFunctionExpressionsInParens(expr) : expr;
|
|
3414
3708
|
});
|
|
3415
|
-
properties.push(
|
|
3709
|
+
properties.push(ts18.createPropertyAssignment("args", ts18.createArrayLiteral(args)));
|
|
3416
3710
|
}
|
|
3417
|
-
return
|
|
3711
|
+
return ts18.createObjectLiteral(properties, true);
|
|
3418
3712
|
}
|
|
3419
3713
|
function isAngularDecorator2(decorator, isCore) {
|
|
3420
3714
|
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
3421
3715
|
}
|
|
3422
3716
|
function removeIdentifierReferences(node, name) {
|
|
3423
|
-
const result =
|
|
3424
|
-
return
|
|
3717
|
+
const result = ts18.transform(node, [(context) => (root) => ts18.visitNode(root, function walk(current) {
|
|
3718
|
+
return ts18.isIdentifier(current) && current.text === name ? ts18.createIdentifier(current.text) : ts18.visitEachChild(current, walk, context);
|
|
3425
3719
|
})]);
|
|
3426
3720
|
return result.transformed[0];
|
|
3427
3721
|
}
|
|
3428
3722
|
|
|
3429
|
-
// bazel-out/
|
|
3723
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
|
|
3430
3724
|
var EMPTY_OBJECT = {};
|
|
3431
3725
|
var FIELD_DECORATORS = [
|
|
3432
3726
|
"Input",
|
|
@@ -3438,7 +3732,7 @@ var FIELD_DECORATORS = [
|
|
|
3438
3732
|
"HostBinding",
|
|
3439
3733
|
"HostListener"
|
|
3440
3734
|
];
|
|
3441
|
-
var LIFECYCLE_HOOKS = new Set([
|
|
3735
|
+
var LIFECYCLE_HOOKS = /* @__PURE__ */ new Set([
|
|
3442
3736
|
"ngOnChanges",
|
|
3443
3737
|
"ngOnInit",
|
|
3444
3738
|
"ngOnDestroy",
|
|
@@ -3641,12 +3935,12 @@ var DirectiveDecoratorHandler = class {
|
|
|
3641
3935
|
function extractDirectiveMetadata(clazz, decorator, reflector, evaluator, isCore, flags, annotateForClosureCompiler, defaultSelector = null) {
|
|
3642
3936
|
let directive;
|
|
3643
3937
|
if (decorator === null || decorator.args === null || decorator.args.length === 0) {
|
|
3644
|
-
directive = new Map();
|
|
3938
|
+
directive = /* @__PURE__ */ new Map();
|
|
3645
3939
|
} else if (decorator.args.length !== 1) {
|
|
3646
3940
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @${decorator.name} decorator`);
|
|
3647
3941
|
} else {
|
|
3648
3942
|
const meta = unwrapExpression(decorator.args[0]);
|
|
3649
|
-
if (!
|
|
3943
|
+
if (!ts19.isObjectLiteralExpression(meta)) {
|
|
3650
3944
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `@${decorator.name} argument must be an object literal`);
|
|
3651
3945
|
}
|
|
3652
3946
|
directive = reflectObjectLiteral(meta);
|
|
@@ -3757,7 +4051,7 @@ function extractQueryMetadata(exprNode, name, args, propertyName, reflector, eva
|
|
|
3757
4051
|
let emitDistinctChangesOnly = emitDistinctChangesOnlyDefaultValue;
|
|
3758
4052
|
if (args.length === 2) {
|
|
3759
4053
|
const optionsExpr = unwrapExpression(args[1]);
|
|
3760
|
-
if (!
|
|
4054
|
+
if (!ts19.isObjectLiteralExpression(optionsExpr)) {
|
|
3761
4055
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, optionsExpr, `@${name} options must be an object literal`);
|
|
3762
4056
|
}
|
|
3763
4057
|
const options = reflectObjectLiteral(optionsExpr);
|
|
@@ -3802,16 +4096,16 @@ function extractQueryMetadata(exprNode, name, args, propertyName, reflector, eva
|
|
|
3802
4096
|
}
|
|
3803
4097
|
function extractQueriesFromDecorator(queryData, reflector, evaluator, isCore) {
|
|
3804
4098
|
const content = [], view = [];
|
|
3805
|
-
if (!
|
|
4099
|
+
if (!ts19.isObjectLiteralExpression(queryData)) {
|
|
3806
4100
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator queries metadata must be an object literal");
|
|
3807
4101
|
}
|
|
3808
4102
|
reflectObjectLiteral(queryData).forEach((queryExpr, propertyName) => {
|
|
3809
4103
|
queryExpr = unwrapExpression(queryExpr);
|
|
3810
|
-
if (!
|
|
4104
|
+
if (!ts19.isNewExpression(queryExpr)) {
|
|
3811
4105
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
3812
4106
|
}
|
|
3813
|
-
const queryType =
|
|
3814
|
-
if (!
|
|
4107
|
+
const queryType = ts19.isPropertyAccessExpression(queryExpr.expression) ? queryExpr.expression.name : queryExpr.expression;
|
|
4108
|
+
if (!ts19.isIdentifier(queryType)) {
|
|
3815
4109
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
3816
4110
|
}
|
|
3817
4111
|
const type = reflector.getImportOfIdentifier(queryType);
|
|
@@ -3981,16 +4275,16 @@ function extractHostBindings(members, evaluator, coreModule, metadata) {
|
|
|
3981
4275
|
});
|
|
3982
4276
|
return bindings;
|
|
3983
4277
|
}
|
|
3984
|
-
var QUERY_TYPES = new Set([
|
|
4278
|
+
var QUERY_TYPES = /* @__PURE__ */ new Set([
|
|
3985
4279
|
"ContentChild",
|
|
3986
4280
|
"ContentChildren",
|
|
3987
4281
|
"ViewChild",
|
|
3988
4282
|
"ViewChildren"
|
|
3989
4283
|
]);
|
|
3990
4284
|
|
|
3991
|
-
// bazel-out/
|
|
4285
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/ng_module.mjs
|
|
3992
4286
|
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
|
|
4287
|
+
import ts20 from "typescript";
|
|
3994
4288
|
var NgModuleSymbol = class extends SemanticSymbol {
|
|
3995
4289
|
constructor() {
|
|
3996
4290
|
super(...arguments);
|
|
@@ -4073,8 +4367,8 @@ var NgModuleDecoratorHandler = class {
|
|
|
4073
4367
|
if (decorator.args === null || decorator.args.length > 1) {
|
|
4074
4368
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @NgModule decorator`);
|
|
4075
4369
|
}
|
|
4076
|
-
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) :
|
|
4077
|
-
if (!
|
|
4370
|
+
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) : ts20.createObjectLiteral([]);
|
|
4371
|
+
if (!ts20.isObjectLiteralExpression(meta)) {
|
|
4078
4372
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@NgModule argument must be an object literal");
|
|
4079
4373
|
}
|
|
4080
4374
|
const ngModule = reflectObjectLiteral(meta);
|
|
@@ -4155,10 +4449,10 @@ var NgModuleDecoratorHandler = class {
|
|
|
4155
4449
|
if (typeNode !== null) {
|
|
4156
4450
|
typeContext = typeNode.getSourceFile();
|
|
4157
4451
|
}
|
|
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));
|
|
4452
|
+
const bootstrap = bootstrapRefs.map((bootstrap2) => this._toR3Reference(bootstrap2.getOriginForDiagnostics(meta, node.name), bootstrap2, valueContext, typeContext));
|
|
4453
|
+
const declarations = declarationRefs.map((decl) => this._toR3Reference(decl.getOriginForDiagnostics(meta, node.name), decl, valueContext, typeContext));
|
|
4454
|
+
const imports = importRefs.map((imp) => this._toR3Reference(imp.getOriginForDiagnostics(meta, node.name), imp, valueContext, typeContext));
|
|
4455
|
+
const exports = exportRefs.map((exp) => this._toR3Reference(exp.getOriginForDiagnostics(meta, node.name), exp, valueContext, typeContext));
|
|
4162
4456
|
const isForwardReference = (ref) => isExpressionForwardReference(ref.value, node.name, valueContext);
|
|
4163
4457
|
const containsForwardDecls = bootstrap.some(isForwardReference) || declarations.some(isForwardReference) || imports.some(isForwardReference) || exports.some(isForwardReference);
|
|
4164
4458
|
const type = wrapTypeReference(this.reflector, node);
|
|
@@ -4254,7 +4548,9 @@ var NgModuleDecoratorHandler = class {
|
|
|
4254
4548
|
const context = getSourceFile(node);
|
|
4255
4549
|
for (const exportRef of analysis.exports) {
|
|
4256
4550
|
if (isNgModule(exportRef.node, scope.compilation)) {
|
|
4257
|
-
|
|
4551
|
+
const type = this.refEmitter.emit(exportRef, context);
|
|
4552
|
+
assertSuccessfulReferenceEmit(type, node, "NgModule");
|
|
4553
|
+
data.injectorImports.push(type.expression);
|
|
4258
4554
|
}
|
|
4259
4555
|
}
|
|
4260
4556
|
for (const decl of analysis.declarations) {
|
|
@@ -4307,11 +4603,21 @@ var NgModuleDecoratorHandler = class {
|
|
|
4307
4603
|
for (const decl of declarations) {
|
|
4308
4604
|
const remoteScope = this.scopeRegistry.getRemoteScope(decl.node);
|
|
4309
4605
|
if (remoteScope !== null) {
|
|
4310
|
-
const directives = remoteScope.directives.map((directive) =>
|
|
4311
|
-
|
|
4606
|
+
const directives = remoteScope.directives.map((directive) => {
|
|
4607
|
+
const type = this.refEmitter.emit(directive, context);
|
|
4608
|
+
assertSuccessfulReferenceEmit(type, node, "directive");
|
|
4609
|
+
return type.expression;
|
|
4610
|
+
});
|
|
4611
|
+
const pipes = remoteScope.pipes.map((pipe) => {
|
|
4612
|
+
const type = this.refEmitter.emit(pipe, context);
|
|
4613
|
+
assertSuccessfulReferenceEmit(type, node, "pipe");
|
|
4614
|
+
return type.expression;
|
|
4615
|
+
});
|
|
4312
4616
|
const directiveArray = new LiteralArrayExpr2(directives);
|
|
4313
4617
|
const pipesArray = new LiteralArrayExpr2(pipes);
|
|
4314
|
-
const
|
|
4618
|
+
const componentType = this.refEmitter.emit(decl, context);
|
|
4619
|
+
assertSuccessfulReferenceEmit(componentType, node, "component");
|
|
4620
|
+
const declExpr = componentType.expression;
|
|
4315
4621
|
const setComponentScope = new ExternalExpr4(R3Identifiers.setComponentScope);
|
|
4316
4622
|
const callExpr = new InvokeFunctionExpr(setComponentScope, [declExpr, directiveArray, pipesArray]);
|
|
4317
4623
|
ngModuleStatements.push(callExpr.toStmt());
|
|
@@ -4336,16 +4642,16 @@ var NgModuleDecoratorHandler = class {
|
|
|
4336
4642
|
];
|
|
4337
4643
|
return res;
|
|
4338
4644
|
}
|
|
4339
|
-
_toR3Reference(valueRef, valueContext, typeContext) {
|
|
4645
|
+
_toR3Reference(origin, valueRef, valueContext, typeContext) {
|
|
4340
4646
|
if (valueRef.hasOwningModuleGuess) {
|
|
4341
|
-
return toR3Reference(valueRef, valueRef, valueContext, valueContext, this.refEmitter);
|
|
4647
|
+
return toR3Reference(origin, valueRef, valueRef, valueContext, valueContext, this.refEmitter);
|
|
4342
4648
|
} else {
|
|
4343
4649
|
let typeRef = valueRef;
|
|
4344
4650
|
let typeNode = this.reflector.getDtsDeclaration(typeRef.node);
|
|
4345
4651
|
if (typeNode !== null && isNamedClassDeclaration(typeNode)) {
|
|
4346
4652
|
typeRef = new Reference(typeNode);
|
|
4347
4653
|
}
|
|
4348
|
-
return toR3Reference(valueRef, typeRef, valueContext, typeContext, this.refEmitter);
|
|
4654
|
+
return toR3Reference(origin, valueRef, typeRef, valueContext, typeContext, this.refEmitter);
|
|
4349
4655
|
}
|
|
4350
4656
|
}
|
|
4351
4657
|
_extractModuleFromModuleWithProvidersFn(node) {
|
|
@@ -4353,10 +4659,10 @@ var NgModuleDecoratorHandler = class {
|
|
|
4353
4659
|
return type && (this._reflectModuleFromTypeParam(type, node) || this._reflectModuleFromLiteralType(type));
|
|
4354
4660
|
}
|
|
4355
4661
|
_reflectModuleFromTypeParam(type, node) {
|
|
4356
|
-
if (!
|
|
4662
|
+
if (!ts20.isTypeReferenceNode(type)) {
|
|
4357
4663
|
return null;
|
|
4358
4664
|
}
|
|
4359
|
-
const typeName = type && (
|
|
4665
|
+
const typeName = type && (ts20.isIdentifier(type.typeName) && type.typeName || ts20.isQualifiedName(type.typeName) && type.typeName.right) || null;
|
|
4360
4666
|
if (typeName === null) {
|
|
4361
4667
|
return null;
|
|
4362
4668
|
}
|
|
@@ -4368,7 +4674,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
4368
4674
|
return null;
|
|
4369
4675
|
}
|
|
4370
4676
|
if (type.typeArguments === void 0 || type.typeArguments.length !== 1) {
|
|
4371
|
-
const parent =
|
|
4677
|
+
const parent = ts20.isMethodDeclaration(node) && ts20.isClassDeclaration(node.parent) ? node.parent : null;
|
|
4372
4678
|
const symbolName = (parent && parent.name ? parent.name.getText() + "." : "") + (node.name ? node.name.getText() : "anonymous");
|
|
4373
4679
|
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
4680
|
}
|
|
@@ -4376,13 +4682,13 @@ var NgModuleDecoratorHandler = class {
|
|
|
4376
4682
|
return typeNodeToValueExpr(arg);
|
|
4377
4683
|
}
|
|
4378
4684
|
_reflectModuleFromLiteralType(type) {
|
|
4379
|
-
if (!
|
|
4685
|
+
if (!ts20.isIntersectionTypeNode(type)) {
|
|
4380
4686
|
return null;
|
|
4381
4687
|
}
|
|
4382
4688
|
for (const t of type.types) {
|
|
4383
|
-
if (
|
|
4689
|
+
if (ts20.isTypeLiteralNode(t)) {
|
|
4384
4690
|
for (const m of t.members) {
|
|
4385
|
-
const ngModuleType =
|
|
4691
|
+
const ngModuleType = ts20.isPropertySignature(m) && ts20.isIdentifier(m.name) && m.name.text === "ngModule" && m.type || null;
|
|
4386
4692
|
const ngModuleExpression = ngModuleType && typeNodeToValueExpr(ngModuleType);
|
|
4387
4693
|
if (ngModuleExpression) {
|
|
4388
4694
|
return ngModuleExpression;
|
|
@@ -4422,8 +4728,8 @@ function isNgModule(node, compilation) {
|
|
|
4422
4728
|
return !compilation.directives.some((directive) => directive.ref.node === node) && !compilation.pipes.some((pipe) => pipe.ref.node === node);
|
|
4423
4729
|
}
|
|
4424
4730
|
|
|
4425
|
-
// bazel-out/
|
|
4426
|
-
var EMPTY_MAP = new Map();
|
|
4731
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/component.mjs
|
|
4732
|
+
var EMPTY_MAP = /* @__PURE__ */ new Map();
|
|
4427
4733
|
var EMPTY_ARRAY = [];
|
|
4428
4734
|
var ComponentSymbol = class extends DirectiveSymbol {
|
|
4429
4735
|
constructor() {
|
|
@@ -4485,10 +4791,10 @@ var ComponentDecoratorHandler = class {
|
|
|
4485
4791
|
this.semanticDepGraphUpdater = semanticDepGraphUpdater;
|
|
4486
4792
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
4487
4793
|
this.perf = perf;
|
|
4488
|
-
this.literalCache = new Map();
|
|
4794
|
+
this.literalCache = /* @__PURE__ */ new Map();
|
|
4489
4795
|
this.elementSchemaRegistry = new DomElementSchemaRegistry();
|
|
4490
|
-
this.preanalyzeTemplateCache = new Map();
|
|
4491
|
-
this.preanalyzeStylesCache = new Map();
|
|
4796
|
+
this.preanalyzeTemplateCache = /* @__PURE__ */ new Map();
|
|
4797
|
+
this.preanalyzeStylesCache = /* @__PURE__ */ new Map();
|
|
4492
4798
|
this.precedence = HandlerPrecedence.PRIMARY;
|
|
4493
4799
|
this.name = ComponentDecoratorHandler.name;
|
|
4494
4800
|
}
|
|
@@ -4743,7 +5049,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4743
5049
|
});
|
|
4744
5050
|
}
|
|
4745
5051
|
typeCheck(ctx, node, meta) {
|
|
4746
|
-
if (this.typeCheckScopeRegistry === null || !
|
|
5052
|
+
if (this.typeCheckScopeRegistry === null || !ts21.isClassDeclaration(node)) {
|
|
4747
5053
|
return;
|
|
4748
5054
|
}
|
|
4749
5055
|
if (meta.isPoisoned && !this.usePoisonedData) {
|
|
@@ -4781,7 +5087,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4781
5087
|
matcher.addSelectables(CssSelector.parse(dir.selector), dir);
|
|
4782
5088
|
}
|
|
4783
5089
|
}
|
|
4784
|
-
const pipes = new Map();
|
|
5090
|
+
const pipes = /* @__PURE__ */ new Map();
|
|
4785
5091
|
for (const pipe of scope.compilation.pipes) {
|
|
4786
5092
|
pipes.set(pipe.name, pipe.ref);
|
|
4787
5093
|
}
|
|
@@ -4789,6 +5095,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4789
5095
|
const bound = binder.bind({ template: metadata.template.nodes });
|
|
4790
5096
|
const usedDirectives = bound.getUsedDirectives().map((directive) => {
|
|
4791
5097
|
const type = this.refEmitter.emit(directive.ref, context);
|
|
5098
|
+
assertSuccessfulReferenceEmit(type, node.name, directive.isComponent ? "component" : "directive");
|
|
4792
5099
|
return {
|
|
4793
5100
|
ref: directive.ref,
|
|
4794
5101
|
type: type.expression,
|
|
@@ -4807,6 +5114,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4807
5114
|
}
|
|
4808
5115
|
const pipe = pipes.get(pipeName);
|
|
4809
5116
|
const type = this.refEmitter.emit(pipe, context);
|
|
5117
|
+
assertSuccessfulReferenceEmit(type, node.name, "pipe");
|
|
4810
5118
|
usedPipes.push({
|
|
4811
5119
|
ref: pipe,
|
|
4812
5120
|
pipeName,
|
|
@@ -4818,14 +5126,14 @@ var ComponentDecoratorHandler = class {
|
|
|
4818
5126
|
symbol.usedDirectives = usedDirectives.map((dir) => this.semanticDepGraphUpdater.getSemanticReference(dir.ref.node, dir.type));
|
|
4819
5127
|
symbol.usedPipes = usedPipes.map((pipe) => this.semanticDepGraphUpdater.getSemanticReference(pipe.ref.node, pipe.expression));
|
|
4820
5128
|
}
|
|
4821
|
-
const cyclesFromDirectives = new Map();
|
|
5129
|
+
const cyclesFromDirectives = /* @__PURE__ */ new Map();
|
|
4822
5130
|
for (const usedDirective of usedDirectives) {
|
|
4823
5131
|
const cycle = this._checkForCyclicImport(usedDirective.importedFile, usedDirective.type, context);
|
|
4824
5132
|
if (cycle !== null) {
|
|
4825
5133
|
cyclesFromDirectives.set(usedDirective, cycle);
|
|
4826
5134
|
}
|
|
4827
5135
|
}
|
|
4828
|
-
const cyclesFromPipes = new Map();
|
|
5136
|
+
const cyclesFromPipes = /* @__PURE__ */ new Map();
|
|
4829
5137
|
for (const usedPipe of usedPipes) {
|
|
4830
5138
|
const cycle = this._checkForCyclicImport(usedPipe.importedFile, usedPipe.expression, context);
|
|
4831
5139
|
if (cycle !== null) {
|
|
@@ -4952,17 +5260,17 @@ var ComponentDecoratorHandler = class {
|
|
|
4952
5260
|
const metadata = new Map(component);
|
|
4953
5261
|
if (metadata.has("templateUrl")) {
|
|
4954
5262
|
metadata.delete("templateUrl");
|
|
4955
|
-
metadata.set("template",
|
|
5263
|
+
metadata.set("template", ts21.createStringLiteral(template.content));
|
|
4956
5264
|
}
|
|
4957
5265
|
if (metadata.has("styleUrls")) {
|
|
4958
5266
|
metadata.delete("styleUrls");
|
|
4959
|
-
metadata.set("styles",
|
|
5267
|
+
metadata.set("styles", ts21.createArrayLiteral(styles.map((s) => ts21.createStringLiteral(s))));
|
|
4960
5268
|
}
|
|
4961
5269
|
const newMetadataFields = [];
|
|
4962
5270
|
for (const [name, value] of metadata.entries()) {
|
|
4963
|
-
newMetadataFields.push(
|
|
5271
|
+
newMetadataFields.push(ts21.createPropertyAssignment(name, value));
|
|
4964
5272
|
}
|
|
4965
|
-
return __spreadProps(__spreadValues({}, dec), { args: [
|
|
5273
|
+
return __spreadProps(__spreadValues({}, dec), { args: [ts21.createObjectLiteral(newMetadataFields)] });
|
|
4966
5274
|
}
|
|
4967
5275
|
_resolveLiteral(decorator) {
|
|
4968
5276
|
if (this.literalCache.has(decorator)) {
|
|
@@ -4972,7 +5280,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4972
5280
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @Component decorator`);
|
|
4973
5281
|
}
|
|
4974
5282
|
const meta = unwrapExpression(decorator.args[0]);
|
|
4975
|
-
if (!
|
|
5283
|
+
if (!ts21.isObjectLiteralExpression(meta)) {
|
|
4976
5284
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `Decorator argument must be literal.`);
|
|
4977
5285
|
}
|
|
4978
5286
|
this.literalCache.set(decorator, meta);
|
|
@@ -4999,9 +5307,9 @@ var ComponentDecoratorHandler = class {
|
|
|
4999
5307
|
}
|
|
5000
5308
|
_extractStyleUrlsFromExpression(styleUrlsExpr) {
|
|
5001
5309
|
const styleUrls = [];
|
|
5002
|
-
if (
|
|
5310
|
+
if (ts21.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
5003
5311
|
for (const styleUrlExpr of styleUrlsExpr.elements) {
|
|
5004
|
-
if (
|
|
5312
|
+
if (ts21.isSpreadElement(styleUrlExpr)) {
|
|
5005
5313
|
styleUrls.push(...this._extractStyleUrlsFromExpression(styleUrlExpr.expression));
|
|
5006
5314
|
} else {
|
|
5007
5315
|
const styleUrl = this.evaluator.evaluate(styleUrlExpr);
|
|
@@ -5031,12 +5339,12 @@ var ComponentDecoratorHandler = class {
|
|
|
5031
5339
|
return styleUrls;
|
|
5032
5340
|
}
|
|
5033
5341
|
_extractStyleResources(component, containingFile) {
|
|
5034
|
-
const styles = new Set();
|
|
5342
|
+
const styles = /* @__PURE__ */ new Set();
|
|
5035
5343
|
function stringLiteralElements(array) {
|
|
5036
|
-
return array.elements.filter((e) =>
|
|
5344
|
+
return array.elements.filter((e) => ts21.isStringLiteralLike(e));
|
|
5037
5345
|
}
|
|
5038
5346
|
const styleUrlsExpr = component.get("styleUrls");
|
|
5039
|
-
if (styleUrlsExpr !== void 0 &&
|
|
5347
|
+
if (styleUrlsExpr !== void 0 && ts21.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
5040
5348
|
for (const expression of stringLiteralElements(styleUrlsExpr)) {
|
|
5041
5349
|
try {
|
|
5042
5350
|
const resourceUrl = this.resourceLoader.resolve(expression.text, containingFile);
|
|
@@ -5046,7 +5354,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5046
5354
|
}
|
|
5047
5355
|
}
|
|
5048
5356
|
const stylesExpr = component.get("styles");
|
|
5049
|
-
if (stylesExpr !== void 0 &&
|
|
5357
|
+
if (stylesExpr !== void 0 && ts21.isArrayLiteralExpression(stylesExpr)) {
|
|
5050
5358
|
for (const expression of stringLiteralElements(stylesExpr)) {
|
|
5051
5359
|
styles.add({ path: null, expression });
|
|
5052
5360
|
}
|
|
@@ -5091,7 +5399,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5091
5399
|
let sourceMapping;
|
|
5092
5400
|
let escapedString = false;
|
|
5093
5401
|
let sourceMapUrl;
|
|
5094
|
-
if (
|
|
5402
|
+
if (ts21.isStringLiteral(template.expression) || ts21.isNoSubstitutionTemplateLiteral(template.expression)) {
|
|
5095
5403
|
sourceParseRange = getTemplateRange(template.expression);
|
|
5096
5404
|
sourceStr = template.expression.getSourceFile().text;
|
|
5097
5405
|
templateContent = template.expression.text;
|
|
@@ -5265,7 +5573,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5265
5573
|
};
|
|
5266
5574
|
function getTemplateRange(templateExpr) {
|
|
5267
5575
|
const startPos = templateExpr.getStart() + 1;
|
|
5268
|
-
const { line, character } =
|
|
5576
|
+
const { line, character } = ts21.getLineAndCharacterOfPosition(templateExpr.getSourceFile(), startPos);
|
|
5269
5577
|
return {
|
|
5270
5578
|
startPos,
|
|
5271
5579
|
startLine: line,
|
|
@@ -5306,9 +5614,9 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
5306
5614
|
return null;
|
|
5307
5615
|
}
|
|
5308
5616
|
|
|
5309
|
-
// bazel-out/
|
|
5617
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
5310
5618
|
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
|
|
5619
|
+
import ts22 from "typescript";
|
|
5312
5620
|
var InjectableDecoratorHandler = class {
|
|
5313
5621
|
constructor(reflector, isCore, strictCtorDeps, injectableRegistry, perf, errorOnDuplicateProv = true) {
|
|
5314
5622
|
this.reflector = reflector;
|
|
@@ -5399,7 +5707,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
5399
5707
|
};
|
|
5400
5708
|
} else if (decorator.args.length === 1) {
|
|
5401
5709
|
const metaNode = decorator.args[0];
|
|
5402
|
-
if (!
|
|
5710
|
+
if (!ts22.isObjectLiteralExpression(metaNode)) {
|
|
5403
5711
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, metaNode, `@Injectable argument must be an object literal`);
|
|
5404
5712
|
}
|
|
5405
5713
|
const meta = reflectObjectLiteral(metaNode);
|
|
@@ -5407,7 +5715,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
5407
5715
|
let deps = void 0;
|
|
5408
5716
|
if ((meta.has("useClass") || meta.has("useFactory")) && meta.has("deps")) {
|
|
5409
5717
|
const depsExpr = meta.get("deps");
|
|
5410
|
-
if (!
|
|
5718
|
+
if (!ts22.isArrayLiteralExpression(depsExpr)) {
|
|
5411
5719
|
throw new FatalDiagnosticError(ErrorCode.VALUE_NOT_LITERAL, depsExpr, `@Injectable deps metadata must be an inline array`);
|
|
5412
5720
|
}
|
|
5413
5721
|
deps = depsExpr.elements.map((dep) => getDep(dep, reflector));
|
|
@@ -5489,12 +5797,12 @@ function getDep(dep, reflector) {
|
|
|
5489
5797
|
}
|
|
5490
5798
|
return true;
|
|
5491
5799
|
}
|
|
5492
|
-
if (
|
|
5800
|
+
if (ts22.isArrayLiteralExpression(dep)) {
|
|
5493
5801
|
dep.elements.forEach((el) => {
|
|
5494
5802
|
let isDecorator = false;
|
|
5495
|
-
if (
|
|
5803
|
+
if (ts22.isIdentifier(el)) {
|
|
5496
5804
|
isDecorator = maybeUpdateDecorator(el, reflector);
|
|
5497
|
-
} else if (
|
|
5805
|
+
} else if (ts22.isNewExpression(el) && ts22.isIdentifier(el.expression)) {
|
|
5498
5806
|
const token = el.arguments && el.arguments.length > 0 && el.arguments[0] || void 0;
|
|
5499
5807
|
isDecorator = maybeUpdateDecorator(el.expression, reflector, token);
|
|
5500
5808
|
}
|
|
@@ -5506,9 +5814,9 @@ function getDep(dep, reflector) {
|
|
|
5506
5814
|
return meta;
|
|
5507
5815
|
}
|
|
5508
5816
|
|
|
5509
|
-
// bazel-out/
|
|
5817
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
|
|
5510
5818
|
import { compileClassMetadata as compileClassMetadata5, compileDeclareClassMetadata as compileDeclareClassMetadata5, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
5511
|
-
import
|
|
5819
|
+
import ts23 from "typescript";
|
|
5512
5820
|
var PipeSymbol = class extends SemanticSymbol {
|
|
5513
5821
|
constructor(decl, name) {
|
|
5514
5822
|
super(decl);
|
|
@@ -5563,7 +5871,7 @@ var PipeDecoratorHandler = class {
|
|
|
5563
5871
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), "@Pipe must have exactly one argument");
|
|
5564
5872
|
}
|
|
5565
5873
|
const meta = unwrapExpression(decorator.args[0]);
|
|
5566
|
-
if (!
|
|
5874
|
+
if (!ts23.isObjectLiteralExpression(meta)) {
|
|
5567
5875
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@Pipe must have a literal argument");
|
|
5568
5876
|
}
|
|
5569
5877
|
const pipe = reflectObjectLiteral(meta);
|
|
@@ -5631,21 +5939,13 @@ var PipeDecoratorHandler = class {
|
|
|
5631
5939
|
}
|
|
5632
5940
|
};
|
|
5633
5941
|
|
|
5634
|
-
// bazel-out/
|
|
5942
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/references_registry.mjs
|
|
5635
5943
|
var NoopReferencesRegistry = class {
|
|
5636
5944
|
add(source, ...references) {
|
|
5637
5945
|
}
|
|
5638
5946
|
};
|
|
5639
5947
|
|
|
5640
5948
|
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
5949
|
SemanticDepGraphUpdater,
|
|
5650
5950
|
CompoundMetadataReader,
|
|
5651
5951
|
DtsMetadataReader,
|
|
@@ -5660,6 +5960,15 @@ export {
|
|
|
5660
5960
|
CompilationMode,
|
|
5661
5961
|
HandlerFlags,
|
|
5662
5962
|
aliasTransformFactory,
|
|
5963
|
+
isShim,
|
|
5964
|
+
copyFileShimData,
|
|
5965
|
+
untagAllTsFiles,
|
|
5966
|
+
retagAllTsFiles,
|
|
5967
|
+
ShimAdapter,
|
|
5968
|
+
FactoryGenerator,
|
|
5969
|
+
generatedFactoryTransform,
|
|
5970
|
+
ShimReferenceTagger,
|
|
5971
|
+
SummaryGenerator,
|
|
5663
5972
|
TraitState,
|
|
5664
5973
|
TraitCompiler,
|
|
5665
5974
|
DtsTransformRegistry,
|
|
@@ -5681,4 +5990,5 @@ export {
|
|
|
5681
5990
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5682
5991
|
* found in the LICENSE file at https://angular.io/license
|
|
5683
5992
|
*/
|
|
5684
|
-
|
|
5993
|
+
// Closure Compiler ignores @suppress and similar if the comment contains @license.
|
|
5994
|
+
//# sourceMappingURL=chunk-L23I4NJT.js.map
|