@angular/compiler-cli 15.0.0-next.4 → 15.0.0-next.6
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-RCXOJZDO.js → chunk-2HPI44CB.js} +5 -5
- package/bundles/{chunk-RCXOJZDO.js.map → chunk-2HPI44CB.js.map} +0 -0
- package/bundles/{chunk-TC3DKEFP.js → chunk-2LFNJ4YC.js} +196 -140
- package/bundles/chunk-2LFNJ4YC.js.map +6 -0
- package/bundles/{chunk-56O2PTWU.js → chunk-CYVTLM4Z.js} +7 -7
- package/bundles/{chunk-56O2PTWU.js.map → chunk-CYVTLM4Z.js.map} +0 -0
- package/bundles/{chunk-5FZBUSFV.js → chunk-E7NQQTT7.js} +3 -3
- package/bundles/{chunk-5FZBUSFV.js.map → chunk-E7NQQTT7.js.map} +0 -0
- package/bundles/{chunk-FPKAMI6D.js → chunk-EQ7NIVSK.js} +27 -26
- package/bundles/chunk-EQ7NIVSK.js.map +6 -0
- package/bundles/{chunk-DM4TYSFG.js → chunk-F526PAOI.js} +2 -5
- package/bundles/chunk-F526PAOI.js.map +6 -0
- package/bundles/{chunk-ICPLY7FO.js → chunk-FM6NPN5V.js} +4 -4
- package/bundles/{chunk-ICPLY7FO.js.map → chunk-FM6NPN5V.js.map} +0 -0
- package/bundles/{chunk-JN4TT3OU.js → chunk-GQT3DC2W.js} +7 -7
- package/bundles/{chunk-JN4TT3OU.js.map → chunk-GQT3DC2W.js.map} +0 -0
- package/bundles/{chunk-ERNK3SQG.js → chunk-JH56H6IJ.js} +31 -31
- package/bundles/{chunk-ERNK3SQG.js.map → chunk-JH56H6IJ.js.map} +0 -0
- package/bundles/{chunk-V7FBNIO3.js → chunk-MYEONJ6Z.js} +40 -40
- package/bundles/{chunk-V7FBNIO3.js.map → chunk-MYEONJ6Z.js.map} +0 -0
- package/bundles/{chunk-JTAGML7U.js → chunk-OZI3NCRJ.js} +75 -75
- package/bundles/{chunk-JTAGML7U.js.map → chunk-OZI3NCRJ.js.map} +1 -1
- package/bundles/{chunk-HMWNYAAE.js → chunk-R3C7RFJ4.js} +2 -2
- package/bundles/{chunk-HMWNYAAE.js.map → chunk-R3C7RFJ4.js.map} +0 -0
- package/bundles/{chunk-A5S5H2MN.js → chunk-R4GD76QD.js} +855 -783
- package/bundles/chunk-R4GD76QD.js.map +6 -0
- package/bundles/{chunk-4NRCP3Y6.js → chunk-TOKOIIBI.js} +7 -7
- package/bundles/{chunk-4NRCP3Y6.js.map → chunk-TOKOIIBI.js.map} +0 -0
- package/bundles/{chunk-C7SYDZNO.js → chunk-XOVG7LXX.js} +5 -5
- package/bundles/{chunk-C7SYDZNO.js.map → chunk-XOVG7LXX.js.map} +0 -0
- package/bundles/{chunk-MOE5WKIA.js → chunk-ZXBCBXWY.js} +7 -7
- package/bundles/{chunk-MOE5WKIA.js.map → chunk-ZXBCBXWY.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/core/src/host.d.ts +1 -0
- package/src/ngtsc/diagnostics/src/error_code.d.ts +5 -0
- package/src/ngtsc/metadata/index.d.ts +2 -2
- package/src/ngtsc/metadata/src/api.d.ts +6 -0
- package/src/ngtsc/metadata/src/registry.d.ts +4 -14
- package/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts +1 -0
- package/src/ngtsc/ts_compatibility/src/ts_cross_version_utils.d.ts +0 -9
- package/src/ngtsc/typecheck/api/checker.d.ts +11 -6
- package/src/ngtsc/typecheck/api/scope.d.ts +30 -4
- package/src/ngtsc/typecheck/api/symbols.d.ts +2 -2
- package/src/ngtsc/typecheck/src/checker.d.ts +9 -6
- package/bundles/chunk-A5S5H2MN.js.map +0 -6
- package/bundles/chunk-DM4TYSFG.js.map +0 -6
- package/bundles/chunk-FPKAMI6D.js.map +0 -6
- package/bundles/chunk-TC3DKEFP.js.map +0 -6
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
reflectObjectLiteral,
|
|
14
14
|
reflectTypeEntityToDeclaration,
|
|
15
15
|
typeNodeToValueExpr
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZXBCBXWY.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-EQ7NIVSK.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-F526PAOI.js";
|
|
50
50
|
import {
|
|
51
51
|
absoluteFrom,
|
|
52
52
|
absoluteFromSourceFile,
|
|
53
53
|
relative
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-TOKOIIBI.js";
|
|
55
55
|
import {
|
|
56
56
|
PerfEvent,
|
|
57
57
|
PerfPhase
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-2HPI44CB.js";
|
|
59
59
|
|
|
60
|
-
// bazel-out/
|
|
60
|
+
// bazel-out/k8-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/k8-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/k8-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/k8-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/k8-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/k8-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/k8-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/k8-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/k8-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/k8-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/k8-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/k8-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,7 +1454,7 @@ function createUnsuitableInjectionTokenError(clazz, error) {
|
|
|
1451
1454
|
return new FatalDiagnosticError(ErrorCode.PARAM_MISSING_TOKEN, param.nameNode, chain, hints);
|
|
1452
1455
|
}
|
|
1453
1456
|
|
|
1454
|
-
// bazel-out/
|
|
1457
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/diagnostics.mjs
|
|
1455
1458
|
import ts5 from "typescript";
|
|
1456
1459
|
function makeDuplicateDeclarationError(node, data, kind) {
|
|
1457
1460
|
const context = [];
|
|
@@ -1494,7 +1497,8 @@ function createValueHasWrongTypeError(node, value, messageText) {
|
|
|
1494
1497
|
function getProviderDiagnostics(providerClasses, providersDeclaration, registry) {
|
|
1495
1498
|
const diagnostics = [];
|
|
1496
1499
|
for (const provider of providerClasses) {
|
|
1497
|
-
|
|
1500
|
+
const injectableMeta = registry.getInjectableMeta(provider.node);
|
|
1501
|
+
if (injectableMeta !== null) {
|
|
1498
1502
|
continue;
|
|
1499
1503
|
}
|
|
1500
1504
|
const contextNode = provider.getOriginForDiagnostics(providersDeclaration);
|
|
@@ -1505,7 +1509,7 @@ Either add the @Injectable() decorator to '${provider.node.name.text}', or confi
|
|
|
1505
1509
|
}
|
|
1506
1510
|
return diagnostics;
|
|
1507
1511
|
}
|
|
1508
|
-
function getDirectiveDiagnostics(node,
|
|
1512
|
+
function getDirectiveDiagnostics(node, injectableRegistry, evaluator, reflector, scopeRegistry, strictInjectionParameters, kind) {
|
|
1509
1513
|
let diagnostics = [];
|
|
1510
1514
|
const addDiagnostics = (more) => {
|
|
1511
1515
|
if (more === null) {
|
|
@@ -1522,7 +1526,7 @@ function getDirectiveDiagnostics(node, reader, evaluator, reflector, scopeRegist
|
|
|
1522
1526
|
if (duplicateDeclarations !== null) {
|
|
1523
1527
|
addDiagnostics(makeDuplicateDeclarationError(node, duplicateDeclarations, kind));
|
|
1524
1528
|
}
|
|
1525
|
-
addDiagnostics(
|
|
1529
|
+
addDiagnostics(checkInheritanceOfInjectable(node, injectableRegistry, reflector, evaluator, strictInjectionParameters, kind));
|
|
1526
1530
|
return diagnostics;
|
|
1527
1531
|
}
|
|
1528
1532
|
function validateHostDirectives(origin, hostDirectives, metaReader) {
|
|
@@ -1545,7 +1549,20 @@ function validateHostDirectives(origin, hostDirectives, metaReader) {
|
|
|
1545
1549
|
function getUndecoratedClassWithAngularFeaturesDiagnostic(node) {
|
|
1546
1550
|
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
1551
|
}
|
|
1548
|
-
function
|
|
1552
|
+
function checkInheritanceOfInjectable(node, injectableRegistry, reflector, evaluator, strictInjectionParameters, kind) {
|
|
1553
|
+
const classWithCtor = findInheritedCtor(node, injectableRegistry, reflector, evaluator);
|
|
1554
|
+
if (classWithCtor === null || classWithCtor.isCtorValid) {
|
|
1555
|
+
return null;
|
|
1556
|
+
}
|
|
1557
|
+
if (!classWithCtor.isDecorated) {
|
|
1558
|
+
return getInheritedUndecoratedCtorDiagnostic(node, classWithCtor.ref, kind);
|
|
1559
|
+
}
|
|
1560
|
+
if (!strictInjectionParameters || isAbstractClassDeclaration(node)) {
|
|
1561
|
+
return null;
|
|
1562
|
+
}
|
|
1563
|
+
return getInheritedInvalidCtorDiagnostic(node, classWithCtor.ref, kind);
|
|
1564
|
+
}
|
|
1565
|
+
function findInheritedCtor(node, injectableRegistry, reflector, evaluator) {
|
|
1549
1566
|
if (!reflector.isClass(node) || reflector.getConstructorParameters(node) !== null) {
|
|
1550
1567
|
return null;
|
|
1551
1568
|
}
|
|
@@ -1554,29 +1571,40 @@ function checkInheritanceOfDirective(node, reader, reflector, evaluator) {
|
|
|
1554
1571
|
if (baseClass === "dynamic") {
|
|
1555
1572
|
return null;
|
|
1556
1573
|
}
|
|
1557
|
-
const
|
|
1558
|
-
if (
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1574
|
+
const injectableMeta = injectableRegistry.getInjectableMeta(baseClass.node);
|
|
1575
|
+
if (injectableMeta !== null) {
|
|
1576
|
+
if (injectableMeta.ctorDeps !== null) {
|
|
1577
|
+
return {
|
|
1578
|
+
ref: baseClass,
|
|
1579
|
+
isCtorValid: injectableMeta.ctorDeps !== "invalid",
|
|
1580
|
+
isDecorated: true
|
|
1581
|
+
};
|
|
1582
|
+
}
|
|
1583
|
+
} else {
|
|
1584
|
+
const baseClassConstructorParams = reflector.getConstructorParameters(baseClass.node);
|
|
1585
|
+
if (baseClassConstructorParams !== null) {
|
|
1586
|
+
return {
|
|
1587
|
+
ref: baseClass,
|
|
1588
|
+
isCtorValid: baseClassConstructorParams.length === 0,
|
|
1589
|
+
isDecorated: false
|
|
1590
|
+
};
|
|
1591
|
+
}
|
|
1567
1592
|
}
|
|
1568
|
-
baseClass =
|
|
1593
|
+
baseClass = readBaseClass(baseClass.node, reflector, evaluator);
|
|
1569
1594
|
}
|
|
1570
1595
|
return null;
|
|
1571
1596
|
}
|
|
1572
|
-
function
|
|
1573
|
-
const
|
|
1574
|
-
|
|
1597
|
+
function getInheritedInvalidCtorDiagnostic(node, baseClass, kind) {
|
|
1598
|
+
const baseClassName = baseClass.debugName;
|
|
1599
|
+
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.`);
|
|
1600
|
+
}
|
|
1601
|
+
function getInheritedUndecoratedCtorDiagnostic(node, baseClass, kind) {
|
|
1575
1602
|
const baseClassName = baseClass.debugName;
|
|
1576
|
-
|
|
1603
|
+
const baseNeedsDecorator = kind === "Component" || kind === "Directive" ? "Directive" : "Injectable";
|
|
1604
|
+
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}.`);
|
|
1577
1605
|
}
|
|
1578
1606
|
|
|
1579
|
-
// bazel-out/
|
|
1607
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/evaluation.mjs
|
|
1580
1608
|
import ts6 from "typescript";
|
|
1581
1609
|
function resolveEnumValue(evaluator, metadata, field, enumSymbolName) {
|
|
1582
1610
|
let resolved = null;
|
|
@@ -1609,7 +1637,7 @@ function resolveLiteral(decorator, literalCache) {
|
|
|
1609
1637
|
return meta;
|
|
1610
1638
|
}
|
|
1611
1639
|
|
|
1612
|
-
// bazel-out/
|
|
1640
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/factory.mjs
|
|
1613
1641
|
import { compileDeclareFactoryFunction, compileFactoryFunction } from "@angular/compiler";
|
|
1614
1642
|
function compileNgFactoryDefField(metadata) {
|
|
1615
1643
|
const res = compileFactoryFunction(metadata);
|
|
@@ -1620,640 +1648,281 @@ function compileDeclareFactory(metadata) {
|
|
|
1620
1648
|
return { name: "\u0275fac", initializer: res.expression, statements: res.statements, type: res.type };
|
|
1621
1649
|
}
|
|
1622
1650
|
|
|
1623
|
-
// bazel-out/
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1651
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/api.mjs
|
|
1652
|
+
var MetaKind;
|
|
1653
|
+
(function(MetaKind2) {
|
|
1654
|
+
MetaKind2[MetaKind2["Directive"] = 0] = "Directive";
|
|
1655
|
+
MetaKind2[MetaKind2["Pipe"] = 1] = "Pipe";
|
|
1656
|
+
MetaKind2[MetaKind2["NgModule"] = 2] = "NgModule";
|
|
1657
|
+
})(MetaKind || (MetaKind = {}));
|
|
1658
|
+
var MatchSource;
|
|
1659
|
+
(function(MatchSource2) {
|
|
1660
|
+
MatchSource2[MatchSource2["Selector"] = 0] = "Selector";
|
|
1661
|
+
MatchSource2[MatchSource2["HostDirective"] = 1] = "HostDirective";
|
|
1662
|
+
})(MatchSource || (MatchSource = {}));
|
|
1663
|
+
|
|
1664
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1665
|
+
import ts8 from "typescript";
|
|
1666
|
+
|
|
1667
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/property_mapping.mjs
|
|
1668
|
+
var ClassPropertyMapping = class {
|
|
1669
|
+
constructor(forwardMap) {
|
|
1670
|
+
this.forwardMap = forwardMap;
|
|
1671
|
+
this.reverseMap = reverseMapFromForwardMap(forwardMap);
|
|
1634
1672
|
}
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
return null;
|
|
1673
|
+
static empty() {
|
|
1674
|
+
return new ClassPropertyMapping(/* @__PURE__ */ new Map());
|
|
1638
1675
|
}
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1676
|
+
static fromMappedObject(obj) {
|
|
1677
|
+
const forwardMap = /* @__PURE__ */ new Map();
|
|
1678
|
+
for (const classPropertyName of Object.keys(obj)) {
|
|
1679
|
+
const value = obj[classPropertyName];
|
|
1680
|
+
const bindingPropertyName = Array.isArray(value) ? value[0] : value;
|
|
1681
|
+
const inputOrOutput = { classPropertyName, bindingPropertyName };
|
|
1682
|
+
forwardMap.set(classPropertyName, inputOrOutput);
|
|
1683
|
+
}
|
|
1684
|
+
return new ClassPropertyMapping(forwardMap);
|
|
1647
1685
|
}
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1686
|
+
static merge(a, b) {
|
|
1687
|
+
const forwardMap = new Map(a.forwardMap.entries());
|
|
1688
|
+
for (const [classPropertyName, inputOrOutput] of b.forwardMap) {
|
|
1689
|
+
forwardMap.set(classPropertyName, inputOrOutput);
|
|
1690
|
+
}
|
|
1691
|
+
return new ClassPropertyMapping(forwardMap);
|
|
1653
1692
|
}
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
return classMemberToMetadata((_a = member.nameNode) != null ? _a : member.name, member.decorators, isCore);
|
|
1657
|
-
});
|
|
1658
|
-
if (decoratedMembers.length > 0) {
|
|
1659
|
-
metaPropDecorators = new WrappedNodeExpr3(ts7.factory.createObjectLiteralExpression(decoratedMembers));
|
|
1693
|
+
get classPropertyNames() {
|
|
1694
|
+
return Array.from(this.forwardMap.keys());
|
|
1660
1695
|
}
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
decorators: metaDecorators,
|
|
1664
|
-
ctorParameters: metaCtorParameters,
|
|
1665
|
-
propDecorators: metaPropDecorators
|
|
1666
|
-
};
|
|
1667
|
-
}
|
|
1668
|
-
function ctorParameterToMetadata(param, isCore) {
|
|
1669
|
-
const type = param.typeValueReference.kind !== 2 ? valueReferenceToExpression(param.typeValueReference) : new LiteralExpr2(void 0);
|
|
1670
|
-
const mapEntries = [
|
|
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 });
|
|
1696
|
+
get propertyNames() {
|
|
1697
|
+
return Array.from(this.reverseMap.keys());
|
|
1677
1698
|
}
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
function classMemberToMetadata(name, decorators, isCore) {
|
|
1681
|
-
const ngDecorators = decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
1682
|
-
const decoratorMeta = ts7.factory.createArrayLiteralExpression(ngDecorators);
|
|
1683
|
-
return ts7.factory.createPropertyAssignment(name, decoratorMeta);
|
|
1684
|
-
}
|
|
1685
|
-
function decoratorToMetadata(decorator, wrapFunctionsInParens) {
|
|
1686
|
-
if (decorator.identifier === null) {
|
|
1687
|
-
throw new Error("Illegal state: synthesized decorator cannot be emitted in class metadata.");
|
|
1699
|
+
hasBindingPropertyName(propertyName) {
|
|
1700
|
+
return this.reverseMap.has(propertyName);
|
|
1688
1701
|
}
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
];
|
|
1692
|
-
if (decorator.args !== null && decorator.args.length > 0) {
|
|
1693
|
-
const args = decorator.args.map((arg) => {
|
|
1694
|
-
return wrapFunctionsInParens ? wrapFunctionExpressionsInParens(arg) : arg;
|
|
1695
|
-
});
|
|
1696
|
-
properties.push(ts7.factory.createPropertyAssignment("args", ts7.factory.createArrayLiteralExpression(args)));
|
|
1702
|
+
getByBindingPropertyName(propertyName) {
|
|
1703
|
+
return this.reverseMap.has(propertyName) ? this.reverseMap.get(propertyName) : null;
|
|
1697
1704
|
}
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
function isAngularDecorator2(decorator, isCore) {
|
|
1701
|
-
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
1702
|
-
}
|
|
1703
|
-
function removeIdentifierReferences(node, name) {
|
|
1704
|
-
const result = ts7.transform(node, [(context) => (root) => ts7.visitNode(root, function walk(current) {
|
|
1705
|
-
return ts7.isIdentifier(current) && current.text === name ? ts7.factory.createIdentifier(current.text) : ts7.visitEachChild(current, walk, context);
|
|
1706
|
-
})]);
|
|
1707
|
-
return result.transformed[0];
|
|
1708
|
-
}
|
|
1709
|
-
|
|
1710
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/references_registry.mjs
|
|
1711
|
-
var NoopReferencesRegistry = class {
|
|
1712
|
-
add(source, ...references) {
|
|
1705
|
+
getByClassPropertyName(classPropertyName) {
|
|
1706
|
+
return this.forwardMap.has(classPropertyName) ? this.forwardMap.get(classPropertyName) : null;
|
|
1713
1707
|
}
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
const result = evaluator.evaluate(rawExpr);
|
|
1721
|
-
if (!Array.isArray(result)) {
|
|
1722
|
-
throw createValueHasWrongTypeError(rawExpr, result, `${context}.schemas must be an array`);
|
|
1708
|
+
toDirectMappedObject() {
|
|
1709
|
+
const obj = {};
|
|
1710
|
+
for (const [classPropertyName, inputOrOutput] of this.forwardMap) {
|
|
1711
|
+
obj[classPropertyName] = inputOrOutput.bindingPropertyName;
|
|
1712
|
+
}
|
|
1713
|
+
return obj;
|
|
1723
1714
|
}
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1715
|
+
toJointMappedObject() {
|
|
1716
|
+
const obj = {};
|
|
1717
|
+
for (const [classPropertyName, inputOrOutput] of this.forwardMap) {
|
|
1718
|
+
if (inputOrOutput.bindingPropertyName === classPropertyName) {
|
|
1719
|
+
obj[classPropertyName] = inputOrOutput.bindingPropertyName;
|
|
1720
|
+
} else {
|
|
1721
|
+
obj[classPropertyName] = [inputOrOutput.bindingPropertyName, classPropertyName];
|
|
1722
|
+
}
|
|
1727
1723
|
}
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1724
|
+
return obj;
|
|
1725
|
+
}
|
|
1726
|
+
*[Symbol.iterator]() {
|
|
1727
|
+
for (const [classPropertyName, inputOrOutput] of this.forwardMap.entries()) {
|
|
1728
|
+
yield [classPropertyName, inputOrOutput.bindingPropertyName];
|
|
1731
1729
|
}
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
default:
|
|
1740
|
-
throw createValueHasWrongTypeError(rawExpr, schemaRef, `'${schemaRef.debugName}' is not a valid ${context} schema`);
|
|
1730
|
+
}
|
|
1731
|
+
};
|
|
1732
|
+
function reverseMapFromForwardMap(forwardMap) {
|
|
1733
|
+
const reverseMap = /* @__PURE__ */ new Map();
|
|
1734
|
+
for (const [_, inputOrOutput] of forwardMap) {
|
|
1735
|
+
if (!reverseMap.has(inputOrOutput.bindingPropertyName)) {
|
|
1736
|
+
reverseMap.set(inputOrOutput.bindingPropertyName, []);
|
|
1741
1737
|
}
|
|
1738
|
+
reverseMap.get(inputOrOutput.bindingPropertyName).push(inputOrOutput);
|
|
1742
1739
|
}
|
|
1743
|
-
return
|
|
1740
|
+
return reverseMap;
|
|
1744
1741
|
}
|
|
1745
1742
|
|
|
1746
|
-
// bazel-out/
|
|
1747
|
-
import
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
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);
|
|
1743
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/util.mjs
|
|
1744
|
+
import ts7 from "typescript";
|
|
1745
|
+
function extractReferencesFromType(checker, def, bestGuessOwningModule) {
|
|
1746
|
+
if (!ts7.isTupleTypeNode(def)) {
|
|
1747
|
+
return [];
|
|
1757
1748
|
}
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1749
|
+
return def.elements.map((element) => {
|
|
1750
|
+
if (!ts7.isTypeQueryNode(element)) {
|
|
1751
|
+
throw new Error(`Expected TypeQueryNode: ${nodeDebugInfo(element)}`);
|
|
1752
|
+
}
|
|
1753
|
+
return extraReferenceFromTypeQuery(checker, element, def, bestGuessOwningModule);
|
|
1754
|
+
});
|
|
1755
|
+
}
|
|
1756
|
+
function extraReferenceFromTypeQuery(checker, typeNode, origin, bestGuessOwningModule) {
|
|
1757
|
+
const type = typeNode.exprName;
|
|
1758
|
+
const { node, from } = reflectTypeEntityToDeclaration(type, checker);
|
|
1759
|
+
if (!isNamedClassDeclaration(node)) {
|
|
1760
|
+
throw new Error(`Expected named ClassDeclaration: ${nodeDebugInfo(node)}`);
|
|
1762
1761
|
}
|
|
1763
|
-
|
|
1762
|
+
if (from !== null && !from.startsWith(".")) {
|
|
1763
|
+
return new Reference(node, { specifier: from, resolutionContext: origin.getSourceFile().fileName });
|
|
1764
|
+
}
|
|
1765
|
+
return new Reference(node, bestGuessOwningModule);
|
|
1764
1766
|
}
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
var OpaqueSymbol = class extends SemanticSymbol {
|
|
1769
|
-
isPublicApiAffected() {
|
|
1770
|
-
return false;
|
|
1767
|
+
function readBooleanType(type) {
|
|
1768
|
+
if (!ts7.isLiteralTypeNode(type)) {
|
|
1769
|
+
return null;
|
|
1771
1770
|
}
|
|
1772
|
-
|
|
1773
|
-
|
|
1771
|
+
switch (type.literal.kind) {
|
|
1772
|
+
case ts7.SyntaxKind.TrueKeyword:
|
|
1773
|
+
return true;
|
|
1774
|
+
case ts7.SyntaxKind.FalseKeyword:
|
|
1775
|
+
return false;
|
|
1776
|
+
default:
|
|
1777
|
+
return null;
|
|
1774
1778
|
}
|
|
1775
|
-
}
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
this.symbolByDecl = /* @__PURE__ */ new Map();
|
|
1779
|
+
}
|
|
1780
|
+
function readStringType(type) {
|
|
1781
|
+
if (!ts7.isLiteralTypeNode(type) || !ts7.isStringLiteral(type.literal)) {
|
|
1782
|
+
return null;
|
|
1780
1783
|
}
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
}
|
|
1787
|
-
this.files.get(symbol.path).set(symbol.identifier, symbol);
|
|
1788
|
-
}
|
|
1784
|
+
return type.literal.text;
|
|
1785
|
+
}
|
|
1786
|
+
function readMapType(type, valueTransform) {
|
|
1787
|
+
if (!ts7.isTypeLiteralNode(type)) {
|
|
1788
|
+
return {};
|
|
1789
1789
|
}
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
if (
|
|
1793
|
-
|
|
1790
|
+
const obj = {};
|
|
1791
|
+
type.members.forEach((member) => {
|
|
1792
|
+
if (!ts7.isPropertySignature(member) || member.type === void 0 || member.name === void 0 || !ts7.isStringLiteral(member.name) && !ts7.isIdentifier(member.name)) {
|
|
1793
|
+
return;
|
|
1794
1794
|
}
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
getSymbolByName(path, identifier) {
|
|
1798
|
-
if (!this.files.has(path)) {
|
|
1799
|
-
return null;
|
|
1800
|
-
}
|
|
1801
|
-
const file = this.files.get(path);
|
|
1802
|
-
if (!file.has(identifier)) {
|
|
1803
|
-
return null;
|
|
1804
|
-
}
|
|
1805
|
-
return file.get(identifier);
|
|
1806
|
-
}
|
|
1807
|
-
getSymbolByDecl(decl) {
|
|
1808
|
-
if (!this.symbolByDecl.has(decl)) {
|
|
1795
|
+
const value = valueTransform(member.type);
|
|
1796
|
+
if (value === null) {
|
|
1809
1797
|
return null;
|
|
1810
1798
|
}
|
|
1811
|
-
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
this.opaqueSymbols = /* @__PURE__ */ new Map();
|
|
1819
|
-
}
|
|
1820
|
-
registerSymbol(symbol) {
|
|
1821
|
-
this.newGraph.registerSymbol(symbol);
|
|
1822
|
-
}
|
|
1823
|
-
finalize() {
|
|
1824
|
-
if (this.priorGraph === null) {
|
|
1825
|
-
return {
|
|
1826
|
-
needsEmit: /* @__PURE__ */ new Set(),
|
|
1827
|
-
needsTypeCheckEmit: /* @__PURE__ */ new Set(),
|
|
1828
|
-
newGraph: this.newGraph
|
|
1829
|
-
};
|
|
1830
|
-
}
|
|
1831
|
-
const needsEmit = this.determineInvalidatedFiles(this.priorGraph);
|
|
1832
|
-
const needsTypeCheckEmit = this.determineInvalidatedTypeCheckFiles(this.priorGraph);
|
|
1833
|
-
return {
|
|
1834
|
-
needsEmit,
|
|
1835
|
-
needsTypeCheckEmit,
|
|
1836
|
-
newGraph: this.newGraph
|
|
1837
|
-
};
|
|
1799
|
+
obj[member.name.text] = value;
|
|
1800
|
+
});
|
|
1801
|
+
return obj;
|
|
1802
|
+
}
|
|
1803
|
+
function readStringArrayType(type) {
|
|
1804
|
+
if (!ts7.isTupleTypeNode(type)) {
|
|
1805
|
+
return [];
|
|
1838
1806
|
}
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
if (previousSymbol === null || symbol.isPublicApiAffected(previousSymbol)) {
|
|
1844
|
-
isPublicApiAffected.add(symbol);
|
|
1845
|
-
}
|
|
1807
|
+
const res = [];
|
|
1808
|
+
type.elements.forEach((el) => {
|
|
1809
|
+
if (!ts7.isLiteralTypeNode(el) || !ts7.isStringLiteral(el.literal)) {
|
|
1810
|
+
return;
|
|
1846
1811
|
}
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1812
|
+
res.push(el.literal.text);
|
|
1813
|
+
});
|
|
1814
|
+
return res;
|
|
1815
|
+
}
|
|
1816
|
+
function extractDirectiveTypeCheckMeta(node, inputs, reflector) {
|
|
1817
|
+
const members = reflector.getMembersOfClass(node);
|
|
1818
|
+
const staticMembers = members.filter((member) => member.isStatic);
|
|
1819
|
+
const ngTemplateGuards = staticMembers.map(extractTemplateGuard).filter((guard) => guard !== null);
|
|
1820
|
+
const hasNgTemplateContextGuard = staticMembers.some((member) => member.kind === ClassMemberKind.Method && member.name === "ngTemplateContextGuard");
|
|
1821
|
+
const coercedInputFields = new Set(staticMembers.map(extractCoercedInput).filter((inputName) => inputName !== null));
|
|
1822
|
+
const restrictedInputFields = /* @__PURE__ */ new Set();
|
|
1823
|
+
const stringLiteralInputFields = /* @__PURE__ */ new Set();
|
|
1824
|
+
const undeclaredInputFields = /* @__PURE__ */ new Set();
|
|
1825
|
+
for (const classPropertyName of inputs.classPropertyNames) {
|
|
1826
|
+
const field = members.find((member) => member.name === classPropertyName);
|
|
1827
|
+
if (field === void 0 || field.node === null) {
|
|
1828
|
+
undeclaredInputFields.add(classPropertyName);
|
|
1829
|
+
continue;
|
|
1856
1830
|
}
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
determineInvalidatedTypeCheckFiles(priorGraph) {
|
|
1860
|
-
const isTypeCheckApiAffected = /* @__PURE__ */ new Set();
|
|
1861
|
-
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1862
|
-
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
1863
|
-
if (previousSymbol === null || symbol.isTypeCheckApiAffected(previousSymbol)) {
|
|
1864
|
-
isTypeCheckApiAffected.add(symbol);
|
|
1865
|
-
}
|
|
1831
|
+
if (isRestricted(field.node)) {
|
|
1832
|
+
restrictedInputFields.add(classPropertyName);
|
|
1866
1833
|
}
|
|
1867
|
-
|
|
1868
|
-
|
|
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
|
-
}
|
|
1834
|
+
if (field.nameNode !== null && ts7.isStringLiteral(field.nameNode)) {
|
|
1835
|
+
stringLiteralInputFields.add(classPropertyName);
|
|
1876
1836
|
}
|
|
1877
|
-
return needsTypeCheckEmit;
|
|
1878
1837
|
}
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1838
|
+
const arity = reflector.getGenericArityOfClass(node);
|
|
1839
|
+
return {
|
|
1840
|
+
hasNgTemplateContextGuard,
|
|
1841
|
+
ngTemplateGuards,
|
|
1842
|
+
coercedInputFields,
|
|
1843
|
+
restrictedInputFields,
|
|
1844
|
+
stringLiteralInputFields,
|
|
1845
|
+
undeclaredInputFields,
|
|
1846
|
+
isGeneric: arity !== null && arity > 0
|
|
1847
|
+
};
|
|
1848
|
+
}
|
|
1849
|
+
function isRestricted(node) {
|
|
1850
|
+
const modifiers = getModifiers(node);
|
|
1851
|
+
return modifiers !== void 0 && modifiers.some(({ kind }) => {
|
|
1852
|
+
return kind === ts7.SyntaxKind.PrivateKeyword || kind === ts7.SyntaxKind.ProtectedKeyword || kind === ts7.SyntaxKind.ReadonlyKeyword;
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
function extractTemplateGuard(member) {
|
|
1856
|
+
if (!member.name.startsWith("ngTemplateGuard_")) {
|
|
1857
|
+
return null;
|
|
1884
1858
|
}
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1859
|
+
const inputName = afterUnderscore(member.name);
|
|
1860
|
+
if (member.kind === ClassMemberKind.Property) {
|
|
1861
|
+
let type = null;
|
|
1862
|
+
if (member.type !== null && ts7.isLiteralTypeNode(member.type) && ts7.isStringLiteral(member.type.literal)) {
|
|
1863
|
+
type = member.type.literal.text;
|
|
1889
1864
|
}
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
getOpaqueSymbol(decl) {
|
|
1893
|
-
if (this.opaqueSymbols.has(decl)) {
|
|
1894
|
-
return this.opaqueSymbols.get(decl);
|
|
1865
|
+
if (type !== "binding") {
|
|
1866
|
+
return null;
|
|
1895
1867
|
}
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
return
|
|
1899
|
-
}
|
|
1900
|
-
};
|
|
1901
|
-
function getImportPath(expr) {
|
|
1902
|
-
if (expr instanceof ExternalExpr2) {
|
|
1903
|
-
return `${expr.value.moduleName}$${expr.value.name}`;
|
|
1868
|
+
return { inputName, type };
|
|
1869
|
+
} else if (member.kind === ClassMemberKind.Method) {
|
|
1870
|
+
return { inputName, type: "invocation" };
|
|
1904
1871
|
} else {
|
|
1905
1872
|
return null;
|
|
1906
1873
|
}
|
|
1907
1874
|
}
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
// bazel-out/darwin_arm64-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;
|
|
1919
|
-
}
|
|
1920
|
-
return a.path === b.path && a.identifier === b.identifier;
|
|
1921
|
-
}
|
|
1922
|
-
function isReferenceEqual(a, b) {
|
|
1923
|
-
if (!isSymbolEqual(a.symbol, b.symbol)) {
|
|
1924
|
-
return false;
|
|
1925
|
-
}
|
|
1926
|
-
return a.importPath === b.importPath;
|
|
1927
|
-
}
|
|
1928
|
-
function referenceEquality(a, b) {
|
|
1929
|
-
return a === b;
|
|
1930
|
-
}
|
|
1931
|
-
function isArrayEqual(a, b, equalityTester = referenceEquality) {
|
|
1932
|
-
if (a === null || b === null) {
|
|
1933
|
-
return a === b;
|
|
1934
|
-
}
|
|
1935
|
-
if (a.length !== b.length) {
|
|
1936
|
-
return false;
|
|
1875
|
+
function extractCoercedInput(member) {
|
|
1876
|
+
if (member.kind !== ClassMemberKind.Property || !member.name.startsWith("ngAcceptInputType_")) {
|
|
1877
|
+
return null;
|
|
1937
1878
|
}
|
|
1938
|
-
return
|
|
1879
|
+
return afterUnderscore(member.name);
|
|
1939
1880
|
}
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
}
|
|
1944
|
-
if (a.size !== b.size) {
|
|
1945
|
-
return false;
|
|
1881
|
+
var CompoundMetadataReader = class {
|
|
1882
|
+
constructor(readers) {
|
|
1883
|
+
this.readers = readers;
|
|
1946
1884
|
}
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
if (
|
|
1951
|
-
|
|
1952
|
-
break;
|
|
1885
|
+
getDirectiveMetadata(node) {
|
|
1886
|
+
for (const reader of this.readers) {
|
|
1887
|
+
const meta = reader.getDirectiveMetadata(node);
|
|
1888
|
+
if (meta !== null) {
|
|
1889
|
+
return meta;
|
|
1953
1890
|
}
|
|
1954
1891
|
}
|
|
1955
|
-
|
|
1956
|
-
return false;
|
|
1957
|
-
}
|
|
1892
|
+
return null;
|
|
1958
1893
|
}
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1894
|
+
getNgModuleMetadata(node) {
|
|
1895
|
+
for (const reader of this.readers) {
|
|
1896
|
+
const meta = reader.getNgModuleMetadata(node);
|
|
1897
|
+
if (meta !== null) {
|
|
1898
|
+
return meta;
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1965
1901
|
return null;
|
|
1966
1902
|
}
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1903
|
+
getPipeMetadata(node) {
|
|
1904
|
+
for (const reader of this.readers) {
|
|
1905
|
+
const meta = reader.getPipeMetadata(node);
|
|
1906
|
+
if (meta !== null) {
|
|
1907
|
+
return meta;
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
return null;
|
|
1972
1911
|
}
|
|
1973
|
-
|
|
1974
|
-
|
|
1912
|
+
};
|
|
1913
|
+
function afterUnderscore(str) {
|
|
1914
|
+
const pos = str.indexOf("_");
|
|
1915
|
+
if (pos === -1) {
|
|
1916
|
+
throw new Error(`Expected '${str}' to contain '_'`);
|
|
1975
1917
|
}
|
|
1976
|
-
return
|
|
1918
|
+
return str.slice(pos + 1);
|
|
1977
1919
|
}
|
|
1978
|
-
function
|
|
1979
|
-
|
|
1920
|
+
function hasInjectableFields(clazz, host) {
|
|
1921
|
+
const members = host.getMembersOfClass(clazz);
|
|
1922
|
+
return members.some(({ isStatic, name }) => isStatic && (name === "\u0275prov" || name === "\u0275fac"));
|
|
1980
1923
|
}
|
|
1981
1924
|
|
|
1982
|
-
// bazel-out/
|
|
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/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1996
|
-
import ts11 from "typescript";
|
|
1997
|
-
|
|
1998
|
-
// bazel-out/darwin_arm64-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);
|
|
2003
|
-
}
|
|
2004
|
-
static empty() {
|
|
2005
|
-
return new ClassPropertyMapping(/* @__PURE__ */ new Map());
|
|
2006
|
-
}
|
|
2007
|
-
static fromMappedObject(obj) {
|
|
2008
|
-
const forwardMap = /* @__PURE__ */ new Map();
|
|
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);
|
|
2016
|
-
}
|
|
2017
|
-
static merge(a, b) {
|
|
2018
|
-
const forwardMap = new Map(a.forwardMap.entries());
|
|
2019
|
-
for (const [classPropertyName, inputOrOutput] of b.forwardMap) {
|
|
2020
|
-
forwardMap.set(classPropertyName, inputOrOutput);
|
|
2021
|
-
}
|
|
2022
|
-
return new ClassPropertyMapping(forwardMap);
|
|
2023
|
-
}
|
|
2024
|
-
get classPropertyNames() {
|
|
2025
|
-
return Array.from(this.forwardMap.keys());
|
|
2026
|
-
}
|
|
2027
|
-
get propertyNames() {
|
|
2028
|
-
return Array.from(this.reverseMap.keys());
|
|
2029
|
-
}
|
|
2030
|
-
hasBindingPropertyName(propertyName) {
|
|
2031
|
-
return this.reverseMap.has(propertyName);
|
|
2032
|
-
}
|
|
2033
|
-
getByBindingPropertyName(propertyName) {
|
|
2034
|
-
return this.reverseMap.has(propertyName) ? this.reverseMap.get(propertyName) : null;
|
|
2035
|
-
}
|
|
2036
|
-
getByClassPropertyName(classPropertyName) {
|
|
2037
|
-
return this.forwardMap.has(classPropertyName) ? this.forwardMap.get(classPropertyName) : null;
|
|
2038
|
-
}
|
|
2039
|
-
toDirectMappedObject() {
|
|
2040
|
-
const obj = {};
|
|
2041
|
-
for (const [classPropertyName, inputOrOutput] of this.forwardMap) {
|
|
2042
|
-
obj[classPropertyName] = inputOrOutput.bindingPropertyName;
|
|
2043
|
-
}
|
|
2044
|
-
return obj;
|
|
2045
|
-
}
|
|
2046
|
-
toJointMappedObject() {
|
|
2047
|
-
const obj = {};
|
|
2048
|
-
for (const [classPropertyName, inputOrOutput] of this.forwardMap) {
|
|
2049
|
-
if (inputOrOutput.bindingPropertyName === classPropertyName) {
|
|
2050
|
-
obj[classPropertyName] = inputOrOutput.bindingPropertyName;
|
|
2051
|
-
} else {
|
|
2052
|
-
obj[classPropertyName] = [inputOrOutput.bindingPropertyName, classPropertyName];
|
|
2053
|
-
}
|
|
2054
|
-
}
|
|
2055
|
-
return obj;
|
|
2056
|
-
}
|
|
2057
|
-
*[Symbol.iterator]() {
|
|
2058
|
-
for (const [classPropertyName, inputOrOutput] of this.forwardMap.entries()) {
|
|
2059
|
-
yield [classPropertyName, inputOrOutput.bindingPropertyName];
|
|
2060
|
-
}
|
|
2061
|
-
}
|
|
2062
|
-
};
|
|
2063
|
-
function reverseMapFromForwardMap(forwardMap) {
|
|
2064
|
-
const reverseMap = /* @__PURE__ */ new Map();
|
|
2065
|
-
for (const [_, inputOrOutput] of forwardMap) {
|
|
2066
|
-
if (!reverseMap.has(inputOrOutput.bindingPropertyName)) {
|
|
2067
|
-
reverseMap.set(inputOrOutput.bindingPropertyName, []);
|
|
2068
|
-
}
|
|
2069
|
-
reverseMap.get(inputOrOutput.bindingPropertyName).push(inputOrOutput);
|
|
2070
|
-
}
|
|
2071
|
-
return reverseMap;
|
|
2072
|
-
}
|
|
2073
|
-
|
|
2074
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/util.mjs
|
|
2075
|
-
import ts10 from "typescript";
|
|
2076
|
-
function extractReferencesFromType(checker, def, bestGuessOwningModule) {
|
|
2077
|
-
if (!ts10.isTupleTypeNode(def)) {
|
|
2078
|
-
return [];
|
|
2079
|
-
}
|
|
2080
|
-
return def.elements.map((element) => {
|
|
2081
|
-
if (!ts10.isTypeQueryNode(element)) {
|
|
2082
|
-
throw new Error(`Expected TypeQueryNode: ${nodeDebugInfo(element)}`);
|
|
2083
|
-
}
|
|
2084
|
-
return extraReferenceFromTypeQuery(checker, element, def, bestGuessOwningModule);
|
|
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)}`);
|
|
2092
|
-
}
|
|
2093
|
-
if (from !== null && !from.startsWith(".")) {
|
|
2094
|
-
return new Reference(node, { specifier: from, resolutionContext: origin.getSourceFile().fileName });
|
|
2095
|
-
}
|
|
2096
|
-
return new Reference(node, bestGuessOwningModule);
|
|
2097
|
-
}
|
|
2098
|
-
function readBooleanType(type) {
|
|
2099
|
-
if (!ts10.isLiteralTypeNode(type)) {
|
|
2100
|
-
return null;
|
|
2101
|
-
}
|
|
2102
|
-
switch (type.literal.kind) {
|
|
2103
|
-
case ts10.SyntaxKind.TrueKeyword:
|
|
2104
|
-
return true;
|
|
2105
|
-
case ts10.SyntaxKind.FalseKeyword:
|
|
2106
|
-
return false;
|
|
2107
|
-
default:
|
|
2108
|
-
return null;
|
|
2109
|
-
}
|
|
2110
|
-
}
|
|
2111
|
-
function readStringType(type) {
|
|
2112
|
-
if (!ts10.isLiteralTypeNode(type) || !ts10.isStringLiteral(type.literal)) {
|
|
2113
|
-
return null;
|
|
2114
|
-
}
|
|
2115
|
-
return type.literal.text;
|
|
2116
|
-
}
|
|
2117
|
-
function readMapType(type, valueTransform) {
|
|
2118
|
-
if (!ts10.isTypeLiteralNode(type)) {
|
|
2119
|
-
return {};
|
|
2120
|
-
}
|
|
2121
|
-
const obj = {};
|
|
2122
|
-
type.members.forEach((member) => {
|
|
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;
|
|
2129
|
-
}
|
|
2130
|
-
obj[member.name.text] = value;
|
|
2131
|
-
});
|
|
2132
|
-
return obj;
|
|
2133
|
-
}
|
|
2134
|
-
function readStringArrayType(type) {
|
|
2135
|
-
if (!ts10.isTupleTypeNode(type)) {
|
|
2136
|
-
return [];
|
|
2137
|
-
}
|
|
2138
|
-
const res = [];
|
|
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;
|
|
2146
|
-
}
|
|
2147
|
-
function extractDirectiveTypeCheckMeta(node, inputs, reflector) {
|
|
2148
|
-
const members = reflector.getMembersOfClass(node);
|
|
2149
|
-
const staticMembers = members.filter((member) => member.isStatic);
|
|
2150
|
-
const ngTemplateGuards = staticMembers.map(extractTemplateGuard).filter((guard) => guard !== null);
|
|
2151
|
-
const hasNgTemplateContextGuard = staticMembers.some((member) => member.kind === ClassMemberKind.Method && member.name === "ngTemplateContextGuard");
|
|
2152
|
-
const coercedInputFields = new Set(staticMembers.map(extractCoercedInput).filter((inputName) => inputName !== null));
|
|
2153
|
-
const restrictedInputFields = /* @__PURE__ */ new Set();
|
|
2154
|
-
const stringLiteralInputFields = /* @__PURE__ */ new Set();
|
|
2155
|
-
const undeclaredInputFields = /* @__PURE__ */ new Set();
|
|
2156
|
-
for (const classPropertyName of inputs.classPropertyNames) {
|
|
2157
|
-
const field = members.find((member) => member.name === classPropertyName);
|
|
2158
|
-
if (field === void 0 || field.node === null) {
|
|
2159
|
-
undeclaredInputFields.add(classPropertyName);
|
|
2160
|
-
continue;
|
|
2161
|
-
}
|
|
2162
|
-
if (isRestricted(field.node)) {
|
|
2163
|
-
restrictedInputFields.add(classPropertyName);
|
|
2164
|
-
}
|
|
2165
|
-
if (field.nameNode !== null && ts10.isStringLiteral(field.nameNode)) {
|
|
2166
|
-
stringLiteralInputFields.add(classPropertyName);
|
|
2167
|
-
}
|
|
2168
|
-
}
|
|
2169
|
-
const arity = reflector.getGenericArityOfClass(node);
|
|
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
|
-
});
|
|
2185
|
-
}
|
|
2186
|
-
function extractTemplateGuard(member) {
|
|
2187
|
-
if (!member.name.startsWith("ngTemplateGuard_")) {
|
|
2188
|
-
return null;
|
|
2189
|
-
}
|
|
2190
|
-
const inputName = afterUnderscore(member.name);
|
|
2191
|
-
if (member.kind === ClassMemberKind.Property) {
|
|
2192
|
-
let type = null;
|
|
2193
|
-
if (member.type !== null && ts10.isLiteralTypeNode(member.type) && ts10.isStringLiteral(member.type.literal)) {
|
|
2194
|
-
type = member.type.literal.text;
|
|
2195
|
-
}
|
|
2196
|
-
if (type !== "binding") {
|
|
2197
|
-
return null;
|
|
2198
|
-
}
|
|
2199
|
-
return { inputName, type };
|
|
2200
|
-
} else if (member.kind === ClassMemberKind.Method) {
|
|
2201
|
-
return { inputName, type: "invocation" };
|
|
2202
|
-
} else {
|
|
2203
|
-
return null;
|
|
2204
|
-
}
|
|
2205
|
-
}
|
|
2206
|
-
function extractCoercedInput(member) {
|
|
2207
|
-
if (member.kind !== ClassMemberKind.Property || !member.name.startsWith("ngAcceptInputType_")) {
|
|
2208
|
-
return null;
|
|
2209
|
-
}
|
|
2210
|
-
return afterUnderscore(member.name);
|
|
2211
|
-
}
|
|
2212
|
-
var CompoundMetadataReader = class {
|
|
2213
|
-
constructor(readers) {
|
|
2214
|
-
this.readers = readers;
|
|
2215
|
-
}
|
|
2216
|
-
getDirectiveMetadata(node) {
|
|
2217
|
-
for (const reader of this.readers) {
|
|
2218
|
-
const meta = reader.getDirectiveMetadata(node);
|
|
2219
|
-
if (meta !== null) {
|
|
2220
|
-
return meta;
|
|
2221
|
-
}
|
|
2222
|
-
}
|
|
2223
|
-
return null;
|
|
2224
|
-
}
|
|
2225
|
-
getNgModuleMetadata(node) {
|
|
2226
|
-
for (const reader of this.readers) {
|
|
2227
|
-
const meta = reader.getNgModuleMetadata(node);
|
|
2228
|
-
if (meta !== null) {
|
|
2229
|
-
return meta;
|
|
2230
|
-
}
|
|
2231
|
-
}
|
|
2232
|
-
return null;
|
|
2233
|
-
}
|
|
2234
|
-
getPipeMetadata(node) {
|
|
2235
|
-
for (const reader of this.readers) {
|
|
2236
|
-
const meta = reader.getPipeMetadata(node);
|
|
2237
|
-
if (meta !== null) {
|
|
2238
|
-
return meta;
|
|
2239
|
-
}
|
|
2240
|
-
}
|
|
2241
|
-
return null;
|
|
2242
|
-
}
|
|
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);
|
|
2250
|
-
}
|
|
2251
|
-
function hasInjectableFields(clazz, host) {
|
|
2252
|
-
const members = host.getMembersOfClass(clazz);
|
|
2253
|
-
return members.some(({ isStatic, name }) => isStatic && (name === "\u0275prov" || name === "\u0275fac"));
|
|
2254
|
-
}
|
|
2255
|
-
|
|
2256
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1925
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
2257
1926
|
var DtsMetadataReader = class {
|
|
2258
1927
|
constructor(checker, reflector) {
|
|
2259
1928
|
this.checker = checker;
|
|
@@ -2264,7 +1933,7 @@ var DtsMetadataReader = class {
|
|
|
2264
1933
|
const ngModuleDef = this.reflector.getMembersOfClass(clazz).find((member) => member.name === "\u0275mod" && member.isStatic);
|
|
2265
1934
|
if (ngModuleDef === void 0) {
|
|
2266
1935
|
return null;
|
|
2267
|
-
} else if (ngModuleDef.type === null || !
|
|
1936
|
+
} else if (ngModuleDef.type === null || !ts8.isTypeReferenceNode(ngModuleDef.type) || ngModuleDef.type.typeArguments === void 0 || ngModuleDef.type.typeArguments.length !== 4) {
|
|
2268
1937
|
return null;
|
|
2269
1938
|
}
|
|
2270
1939
|
const [_, declarationMetadata, importMetadata, exportMetadata] = ngModuleDef.type.typeArguments;
|
|
@@ -2287,7 +1956,7 @@ var DtsMetadataReader = class {
|
|
|
2287
1956
|
const def = this.reflector.getMembersOfClass(clazz).find((field) => field.isStatic && (field.name === "\u0275cmp" || field.name === "\u0275dir"));
|
|
2288
1957
|
if (def === void 0) {
|
|
2289
1958
|
return null;
|
|
2290
|
-
} else if (def.type === null || !
|
|
1959
|
+
} else if (def.type === null || !ts8.isTypeReferenceNode(def.type) || def.type.typeArguments === void 0 || def.type.typeArguments.length < 2) {
|
|
2291
1960
|
return null;
|
|
2292
1961
|
}
|
|
2293
1962
|
const isComponent = def.name === "\u0275cmp";
|
|
@@ -2327,11 +1996,11 @@ var DtsMetadataReader = class {
|
|
|
2327
1996
|
const def = this.reflector.getMembersOfClass(ref.node).find((field) => field.isStatic && field.name === "\u0275pipe");
|
|
2328
1997
|
if (def === void 0) {
|
|
2329
1998
|
return null;
|
|
2330
|
-
} else if (def.type === null || !
|
|
1999
|
+
} else if (def.type === null || !ts8.isTypeReferenceNode(def.type) || def.type.typeArguments === void 0 || def.type.typeArguments.length < 2) {
|
|
2331
2000
|
return null;
|
|
2332
2001
|
}
|
|
2333
2002
|
const type = def.type.typeArguments[1];
|
|
2334
|
-
if (!
|
|
2003
|
+
if (!ts8.isLiteralTypeNode(type) || !ts8.isStringLiteral(type.literal)) {
|
|
2335
2004
|
return null;
|
|
2336
2005
|
}
|
|
2337
2006
|
const name = type.literal.text;
|
|
@@ -2352,12 +2021,12 @@ function readBaseClass2(clazz, checker, reflector) {
|
|
|
2352
2021
|
}
|
|
2353
2022
|
if (clazz.heritageClauses !== void 0) {
|
|
2354
2023
|
for (const clause of clazz.heritageClauses) {
|
|
2355
|
-
if (clause.token ===
|
|
2024
|
+
if (clause.token === ts8.SyntaxKind.ExtendsKeyword) {
|
|
2356
2025
|
const baseExpr = clause.types[0].expression;
|
|
2357
2026
|
let symbol = checker.getSymbolAtLocation(baseExpr);
|
|
2358
2027
|
if (symbol === void 0) {
|
|
2359
2028
|
return "dynamic";
|
|
2360
|
-
} else if (symbol.flags &
|
|
2029
|
+
} else if (symbol.flags & ts8.SymbolFlags.Alias) {
|
|
2361
2030
|
symbol = checker.getAliasedSymbol(symbol);
|
|
2362
2031
|
}
|
|
2363
2032
|
if (symbol.valueDeclaration !== void 0 && isNamedClassDeclaration(symbol.valueDeclaration)) {
|
|
@@ -2371,14 +2040,14 @@ function readBaseClass2(clazz, checker, reflector) {
|
|
|
2371
2040
|
return null;
|
|
2372
2041
|
}
|
|
2373
2042
|
function readHostDirectivesType(checker, type, bestGuessOwningModule) {
|
|
2374
|
-
if (!
|
|
2043
|
+
if (!ts8.isTupleTypeNode(type) || type.elements.length === 0) {
|
|
2375
2044
|
return null;
|
|
2376
2045
|
}
|
|
2377
2046
|
const result = [];
|
|
2378
2047
|
for (const hostDirectiveType of type.elements) {
|
|
2379
2048
|
const { directive, inputs, outputs } = readMapType(hostDirectiveType, (type2) => type2);
|
|
2380
2049
|
if (directive) {
|
|
2381
|
-
if (!
|
|
2050
|
+
if (!ts8.isTypeQueryNode(directive)) {
|
|
2382
2051
|
throw new Error(`Expected TypeQueryNode: ${nodeDebugInfo(directive)}`);
|
|
2383
2052
|
}
|
|
2384
2053
|
result.push({
|
|
@@ -2392,7 +2061,7 @@ function readHostDirectivesType(checker, type, bestGuessOwningModule) {
|
|
|
2392
2061
|
return result.length > 0 ? result : null;
|
|
2393
2062
|
}
|
|
2394
2063
|
|
|
2395
|
-
// bazel-out/
|
|
2064
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/inheritance.mjs
|
|
2396
2065
|
function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
2397
2066
|
const topMeta = reader.getDirectiveMetadata(dir);
|
|
2398
2067
|
if (topMeta === null) {
|
|
@@ -2450,7 +2119,7 @@ function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
|
2450
2119
|
};
|
|
2451
2120
|
}
|
|
2452
2121
|
|
|
2453
|
-
// bazel-out/
|
|
2122
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/registry.mjs
|
|
2454
2123
|
var LocalMetadataRegistry = class {
|
|
2455
2124
|
constructor() {
|
|
2456
2125
|
this.directives = /* @__PURE__ */ new Map();
|
|
@@ -2475,6 +2144,9 @@ var LocalMetadataRegistry = class {
|
|
|
2475
2144
|
registerPipeMetadata(meta) {
|
|
2476
2145
|
this.pipes.set(meta.ref.node, meta);
|
|
2477
2146
|
}
|
|
2147
|
+
getKnownDirectives() {
|
|
2148
|
+
return this.directives.keys();
|
|
2149
|
+
}
|
|
2478
2150
|
};
|
|
2479
2151
|
var CompoundMetadataRegistry = class {
|
|
2480
2152
|
constructor(registries) {
|
|
@@ -2496,143 +2168,516 @@ var CompoundMetadataRegistry = class {
|
|
|
2496
2168
|
}
|
|
2497
2169
|
}
|
|
2498
2170
|
};
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2171
|
+
|
|
2172
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/resource_registry.mjs
|
|
2173
|
+
var ResourceRegistry = class {
|
|
2174
|
+
constructor() {
|
|
2175
|
+
this.externalTemplateToComponentsMap = /* @__PURE__ */ new Map();
|
|
2176
|
+
this.componentToTemplateMap = /* @__PURE__ */ new Map();
|
|
2177
|
+
this.componentToStylesMap = /* @__PURE__ */ new Map();
|
|
2178
|
+
this.externalStyleToComponentsMap = /* @__PURE__ */ new Map();
|
|
2179
|
+
}
|
|
2180
|
+
getComponentsWithTemplate(template) {
|
|
2181
|
+
if (!this.externalTemplateToComponentsMap.has(template)) {
|
|
2182
|
+
return /* @__PURE__ */ new Set();
|
|
2183
|
+
}
|
|
2184
|
+
return this.externalTemplateToComponentsMap.get(template);
|
|
2185
|
+
}
|
|
2186
|
+
registerResources(resources, component) {
|
|
2187
|
+
if (resources.template !== null) {
|
|
2188
|
+
this.registerTemplate(resources.template, component);
|
|
2189
|
+
}
|
|
2190
|
+
for (const style of resources.styles) {
|
|
2191
|
+
this.registerStyle(style, component);
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
registerTemplate(templateResource, component) {
|
|
2195
|
+
const { path } = templateResource;
|
|
2196
|
+
if (path !== null) {
|
|
2197
|
+
if (!this.externalTemplateToComponentsMap.has(path)) {
|
|
2198
|
+
this.externalTemplateToComponentsMap.set(path, /* @__PURE__ */ new Set());
|
|
2199
|
+
}
|
|
2200
|
+
this.externalTemplateToComponentsMap.get(path).add(component);
|
|
2201
|
+
}
|
|
2202
|
+
this.componentToTemplateMap.set(component, templateResource);
|
|
2203
|
+
}
|
|
2204
|
+
getTemplate(component) {
|
|
2205
|
+
if (!this.componentToTemplateMap.has(component)) {
|
|
2206
|
+
return null;
|
|
2207
|
+
}
|
|
2208
|
+
return this.componentToTemplateMap.get(component);
|
|
2209
|
+
}
|
|
2210
|
+
registerStyle(styleResource, component) {
|
|
2211
|
+
const { path } = styleResource;
|
|
2212
|
+
if (!this.componentToStylesMap.has(component)) {
|
|
2213
|
+
this.componentToStylesMap.set(component, /* @__PURE__ */ new Set());
|
|
2214
|
+
}
|
|
2215
|
+
if (path !== null) {
|
|
2216
|
+
if (!this.externalStyleToComponentsMap.has(path)) {
|
|
2217
|
+
this.externalStyleToComponentsMap.set(path, /* @__PURE__ */ new Set());
|
|
2218
|
+
}
|
|
2219
|
+
this.externalStyleToComponentsMap.get(path).add(component);
|
|
2220
|
+
}
|
|
2221
|
+
this.componentToStylesMap.get(component).add(styleResource);
|
|
2222
|
+
}
|
|
2223
|
+
getStyles(component) {
|
|
2224
|
+
if (!this.componentToStylesMap.has(component)) {
|
|
2225
|
+
return /* @__PURE__ */ new Set();
|
|
2226
|
+
}
|
|
2227
|
+
return this.componentToStylesMap.get(component);
|
|
2228
|
+
}
|
|
2229
|
+
getComponentsWithStyle(styleUrl) {
|
|
2230
|
+
if (!this.externalStyleToComponentsMap.has(styleUrl)) {
|
|
2231
|
+
return /* @__PURE__ */ new Set();
|
|
2232
|
+
}
|
|
2233
|
+
return this.externalStyleToComponentsMap.get(styleUrl);
|
|
2234
|
+
}
|
|
2235
|
+
};
|
|
2236
|
+
|
|
2237
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/host_directives_resolver.mjs
|
|
2238
|
+
var EMPTY_ARRAY = [];
|
|
2239
|
+
var HostDirectivesResolver = class {
|
|
2240
|
+
constructor(metaReader) {
|
|
2241
|
+
this.metaReader = metaReader;
|
|
2242
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
2243
|
+
}
|
|
2244
|
+
resolve(metadata) {
|
|
2245
|
+
if (this.cache.has(metadata.ref.node)) {
|
|
2246
|
+
return this.cache.get(metadata.ref.node);
|
|
2247
|
+
}
|
|
2248
|
+
const results = metadata.hostDirectives && metadata.hostDirectives.length > 0 ? this.walkHostDirectives(metadata.hostDirectives, []) : EMPTY_ARRAY;
|
|
2249
|
+
this.cache.set(metadata.ref.node, results);
|
|
2250
|
+
return results;
|
|
2251
|
+
}
|
|
2252
|
+
walkHostDirectives(directives, results) {
|
|
2253
|
+
for (const current of directives) {
|
|
2254
|
+
const hostMeta = flattenInheritedDirectiveMetadata(this.metaReader, current.directive);
|
|
2255
|
+
if (hostMeta === null) {
|
|
2256
|
+
throw new Error(`Could not resolve host directive metadata of ${current.directive.debugName}`);
|
|
2257
|
+
}
|
|
2258
|
+
if (hostMeta.hostDirectives) {
|
|
2259
|
+
this.walkHostDirectives(hostMeta.hostDirectives, results);
|
|
2260
|
+
}
|
|
2261
|
+
results.push({
|
|
2262
|
+
...hostMeta,
|
|
2263
|
+
matchSource: MatchSource.HostDirective,
|
|
2264
|
+
inputs: this.filterMappings(hostMeta.inputs, current.inputs),
|
|
2265
|
+
outputs: this.filterMappings(hostMeta.outputs, current.outputs)
|
|
2266
|
+
});
|
|
2267
|
+
}
|
|
2268
|
+
return results;
|
|
2269
|
+
}
|
|
2270
|
+
filterMappings(source, allowedProperties) {
|
|
2271
|
+
const result = {};
|
|
2272
|
+
if (allowedProperties !== null) {
|
|
2273
|
+
for (const publicName in allowedProperties) {
|
|
2274
|
+
if (allowedProperties.hasOwnProperty(publicName)) {
|
|
2275
|
+
const bindings = source.getByBindingPropertyName(publicName);
|
|
2276
|
+
if (bindings !== null) {
|
|
2277
|
+
for (const binding of bindings) {
|
|
2278
|
+
result[binding.classPropertyName] = allowedProperties[publicName];
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
return ClassPropertyMapping.fromMappedObject(result);
|
|
2285
|
+
}
|
|
2286
|
+
};
|
|
2287
|
+
|
|
2288
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/injectable_registry.mjs
|
|
2289
|
+
var InjectableClassRegistry = class {
|
|
2290
|
+
constructor(host, isCore) {
|
|
2291
|
+
this.host = host;
|
|
2292
|
+
this.isCore = isCore;
|
|
2293
|
+
this.classes = /* @__PURE__ */ new Map();
|
|
2503
2294
|
}
|
|
2504
|
-
registerInjectable(declaration) {
|
|
2505
|
-
this.classes.
|
|
2295
|
+
registerInjectable(declaration, meta) {
|
|
2296
|
+
this.classes.set(declaration, meta);
|
|
2297
|
+
}
|
|
2298
|
+
getInjectableMeta(declaration) {
|
|
2299
|
+
if (this.classes.has(declaration)) {
|
|
2300
|
+
return this.classes.get(declaration);
|
|
2301
|
+
}
|
|
2302
|
+
if (!hasInjectableFields(declaration, this.host)) {
|
|
2303
|
+
return null;
|
|
2304
|
+
}
|
|
2305
|
+
const ctorDeps = getConstructorDependencies(declaration, this.host, this.isCore);
|
|
2306
|
+
const meta = {
|
|
2307
|
+
ctorDeps: unwrapConstructorDependencies(ctorDeps)
|
|
2308
|
+
};
|
|
2309
|
+
this.classes.set(declaration, meta);
|
|
2310
|
+
return meta;
|
|
2311
|
+
}
|
|
2312
|
+
};
|
|
2313
|
+
|
|
2314
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/metadata.mjs
|
|
2315
|
+
import { FunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr3 } from "@angular/compiler";
|
|
2316
|
+
import ts9 from "typescript";
|
|
2317
|
+
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
|
|
2318
|
+
if (!reflection.isClass(clazz)) {
|
|
2319
|
+
return null;
|
|
2320
|
+
}
|
|
2321
|
+
const id = reflection.getAdjacentNameOfClass(clazz);
|
|
2322
|
+
const classDecorators = reflection.getDecoratorsOfDeclaration(clazz);
|
|
2323
|
+
if (classDecorators === null) {
|
|
2324
|
+
return null;
|
|
2325
|
+
}
|
|
2326
|
+
const ngClassDecorators = classDecorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(angularDecoratorTransform(decorator), annotateForClosureCompiler)).map((decorator) => removeIdentifierReferences(decorator, id.text));
|
|
2327
|
+
if (ngClassDecorators.length === 0) {
|
|
2328
|
+
return null;
|
|
2329
|
+
}
|
|
2330
|
+
const metaDecorators = new WrappedNodeExpr3(ts9.factory.createArrayLiteralExpression(ngClassDecorators));
|
|
2331
|
+
let metaCtorParameters = null;
|
|
2332
|
+
const classCtorParameters = reflection.getConstructorParameters(clazz);
|
|
2333
|
+
if (classCtorParameters !== null) {
|
|
2334
|
+
const ctorParameters = classCtorParameters.map((param) => ctorParameterToMetadata(param, isCore));
|
|
2335
|
+
metaCtorParameters = new FunctionExpr([], [
|
|
2336
|
+
new ReturnStatement(new LiteralArrayExpr(ctorParameters))
|
|
2337
|
+
]);
|
|
2338
|
+
}
|
|
2339
|
+
let metaPropDecorators = null;
|
|
2340
|
+
const classMembers = reflection.getMembersOfClass(clazz).filter((member) => !member.isStatic && member.decorators !== null && member.decorators.length > 0);
|
|
2341
|
+
const duplicateDecoratedMemberNames = classMembers.map((member) => member.name).filter((name, i, arr) => arr.indexOf(name) < i);
|
|
2342
|
+
if (duplicateDecoratedMemberNames.length > 0) {
|
|
2343
|
+
throw new Error(`Duplicate decorated properties found on class '${clazz.name.text}': ` + duplicateDecoratedMemberNames.join(", "));
|
|
2344
|
+
}
|
|
2345
|
+
const decoratedMembers = classMembers.map((member) => {
|
|
2346
|
+
var _a;
|
|
2347
|
+
return classMemberToMetadata((_a = member.nameNode) != null ? _a : member.name, member.decorators, isCore);
|
|
2348
|
+
});
|
|
2349
|
+
if (decoratedMembers.length > 0) {
|
|
2350
|
+
metaPropDecorators = new WrappedNodeExpr3(ts9.factory.createObjectLiteralExpression(decoratedMembers));
|
|
2351
|
+
}
|
|
2352
|
+
return {
|
|
2353
|
+
type: new WrappedNodeExpr3(id),
|
|
2354
|
+
decorators: metaDecorators,
|
|
2355
|
+
ctorParameters: metaCtorParameters,
|
|
2356
|
+
propDecorators: metaPropDecorators
|
|
2357
|
+
};
|
|
2358
|
+
}
|
|
2359
|
+
function ctorParameterToMetadata(param, isCore) {
|
|
2360
|
+
const type = param.typeValueReference.kind !== 2 ? valueReferenceToExpression(param.typeValueReference) : new LiteralExpr2(void 0);
|
|
2361
|
+
const mapEntries = [
|
|
2362
|
+
{ key: "type", value: type, quoted: false }
|
|
2363
|
+
];
|
|
2364
|
+
if (param.decorators !== null) {
|
|
2365
|
+
const ngDecorators = param.decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
2366
|
+
const value = new WrappedNodeExpr3(ts9.factory.createArrayLiteralExpression(ngDecorators));
|
|
2367
|
+
mapEntries.push({ key: "decorators", value, quoted: false });
|
|
2368
|
+
}
|
|
2369
|
+
return literalMap(mapEntries);
|
|
2370
|
+
}
|
|
2371
|
+
function classMemberToMetadata(name, decorators, isCore) {
|
|
2372
|
+
const ngDecorators = decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
2373
|
+
const decoratorMeta = ts9.factory.createArrayLiteralExpression(ngDecorators);
|
|
2374
|
+
return ts9.factory.createPropertyAssignment(name, decoratorMeta);
|
|
2375
|
+
}
|
|
2376
|
+
function decoratorToMetadata(decorator, wrapFunctionsInParens) {
|
|
2377
|
+
if (decorator.identifier === null) {
|
|
2378
|
+
throw new Error("Illegal state: synthesized decorator cannot be emitted in class metadata.");
|
|
2379
|
+
}
|
|
2380
|
+
const properties = [
|
|
2381
|
+
ts9.factory.createPropertyAssignment("type", decorator.identifier)
|
|
2382
|
+
];
|
|
2383
|
+
if (decorator.args !== null && decorator.args.length > 0) {
|
|
2384
|
+
const args = decorator.args.map((arg) => {
|
|
2385
|
+
return wrapFunctionsInParens ? wrapFunctionExpressionsInParens(arg) : arg;
|
|
2386
|
+
});
|
|
2387
|
+
properties.push(ts9.factory.createPropertyAssignment("args", ts9.factory.createArrayLiteralExpression(args)));
|
|
2388
|
+
}
|
|
2389
|
+
return ts9.factory.createObjectLiteralExpression(properties, true);
|
|
2390
|
+
}
|
|
2391
|
+
function isAngularDecorator2(decorator, isCore) {
|
|
2392
|
+
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
2393
|
+
}
|
|
2394
|
+
function removeIdentifierReferences(node, name) {
|
|
2395
|
+
const result = ts9.transform(node, [(context) => (root) => ts9.visitNode(root, function walk(current) {
|
|
2396
|
+
return ts9.isIdentifier(current) && current.text === name ? ts9.factory.createIdentifier(current.text) : ts9.visitEachChild(current, walk, context);
|
|
2397
|
+
})]);
|
|
2398
|
+
return result.transformed[0];
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/references_registry.mjs
|
|
2402
|
+
var NoopReferencesRegistry = class {
|
|
2403
|
+
add(source, ...references) {
|
|
2404
|
+
}
|
|
2405
|
+
};
|
|
2406
|
+
|
|
2407
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/schema.mjs
|
|
2408
|
+
import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from "@angular/compiler";
|
|
2409
|
+
function extractSchemas(rawExpr, evaluator, context) {
|
|
2410
|
+
const schemas = [];
|
|
2411
|
+
const result = evaluator.evaluate(rawExpr);
|
|
2412
|
+
if (!Array.isArray(result)) {
|
|
2413
|
+
throw createValueHasWrongTypeError(rawExpr, result, `${context}.schemas must be an array`);
|
|
2414
|
+
}
|
|
2415
|
+
for (const schemaRef of result) {
|
|
2416
|
+
if (!(schemaRef instanceof Reference)) {
|
|
2417
|
+
throw createValueHasWrongTypeError(rawExpr, result, `${context}.schemas must be an array of schemas`);
|
|
2418
|
+
}
|
|
2419
|
+
const id = schemaRef.getIdentityIn(schemaRef.node.getSourceFile());
|
|
2420
|
+
if (id === null || schemaRef.ownedByModuleGuess !== "@angular/core") {
|
|
2421
|
+
throw createValueHasWrongTypeError(rawExpr, result, `${context}.schemas must be an array of schemas`);
|
|
2422
|
+
}
|
|
2423
|
+
switch (id.text) {
|
|
2424
|
+
case "CUSTOM_ELEMENTS_SCHEMA":
|
|
2425
|
+
schemas.push(CUSTOM_ELEMENTS_SCHEMA);
|
|
2426
|
+
break;
|
|
2427
|
+
case "NO_ERRORS_SCHEMA":
|
|
2428
|
+
schemas.push(NO_ERRORS_SCHEMA);
|
|
2429
|
+
break;
|
|
2430
|
+
default:
|
|
2431
|
+
throw createValueHasWrongTypeError(rawExpr, schemaRef, `'${schemaRef.debugName}' is not a valid ${context} schema`);
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
return schemas;
|
|
2435
|
+
}
|
|
2436
|
+
|
|
2437
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
|
|
2438
|
+
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";
|
|
2439
|
+
import ts24 from "typescript";
|
|
2440
|
+
|
|
2441
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
2442
|
+
import ts10 from "typescript";
|
|
2443
|
+
var SemanticSymbol = class {
|
|
2444
|
+
constructor(decl) {
|
|
2445
|
+
this.decl = decl;
|
|
2446
|
+
this.path = absoluteFromSourceFile(decl.getSourceFile());
|
|
2447
|
+
this.identifier = getSymbolIdentifier(decl);
|
|
2448
|
+
}
|
|
2449
|
+
};
|
|
2450
|
+
function getSymbolIdentifier(decl) {
|
|
2451
|
+
if (!ts10.isSourceFile(decl.parent)) {
|
|
2452
|
+
return null;
|
|
2453
|
+
}
|
|
2454
|
+
return decl.name.text;
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/graph.mjs
|
|
2458
|
+
import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
|
|
2459
|
+
var OpaqueSymbol = class extends SemanticSymbol {
|
|
2460
|
+
isPublicApiAffected() {
|
|
2461
|
+
return false;
|
|
2462
|
+
}
|
|
2463
|
+
isTypeCheckApiAffected() {
|
|
2464
|
+
return false;
|
|
2465
|
+
}
|
|
2466
|
+
};
|
|
2467
|
+
var SemanticDepGraph = class {
|
|
2468
|
+
constructor() {
|
|
2469
|
+
this.files = /* @__PURE__ */ new Map();
|
|
2470
|
+
this.symbolByDecl = /* @__PURE__ */ new Map();
|
|
2471
|
+
}
|
|
2472
|
+
registerSymbol(symbol) {
|
|
2473
|
+
this.symbolByDecl.set(symbol.decl, symbol);
|
|
2474
|
+
if (symbol.identifier !== null) {
|
|
2475
|
+
if (!this.files.has(symbol.path)) {
|
|
2476
|
+
this.files.set(symbol.path, /* @__PURE__ */ new Map());
|
|
2477
|
+
}
|
|
2478
|
+
this.files.get(symbol.path).set(symbol.identifier, symbol);
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2481
|
+
getEquivalentSymbol(symbol) {
|
|
2482
|
+
let previousSymbol = this.getSymbolByDecl(symbol.decl);
|
|
2483
|
+
if (previousSymbol === null && symbol.identifier !== null) {
|
|
2484
|
+
previousSymbol = this.getSymbolByName(symbol.path, symbol.identifier);
|
|
2485
|
+
}
|
|
2486
|
+
return previousSymbol;
|
|
2487
|
+
}
|
|
2488
|
+
getSymbolByName(path, identifier) {
|
|
2489
|
+
if (!this.files.has(path)) {
|
|
2490
|
+
return null;
|
|
2491
|
+
}
|
|
2492
|
+
const file = this.files.get(path);
|
|
2493
|
+
if (!file.has(identifier)) {
|
|
2494
|
+
return null;
|
|
2495
|
+
}
|
|
2496
|
+
return file.get(identifier);
|
|
2506
2497
|
}
|
|
2507
|
-
|
|
2508
|
-
|
|
2498
|
+
getSymbolByDecl(decl) {
|
|
2499
|
+
if (!this.symbolByDecl.has(decl)) {
|
|
2500
|
+
return null;
|
|
2501
|
+
}
|
|
2502
|
+
return this.symbolByDecl.get(decl);
|
|
2509
2503
|
}
|
|
2510
2504
|
};
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
this.
|
|
2516
|
-
this.componentToTemplateMap = /* @__PURE__ */ new Map();
|
|
2517
|
-
this.componentToStylesMap = /* @__PURE__ */ new Map();
|
|
2518
|
-
this.externalStyleToComponentsMap = /* @__PURE__ */ new Map();
|
|
2505
|
+
var SemanticDepGraphUpdater = class {
|
|
2506
|
+
constructor(priorGraph) {
|
|
2507
|
+
this.priorGraph = priorGraph;
|
|
2508
|
+
this.newGraph = new SemanticDepGraph();
|
|
2509
|
+
this.opaqueSymbols = /* @__PURE__ */ new Map();
|
|
2519
2510
|
}
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
return /* @__PURE__ */ new Set();
|
|
2523
|
-
}
|
|
2524
|
-
return this.externalTemplateToComponentsMap.get(template);
|
|
2511
|
+
registerSymbol(symbol) {
|
|
2512
|
+
this.newGraph.registerSymbol(symbol);
|
|
2525
2513
|
}
|
|
2526
|
-
|
|
2527
|
-
if (
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2514
|
+
finalize() {
|
|
2515
|
+
if (this.priorGraph === null) {
|
|
2516
|
+
return {
|
|
2517
|
+
needsEmit: /* @__PURE__ */ new Set(),
|
|
2518
|
+
needsTypeCheckEmit: /* @__PURE__ */ new Set(),
|
|
2519
|
+
newGraph: this.newGraph
|
|
2520
|
+
};
|
|
2532
2521
|
}
|
|
2522
|
+
const needsEmit = this.determineInvalidatedFiles(this.priorGraph);
|
|
2523
|
+
const needsTypeCheckEmit = this.determineInvalidatedTypeCheckFiles(this.priorGraph);
|
|
2524
|
+
return {
|
|
2525
|
+
needsEmit,
|
|
2526
|
+
needsTypeCheckEmit,
|
|
2527
|
+
newGraph: this.newGraph
|
|
2528
|
+
};
|
|
2533
2529
|
}
|
|
2534
|
-
|
|
2535
|
-
const
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2530
|
+
determineInvalidatedFiles(priorGraph) {
|
|
2531
|
+
const isPublicApiAffected = /* @__PURE__ */ new Set();
|
|
2532
|
+
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
2533
|
+
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
2534
|
+
if (previousSymbol === null || symbol.isPublicApiAffected(previousSymbol)) {
|
|
2535
|
+
isPublicApiAffected.add(symbol);
|
|
2539
2536
|
}
|
|
2540
|
-
this.externalTemplateToComponentsMap.get(path).add(component);
|
|
2541
2537
|
}
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2538
|
+
const needsEmit = /* @__PURE__ */ new Set();
|
|
2539
|
+
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
2540
|
+
if (symbol.isEmitAffected === void 0) {
|
|
2541
|
+
continue;
|
|
2542
|
+
}
|
|
2543
|
+
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
2544
|
+
if (previousSymbol === null || symbol.isEmitAffected(previousSymbol, isPublicApiAffected)) {
|
|
2545
|
+
needsEmit.add(symbol.path);
|
|
2546
|
+
}
|
|
2547
2547
|
}
|
|
2548
|
-
return
|
|
2548
|
+
return needsEmit;
|
|
2549
2549
|
}
|
|
2550
|
-
|
|
2551
|
-
const
|
|
2552
|
-
|
|
2553
|
-
|
|
2550
|
+
determineInvalidatedTypeCheckFiles(priorGraph) {
|
|
2551
|
+
const isTypeCheckApiAffected = /* @__PURE__ */ new Set();
|
|
2552
|
+
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
2553
|
+
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
2554
|
+
if (previousSymbol === null || symbol.isTypeCheckApiAffected(previousSymbol)) {
|
|
2555
|
+
isTypeCheckApiAffected.add(symbol);
|
|
2556
|
+
}
|
|
2554
2557
|
}
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
+
const needsTypeCheckEmit = /* @__PURE__ */ new Set();
|
|
2559
|
+
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
2560
|
+
if (symbol.isTypeCheckBlockAffected === void 0) {
|
|
2561
|
+
continue;
|
|
2562
|
+
}
|
|
2563
|
+
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
2564
|
+
if (previousSymbol === null || symbol.isTypeCheckBlockAffected(previousSymbol, isTypeCheckApiAffected)) {
|
|
2565
|
+
needsTypeCheckEmit.add(symbol.path);
|
|
2558
2566
|
}
|
|
2559
|
-
this.externalStyleToComponentsMap.get(path).add(component);
|
|
2560
2567
|
}
|
|
2561
|
-
|
|
2568
|
+
return needsTypeCheckEmit;
|
|
2562
2569
|
}
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2570
|
+
getSemanticReference(decl, expr) {
|
|
2571
|
+
return {
|
|
2572
|
+
symbol: this.getSymbol(decl),
|
|
2573
|
+
importPath: getImportPath(expr)
|
|
2574
|
+
};
|
|
2575
|
+
}
|
|
2576
|
+
getSymbol(decl) {
|
|
2577
|
+
const symbol = this.newGraph.getSymbolByDecl(decl);
|
|
2578
|
+
if (symbol === null) {
|
|
2579
|
+
return this.getOpaqueSymbol(decl);
|
|
2566
2580
|
}
|
|
2567
|
-
return
|
|
2581
|
+
return symbol;
|
|
2568
2582
|
}
|
|
2569
|
-
|
|
2570
|
-
if (
|
|
2571
|
-
return
|
|
2583
|
+
getOpaqueSymbol(decl) {
|
|
2584
|
+
if (this.opaqueSymbols.has(decl)) {
|
|
2585
|
+
return this.opaqueSymbols.get(decl);
|
|
2572
2586
|
}
|
|
2573
|
-
|
|
2587
|
+
const symbol = new OpaqueSymbol(decl);
|
|
2588
|
+
this.opaqueSymbols.set(decl, symbol);
|
|
2589
|
+
return symbol;
|
|
2574
2590
|
}
|
|
2575
2591
|
};
|
|
2592
|
+
function getImportPath(expr) {
|
|
2593
|
+
if (expr instanceof ExternalExpr2) {
|
|
2594
|
+
return `${expr.value.moduleName}$${expr.value.name}`;
|
|
2595
|
+
} else {
|
|
2596
|
+
return null;
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2576
2599
|
|
|
2577
|
-
// bazel-out/
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2600
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
2601
|
+
import ts11 from "typescript";
|
|
2602
|
+
|
|
2603
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/util.mjs
|
|
2604
|
+
function isSymbolEqual(a, b) {
|
|
2605
|
+
if (a.decl === b.decl) {
|
|
2606
|
+
return true;
|
|
2583
2607
|
}
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
return this.cache.get(metadata.ref.node);
|
|
2587
|
-
}
|
|
2588
|
-
const results = metadata.hostDirectives && metadata.hostDirectives.length > 0 ? this.walkHostDirectives(metadata.hostDirectives, []) : EMPTY_ARRAY;
|
|
2589
|
-
this.cache.set(metadata.ref.node, results);
|
|
2590
|
-
return results;
|
|
2608
|
+
if (a.identifier === null || b.identifier === null) {
|
|
2609
|
+
return false;
|
|
2591
2610
|
}
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
}
|
|
2598
|
-
if (hostMeta.hostDirectives) {
|
|
2599
|
-
this.walkHostDirectives(hostMeta.hostDirectives, results);
|
|
2600
|
-
}
|
|
2601
|
-
results.push({
|
|
2602
|
-
...hostMeta,
|
|
2603
|
-
matchSource: MatchSource.HostDirective,
|
|
2604
|
-
inputs: this.filterMappings(hostMeta.inputs, current.inputs),
|
|
2605
|
-
outputs: this.filterMappings(hostMeta.outputs, current.outputs)
|
|
2606
|
-
});
|
|
2607
|
-
}
|
|
2608
|
-
return results;
|
|
2611
|
+
return a.path === b.path && a.identifier === b.identifier;
|
|
2612
|
+
}
|
|
2613
|
+
function isReferenceEqual(a, b) {
|
|
2614
|
+
if (!isSymbolEqual(a.symbol, b.symbol)) {
|
|
2615
|
+
return false;
|
|
2609
2616
|
}
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2617
|
+
return a.importPath === b.importPath;
|
|
2618
|
+
}
|
|
2619
|
+
function referenceEquality(a, b) {
|
|
2620
|
+
return a === b;
|
|
2621
|
+
}
|
|
2622
|
+
function isArrayEqual(a, b, equalityTester = referenceEquality) {
|
|
2623
|
+
if (a === null || b === null) {
|
|
2624
|
+
return a === b;
|
|
2625
|
+
}
|
|
2626
|
+
if (a.length !== b.length) {
|
|
2627
|
+
return false;
|
|
2628
|
+
}
|
|
2629
|
+
return !a.some((item, index) => !equalityTester(item, b[index]));
|
|
2630
|
+
}
|
|
2631
|
+
function isSetEqual(a, b, equalityTester = referenceEquality) {
|
|
2632
|
+
if (a === null || b === null) {
|
|
2633
|
+
return a === b;
|
|
2634
|
+
}
|
|
2635
|
+
if (a.size !== b.size) {
|
|
2636
|
+
return false;
|
|
2637
|
+
}
|
|
2638
|
+
for (const itemA of a) {
|
|
2639
|
+
let found = false;
|
|
2640
|
+
for (const itemB of b) {
|
|
2641
|
+
if (equalityTester(itemA, itemB)) {
|
|
2642
|
+
found = true;
|
|
2643
|
+
break;
|
|
2622
2644
|
}
|
|
2623
2645
|
}
|
|
2624
|
-
|
|
2646
|
+
if (!found) {
|
|
2647
|
+
return false;
|
|
2648
|
+
}
|
|
2625
2649
|
}
|
|
2626
|
-
|
|
2650
|
+
return true;
|
|
2651
|
+
}
|
|
2652
|
+
|
|
2653
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
2654
|
+
function extractSemanticTypeParameters(node) {
|
|
2655
|
+
if (!ts11.isClassDeclaration(node) || node.typeParameters === void 0) {
|
|
2656
|
+
return null;
|
|
2657
|
+
}
|
|
2658
|
+
return node.typeParameters.map((typeParam) => ({ hasGenericTypeBound: typeParam.constraint !== void 0 }));
|
|
2659
|
+
}
|
|
2660
|
+
function areTypeParametersEqual(current, previous) {
|
|
2661
|
+
if (!isArrayEqual(current, previous, isTypeParameterEqual)) {
|
|
2662
|
+
return false;
|
|
2663
|
+
}
|
|
2664
|
+
if (current !== null && current.some((typeParam) => typeParam.hasGenericTypeBound)) {
|
|
2665
|
+
return false;
|
|
2666
|
+
}
|
|
2667
|
+
return true;
|
|
2668
|
+
}
|
|
2669
|
+
function isTypeParameterEqual(a, b) {
|
|
2670
|
+
return a.hasGenericTypeBound === b.hasGenericTypeBound;
|
|
2671
|
+
}
|
|
2627
2672
|
|
|
2628
|
-
// bazel-out/
|
|
2673
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/api.mjs
|
|
2629
2674
|
var ComponentScopeKind;
|
|
2630
2675
|
(function(ComponentScopeKind2) {
|
|
2631
2676
|
ComponentScopeKind2[ComponentScopeKind2["NgModule"] = 0] = "NgModule";
|
|
2632
2677
|
ComponentScopeKind2[ComponentScopeKind2["Standalone"] = 1] = "Standalone";
|
|
2633
2678
|
})(ComponentScopeKind || (ComponentScopeKind = {}));
|
|
2634
2679
|
|
|
2635
|
-
// bazel-out/
|
|
2680
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/component_scope.mjs
|
|
2636
2681
|
var CompoundComponentScopeReader = class {
|
|
2637
2682
|
constructor(readers) {
|
|
2638
2683
|
this.readers = readers;
|
|
@@ -2657,7 +2702,7 @@ var CompoundComponentScopeReader = class {
|
|
|
2657
2702
|
}
|
|
2658
2703
|
};
|
|
2659
2704
|
|
|
2660
|
-
// bazel-out/
|
|
2705
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/dependency.mjs
|
|
2661
2706
|
var MetadataDtsModuleScopeResolver = class {
|
|
2662
2707
|
constructor(dtsMetaReader, aliasingHost) {
|
|
2663
2708
|
this.dtsMetaReader = dtsMetaReader;
|
|
@@ -2733,11 +2778,11 @@ var MetadataDtsModuleScopeResolver = class {
|
|
|
2733
2778
|
}
|
|
2734
2779
|
};
|
|
2735
2780
|
|
|
2736
|
-
// bazel-out/
|
|
2781
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/local.mjs
|
|
2737
2782
|
import { ExternalExpr as ExternalExpr3 } from "@angular/compiler";
|
|
2738
2783
|
import ts12 from "typescript";
|
|
2739
2784
|
|
|
2740
|
-
// bazel-out/
|
|
2785
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/util.mjs
|
|
2741
2786
|
function getDiagnosticNode(ref, rawExpr) {
|
|
2742
2787
|
return rawExpr !== null ? ref.getOriginForDiagnostics(rawExpr) : ref.node.name;
|
|
2743
2788
|
}
|
|
@@ -2760,7 +2805,7 @@ function makeUnknownComponentImportDiagnostic(ref, rawExpr) {
|
|
|
2760
2805
|
return makeDiagnostic(ErrorCode.COMPONENT_UNKNOWN_IMPORT, getDiagnosticNode(ref, rawExpr), `Component imports must be standalone components, directives, pipes, or must be NgModules.`);
|
|
2761
2806
|
}
|
|
2762
2807
|
|
|
2763
|
-
// bazel-out/
|
|
2808
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/local.mjs
|
|
2764
2809
|
var LocalModuleScopeRegistry = class {
|
|
2765
2810
|
constructor(localReader, fullReader, dependencyScopeReader, refEmitter, aliasingHost) {
|
|
2766
2811
|
this.localReader = localReader;
|
|
@@ -3099,7 +3144,7 @@ function reexportCollision(module, refA, refB) {
|
|
|
3099
3144
|
]);
|
|
3100
3145
|
}
|
|
3101
3146
|
|
|
3102
|
-
// bazel-out/
|
|
3147
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/typecheck.mjs
|
|
3103
3148
|
import { CssSelector, SelectorMatcher } from "@angular/compiler";
|
|
3104
3149
|
import ts13 from "typescript";
|
|
3105
3150
|
var TypeCheckScopeRegistry = class {
|
|
@@ -3162,7 +3207,7 @@ var TypeCheckScopeRegistry = class {
|
|
|
3162
3207
|
}
|
|
3163
3208
|
};
|
|
3164
3209
|
|
|
3165
|
-
// bazel-out/
|
|
3210
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/api.mjs
|
|
3166
3211
|
var CompilationMode;
|
|
3167
3212
|
(function(CompilationMode2) {
|
|
3168
3213
|
CompilationMode2[CompilationMode2["FULL"] = 0] = "FULL";
|
|
@@ -3180,7 +3225,7 @@ var HandlerFlags;
|
|
|
3180
3225
|
HandlerFlags2[HandlerFlags2["FULL_INHERITANCE"] = 1] = "FULL_INHERITANCE";
|
|
3181
3226
|
})(HandlerFlags || (HandlerFlags = {}));
|
|
3182
3227
|
|
|
3183
|
-
// bazel-out/
|
|
3228
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/alias.mjs
|
|
3184
3229
|
import ts14 from "typescript";
|
|
3185
3230
|
function aliasTransformFactory(exportStatements) {
|
|
3186
3231
|
return (context) => {
|
|
@@ -3198,10 +3243,10 @@ function aliasTransformFactory(exportStatements) {
|
|
|
3198
3243
|
};
|
|
3199
3244
|
}
|
|
3200
3245
|
|
|
3201
|
-
// bazel-out/
|
|
3246
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
3202
3247
|
import ts15 from "typescript";
|
|
3203
3248
|
|
|
3204
|
-
// bazel-out/
|
|
3249
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/trait.mjs
|
|
3205
3250
|
var TraitState;
|
|
3206
3251
|
(function(TraitState2) {
|
|
3207
3252
|
TraitState2[TraitState2["Pending"] = 0] = "Pending";
|
|
@@ -3256,7 +3301,7 @@ var TraitImpl = class {
|
|
|
3256
3301
|
}
|
|
3257
3302
|
};
|
|
3258
3303
|
|
|
3259
|
-
// bazel-out/
|
|
3304
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
3260
3305
|
var TraitCompiler = class {
|
|
3261
3306
|
constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater, sourceFileTypeIdentifier) {
|
|
3262
3307
|
this.handlers = handlers;
|
|
@@ -3700,10 +3745,10 @@ function containsErrors(diagnostics) {
|
|
|
3700
3745
|
return diagnostics !== null && diagnostics.some((diag) => diag.category === ts15.DiagnosticCategory.Error);
|
|
3701
3746
|
}
|
|
3702
3747
|
|
|
3703
|
-
// bazel-out/
|
|
3748
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
3704
3749
|
import ts17 from "typescript";
|
|
3705
3750
|
|
|
3706
|
-
// bazel-out/
|
|
3751
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/utils.mjs
|
|
3707
3752
|
import ts16 from "typescript";
|
|
3708
3753
|
function addImports(importManager, sf, extraStatements = []) {
|
|
3709
3754
|
const addedImports = importManager.getAllImports(sf.fileName).map((i) => {
|
|
@@ -3731,7 +3776,7 @@ function isImportStatement(stmt) {
|
|
|
3731
3776
|
return ts16.isImportDeclaration(stmt) || ts16.isImportEqualsDeclaration(stmt) || ts16.isNamespaceImport(stmt);
|
|
3732
3777
|
}
|
|
3733
3778
|
|
|
3734
|
-
// bazel-out/
|
|
3779
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
3735
3780
|
var DtsTransformRegistry = class {
|
|
3736
3781
|
constructor() {
|
|
3737
3782
|
this.ivyDeclarationTransforms = /* @__PURE__ */ new Map();
|
|
@@ -3856,11 +3901,11 @@ function markForEmitAsSingleLine(node) {
|
|
|
3856
3901
|
ts17.forEachChild(node, markForEmitAsSingleLine);
|
|
3857
3902
|
}
|
|
3858
3903
|
|
|
3859
|
-
// bazel-out/
|
|
3904
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
3860
3905
|
import { ConstantPool } from "@angular/compiler";
|
|
3861
3906
|
import ts19 from "typescript";
|
|
3862
3907
|
|
|
3863
|
-
// bazel-out/
|
|
3908
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
|
|
3864
3909
|
import ts18 from "typescript";
|
|
3865
3910
|
function visit(node, visitor, context) {
|
|
3866
3911
|
return visitor._visit(node, context);
|
|
@@ -3921,7 +3966,7 @@ var Visitor = class {
|
|
|
3921
3966
|
}
|
|
3922
3967
|
};
|
|
3923
3968
|
|
|
3924
|
-
// bazel-out/
|
|
3969
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
3925
3970
|
var NO_DECORATORS = /* @__PURE__ */ new Set();
|
|
3926
3971
|
var CLOSURE_FILE_OVERVIEW_REGEXP = /\s+@fileoverview\s+/i;
|
|
3927
3972
|
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, perf, isCore, isClosureCompilerEnabled) {
|
|
@@ -4109,10 +4154,10 @@ function nodeArrayFromDecoratorsArray(decorators) {
|
|
|
4109
4154
|
return array;
|
|
4110
4155
|
}
|
|
4111
4156
|
|
|
4112
|
-
// bazel-out/
|
|
4157
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/handler.mjs
|
|
4113
4158
|
import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, FactoryTarget, makeBindingParser, WrappedNodeExpr as WrappedNodeExpr5 } from "@angular/compiler";
|
|
4114
4159
|
|
|
4115
|
-
// bazel-out/
|
|
4160
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.mjs
|
|
4116
4161
|
import { createMayBeForwardRefExpression, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr4, getSafePropertyAccessString, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
|
|
4117
4162
|
import ts20 from "typescript";
|
|
4118
4163
|
var EMPTY_OBJECT = {};
|
|
@@ -4525,7 +4570,7 @@ function toHostDirectiveMetadata(hostDirective, context, refEmitter) {
|
|
|
4525
4570
|
};
|
|
4526
4571
|
}
|
|
4527
4572
|
|
|
4528
|
-
// bazel-out/
|
|
4573
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/symbol.mjs
|
|
4529
4574
|
var DirectiveSymbol = class extends SemanticSymbol {
|
|
4530
4575
|
constructor(decl, selector, inputs, outputs, exportAs, typeCheckMeta, typeParameters) {
|
|
4531
4576
|
super(decl);
|
|
@@ -4602,7 +4647,7 @@ function isBaseClassEqual(current, previous) {
|
|
|
4602
4647
|
return isSymbolEqual(current, previous);
|
|
4603
4648
|
}
|
|
4604
4649
|
|
|
4605
|
-
// bazel-out/
|
|
4650
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/handler.mjs
|
|
4606
4651
|
var FIELD_DECORATORS = [
|
|
4607
4652
|
"Input",
|
|
4608
4653
|
"Output",
|
|
@@ -4624,7 +4669,7 @@ var LIFECYCLE_HOOKS = /* @__PURE__ */ new Set([
|
|
|
4624
4669
|
"ngAfterContentChecked"
|
|
4625
4670
|
]);
|
|
4626
4671
|
var DirectiveDecoratorHandler = class {
|
|
4627
|
-
constructor(reflector, evaluator, metaRegistry, scopeRegistry, metaReader, injectableRegistry, refEmitter, isCore, semanticDepGraphUpdater, annotateForClosureCompiler, compileUndecoratedClassesWithAngularFeatures, perf) {
|
|
4672
|
+
constructor(reflector, evaluator, metaRegistry, scopeRegistry, metaReader, injectableRegistry, refEmitter, isCore, strictCtorDeps, semanticDepGraphUpdater, annotateForClosureCompiler, compileUndecoratedClassesWithAngularFeatures, perf) {
|
|
4628
4673
|
this.reflector = reflector;
|
|
4629
4674
|
this.evaluator = evaluator;
|
|
4630
4675
|
this.metaRegistry = metaRegistry;
|
|
@@ -4633,6 +4678,7 @@ var DirectiveDecoratorHandler = class {
|
|
|
4633
4678
|
this.injectableRegistry = injectableRegistry;
|
|
4634
4679
|
this.refEmitter = refEmitter;
|
|
4635
4680
|
this.isCore = isCore;
|
|
4681
|
+
this.strictCtorDeps = strictCtorDeps;
|
|
4636
4682
|
this.semanticDepGraphUpdater = semanticDepGraphUpdater;
|
|
4637
4683
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
4638
4684
|
this.compileUndecoratedClassesWithAngularFeatures = compileUndecoratedClassesWithAngularFeatures;
|
|
@@ -4712,7 +4758,9 @@ var DirectiveDecoratorHandler = class {
|
|
|
4712
4758
|
schemas: null,
|
|
4713
4759
|
decorator: analysis.decorator
|
|
4714
4760
|
});
|
|
4715
|
-
this.injectableRegistry.registerInjectable(node
|
|
4761
|
+
this.injectableRegistry.registerInjectable(node, {
|
|
4762
|
+
ctorDeps: analysis.meta.deps
|
|
4763
|
+
});
|
|
4716
4764
|
}
|
|
4717
4765
|
resolve(node, analysis, symbol) {
|
|
4718
4766
|
if (this.semanticDepGraphUpdater !== null && analysis.baseClass instanceof Reference) {
|
|
@@ -4723,7 +4771,7 @@ var DirectiveDecoratorHandler = class {
|
|
|
4723
4771
|
const providerDiagnostics = getProviderDiagnostics(analysis.providersRequiringFactory, analysis.meta.providers.node, this.injectableRegistry);
|
|
4724
4772
|
diagnostics.push(...providerDiagnostics);
|
|
4725
4773
|
}
|
|
4726
|
-
const directiveDiagnostics = getDirectiveDiagnostics(node, this.
|
|
4774
|
+
const directiveDiagnostics = getDirectiveDiagnostics(node, this.injectableRegistry, this.evaluator, this.reflector, this.scopeRegistry, this.strictCtorDeps, "Directive");
|
|
4727
4775
|
if (directiveDiagnostics !== null) {
|
|
4728
4776
|
diagnostics.push(...directiveDiagnostics);
|
|
4729
4777
|
}
|
|
@@ -4758,11 +4806,11 @@ var DirectiveDecoratorHandler = class {
|
|
|
4758
4806
|
}
|
|
4759
4807
|
};
|
|
4760
4808
|
|
|
4761
|
-
// bazel-out/
|
|
4809
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.mjs
|
|
4762
4810
|
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";
|
|
4763
4811
|
import ts22 from "typescript";
|
|
4764
4812
|
|
|
4765
|
-
// bazel-out/
|
|
4813
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/module_with_providers.mjs
|
|
4766
4814
|
import ts21 from "typescript";
|
|
4767
4815
|
function createModuleWithProvidersResolver(reflector, isCore) {
|
|
4768
4816
|
function _reflectModuleFromTypeParam(type, node) {
|
|
@@ -4829,7 +4877,7 @@ function isResolvedModuleWithProviders(sv) {
|
|
|
4829
4877
|
return typeof sv.value === "object" && sv.value != null && sv.value.hasOwnProperty("ngModule") && sv.value.hasOwnProperty("mwpCall");
|
|
4830
4878
|
}
|
|
4831
4879
|
|
|
4832
|
-
// bazel-out/
|
|
4880
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.mjs
|
|
4833
4881
|
var NgModuleSymbol = class extends SemanticSymbol {
|
|
4834
4882
|
constructor() {
|
|
4835
4883
|
super(...arguments);
|
|
@@ -5113,7 +5161,9 @@ var NgModuleDecoratorHandler = class {
|
|
|
5113
5161
|
name: analysis.factorySymbolName
|
|
5114
5162
|
});
|
|
5115
5163
|
}
|
|
5116
|
-
this.injectableRegistry.registerInjectable(node
|
|
5164
|
+
this.injectableRegistry.registerInjectable(node, {
|
|
5165
|
+
ctorDeps: analysis.fac.deps
|
|
5166
|
+
});
|
|
5117
5167
|
}
|
|
5118
5168
|
resolve(node, analysis) {
|
|
5119
5169
|
const scope = this.scopeRegistry.getScopeOfModule(node);
|
|
@@ -5331,7 +5381,7 @@ function isSyntheticReference(ref) {
|
|
|
5331
5381
|
return ref.synthetic;
|
|
5332
5382
|
}
|
|
5333
5383
|
|
|
5334
|
-
// bazel-out/
|
|
5384
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/diagnostics.mjs
|
|
5335
5385
|
function makeCyclicImportInfo(ref, type, cycle) {
|
|
5336
5386
|
const name = ref.debugName || "(unknown)";
|
|
5337
5387
|
const path = cycle.getPath().map((sf) => sf.fileName).join(" -> ");
|
|
@@ -5354,7 +5404,7 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
5354
5404
|
return null;
|
|
5355
5405
|
}
|
|
5356
5406
|
|
|
5357
|
-
// bazel-out/
|
|
5407
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/resources.mjs
|
|
5358
5408
|
import { DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, ParseSourceFile as ParseSourceFile2, parseTemplate } from "@angular/compiler";
|
|
5359
5409
|
import ts23 from "typescript";
|
|
5360
5410
|
function getTemplateDeclarationNodeForError(declaration) {
|
|
@@ -5660,7 +5710,7 @@ function _extractTemplateStyleUrls(template) {
|
|
|
5660
5710
|
return template.styleUrls.map((url) => ({ url, source: 1, nodeForError }));
|
|
5661
5711
|
}
|
|
5662
5712
|
|
|
5663
|
-
// bazel-out/
|
|
5713
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/symbol.mjs
|
|
5664
5714
|
var ComponentSymbol = class extends DirectiveSymbol {
|
|
5665
5715
|
constructor() {
|
|
5666
5716
|
super(...arguments);
|
|
@@ -5695,7 +5745,7 @@ var ComponentSymbol = class extends DirectiveSymbol {
|
|
|
5695
5745
|
}
|
|
5696
5746
|
};
|
|
5697
5747
|
|
|
5698
|
-
// bazel-out/
|
|
5748
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/util.mjs
|
|
5699
5749
|
function collectAnimationNames(value, animationTriggerNames) {
|
|
5700
5750
|
if (value instanceof Map) {
|
|
5701
5751
|
const name = value.get("name");
|
|
@@ -5731,7 +5781,7 @@ var animationTriggerResolver = (fn, node, resolve, unresolvable) => {
|
|
|
5731
5781
|
function validateAndFlattenComponentImports(imports, expr) {
|
|
5732
5782
|
const flattened = [];
|
|
5733
5783
|
if (!Array.isArray(imports)) {
|
|
5734
|
-
const error = createValueHasWrongTypeError(expr, imports, `'imports' must be an array of components, directives, pipes, or NgModules
|
|
5784
|
+
const error = createValueHasWrongTypeError(expr, imports, `'imports' must be an array of components, directives, pipes, or NgModules.`).toDiagnostic();
|
|
5735
5785
|
return {
|
|
5736
5786
|
imports: [],
|
|
5737
5787
|
diagnostics: [error]
|
|
@@ -5747,7 +5797,7 @@ function validateAndFlattenComponentImports(imports, expr) {
|
|
|
5747
5797
|
if (isNamedClassDeclaration(ref.node)) {
|
|
5748
5798
|
flattened.push(ref);
|
|
5749
5799
|
} else {
|
|
5750
|
-
diagnostics.push(createValueHasWrongTypeError(ref.getOriginForDiagnostics(expr), ref, `'imports' must be an array of components, directives, pipes, or NgModules
|
|
5800
|
+
diagnostics.push(createValueHasWrongTypeError(ref.getOriginForDiagnostics(expr), ref, `'imports' must be an array of components, directives, pipes, or NgModules.`).toDiagnostic());
|
|
5751
5801
|
}
|
|
5752
5802
|
} else if (isLikelyModuleWithProviders(ref)) {
|
|
5753
5803
|
let origin = expr;
|
|
@@ -5756,7 +5806,7 @@ function validateAndFlattenComponentImports(imports, expr) {
|
|
|
5756
5806
|
}
|
|
5757
5807
|
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.`));
|
|
5758
5808
|
} else {
|
|
5759
|
-
diagnostics.push(createValueHasWrongTypeError(expr, imports, `'imports' must be an array of components, directives, pipes, or NgModules
|
|
5809
|
+
diagnostics.push(createValueHasWrongTypeError(expr, imports, `'imports' must be an array of components, directives, pipes, or NgModules.`).toDiagnostic());
|
|
5760
5810
|
}
|
|
5761
5811
|
}
|
|
5762
5812
|
return { imports: flattened, diagnostics };
|
|
@@ -5771,10 +5821,10 @@ function isLikelyModuleWithProviders(value) {
|
|
|
5771
5821
|
return false;
|
|
5772
5822
|
}
|
|
5773
5823
|
|
|
5774
|
-
// bazel-out/
|
|
5824
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
|
|
5775
5825
|
var EMPTY_ARRAY2 = [];
|
|
5776
5826
|
var ComponentDecoratorHandler = class {
|
|
5777
|
-
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) {
|
|
5827
|
+
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) {
|
|
5778
5828
|
this.reflector = reflector;
|
|
5779
5829
|
this.evaluator = evaluator;
|
|
5780
5830
|
this.metaRegistry = metaRegistry;
|
|
@@ -5785,6 +5835,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5785
5835
|
this.typeCheckScopeRegistry = typeCheckScopeRegistry;
|
|
5786
5836
|
this.resourceRegistry = resourceRegistry;
|
|
5787
5837
|
this.isCore = isCore;
|
|
5838
|
+
this.strictCtorDeps = strictCtorDeps;
|
|
5788
5839
|
this.resourceLoader = resourceLoader;
|
|
5789
5840
|
this.rootDirs = rootDirs;
|
|
5790
5841
|
this.defaultPreserveWhitespaces = defaultPreserveWhitespaces;
|
|
@@ -6094,7 +6145,9 @@ var ComponentDecoratorHandler = class {
|
|
|
6094
6145
|
decorator: analysis.decorator
|
|
6095
6146
|
});
|
|
6096
6147
|
this.resourceRegistry.registerResources(analysis.resources, node);
|
|
6097
|
-
this.injectableRegistry.registerInjectable(node
|
|
6148
|
+
this.injectableRegistry.registerInjectable(node, {
|
|
6149
|
+
ctorDeps: analysis.meta.deps
|
|
6150
|
+
});
|
|
6098
6151
|
}
|
|
6099
6152
|
index(context, node, analysis) {
|
|
6100
6153
|
if (analysis.isPoisoned && !this.usePoisonedData) {
|
|
@@ -6301,7 +6354,7 @@ var ComponentDecoratorHandler = class {
|
|
|
6301
6354
|
const viewProviderDiagnostics = getProviderDiagnostics(analysis.viewProvidersRequiringFactory, analysis.meta.viewProviders.node, this.injectableRegistry);
|
|
6302
6355
|
diagnostics.push(...viewProviderDiagnostics);
|
|
6303
6356
|
}
|
|
6304
|
-
const directiveDiagnostics = getDirectiveDiagnostics(node, this.
|
|
6357
|
+
const directiveDiagnostics = getDirectiveDiagnostics(node, this.injectableRegistry, this.evaluator, this.reflector, this.scopeRegistry, this.strictCtorDeps, "Component");
|
|
6305
6358
|
if (directiveDiagnostics !== null) {
|
|
6306
6359
|
diagnostics.push(...directiveDiagnostics);
|
|
6307
6360
|
}
|
|
@@ -6412,12 +6465,13 @@ function validateStandaloneImports(importRefs, importExpr, metaReader, scopeRead
|
|
|
6412
6465
|
return diagnostics;
|
|
6413
6466
|
}
|
|
6414
6467
|
|
|
6415
|
-
// bazel-out/
|
|
6468
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
6416
6469
|
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression2, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr8 } from "@angular/compiler";
|
|
6417
6470
|
import ts25 from "typescript";
|
|
6418
6471
|
var InjectableDecoratorHandler = class {
|
|
6419
|
-
constructor(reflector, isCore, strictCtorDeps, injectableRegistry, perf, errorOnDuplicateProv = true) {
|
|
6472
|
+
constructor(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, perf, errorOnDuplicateProv = true) {
|
|
6420
6473
|
this.reflector = reflector;
|
|
6474
|
+
this.evaluator = evaluator;
|
|
6421
6475
|
this.isCore = isCore;
|
|
6422
6476
|
this.strictCtorDeps = strictCtorDeps;
|
|
6423
6477
|
this.injectableRegistry = injectableRegistry;
|
|
@@ -6457,8 +6511,21 @@ var InjectableDecoratorHandler = class {
|
|
|
6457
6511
|
symbol() {
|
|
6458
6512
|
return null;
|
|
6459
6513
|
}
|
|
6460
|
-
register(node) {
|
|
6461
|
-
this.injectableRegistry.registerInjectable(node
|
|
6514
|
+
register(node, analysis) {
|
|
6515
|
+
this.injectableRegistry.registerInjectable(node, {
|
|
6516
|
+
ctorDeps: analysis.ctorDeps
|
|
6517
|
+
});
|
|
6518
|
+
}
|
|
6519
|
+
resolve(node, analysis, symbol) {
|
|
6520
|
+
if (requiresValidCtor(analysis.meta)) {
|
|
6521
|
+
const diagnostic = checkInheritanceOfInjectable(node, this.injectableRegistry, this.reflector, this.evaluator, this.strictCtorDeps, "Injectable");
|
|
6522
|
+
if (diagnostic !== null) {
|
|
6523
|
+
return {
|
|
6524
|
+
diagnostics: [diagnostic]
|
|
6525
|
+
};
|
|
6526
|
+
}
|
|
6527
|
+
}
|
|
6528
|
+
return {};
|
|
6462
6529
|
}
|
|
6463
6530
|
compileFull(node, analysis) {
|
|
6464
6531
|
return this.compile(compileNgFactoryDefField, (meta) => compileInjectable(meta, false), compileClassMetadata4, node, analysis);
|
|
@@ -6545,7 +6612,7 @@ function extractInjectableCtorDeps(clazz, meta, decorator, reflector, isCore, st
|
|
|
6545
6612
|
}
|
|
6546
6613
|
let ctorDeps = null;
|
|
6547
6614
|
if (decorator.args.length === 0) {
|
|
6548
|
-
if (strictCtorDeps) {
|
|
6615
|
+
if (strictCtorDeps && !isAbstractClassDeclaration(clazz)) {
|
|
6549
6616
|
ctorDeps = getValidConstructorDependencies(clazz, reflector, isCore);
|
|
6550
6617
|
} else {
|
|
6551
6618
|
ctorDeps = unwrapConstructorDependencies(getConstructorDependencies(clazz, reflector, isCore));
|
|
@@ -6553,7 +6620,7 @@ function extractInjectableCtorDeps(clazz, meta, decorator, reflector, isCore, st
|
|
|
6553
6620
|
return ctorDeps;
|
|
6554
6621
|
} else if (decorator.args.length === 1) {
|
|
6555
6622
|
const rawCtorDeps = getConstructorDependencies(clazz, reflector, isCore);
|
|
6556
|
-
if (strictCtorDeps &&
|
|
6623
|
+
if (strictCtorDeps && !isAbstractClassDeclaration(clazz) && requiresValidCtor(meta)) {
|
|
6557
6624
|
ctorDeps = validateConstructorDependencies(clazz, rawCtorDeps);
|
|
6558
6625
|
} else {
|
|
6559
6626
|
ctorDeps = unwrapConstructorDependencies(rawCtorDeps);
|
|
@@ -6561,6 +6628,9 @@ function extractInjectableCtorDeps(clazz, meta, decorator, reflector, isCore, st
|
|
|
6561
6628
|
}
|
|
6562
6629
|
return ctorDeps;
|
|
6563
6630
|
}
|
|
6631
|
+
function requiresValidCtor(meta) {
|
|
6632
|
+
return meta.useValue === void 0 && meta.useExisting === void 0 && meta.useClass === void 0 && meta.useFactory === void 0;
|
|
6633
|
+
}
|
|
6564
6634
|
function getDep(dep, reflector) {
|
|
6565
6635
|
const meta = {
|
|
6566
6636
|
token: new WrappedNodeExpr8(dep),
|
|
@@ -6612,7 +6682,7 @@ function getDep(dep, reflector) {
|
|
|
6612
6682
|
return meta;
|
|
6613
6683
|
}
|
|
6614
6684
|
|
|
6615
|
-
// bazel-out/
|
|
6685
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
|
|
6616
6686
|
import { compileClassMetadata as compileClassMetadata5, compileDeclareClassMetadata as compileDeclareClassMetadata5, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5, WrappedNodeExpr as WrappedNodeExpr9 } from "@angular/compiler";
|
|
6617
6687
|
import ts26 from "typescript";
|
|
6618
6688
|
var PipeSymbol = class extends SemanticSymbol {
|
|
@@ -6731,7 +6801,9 @@ var PipeDecoratorHandler = class {
|
|
|
6731
6801
|
isStandalone: analysis.meta.isStandalone,
|
|
6732
6802
|
decorator: analysis.decorator
|
|
6733
6803
|
});
|
|
6734
|
-
this.injectableRegistry.registerInjectable(node
|
|
6804
|
+
this.injectableRegistry.registerInjectable(node, {
|
|
6805
|
+
ctorDeps: analysis.meta.deps
|
|
6806
|
+
});
|
|
6735
6807
|
}
|
|
6736
6808
|
resolve(node) {
|
|
6737
6809
|
const duplicateDeclData = this.scopeRegistry.getDuplicateDeclarations(node);
|
|
@@ -6762,16 +6834,16 @@ export {
|
|
|
6762
6834
|
DynamicValue,
|
|
6763
6835
|
StaticInterpreter,
|
|
6764
6836
|
PartialEvaluator,
|
|
6765
|
-
NoopReferencesRegistry,
|
|
6766
|
-
SemanticDepGraphUpdater,
|
|
6767
6837
|
MetaKind,
|
|
6768
6838
|
CompoundMetadataReader,
|
|
6769
6839
|
DtsMetadataReader,
|
|
6770
6840
|
LocalMetadataRegistry,
|
|
6771
6841
|
CompoundMetadataRegistry,
|
|
6772
|
-
InjectableClassRegistry,
|
|
6773
6842
|
ResourceRegistry,
|
|
6774
6843
|
HostDirectivesResolver,
|
|
6844
|
+
InjectableClassRegistry,
|
|
6845
|
+
NoopReferencesRegistry,
|
|
6846
|
+
SemanticDepGraphUpdater,
|
|
6775
6847
|
ComponentScopeKind,
|
|
6776
6848
|
CompoundComponentScopeReader,
|
|
6777
6849
|
MetadataDtsModuleScopeResolver,
|
|
@@ -6805,4 +6877,4 @@ export {
|
|
|
6805
6877
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6806
6878
|
* found in the LICENSE file at https://angular.io/license
|
|
6807
6879
|
*/
|
|
6808
|
-
//# sourceMappingURL=chunk-
|
|
6880
|
+
//# sourceMappingURL=chunk-R4GD76QD.js.map
|