@angular/compiler-cli 15.0.0-next.5 → 15.0.0-rc.0
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-E7NQQTT7.js → chunk-4SINIALN.js} +3 -3
- package/bundles/{chunk-E7NQQTT7.js.map → chunk-4SINIALN.js.map} +0 -0
- package/bundles/{chunk-FHVSPC32.js → chunk-7YKDVBJ5.js} +31 -31
- package/bundles/{chunk-FHVSPC32.js.map → chunk-7YKDVBJ5.js.map} +0 -0
- package/bundles/{chunk-2HPI44CB.js → chunk-CTEVZGOM.js} +5 -5
- package/bundles/{chunk-2HPI44CB.js.map → chunk-CTEVZGOM.js.map} +0 -0
- package/bundles/{chunk-OZM4WUIW.js → chunk-D55CQOCC.js} +5 -5
- package/bundles/{chunk-OZM4WUIW.js.map → chunk-D55CQOCC.js.map} +0 -0
- package/bundles/{chunk-LBWAABMF.js → chunk-DLWNNV6S.js} +40 -40
- package/bundles/{chunk-LBWAABMF.js.map → chunk-DLWNNV6S.js.map} +0 -0
- package/bundles/{chunk-FM6NPN5V.js → chunk-GGLQGQHV.js} +4 -4
- package/bundles/{chunk-FM6NPN5V.js.map → chunk-GGLQGQHV.js.map} +0 -0
- package/bundles/{chunk-2RROWOZG.js → chunk-GVQAA5D3.js} +75 -75
- package/bundles/{chunk-2RROWOZG.js.map → chunk-GVQAA5D3.js.map} +1 -1
- package/bundles/{chunk-TF2TR2WS.js → chunk-JSLY52ZU.js} +29 -26
- package/bundles/chunk-JSLY52ZU.js.map +6 -0
- package/bundles/{chunk-VSAO3EZ7.js → chunk-KIQI22GZ.js} +1151 -1057
- package/bundles/chunk-KIQI22GZ.js.map +6 -0
- package/bundles/{chunk-7YHMCUJT.js → chunk-MEB4YHNS.js} +2 -5
- package/bundles/chunk-MEB4YHNS.js.map +6 -0
- package/bundles/{chunk-TOKOIIBI.js → chunk-RC2GY3FU.js} +8 -24
- package/bundles/{chunk-TOKOIIBI.js.map → chunk-RC2GY3FU.js.map} +1 -1
- package/bundles/{chunk-YEQI6VDV.js → chunk-RMZB2XBA.js} +137 -112
- package/bundles/chunk-RMZB2XBA.js.map +6 -0
- package/bundles/{chunk-R3C7RFJ4.js → chunk-SJL5HBUW.js} +2 -2
- package/bundles/{chunk-R3C7RFJ4.js.map → chunk-SJL5HBUW.js.map} +0 -0
- package/bundles/{chunk-XDX5RDY5.js → chunk-VZ2Q36OK.js} +7 -7
- package/bundles/{chunk-XDX5RDY5.js.map → chunk-VZ2Q36OK.js.map} +0 -0
- package/bundles/{chunk-UZLFREET.js → chunk-YGJACQGV.js} +7 -7
- package/bundles/{chunk-UZLFREET.js.map → chunk-YGJACQGV.js.map} +0 -0
- package/bundles/{chunk-CYVTLM4Z.js → chunk-Z57D3OKU.js} +7 -7
- package/bundles/{chunk-CYVTLM4Z.js.map → chunk-Z57D3OKU.js.map} +0 -0
- package/bundles/index.js +13 -13
- package/bundles/linker/babel/index.js +13 -13
- 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 +4 -4
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +3 -3
- 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 +9 -9
- package/bundles_metadata.json +1 -1
- package/ngcc/src/analysis/decoration_analyzer.d.ts +2 -1
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/package.json +4 -4
- package/src/ngtsc/annotations/common/index.d.ts +1 -0
- package/src/ngtsc/annotations/common/src/diagnostics.d.ts +11 -3
- package/src/ngtsc/annotations/common/src/injectable_registry.d.ts +25 -0
- package/src/ngtsc/annotations/common/src/util.d.ts +1 -0
- package/src/ngtsc/annotations/component/src/handler.d.ts +4 -3
- package/src/ngtsc/annotations/directive/src/handler.d.ts +4 -2
- package/src/ngtsc/annotations/ng_module/src/handler.d.ts +2 -2
- package/src/ngtsc/annotations/src/injectable.d.ts +7 -4
- package/src/ngtsc/annotations/src/pipe.d.ts +2 -1
- package/src/ngtsc/diagnostics/src/error_code.d.ts +12 -0
- package/src/ngtsc/file_system/src/node_js_file_system.d.ts +0 -1
- package/src/ngtsc/metadata/index.d.ts +2 -2
- package/src/ngtsc/metadata/src/registry.d.ts +1 -12
- package/src/ngtsc/ts_compatibility/src/ts_cross_version_utils.d.ts +0 -9
- package/src/ngtsc/typecheck/api/checker.d.ts +5 -1
- package/src/ngtsc/typecheck/api/scope.d.ts +16 -0
- package/src/ngtsc/typecheck/src/checker.d.ts +2 -1
- package/bundles/chunk-7YHMCUJT.js.map +0 -6
- package/bundles/chunk-TF2TR2WS.js.map +0 -6
- package/bundles/chunk-VSAO3EZ7.js.map +0 -6
- package/bundles/chunk-YEQI6VDV.js.map +0 -6
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
reflectObjectLiteral,
|
|
14
14
|
reflectTypeEntityToDeclaration,
|
|
15
15
|
typeNodeToValueExpr
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VZ2Q36OK.js";
|
|
17
17
|
import {
|
|
18
18
|
ErrorCode,
|
|
19
19
|
FatalDiagnosticError,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
translateExpression,
|
|
34
34
|
translateStatement,
|
|
35
35
|
translateType
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-JSLY52ZU.js";
|
|
37
37
|
import {
|
|
38
38
|
combineModifiers,
|
|
39
39
|
createPropertyDeclaration,
|
|
@@ -46,18 +46,18 @@ import {
|
|
|
46
46
|
updateParameterDeclaration,
|
|
47
47
|
updatePropertyDeclaration,
|
|
48
48
|
updateSetAccessorDeclaration
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-MEB4YHNS.js";
|
|
50
50
|
import {
|
|
51
51
|
absoluteFrom,
|
|
52
52
|
absoluteFromSourceFile,
|
|
53
53
|
relative
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-RC2GY3FU.js";
|
|
55
55
|
import {
|
|
56
56
|
PerfEvent,
|
|
57
57
|
PerfPhase
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-CTEVZGOM.js";
|
|
59
59
|
|
|
60
|
-
// bazel-out/
|
|
60
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/util.mjs
|
|
61
61
|
import { ExternalExpr, ParseLocation, ParseSourceFile, ParseSourceSpan, ReadPropExpr, WrappedNodeExpr } from "@angular/compiler";
|
|
62
62
|
import ts from "typescript";
|
|
63
63
|
function valueReferenceToExpression(valueRef) {
|
|
@@ -292,8 +292,11 @@ function getOriginNodeForDiagnostics(expr, container) {
|
|
|
292
292
|
return container;
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
+
function isAbstractClassDeclaration(clazz) {
|
|
296
|
+
return clazz.modifiers !== void 0 && clazz.modifiers.some((mod) => mod.kind === ts.SyntaxKind.AbstractKeyword);
|
|
297
|
+
}
|
|
295
298
|
|
|
296
|
-
// bazel-out/
|
|
299
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/dynamic.mjs
|
|
297
300
|
var DynamicValue = class {
|
|
298
301
|
constructor(node, reason, code) {
|
|
299
302
|
this.node = node;
|
|
@@ -383,10 +386,10 @@ var DynamicValue = class {
|
|
|
383
386
|
}
|
|
384
387
|
};
|
|
385
388
|
|
|
386
|
-
// bazel-out/
|
|
389
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
387
390
|
import ts2 from "typescript";
|
|
388
391
|
|
|
389
|
-
// bazel-out/
|
|
392
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/result.mjs
|
|
390
393
|
var ResolvedModule = class {
|
|
391
394
|
constructor(exports, evaluate) {
|
|
392
395
|
this.exports = exports;
|
|
@@ -416,7 +419,7 @@ var EnumValue = class {
|
|
|
416
419
|
var KnownFn = class {
|
|
417
420
|
};
|
|
418
421
|
|
|
419
|
-
// bazel-out/
|
|
422
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/builtin.mjs
|
|
420
423
|
var ArraySliceBuiltinFn = class extends KnownFn {
|
|
421
424
|
constructor(lhs) {
|
|
422
425
|
super();
|
|
@@ -487,7 +490,7 @@ var ObjectAssignBuiltinFn = class extends KnownFn {
|
|
|
487
490
|
}
|
|
488
491
|
};
|
|
489
492
|
|
|
490
|
-
// bazel-out/
|
|
493
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/ts_helpers.mjs
|
|
491
494
|
var AssignHelperFn = class extends ObjectAssignBuiltinFn {
|
|
492
495
|
};
|
|
493
496
|
var SpreadHelperFn = class extends KnownFn {
|
|
@@ -540,7 +543,7 @@ var ReadHelperFn = class extends KnownFn {
|
|
|
540
543
|
}
|
|
541
544
|
};
|
|
542
545
|
|
|
543
|
-
// bazel-out/
|
|
546
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/known_declaration.mjs
|
|
544
547
|
var jsGlobalObjectValue = /* @__PURE__ */ new Map([["assign", new ObjectAssignBuiltinFn()]]);
|
|
545
548
|
var assignTsHelperFn = new AssignHelperFn();
|
|
546
549
|
var spreadTsHelperFn = new SpreadHelperFn();
|
|
@@ -564,14 +567,14 @@ function resolveKnownDeclaration(decl) {
|
|
|
564
567
|
}
|
|
565
568
|
}
|
|
566
569
|
|
|
567
|
-
// bazel-out/
|
|
570
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/synthetic.mjs
|
|
568
571
|
var SyntheticValue = class {
|
|
569
572
|
constructor(value) {
|
|
570
573
|
this.value = value;
|
|
571
574
|
}
|
|
572
575
|
};
|
|
573
576
|
|
|
574
|
-
// bazel-out/
|
|
577
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
575
578
|
function literalBinaryOp(op) {
|
|
576
579
|
return { op, literal: true };
|
|
577
580
|
}
|
|
@@ -1157,7 +1160,7 @@ function owningModule(context, override = null) {
|
|
|
1157
1160
|
}
|
|
1158
1161
|
}
|
|
1159
1162
|
|
|
1160
|
-
// bazel-out/
|
|
1163
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interface.mjs
|
|
1161
1164
|
var PartialEvaluator = class {
|
|
1162
1165
|
constructor(host, checker, dependencyTracker) {
|
|
1163
1166
|
this.host = host;
|
|
@@ -1177,7 +1180,7 @@ var PartialEvaluator = class {
|
|
|
1177
1180
|
}
|
|
1178
1181
|
};
|
|
1179
1182
|
|
|
1180
|
-
// bazel-out/
|
|
1183
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
|
|
1181
1184
|
import ts3 from "typescript";
|
|
1182
1185
|
function describeResolvedType(value, maxDepth = 1) {
|
|
1183
1186
|
var _a, _b;
|
|
@@ -1307,7 +1310,7 @@ function getContainerNode(node) {
|
|
|
1307
1310
|
return node.getSourceFile();
|
|
1308
1311
|
}
|
|
1309
1312
|
|
|
1310
|
-
// bazel-out/
|
|
1313
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/di.mjs
|
|
1311
1314
|
import { LiteralExpr, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
|
|
1312
1315
|
import ts4 from "typescript";
|
|
1313
1316
|
function getConstructorDependencies(clazz, reflector, isCore) {
|
|
@@ -1451,1191 +1454,1255 @@ function createUnsuitableInjectionTokenError(clazz, error) {
|
|
|
1451
1454
|
return new FatalDiagnosticError(ErrorCode.PARAM_MISSING_TOKEN, param.nameNode, chain, hints);
|
|
1452
1455
|
}
|
|
1453
1456
|
|
|
1454
|
-
// bazel-out/
|
|
1455
|
-
import
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1457
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/diagnostics.mjs
|
|
1458
|
+
import ts7 from "typescript";
|
|
1459
|
+
|
|
1460
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/api.mjs
|
|
1461
|
+
var MetaKind;
|
|
1462
|
+
(function(MetaKind2) {
|
|
1463
|
+
MetaKind2[MetaKind2["Directive"] = 0] = "Directive";
|
|
1464
|
+
MetaKind2[MetaKind2["Pipe"] = 1] = "Pipe";
|
|
1465
|
+
MetaKind2[MetaKind2["NgModule"] = 2] = "NgModule";
|
|
1466
|
+
})(MetaKind || (MetaKind = {}));
|
|
1467
|
+
var MatchSource;
|
|
1468
|
+
(function(MatchSource2) {
|
|
1469
|
+
MatchSource2[MatchSource2["Selector"] = 0] = "Selector";
|
|
1470
|
+
MatchSource2[MatchSource2["HostDirective"] = 1] = "HostDirective";
|
|
1471
|
+
})(MatchSource || (MatchSource = {}));
|
|
1472
|
+
|
|
1473
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1474
|
+
import ts6 from "typescript";
|
|
1475
|
+
|
|
1476
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/property_mapping.mjs
|
|
1477
|
+
var ClassPropertyMapping = class {
|
|
1478
|
+
constructor(forwardMap) {
|
|
1479
|
+
this.forwardMap = forwardMap;
|
|
1480
|
+
this.reverseMap = reverseMapFromForwardMap(forwardMap);
|
|
1464
1481
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
function createValueHasWrongTypeError(node, value, messageText) {
|
|
1468
|
-
var _a;
|
|
1469
|
-
let chainedMessage;
|
|
1470
|
-
let relatedInformation;
|
|
1471
|
-
if (value instanceof DynamicValue) {
|
|
1472
|
-
chainedMessage = "Value could not be determined statically.";
|
|
1473
|
-
relatedInformation = traceDynamicValue(node, value);
|
|
1474
|
-
} else if (value instanceof Reference) {
|
|
1475
|
-
const target = value.debugName !== null ? `'${value.debugName}'` : "an anonymous declaration";
|
|
1476
|
-
chainedMessage = `Value is a reference to ${target}.`;
|
|
1477
|
-
const referenceNode = (_a = identifierOfNode(value.node)) != null ? _a : value.node;
|
|
1478
|
-
relatedInformation = [makeRelatedInformation(referenceNode, "Reference is declared here.")];
|
|
1479
|
-
} else {
|
|
1480
|
-
chainedMessage = `Value is of type '${describeResolvedType(value)}'.`;
|
|
1482
|
+
static empty() {
|
|
1483
|
+
return new ClassPropertyMapping(/* @__PURE__ */ new Map());
|
|
1481
1484
|
}
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
code: 0
|
|
1490
|
-
}]
|
|
1491
|
-
};
|
|
1492
|
-
return new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, node, chain, relatedInformation);
|
|
1493
|
-
}
|
|
1494
|
-
function getProviderDiagnostics(providerClasses, providersDeclaration, registry) {
|
|
1495
|
-
const diagnostics = [];
|
|
1496
|
-
for (const provider of providerClasses) {
|
|
1497
|
-
if (registry.isInjectable(provider.node)) {
|
|
1498
|
-
continue;
|
|
1485
|
+
static fromMappedObject(obj) {
|
|
1486
|
+
const forwardMap = /* @__PURE__ */ new Map();
|
|
1487
|
+
for (const classPropertyName of Object.keys(obj)) {
|
|
1488
|
+
const value = obj[classPropertyName];
|
|
1489
|
+
const bindingPropertyName = Array.isArray(value) ? value[0] : value;
|
|
1490
|
+
const inputOrOutput = { classPropertyName, bindingPropertyName };
|
|
1491
|
+
forwardMap.set(classPropertyName, inputOrOutput);
|
|
1499
1492
|
}
|
|
1500
|
-
|
|
1501
|
-
diagnostics.push(makeDiagnostic(ErrorCode.UNDECORATED_PROVIDER, contextNode, `The class '${provider.node.name.text}' cannot be created via dependency injection, as it does not have an Angular decorator. This will result in an error at runtime.
|
|
1502
|
-
|
|
1503
|
-
Either add the @Injectable() decorator to '${provider.node.name.text}', or configure a different provider (such as a provider with 'useFactory').
|
|
1504
|
-
`, [makeRelatedInformation(provider.node, `'${provider.node.name.text}' is declared here.`)]));
|
|
1493
|
+
return new ClassPropertyMapping(forwardMap);
|
|
1505
1494
|
}
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
const addDiagnostics = (more) => {
|
|
1511
|
-
if (more === null) {
|
|
1512
|
-
return;
|
|
1513
|
-
} else if (diagnostics === null) {
|
|
1514
|
-
diagnostics = Array.isArray(more) ? more : [more];
|
|
1515
|
-
} else if (Array.isArray(more)) {
|
|
1516
|
-
diagnostics.push(...more);
|
|
1517
|
-
} else {
|
|
1518
|
-
diagnostics.push(more);
|
|
1495
|
+
static merge(a, b) {
|
|
1496
|
+
const forwardMap = new Map(a.forwardMap.entries());
|
|
1497
|
+
for (const [classPropertyName, inputOrOutput] of b.forwardMap) {
|
|
1498
|
+
forwardMap.set(classPropertyName, inputOrOutput);
|
|
1519
1499
|
}
|
|
1520
|
-
|
|
1521
|
-
const duplicateDeclarations = scopeRegistry.getDuplicateDeclarations(node);
|
|
1522
|
-
if (duplicateDeclarations !== null) {
|
|
1523
|
-
addDiagnostics(makeDuplicateDeclarationError(node, duplicateDeclarations, kind));
|
|
1500
|
+
return new ClassPropertyMapping(forwardMap);
|
|
1524
1501
|
}
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
}
|
|
1528
|
-
function validateHostDirectives(origin, hostDirectives, metaReader) {
|
|
1529
|
-
const diagnostics = [];
|
|
1530
|
-
for (const current of hostDirectives) {
|
|
1531
|
-
const hostMeta = metaReader.getDirectiveMetadata(current.directive);
|
|
1532
|
-
if (hostMeta === null) {
|
|
1533
|
-
diagnostics.push(makeDiagnostic(ErrorCode.HOST_DIRECTIVE_INVALID, current.directive.getOriginForDiagnostics(origin), `${current.directive.debugName} must be a standalone directive to be used as a host directive`));
|
|
1534
|
-
continue;
|
|
1535
|
-
}
|
|
1536
|
-
if (!hostMeta.isStandalone) {
|
|
1537
|
-
diagnostics.push(makeDiagnostic(ErrorCode.HOST_DIRECTIVE_NOT_STANDALONE, current.directive.getOriginForDiagnostics(origin), `Host directive ${hostMeta.name} must be standalone`));
|
|
1538
|
-
}
|
|
1539
|
-
if (hostMeta.isComponent) {
|
|
1540
|
-
diagnostics.push(makeDiagnostic(ErrorCode.HOST_DIRECTIVE_COMPONENT, current.directive.getOriginForDiagnostics(origin), `Host directive ${hostMeta.name} cannot be a component`));
|
|
1541
|
-
}
|
|
1502
|
+
get classPropertyNames() {
|
|
1503
|
+
return Array.from(this.forwardMap.keys());
|
|
1542
1504
|
}
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
function getUndecoratedClassWithAngularFeaturesDiagnostic(node) {
|
|
1546
|
-
return makeDiagnostic(ErrorCode.UNDECORATED_CLASS_USING_ANGULAR_FEATURES, node.name, `Class is using Angular features but is not decorated. Please add an explicit Angular decorator.`);
|
|
1547
|
-
}
|
|
1548
|
-
function checkInheritanceOfDirective(node, reader, reflector, evaluator) {
|
|
1549
|
-
if (!reflector.isClass(node) || reflector.getConstructorParameters(node) !== null) {
|
|
1550
|
-
return null;
|
|
1505
|
+
get propertyNames() {
|
|
1506
|
+
return Array.from(this.reverseMap.keys());
|
|
1551
1507
|
}
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1508
|
+
hasBindingPropertyName(propertyName) {
|
|
1509
|
+
return this.reverseMap.has(propertyName);
|
|
1510
|
+
}
|
|
1511
|
+
getByBindingPropertyName(propertyName) {
|
|
1512
|
+
return this.reverseMap.has(propertyName) ? this.reverseMap.get(propertyName) : null;
|
|
1513
|
+
}
|
|
1514
|
+
getByClassPropertyName(classPropertyName) {
|
|
1515
|
+
return this.forwardMap.has(classPropertyName) ? this.forwardMap.get(classPropertyName) : null;
|
|
1516
|
+
}
|
|
1517
|
+
toDirectMappedObject() {
|
|
1518
|
+
const obj = {};
|
|
1519
|
+
for (const [classPropertyName, inputOrOutput] of this.forwardMap) {
|
|
1520
|
+
obj[classPropertyName] = inputOrOutput.bindingPropertyName;
|
|
1556
1521
|
}
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1522
|
+
return obj;
|
|
1523
|
+
}
|
|
1524
|
+
toJointMappedObject() {
|
|
1525
|
+
const obj = {};
|
|
1526
|
+
for (const [classPropertyName, inputOrOutput] of this.forwardMap) {
|
|
1527
|
+
if (inputOrOutput.bindingPropertyName === classPropertyName) {
|
|
1528
|
+
obj[classPropertyName] = inputOrOutput.bindingPropertyName;
|
|
1529
|
+
} else {
|
|
1530
|
+
obj[classPropertyName] = [inputOrOutput.bindingPropertyName, classPropertyName];
|
|
1531
|
+
}
|
|
1560
1532
|
}
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
return null;
|
|
1533
|
+
return obj;
|
|
1534
|
+
}
|
|
1535
|
+
*[Symbol.iterator]() {
|
|
1536
|
+
for (const [classPropertyName, inputOrOutput] of this.forwardMap.entries()) {
|
|
1537
|
+
yield [classPropertyName, inputOrOutput.bindingPropertyName];
|
|
1567
1538
|
}
|
|
1568
|
-
baseClass = newParentClass;
|
|
1569
1539
|
}
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
const
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
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}.`);
|
|
1577
|
-
}
|
|
1578
|
-
|
|
1579
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/evaluation.mjs
|
|
1580
|
-
import ts6 from "typescript";
|
|
1581
|
-
function resolveEnumValue(evaluator, metadata, field, enumSymbolName) {
|
|
1582
|
-
let resolved = null;
|
|
1583
|
-
if (metadata.has(field)) {
|
|
1584
|
-
const expr = metadata.get(field);
|
|
1585
|
-
const value = evaluator.evaluate(expr);
|
|
1586
|
-
if (value instanceof EnumValue && isAngularCoreReference(value.enumRef, enumSymbolName)) {
|
|
1587
|
-
resolved = value.resolved;
|
|
1588
|
-
} else {
|
|
1589
|
-
throw createValueHasWrongTypeError(expr, value, `${field} must be a member of ${enumSymbolName} enum from @angular/core`);
|
|
1540
|
+
};
|
|
1541
|
+
function reverseMapFromForwardMap(forwardMap) {
|
|
1542
|
+
const reverseMap = /* @__PURE__ */ new Map();
|
|
1543
|
+
for (const [_, inputOrOutput] of forwardMap) {
|
|
1544
|
+
if (!reverseMap.has(inputOrOutput.bindingPropertyName)) {
|
|
1545
|
+
reverseMap.set(inputOrOutput.bindingPropertyName, []);
|
|
1590
1546
|
}
|
|
1547
|
+
reverseMap.get(inputOrOutput.bindingPropertyName).push(inputOrOutput);
|
|
1591
1548
|
}
|
|
1592
|
-
return
|
|
1593
|
-
}
|
|
1594
|
-
function isStringArray(resolvedValue) {
|
|
1595
|
-
return Array.isArray(resolvedValue) && resolvedValue.every((elem) => typeof elem === "string");
|
|
1549
|
+
return reverseMap;
|
|
1596
1550
|
}
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1551
|
+
|
|
1552
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/util.mjs
|
|
1553
|
+
import ts5 from "typescript";
|
|
1554
|
+
function extractReferencesFromType(checker, def, bestGuessOwningModule) {
|
|
1555
|
+
if (!ts5.isTupleTypeNode(def)) {
|
|
1556
|
+
return [];
|
|
1600
1557
|
}
|
|
1601
|
-
|
|
1602
|
-
|
|
1558
|
+
return def.elements.map((element) => {
|
|
1559
|
+
if (!ts5.isTypeQueryNode(element)) {
|
|
1560
|
+
throw new Error(`Expected TypeQueryNode: ${nodeDebugInfo(element)}`);
|
|
1561
|
+
}
|
|
1562
|
+
return extraReferenceFromTypeQuery(checker, element, def, bestGuessOwningModule);
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
function extraReferenceFromTypeQuery(checker, typeNode, origin, bestGuessOwningModule) {
|
|
1566
|
+
const type = typeNode.exprName;
|
|
1567
|
+
const { node, from } = reflectTypeEntityToDeclaration(type, checker);
|
|
1568
|
+
if (!isNamedClassDeclaration(node)) {
|
|
1569
|
+
throw new Error(`Expected named ClassDeclaration: ${nodeDebugInfo(node)}`);
|
|
1603
1570
|
}
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `Decorator argument must be literal.`);
|
|
1571
|
+
if (from !== null && !from.startsWith(".")) {
|
|
1572
|
+
return new Reference(node, { specifier: from, resolutionContext: origin.getSourceFile().fileName });
|
|
1607
1573
|
}
|
|
1608
|
-
|
|
1609
|
-
return meta;
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/factory.mjs
|
|
1613
|
-
import { compileDeclareFactoryFunction, compileFactoryFunction } from "@angular/compiler";
|
|
1614
|
-
function compileNgFactoryDefField(metadata) {
|
|
1615
|
-
const res = compileFactoryFunction(metadata);
|
|
1616
|
-
return { name: "\u0275fac", initializer: res.expression, statements: res.statements, type: res.type };
|
|
1617
|
-
}
|
|
1618
|
-
function compileDeclareFactory(metadata) {
|
|
1619
|
-
const res = compileDeclareFactoryFunction(metadata);
|
|
1620
|
-
return { name: "\u0275fac", initializer: res.expression, statements: res.statements, type: res.type };
|
|
1574
|
+
return new Reference(node, bestGuessOwningModule);
|
|
1621
1575
|
}
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
import { FunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr3 } from "@angular/compiler";
|
|
1625
|
-
import ts7 from "typescript";
|
|
1626
|
-
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
|
|
1627
|
-
if (!reflection.isClass(clazz)) {
|
|
1576
|
+
function readBooleanType(type) {
|
|
1577
|
+
if (!ts5.isLiteralTypeNode(type)) {
|
|
1628
1578
|
return null;
|
|
1629
1579
|
}
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1580
|
+
switch (type.literal.kind) {
|
|
1581
|
+
case ts5.SyntaxKind.TrueKeyword:
|
|
1582
|
+
return true;
|
|
1583
|
+
case ts5.SyntaxKind.FalseKeyword:
|
|
1584
|
+
return false;
|
|
1585
|
+
default:
|
|
1586
|
+
return null;
|
|
1634
1587
|
}
|
|
1635
|
-
|
|
1636
|
-
|
|
1588
|
+
}
|
|
1589
|
+
function readStringType(type) {
|
|
1590
|
+
if (!ts5.isLiteralTypeNode(type) || !ts5.isStringLiteral(type.literal)) {
|
|
1637
1591
|
return null;
|
|
1638
1592
|
}
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
if (
|
|
1643
|
-
|
|
1644
|
-
metaCtorParameters = new FunctionExpr([], [
|
|
1645
|
-
new ReturnStatement(new LiteralArrayExpr(ctorParameters))
|
|
1646
|
-
]);
|
|
1647
|
-
}
|
|
1648
|
-
let metaPropDecorators = null;
|
|
1649
|
-
const classMembers = reflection.getMembersOfClass(clazz).filter((member) => !member.isStatic && member.decorators !== null && member.decorators.length > 0);
|
|
1650
|
-
const duplicateDecoratedMemberNames = classMembers.map((member) => member.name).filter((name, i, arr) => arr.indexOf(name) < i);
|
|
1651
|
-
if (duplicateDecoratedMemberNames.length > 0) {
|
|
1652
|
-
throw new Error(`Duplicate decorated properties found on class '${clazz.name.text}': ` + duplicateDecoratedMemberNames.join(", "));
|
|
1593
|
+
return type.literal.text;
|
|
1594
|
+
}
|
|
1595
|
+
function readMapType(type, valueTransform) {
|
|
1596
|
+
if (!ts5.isTypeLiteralNode(type)) {
|
|
1597
|
+
return {};
|
|
1653
1598
|
}
|
|
1654
|
-
const
|
|
1655
|
-
|
|
1656
|
-
|
|
1599
|
+
const obj = {};
|
|
1600
|
+
type.members.forEach((member) => {
|
|
1601
|
+
if (!ts5.isPropertySignature(member) || member.type === void 0 || member.name === void 0 || !ts5.isStringLiteral(member.name) && !ts5.isIdentifier(member.name)) {
|
|
1602
|
+
return;
|
|
1603
|
+
}
|
|
1604
|
+
const value = valueTransform(member.type);
|
|
1605
|
+
if (value === null) {
|
|
1606
|
+
return null;
|
|
1607
|
+
}
|
|
1608
|
+
obj[member.name.text] = value;
|
|
1657
1609
|
});
|
|
1658
|
-
|
|
1659
|
-
metaPropDecorators = new WrappedNodeExpr3(ts7.factory.createObjectLiteralExpression(decoratedMembers));
|
|
1660
|
-
}
|
|
1661
|
-
return {
|
|
1662
|
-
type: new WrappedNodeExpr3(id),
|
|
1663
|
-
decorators: metaDecorators,
|
|
1664
|
-
ctorParameters: metaCtorParameters,
|
|
1665
|
-
propDecorators: metaPropDecorators
|
|
1666
|
-
};
|
|
1610
|
+
return obj;
|
|
1667
1611
|
}
|
|
1668
|
-
function
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
{ key: "type", value: type, quoted: false }
|
|
1672
|
-
];
|
|
1673
|
-
if (param.decorators !== null) {
|
|
1674
|
-
const ngDecorators = param.decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
1675
|
-
const value = new WrappedNodeExpr3(ts7.factory.createArrayLiteralExpression(ngDecorators));
|
|
1676
|
-
mapEntries.push({ key: "decorators", value, quoted: false });
|
|
1612
|
+
function readStringArrayType(type) {
|
|
1613
|
+
if (!ts5.isTupleTypeNode(type)) {
|
|
1614
|
+
return [];
|
|
1677
1615
|
}
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1616
|
+
const res = [];
|
|
1617
|
+
type.elements.forEach((el) => {
|
|
1618
|
+
if (!ts5.isLiteralTypeNode(el) || !ts5.isStringLiteral(el.literal)) {
|
|
1619
|
+
return;
|
|
1620
|
+
}
|
|
1621
|
+
res.push(el.literal.text);
|
|
1622
|
+
});
|
|
1623
|
+
return res;
|
|
1684
1624
|
}
|
|
1685
|
-
function
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
const
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1625
|
+
function extractDirectiveTypeCheckMeta(node, inputs, reflector) {
|
|
1626
|
+
const members = reflector.getMembersOfClass(node);
|
|
1627
|
+
const staticMembers = members.filter((member) => member.isStatic);
|
|
1628
|
+
const ngTemplateGuards = staticMembers.map(extractTemplateGuard).filter((guard) => guard !== null);
|
|
1629
|
+
const hasNgTemplateContextGuard = staticMembers.some((member) => member.kind === ClassMemberKind.Method && member.name === "ngTemplateContextGuard");
|
|
1630
|
+
const coercedInputFields = new Set(staticMembers.map(extractCoercedInput).filter((inputName) => inputName !== null));
|
|
1631
|
+
const restrictedInputFields = /* @__PURE__ */ new Set();
|
|
1632
|
+
const stringLiteralInputFields = /* @__PURE__ */ new Set();
|
|
1633
|
+
const undeclaredInputFields = /* @__PURE__ */ new Set();
|
|
1634
|
+
for (const classPropertyName of inputs.classPropertyNames) {
|
|
1635
|
+
const field = members.find((member) => member.name === classPropertyName);
|
|
1636
|
+
if (field === void 0 || field.node === null) {
|
|
1637
|
+
undeclaredInputFields.add(classPropertyName);
|
|
1638
|
+
continue;
|
|
1639
|
+
}
|
|
1640
|
+
if (isRestricted(field.node)) {
|
|
1641
|
+
restrictedInputFields.add(classPropertyName);
|
|
1642
|
+
}
|
|
1643
|
+
if (field.nameNode !== null && ts5.isStringLiteral(field.nameNode)) {
|
|
1644
|
+
stringLiteralInputFields.add(classPropertyName);
|
|
1645
|
+
}
|
|
1697
1646
|
}
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1647
|
+
const arity = reflector.getGenericArityOfClass(node);
|
|
1648
|
+
return {
|
|
1649
|
+
hasNgTemplateContextGuard,
|
|
1650
|
+
ngTemplateGuards,
|
|
1651
|
+
coercedInputFields,
|
|
1652
|
+
restrictedInputFields,
|
|
1653
|
+
stringLiteralInputFields,
|
|
1654
|
+
undeclaredInputFields,
|
|
1655
|
+
isGeneric: arity !== null && arity > 0
|
|
1656
|
+
};
|
|
1702
1657
|
}
|
|
1703
|
-
function
|
|
1704
|
-
const
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1658
|
+
function isRestricted(node) {
|
|
1659
|
+
const modifiers = getModifiers(node);
|
|
1660
|
+
return modifiers !== void 0 && modifiers.some(({ kind }) => {
|
|
1661
|
+
return kind === ts5.SyntaxKind.PrivateKeyword || kind === ts5.SyntaxKind.ProtectedKeyword || kind === ts5.SyntaxKind.ReadonlyKeyword;
|
|
1662
|
+
});
|
|
1708
1663
|
}
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
add(source, ...references) {
|
|
1713
|
-
}
|
|
1714
|
-
};
|
|
1715
|
-
|
|
1716
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/schema.mjs
|
|
1717
|
-
import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from "@angular/compiler";
|
|
1718
|
-
function extractSchemas(rawExpr, evaluator, context) {
|
|
1719
|
-
const schemas = [];
|
|
1720
|
-
const result = evaluator.evaluate(rawExpr);
|
|
1721
|
-
if (!Array.isArray(result)) {
|
|
1722
|
-
throw createValueHasWrongTypeError(rawExpr, result, `${context}.schemas must be an array`);
|
|
1664
|
+
function extractTemplateGuard(member) {
|
|
1665
|
+
if (!member.name.startsWith("ngTemplateGuard_")) {
|
|
1666
|
+
return null;
|
|
1723
1667
|
}
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
if (id === null || schemaRef.ownedByModuleGuess !== "@angular/core") {
|
|
1730
|
-
throw createValueHasWrongTypeError(rawExpr, result, `${context}.schemas must be an array of schemas`);
|
|
1668
|
+
const inputName = afterUnderscore(member.name);
|
|
1669
|
+
if (member.kind === ClassMemberKind.Property) {
|
|
1670
|
+
let type = null;
|
|
1671
|
+
if (member.type !== null && ts5.isLiteralTypeNode(member.type) && ts5.isStringLiteral(member.type.literal)) {
|
|
1672
|
+
type = member.type.literal.text;
|
|
1731
1673
|
}
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
schemas.push(CUSTOM_ELEMENTS_SCHEMA);
|
|
1735
|
-
break;
|
|
1736
|
-
case "NO_ERRORS_SCHEMA":
|
|
1737
|
-
schemas.push(NO_ERRORS_SCHEMA);
|
|
1738
|
-
break;
|
|
1739
|
-
default:
|
|
1740
|
-
throw createValueHasWrongTypeError(rawExpr, schemaRef, `'${schemaRef.debugName}' is not a valid ${context} schema`);
|
|
1674
|
+
if (type !== "binding") {
|
|
1675
|
+
return null;
|
|
1741
1676
|
}
|
|
1677
|
+
return { inputName, type };
|
|
1678
|
+
} else if (member.kind === ClassMemberKind.Method) {
|
|
1679
|
+
return { inputName, type: "invocation" };
|
|
1680
|
+
} else {
|
|
1681
|
+
return null;
|
|
1742
1682
|
}
|
|
1743
|
-
return schemas;
|
|
1744
1683
|
}
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
import { compileClassMetadata as compileClassMetadata3, compileComponentFromMetadata, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareComponentFromMetadata, CssSelector as CssSelector2, DEFAULT_INTERPOLATION_CONFIG as DEFAULT_INTERPOLATION_CONFIG2, DomElementSchemaRegistry, FactoryTarget as FactoryTarget3, makeBindingParser as makeBindingParser2, R3TargetBinder, R3TemplateDependencyKind, SelectorMatcher as SelectorMatcher2, ViewEncapsulation, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
1748
|
-
import ts24 from "typescript";
|
|
1749
|
-
|
|
1750
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
1751
|
-
import ts8 from "typescript";
|
|
1752
|
-
var SemanticSymbol = class {
|
|
1753
|
-
constructor(decl) {
|
|
1754
|
-
this.decl = decl;
|
|
1755
|
-
this.path = absoluteFromSourceFile(decl.getSourceFile());
|
|
1756
|
-
this.identifier = getSymbolIdentifier(decl);
|
|
1757
|
-
}
|
|
1758
|
-
};
|
|
1759
|
-
function getSymbolIdentifier(decl) {
|
|
1760
|
-
if (!ts8.isSourceFile(decl.parent)) {
|
|
1684
|
+
function extractCoercedInput(member) {
|
|
1685
|
+
if (member.kind !== ClassMemberKind.Property || !member.name.startsWith("ngAcceptInputType_")) {
|
|
1761
1686
|
return null;
|
|
1762
1687
|
}
|
|
1763
|
-
return
|
|
1688
|
+
return afterUnderscore(member.name);
|
|
1764
1689
|
}
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
var OpaqueSymbol = class extends SemanticSymbol {
|
|
1769
|
-
isPublicApiAffected() {
|
|
1770
|
-
return false;
|
|
1771
|
-
}
|
|
1772
|
-
isTypeCheckApiAffected() {
|
|
1773
|
-
return false;
|
|
1774
|
-
}
|
|
1775
|
-
};
|
|
1776
|
-
var SemanticDepGraph = class {
|
|
1777
|
-
constructor() {
|
|
1778
|
-
this.files = /* @__PURE__ */ new Map();
|
|
1779
|
-
this.symbolByDecl = /* @__PURE__ */ new Map();
|
|
1690
|
+
var CompoundMetadataReader = class {
|
|
1691
|
+
constructor(readers) {
|
|
1692
|
+
this.readers = readers;
|
|
1780
1693
|
}
|
|
1781
|
-
|
|
1782
|
-
this.
|
|
1783
|
-
|
|
1784
|
-
if (
|
|
1785
|
-
|
|
1694
|
+
getDirectiveMetadata(node) {
|
|
1695
|
+
for (const reader of this.readers) {
|
|
1696
|
+
const meta = reader.getDirectiveMetadata(node);
|
|
1697
|
+
if (meta !== null) {
|
|
1698
|
+
return meta;
|
|
1786
1699
|
}
|
|
1787
|
-
this.files.get(symbol.path).set(symbol.identifier, symbol);
|
|
1788
|
-
}
|
|
1789
|
-
}
|
|
1790
|
-
getEquivalentSymbol(symbol) {
|
|
1791
|
-
let previousSymbol = this.getSymbolByDecl(symbol.decl);
|
|
1792
|
-
if (previousSymbol === null && symbol.identifier !== null) {
|
|
1793
|
-
previousSymbol = this.getSymbolByName(symbol.path, symbol.identifier);
|
|
1794
1700
|
}
|
|
1795
|
-
return
|
|
1701
|
+
return null;
|
|
1796
1702
|
}
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
return null;
|
|
1703
|
+
getNgModuleMetadata(node) {
|
|
1704
|
+
for (const reader of this.readers) {
|
|
1705
|
+
const meta = reader.getNgModuleMetadata(node);
|
|
1706
|
+
if (meta !== null) {
|
|
1707
|
+
return meta;
|
|
1708
|
+
}
|
|
1804
1709
|
}
|
|
1805
|
-
return
|
|
1710
|
+
return null;
|
|
1806
1711
|
}
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1712
|
+
getPipeMetadata(node) {
|
|
1713
|
+
for (const reader of this.readers) {
|
|
1714
|
+
const meta = reader.getPipeMetadata(node);
|
|
1715
|
+
if (meta !== null) {
|
|
1716
|
+
return meta;
|
|
1717
|
+
}
|
|
1810
1718
|
}
|
|
1811
|
-
return
|
|
1719
|
+
return null;
|
|
1812
1720
|
}
|
|
1813
1721
|
};
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
this.opaqueSymbols = /* @__PURE__ */ new Map();
|
|
1722
|
+
function afterUnderscore(str) {
|
|
1723
|
+
const pos = str.indexOf("_");
|
|
1724
|
+
if (pos === -1) {
|
|
1725
|
+
throw new Error(`Expected '${str}' to contain '_'`);
|
|
1819
1726
|
}
|
|
1820
|
-
|
|
1821
|
-
|
|
1727
|
+
return str.slice(pos + 1);
|
|
1728
|
+
}
|
|
1729
|
+
function hasInjectableFields(clazz, host) {
|
|
1730
|
+
const members = host.getMembersOfClass(clazz);
|
|
1731
|
+
return members.some(({ isStatic, name }) => isStatic && (name === "\u0275prov" || name === "\u0275fac"));
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1735
|
+
var DtsMetadataReader = class {
|
|
1736
|
+
constructor(checker, reflector) {
|
|
1737
|
+
this.checker = checker;
|
|
1738
|
+
this.reflector = reflector;
|
|
1822
1739
|
}
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1740
|
+
getNgModuleMetadata(ref) {
|
|
1741
|
+
const clazz = ref.node;
|
|
1742
|
+
const ngModuleDef = this.reflector.getMembersOfClass(clazz).find((member) => member.name === "\u0275mod" && member.isStatic);
|
|
1743
|
+
if (ngModuleDef === void 0) {
|
|
1744
|
+
return null;
|
|
1745
|
+
} else if (ngModuleDef.type === null || !ts6.isTypeReferenceNode(ngModuleDef.type) || ngModuleDef.type.typeArguments === void 0 || ngModuleDef.type.typeArguments.length !== 4) {
|
|
1746
|
+
return null;
|
|
1830
1747
|
}
|
|
1831
|
-
const
|
|
1832
|
-
const needsTypeCheckEmit = this.determineInvalidatedTypeCheckFiles(this.priorGraph);
|
|
1748
|
+
const [_, declarationMetadata, importMetadata, exportMetadata] = ngModuleDef.type.typeArguments;
|
|
1833
1749
|
return {
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
}
|
|
1846
|
-
}
|
|
1847
|
-
const needsEmit = /* @__PURE__ */ new Set();
|
|
1848
|
-
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1849
|
-
if (symbol.isEmitAffected === void 0) {
|
|
1850
|
-
continue;
|
|
1851
|
-
}
|
|
1852
|
-
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
1853
|
-
if (previousSymbol === null || symbol.isEmitAffected(previousSymbol, isPublicApiAffected)) {
|
|
1854
|
-
needsEmit.add(symbol.path);
|
|
1855
|
-
}
|
|
1856
|
-
}
|
|
1857
|
-
return needsEmit;
|
|
1750
|
+
kind: MetaKind.NgModule,
|
|
1751
|
+
ref,
|
|
1752
|
+
declarations: extractReferencesFromType(this.checker, declarationMetadata, ref.bestGuessOwningModule),
|
|
1753
|
+
exports: extractReferencesFromType(this.checker, exportMetadata, ref.bestGuessOwningModule),
|
|
1754
|
+
imports: extractReferencesFromType(this.checker, importMetadata, ref.bestGuessOwningModule),
|
|
1755
|
+
schemas: [],
|
|
1756
|
+
rawDeclarations: null,
|
|
1757
|
+
rawImports: null,
|
|
1758
|
+
rawExports: null,
|
|
1759
|
+
decorator: null
|
|
1760
|
+
};
|
|
1858
1761
|
}
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
const needsTypeCheckEmit = /* @__PURE__ */ new Set();
|
|
1868
|
-
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1869
|
-
if (symbol.isTypeCheckBlockAffected === void 0) {
|
|
1870
|
-
continue;
|
|
1871
|
-
}
|
|
1872
|
-
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
1873
|
-
if (previousSymbol === null || symbol.isTypeCheckBlockAffected(previousSymbol, isTypeCheckApiAffected)) {
|
|
1874
|
-
needsTypeCheckEmit.add(symbol.path);
|
|
1875
|
-
}
|
|
1762
|
+
getDirectiveMetadata(ref) {
|
|
1763
|
+
var _a;
|
|
1764
|
+
const clazz = ref.node;
|
|
1765
|
+
const def = this.reflector.getMembersOfClass(clazz).find((field) => field.isStatic && (field.name === "\u0275cmp" || field.name === "\u0275dir"));
|
|
1766
|
+
if (def === void 0) {
|
|
1767
|
+
return null;
|
|
1768
|
+
} else if (def.type === null || !ts6.isTypeReferenceNode(def.type) || def.type.typeArguments === void 0 || def.type.typeArguments.length < 2) {
|
|
1769
|
+
return null;
|
|
1876
1770
|
}
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1771
|
+
const isComponent = def.name === "\u0275cmp";
|
|
1772
|
+
const ctorParams = this.reflector.getConstructorParameters(clazz);
|
|
1773
|
+
const isStructural = !isComponent && ctorParams !== null && ctorParams.some((param) => {
|
|
1774
|
+
return param.typeValueReference.kind === 1 && param.typeValueReference.moduleName === "@angular/core" && param.typeValueReference.importedName === "TemplateRef";
|
|
1775
|
+
});
|
|
1776
|
+
const isStandalone = def.type.typeArguments.length > 7 && ((_a = readBooleanType(def.type.typeArguments[7])) != null ? _a : false);
|
|
1777
|
+
const inputs = ClassPropertyMapping.fromMappedObject(readMapType(def.type.typeArguments[3], readStringType));
|
|
1778
|
+
const outputs = ClassPropertyMapping.fromMappedObject(readMapType(def.type.typeArguments[4], readStringType));
|
|
1779
|
+
const hostDirectives = def.type.typeArguments.length > 8 ? readHostDirectivesType(this.checker, def.type.typeArguments[8], ref.bestGuessOwningModule) : null;
|
|
1880
1780
|
return {
|
|
1881
|
-
|
|
1882
|
-
|
|
1781
|
+
kind: MetaKind.Directive,
|
|
1782
|
+
matchSource: MatchSource.Selector,
|
|
1783
|
+
ref,
|
|
1784
|
+
name: clazz.name.text,
|
|
1785
|
+
isComponent,
|
|
1786
|
+
selector: readStringType(def.type.typeArguments[1]),
|
|
1787
|
+
exportAs: readStringArrayType(def.type.typeArguments[2]),
|
|
1788
|
+
inputs,
|
|
1789
|
+
outputs,
|
|
1790
|
+
hostDirectives,
|
|
1791
|
+
queries: readStringArrayType(def.type.typeArguments[5]),
|
|
1792
|
+
...extractDirectiveTypeCheckMeta(clazz, inputs, this.reflector),
|
|
1793
|
+
baseClass: readBaseClass2(clazz, this.checker, this.reflector),
|
|
1794
|
+
isPoisoned: false,
|
|
1795
|
+
isStructural,
|
|
1796
|
+
animationTriggerNames: null,
|
|
1797
|
+
isStandalone,
|
|
1798
|
+
imports: null,
|
|
1799
|
+
schemas: null,
|
|
1800
|
+
decorator: null
|
|
1883
1801
|
};
|
|
1884
1802
|
}
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1803
|
+
getPipeMetadata(ref) {
|
|
1804
|
+
var _a;
|
|
1805
|
+
const def = this.reflector.getMembersOfClass(ref.node).find((field) => field.isStatic && field.name === "\u0275pipe");
|
|
1806
|
+
if (def === void 0) {
|
|
1807
|
+
return null;
|
|
1808
|
+
} else if (def.type === null || !ts6.isTypeReferenceNode(def.type) || def.type.typeArguments === void 0 || def.type.typeArguments.length < 2) {
|
|
1809
|
+
return null;
|
|
1889
1810
|
}
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
if (this.opaqueSymbols.has(decl)) {
|
|
1894
|
-
return this.opaqueSymbols.get(decl);
|
|
1811
|
+
const type = def.type.typeArguments[1];
|
|
1812
|
+
if (!ts6.isLiteralTypeNode(type) || !ts6.isStringLiteral(type.literal)) {
|
|
1813
|
+
return null;
|
|
1895
1814
|
}
|
|
1896
|
-
const
|
|
1897
|
-
|
|
1898
|
-
return
|
|
1815
|
+
const name = type.literal.text;
|
|
1816
|
+
const isStandalone = def.type.typeArguments.length > 2 && ((_a = readBooleanType(def.type.typeArguments[2])) != null ? _a : false);
|
|
1817
|
+
return {
|
|
1818
|
+
kind: MetaKind.Pipe,
|
|
1819
|
+
ref,
|
|
1820
|
+
name,
|
|
1821
|
+
nameExpr: null,
|
|
1822
|
+
isStandalone,
|
|
1823
|
+
decorator: null
|
|
1824
|
+
};
|
|
1899
1825
|
}
|
|
1900
1826
|
};
|
|
1901
|
-
function
|
|
1902
|
-
if (
|
|
1903
|
-
return
|
|
1904
|
-
} else {
|
|
1905
|
-
return null;
|
|
1906
|
-
}
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
1910
|
-
import ts9 from "typescript";
|
|
1911
|
-
|
|
1912
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/util.mjs
|
|
1913
|
-
function isSymbolEqual(a, b) {
|
|
1914
|
-
if (a.decl === b.decl) {
|
|
1915
|
-
return true;
|
|
1916
|
-
}
|
|
1917
|
-
if (a.identifier === null || b.identifier === null) {
|
|
1918
|
-
return false;
|
|
1827
|
+
function readBaseClass2(clazz, checker, reflector) {
|
|
1828
|
+
if (!isNamedClassDeclaration(clazz)) {
|
|
1829
|
+
return reflector.hasBaseClass(clazz) ? "dynamic" : null;
|
|
1919
1830
|
}
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1831
|
+
if (clazz.heritageClauses !== void 0) {
|
|
1832
|
+
for (const clause of clazz.heritageClauses) {
|
|
1833
|
+
if (clause.token === ts6.SyntaxKind.ExtendsKeyword) {
|
|
1834
|
+
const baseExpr = clause.types[0].expression;
|
|
1835
|
+
let symbol = checker.getSymbolAtLocation(baseExpr);
|
|
1836
|
+
if (symbol === void 0) {
|
|
1837
|
+
return "dynamic";
|
|
1838
|
+
} else if (symbol.flags & ts6.SymbolFlags.Alias) {
|
|
1839
|
+
symbol = checker.getAliasedSymbol(symbol);
|
|
1840
|
+
}
|
|
1841
|
+
if (symbol.valueDeclaration !== void 0 && isNamedClassDeclaration(symbol.valueDeclaration)) {
|
|
1842
|
+
return new Reference(symbol.valueDeclaration);
|
|
1843
|
+
} else {
|
|
1844
|
+
return "dynamic";
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1925
1848
|
}
|
|
1926
|
-
return
|
|
1927
|
-
}
|
|
1928
|
-
function referenceEquality(a, b) {
|
|
1929
|
-
return a === b;
|
|
1849
|
+
return null;
|
|
1930
1850
|
}
|
|
1931
|
-
function
|
|
1932
|
-
if (
|
|
1933
|
-
return
|
|
1851
|
+
function readHostDirectivesType(checker, type, bestGuessOwningModule) {
|
|
1852
|
+
if (!ts6.isTupleTypeNode(type) || type.elements.length === 0) {
|
|
1853
|
+
return null;
|
|
1934
1854
|
}
|
|
1935
|
-
|
|
1936
|
-
|
|
1855
|
+
const result = [];
|
|
1856
|
+
for (const hostDirectiveType of type.elements) {
|
|
1857
|
+
const { directive, inputs, outputs } = readMapType(hostDirectiveType, (type2) => type2);
|
|
1858
|
+
if (directive) {
|
|
1859
|
+
if (!ts6.isTypeQueryNode(directive)) {
|
|
1860
|
+
throw new Error(`Expected TypeQueryNode: ${nodeDebugInfo(directive)}`);
|
|
1861
|
+
}
|
|
1862
|
+
result.push({
|
|
1863
|
+
directive: extraReferenceFromTypeQuery(checker, directive, type, bestGuessOwningModule),
|
|
1864
|
+
isForwardReference: false,
|
|
1865
|
+
inputs: readMapType(inputs, readStringType),
|
|
1866
|
+
outputs: readMapType(outputs, readStringType)
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1937
1869
|
}
|
|
1938
|
-
return
|
|
1870
|
+
return result.length > 0 ? result : null;
|
|
1939
1871
|
}
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1872
|
+
|
|
1873
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/inheritance.mjs
|
|
1874
|
+
function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
1875
|
+
const topMeta = reader.getDirectiveMetadata(dir);
|
|
1876
|
+
if (topMeta === null) {
|
|
1877
|
+
throw new Error(`Metadata not found for directive: ${dir.debugName}`);
|
|
1943
1878
|
}
|
|
1944
|
-
if (
|
|
1945
|
-
return
|
|
1879
|
+
if (topMeta.baseClass === null) {
|
|
1880
|
+
return topMeta;
|
|
1946
1881
|
}
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1882
|
+
const coercedInputFields = /* @__PURE__ */ new Set();
|
|
1883
|
+
const undeclaredInputFields = /* @__PURE__ */ new Set();
|
|
1884
|
+
const restrictedInputFields = /* @__PURE__ */ new Set();
|
|
1885
|
+
const stringLiteralInputFields = /* @__PURE__ */ new Set();
|
|
1886
|
+
let isDynamic = false;
|
|
1887
|
+
let inputs = ClassPropertyMapping.empty();
|
|
1888
|
+
let outputs = ClassPropertyMapping.empty();
|
|
1889
|
+
let isStructural = false;
|
|
1890
|
+
const addMetadata = (meta) => {
|
|
1891
|
+
if (meta.baseClass === "dynamic") {
|
|
1892
|
+
isDynamic = true;
|
|
1893
|
+
} else if (meta.baseClass !== null) {
|
|
1894
|
+
const baseMeta = reader.getDirectiveMetadata(meta.baseClass);
|
|
1895
|
+
if (baseMeta !== null) {
|
|
1896
|
+
addMetadata(baseMeta);
|
|
1897
|
+
} else {
|
|
1898
|
+
isDynamic = true;
|
|
1953
1899
|
}
|
|
1954
1900
|
}
|
|
1955
|
-
|
|
1956
|
-
|
|
1901
|
+
isStructural = isStructural || meta.isStructural;
|
|
1902
|
+
inputs = ClassPropertyMapping.merge(inputs, meta.inputs);
|
|
1903
|
+
outputs = ClassPropertyMapping.merge(outputs, meta.outputs);
|
|
1904
|
+
for (const coercedInputField of meta.coercedInputFields) {
|
|
1905
|
+
coercedInputFields.add(coercedInputField);
|
|
1957
1906
|
}
|
|
1958
|
-
|
|
1959
|
-
|
|
1907
|
+
for (const undeclaredInputField of meta.undeclaredInputFields) {
|
|
1908
|
+
undeclaredInputFields.add(undeclaredInputField);
|
|
1909
|
+
}
|
|
1910
|
+
for (const restrictedInputField of meta.restrictedInputFields) {
|
|
1911
|
+
restrictedInputFields.add(restrictedInputField);
|
|
1912
|
+
}
|
|
1913
|
+
for (const field of meta.stringLiteralInputFields) {
|
|
1914
|
+
stringLiteralInputFields.add(field);
|
|
1915
|
+
}
|
|
1916
|
+
};
|
|
1917
|
+
addMetadata(topMeta);
|
|
1918
|
+
return {
|
|
1919
|
+
...topMeta,
|
|
1920
|
+
inputs,
|
|
1921
|
+
outputs,
|
|
1922
|
+
coercedInputFields,
|
|
1923
|
+
undeclaredInputFields,
|
|
1924
|
+
restrictedInputFields,
|
|
1925
|
+
stringLiteralInputFields,
|
|
1926
|
+
baseClass: isDynamic ? "dynamic" : null,
|
|
1927
|
+
isStructural
|
|
1928
|
+
};
|
|
1960
1929
|
}
|
|
1961
1930
|
|
|
1962
|
-
// bazel-out/
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1931
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/registry.mjs
|
|
1932
|
+
var LocalMetadataRegistry = class {
|
|
1933
|
+
constructor() {
|
|
1934
|
+
this.directives = /* @__PURE__ */ new Map();
|
|
1935
|
+
this.ngModules = /* @__PURE__ */ new Map();
|
|
1936
|
+
this.pipes = /* @__PURE__ */ new Map();
|
|
1966
1937
|
}
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
function areTypeParametersEqual(current, previous) {
|
|
1970
|
-
if (!isArrayEqual(current, previous, isTypeParameterEqual)) {
|
|
1971
|
-
return false;
|
|
1938
|
+
getDirectiveMetadata(ref) {
|
|
1939
|
+
return this.directives.has(ref.node) ? this.directives.get(ref.node) : null;
|
|
1972
1940
|
}
|
|
1973
|
-
|
|
1974
|
-
return
|
|
1941
|
+
getNgModuleMetadata(ref) {
|
|
1942
|
+
return this.ngModules.has(ref.node) ? this.ngModules.get(ref.node) : null;
|
|
1975
1943
|
}
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
function isTypeParameterEqual(a, b) {
|
|
1979
|
-
return a.hasGenericTypeBound === b.hasGenericTypeBound;
|
|
1980
|
-
}
|
|
1981
|
-
|
|
1982
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/api.mjs
|
|
1983
|
-
var MetaKind;
|
|
1984
|
-
(function(MetaKind2) {
|
|
1985
|
-
MetaKind2[MetaKind2["Directive"] = 0] = "Directive";
|
|
1986
|
-
MetaKind2[MetaKind2["Pipe"] = 1] = "Pipe";
|
|
1987
|
-
MetaKind2[MetaKind2["NgModule"] = 2] = "NgModule";
|
|
1988
|
-
})(MetaKind || (MetaKind = {}));
|
|
1989
|
-
var MatchSource;
|
|
1990
|
-
(function(MatchSource2) {
|
|
1991
|
-
MatchSource2[MatchSource2["Selector"] = 0] = "Selector";
|
|
1992
|
-
MatchSource2[MatchSource2["HostDirective"] = 1] = "HostDirective";
|
|
1993
|
-
})(MatchSource || (MatchSource = {}));
|
|
1994
|
-
|
|
1995
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1996
|
-
import ts11 from "typescript";
|
|
1997
|
-
|
|
1998
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/property_mapping.mjs
|
|
1999
|
-
var ClassPropertyMapping = class {
|
|
2000
|
-
constructor(forwardMap) {
|
|
2001
|
-
this.forwardMap = forwardMap;
|
|
2002
|
-
this.reverseMap = reverseMapFromForwardMap(forwardMap);
|
|
1944
|
+
getPipeMetadata(ref) {
|
|
1945
|
+
return this.pipes.has(ref.node) ? this.pipes.get(ref.node) : null;
|
|
2003
1946
|
}
|
|
2004
|
-
|
|
2005
|
-
|
|
1947
|
+
registerDirectiveMetadata(meta) {
|
|
1948
|
+
this.directives.set(meta.ref.node, meta);
|
|
2006
1949
|
}
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
for (const classPropertyName of Object.keys(obj)) {
|
|
2010
|
-
const value = obj[classPropertyName];
|
|
2011
|
-
const bindingPropertyName = Array.isArray(value) ? value[0] : value;
|
|
2012
|
-
const inputOrOutput = { classPropertyName, bindingPropertyName };
|
|
2013
|
-
forwardMap.set(classPropertyName, inputOrOutput);
|
|
2014
|
-
}
|
|
2015
|
-
return new ClassPropertyMapping(forwardMap);
|
|
1950
|
+
registerNgModuleMetadata(meta) {
|
|
1951
|
+
this.ngModules.set(meta.ref.node, meta);
|
|
2016
1952
|
}
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
1953
|
+
registerPipeMetadata(meta) {
|
|
1954
|
+
this.pipes.set(meta.ref.node, meta);
|
|
1955
|
+
}
|
|
1956
|
+
getKnownDirectives() {
|
|
1957
|
+
return this.directives.keys();
|
|
1958
|
+
}
|
|
1959
|
+
};
|
|
1960
|
+
var CompoundMetadataRegistry = class {
|
|
1961
|
+
constructor(registries) {
|
|
1962
|
+
this.registries = registries;
|
|
1963
|
+
}
|
|
1964
|
+
registerDirectiveMetadata(meta) {
|
|
1965
|
+
for (const registry of this.registries) {
|
|
1966
|
+
registry.registerDirectiveMetadata(meta);
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
registerNgModuleMetadata(meta) {
|
|
1970
|
+
for (const registry of this.registries) {
|
|
1971
|
+
registry.registerNgModuleMetadata(meta);
|
|
2021
1972
|
}
|
|
2022
|
-
return new ClassPropertyMapping(forwardMap);
|
|
2023
1973
|
}
|
|
2024
|
-
|
|
2025
|
-
|
|
1974
|
+
registerPipeMetadata(meta) {
|
|
1975
|
+
for (const registry of this.registries) {
|
|
1976
|
+
registry.registerPipeMetadata(meta);
|
|
1977
|
+
}
|
|
2026
1978
|
}
|
|
2027
|
-
|
|
2028
|
-
|
|
1979
|
+
};
|
|
1980
|
+
|
|
1981
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/resource_registry.mjs
|
|
1982
|
+
var ResourceRegistry = class {
|
|
1983
|
+
constructor() {
|
|
1984
|
+
this.externalTemplateToComponentsMap = /* @__PURE__ */ new Map();
|
|
1985
|
+
this.componentToTemplateMap = /* @__PURE__ */ new Map();
|
|
1986
|
+
this.componentToStylesMap = /* @__PURE__ */ new Map();
|
|
1987
|
+
this.externalStyleToComponentsMap = /* @__PURE__ */ new Map();
|
|
2029
1988
|
}
|
|
2030
|
-
|
|
2031
|
-
|
|
1989
|
+
getComponentsWithTemplate(template) {
|
|
1990
|
+
if (!this.externalTemplateToComponentsMap.has(template)) {
|
|
1991
|
+
return /* @__PURE__ */ new Set();
|
|
1992
|
+
}
|
|
1993
|
+
return this.externalTemplateToComponentsMap.get(template);
|
|
2032
1994
|
}
|
|
2033
|
-
|
|
2034
|
-
|
|
1995
|
+
registerResources(resources, component) {
|
|
1996
|
+
if (resources.template !== null) {
|
|
1997
|
+
this.registerTemplate(resources.template, component);
|
|
1998
|
+
}
|
|
1999
|
+
for (const style of resources.styles) {
|
|
2000
|
+
this.registerStyle(style, component);
|
|
2001
|
+
}
|
|
2035
2002
|
}
|
|
2036
|
-
|
|
2037
|
-
|
|
2003
|
+
registerTemplate(templateResource, component) {
|
|
2004
|
+
const { path } = templateResource;
|
|
2005
|
+
if (path !== null) {
|
|
2006
|
+
if (!this.externalTemplateToComponentsMap.has(path)) {
|
|
2007
|
+
this.externalTemplateToComponentsMap.set(path, /* @__PURE__ */ new Set());
|
|
2008
|
+
}
|
|
2009
|
+
this.externalTemplateToComponentsMap.get(path).add(component);
|
|
2010
|
+
}
|
|
2011
|
+
this.componentToTemplateMap.set(component, templateResource);
|
|
2038
2012
|
}
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
obj[classPropertyName] = inputOrOutput.bindingPropertyName;
|
|
2013
|
+
getTemplate(component) {
|
|
2014
|
+
if (!this.componentToTemplateMap.has(component)) {
|
|
2015
|
+
return null;
|
|
2043
2016
|
}
|
|
2044
|
-
return
|
|
2017
|
+
return this.componentToTemplateMap.get(component);
|
|
2045
2018
|
}
|
|
2046
|
-
|
|
2047
|
-
const
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2019
|
+
registerStyle(styleResource, component) {
|
|
2020
|
+
const { path } = styleResource;
|
|
2021
|
+
if (!this.componentToStylesMap.has(component)) {
|
|
2022
|
+
this.componentToStylesMap.set(component, /* @__PURE__ */ new Set());
|
|
2023
|
+
}
|
|
2024
|
+
if (path !== null) {
|
|
2025
|
+
if (!this.externalStyleToComponentsMap.has(path)) {
|
|
2026
|
+
this.externalStyleToComponentsMap.set(path, /* @__PURE__ */ new Set());
|
|
2053
2027
|
}
|
|
2028
|
+
this.externalStyleToComponentsMap.get(path).add(component);
|
|
2054
2029
|
}
|
|
2055
|
-
|
|
2030
|
+
this.componentToStylesMap.get(component).add(styleResource);
|
|
2056
2031
|
}
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2032
|
+
getStyles(component) {
|
|
2033
|
+
if (!this.componentToStylesMap.has(component)) {
|
|
2034
|
+
return /* @__PURE__ */ new Set();
|
|
2060
2035
|
}
|
|
2036
|
+
return this.componentToStylesMap.get(component);
|
|
2061
2037
|
}
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
for (const [_, inputOrOutput] of forwardMap) {
|
|
2066
|
-
if (!reverseMap.has(inputOrOutput.bindingPropertyName)) {
|
|
2067
|
-
reverseMap.set(inputOrOutput.bindingPropertyName, []);
|
|
2038
|
+
getComponentsWithStyle(styleUrl) {
|
|
2039
|
+
if (!this.externalStyleToComponentsMap.has(styleUrl)) {
|
|
2040
|
+
return /* @__PURE__ */ new Set();
|
|
2068
2041
|
}
|
|
2069
|
-
|
|
2042
|
+
return this.externalStyleToComponentsMap.get(styleUrl);
|
|
2070
2043
|
}
|
|
2071
|
-
|
|
2072
|
-
}
|
|
2044
|
+
};
|
|
2073
2045
|
|
|
2074
|
-
// bazel-out/
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2046
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/host_directives_resolver.mjs
|
|
2047
|
+
var EMPTY_ARRAY = [];
|
|
2048
|
+
var HostDirectivesResolver = class {
|
|
2049
|
+
constructor(metaReader) {
|
|
2050
|
+
this.metaReader = metaReader;
|
|
2051
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
2079
2052
|
}
|
|
2080
|
-
|
|
2081
|
-
if (
|
|
2082
|
-
|
|
2053
|
+
resolve(metadata) {
|
|
2054
|
+
if (this.cache.has(metadata.ref.node)) {
|
|
2055
|
+
return this.cache.get(metadata.ref.node);
|
|
2083
2056
|
}
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
function extraReferenceFromTypeQuery(checker, typeNode, origin, bestGuessOwningModule) {
|
|
2088
|
-
const type = typeNode.exprName;
|
|
2089
|
-
const { node, from } = reflectTypeEntityToDeclaration(type, checker);
|
|
2090
|
-
if (!isNamedClassDeclaration(node)) {
|
|
2091
|
-
throw new Error(`Expected named ClassDeclaration: ${nodeDebugInfo(node)}`);
|
|
2057
|
+
const results = metadata.hostDirectives && metadata.hostDirectives.length > 0 ? this.walkHostDirectives(metadata.hostDirectives, []) : EMPTY_ARRAY;
|
|
2058
|
+
this.cache.set(metadata.ref.node, results);
|
|
2059
|
+
return results;
|
|
2092
2060
|
}
|
|
2093
|
-
|
|
2094
|
-
|
|
2061
|
+
walkHostDirectives(directives, results) {
|
|
2062
|
+
for (const current of directives) {
|
|
2063
|
+
const hostMeta = flattenInheritedDirectiveMetadata(this.metaReader, current.directive);
|
|
2064
|
+
if (hostMeta === null) {
|
|
2065
|
+
throw new Error(`Could not resolve host directive metadata of ${current.directive.debugName}`);
|
|
2066
|
+
}
|
|
2067
|
+
if (hostMeta.hostDirectives) {
|
|
2068
|
+
this.walkHostDirectives(hostMeta.hostDirectives, results);
|
|
2069
|
+
}
|
|
2070
|
+
results.push({
|
|
2071
|
+
...hostMeta,
|
|
2072
|
+
matchSource: MatchSource.HostDirective,
|
|
2073
|
+
inputs: this.filterMappings(hostMeta.inputs, current.inputs),
|
|
2074
|
+
outputs: this.filterMappings(hostMeta.outputs, current.outputs)
|
|
2075
|
+
});
|
|
2076
|
+
}
|
|
2077
|
+
return results;
|
|
2095
2078
|
}
|
|
2096
|
-
|
|
2097
|
-
}
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2079
|
+
filterMappings(source, allowedProperties) {
|
|
2080
|
+
const result = {};
|
|
2081
|
+
if (allowedProperties !== null) {
|
|
2082
|
+
for (const publicName in allowedProperties) {
|
|
2083
|
+
if (allowedProperties.hasOwnProperty(publicName)) {
|
|
2084
|
+
const bindings = source.getByBindingPropertyName(publicName);
|
|
2085
|
+
if (bindings !== null) {
|
|
2086
|
+
for (const binding of bindings) {
|
|
2087
|
+
result[binding.classPropertyName] = allowedProperties[publicName];
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
return ClassPropertyMapping.fromMappedObject(result);
|
|
2101
2094
|
}
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2095
|
+
};
|
|
2096
|
+
|
|
2097
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/diagnostics.mjs
|
|
2098
|
+
function makeDuplicateDeclarationError(node, data, kind) {
|
|
2099
|
+
const context = [];
|
|
2100
|
+
for (const decl of data) {
|
|
2101
|
+
if (decl.rawDeclarations === null) {
|
|
2102
|
+
continue;
|
|
2103
|
+
}
|
|
2104
|
+
const contextNode = decl.ref.getOriginForDiagnostics(decl.rawDeclarations, decl.ngModule.name);
|
|
2105
|
+
context.push(makeRelatedInformation(contextNode, `'${node.name.text}' is listed in the declarations of the NgModule '${decl.ngModule.name.text}'.`));
|
|
2109
2106
|
}
|
|
2107
|
+
return makeDiagnostic(ErrorCode.NGMODULE_DECLARATION_NOT_UNIQUE, node.name, `The ${kind} '${node.name.text}' is declared by more than one NgModule.`, context);
|
|
2110
2108
|
}
|
|
2111
|
-
function
|
|
2112
|
-
|
|
2113
|
-
|
|
2109
|
+
function createValueHasWrongTypeError(node, value, messageText) {
|
|
2110
|
+
var _a;
|
|
2111
|
+
let chainedMessage;
|
|
2112
|
+
let relatedInformation;
|
|
2113
|
+
if (value instanceof DynamicValue) {
|
|
2114
|
+
chainedMessage = "Value could not be determined statically.";
|
|
2115
|
+
relatedInformation = traceDynamicValue(node, value);
|
|
2116
|
+
} else if (value instanceof Reference) {
|
|
2117
|
+
const target = value.debugName !== null ? `'${value.debugName}'` : "an anonymous declaration";
|
|
2118
|
+
chainedMessage = `Value is a reference to ${target}.`;
|
|
2119
|
+
const referenceNode = (_a = identifierOfNode(value.node)) != null ? _a : value.node;
|
|
2120
|
+
relatedInformation = [makeRelatedInformation(referenceNode, "Reference is declared here.")];
|
|
2121
|
+
} else {
|
|
2122
|
+
chainedMessage = `Value is of type '${describeResolvedType(value)}'.`;
|
|
2114
2123
|
}
|
|
2115
|
-
|
|
2124
|
+
const chain = {
|
|
2125
|
+
messageText,
|
|
2126
|
+
category: ts7.DiagnosticCategory.Error,
|
|
2127
|
+
code: 0,
|
|
2128
|
+
next: [{
|
|
2129
|
+
messageText: chainedMessage,
|
|
2130
|
+
category: ts7.DiagnosticCategory.Message,
|
|
2131
|
+
code: 0
|
|
2132
|
+
}]
|
|
2133
|
+
};
|
|
2134
|
+
return new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, node, chain, relatedInformation);
|
|
2116
2135
|
}
|
|
2117
|
-
function
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
if (!ts10.isPropertySignature(member) || member.type === void 0 || member.name === void 0 || !ts10.isStringLiteral(member.name) && !ts10.isIdentifier(member.name)) {
|
|
2124
|
-
return;
|
|
2125
|
-
}
|
|
2126
|
-
const value = valueTransform(member.type);
|
|
2127
|
-
if (value === null) {
|
|
2128
|
-
return null;
|
|
2136
|
+
function getProviderDiagnostics(providerClasses, providersDeclaration, registry) {
|
|
2137
|
+
const diagnostics = [];
|
|
2138
|
+
for (const provider of providerClasses) {
|
|
2139
|
+
const injectableMeta = registry.getInjectableMeta(provider.node);
|
|
2140
|
+
if (injectableMeta !== null) {
|
|
2141
|
+
continue;
|
|
2129
2142
|
}
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
}
|
|
2134
|
-
|
|
2135
|
-
if (!ts10.isTupleTypeNode(type)) {
|
|
2136
|
-
return [];
|
|
2143
|
+
const contextNode = provider.getOriginForDiagnostics(providersDeclaration);
|
|
2144
|
+
diagnostics.push(makeDiagnostic(ErrorCode.UNDECORATED_PROVIDER, contextNode, `The class '${provider.node.name.text}' cannot be created via dependency injection, as it does not have an Angular decorator. This will result in an error at runtime.
|
|
2145
|
+
|
|
2146
|
+
Either add the @Injectable() decorator to '${provider.node.name.text}', or configure a different provider (such as a provider with 'useFactory').
|
|
2147
|
+
`, [makeRelatedInformation(provider.node, `'${provider.node.name.text}' is declared here.`)]));
|
|
2137
2148
|
}
|
|
2138
|
-
|
|
2139
|
-
type.elements.forEach((el) => {
|
|
2140
|
-
if (!ts10.isLiteralTypeNode(el) || !ts10.isStringLiteral(el.literal)) {
|
|
2141
|
-
return;
|
|
2142
|
-
}
|
|
2143
|
-
res.push(el.literal.text);
|
|
2144
|
-
});
|
|
2145
|
-
return res;
|
|
2149
|
+
return diagnostics;
|
|
2146
2150
|
}
|
|
2147
|
-
function
|
|
2148
|
-
|
|
2149
|
-
const
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2151
|
+
function getDirectiveDiagnostics(node, injectableRegistry, evaluator, reflector, scopeRegistry, strictInjectionParameters, kind) {
|
|
2152
|
+
let diagnostics = [];
|
|
2153
|
+
const addDiagnostics = (more) => {
|
|
2154
|
+
if (more === null) {
|
|
2155
|
+
return;
|
|
2156
|
+
} else if (diagnostics === null) {
|
|
2157
|
+
diagnostics = Array.isArray(more) ? more : [more];
|
|
2158
|
+
} else if (Array.isArray(more)) {
|
|
2159
|
+
diagnostics.push(...more);
|
|
2160
|
+
} else {
|
|
2161
|
+
diagnostics.push(more);
|
|
2162
|
+
}
|
|
2163
|
+
};
|
|
2164
|
+
const duplicateDeclarations = scopeRegistry.getDuplicateDeclarations(node);
|
|
2165
|
+
if (duplicateDeclarations !== null) {
|
|
2166
|
+
addDiagnostics(makeDuplicateDeclarationError(node, duplicateDeclarations, kind));
|
|
2167
|
+
}
|
|
2168
|
+
addDiagnostics(checkInheritanceOfInjectable(node, injectableRegistry, reflector, evaluator, strictInjectionParameters, kind));
|
|
2169
|
+
return diagnostics;
|
|
2170
|
+
}
|
|
2171
|
+
function validateHostDirectives(origin, hostDirectives, metaReader) {
|
|
2172
|
+
const diagnostics = [];
|
|
2173
|
+
for (const current of hostDirectives) {
|
|
2174
|
+
const hostMeta = flattenInheritedDirectiveMetadata(metaReader, current.directive);
|
|
2175
|
+
if (hostMeta === null) {
|
|
2176
|
+
diagnostics.push(makeDiagnostic(ErrorCode.HOST_DIRECTIVE_INVALID, current.directive.getOriginForDiagnostics(origin), `${current.directive.debugName} must be a standalone directive to be used as a host directive`));
|
|
2160
2177
|
continue;
|
|
2161
2178
|
}
|
|
2162
|
-
if (
|
|
2163
|
-
|
|
2179
|
+
if (!hostMeta.isStandalone) {
|
|
2180
|
+
diagnostics.push(makeDiagnostic(ErrorCode.HOST_DIRECTIVE_NOT_STANDALONE, current.directive.getOriginForDiagnostics(origin), `Host directive ${hostMeta.name} must be standalone`));
|
|
2164
2181
|
}
|
|
2165
|
-
if (
|
|
2166
|
-
|
|
2182
|
+
if (hostMeta.isComponent) {
|
|
2183
|
+
diagnostics.push(makeDiagnostic(ErrorCode.HOST_DIRECTIVE_COMPONENT, current.directive.getOriginForDiagnostics(origin), `Host directive ${hostMeta.name} cannot be a component`));
|
|
2167
2184
|
}
|
|
2185
|
+
validateHostDirectiveMappings("input", current, hostMeta, origin, diagnostics);
|
|
2186
|
+
validateHostDirectiveMappings("output", current, hostMeta, origin, diagnostics);
|
|
2168
2187
|
}
|
|
2169
|
-
|
|
2170
|
-
return {
|
|
2171
|
-
hasNgTemplateContextGuard,
|
|
2172
|
-
ngTemplateGuards,
|
|
2173
|
-
coercedInputFields,
|
|
2174
|
-
restrictedInputFields,
|
|
2175
|
-
stringLiteralInputFields,
|
|
2176
|
-
undeclaredInputFields,
|
|
2177
|
-
isGeneric: arity !== null && arity > 0
|
|
2178
|
-
};
|
|
2179
|
-
}
|
|
2180
|
-
function isRestricted(node) {
|
|
2181
|
-
const modifiers = getModifiers(node);
|
|
2182
|
-
return modifiers !== void 0 && modifiers.some(({ kind }) => {
|
|
2183
|
-
return kind === ts10.SyntaxKind.PrivateKeyword || kind === ts10.SyntaxKind.ProtectedKeyword || kind === ts10.SyntaxKind.ReadonlyKeyword;
|
|
2184
|
-
});
|
|
2188
|
+
return diagnostics;
|
|
2185
2189
|
}
|
|
2186
|
-
function
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
const
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2190
|
+
function validateHostDirectiveMappings(bindingType, hostDirectiveMeta, meta, origin, diagnostics) {
|
|
2191
|
+
const className = meta.name;
|
|
2192
|
+
const hostDirectiveMappings = bindingType === "input" ? hostDirectiveMeta.inputs : hostDirectiveMeta.outputs;
|
|
2193
|
+
const existingBindings = bindingType === "input" ? meta.inputs : meta.outputs;
|
|
2194
|
+
for (const publicName in hostDirectiveMappings) {
|
|
2195
|
+
if (hostDirectiveMappings.hasOwnProperty(publicName)) {
|
|
2196
|
+
if (!existingBindings.hasBindingPropertyName(publicName)) {
|
|
2197
|
+
diagnostics.push(makeDiagnostic(ErrorCode.HOST_DIRECTIVE_UNDEFINED_BINDING, hostDirectiveMeta.directive.getOriginForDiagnostics(origin), `Directive ${className} does not have an ${bindingType} with a public name of ${publicName}.`));
|
|
2198
|
+
}
|
|
2199
|
+
const remappedPublicName = hostDirectiveMappings[publicName];
|
|
2200
|
+
const bindingsForPublicName = existingBindings.getByBindingPropertyName(remappedPublicName);
|
|
2201
|
+
if (bindingsForPublicName !== null) {
|
|
2202
|
+
for (const binding of bindingsForPublicName) {
|
|
2203
|
+
if (binding.bindingPropertyName !== publicName) {
|
|
2204
|
+
diagnostics.push(makeDiagnostic(ErrorCode.HOST_DIRECTIVE_CONFLICTING_ALIAS, hostDirectiveMeta.directive.getOriginForDiagnostics(origin), `Cannot alias ${bindingType} ${publicName} of host directive ${className} to ${remappedPublicName}, because it already has a different ${bindingType} with the same public name.`));
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2198
2208
|
}
|
|
2199
|
-
return { inputName, type };
|
|
2200
|
-
} else if (member.kind === ClassMemberKind.Method) {
|
|
2201
|
-
return { inputName, type: "invocation" };
|
|
2202
|
-
} else {
|
|
2203
|
-
return null;
|
|
2204
2209
|
}
|
|
2205
2210
|
}
|
|
2206
|
-
function
|
|
2207
|
-
|
|
2211
|
+
function getUndecoratedClassWithAngularFeaturesDiagnostic(node) {
|
|
2212
|
+
return makeDiagnostic(ErrorCode.UNDECORATED_CLASS_USING_ANGULAR_FEATURES, node.name, `Class is using Angular features but is not decorated. Please add an explicit Angular decorator.`);
|
|
2213
|
+
}
|
|
2214
|
+
function checkInheritanceOfInjectable(node, injectableRegistry, reflector, evaluator, strictInjectionParameters, kind) {
|
|
2215
|
+
const classWithCtor = findInheritedCtor(node, injectableRegistry, reflector, evaluator);
|
|
2216
|
+
if (classWithCtor === null || classWithCtor.isCtorValid) {
|
|
2208
2217
|
return null;
|
|
2209
2218
|
}
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
var CompoundMetadataReader = class {
|
|
2213
|
-
constructor(readers) {
|
|
2214
|
-
this.readers = readers;
|
|
2219
|
+
if (!classWithCtor.isDecorated) {
|
|
2220
|
+
return getInheritedUndecoratedCtorDiagnostic(node, classWithCtor.ref, kind);
|
|
2215
2221
|
}
|
|
2216
|
-
|
|
2217
|
-
for (const reader of this.readers) {
|
|
2218
|
-
const meta = reader.getDirectiveMetadata(node);
|
|
2219
|
-
if (meta !== null) {
|
|
2220
|
-
return meta;
|
|
2221
|
-
}
|
|
2222
|
-
}
|
|
2222
|
+
if (!strictInjectionParameters || isAbstractClassDeclaration(node)) {
|
|
2223
2223
|
return null;
|
|
2224
2224
|
}
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
return meta;
|
|
2230
|
-
}
|
|
2231
|
-
}
|
|
2225
|
+
return getInheritedInvalidCtorDiagnostic(node, classWithCtor.ref, kind);
|
|
2226
|
+
}
|
|
2227
|
+
function findInheritedCtor(node, injectableRegistry, reflector, evaluator) {
|
|
2228
|
+
if (!reflector.isClass(node) || reflector.getConstructorParameters(node) !== null) {
|
|
2232
2229
|
return null;
|
|
2233
2230
|
}
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2231
|
+
let baseClass = readBaseClass(node, reflector, evaluator);
|
|
2232
|
+
while (baseClass !== null) {
|
|
2233
|
+
if (baseClass === "dynamic") {
|
|
2234
|
+
return null;
|
|
2235
|
+
}
|
|
2236
|
+
const injectableMeta = injectableRegistry.getInjectableMeta(baseClass.node);
|
|
2237
|
+
if (injectableMeta !== null) {
|
|
2238
|
+
if (injectableMeta.ctorDeps !== null) {
|
|
2239
|
+
return {
|
|
2240
|
+
ref: baseClass,
|
|
2241
|
+
isCtorValid: injectableMeta.ctorDeps !== "invalid",
|
|
2242
|
+
isDecorated: true
|
|
2243
|
+
};
|
|
2244
|
+
}
|
|
2245
|
+
} else {
|
|
2246
|
+
const baseClassConstructorParams = reflector.getConstructorParameters(baseClass.node);
|
|
2247
|
+
if (baseClassConstructorParams !== null) {
|
|
2248
|
+
return {
|
|
2249
|
+
ref: baseClass,
|
|
2250
|
+
isCtorValid: baseClassConstructorParams.length === 0,
|
|
2251
|
+
isDecorated: false
|
|
2252
|
+
};
|
|
2239
2253
|
}
|
|
2240
2254
|
}
|
|
2241
|
-
|
|
2255
|
+
baseClass = readBaseClass(baseClass.node, reflector, evaluator);
|
|
2242
2256
|
}
|
|
2243
|
-
|
|
2244
|
-
function afterUnderscore(str) {
|
|
2245
|
-
const pos = str.indexOf("_");
|
|
2246
|
-
if (pos === -1) {
|
|
2247
|
-
throw new Error(`Expected '${str}' to contain '_'`);
|
|
2248
|
-
}
|
|
2249
|
-
return str.slice(pos + 1);
|
|
2257
|
+
return null;
|
|
2250
2258
|
}
|
|
2251
|
-
function
|
|
2252
|
-
const
|
|
2253
|
-
return
|
|
2259
|
+
function getInheritedInvalidCtorDiagnostic(node, baseClass, kind) {
|
|
2260
|
+
const baseClassName = baseClass.debugName;
|
|
2261
|
+
return makeDiagnostic(ErrorCode.INJECTABLE_INHERITS_INVALID_CONSTRUCTOR, node.name, `The ${kind.toLowerCase()} ${node.name.text} inherits its constructor from ${baseClassName}, but the latter has a constructor parameter that is not compatible with dependency injection. Either add an explicit constructor to ${node.name.text} or change ${baseClassName}'s constructor to use parameters that are valid for DI.`);
|
|
2262
|
+
}
|
|
2263
|
+
function getInheritedUndecoratedCtorDiagnostic(node, baseClass, kind) {
|
|
2264
|
+
const baseClassName = baseClass.debugName;
|
|
2265
|
+
const baseNeedsDecorator = kind === "Component" || kind === "Directive" ? "Directive" : "Injectable";
|
|
2266
|
+
return makeDiagnostic(ErrorCode.DIRECTIVE_INHERITS_UNDECORATED_CTOR, node.name, `The ${kind.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 @${baseNeedsDecorator} decorator to ${baseClassName}, or add an explicit constructor to ${node.name.text}.`);
|
|
2254
2267
|
}
|
|
2255
2268
|
|
|
2256
|
-
// bazel-out/
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
} else if (ngModuleDef.type === null || !ts11.isTypeReferenceNode(ngModuleDef.type) || ngModuleDef.type.typeArguments === void 0 || ngModuleDef.type.typeArguments.length !== 4) {
|
|
2268
|
-
return null;
|
|
2269
|
-
}
|
|
2270
|
-
const [_, declarationMetadata, importMetadata, exportMetadata] = ngModuleDef.type.typeArguments;
|
|
2271
|
-
return {
|
|
2272
|
-
kind: MetaKind.NgModule,
|
|
2273
|
-
ref,
|
|
2274
|
-
declarations: extractReferencesFromType(this.checker, declarationMetadata, ref.bestGuessOwningModule),
|
|
2275
|
-
exports: extractReferencesFromType(this.checker, exportMetadata, ref.bestGuessOwningModule),
|
|
2276
|
-
imports: extractReferencesFromType(this.checker, importMetadata, ref.bestGuessOwningModule),
|
|
2277
|
-
schemas: [],
|
|
2278
|
-
rawDeclarations: null,
|
|
2279
|
-
rawImports: null,
|
|
2280
|
-
rawExports: null,
|
|
2281
|
-
decorator: null
|
|
2282
|
-
};
|
|
2283
|
-
}
|
|
2284
|
-
getDirectiveMetadata(ref) {
|
|
2285
|
-
var _a;
|
|
2286
|
-
const clazz = ref.node;
|
|
2287
|
-
const def = this.reflector.getMembersOfClass(clazz).find((field) => field.isStatic && (field.name === "\u0275cmp" || field.name === "\u0275dir"));
|
|
2288
|
-
if (def === void 0) {
|
|
2289
|
-
return null;
|
|
2290
|
-
} else if (def.type === null || !ts11.isTypeReferenceNode(def.type) || def.type.typeArguments === void 0 || def.type.typeArguments.length < 2) {
|
|
2291
|
-
return null;
|
|
2269
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/evaluation.mjs
|
|
2270
|
+
import ts8 from "typescript";
|
|
2271
|
+
function resolveEnumValue(evaluator, metadata, field, enumSymbolName) {
|
|
2272
|
+
let resolved = null;
|
|
2273
|
+
if (metadata.has(field)) {
|
|
2274
|
+
const expr = metadata.get(field);
|
|
2275
|
+
const value = evaluator.evaluate(expr);
|
|
2276
|
+
if (value instanceof EnumValue && isAngularCoreReference(value.enumRef, enumSymbolName)) {
|
|
2277
|
+
resolved = value.resolved;
|
|
2278
|
+
} else {
|
|
2279
|
+
throw createValueHasWrongTypeError(expr, value, `${field} must be a member of ${enumSymbolName} enum from @angular/core`);
|
|
2292
2280
|
}
|
|
2293
|
-
const isComponent = def.name === "\u0275cmp";
|
|
2294
|
-
const ctorParams = this.reflector.getConstructorParameters(clazz);
|
|
2295
|
-
const isStructural = !isComponent && ctorParams !== null && ctorParams.some((param) => {
|
|
2296
|
-
return param.typeValueReference.kind === 1 && param.typeValueReference.moduleName === "@angular/core" && param.typeValueReference.importedName === "TemplateRef";
|
|
2297
|
-
});
|
|
2298
|
-
const isStandalone = def.type.typeArguments.length > 7 && ((_a = readBooleanType(def.type.typeArguments[7])) != null ? _a : false);
|
|
2299
|
-
const inputs = ClassPropertyMapping.fromMappedObject(readMapType(def.type.typeArguments[3], readStringType));
|
|
2300
|
-
const outputs = ClassPropertyMapping.fromMappedObject(readMapType(def.type.typeArguments[4], readStringType));
|
|
2301
|
-
const hostDirectives = def.type.typeArguments.length > 8 ? readHostDirectivesType(this.checker, def.type.typeArguments[8], ref.bestGuessOwningModule) : null;
|
|
2302
|
-
return {
|
|
2303
|
-
kind: MetaKind.Directive,
|
|
2304
|
-
matchSource: MatchSource.Selector,
|
|
2305
|
-
ref,
|
|
2306
|
-
name: clazz.name.text,
|
|
2307
|
-
isComponent,
|
|
2308
|
-
selector: readStringType(def.type.typeArguments[1]),
|
|
2309
|
-
exportAs: readStringArrayType(def.type.typeArguments[2]),
|
|
2310
|
-
inputs,
|
|
2311
|
-
outputs,
|
|
2312
|
-
hostDirectives,
|
|
2313
|
-
queries: readStringArrayType(def.type.typeArguments[5]),
|
|
2314
|
-
...extractDirectiveTypeCheckMeta(clazz, inputs, this.reflector),
|
|
2315
|
-
baseClass: readBaseClass2(clazz, this.checker, this.reflector),
|
|
2316
|
-
isPoisoned: false,
|
|
2317
|
-
isStructural,
|
|
2318
|
-
animationTriggerNames: null,
|
|
2319
|
-
isStandalone,
|
|
2320
|
-
imports: null,
|
|
2321
|
-
schemas: null,
|
|
2322
|
-
decorator: null
|
|
2323
|
-
};
|
|
2324
2281
|
}
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
const type = def.type.typeArguments[1];
|
|
2334
|
-
if (!ts11.isLiteralTypeNode(type) || !ts11.isStringLiteral(type.literal)) {
|
|
2335
|
-
return null;
|
|
2336
|
-
}
|
|
2337
|
-
const name = type.literal.text;
|
|
2338
|
-
const isStandalone = def.type.typeArguments.length > 2 && ((_a = readBooleanType(def.type.typeArguments[2])) != null ? _a : false);
|
|
2339
|
-
return {
|
|
2340
|
-
kind: MetaKind.Pipe,
|
|
2341
|
-
ref,
|
|
2342
|
-
name,
|
|
2343
|
-
nameExpr: null,
|
|
2344
|
-
isStandalone,
|
|
2345
|
-
decorator: null
|
|
2346
|
-
};
|
|
2282
|
+
return resolved;
|
|
2283
|
+
}
|
|
2284
|
+
function isStringArray(resolvedValue) {
|
|
2285
|
+
return Array.isArray(resolvedValue) && resolvedValue.every((elem) => typeof elem === "string");
|
|
2286
|
+
}
|
|
2287
|
+
function resolveLiteral(decorator, literalCache) {
|
|
2288
|
+
if (literalCache.has(decorator)) {
|
|
2289
|
+
return literalCache.get(decorator);
|
|
2347
2290
|
}
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
if (!isNamedClassDeclaration(clazz)) {
|
|
2351
|
-
return reflector.hasBaseClass(clazz) ? "dynamic" : null;
|
|
2291
|
+
if (decorator.args === null || decorator.args.length !== 1) {
|
|
2292
|
+
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @${decorator.name} decorator`);
|
|
2352
2293
|
}
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
const baseExpr = clause.types[0].expression;
|
|
2357
|
-
let symbol = checker.getSymbolAtLocation(baseExpr);
|
|
2358
|
-
if (symbol === void 0) {
|
|
2359
|
-
return "dynamic";
|
|
2360
|
-
} else if (symbol.flags & ts11.SymbolFlags.Alias) {
|
|
2361
|
-
symbol = checker.getAliasedSymbol(symbol);
|
|
2362
|
-
}
|
|
2363
|
-
if (symbol.valueDeclaration !== void 0 && isNamedClassDeclaration(symbol.valueDeclaration)) {
|
|
2364
|
-
return new Reference(symbol.valueDeclaration);
|
|
2365
|
-
} else {
|
|
2366
|
-
return "dynamic";
|
|
2367
|
-
}
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2294
|
+
const meta = unwrapExpression(decorator.args[0]);
|
|
2295
|
+
if (!ts8.isObjectLiteralExpression(meta)) {
|
|
2296
|
+
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `Decorator argument must be literal.`);
|
|
2370
2297
|
}
|
|
2371
|
-
|
|
2298
|
+
literalCache.set(decorator, meta);
|
|
2299
|
+
return meta;
|
|
2372
2300
|
}
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
const
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
}
|
|
2384
|
-
result.push({
|
|
2385
|
-
directive: extraReferenceFromTypeQuery(checker, directive, type, bestGuessOwningModule),
|
|
2386
|
-
isForwardReference: false,
|
|
2387
|
-
inputs: readMapType(inputs, readStringType),
|
|
2388
|
-
outputs: readMapType(outputs, readStringType)
|
|
2389
|
-
});
|
|
2390
|
-
}
|
|
2391
|
-
}
|
|
2392
|
-
return result.length > 0 ? result : null;
|
|
2301
|
+
|
|
2302
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/factory.mjs
|
|
2303
|
+
import { compileDeclareFactoryFunction, compileFactoryFunction } from "@angular/compiler";
|
|
2304
|
+
function compileNgFactoryDefField(metadata) {
|
|
2305
|
+
const res = compileFactoryFunction(metadata);
|
|
2306
|
+
return { name: "\u0275fac", initializer: res.expression, statements: res.statements, type: res.type };
|
|
2307
|
+
}
|
|
2308
|
+
function compileDeclareFactory(metadata) {
|
|
2309
|
+
const res = compileDeclareFactoryFunction(metadata);
|
|
2310
|
+
return { name: "\u0275fac", initializer: res.expression, statements: res.statements, type: res.type };
|
|
2393
2311
|
}
|
|
2394
2312
|
|
|
2395
|
-
// bazel-out/
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2313
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/injectable_registry.mjs
|
|
2314
|
+
var InjectableClassRegistry = class {
|
|
2315
|
+
constructor(host, isCore) {
|
|
2316
|
+
this.host = host;
|
|
2317
|
+
this.isCore = isCore;
|
|
2318
|
+
this.classes = /* @__PURE__ */ new Map();
|
|
2400
2319
|
}
|
|
2401
|
-
|
|
2402
|
-
|
|
2320
|
+
registerInjectable(declaration, meta) {
|
|
2321
|
+
this.classes.set(declaration, meta);
|
|
2403
2322
|
}
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
const stringLiteralInputFields = /* @__PURE__ */ new Set();
|
|
2408
|
-
let isDynamic = false;
|
|
2409
|
-
let inputs = ClassPropertyMapping.empty();
|
|
2410
|
-
let outputs = ClassPropertyMapping.empty();
|
|
2411
|
-
let isStructural = false;
|
|
2412
|
-
const addMetadata = (meta) => {
|
|
2413
|
-
if (meta.baseClass === "dynamic") {
|
|
2414
|
-
isDynamic = true;
|
|
2415
|
-
} else if (meta.baseClass !== null) {
|
|
2416
|
-
const baseMeta = reader.getDirectiveMetadata(meta.baseClass);
|
|
2417
|
-
if (baseMeta !== null) {
|
|
2418
|
-
addMetadata(baseMeta);
|
|
2419
|
-
} else {
|
|
2420
|
-
isDynamic = true;
|
|
2421
|
-
}
|
|
2422
|
-
}
|
|
2423
|
-
isStructural = isStructural || meta.isStructural;
|
|
2424
|
-
inputs = ClassPropertyMapping.merge(inputs, meta.inputs);
|
|
2425
|
-
outputs = ClassPropertyMapping.merge(outputs, meta.outputs);
|
|
2426
|
-
for (const coercedInputField of meta.coercedInputFields) {
|
|
2427
|
-
coercedInputFields.add(coercedInputField);
|
|
2428
|
-
}
|
|
2429
|
-
for (const undeclaredInputField of meta.undeclaredInputFields) {
|
|
2430
|
-
undeclaredInputFields.add(undeclaredInputField);
|
|
2431
|
-
}
|
|
2432
|
-
for (const restrictedInputField of meta.restrictedInputFields) {
|
|
2433
|
-
restrictedInputFields.add(restrictedInputField);
|
|
2323
|
+
getInjectableMeta(declaration) {
|
|
2324
|
+
if (this.classes.has(declaration)) {
|
|
2325
|
+
return this.classes.get(declaration);
|
|
2434
2326
|
}
|
|
2435
|
-
|
|
2436
|
-
|
|
2327
|
+
if (!hasInjectableFields(declaration, this.host)) {
|
|
2328
|
+
return null;
|
|
2437
2329
|
}
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
restrictedInputFields,
|
|
2447
|
-
stringLiteralInputFields,
|
|
2448
|
-
baseClass: isDynamic ? "dynamic" : null,
|
|
2449
|
-
isStructural
|
|
2450
|
-
};
|
|
2451
|
-
}
|
|
2330
|
+
const ctorDeps = getConstructorDependencies(declaration, this.host, this.isCore);
|
|
2331
|
+
const meta = {
|
|
2332
|
+
ctorDeps: unwrapConstructorDependencies(ctorDeps)
|
|
2333
|
+
};
|
|
2334
|
+
this.classes.set(declaration, meta);
|
|
2335
|
+
return meta;
|
|
2336
|
+
}
|
|
2337
|
+
};
|
|
2452
2338
|
|
|
2453
|
-
// bazel-out/
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2339
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/metadata.mjs
|
|
2340
|
+
import { FunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr3 } from "@angular/compiler";
|
|
2341
|
+
import ts9 from "typescript";
|
|
2342
|
+
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
|
|
2343
|
+
if (!reflection.isClass(clazz)) {
|
|
2344
|
+
return null;
|
|
2459
2345
|
}
|
|
2460
|
-
|
|
2461
|
-
|
|
2346
|
+
const id = reflection.getAdjacentNameOfClass(clazz);
|
|
2347
|
+
const classDecorators = reflection.getDecoratorsOfDeclaration(clazz);
|
|
2348
|
+
if (classDecorators === null) {
|
|
2349
|
+
return null;
|
|
2462
2350
|
}
|
|
2463
|
-
|
|
2464
|
-
|
|
2351
|
+
const ngClassDecorators = classDecorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(angularDecoratorTransform(decorator), annotateForClosureCompiler)).map((decorator) => removeIdentifierReferences(decorator, id.text));
|
|
2352
|
+
if (ngClassDecorators.length === 0) {
|
|
2353
|
+
return null;
|
|
2465
2354
|
}
|
|
2466
|
-
|
|
2467
|
-
|
|
2355
|
+
const metaDecorators = new WrappedNodeExpr3(ts9.factory.createArrayLiteralExpression(ngClassDecorators));
|
|
2356
|
+
let metaCtorParameters = null;
|
|
2357
|
+
const classCtorParameters = reflection.getConstructorParameters(clazz);
|
|
2358
|
+
if (classCtorParameters !== null) {
|
|
2359
|
+
const ctorParameters = classCtorParameters.map((param) => ctorParameterToMetadata(param, isCore));
|
|
2360
|
+
metaCtorParameters = new FunctionExpr([], [
|
|
2361
|
+
new ReturnStatement(new LiteralArrayExpr(ctorParameters))
|
|
2362
|
+
]);
|
|
2468
2363
|
}
|
|
2469
|
-
|
|
2470
|
-
|
|
2364
|
+
let metaPropDecorators = null;
|
|
2365
|
+
const classMembers = reflection.getMembersOfClass(clazz).filter((member) => !member.isStatic && member.decorators !== null && member.decorators.length > 0);
|
|
2366
|
+
const duplicateDecoratedMemberNames = classMembers.map((member) => member.name).filter((name, i, arr) => arr.indexOf(name) < i);
|
|
2367
|
+
if (duplicateDecoratedMemberNames.length > 0) {
|
|
2368
|
+
throw new Error(`Duplicate decorated properties found on class '${clazz.name.text}': ` + duplicateDecoratedMemberNames.join(", "));
|
|
2471
2369
|
}
|
|
2472
|
-
|
|
2473
|
-
|
|
2370
|
+
const decoratedMembers = classMembers.map((member) => {
|
|
2371
|
+
var _a;
|
|
2372
|
+
return classMemberToMetadata((_a = member.nameNode) != null ? _a : member.name, member.decorators, isCore);
|
|
2373
|
+
});
|
|
2374
|
+
if (decoratedMembers.length > 0) {
|
|
2375
|
+
metaPropDecorators = new WrappedNodeExpr3(ts9.factory.createObjectLiteralExpression(decoratedMembers));
|
|
2474
2376
|
}
|
|
2475
|
-
|
|
2476
|
-
|
|
2377
|
+
return {
|
|
2378
|
+
type: new WrappedNodeExpr3(id),
|
|
2379
|
+
decorators: metaDecorators,
|
|
2380
|
+
ctorParameters: metaCtorParameters,
|
|
2381
|
+
propDecorators: metaPropDecorators
|
|
2382
|
+
};
|
|
2383
|
+
}
|
|
2384
|
+
function ctorParameterToMetadata(param, isCore) {
|
|
2385
|
+
const type = param.typeValueReference.kind !== 2 ? valueReferenceToExpression(param.typeValueReference) : new LiteralExpr2(void 0);
|
|
2386
|
+
const mapEntries = [
|
|
2387
|
+
{ key: "type", value: type, quoted: false }
|
|
2388
|
+
];
|
|
2389
|
+
if (param.decorators !== null) {
|
|
2390
|
+
const ngDecorators = param.decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
2391
|
+
const value = new WrappedNodeExpr3(ts9.factory.createArrayLiteralExpression(ngDecorators));
|
|
2392
|
+
mapEntries.push({ key: "decorators", value, quoted: false });
|
|
2477
2393
|
}
|
|
2478
|
-
|
|
2479
|
-
|
|
2394
|
+
return literalMap(mapEntries);
|
|
2395
|
+
}
|
|
2396
|
+
function classMemberToMetadata(name, decorators, isCore) {
|
|
2397
|
+
const ngDecorators = decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
2398
|
+
const decoratorMeta = ts9.factory.createArrayLiteralExpression(ngDecorators);
|
|
2399
|
+
return ts9.factory.createPropertyAssignment(name, decoratorMeta);
|
|
2400
|
+
}
|
|
2401
|
+
function decoratorToMetadata(decorator, wrapFunctionsInParens) {
|
|
2402
|
+
if (decorator.identifier === null) {
|
|
2403
|
+
throw new Error("Illegal state: synthesized decorator cannot be emitted in class metadata.");
|
|
2404
|
+
}
|
|
2405
|
+
const properties = [
|
|
2406
|
+
ts9.factory.createPropertyAssignment("type", decorator.identifier)
|
|
2407
|
+
];
|
|
2408
|
+
if (decorator.args !== null && decorator.args.length > 0) {
|
|
2409
|
+
const args = decorator.args.map((arg) => {
|
|
2410
|
+
return wrapFunctionsInParens ? wrapFunctionExpressionsInParens(arg) : arg;
|
|
2411
|
+
});
|
|
2412
|
+
properties.push(ts9.factory.createPropertyAssignment("args", ts9.factory.createArrayLiteralExpression(args)));
|
|
2413
|
+
}
|
|
2414
|
+
return ts9.factory.createObjectLiteralExpression(properties, true);
|
|
2415
|
+
}
|
|
2416
|
+
function isAngularDecorator2(decorator, isCore) {
|
|
2417
|
+
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
2418
|
+
}
|
|
2419
|
+
function removeIdentifierReferences(node, name) {
|
|
2420
|
+
const result = ts9.transform(node, [(context) => (root) => ts9.visitNode(root, function walk(current) {
|
|
2421
|
+
return ts9.isIdentifier(current) && current.text === name ? ts9.factory.createIdentifier(current.text) : ts9.visitEachChild(current, walk, context);
|
|
2422
|
+
})]);
|
|
2423
|
+
return result.transformed[0];
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/references_registry.mjs
|
|
2427
|
+
var NoopReferencesRegistry = class {
|
|
2428
|
+
add(source, ...references) {
|
|
2480
2429
|
}
|
|
2481
2430
|
};
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2431
|
+
|
|
2432
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/schema.mjs
|
|
2433
|
+
import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from "@angular/compiler";
|
|
2434
|
+
function extractSchemas(rawExpr, evaluator, context) {
|
|
2435
|
+
const schemas = [];
|
|
2436
|
+
const result = evaluator.evaluate(rawExpr);
|
|
2437
|
+
if (!Array.isArray(result)) {
|
|
2438
|
+
throw createValueHasWrongTypeError(rawExpr, result, `${context}.schemas must be an array`);
|
|
2485
2439
|
}
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2440
|
+
for (const schemaRef of result) {
|
|
2441
|
+
if (!(schemaRef instanceof Reference)) {
|
|
2442
|
+
throw createValueHasWrongTypeError(rawExpr, result, `${context}.schemas must be an array of schemas`);
|
|
2489
2443
|
}
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
registry.registerNgModuleMetadata(meta);
|
|
2444
|
+
const id = schemaRef.getIdentityIn(schemaRef.node.getSourceFile());
|
|
2445
|
+
if (id === null || schemaRef.ownedByModuleGuess !== "@angular/core") {
|
|
2446
|
+
throw createValueHasWrongTypeError(rawExpr, result, `${context}.schemas must be an array of schemas`);
|
|
2494
2447
|
}
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2448
|
+
switch (id.text) {
|
|
2449
|
+
case "CUSTOM_ELEMENTS_SCHEMA":
|
|
2450
|
+
schemas.push(CUSTOM_ELEMENTS_SCHEMA);
|
|
2451
|
+
break;
|
|
2452
|
+
case "NO_ERRORS_SCHEMA":
|
|
2453
|
+
schemas.push(NO_ERRORS_SCHEMA);
|
|
2454
|
+
break;
|
|
2455
|
+
default:
|
|
2456
|
+
throw createValueHasWrongTypeError(rawExpr, schemaRef, `'${schemaRef.debugName}' is not a valid ${context} schema`);
|
|
2499
2457
|
}
|
|
2500
2458
|
}
|
|
2459
|
+
return schemas;
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
|
|
2463
|
+
import { compileClassMetadata as compileClassMetadata3, compileComponentFromMetadata, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareComponentFromMetadata, CssSelector as CssSelector2, DEFAULT_INTERPOLATION_CONFIG as DEFAULT_INTERPOLATION_CONFIG2, DomElementSchemaRegistry, FactoryTarget as FactoryTarget3, makeBindingParser as makeBindingParser2, R3TargetBinder, R3TemplateDependencyKind, SelectorMatcher as SelectorMatcher2, ViewEncapsulation, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
2464
|
+
import ts24 from "typescript";
|
|
2465
|
+
|
|
2466
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
2467
|
+
import ts10 from "typescript";
|
|
2468
|
+
var SemanticSymbol = class {
|
|
2469
|
+
constructor(decl) {
|
|
2470
|
+
this.decl = decl;
|
|
2471
|
+
this.path = absoluteFromSourceFile(decl.getSourceFile());
|
|
2472
|
+
this.identifier = getSymbolIdentifier(decl);
|
|
2473
|
+
}
|
|
2501
2474
|
};
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
this.classes = /* @__PURE__ */ new Set();
|
|
2475
|
+
function getSymbolIdentifier(decl) {
|
|
2476
|
+
if (!ts10.isSourceFile(decl.parent)) {
|
|
2477
|
+
return null;
|
|
2506
2478
|
}
|
|
2507
|
-
|
|
2508
|
-
|
|
2479
|
+
return decl.name.text;
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/graph.mjs
|
|
2483
|
+
import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
|
|
2484
|
+
var OpaqueSymbol = class extends SemanticSymbol {
|
|
2485
|
+
isPublicApiAffected() {
|
|
2486
|
+
return false;
|
|
2509
2487
|
}
|
|
2510
|
-
|
|
2511
|
-
return
|
|
2488
|
+
isTypeCheckApiAffected() {
|
|
2489
|
+
return false;
|
|
2512
2490
|
}
|
|
2513
2491
|
};
|
|
2514
|
-
|
|
2515
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/resource_registry.mjs
|
|
2516
|
-
var ResourceRegistry = class {
|
|
2492
|
+
var SemanticDepGraph = class {
|
|
2517
2493
|
constructor() {
|
|
2518
|
-
this.
|
|
2519
|
-
this.
|
|
2520
|
-
this.componentToStylesMap = /* @__PURE__ */ new Map();
|
|
2521
|
-
this.externalStyleToComponentsMap = /* @__PURE__ */ new Map();
|
|
2494
|
+
this.files = /* @__PURE__ */ new Map();
|
|
2495
|
+
this.symbolByDecl = /* @__PURE__ */ new Map();
|
|
2522
2496
|
}
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2497
|
+
registerSymbol(symbol) {
|
|
2498
|
+
this.symbolByDecl.set(symbol.decl, symbol);
|
|
2499
|
+
if (symbol.identifier !== null) {
|
|
2500
|
+
if (!this.files.has(symbol.path)) {
|
|
2501
|
+
this.files.set(symbol.path, /* @__PURE__ */ new Map());
|
|
2502
|
+
}
|
|
2503
|
+
this.files.get(symbol.path).set(symbol.identifier, symbol);
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
getEquivalentSymbol(symbol) {
|
|
2507
|
+
let previousSymbol = this.getSymbolByDecl(symbol.decl);
|
|
2508
|
+
if (previousSymbol === null && symbol.identifier !== null) {
|
|
2509
|
+
previousSymbol = this.getSymbolByName(symbol.path, symbol.identifier);
|
|
2510
|
+
}
|
|
2511
|
+
return previousSymbol;
|
|
2512
|
+
}
|
|
2513
|
+
getSymbolByName(path, identifier) {
|
|
2514
|
+
if (!this.files.has(path)) {
|
|
2515
|
+
return null;
|
|
2516
|
+
}
|
|
2517
|
+
const file = this.files.get(path);
|
|
2518
|
+
if (!file.has(identifier)) {
|
|
2519
|
+
return null;
|
|
2526
2520
|
}
|
|
2527
|
-
return
|
|
2521
|
+
return file.get(identifier);
|
|
2528
2522
|
}
|
|
2529
|
-
|
|
2530
|
-
if (
|
|
2531
|
-
|
|
2523
|
+
getSymbolByDecl(decl) {
|
|
2524
|
+
if (!this.symbolByDecl.has(decl)) {
|
|
2525
|
+
return null;
|
|
2532
2526
|
}
|
|
2533
|
-
|
|
2534
|
-
|
|
2527
|
+
return this.symbolByDecl.get(decl);
|
|
2528
|
+
}
|
|
2529
|
+
};
|
|
2530
|
+
var SemanticDepGraphUpdater = class {
|
|
2531
|
+
constructor(priorGraph) {
|
|
2532
|
+
this.priorGraph = priorGraph;
|
|
2533
|
+
this.newGraph = new SemanticDepGraph();
|
|
2534
|
+
this.opaqueSymbols = /* @__PURE__ */ new Map();
|
|
2535
|
+
}
|
|
2536
|
+
registerSymbol(symbol) {
|
|
2537
|
+
this.newGraph.registerSymbol(symbol);
|
|
2538
|
+
}
|
|
2539
|
+
finalize() {
|
|
2540
|
+
if (this.priorGraph === null) {
|
|
2541
|
+
return {
|
|
2542
|
+
needsEmit: /* @__PURE__ */ new Set(),
|
|
2543
|
+
needsTypeCheckEmit: /* @__PURE__ */ new Set(),
|
|
2544
|
+
newGraph: this.newGraph
|
|
2545
|
+
};
|
|
2535
2546
|
}
|
|
2547
|
+
const needsEmit = this.determineInvalidatedFiles(this.priorGraph);
|
|
2548
|
+
const needsTypeCheckEmit = this.determineInvalidatedTypeCheckFiles(this.priorGraph);
|
|
2549
|
+
return {
|
|
2550
|
+
needsEmit,
|
|
2551
|
+
needsTypeCheckEmit,
|
|
2552
|
+
newGraph: this.newGraph
|
|
2553
|
+
};
|
|
2536
2554
|
}
|
|
2537
|
-
|
|
2538
|
-
const
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2555
|
+
determineInvalidatedFiles(priorGraph) {
|
|
2556
|
+
const isPublicApiAffected = /* @__PURE__ */ new Set();
|
|
2557
|
+
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
2558
|
+
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
2559
|
+
if (previousSymbol === null || symbol.isPublicApiAffected(previousSymbol)) {
|
|
2560
|
+
isPublicApiAffected.add(symbol);
|
|
2542
2561
|
}
|
|
2543
|
-
this.externalTemplateToComponentsMap.get(path).add(component);
|
|
2544
2562
|
}
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2563
|
+
const needsEmit = /* @__PURE__ */ new Set();
|
|
2564
|
+
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
2565
|
+
if (symbol.isEmitAffected === void 0) {
|
|
2566
|
+
continue;
|
|
2567
|
+
}
|
|
2568
|
+
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
2569
|
+
if (previousSymbol === null || symbol.isEmitAffected(previousSymbol, isPublicApiAffected)) {
|
|
2570
|
+
needsEmit.add(symbol.path);
|
|
2571
|
+
}
|
|
2550
2572
|
}
|
|
2551
|
-
return
|
|
2573
|
+
return needsEmit;
|
|
2552
2574
|
}
|
|
2553
|
-
|
|
2554
|
-
const
|
|
2555
|
-
|
|
2556
|
-
|
|
2575
|
+
determineInvalidatedTypeCheckFiles(priorGraph) {
|
|
2576
|
+
const isTypeCheckApiAffected = /* @__PURE__ */ new Set();
|
|
2577
|
+
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
2578
|
+
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
2579
|
+
if (previousSymbol === null || symbol.isTypeCheckApiAffected(previousSymbol)) {
|
|
2580
|
+
isTypeCheckApiAffected.add(symbol);
|
|
2581
|
+
}
|
|
2557
2582
|
}
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2583
|
+
const needsTypeCheckEmit = /* @__PURE__ */ new Set();
|
|
2584
|
+
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
2585
|
+
if (symbol.isTypeCheckBlockAffected === void 0) {
|
|
2586
|
+
continue;
|
|
2587
|
+
}
|
|
2588
|
+
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
2589
|
+
if (previousSymbol === null || symbol.isTypeCheckBlockAffected(previousSymbol, isTypeCheckApiAffected)) {
|
|
2590
|
+
needsTypeCheckEmit.add(symbol.path);
|
|
2561
2591
|
}
|
|
2562
|
-
this.externalStyleToComponentsMap.get(path).add(component);
|
|
2563
2592
|
}
|
|
2564
|
-
|
|
2593
|
+
return needsTypeCheckEmit;
|
|
2565
2594
|
}
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2595
|
+
getSemanticReference(decl, expr) {
|
|
2596
|
+
return {
|
|
2597
|
+
symbol: this.getSymbol(decl),
|
|
2598
|
+
importPath: getImportPath(expr)
|
|
2599
|
+
};
|
|
2600
|
+
}
|
|
2601
|
+
getSymbol(decl) {
|
|
2602
|
+
const symbol = this.newGraph.getSymbolByDecl(decl);
|
|
2603
|
+
if (symbol === null) {
|
|
2604
|
+
return this.getOpaqueSymbol(decl);
|
|
2569
2605
|
}
|
|
2570
|
-
return
|
|
2606
|
+
return symbol;
|
|
2571
2607
|
}
|
|
2572
|
-
|
|
2573
|
-
if (
|
|
2574
|
-
return
|
|
2608
|
+
getOpaqueSymbol(decl) {
|
|
2609
|
+
if (this.opaqueSymbols.has(decl)) {
|
|
2610
|
+
return this.opaqueSymbols.get(decl);
|
|
2575
2611
|
}
|
|
2576
|
-
|
|
2612
|
+
const symbol = new OpaqueSymbol(decl);
|
|
2613
|
+
this.opaqueSymbols.set(decl, symbol);
|
|
2614
|
+
return symbol;
|
|
2577
2615
|
}
|
|
2578
2616
|
};
|
|
2617
|
+
function getImportPath(expr) {
|
|
2618
|
+
if (expr instanceof ExternalExpr2) {
|
|
2619
|
+
return `${expr.value.moduleName}$${expr.value.name}`;
|
|
2620
|
+
} else {
|
|
2621
|
+
return null;
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2579
2624
|
|
|
2580
|
-
// bazel-out/
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2625
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
2626
|
+
import ts11 from "typescript";
|
|
2627
|
+
|
|
2628
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/util.mjs
|
|
2629
|
+
function isSymbolEqual(a, b) {
|
|
2630
|
+
if (a.decl === b.decl) {
|
|
2631
|
+
return true;
|
|
2586
2632
|
}
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
return this.cache.get(metadata.ref.node);
|
|
2590
|
-
}
|
|
2591
|
-
const results = metadata.hostDirectives && metadata.hostDirectives.length > 0 ? this.walkHostDirectives(metadata.hostDirectives, []) : EMPTY_ARRAY;
|
|
2592
|
-
this.cache.set(metadata.ref.node, results);
|
|
2593
|
-
return results;
|
|
2633
|
+
if (a.identifier === null || b.identifier === null) {
|
|
2634
|
+
return false;
|
|
2594
2635
|
}
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
}
|
|
2601
|
-
if (hostMeta.hostDirectives) {
|
|
2602
|
-
this.walkHostDirectives(hostMeta.hostDirectives, results);
|
|
2603
|
-
}
|
|
2604
|
-
results.push({
|
|
2605
|
-
...hostMeta,
|
|
2606
|
-
matchSource: MatchSource.HostDirective,
|
|
2607
|
-
inputs: this.filterMappings(hostMeta.inputs, current.inputs),
|
|
2608
|
-
outputs: this.filterMappings(hostMeta.outputs, current.outputs)
|
|
2609
|
-
});
|
|
2610
|
-
}
|
|
2611
|
-
return results;
|
|
2636
|
+
return a.path === b.path && a.identifier === b.identifier;
|
|
2637
|
+
}
|
|
2638
|
+
function isReferenceEqual(a, b) {
|
|
2639
|
+
if (!isSymbolEqual(a.symbol, b.symbol)) {
|
|
2640
|
+
return false;
|
|
2612
2641
|
}
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2642
|
+
return a.importPath === b.importPath;
|
|
2643
|
+
}
|
|
2644
|
+
function referenceEquality(a, b) {
|
|
2645
|
+
return a === b;
|
|
2646
|
+
}
|
|
2647
|
+
function isArrayEqual(a, b, equalityTester = referenceEquality) {
|
|
2648
|
+
if (a === null || b === null) {
|
|
2649
|
+
return a === b;
|
|
2650
|
+
}
|
|
2651
|
+
if (a.length !== b.length) {
|
|
2652
|
+
return false;
|
|
2653
|
+
}
|
|
2654
|
+
return !a.some((item, index) => !equalityTester(item, b[index]));
|
|
2655
|
+
}
|
|
2656
|
+
function isSetEqual(a, b, equalityTester = referenceEquality) {
|
|
2657
|
+
if (a === null || b === null) {
|
|
2658
|
+
return a === b;
|
|
2659
|
+
}
|
|
2660
|
+
if (a.size !== b.size) {
|
|
2661
|
+
return false;
|
|
2662
|
+
}
|
|
2663
|
+
for (const itemA of a) {
|
|
2664
|
+
let found = false;
|
|
2665
|
+
for (const itemB of b) {
|
|
2666
|
+
if (equalityTester(itemA, itemB)) {
|
|
2667
|
+
found = true;
|
|
2668
|
+
break;
|
|
2625
2669
|
}
|
|
2626
2670
|
}
|
|
2627
|
-
|
|
2671
|
+
if (!found) {
|
|
2672
|
+
return false;
|
|
2673
|
+
}
|
|
2628
2674
|
}
|
|
2629
|
-
|
|
2675
|
+
return true;
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2678
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
2679
|
+
function extractSemanticTypeParameters(node) {
|
|
2680
|
+
if (!ts11.isClassDeclaration(node) || node.typeParameters === void 0) {
|
|
2681
|
+
return null;
|
|
2682
|
+
}
|
|
2683
|
+
return node.typeParameters.map((typeParam) => ({ hasGenericTypeBound: typeParam.constraint !== void 0 }));
|
|
2684
|
+
}
|
|
2685
|
+
function areTypeParametersEqual(current, previous) {
|
|
2686
|
+
if (!isArrayEqual(current, previous, isTypeParameterEqual)) {
|
|
2687
|
+
return false;
|
|
2688
|
+
}
|
|
2689
|
+
if (current !== null && current.some((typeParam) => typeParam.hasGenericTypeBound)) {
|
|
2690
|
+
return false;
|
|
2691
|
+
}
|
|
2692
|
+
return true;
|
|
2693
|
+
}
|
|
2694
|
+
function isTypeParameterEqual(a, b) {
|
|
2695
|
+
return a.hasGenericTypeBound === b.hasGenericTypeBound;
|
|
2696
|
+
}
|
|
2630
2697
|
|
|
2631
|
-
// bazel-out/
|
|
2698
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/api.mjs
|
|
2632
2699
|
var ComponentScopeKind;
|
|
2633
2700
|
(function(ComponentScopeKind2) {
|
|
2634
2701
|
ComponentScopeKind2[ComponentScopeKind2["NgModule"] = 0] = "NgModule";
|
|
2635
2702
|
ComponentScopeKind2[ComponentScopeKind2["Standalone"] = 1] = "Standalone";
|
|
2636
2703
|
})(ComponentScopeKind || (ComponentScopeKind = {}));
|
|
2637
2704
|
|
|
2638
|
-
// bazel-out/
|
|
2705
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/component_scope.mjs
|
|
2639
2706
|
var CompoundComponentScopeReader = class {
|
|
2640
2707
|
constructor(readers) {
|
|
2641
2708
|
this.readers = readers;
|
|
@@ -2660,7 +2727,7 @@ var CompoundComponentScopeReader = class {
|
|
|
2660
2727
|
}
|
|
2661
2728
|
};
|
|
2662
2729
|
|
|
2663
|
-
// bazel-out/
|
|
2730
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/dependency.mjs
|
|
2664
2731
|
var MetadataDtsModuleScopeResolver = class {
|
|
2665
2732
|
constructor(dtsMetaReader, aliasingHost) {
|
|
2666
2733
|
this.dtsMetaReader = dtsMetaReader;
|
|
@@ -2736,11 +2803,11 @@ var MetadataDtsModuleScopeResolver = class {
|
|
|
2736
2803
|
}
|
|
2737
2804
|
};
|
|
2738
2805
|
|
|
2739
|
-
// bazel-out/
|
|
2806
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/local.mjs
|
|
2740
2807
|
import { ExternalExpr as ExternalExpr3 } from "@angular/compiler";
|
|
2741
2808
|
import ts12 from "typescript";
|
|
2742
2809
|
|
|
2743
|
-
// bazel-out/
|
|
2810
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/util.mjs
|
|
2744
2811
|
function getDiagnosticNode(ref, rawExpr) {
|
|
2745
2812
|
return rawExpr !== null ? ref.getOriginForDiagnostics(rawExpr) : ref.node.name;
|
|
2746
2813
|
}
|
|
@@ -2763,7 +2830,7 @@ function makeUnknownComponentImportDiagnostic(ref, rawExpr) {
|
|
|
2763
2830
|
return makeDiagnostic(ErrorCode.COMPONENT_UNKNOWN_IMPORT, getDiagnosticNode(ref, rawExpr), `Component imports must be standalone components, directives, pipes, or must be NgModules.`);
|
|
2764
2831
|
}
|
|
2765
2832
|
|
|
2766
|
-
// bazel-out/
|
|
2833
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/local.mjs
|
|
2767
2834
|
var LocalModuleScopeRegistry = class {
|
|
2768
2835
|
constructor(localReader, fullReader, dependencyScopeReader, refEmitter, aliasingHost) {
|
|
2769
2836
|
this.localReader = localReader;
|
|
@@ -3102,7 +3169,7 @@ function reexportCollision(module, refA, refB) {
|
|
|
3102
3169
|
]);
|
|
3103
3170
|
}
|
|
3104
3171
|
|
|
3105
|
-
// bazel-out/
|
|
3172
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/typecheck.mjs
|
|
3106
3173
|
import { CssSelector, SelectorMatcher } from "@angular/compiler";
|
|
3107
3174
|
import ts13 from "typescript";
|
|
3108
3175
|
var TypeCheckScopeRegistry = class {
|
|
@@ -3165,7 +3232,7 @@ var TypeCheckScopeRegistry = class {
|
|
|
3165
3232
|
}
|
|
3166
3233
|
};
|
|
3167
3234
|
|
|
3168
|
-
// bazel-out/
|
|
3235
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/api.mjs
|
|
3169
3236
|
var CompilationMode;
|
|
3170
3237
|
(function(CompilationMode2) {
|
|
3171
3238
|
CompilationMode2[CompilationMode2["FULL"] = 0] = "FULL";
|
|
@@ -3183,7 +3250,7 @@ var HandlerFlags;
|
|
|
3183
3250
|
HandlerFlags2[HandlerFlags2["FULL_INHERITANCE"] = 1] = "FULL_INHERITANCE";
|
|
3184
3251
|
})(HandlerFlags || (HandlerFlags = {}));
|
|
3185
3252
|
|
|
3186
|
-
// bazel-out/
|
|
3253
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/alias.mjs
|
|
3187
3254
|
import ts14 from "typescript";
|
|
3188
3255
|
function aliasTransformFactory(exportStatements) {
|
|
3189
3256
|
return (context) => {
|
|
@@ -3201,10 +3268,10 @@ function aliasTransformFactory(exportStatements) {
|
|
|
3201
3268
|
};
|
|
3202
3269
|
}
|
|
3203
3270
|
|
|
3204
|
-
// bazel-out/
|
|
3271
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
3205
3272
|
import ts15 from "typescript";
|
|
3206
3273
|
|
|
3207
|
-
// bazel-out/
|
|
3274
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/trait.mjs
|
|
3208
3275
|
var TraitState;
|
|
3209
3276
|
(function(TraitState2) {
|
|
3210
3277
|
TraitState2[TraitState2["Pending"] = 0] = "Pending";
|
|
@@ -3259,7 +3326,7 @@ var TraitImpl = class {
|
|
|
3259
3326
|
}
|
|
3260
3327
|
};
|
|
3261
3328
|
|
|
3262
|
-
// bazel-out/
|
|
3329
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
3263
3330
|
var TraitCompiler = class {
|
|
3264
3331
|
constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater, sourceFileTypeIdentifier) {
|
|
3265
3332
|
this.handlers = handlers;
|
|
@@ -3703,10 +3770,10 @@ function containsErrors(diagnostics) {
|
|
|
3703
3770
|
return diagnostics !== null && diagnostics.some((diag) => diag.category === ts15.DiagnosticCategory.Error);
|
|
3704
3771
|
}
|
|
3705
3772
|
|
|
3706
|
-
// bazel-out/
|
|
3773
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
3707
3774
|
import ts17 from "typescript";
|
|
3708
3775
|
|
|
3709
|
-
// bazel-out/
|
|
3776
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/utils.mjs
|
|
3710
3777
|
import ts16 from "typescript";
|
|
3711
3778
|
function addImports(importManager, sf, extraStatements = []) {
|
|
3712
3779
|
const addedImports = importManager.getAllImports(sf.fileName).map((i) => {
|
|
@@ -3734,7 +3801,7 @@ function isImportStatement(stmt) {
|
|
|
3734
3801
|
return ts16.isImportDeclaration(stmt) || ts16.isImportEqualsDeclaration(stmt) || ts16.isNamespaceImport(stmt);
|
|
3735
3802
|
}
|
|
3736
3803
|
|
|
3737
|
-
// bazel-out/
|
|
3804
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
3738
3805
|
var DtsTransformRegistry = class {
|
|
3739
3806
|
constructor() {
|
|
3740
3807
|
this.ivyDeclarationTransforms = /* @__PURE__ */ new Map();
|
|
@@ -3859,11 +3926,11 @@ function markForEmitAsSingleLine(node) {
|
|
|
3859
3926
|
ts17.forEachChild(node, markForEmitAsSingleLine);
|
|
3860
3927
|
}
|
|
3861
3928
|
|
|
3862
|
-
// bazel-out/
|
|
3929
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
3863
3930
|
import { ConstantPool } from "@angular/compiler";
|
|
3864
3931
|
import ts19 from "typescript";
|
|
3865
3932
|
|
|
3866
|
-
// bazel-out/
|
|
3933
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
|
|
3867
3934
|
import ts18 from "typescript";
|
|
3868
3935
|
function visit(node, visitor, context) {
|
|
3869
3936
|
return visitor._visit(node, context);
|
|
@@ -3924,7 +3991,7 @@ var Visitor = class {
|
|
|
3924
3991
|
}
|
|
3925
3992
|
};
|
|
3926
3993
|
|
|
3927
|
-
// bazel-out/
|
|
3994
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
3928
3995
|
var NO_DECORATORS = /* @__PURE__ */ new Set();
|
|
3929
3996
|
var CLOSURE_FILE_OVERVIEW_REGEXP = /\s+@fileoverview\s+/i;
|
|
3930
3997
|
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, perf, isCore, isClosureCompilerEnabled) {
|
|
@@ -4112,10 +4179,10 @@ function nodeArrayFromDecoratorsArray(decorators) {
|
|
|
4112
4179
|
return array;
|
|
4113
4180
|
}
|
|
4114
4181
|
|
|
4115
|
-
// bazel-out/
|
|
4182
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/handler.mjs
|
|
4116
4183
|
import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, FactoryTarget, makeBindingParser, WrappedNodeExpr as WrappedNodeExpr5 } from "@angular/compiler";
|
|
4117
4184
|
|
|
4118
|
-
// bazel-out/
|
|
4185
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.mjs
|
|
4119
4186
|
import { createMayBeForwardRefExpression, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr4, getSafePropertyAccessString, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
|
|
4120
4187
|
import ts20 from "typescript";
|
|
4121
4188
|
var EMPTY_OBJECT = {};
|
|
@@ -4528,7 +4595,7 @@ function toHostDirectiveMetadata(hostDirective, context, refEmitter) {
|
|
|
4528
4595
|
};
|
|
4529
4596
|
}
|
|
4530
4597
|
|
|
4531
|
-
// bazel-out/
|
|
4598
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/symbol.mjs
|
|
4532
4599
|
var DirectiveSymbol = class extends SemanticSymbol {
|
|
4533
4600
|
constructor(decl, selector, inputs, outputs, exportAs, typeCheckMeta, typeParameters) {
|
|
4534
4601
|
super(decl);
|
|
@@ -4605,7 +4672,7 @@ function isBaseClassEqual(current, previous) {
|
|
|
4605
4672
|
return isSymbolEqual(current, previous);
|
|
4606
4673
|
}
|
|
4607
4674
|
|
|
4608
|
-
// bazel-out/
|
|
4675
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/handler.mjs
|
|
4609
4676
|
var FIELD_DECORATORS = [
|
|
4610
4677
|
"Input",
|
|
4611
4678
|
"Output",
|
|
@@ -4627,7 +4694,7 @@ var LIFECYCLE_HOOKS = /* @__PURE__ */ new Set([
|
|
|
4627
4694
|
"ngAfterContentChecked"
|
|
4628
4695
|
]);
|
|
4629
4696
|
var DirectiveDecoratorHandler = class {
|
|
4630
|
-
constructor(reflector, evaluator, metaRegistry, scopeRegistry, metaReader, injectableRegistry, refEmitter, isCore, semanticDepGraphUpdater, annotateForClosureCompiler, compileUndecoratedClassesWithAngularFeatures, perf) {
|
|
4697
|
+
constructor(reflector, evaluator, metaRegistry, scopeRegistry, metaReader, injectableRegistry, refEmitter, isCore, strictCtorDeps, semanticDepGraphUpdater, annotateForClosureCompiler, compileUndecoratedClassesWithAngularFeatures, perf) {
|
|
4631
4698
|
this.reflector = reflector;
|
|
4632
4699
|
this.evaluator = evaluator;
|
|
4633
4700
|
this.metaRegistry = metaRegistry;
|
|
@@ -4636,6 +4703,7 @@ var DirectiveDecoratorHandler = class {
|
|
|
4636
4703
|
this.injectableRegistry = injectableRegistry;
|
|
4637
4704
|
this.refEmitter = refEmitter;
|
|
4638
4705
|
this.isCore = isCore;
|
|
4706
|
+
this.strictCtorDeps = strictCtorDeps;
|
|
4639
4707
|
this.semanticDepGraphUpdater = semanticDepGraphUpdater;
|
|
4640
4708
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
4641
4709
|
this.compileUndecoratedClassesWithAngularFeatures = compileUndecoratedClassesWithAngularFeatures;
|
|
@@ -4715,7 +4783,9 @@ var DirectiveDecoratorHandler = class {
|
|
|
4715
4783
|
schemas: null,
|
|
4716
4784
|
decorator: analysis.decorator
|
|
4717
4785
|
});
|
|
4718
|
-
this.injectableRegistry.registerInjectable(node
|
|
4786
|
+
this.injectableRegistry.registerInjectable(node, {
|
|
4787
|
+
ctorDeps: analysis.meta.deps
|
|
4788
|
+
});
|
|
4719
4789
|
}
|
|
4720
4790
|
resolve(node, analysis, symbol) {
|
|
4721
4791
|
if (this.semanticDepGraphUpdater !== null && analysis.baseClass instanceof Reference) {
|
|
@@ -4726,7 +4796,7 @@ var DirectiveDecoratorHandler = class {
|
|
|
4726
4796
|
const providerDiagnostics = getProviderDiagnostics(analysis.providersRequiringFactory, analysis.meta.providers.node, this.injectableRegistry);
|
|
4727
4797
|
diagnostics.push(...providerDiagnostics);
|
|
4728
4798
|
}
|
|
4729
|
-
const directiveDiagnostics = getDirectiveDiagnostics(node, this.
|
|
4799
|
+
const directiveDiagnostics = getDirectiveDiagnostics(node, this.injectableRegistry, this.evaluator, this.reflector, this.scopeRegistry, this.strictCtorDeps, "Directive");
|
|
4730
4800
|
if (directiveDiagnostics !== null) {
|
|
4731
4801
|
diagnostics.push(...directiveDiagnostics);
|
|
4732
4802
|
}
|
|
@@ -4761,11 +4831,11 @@ var DirectiveDecoratorHandler = class {
|
|
|
4761
4831
|
}
|
|
4762
4832
|
};
|
|
4763
4833
|
|
|
4764
|
-
// bazel-out/
|
|
4834
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.mjs
|
|
4765
4835
|
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, ExternalExpr as ExternalExpr5, FactoryTarget as FactoryTarget2, FunctionExpr as FunctionExpr2, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2, R3Identifiers, R3SelectorScopeMode, ReturnStatement as ReturnStatement2, WrappedNodeExpr as WrappedNodeExpr6 } from "@angular/compiler";
|
|
4766
4836
|
import ts22 from "typescript";
|
|
4767
4837
|
|
|
4768
|
-
// bazel-out/
|
|
4838
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/module_with_providers.mjs
|
|
4769
4839
|
import ts21 from "typescript";
|
|
4770
4840
|
function createModuleWithProvidersResolver(reflector, isCore) {
|
|
4771
4841
|
function _reflectModuleFromTypeParam(type, node) {
|
|
@@ -4832,7 +4902,7 @@ function isResolvedModuleWithProviders(sv) {
|
|
|
4832
4902
|
return typeof sv.value === "object" && sv.value != null && sv.value.hasOwnProperty("ngModule") && sv.value.hasOwnProperty("mwpCall");
|
|
4833
4903
|
}
|
|
4834
4904
|
|
|
4835
|
-
// bazel-out/
|
|
4905
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.mjs
|
|
4836
4906
|
var NgModuleSymbol = class extends SemanticSymbol {
|
|
4837
4907
|
constructor() {
|
|
4838
4908
|
super(...arguments);
|
|
@@ -5116,7 +5186,9 @@ var NgModuleDecoratorHandler = class {
|
|
|
5116
5186
|
name: analysis.factorySymbolName
|
|
5117
5187
|
});
|
|
5118
5188
|
}
|
|
5119
|
-
this.injectableRegistry.registerInjectable(node
|
|
5189
|
+
this.injectableRegistry.registerInjectable(node, {
|
|
5190
|
+
ctorDeps: analysis.fac.deps
|
|
5191
|
+
});
|
|
5120
5192
|
}
|
|
5121
5193
|
resolve(node, analysis) {
|
|
5122
5194
|
const scope = this.scopeRegistry.getScopeOfModule(node);
|
|
@@ -5334,7 +5406,7 @@ function isSyntheticReference(ref) {
|
|
|
5334
5406
|
return ref.synthetic;
|
|
5335
5407
|
}
|
|
5336
5408
|
|
|
5337
|
-
// bazel-out/
|
|
5409
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/diagnostics.mjs
|
|
5338
5410
|
function makeCyclicImportInfo(ref, type, cycle) {
|
|
5339
5411
|
const name = ref.debugName || "(unknown)";
|
|
5340
5412
|
const path = cycle.getPath().map((sf) => sf.fileName).join(" -> ");
|
|
@@ -5357,7 +5429,7 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
5357
5429
|
return null;
|
|
5358
5430
|
}
|
|
5359
5431
|
|
|
5360
|
-
// bazel-out/
|
|
5432
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/resources.mjs
|
|
5361
5433
|
import { DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, ParseSourceFile as ParseSourceFile2, parseTemplate } from "@angular/compiler";
|
|
5362
5434
|
import ts23 from "typescript";
|
|
5363
5435
|
function getTemplateDeclarationNodeForError(declaration) {
|
|
@@ -5663,7 +5735,7 @@ function _extractTemplateStyleUrls(template) {
|
|
|
5663
5735
|
return template.styleUrls.map((url) => ({ url, source: 1, nodeForError }));
|
|
5664
5736
|
}
|
|
5665
5737
|
|
|
5666
|
-
// bazel-out/
|
|
5738
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/symbol.mjs
|
|
5667
5739
|
var ComponentSymbol = class extends DirectiveSymbol {
|
|
5668
5740
|
constructor() {
|
|
5669
5741
|
super(...arguments);
|
|
@@ -5698,7 +5770,7 @@ var ComponentSymbol = class extends DirectiveSymbol {
|
|
|
5698
5770
|
}
|
|
5699
5771
|
};
|
|
5700
5772
|
|
|
5701
|
-
// bazel-out/
|
|
5773
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/util.mjs
|
|
5702
5774
|
function collectAnimationNames(value, animationTriggerNames) {
|
|
5703
5775
|
if (value instanceof Map) {
|
|
5704
5776
|
const name = value.get("name");
|
|
@@ -5734,7 +5806,7 @@ var animationTriggerResolver = (fn, node, resolve, unresolvable) => {
|
|
|
5734
5806
|
function validateAndFlattenComponentImports(imports, expr) {
|
|
5735
5807
|
const flattened = [];
|
|
5736
5808
|
if (!Array.isArray(imports)) {
|
|
5737
|
-
const error = createValueHasWrongTypeError(expr, imports, `'imports' must be an array of components, directives, pipes, or NgModules
|
|
5809
|
+
const error = createValueHasWrongTypeError(expr, imports, `'imports' must be an array of components, directives, pipes, or NgModules.`).toDiagnostic();
|
|
5738
5810
|
return {
|
|
5739
5811
|
imports: [],
|
|
5740
5812
|
diagnostics: [error]
|
|
@@ -5750,7 +5822,7 @@ function validateAndFlattenComponentImports(imports, expr) {
|
|
|
5750
5822
|
if (isNamedClassDeclaration(ref.node)) {
|
|
5751
5823
|
flattened.push(ref);
|
|
5752
5824
|
} else {
|
|
5753
|
-
diagnostics.push(createValueHasWrongTypeError(ref.getOriginForDiagnostics(expr), ref, `'imports' must be an array of components, directives, pipes, or NgModules
|
|
5825
|
+
diagnostics.push(createValueHasWrongTypeError(ref.getOriginForDiagnostics(expr), ref, `'imports' must be an array of components, directives, pipes, or NgModules.`).toDiagnostic());
|
|
5754
5826
|
}
|
|
5755
5827
|
} else if (isLikelyModuleWithProviders(ref)) {
|
|
5756
5828
|
let origin = expr;
|
|
@@ -5759,7 +5831,7 @@ function validateAndFlattenComponentImports(imports, expr) {
|
|
|
5759
5831
|
}
|
|
5760
5832
|
diagnostics.push(makeDiagnostic(ErrorCode.COMPONENT_UNKNOWN_IMPORT, origin, `'imports' contains a ModuleWithProviders value, likely the result of a 'Module.forRoot()'-style call. These calls are not used to configure components and are not valid in standalone component imports - consider importing them in the application bootstrap instead.`));
|
|
5761
5833
|
} else {
|
|
5762
|
-
diagnostics.push(createValueHasWrongTypeError(expr, imports, `'imports' must be an array of components, directives, pipes, or NgModules
|
|
5834
|
+
diagnostics.push(createValueHasWrongTypeError(expr, imports, `'imports' must be an array of components, directives, pipes, or NgModules.`).toDiagnostic());
|
|
5763
5835
|
}
|
|
5764
5836
|
}
|
|
5765
5837
|
return { imports: flattened, diagnostics };
|
|
@@ -5774,10 +5846,10 @@ function isLikelyModuleWithProviders(value) {
|
|
|
5774
5846
|
return false;
|
|
5775
5847
|
}
|
|
5776
5848
|
|
|
5777
|
-
// bazel-out/
|
|
5849
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
|
|
5778
5850
|
var EMPTY_ARRAY2 = [];
|
|
5779
5851
|
var ComponentDecoratorHandler = class {
|
|
5780
|
-
constructor(reflector, evaluator, metaRegistry, metaReader, scopeReader, dtsScopeReader, scopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, resourceLoader, rootDirs, defaultPreserveWhitespaces, i18nUseExternalIds, enableI18nLegacyMessageIdFormat, usePoisonedData, i18nNormalizeLineEndingsInICUs, moduleResolver, cycleAnalyzer, cycleHandlingStrategy, refEmitter, depTracker, injectableRegistry, semanticDepGraphUpdater, annotateForClosureCompiler, perf, hostDirectivesResolver) {
|
|
5852
|
+
constructor(reflector, evaluator, metaRegistry, metaReader, scopeReader, dtsScopeReader, scopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, resourceLoader, rootDirs, defaultPreserveWhitespaces, i18nUseExternalIds, enableI18nLegacyMessageIdFormat, usePoisonedData, i18nNormalizeLineEndingsInICUs, moduleResolver, cycleAnalyzer, cycleHandlingStrategy, refEmitter, depTracker, injectableRegistry, semanticDepGraphUpdater, annotateForClosureCompiler, perf, hostDirectivesResolver) {
|
|
5781
5853
|
this.reflector = reflector;
|
|
5782
5854
|
this.evaluator = evaluator;
|
|
5783
5855
|
this.metaRegistry = metaRegistry;
|
|
@@ -5788,6 +5860,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5788
5860
|
this.typeCheckScopeRegistry = typeCheckScopeRegistry;
|
|
5789
5861
|
this.resourceRegistry = resourceRegistry;
|
|
5790
5862
|
this.isCore = isCore;
|
|
5863
|
+
this.strictCtorDeps = strictCtorDeps;
|
|
5791
5864
|
this.resourceLoader = resourceLoader;
|
|
5792
5865
|
this.rootDirs = rootDirs;
|
|
5793
5866
|
this.defaultPreserveWhitespaces = defaultPreserveWhitespaces;
|
|
@@ -6097,7 +6170,9 @@ var ComponentDecoratorHandler = class {
|
|
|
6097
6170
|
decorator: analysis.decorator
|
|
6098
6171
|
});
|
|
6099
6172
|
this.resourceRegistry.registerResources(analysis.resources, node);
|
|
6100
|
-
this.injectableRegistry.registerInjectable(node
|
|
6173
|
+
this.injectableRegistry.registerInjectable(node, {
|
|
6174
|
+
ctorDeps: analysis.meta.deps
|
|
6175
|
+
});
|
|
6101
6176
|
}
|
|
6102
6177
|
index(context, node, analysis) {
|
|
6103
6178
|
if (analysis.isPoisoned && !this.usePoisonedData) {
|
|
@@ -6304,7 +6379,7 @@ var ComponentDecoratorHandler = class {
|
|
|
6304
6379
|
const viewProviderDiagnostics = getProviderDiagnostics(analysis.viewProvidersRequiringFactory, analysis.meta.viewProviders.node, this.injectableRegistry);
|
|
6305
6380
|
diagnostics.push(...viewProviderDiagnostics);
|
|
6306
6381
|
}
|
|
6307
|
-
const directiveDiagnostics = getDirectiveDiagnostics(node, this.
|
|
6382
|
+
const directiveDiagnostics = getDirectiveDiagnostics(node, this.injectableRegistry, this.evaluator, this.reflector, this.scopeRegistry, this.strictCtorDeps, "Component");
|
|
6308
6383
|
if (directiveDiagnostics !== null) {
|
|
6309
6384
|
diagnostics.push(...directiveDiagnostics);
|
|
6310
6385
|
}
|
|
@@ -6415,12 +6490,13 @@ function validateStandaloneImports(importRefs, importExpr, metaReader, scopeRead
|
|
|
6415
6490
|
return diagnostics;
|
|
6416
6491
|
}
|
|
6417
6492
|
|
|
6418
|
-
// bazel-out/
|
|
6493
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
6419
6494
|
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression2, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr8 } from "@angular/compiler";
|
|
6420
6495
|
import ts25 from "typescript";
|
|
6421
6496
|
var InjectableDecoratorHandler = class {
|
|
6422
|
-
constructor(reflector, isCore, strictCtorDeps, injectableRegistry, perf, errorOnDuplicateProv = true) {
|
|
6497
|
+
constructor(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, perf, errorOnDuplicateProv = true) {
|
|
6423
6498
|
this.reflector = reflector;
|
|
6499
|
+
this.evaluator = evaluator;
|
|
6424
6500
|
this.isCore = isCore;
|
|
6425
6501
|
this.strictCtorDeps = strictCtorDeps;
|
|
6426
6502
|
this.injectableRegistry = injectableRegistry;
|
|
@@ -6460,8 +6536,21 @@ var InjectableDecoratorHandler = class {
|
|
|
6460
6536
|
symbol() {
|
|
6461
6537
|
return null;
|
|
6462
6538
|
}
|
|
6463
|
-
register(node) {
|
|
6464
|
-
this.injectableRegistry.registerInjectable(node
|
|
6539
|
+
register(node, analysis) {
|
|
6540
|
+
this.injectableRegistry.registerInjectable(node, {
|
|
6541
|
+
ctorDeps: analysis.ctorDeps
|
|
6542
|
+
});
|
|
6543
|
+
}
|
|
6544
|
+
resolve(node, analysis, symbol) {
|
|
6545
|
+
if (requiresValidCtor(analysis.meta)) {
|
|
6546
|
+
const diagnostic = checkInheritanceOfInjectable(node, this.injectableRegistry, this.reflector, this.evaluator, this.strictCtorDeps, "Injectable");
|
|
6547
|
+
if (diagnostic !== null) {
|
|
6548
|
+
return {
|
|
6549
|
+
diagnostics: [diagnostic]
|
|
6550
|
+
};
|
|
6551
|
+
}
|
|
6552
|
+
}
|
|
6553
|
+
return {};
|
|
6465
6554
|
}
|
|
6466
6555
|
compileFull(node, analysis) {
|
|
6467
6556
|
return this.compile(compileNgFactoryDefField, (meta) => compileInjectable(meta, false), compileClassMetadata4, node, analysis);
|
|
@@ -6548,7 +6637,7 @@ function extractInjectableCtorDeps(clazz, meta, decorator, reflector, isCore, st
|
|
|
6548
6637
|
}
|
|
6549
6638
|
let ctorDeps = null;
|
|
6550
6639
|
if (decorator.args.length === 0) {
|
|
6551
|
-
if (strictCtorDeps) {
|
|
6640
|
+
if (strictCtorDeps && !isAbstractClassDeclaration(clazz)) {
|
|
6552
6641
|
ctorDeps = getValidConstructorDependencies(clazz, reflector, isCore);
|
|
6553
6642
|
} else {
|
|
6554
6643
|
ctorDeps = unwrapConstructorDependencies(getConstructorDependencies(clazz, reflector, isCore));
|
|
@@ -6556,7 +6645,7 @@ function extractInjectableCtorDeps(clazz, meta, decorator, reflector, isCore, st
|
|
|
6556
6645
|
return ctorDeps;
|
|
6557
6646
|
} else if (decorator.args.length === 1) {
|
|
6558
6647
|
const rawCtorDeps = getConstructorDependencies(clazz, reflector, isCore);
|
|
6559
|
-
if (strictCtorDeps &&
|
|
6648
|
+
if (strictCtorDeps && !isAbstractClassDeclaration(clazz) && requiresValidCtor(meta)) {
|
|
6560
6649
|
ctorDeps = validateConstructorDependencies(clazz, rawCtorDeps);
|
|
6561
6650
|
} else {
|
|
6562
6651
|
ctorDeps = unwrapConstructorDependencies(rawCtorDeps);
|
|
@@ -6564,6 +6653,9 @@ function extractInjectableCtorDeps(clazz, meta, decorator, reflector, isCore, st
|
|
|
6564
6653
|
}
|
|
6565
6654
|
return ctorDeps;
|
|
6566
6655
|
}
|
|
6656
|
+
function requiresValidCtor(meta) {
|
|
6657
|
+
return meta.useValue === void 0 && meta.useExisting === void 0 && meta.useClass === void 0 && meta.useFactory === void 0;
|
|
6658
|
+
}
|
|
6567
6659
|
function getDep(dep, reflector) {
|
|
6568
6660
|
const meta = {
|
|
6569
6661
|
token: new WrappedNodeExpr8(dep),
|
|
@@ -6615,7 +6707,7 @@ function getDep(dep, reflector) {
|
|
|
6615
6707
|
return meta;
|
|
6616
6708
|
}
|
|
6617
6709
|
|
|
6618
|
-
// bazel-out/
|
|
6710
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
|
|
6619
6711
|
import { compileClassMetadata as compileClassMetadata5, compileDeclareClassMetadata as compileDeclareClassMetadata5, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5, WrappedNodeExpr as WrappedNodeExpr9 } from "@angular/compiler";
|
|
6620
6712
|
import ts26 from "typescript";
|
|
6621
6713
|
var PipeSymbol = class extends SemanticSymbol {
|
|
@@ -6734,7 +6826,9 @@ var PipeDecoratorHandler = class {
|
|
|
6734
6826
|
isStandalone: analysis.meta.isStandalone,
|
|
6735
6827
|
decorator: analysis.decorator
|
|
6736
6828
|
});
|
|
6737
|
-
this.injectableRegistry.registerInjectable(node
|
|
6829
|
+
this.injectableRegistry.registerInjectable(node, {
|
|
6830
|
+
ctorDeps: analysis.meta.deps
|
|
6831
|
+
});
|
|
6738
6832
|
}
|
|
6739
6833
|
resolve(node) {
|
|
6740
6834
|
const duplicateDeclData = this.scopeRegistry.getDuplicateDeclarations(node);
|
|
@@ -6762,19 +6856,19 @@ var PipeDecoratorHandler = class {
|
|
|
6762
6856
|
export {
|
|
6763
6857
|
forwardRefResolver,
|
|
6764
6858
|
readBaseClass,
|
|
6765
|
-
DynamicValue,
|
|
6766
|
-
StaticInterpreter,
|
|
6767
|
-
PartialEvaluator,
|
|
6768
|
-
NoopReferencesRegistry,
|
|
6769
|
-
SemanticDepGraphUpdater,
|
|
6770
6859
|
MetaKind,
|
|
6771
6860
|
CompoundMetadataReader,
|
|
6772
6861
|
DtsMetadataReader,
|
|
6773
6862
|
LocalMetadataRegistry,
|
|
6774
6863
|
CompoundMetadataRegistry,
|
|
6775
|
-
InjectableClassRegistry,
|
|
6776
6864
|
ResourceRegistry,
|
|
6777
6865
|
HostDirectivesResolver,
|
|
6866
|
+
DynamicValue,
|
|
6867
|
+
StaticInterpreter,
|
|
6868
|
+
PartialEvaluator,
|
|
6869
|
+
InjectableClassRegistry,
|
|
6870
|
+
NoopReferencesRegistry,
|
|
6871
|
+
SemanticDepGraphUpdater,
|
|
6778
6872
|
ComponentScopeKind,
|
|
6779
6873
|
CompoundComponentScopeReader,
|
|
6780
6874
|
MetadataDtsModuleScopeResolver,
|
|
@@ -6808,4 +6902,4 @@ export {
|
|
|
6808
6902
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6809
6903
|
* found in the LICENSE file at https://angular.io/license
|
|
6810
6904
|
*/
|
|
6811
|
-
//# sourceMappingURL=chunk-
|
|
6905
|
+
//# sourceMappingURL=chunk-KIQI22GZ.js.map
|