@angular/compiler-cli 13.1.2 → 13.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/{chunk-O4XVCXRT.js → chunk-7UHLQOIO.js} +4 -4
- package/bundles/{chunk-O4XVCXRT.js.map → chunk-7UHLQOIO.js.map} +0 -0
- package/bundles/{chunk-QDWL7SZJ.js → chunk-BPCUCINV.js} +2 -2
- package/bundles/{chunk-QDWL7SZJ.js.map → chunk-BPCUCINV.js.map} +0 -0
- package/bundles/{chunk-TUNE6DP3.js → chunk-CKZCKW5B.js} +437 -831
- package/bundles/chunk-CKZCKW5B.js.map +6 -0
- package/bundles/{chunk-GLCRIILX.js → chunk-J6CW3T62.js} +5 -5
- package/bundles/{chunk-GLCRIILX.js.map → chunk-J6CW3T62.js.map} +0 -0
- package/bundles/{chunk-SKBLJA43.js → chunk-JTYUTYS2.js} +3 -3
- package/bundles/{chunk-SKBLJA43.js.map → chunk-JTYUTYS2.js.map} +0 -0
- package/bundles/{chunk-6VRWTEQB.js → chunk-K5FPDA5B.js} +40 -40
- package/bundles/{chunk-6VRWTEQB.js.map → chunk-K5FPDA5B.js.map} +0 -0
- package/bundles/{chunk-UESD6FVI.js → chunk-KU4D2JVX.js} +31 -31
- package/bundles/{chunk-UESD6FVI.js.map → chunk-KU4D2JVX.js.map} +0 -0
- package/bundles/{chunk-JOLPJ2E4.js → chunk-KXVQ4SSM.js} +5 -5
- package/bundles/{chunk-JOLPJ2E4.js.map → chunk-KXVQ4SSM.js.map} +0 -0
- package/bundles/{chunk-FUZ3CSDO.js → chunk-L23I4NJT.js} +577 -163
- package/bundles/chunk-L23I4NJT.js.map +6 -0
- package/bundles/{chunk-ADHVDA4A.js → chunk-RDTZZXLZ.js} +7 -7
- package/bundles/{chunk-ADHVDA4A.js.map → chunk-RDTZZXLZ.js.map} +0 -0
- package/bundles/{chunk-676MI6WZ.js → chunk-RGGJJ7ZZ.js} +7 -7
- package/bundles/{chunk-676MI6WZ.js.map → chunk-RGGJJ7ZZ.js.map} +0 -0
- package/bundles/{chunk-A5PL3TE6.js → chunk-RNVIUKDY.js} +6 -6
- package/bundles/{chunk-A5PL3TE6.js.map → chunk-RNVIUKDY.js.map} +0 -0
- package/bundles/{chunk-QBU7RUKB.js → chunk-VUEDWBJP.js} +26 -26
- package/bundles/{chunk-QBU7RUKB.js.map → chunk-VUEDWBJP.js.map} +0 -0
- package/bundles/{chunk-7PY7XEFH.js → chunk-XXMNTCYN.js} +6 -6
- package/bundles/{chunk-7PY7XEFH.js.map → chunk-XXMNTCYN.js.map} +0 -0
- package/bundles/{chunk-5TY44ZS3.js → chunk-ZLL7BXGD.js} +194 -147
- package/bundles/{chunk-5TY44ZS3.js.map → chunk-ZLL7BXGD.js.map} +2 -2
- package/bundles/index.js +14 -13
- package/bundles/index.js.map +1 -1
- package/bundles/linker/babel/index.js +12 -12
- package/bundles/linker/index.js +4 -4
- package/bundles/ngcc/index.js +12 -12
- package/bundles/ngcc/main-ngcc.js +13 -13
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +13 -13
- 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 +5 -5
- package/bundles/private/tooling.js +2 -2
- package/bundles/src/bin/ng_xi18n.js +10 -10
- package/bundles/src/bin/ngc.js +8 -8
- package/bundles_metadata.json +1 -1
- package/ngcc/src/packages/adjust_cjs_umd_exports.d.ts +17 -0
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/ngcc/src/packages/source_file_cache.d.ts +2 -1
- package/package.json +2 -2
- package/bundles/chunk-FUZ3CSDO.js.map +0 -6
- package/bundles/chunk-TUNE6DP3.js.map +0 -6
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
reflectObjectLiteral,
|
|
14
14
|
reflectTypeEntityToDeclaration,
|
|
15
15
|
typeNodeToValueExpr
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XXMNTCYN.js";
|
|
17
17
|
import {
|
|
18
18
|
ErrorCode,
|
|
19
19
|
FatalDiagnosticError,
|
|
@@ -27,28 +27,31 @@ import {
|
|
|
27
27
|
getSourceFile,
|
|
28
28
|
identifierOfNode,
|
|
29
29
|
isDeclaration,
|
|
30
|
+
isDtsPath,
|
|
31
|
+
isNonDeclarationTsPath,
|
|
30
32
|
makeDiagnostic,
|
|
31
33
|
makeRelatedInformation,
|
|
32
34
|
nodeDebugInfo,
|
|
33
35
|
translateExpression,
|
|
34
36
|
translateStatement,
|
|
35
37
|
translateType
|
|
36
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-VUEDWBJP.js";
|
|
37
39
|
import {
|
|
38
40
|
absoluteFrom,
|
|
39
41
|
absoluteFromSourceFile,
|
|
42
|
+
basename,
|
|
40
43
|
relative
|
|
41
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-RGGJJ7ZZ.js";
|
|
42
45
|
import {
|
|
43
46
|
PerfEvent,
|
|
44
47
|
PerfPhase
|
|
45
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-J6CW3T62.js";
|
|
46
49
|
import {
|
|
47
50
|
__spreadProps,
|
|
48
51
|
__spreadValues
|
|
49
52
|
} from "./chunk-WQ3TNYTD.js";
|
|
50
53
|
|
|
51
|
-
// bazel-out/
|
|
54
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/dynamic.mjs
|
|
52
55
|
var DynamicValue = class {
|
|
53
56
|
constructor(node, reason, code) {
|
|
54
57
|
this.node = node;
|
|
@@ -133,10 +136,10 @@ var DynamicValue = class {
|
|
|
133
136
|
}
|
|
134
137
|
};
|
|
135
138
|
|
|
136
|
-
// bazel-out/
|
|
139
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
137
140
|
import ts from "typescript";
|
|
138
141
|
|
|
139
|
-
// bazel-out/
|
|
142
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/result.mjs
|
|
140
143
|
var ResolvedModule = class {
|
|
141
144
|
constructor(exports, evaluate) {
|
|
142
145
|
this.exports = exports;
|
|
@@ -166,7 +169,7 @@ var EnumValue = class {
|
|
|
166
169
|
var KnownFn = class {
|
|
167
170
|
};
|
|
168
171
|
|
|
169
|
-
// bazel-out/
|
|
172
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/builtin.mjs
|
|
170
173
|
var ArraySliceBuiltinFn = class extends KnownFn {
|
|
171
174
|
constructor(lhs) {
|
|
172
175
|
super();
|
|
@@ -237,7 +240,7 @@ var ObjectAssignBuiltinFn = class extends KnownFn {
|
|
|
237
240
|
}
|
|
238
241
|
};
|
|
239
242
|
|
|
240
|
-
// bazel-out/
|
|
243
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/ts_helpers.mjs
|
|
241
244
|
var AssignHelperFn = class extends ObjectAssignBuiltinFn {
|
|
242
245
|
};
|
|
243
246
|
var SpreadHelperFn = class extends KnownFn {
|
|
@@ -290,7 +293,7 @@ var ReadHelperFn = class extends KnownFn {
|
|
|
290
293
|
}
|
|
291
294
|
};
|
|
292
295
|
|
|
293
|
-
// bazel-out/
|
|
296
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/known_declaration.mjs
|
|
294
297
|
var jsGlobalObjectValue = /* @__PURE__ */ new Map([["assign", new ObjectAssignBuiltinFn()]]);
|
|
295
298
|
var assignTsHelperFn = new AssignHelperFn();
|
|
296
299
|
var spreadTsHelperFn = new SpreadHelperFn();
|
|
@@ -314,7 +317,7 @@ function resolveKnownDeclaration(decl) {
|
|
|
314
317
|
}
|
|
315
318
|
}
|
|
316
319
|
|
|
317
|
-
// bazel-out/
|
|
320
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
318
321
|
function literalBinaryOp(op) {
|
|
319
322
|
return { op, literal: true };
|
|
320
323
|
}
|
|
@@ -901,7 +904,7 @@ function owningModule(context, override = null) {
|
|
|
901
904
|
}
|
|
902
905
|
}
|
|
903
906
|
|
|
904
|
-
// bazel-out/
|
|
907
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interface.mjs
|
|
905
908
|
var PartialEvaluator = class {
|
|
906
909
|
constructor(host, checker, dependencyTracker) {
|
|
907
910
|
this.host = host;
|
|
@@ -921,7 +924,7 @@ var PartialEvaluator = class {
|
|
|
921
924
|
}
|
|
922
925
|
};
|
|
923
926
|
|
|
924
|
-
// bazel-out/
|
|
927
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
|
|
925
928
|
import ts2 from "typescript";
|
|
926
929
|
function describeResolvedType(value, maxDepth = 1) {
|
|
927
930
|
var _a, _b;
|
|
@@ -1048,7 +1051,7 @@ function getContainerNode(node) {
|
|
|
1048
1051
|
return node.getSourceFile();
|
|
1049
1052
|
}
|
|
1050
1053
|
|
|
1051
|
-
// bazel-out/
|
|
1054
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/util.mjs
|
|
1052
1055
|
import { ExternalExpr, LiteralExpr, ParseLocation, ParseSourceFile, ParseSourceSpan, ReadPropExpr, WrappedNodeExpr } from "@angular/compiler";
|
|
1053
1056
|
import ts3 from "typescript";
|
|
1054
1057
|
function getConstructorDependencies(clazz, reflector, isCore) {
|
|
@@ -1412,11 +1415,11 @@ function toFactoryMetadata(meta, target) {
|
|
|
1412
1415
|
};
|
|
1413
1416
|
}
|
|
1414
1417
|
|
|
1415
|
-
// bazel-out/
|
|
1418
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/component.mjs
|
|
1416
1419
|
import { compileClassMetadata as compileClassMetadata3, compileComponentFromMetadata, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareComponentFromMetadata, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DomElementSchemaRegistry, ExternalExpr as ExternalExpr5, FactoryTarget as FactoryTarget3, InterpolationConfig, makeBindingParser as makeBindingParser2, ParseSourceFile as ParseSourceFile2, parseTemplate, R3TargetBinder, SelectorMatcher, ViewEncapsulation, WrappedNodeExpr as WrappedNodeExpr5 } from "@angular/compiler";
|
|
1417
|
-
import
|
|
1420
|
+
import ts21 from "typescript";
|
|
1418
1421
|
|
|
1419
|
-
// bazel-out/
|
|
1422
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
1420
1423
|
import ts4 from "typescript";
|
|
1421
1424
|
var SemanticSymbol = class {
|
|
1422
1425
|
constructor(decl) {
|
|
@@ -1432,7 +1435,7 @@ function getSymbolIdentifier(decl) {
|
|
|
1432
1435
|
return decl.name.text;
|
|
1433
1436
|
}
|
|
1434
1437
|
|
|
1435
|
-
// bazel-out/
|
|
1438
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/graph.mjs
|
|
1436
1439
|
import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
|
|
1437
1440
|
var OpaqueSymbol = class extends SemanticSymbol {
|
|
1438
1441
|
isPublicApiAffected() {
|
|
@@ -1575,10 +1578,10 @@ function getImportPath(expr) {
|
|
|
1575
1578
|
}
|
|
1576
1579
|
}
|
|
1577
1580
|
|
|
1578
|
-
// bazel-out/
|
|
1581
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
1579
1582
|
import ts5 from "typescript";
|
|
1580
1583
|
|
|
1581
|
-
// bazel-out/
|
|
1584
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/util.mjs
|
|
1582
1585
|
function isSymbolEqual(a, b) {
|
|
1583
1586
|
if (a.decl === b.decl) {
|
|
1584
1587
|
return true;
|
|
@@ -1628,7 +1631,7 @@ function isSetEqual(a, b, equalityTester = referenceEquality) {
|
|
|
1628
1631
|
return true;
|
|
1629
1632
|
}
|
|
1630
1633
|
|
|
1631
|
-
// bazel-out/
|
|
1634
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
1632
1635
|
function extractSemanticTypeParameters(node) {
|
|
1633
1636
|
if (!ts5.isClassDeclaration(node) || node.typeParameters === void 0) {
|
|
1634
1637
|
return null;
|
|
@@ -1648,17 +1651,17 @@ function isTypeParameterEqual(a, b) {
|
|
|
1648
1651
|
return a.hasGenericTypeBound === b.hasGenericTypeBound;
|
|
1649
1652
|
}
|
|
1650
1653
|
|
|
1651
|
-
// bazel-out/
|
|
1654
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/api.mjs
|
|
1652
1655
|
var MetaType;
|
|
1653
1656
|
(function(MetaType2) {
|
|
1654
1657
|
MetaType2[MetaType2["Pipe"] = 0] = "Pipe";
|
|
1655
1658
|
MetaType2[MetaType2["Directive"] = 1] = "Directive";
|
|
1656
1659
|
})(MetaType || (MetaType = {}));
|
|
1657
1660
|
|
|
1658
|
-
// bazel-out/
|
|
1661
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1659
1662
|
import ts7 from "typescript";
|
|
1660
1663
|
|
|
1661
|
-
// bazel-out/
|
|
1664
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/property_mapping.mjs
|
|
1662
1665
|
var ClassPropertyMapping = class {
|
|
1663
1666
|
constructor(forwardMap) {
|
|
1664
1667
|
this.forwardMap = forwardMap;
|
|
@@ -1734,7 +1737,7 @@ function reverseMapFromForwardMap(forwardMap) {
|
|
|
1734
1737
|
return reverseMap;
|
|
1735
1738
|
}
|
|
1736
1739
|
|
|
1737
|
-
// bazel-out/
|
|
1740
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/util.mjs
|
|
1738
1741
|
import ts6 from "typescript";
|
|
1739
1742
|
function extractReferencesFromType(checker, def, bestGuessOwningModule) {
|
|
1740
1743
|
if (!ts6.isTupleTypeNode(def)) {
|
|
@@ -1901,7 +1904,7 @@ function hasInjectableFields(clazz, host) {
|
|
|
1901
1904
|
return members.some(({ isStatic, name }) => isStatic && (name === "\u0275prov" || name === "\u0275fac"));
|
|
1902
1905
|
}
|
|
1903
1906
|
|
|
1904
|
-
// bazel-out/
|
|
1907
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1905
1908
|
var DtsMetadataReader = class {
|
|
1906
1909
|
constructor(checker, reflector) {
|
|
1907
1910
|
this.checker = checker;
|
|
@@ -2001,7 +2004,7 @@ function readBaseClass2(clazz, checker, reflector) {
|
|
|
2001
2004
|
return null;
|
|
2002
2005
|
}
|
|
2003
2006
|
|
|
2004
|
-
// bazel-out/
|
|
2007
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/inheritance.mjs
|
|
2005
2008
|
function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
2006
2009
|
const topMeta = reader.getDirectiveMetadata(dir);
|
|
2007
2010
|
if (topMeta === null) {
|
|
@@ -2058,7 +2061,7 @@ function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
|
2058
2061
|
});
|
|
2059
2062
|
}
|
|
2060
2063
|
|
|
2061
|
-
// bazel-out/
|
|
2064
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/registry.mjs
|
|
2062
2065
|
var LocalMetadataRegistry = class {
|
|
2063
2066
|
constructor() {
|
|
2064
2067
|
this.directives = /* @__PURE__ */ new Map();
|
|
@@ -2117,7 +2120,7 @@ var InjectableClassRegistry = class {
|
|
|
2117
2120
|
}
|
|
2118
2121
|
};
|
|
2119
2122
|
|
|
2120
|
-
// bazel-out/
|
|
2123
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/resource_registry.mjs
|
|
2121
2124
|
var ResourceRegistry = class {
|
|
2122
2125
|
constructor() {
|
|
2123
2126
|
this.externalTemplateToComponentsMap = /* @__PURE__ */ new Map();
|
|
@@ -2182,7 +2185,7 @@ var ResourceRegistry = class {
|
|
|
2182
2185
|
}
|
|
2183
2186
|
};
|
|
2184
2187
|
|
|
2185
|
-
// bazel-out/
|
|
2188
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/api.mjs
|
|
2186
2189
|
var CompilationMode;
|
|
2187
2190
|
(function(CompilationMode2) {
|
|
2188
2191
|
CompilationMode2[CompilationMode2["FULL"] = 0] = "FULL";
|
|
@@ -2200,7 +2203,7 @@ var HandlerFlags;
|
|
|
2200
2203
|
HandlerFlags2[HandlerFlags2["FULL_INHERITANCE"] = 1] = "FULL_INHERITANCE";
|
|
2201
2204
|
})(HandlerFlags || (HandlerFlags = {}));
|
|
2202
2205
|
|
|
2203
|
-
// bazel-out/
|
|
2206
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/alias.mjs
|
|
2204
2207
|
import ts8 from "typescript";
|
|
2205
2208
|
function aliasTransformFactory(exportStatements) {
|
|
2206
2209
|
return (context) => {
|
|
@@ -2218,10 +2221,408 @@ function aliasTransformFactory(exportStatements) {
|
|
|
2218
2221
|
};
|
|
2219
2222
|
}
|
|
2220
2223
|
|
|
2221
|
-
// bazel-out/
|
|
2224
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
2225
|
+
import ts12 from "typescript";
|
|
2226
|
+
|
|
2227
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
2222
2228
|
import ts9 from "typescript";
|
|
2223
2229
|
|
|
2224
|
-
// bazel-out/
|
|
2230
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/expando.mjs
|
|
2231
|
+
var NgExtension = Symbol("NgExtension");
|
|
2232
|
+
function isExtended(sf) {
|
|
2233
|
+
return sf[NgExtension] !== void 0;
|
|
2234
|
+
}
|
|
2235
|
+
function sfExtensionData(sf) {
|
|
2236
|
+
const extSf = sf;
|
|
2237
|
+
if (extSf[NgExtension] !== void 0) {
|
|
2238
|
+
return extSf[NgExtension];
|
|
2239
|
+
}
|
|
2240
|
+
const extension = {
|
|
2241
|
+
isTopLevelShim: false,
|
|
2242
|
+
fileShim: null,
|
|
2243
|
+
originalReferencedFiles: null,
|
|
2244
|
+
taggedReferenceFiles: null
|
|
2245
|
+
};
|
|
2246
|
+
extSf[NgExtension] = extension;
|
|
2247
|
+
return extension;
|
|
2248
|
+
}
|
|
2249
|
+
function isFileShimSourceFile(sf) {
|
|
2250
|
+
return isExtended(sf) && sf[NgExtension].fileShim !== null;
|
|
2251
|
+
}
|
|
2252
|
+
function isShim(sf) {
|
|
2253
|
+
return isExtended(sf) && (sf[NgExtension].fileShim !== null || sf[NgExtension].isTopLevelShim);
|
|
2254
|
+
}
|
|
2255
|
+
function copyFileShimData(from, to) {
|
|
2256
|
+
if (!isFileShimSourceFile(from)) {
|
|
2257
|
+
return;
|
|
2258
|
+
}
|
|
2259
|
+
sfExtensionData(to).fileShim = sfExtensionData(from).fileShim;
|
|
2260
|
+
}
|
|
2261
|
+
function untagAllTsFiles(program) {
|
|
2262
|
+
for (const sf of program.getSourceFiles()) {
|
|
2263
|
+
untagTsFile(sf);
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
function retagAllTsFiles(program) {
|
|
2267
|
+
for (const sf of program.getSourceFiles()) {
|
|
2268
|
+
retagTsFile(sf);
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
function untagTsFile(sf) {
|
|
2272
|
+
if (sf.isDeclarationFile || !isExtended(sf)) {
|
|
2273
|
+
return;
|
|
2274
|
+
}
|
|
2275
|
+
const ext = sfExtensionData(sf);
|
|
2276
|
+
if (ext.originalReferencedFiles !== null) {
|
|
2277
|
+
sf.referencedFiles = ext.originalReferencedFiles;
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
function retagTsFile(sf) {
|
|
2281
|
+
if (sf.isDeclarationFile || !isExtended(sf)) {
|
|
2282
|
+
return;
|
|
2283
|
+
}
|
|
2284
|
+
const ext = sfExtensionData(sf);
|
|
2285
|
+
if (ext.taggedReferenceFiles !== null) {
|
|
2286
|
+
sf.referencedFiles = ext.taggedReferenceFiles;
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/util.mjs
|
|
2291
|
+
var TS_EXTENSIONS = /\.tsx?$/i;
|
|
2292
|
+
function makeShimFileName(fileName, suffix) {
|
|
2293
|
+
return absoluteFrom(fileName.replace(TS_EXTENSIONS, suffix));
|
|
2294
|
+
}
|
|
2295
|
+
function generatedModuleName(originalModuleName, originalFileName, genSuffix) {
|
|
2296
|
+
let moduleName;
|
|
2297
|
+
if (originalFileName.endsWith("/index.ts")) {
|
|
2298
|
+
moduleName = originalModuleName + "/index" + genSuffix;
|
|
2299
|
+
} else {
|
|
2300
|
+
moduleName = originalModuleName + genSuffix;
|
|
2301
|
+
}
|
|
2302
|
+
return moduleName;
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
2306
|
+
var ShimAdapter = class {
|
|
2307
|
+
constructor(delegate, tsRootFiles, topLevelGenerators, perFileGenerators, oldProgram) {
|
|
2308
|
+
this.delegate = delegate;
|
|
2309
|
+
this.shims = /* @__PURE__ */ new Map();
|
|
2310
|
+
this.priorShims = /* @__PURE__ */ new Map();
|
|
2311
|
+
this.notShims = /* @__PURE__ */ new Set();
|
|
2312
|
+
this.generators = [];
|
|
2313
|
+
this.ignoreForEmit = /* @__PURE__ */ new Set();
|
|
2314
|
+
this.extensionPrefixes = [];
|
|
2315
|
+
for (const gen of perFileGenerators) {
|
|
2316
|
+
const pattern = `^(.*)\\.${gen.extensionPrefix}\\.ts$`;
|
|
2317
|
+
const regexp = new RegExp(pattern, "i");
|
|
2318
|
+
this.generators.push({
|
|
2319
|
+
generator: gen,
|
|
2320
|
+
test: regexp,
|
|
2321
|
+
suffix: `.${gen.extensionPrefix}.ts`
|
|
2322
|
+
});
|
|
2323
|
+
this.extensionPrefixes.push(gen.extensionPrefix);
|
|
2324
|
+
}
|
|
2325
|
+
const extraInputFiles = [];
|
|
2326
|
+
for (const gen of topLevelGenerators) {
|
|
2327
|
+
const sf = gen.makeTopLevelShim();
|
|
2328
|
+
sfExtensionData(sf).isTopLevelShim = true;
|
|
2329
|
+
if (!gen.shouldEmit) {
|
|
2330
|
+
this.ignoreForEmit.add(sf);
|
|
2331
|
+
}
|
|
2332
|
+
const fileName = absoluteFromSourceFile(sf);
|
|
2333
|
+
this.shims.set(fileName, sf);
|
|
2334
|
+
extraInputFiles.push(fileName);
|
|
2335
|
+
}
|
|
2336
|
+
for (const rootFile of tsRootFiles) {
|
|
2337
|
+
for (const gen of this.generators) {
|
|
2338
|
+
extraInputFiles.push(makeShimFileName(rootFile, gen.suffix));
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
this.extraInputFiles = extraInputFiles;
|
|
2342
|
+
if (oldProgram !== null) {
|
|
2343
|
+
for (const oldSf of oldProgram.getSourceFiles()) {
|
|
2344
|
+
if (oldSf.isDeclarationFile || !isFileShimSourceFile(oldSf)) {
|
|
2345
|
+
continue;
|
|
2346
|
+
}
|
|
2347
|
+
this.priorShims.set(absoluteFromSourceFile(oldSf), oldSf);
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
maybeGenerate(fileName) {
|
|
2352
|
+
if (this.notShims.has(fileName)) {
|
|
2353
|
+
return null;
|
|
2354
|
+
} else if (this.shims.has(fileName)) {
|
|
2355
|
+
return this.shims.get(fileName);
|
|
2356
|
+
}
|
|
2357
|
+
if (isDtsPath(fileName)) {
|
|
2358
|
+
this.notShims.add(fileName);
|
|
2359
|
+
return null;
|
|
2360
|
+
}
|
|
2361
|
+
for (const record of this.generators) {
|
|
2362
|
+
const match = record.test.exec(fileName);
|
|
2363
|
+
if (match === null) {
|
|
2364
|
+
continue;
|
|
2365
|
+
}
|
|
2366
|
+
const prefix = match[1];
|
|
2367
|
+
let baseFileName = absoluteFrom(prefix + ".ts");
|
|
2368
|
+
if (!this.delegate.fileExists(baseFileName)) {
|
|
2369
|
+
baseFileName = absoluteFrom(prefix + ".tsx");
|
|
2370
|
+
if (!this.delegate.fileExists(baseFileName)) {
|
|
2371
|
+
return void 0;
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
const inputFile = this.delegate.getSourceFile(baseFileName, ts9.ScriptTarget.Latest);
|
|
2375
|
+
if (inputFile === void 0 || isShim(inputFile)) {
|
|
2376
|
+
return void 0;
|
|
2377
|
+
}
|
|
2378
|
+
return this.generateSpecific(fileName, record.generator, inputFile);
|
|
2379
|
+
}
|
|
2380
|
+
this.notShims.add(fileName);
|
|
2381
|
+
return null;
|
|
2382
|
+
}
|
|
2383
|
+
generateSpecific(fileName, generator, inputFile) {
|
|
2384
|
+
let priorShimSf = null;
|
|
2385
|
+
if (this.priorShims.has(fileName)) {
|
|
2386
|
+
priorShimSf = this.priorShims.get(fileName);
|
|
2387
|
+
this.priorShims.delete(fileName);
|
|
2388
|
+
}
|
|
2389
|
+
const shimSf = generator.generateShimForFile(inputFile, fileName, priorShimSf);
|
|
2390
|
+
sfExtensionData(shimSf).fileShim = {
|
|
2391
|
+
extension: generator.extensionPrefix,
|
|
2392
|
+
generatedFrom: absoluteFromSourceFile(inputFile)
|
|
2393
|
+
};
|
|
2394
|
+
if (!generator.shouldEmit) {
|
|
2395
|
+
this.ignoreForEmit.add(shimSf);
|
|
2396
|
+
}
|
|
2397
|
+
this.shims.set(fileName, shimSf);
|
|
2398
|
+
return shimSf;
|
|
2399
|
+
}
|
|
2400
|
+
};
|
|
2401
|
+
|
|
2402
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/factory_generator.mjs
|
|
2403
|
+
import ts10 from "typescript";
|
|
2404
|
+
var TS_DTS_SUFFIX = /(\.d)?\.ts$/;
|
|
2405
|
+
var STRIP_NG_FACTORY = /(.*)NgFactory$/;
|
|
2406
|
+
var FactoryGenerator = class {
|
|
2407
|
+
constructor() {
|
|
2408
|
+
this.sourceInfo = /* @__PURE__ */ new Map();
|
|
2409
|
+
this.sourceToFactorySymbols = /* @__PURE__ */ new Map();
|
|
2410
|
+
this.shouldEmit = true;
|
|
2411
|
+
this.extensionPrefix = "ngfactory";
|
|
2412
|
+
}
|
|
2413
|
+
generateShimForFile(sf, genFilePath) {
|
|
2414
|
+
const absoluteSfPath = absoluteFromSourceFile(sf);
|
|
2415
|
+
const relativePathToSource = "./" + basename(sf.fileName).replace(TS_DTS_SUFFIX, "");
|
|
2416
|
+
const symbolNames = sf.statements.filter(ts10.isClassDeclaration).filter((decl) => isExported(decl) && decl.decorators !== void 0 && decl.name !== void 0).map((decl) => decl.name.text);
|
|
2417
|
+
let sourceText = "";
|
|
2418
|
+
const leadingComment = getFileoverviewComment(sf);
|
|
2419
|
+
if (leadingComment !== null) {
|
|
2420
|
+
sourceText = leadingComment + "\n\n";
|
|
2421
|
+
}
|
|
2422
|
+
if (symbolNames.length > 0) {
|
|
2423
|
+
const varLines = symbolNames.map((name) => `export const ${name}NgFactory: i0.\u0275NgModuleFactory<any> = new i0.\u0275NgModuleFactory(${name});`);
|
|
2424
|
+
sourceText += [
|
|
2425
|
+
`import * as i0 from '@angular/core';`,
|
|
2426
|
+
`import {${symbolNames.join(", ")}} from '${relativePathToSource}';`,
|
|
2427
|
+
...varLines
|
|
2428
|
+
].join("\n");
|
|
2429
|
+
}
|
|
2430
|
+
sourceText += "\nexport const \u0275NonEmptyModule = true;";
|
|
2431
|
+
const genFile = ts10.createSourceFile(genFilePath, sourceText, sf.languageVersion, true, ts10.ScriptKind.TS);
|
|
2432
|
+
if (sf.moduleName !== void 0) {
|
|
2433
|
+
genFile.moduleName = generatedModuleName(sf.moduleName, sf.fileName, ".ngfactory");
|
|
2434
|
+
}
|
|
2435
|
+
const moduleSymbols = /* @__PURE__ */ new Map();
|
|
2436
|
+
this.sourceToFactorySymbols.set(absoluteSfPath, moduleSymbols);
|
|
2437
|
+
this.sourceInfo.set(genFilePath, {
|
|
2438
|
+
sourceFilePath: absoluteSfPath,
|
|
2439
|
+
moduleSymbols
|
|
2440
|
+
});
|
|
2441
|
+
return genFile;
|
|
2442
|
+
}
|
|
2443
|
+
track(sf, moduleInfo) {
|
|
2444
|
+
if (this.sourceToFactorySymbols.has(sf.fileName)) {
|
|
2445
|
+
this.sourceToFactorySymbols.get(sf.fileName).set(moduleInfo.name, moduleInfo);
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
};
|
|
2449
|
+
function isExported(decl) {
|
|
2450
|
+
return decl.modifiers !== void 0 && decl.modifiers.some((mod) => mod.kind == ts10.SyntaxKind.ExportKeyword);
|
|
2451
|
+
}
|
|
2452
|
+
function generatedFactoryTransform(factoryMap, importRewriter) {
|
|
2453
|
+
return (context) => {
|
|
2454
|
+
return (file) => {
|
|
2455
|
+
return transformFactorySourceFile(factoryMap, context, importRewriter, file);
|
|
2456
|
+
};
|
|
2457
|
+
};
|
|
2458
|
+
}
|
|
2459
|
+
function transformFactorySourceFile(factoryMap, context, importRewriter, file) {
|
|
2460
|
+
if (!factoryMap.has(file.fileName)) {
|
|
2461
|
+
return file;
|
|
2462
|
+
}
|
|
2463
|
+
const { moduleSymbols, sourceFilePath } = factoryMap.get(file.fileName);
|
|
2464
|
+
const transformedStatements = [];
|
|
2465
|
+
let nonEmptyExport = null;
|
|
2466
|
+
const coreImportIdentifiers = /* @__PURE__ */ new Set();
|
|
2467
|
+
for (const stmt of file.statements) {
|
|
2468
|
+
if (ts10.isImportDeclaration(stmt) && ts10.isStringLiteral(stmt.moduleSpecifier) && stmt.moduleSpecifier.text === "@angular/core") {
|
|
2469
|
+
const rewrittenModuleSpecifier = importRewriter.rewriteSpecifier("@angular/core", sourceFilePath);
|
|
2470
|
+
if (rewrittenModuleSpecifier !== stmt.moduleSpecifier.text) {
|
|
2471
|
+
transformedStatements.push(ts10.updateImportDeclaration(stmt, stmt.decorators, stmt.modifiers, stmt.importClause, ts10.createStringLiteral(rewrittenModuleSpecifier), void 0));
|
|
2472
|
+
if (stmt.importClause !== void 0 && stmt.importClause.namedBindings !== void 0 && ts10.isNamespaceImport(stmt.importClause.namedBindings)) {
|
|
2473
|
+
coreImportIdentifiers.add(stmt.importClause.namedBindings.name.text);
|
|
2474
|
+
}
|
|
2475
|
+
} else {
|
|
2476
|
+
transformedStatements.push(stmt);
|
|
2477
|
+
}
|
|
2478
|
+
} else if (ts10.isVariableStatement(stmt) && stmt.declarationList.declarations.length === 1) {
|
|
2479
|
+
const decl = stmt.declarationList.declarations[0];
|
|
2480
|
+
if (ts10.isIdentifier(decl.name)) {
|
|
2481
|
+
if (decl.name.text === "\u0275NonEmptyModule") {
|
|
2482
|
+
nonEmptyExport = stmt;
|
|
2483
|
+
continue;
|
|
2484
|
+
}
|
|
2485
|
+
const match = STRIP_NG_FACTORY.exec(decl.name.text);
|
|
2486
|
+
const module = match ? moduleSymbols.get(match[1]) : null;
|
|
2487
|
+
if (module) {
|
|
2488
|
+
const moduleIsTreeShakable = !module.hasId;
|
|
2489
|
+
const newStmt = !moduleIsTreeShakable ? stmt : updateInitializers(stmt, (init) => init ? wrapInNoSideEffects(init) : void 0);
|
|
2490
|
+
transformedStatements.push(newStmt);
|
|
2491
|
+
}
|
|
2492
|
+
} else {
|
|
2493
|
+
transformedStatements.push(stmt);
|
|
2494
|
+
}
|
|
2495
|
+
} else {
|
|
2496
|
+
transformedStatements.push(stmt);
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
if (!transformedStatements.some(ts10.isVariableStatement) && nonEmptyExport !== null) {
|
|
2500
|
+
transformedStatements.push(nonEmptyExport);
|
|
2501
|
+
}
|
|
2502
|
+
file = ts10.updateSourceFileNode(file, transformedStatements);
|
|
2503
|
+
if (coreImportIdentifiers.size > 0) {
|
|
2504
|
+
const visit2 = (node) => {
|
|
2505
|
+
node = ts10.visitEachChild(node, (child) => visit2(child), context);
|
|
2506
|
+
if (ts10.isPropertyAccessExpression(node) && ts10.isIdentifier(node.expression) && coreImportIdentifiers.has(node.expression.text)) {
|
|
2507
|
+
const rewrittenSymbol = importRewriter.rewriteSymbol(node.name.text, "@angular/core");
|
|
2508
|
+
if (rewrittenSymbol !== node.name.text) {
|
|
2509
|
+
const updated = ts10.updatePropertyAccess(node, node.expression, ts10.createIdentifier(rewrittenSymbol));
|
|
2510
|
+
node = updated;
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2513
|
+
return node;
|
|
2514
|
+
};
|
|
2515
|
+
file = visit2(file);
|
|
2516
|
+
}
|
|
2517
|
+
return file;
|
|
2518
|
+
}
|
|
2519
|
+
function getFileoverviewComment(sourceFile) {
|
|
2520
|
+
const text = sourceFile.getFullText();
|
|
2521
|
+
const trivia = text.substring(0, sourceFile.getStart());
|
|
2522
|
+
const leadingComments = ts10.getLeadingCommentRanges(trivia, 0);
|
|
2523
|
+
if (!leadingComments || leadingComments.length === 0) {
|
|
2524
|
+
return null;
|
|
2525
|
+
}
|
|
2526
|
+
const comment = leadingComments[0];
|
|
2527
|
+
if (comment.kind !== ts10.SyntaxKind.MultiLineCommentTrivia) {
|
|
2528
|
+
return null;
|
|
2529
|
+
}
|
|
2530
|
+
if (text.substring(comment.end, comment.end + 2) !== "\n\n") {
|
|
2531
|
+
return null;
|
|
2532
|
+
}
|
|
2533
|
+
const commentText = text.substring(comment.pos, comment.end);
|
|
2534
|
+
if (commentText.indexOf("@license") !== -1) {
|
|
2535
|
+
return null;
|
|
2536
|
+
}
|
|
2537
|
+
return commentText;
|
|
2538
|
+
}
|
|
2539
|
+
function wrapInNoSideEffects(expr) {
|
|
2540
|
+
const noSideEffects = ts10.createPropertyAccess(ts10.createIdentifier("i0"), "\u0275noSideEffects");
|
|
2541
|
+
return ts10.createCall(noSideEffects, [], [
|
|
2542
|
+
ts10.createFunctionExpression([], void 0, void 0, [], [], void 0, ts10.createBlock([
|
|
2543
|
+
ts10.createReturn(expr)
|
|
2544
|
+
]))
|
|
2545
|
+
]);
|
|
2546
|
+
}
|
|
2547
|
+
function updateInitializers(stmt, update) {
|
|
2548
|
+
return ts10.updateVariableStatement(stmt, stmt.modifiers, ts10.updateVariableDeclarationList(stmt.declarationList, stmt.declarationList.declarations.map((decl) => ts10.updateVariableDeclaration(decl, decl.name, decl.type, update(decl.initializer)))));
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/reference_tagger.mjs
|
|
2552
|
+
var ShimReferenceTagger = class {
|
|
2553
|
+
constructor(shimExtensions) {
|
|
2554
|
+
this.tagged = /* @__PURE__ */ new Set();
|
|
2555
|
+
this.enabled = true;
|
|
2556
|
+
this.suffixes = shimExtensions.map((extension) => `.${extension}.ts`);
|
|
2557
|
+
}
|
|
2558
|
+
tag(sf) {
|
|
2559
|
+
if (!this.enabled || sf.isDeclarationFile || isShim(sf) || this.tagged.has(sf) || !isNonDeclarationTsPath(sf.fileName)) {
|
|
2560
|
+
return;
|
|
2561
|
+
}
|
|
2562
|
+
const ext = sfExtensionData(sf);
|
|
2563
|
+
if (ext.originalReferencedFiles === null) {
|
|
2564
|
+
ext.originalReferencedFiles = sf.referencedFiles;
|
|
2565
|
+
}
|
|
2566
|
+
const referencedFiles = [...ext.originalReferencedFiles];
|
|
2567
|
+
const sfPath = absoluteFromSourceFile(sf);
|
|
2568
|
+
for (const suffix of this.suffixes) {
|
|
2569
|
+
referencedFiles.push({
|
|
2570
|
+
fileName: makeShimFileName(sfPath, suffix),
|
|
2571
|
+
pos: 0,
|
|
2572
|
+
end: 0
|
|
2573
|
+
});
|
|
2574
|
+
}
|
|
2575
|
+
ext.taggedReferenceFiles = referencedFiles;
|
|
2576
|
+
sf.referencedFiles = referencedFiles;
|
|
2577
|
+
this.tagged.add(sf);
|
|
2578
|
+
}
|
|
2579
|
+
finalize() {
|
|
2580
|
+
this.enabled = false;
|
|
2581
|
+
this.tagged.clear();
|
|
2582
|
+
}
|
|
2583
|
+
};
|
|
2584
|
+
|
|
2585
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/summary_generator.mjs
|
|
2586
|
+
import ts11 from "typescript";
|
|
2587
|
+
var SummaryGenerator = class {
|
|
2588
|
+
constructor() {
|
|
2589
|
+
this.shouldEmit = true;
|
|
2590
|
+
this.extensionPrefix = "ngsummary";
|
|
2591
|
+
}
|
|
2592
|
+
generateShimForFile(sf, genFilePath) {
|
|
2593
|
+
const symbolNames = [];
|
|
2594
|
+
for (const stmt of sf.statements) {
|
|
2595
|
+
if (ts11.isClassDeclaration(stmt)) {
|
|
2596
|
+
if (!isExported2(stmt) || stmt.decorators === void 0 || stmt.name === void 0) {
|
|
2597
|
+
continue;
|
|
2598
|
+
}
|
|
2599
|
+
symbolNames.push(stmt.name.text);
|
|
2600
|
+
} else if (ts11.isExportDeclaration(stmt)) {
|
|
2601
|
+
if (stmt.exportClause === void 0 || stmt.moduleSpecifier !== void 0 || !ts11.isNamedExports(stmt.exportClause)) {
|
|
2602
|
+
continue;
|
|
2603
|
+
}
|
|
2604
|
+
for (const specifier of stmt.exportClause.elements) {
|
|
2605
|
+
symbolNames.push(specifier.name.text);
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
const varLines = symbolNames.map((name) => `export const ${name}NgSummary: any = null;`);
|
|
2610
|
+
if (varLines.length === 0) {
|
|
2611
|
+
varLines.push(`export const \u0275empty = null;`);
|
|
2612
|
+
}
|
|
2613
|
+
const sourceText = varLines.join("\n");
|
|
2614
|
+
const genFile = ts11.createSourceFile(genFilePath, sourceText, sf.languageVersion, true, ts11.ScriptKind.TS);
|
|
2615
|
+
if (sf.moduleName !== void 0) {
|
|
2616
|
+
genFile.moduleName = generatedModuleName(sf.moduleName, sf.fileName, ".ngsummary");
|
|
2617
|
+
}
|
|
2618
|
+
return genFile;
|
|
2619
|
+
}
|
|
2620
|
+
};
|
|
2621
|
+
function isExported2(decl) {
|
|
2622
|
+
return decl.modifiers !== void 0 && decl.modifiers.some((mod) => mod.kind == ts11.SyntaxKind.ExportKeyword);
|
|
2623
|
+
}
|
|
2624
|
+
|
|
2625
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/trait.mjs
|
|
2225
2626
|
var TraitState;
|
|
2226
2627
|
(function(TraitState2) {
|
|
2227
2628
|
TraitState2[TraitState2["Pending"] = 0] = "Pending";
|
|
@@ -2276,7 +2677,7 @@ var TraitImpl = class {
|
|
|
2276
2677
|
}
|
|
2277
2678
|
};
|
|
2278
2679
|
|
|
2279
|
-
// bazel-out/
|
|
2680
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
2280
2681
|
var TraitCompiler = class {
|
|
2281
2682
|
constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater) {
|
|
2282
2683
|
this.handlers = handlers;
|
|
@@ -2303,7 +2704,7 @@ var TraitCompiler = class {
|
|
|
2303
2704
|
return this.analyze(sf, true);
|
|
2304
2705
|
}
|
|
2305
2706
|
analyze(sf, preanalyze) {
|
|
2306
|
-
if (sf.isDeclarationFile) {
|
|
2707
|
+
if (sf.isDeclarationFile || isShim(sf)) {
|
|
2307
2708
|
return void 0;
|
|
2308
2709
|
}
|
|
2309
2710
|
const promises = [];
|
|
@@ -2324,9 +2725,12 @@ var TraitCompiler = class {
|
|
|
2324
2725
|
if (this.reflector.isClass(node)) {
|
|
2325
2726
|
this.analyzeClass(node, preanalyze ? promises : null);
|
|
2326
2727
|
}
|
|
2327
|
-
|
|
2728
|
+
ts12.forEachChild(node, visit2);
|
|
2328
2729
|
};
|
|
2329
2730
|
visit2(sf);
|
|
2731
|
+
if (!this.fileToClasses.has(sf)) {
|
|
2732
|
+
this.filesWithoutTraits.add(sf);
|
|
2733
|
+
}
|
|
2330
2734
|
if (preanalyze && promises.length > 0) {
|
|
2331
2735
|
return Promise.all(promises).then(() => void 0);
|
|
2332
2736
|
} else {
|
|
@@ -2435,7 +2839,7 @@ var TraitCompiler = class {
|
|
|
2435
2839
|
}
|
|
2436
2840
|
if (isPrimaryHandler && record.hasPrimaryHandler) {
|
|
2437
2841
|
record.metaDiagnostics = [{
|
|
2438
|
-
category:
|
|
2842
|
+
category: ts12.DiagnosticCategory.Error,
|
|
2439
2843
|
code: Number("-99" + ErrorCode.DECORATOR_COLLISION),
|
|
2440
2844
|
file: getSourceFile(clazz),
|
|
2441
2845
|
start: clazz.getStart(void 0, false),
|
|
@@ -2643,7 +3047,7 @@ var TraitCompiler = class {
|
|
|
2643
3047
|
}
|
|
2644
3048
|
}
|
|
2645
3049
|
compile(clazz, constantPool) {
|
|
2646
|
-
const original =
|
|
3050
|
+
const original = ts12.getOriginalNode(clazz);
|
|
2647
3051
|
if (!this.reflector.isClass(clazz) || !this.reflector.isClass(original) || !this.classes.has(original)) {
|
|
2648
3052
|
return null;
|
|
2649
3053
|
}
|
|
@@ -2674,7 +3078,7 @@ var TraitCompiler = class {
|
|
|
2674
3078
|
return res.length > 0 ? res : null;
|
|
2675
3079
|
}
|
|
2676
3080
|
decoratorsFor(node) {
|
|
2677
|
-
const original =
|
|
3081
|
+
const original = ts12.getOriginalNode(node);
|
|
2678
3082
|
if (!this.reflector.isClass(original) || !this.classes.has(original)) {
|
|
2679
3083
|
return [];
|
|
2680
3084
|
}
|
|
@@ -2684,7 +3088,7 @@ var TraitCompiler = class {
|
|
|
2684
3088
|
if (trait.state !== TraitState.Resolved) {
|
|
2685
3089
|
continue;
|
|
2686
3090
|
}
|
|
2687
|
-
if (trait.detected.trigger !== null &&
|
|
3091
|
+
if (trait.detected.trigger !== null && ts12.isDecorator(trait.detected.trigger)) {
|
|
2688
3092
|
decorators.push(trait.detected.trigger);
|
|
2689
3093
|
}
|
|
2690
3094
|
}
|
|
@@ -2713,24 +3117,24 @@ var TraitCompiler = class {
|
|
|
2713
3117
|
}
|
|
2714
3118
|
};
|
|
2715
3119
|
|
|
2716
|
-
// bazel-out/
|
|
2717
|
-
import
|
|
3120
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
3121
|
+
import ts14 from "typescript";
|
|
2718
3122
|
|
|
2719
|
-
// bazel-out/
|
|
2720
|
-
import
|
|
3123
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/utils.mjs
|
|
3124
|
+
import ts13 from "typescript";
|
|
2721
3125
|
function addImports(importManager, sf, extraStatements = []) {
|
|
2722
3126
|
const addedImports = importManager.getAllImports(sf.fileName).map((i) => {
|
|
2723
|
-
const qualifier =
|
|
2724
|
-
const importClause =
|
|
2725
|
-
const decl =
|
|
2726
|
-
|
|
3127
|
+
const qualifier = ts13.createIdentifier(i.qualifier.text);
|
|
3128
|
+
const importClause = ts13.createImportClause(void 0, ts13.createNamespaceImport(qualifier));
|
|
3129
|
+
const decl = ts13.createImportDeclaration(void 0, void 0, importClause, ts13.createLiteral(i.specifier));
|
|
3130
|
+
ts13.setOriginalNode(i.qualifier, decl);
|
|
2727
3131
|
return decl;
|
|
2728
3132
|
});
|
|
2729
3133
|
const existingImports = sf.statements.filter((stmt) => isImportStatement(stmt));
|
|
2730
3134
|
const body = sf.statements.filter((stmt) => !isImportStatement(stmt));
|
|
2731
3135
|
if (addedImports.length > 0) {
|
|
2732
|
-
const fileoverviewAnchorStmt =
|
|
2733
|
-
return
|
|
3136
|
+
const fileoverviewAnchorStmt = ts13.createNotEmittedStatement(sf);
|
|
3137
|
+
return ts13.updateSourceFileNode(sf, ts13.createNodeArray([
|
|
2734
3138
|
fileoverviewAnchorStmt,
|
|
2735
3139
|
...existingImports,
|
|
2736
3140
|
...addedImports,
|
|
@@ -2741,10 +3145,10 @@ function addImports(importManager, sf, extraStatements = []) {
|
|
|
2741
3145
|
return sf;
|
|
2742
3146
|
}
|
|
2743
3147
|
function isImportStatement(stmt) {
|
|
2744
|
-
return
|
|
3148
|
+
return ts13.isImportDeclaration(stmt) || ts13.isImportEqualsDeclaration(stmt) || ts13.isNamespaceImport(stmt);
|
|
2745
3149
|
}
|
|
2746
3150
|
|
|
2747
|
-
// bazel-out/
|
|
3151
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
2748
3152
|
var DtsTransformRegistry = class {
|
|
2749
3153
|
constructor() {
|
|
2750
3154
|
this.ivyDeclarationTransforms = /* @__PURE__ */ new Map();
|
|
@@ -2759,7 +3163,7 @@ var DtsTransformRegistry = class {
|
|
|
2759
3163
|
if (!sf.isDeclarationFile) {
|
|
2760
3164
|
return null;
|
|
2761
3165
|
}
|
|
2762
|
-
const originalSf =
|
|
3166
|
+
const originalSf = ts14.getOriginalNode(sf);
|
|
2763
3167
|
let transforms = null;
|
|
2764
3168
|
if (this.ivyDeclarationTransforms.has(originalSf)) {
|
|
2765
3169
|
transforms = [];
|
|
@@ -2772,7 +3176,7 @@ function declarationTransformFactory(transformRegistry, importRewriter, importPr
|
|
|
2772
3176
|
return (context) => {
|
|
2773
3177
|
const transformer = new DtsTransformer(context, importRewriter, importPrefix);
|
|
2774
3178
|
return (fileOrBundle) => {
|
|
2775
|
-
if (
|
|
3179
|
+
if (ts14.isBundle(fileOrBundle)) {
|
|
2776
3180
|
return fileOrBundle;
|
|
2777
3181
|
}
|
|
2778
3182
|
const transforms = transformRegistry.getAllTransforms(fileOrBundle);
|
|
@@ -2792,15 +3196,15 @@ var DtsTransformer = class {
|
|
|
2792
3196
|
transform(sf, transforms) {
|
|
2793
3197
|
const imports = new ImportManager(this.importRewriter, this.importPrefix);
|
|
2794
3198
|
const visitor = (node) => {
|
|
2795
|
-
if (
|
|
3199
|
+
if (ts14.isClassDeclaration(node)) {
|
|
2796
3200
|
return this.transformClassDeclaration(node, transforms, imports);
|
|
2797
|
-
} else if (
|
|
3201
|
+
} else if (ts14.isFunctionDeclaration(node)) {
|
|
2798
3202
|
return this.transformFunctionDeclaration(node, transforms, imports);
|
|
2799
3203
|
} else {
|
|
2800
|
-
return
|
|
3204
|
+
return ts14.visitEachChild(node, visitor, this.ctx);
|
|
2801
3205
|
}
|
|
2802
3206
|
};
|
|
2803
|
-
sf =
|
|
3207
|
+
sf = ts14.visitNode(sf, visitor);
|
|
2804
3208
|
return addImports(imports, sf);
|
|
2805
3209
|
}
|
|
2806
3210
|
transformClassDeclaration(clazz, transforms, imports) {
|
|
@@ -2828,7 +3232,7 @@ var DtsTransformer = class {
|
|
|
2828
3232
|
}
|
|
2829
3233
|
}
|
|
2830
3234
|
if (elementsChanged && clazz === newClazz) {
|
|
2831
|
-
newClazz =
|
|
3235
|
+
newClazz = ts14.updateClassDeclaration(clazz, clazz.decorators, clazz.modifiers, clazz.name, clazz.typeParameters, clazz.heritageClauses, elements);
|
|
2832
3236
|
}
|
|
2833
3237
|
return newClazz;
|
|
2834
3238
|
}
|
|
@@ -2850,31 +3254,31 @@ var IvyDeclarationDtsTransform = class {
|
|
|
2850
3254
|
this.declarationFields.set(decl, fields);
|
|
2851
3255
|
}
|
|
2852
3256
|
transformClass(clazz, members, imports) {
|
|
2853
|
-
const original =
|
|
3257
|
+
const original = ts14.getOriginalNode(clazz);
|
|
2854
3258
|
if (!this.declarationFields.has(original)) {
|
|
2855
3259
|
return clazz;
|
|
2856
3260
|
}
|
|
2857
3261
|
const fields = this.declarationFields.get(original);
|
|
2858
3262
|
const newMembers = fields.map((decl) => {
|
|
2859
|
-
const modifiers = [
|
|
3263
|
+
const modifiers = [ts14.createModifier(ts14.SyntaxKind.StaticKeyword)];
|
|
2860
3264
|
const typeRef = translateType(decl.type, imports);
|
|
2861
3265
|
markForEmitAsSingleLine(typeRef);
|
|
2862
|
-
return
|
|
3266
|
+
return ts14.createProperty(void 0, modifiers, decl.name, void 0, typeRef, void 0);
|
|
2863
3267
|
});
|
|
2864
|
-
return
|
|
3268
|
+
return ts14.updateClassDeclaration(clazz, clazz.decorators, clazz.modifiers, clazz.name, clazz.typeParameters, clazz.heritageClauses, [...members, ...newMembers]);
|
|
2865
3269
|
}
|
|
2866
3270
|
};
|
|
2867
3271
|
function markForEmitAsSingleLine(node) {
|
|
2868
|
-
|
|
2869
|
-
|
|
3272
|
+
ts14.setEmitFlags(node, ts14.EmitFlags.SingleLine);
|
|
3273
|
+
ts14.forEachChild(node, markForEmitAsSingleLine);
|
|
2870
3274
|
}
|
|
2871
3275
|
|
|
2872
|
-
// bazel-out/
|
|
3276
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
2873
3277
|
import { ConstantPool } from "@angular/compiler";
|
|
2874
|
-
import
|
|
3278
|
+
import ts16 from "typescript";
|
|
2875
3279
|
|
|
2876
|
-
// bazel-out/
|
|
2877
|
-
import
|
|
3280
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
|
|
3281
|
+
import ts15 from "typescript";
|
|
2878
3282
|
function visit(node, visitor, context) {
|
|
2879
3283
|
return visitor._visit(node, context);
|
|
2880
3284
|
}
|
|
@@ -2898,8 +3302,8 @@ var Visitor = class {
|
|
|
2898
3302
|
}
|
|
2899
3303
|
_visit(node, context) {
|
|
2900
3304
|
let visitedNode = null;
|
|
2901
|
-
node =
|
|
2902
|
-
if (
|
|
3305
|
+
node = ts15.visitEachChild(node, (child) => this._visit(child, context), context);
|
|
3306
|
+
if (ts15.isClassDeclaration(node)) {
|
|
2903
3307
|
visitedNode = this._visitListEntryNode(node, (node2) => this.visitClassDeclaration(node2));
|
|
2904
3308
|
} else {
|
|
2905
3309
|
visitedNode = this.visitOtherNode(node);
|
|
@@ -2913,7 +3317,7 @@ var Visitor = class {
|
|
|
2913
3317
|
if (node.statements.every((stmt) => !this._before.has(stmt) && !this._after.has(stmt))) {
|
|
2914
3318
|
return node;
|
|
2915
3319
|
}
|
|
2916
|
-
const clone =
|
|
3320
|
+
const clone = ts15.getMutableClone(node);
|
|
2917
3321
|
const newStatements = [];
|
|
2918
3322
|
clone.statements.forEach((stmt) => {
|
|
2919
3323
|
if (this._before.has(stmt)) {
|
|
@@ -2926,7 +3330,7 @@ var Visitor = class {
|
|
|
2926
3330
|
this._after.delete(stmt);
|
|
2927
3331
|
}
|
|
2928
3332
|
});
|
|
2929
|
-
clone.statements =
|
|
3333
|
+
clone.statements = ts15.createNodeArray(newStatements, node.statements.hasTrailingComma);
|
|
2930
3334
|
return clone;
|
|
2931
3335
|
}
|
|
2932
3336
|
};
|
|
@@ -2935,7 +3339,7 @@ function hasStatements(node) {
|
|
|
2935
3339
|
return block.statements !== void 0 && Array.isArray(block.statements);
|
|
2936
3340
|
}
|
|
2937
3341
|
|
|
2938
|
-
// bazel-out/
|
|
3342
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
2939
3343
|
var NO_DECORATORS = /* @__PURE__ */ new Set();
|
|
2940
3344
|
var CLOSURE_FILE_OVERVIEW_REGEXP = /\s+@fileoverview\s+/i;
|
|
2941
3345
|
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, perf, isCore, isClosureCompilerEnabled) {
|
|
@@ -2984,14 +3388,14 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
2984
3388
|
const members = [...node.members];
|
|
2985
3389
|
for (const field of this.classCompilationMap.get(node)) {
|
|
2986
3390
|
const exprNode = translateExpression(field.initializer, this.importManager, translateOptions);
|
|
2987
|
-
const property =
|
|
3391
|
+
const property = ts16.createProperty(void 0, [ts16.createToken(ts16.SyntaxKind.StaticKeyword)], field.name, void 0, void 0, exprNode);
|
|
2988
3392
|
if (this.isClosureCompilerEnabled) {
|
|
2989
|
-
|
|
3393
|
+
ts16.addSyntheticLeadingComment(property, ts16.SyntaxKind.MultiLineCommentTrivia, "* @nocollapse ", false);
|
|
2990
3394
|
}
|
|
2991
3395
|
field.statements.map((stmt) => translateStatement(stmt, this.importManager, translateOptions)).forEach((stmt) => statements.push(stmt));
|
|
2992
3396
|
members.push(property);
|
|
2993
3397
|
}
|
|
2994
|
-
node =
|
|
3398
|
+
node = ts16.updateClassDeclaration(node, maybeFilterDecorator(node.decorators, this.compilation.decoratorsFor(node)), node.modifiers, node.name, node.typeParameters, node.heritageClauses || [], members.map((member) => this._stripAngularDecorators(member)));
|
|
2995
3399
|
return { node, after: statements };
|
|
2996
3400
|
}
|
|
2997
3401
|
_angularCoreDecorators(decl) {
|
|
@@ -3020,25 +3424,25 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
3020
3424
|
if (filtered.length === 0) {
|
|
3021
3425
|
return void 0;
|
|
3022
3426
|
}
|
|
3023
|
-
const array =
|
|
3427
|
+
const array = ts16.createNodeArray(filtered);
|
|
3024
3428
|
array.pos = node.decorators.pos;
|
|
3025
3429
|
array.end = node.decorators.end;
|
|
3026
3430
|
return array;
|
|
3027
3431
|
}
|
|
3028
3432
|
_stripAngularDecorators(node) {
|
|
3029
|
-
if (
|
|
3030
|
-
node =
|
|
3031
|
-
} else if (
|
|
3032
|
-
node =
|
|
3033
|
-
} else if (
|
|
3034
|
-
node =
|
|
3035
|
-
} else if (
|
|
3036
|
-
node =
|
|
3037
|
-
} else if (
|
|
3038
|
-
node =
|
|
3039
|
-
} else if (
|
|
3433
|
+
if (ts16.isParameter(node)) {
|
|
3434
|
+
node = ts16.updateParameter(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer);
|
|
3435
|
+
} else if (ts16.isMethodDeclaration(node) && node.decorators !== void 0) {
|
|
3436
|
+
node = ts16.updateMethod(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body);
|
|
3437
|
+
} else if (ts16.isPropertyDeclaration(node) && node.decorators !== void 0) {
|
|
3438
|
+
node = ts16.updateProperty(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.questionToken, node.type, node.initializer);
|
|
3439
|
+
} else if (ts16.isGetAccessor(node)) {
|
|
3440
|
+
node = ts16.updateGetAccessor(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.parameters, node.type, node.body);
|
|
3441
|
+
} else if (ts16.isSetAccessor(node)) {
|
|
3442
|
+
node = ts16.updateSetAccessor(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.parameters, node.body);
|
|
3443
|
+
} else if (ts16.isConstructorDeclaration(node)) {
|
|
3040
3444
|
const parameters = node.parameters.map((param) => this._stripAngularDecorators(param));
|
|
3041
|
-
node =
|
|
3445
|
+
node = ts16.updateConstructor(node, node.decorators, node.modifiers, parameters, node.body);
|
|
3042
3446
|
}
|
|
3043
3447
|
return node;
|
|
3044
3448
|
}
|
|
@@ -3050,7 +3454,7 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
3050
3454
|
visit(file, compilationVisitor, context);
|
|
3051
3455
|
const transformationVisitor = new IvyTransformationVisitor(compilation, compilationVisitor.classCompilationMap, reflector, importManager, recordWrappedNode, isClosureCompilerEnabled, isCore);
|
|
3052
3456
|
let sf = visit(file, transformationVisitor, context);
|
|
3053
|
-
const downlevelTranslatedCode = getLocalizeCompileTarget(context) <
|
|
3457
|
+
const downlevelTranslatedCode = getLocalizeCompileTarget(context) < ts16.ScriptTarget.ES2015;
|
|
3054
3458
|
const constants = constantPool.statements.map((stmt) => translateStatement(stmt, importManager, {
|
|
3055
3459
|
recordWrappedNode,
|
|
3056
3460
|
downlevelTaggedTemplates: downlevelTranslatedCode,
|
|
@@ -3065,17 +3469,17 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
3065
3469
|
return sf;
|
|
3066
3470
|
}
|
|
3067
3471
|
function getLocalizeCompileTarget(context) {
|
|
3068
|
-
const target = context.getCompilerOptions().target ||
|
|
3069
|
-
return target !==
|
|
3472
|
+
const target = context.getCompilerOptions().target || ts16.ScriptTarget.ES2015;
|
|
3473
|
+
return target !== ts16.ScriptTarget.JSON ? target : ts16.ScriptTarget.ES2015;
|
|
3070
3474
|
}
|
|
3071
3475
|
function getFileOverviewComment(statements) {
|
|
3072
3476
|
if (statements.length > 0) {
|
|
3073
3477
|
const host = statements[0];
|
|
3074
3478
|
let trailing = false;
|
|
3075
|
-
let comments =
|
|
3479
|
+
let comments = ts16.getSyntheticLeadingComments(host);
|
|
3076
3480
|
if (!comments || comments.length === 0) {
|
|
3077
3481
|
trailing = true;
|
|
3078
|
-
comments =
|
|
3482
|
+
comments = ts16.getSyntheticTrailingComments(host);
|
|
3079
3483
|
}
|
|
3080
3484
|
if (comments && comments.length > 0 && CLOSURE_FILE_OVERVIEW_REGEXP.test(comments[0].text)) {
|
|
3081
3485
|
return { comments, host, trailing };
|
|
@@ -3087,22 +3491,22 @@ function setFileOverviewComment(sf, fileoverview) {
|
|
|
3087
3491
|
const { comments, host, trailing } = fileoverview;
|
|
3088
3492
|
if (sf.statements.length > 0 && host !== sf.statements[0]) {
|
|
3089
3493
|
if (trailing) {
|
|
3090
|
-
|
|
3494
|
+
ts16.setSyntheticTrailingComments(host, void 0);
|
|
3091
3495
|
} else {
|
|
3092
|
-
|
|
3496
|
+
ts16.setSyntheticLeadingComments(host, void 0);
|
|
3093
3497
|
}
|
|
3094
|
-
|
|
3498
|
+
ts16.setSyntheticLeadingComments(sf.statements[0], comments);
|
|
3095
3499
|
}
|
|
3096
3500
|
}
|
|
3097
3501
|
function maybeFilterDecorator(decorators, toRemove) {
|
|
3098
3502
|
if (decorators === void 0) {
|
|
3099
3503
|
return void 0;
|
|
3100
3504
|
}
|
|
3101
|
-
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) =>
|
|
3505
|
+
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) => ts16.getOriginalNode(dec) === decToRemove) === void 0);
|
|
3102
3506
|
if (filtered.length === 0) {
|
|
3103
3507
|
return void 0;
|
|
3104
3508
|
}
|
|
3105
|
-
return
|
|
3509
|
+
return ts16.createNodeArray(filtered);
|
|
3106
3510
|
}
|
|
3107
3511
|
function isFromAngularCore(decorator) {
|
|
3108
3512
|
return decorator.import !== null && decorator.import.from === "@angular/core";
|
|
@@ -3116,8 +3520,8 @@ function createRecorderFn(defaultImportTracker) {
|
|
|
3116
3520
|
};
|
|
3117
3521
|
}
|
|
3118
3522
|
|
|
3119
|
-
// bazel-out/
|
|
3120
|
-
import
|
|
3523
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/diagnostics.mjs
|
|
3524
|
+
import ts17 from "typescript";
|
|
3121
3525
|
function createValueHasWrongTypeError(node, value, messageText) {
|
|
3122
3526
|
var _a;
|
|
3123
3527
|
let chainedMessage;
|
|
@@ -3135,11 +3539,11 @@ function createValueHasWrongTypeError(node, value, messageText) {
|
|
|
3135
3539
|
}
|
|
3136
3540
|
const chain = {
|
|
3137
3541
|
messageText,
|
|
3138
|
-
category:
|
|
3542
|
+
category: ts17.DiagnosticCategory.Error,
|
|
3139
3543
|
code: 0,
|
|
3140
3544
|
next: [{
|
|
3141
3545
|
messageText: chainedMessage,
|
|
3142
|
-
category:
|
|
3546
|
+
category: ts17.DiagnosticCategory.Message,
|
|
3143
3547
|
code: 0
|
|
3144
3548
|
}]
|
|
3145
3549
|
};
|
|
@@ -3213,11 +3617,11 @@ function getInheritedUndecoratedCtorDiagnostic(node, baseClass, reader) {
|
|
|
3213
3617
|
return makeDiagnostic(ErrorCode.DIRECTIVE_INHERITS_UNDECORATED_CTOR, node.name, `The ${dirOrComp.toLowerCase()} ${node.name.text} inherits its constructor from ${baseClassName}, but the latter does not have an Angular decorator of its own. Dependency injection will not be able to resolve the parameters of ${baseClassName}'s constructor. Either add a @Directive decorator to ${baseClassName}, or add an explicit constructor to ${node.name.text}.`);
|
|
3214
3618
|
}
|
|
3215
3619
|
|
|
3216
|
-
// bazel-out/
|
|
3620
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
|
|
3217
3621
|
import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, createMayBeForwardRefExpression, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr3, FactoryTarget, getSafePropertyAccessString, makeBindingParser, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr3 } from "@angular/compiler";
|
|
3218
|
-
import
|
|
3622
|
+
import ts19 from "typescript";
|
|
3219
3623
|
|
|
3220
|
-
// bazel-out/
|
|
3624
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/factory.mjs
|
|
3221
3625
|
import { compileDeclareFactoryFunction, compileFactoryFunction } from "@angular/compiler";
|
|
3222
3626
|
function compileNgFactoryDefField(metadata) {
|
|
3223
3627
|
const res = compileFactoryFunction(metadata);
|
|
@@ -3228,9 +3632,9 @@ function compileDeclareFactory(metadata) {
|
|
|
3228
3632
|
return { name: "\u0275fac", initializer: res.expression, statements: res.statements, type: res.type };
|
|
3229
3633
|
}
|
|
3230
3634
|
|
|
3231
|
-
// bazel-out/
|
|
3635
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/metadata.mjs
|
|
3232
3636
|
import { FunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
|
|
3233
|
-
import
|
|
3637
|
+
import ts18 from "typescript";
|
|
3234
3638
|
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
|
|
3235
3639
|
if (!reflection.isClass(clazz)) {
|
|
3236
3640
|
return null;
|
|
@@ -3244,7 +3648,7 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
3244
3648
|
if (ngClassDecorators.length === 0) {
|
|
3245
3649
|
return null;
|
|
3246
3650
|
}
|
|
3247
|
-
const metaDecorators = new WrappedNodeExpr2(
|
|
3651
|
+
const metaDecorators = new WrappedNodeExpr2(ts18.createArrayLiteral(ngClassDecorators));
|
|
3248
3652
|
let metaCtorParameters = null;
|
|
3249
3653
|
const classCtorParameters = reflection.getConstructorParameters(clazz);
|
|
3250
3654
|
if (classCtorParameters !== null) {
|
|
@@ -3264,7 +3668,7 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
3264
3668
|
return classMemberToMetadata((_a = member.nameNode) != null ? _a : member.name, member.decorators, isCore);
|
|
3265
3669
|
});
|
|
3266
3670
|
if (decoratedMembers.length > 0) {
|
|
3267
|
-
metaPropDecorators = new WrappedNodeExpr2(
|
|
3671
|
+
metaPropDecorators = new WrappedNodeExpr2(ts18.createObjectLiteral(decoratedMembers));
|
|
3268
3672
|
}
|
|
3269
3673
|
return {
|
|
3270
3674
|
type: new WrappedNodeExpr2(id),
|
|
@@ -3280,43 +3684,43 @@ function ctorParameterToMetadata(param, isCore) {
|
|
|
3280
3684
|
];
|
|
3281
3685
|
if (param.decorators !== null) {
|
|
3282
3686
|
const ngDecorators = param.decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
3283
|
-
const value = new WrappedNodeExpr2(
|
|
3687
|
+
const value = new WrappedNodeExpr2(ts18.createArrayLiteral(ngDecorators));
|
|
3284
3688
|
mapEntries.push({ key: "decorators", value, quoted: false });
|
|
3285
3689
|
}
|
|
3286
3690
|
return literalMap(mapEntries);
|
|
3287
3691
|
}
|
|
3288
3692
|
function classMemberToMetadata(name, decorators, isCore) {
|
|
3289
3693
|
const ngDecorators = decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
3290
|
-
const decoratorMeta =
|
|
3291
|
-
return
|
|
3694
|
+
const decoratorMeta = ts18.createArrayLiteral(ngDecorators);
|
|
3695
|
+
return ts18.createPropertyAssignment(name, decoratorMeta);
|
|
3292
3696
|
}
|
|
3293
3697
|
function decoratorToMetadata(decorator, wrapFunctionsInParens) {
|
|
3294
3698
|
if (decorator.identifier === null) {
|
|
3295
3699
|
throw new Error("Illegal state: synthesized decorator cannot be emitted in class metadata.");
|
|
3296
3700
|
}
|
|
3297
3701
|
const properties = [
|
|
3298
|
-
|
|
3702
|
+
ts18.createPropertyAssignment("type", ts18.getMutableClone(decorator.identifier))
|
|
3299
3703
|
];
|
|
3300
3704
|
if (decorator.args !== null && decorator.args.length > 0) {
|
|
3301
3705
|
const args = decorator.args.map((arg) => {
|
|
3302
|
-
const expr =
|
|
3706
|
+
const expr = ts18.getMutableClone(arg);
|
|
3303
3707
|
return wrapFunctionsInParens ? wrapFunctionExpressionsInParens(expr) : expr;
|
|
3304
3708
|
});
|
|
3305
|
-
properties.push(
|
|
3709
|
+
properties.push(ts18.createPropertyAssignment("args", ts18.createArrayLiteral(args)));
|
|
3306
3710
|
}
|
|
3307
|
-
return
|
|
3711
|
+
return ts18.createObjectLiteral(properties, true);
|
|
3308
3712
|
}
|
|
3309
3713
|
function isAngularDecorator2(decorator, isCore) {
|
|
3310
3714
|
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
3311
3715
|
}
|
|
3312
3716
|
function removeIdentifierReferences(node, name) {
|
|
3313
|
-
const result =
|
|
3314
|
-
return
|
|
3717
|
+
const result = ts18.transform(node, [(context) => (root) => ts18.visitNode(root, function walk(current) {
|
|
3718
|
+
return ts18.isIdentifier(current) && current.text === name ? ts18.createIdentifier(current.text) : ts18.visitEachChild(current, walk, context);
|
|
3315
3719
|
})]);
|
|
3316
3720
|
return result.transformed[0];
|
|
3317
3721
|
}
|
|
3318
3722
|
|
|
3319
|
-
// bazel-out/
|
|
3723
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
|
|
3320
3724
|
var EMPTY_OBJECT = {};
|
|
3321
3725
|
var FIELD_DECORATORS = [
|
|
3322
3726
|
"Input",
|
|
@@ -3536,7 +3940,7 @@ function extractDirectiveMetadata(clazz, decorator, reflector, evaluator, isCore
|
|
|
3536
3940
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @${decorator.name} decorator`);
|
|
3537
3941
|
} else {
|
|
3538
3942
|
const meta = unwrapExpression(decorator.args[0]);
|
|
3539
|
-
if (!
|
|
3943
|
+
if (!ts19.isObjectLiteralExpression(meta)) {
|
|
3540
3944
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `@${decorator.name} argument must be an object literal`);
|
|
3541
3945
|
}
|
|
3542
3946
|
directive = reflectObjectLiteral(meta);
|
|
@@ -3647,7 +4051,7 @@ function extractQueryMetadata(exprNode, name, args, propertyName, reflector, eva
|
|
|
3647
4051
|
let emitDistinctChangesOnly = emitDistinctChangesOnlyDefaultValue;
|
|
3648
4052
|
if (args.length === 2) {
|
|
3649
4053
|
const optionsExpr = unwrapExpression(args[1]);
|
|
3650
|
-
if (!
|
|
4054
|
+
if (!ts19.isObjectLiteralExpression(optionsExpr)) {
|
|
3651
4055
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, optionsExpr, `@${name} options must be an object literal`);
|
|
3652
4056
|
}
|
|
3653
4057
|
const options = reflectObjectLiteral(optionsExpr);
|
|
@@ -3692,16 +4096,16 @@ function extractQueryMetadata(exprNode, name, args, propertyName, reflector, eva
|
|
|
3692
4096
|
}
|
|
3693
4097
|
function extractQueriesFromDecorator(queryData, reflector, evaluator, isCore) {
|
|
3694
4098
|
const content = [], view = [];
|
|
3695
|
-
if (!
|
|
4099
|
+
if (!ts19.isObjectLiteralExpression(queryData)) {
|
|
3696
4100
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator queries metadata must be an object literal");
|
|
3697
4101
|
}
|
|
3698
4102
|
reflectObjectLiteral(queryData).forEach((queryExpr, propertyName) => {
|
|
3699
4103
|
queryExpr = unwrapExpression(queryExpr);
|
|
3700
|
-
if (!
|
|
4104
|
+
if (!ts19.isNewExpression(queryExpr)) {
|
|
3701
4105
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
3702
4106
|
}
|
|
3703
|
-
const queryType =
|
|
3704
|
-
if (!
|
|
4107
|
+
const queryType = ts19.isPropertyAccessExpression(queryExpr.expression) ? queryExpr.expression.name : queryExpr.expression;
|
|
4108
|
+
if (!ts19.isIdentifier(queryType)) {
|
|
3705
4109
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
3706
4110
|
}
|
|
3707
4111
|
const type = reflector.getImportOfIdentifier(queryType);
|
|
@@ -3878,9 +4282,9 @@ var QUERY_TYPES = /* @__PURE__ */ new Set([
|
|
|
3878
4282
|
"ViewChildren"
|
|
3879
4283
|
]);
|
|
3880
4284
|
|
|
3881
|
-
// bazel-out/
|
|
4285
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/ng_module.mjs
|
|
3882
4286
|
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, CUSTOM_ELEMENTS_SCHEMA, ExternalExpr as ExternalExpr4, FactoryTarget as FactoryTarget2, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2, NO_ERRORS_SCHEMA, R3Identifiers, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
|
|
3883
|
-
import
|
|
4287
|
+
import ts20 from "typescript";
|
|
3884
4288
|
var NgModuleSymbol = class extends SemanticSymbol {
|
|
3885
4289
|
constructor() {
|
|
3886
4290
|
super(...arguments);
|
|
@@ -3963,8 +4367,8 @@ var NgModuleDecoratorHandler = class {
|
|
|
3963
4367
|
if (decorator.args === null || decorator.args.length > 1) {
|
|
3964
4368
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @NgModule decorator`);
|
|
3965
4369
|
}
|
|
3966
|
-
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) :
|
|
3967
|
-
if (!
|
|
4370
|
+
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) : ts20.createObjectLiteral([]);
|
|
4371
|
+
if (!ts20.isObjectLiteralExpression(meta)) {
|
|
3968
4372
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@NgModule argument must be an object literal");
|
|
3969
4373
|
}
|
|
3970
4374
|
const ngModule = reflectObjectLiteral(meta);
|
|
@@ -4255,10 +4659,10 @@ var NgModuleDecoratorHandler = class {
|
|
|
4255
4659
|
return type && (this._reflectModuleFromTypeParam(type, node) || this._reflectModuleFromLiteralType(type));
|
|
4256
4660
|
}
|
|
4257
4661
|
_reflectModuleFromTypeParam(type, node) {
|
|
4258
|
-
if (!
|
|
4662
|
+
if (!ts20.isTypeReferenceNode(type)) {
|
|
4259
4663
|
return null;
|
|
4260
4664
|
}
|
|
4261
|
-
const typeName = type && (
|
|
4665
|
+
const typeName = type && (ts20.isIdentifier(type.typeName) && type.typeName || ts20.isQualifiedName(type.typeName) && type.typeName.right) || null;
|
|
4262
4666
|
if (typeName === null) {
|
|
4263
4667
|
return null;
|
|
4264
4668
|
}
|
|
@@ -4270,7 +4674,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
4270
4674
|
return null;
|
|
4271
4675
|
}
|
|
4272
4676
|
if (type.typeArguments === void 0 || type.typeArguments.length !== 1) {
|
|
4273
|
-
const parent =
|
|
4677
|
+
const parent = ts20.isMethodDeclaration(node) && ts20.isClassDeclaration(node.parent) ? node.parent : null;
|
|
4274
4678
|
const symbolName = (parent && parent.name ? parent.name.getText() + "." : "") + (node.name ? node.name.getText() : "anonymous");
|
|
4275
4679
|
throw new FatalDiagnosticError(ErrorCode.NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC, type, `${symbolName} returns a ModuleWithProviders type without a generic type argument. Please add a generic type argument to the ModuleWithProviders type. If this occurrence is in library code you don't control, please contact the library authors.`);
|
|
4276
4680
|
}
|
|
@@ -4278,13 +4682,13 @@ var NgModuleDecoratorHandler = class {
|
|
|
4278
4682
|
return typeNodeToValueExpr(arg);
|
|
4279
4683
|
}
|
|
4280
4684
|
_reflectModuleFromLiteralType(type) {
|
|
4281
|
-
if (!
|
|
4685
|
+
if (!ts20.isIntersectionTypeNode(type)) {
|
|
4282
4686
|
return null;
|
|
4283
4687
|
}
|
|
4284
4688
|
for (const t of type.types) {
|
|
4285
|
-
if (
|
|
4689
|
+
if (ts20.isTypeLiteralNode(t)) {
|
|
4286
4690
|
for (const m of t.members) {
|
|
4287
|
-
const ngModuleType =
|
|
4691
|
+
const ngModuleType = ts20.isPropertySignature(m) && ts20.isIdentifier(m.name) && m.name.text === "ngModule" && m.type || null;
|
|
4288
4692
|
const ngModuleExpression = ngModuleType && typeNodeToValueExpr(ngModuleType);
|
|
4289
4693
|
if (ngModuleExpression) {
|
|
4290
4694
|
return ngModuleExpression;
|
|
@@ -4324,7 +4728,7 @@ function isNgModule(node, compilation) {
|
|
|
4324
4728
|
return !compilation.directives.some((directive) => directive.ref.node === node) && !compilation.pipes.some((pipe) => pipe.ref.node === node);
|
|
4325
4729
|
}
|
|
4326
4730
|
|
|
4327
|
-
// bazel-out/
|
|
4731
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/component.mjs
|
|
4328
4732
|
var EMPTY_MAP = /* @__PURE__ */ new Map();
|
|
4329
4733
|
var EMPTY_ARRAY = [];
|
|
4330
4734
|
var ComponentSymbol = class extends DirectiveSymbol {
|
|
@@ -4645,7 +5049,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4645
5049
|
});
|
|
4646
5050
|
}
|
|
4647
5051
|
typeCheck(ctx, node, meta) {
|
|
4648
|
-
if (this.typeCheckScopeRegistry === null || !
|
|
5052
|
+
if (this.typeCheckScopeRegistry === null || !ts21.isClassDeclaration(node)) {
|
|
4649
5053
|
return;
|
|
4650
5054
|
}
|
|
4651
5055
|
if (meta.isPoisoned && !this.usePoisonedData) {
|
|
@@ -4856,17 +5260,17 @@ var ComponentDecoratorHandler = class {
|
|
|
4856
5260
|
const metadata = new Map(component);
|
|
4857
5261
|
if (metadata.has("templateUrl")) {
|
|
4858
5262
|
metadata.delete("templateUrl");
|
|
4859
|
-
metadata.set("template",
|
|
5263
|
+
metadata.set("template", ts21.createStringLiteral(template.content));
|
|
4860
5264
|
}
|
|
4861
5265
|
if (metadata.has("styleUrls")) {
|
|
4862
5266
|
metadata.delete("styleUrls");
|
|
4863
|
-
metadata.set("styles",
|
|
5267
|
+
metadata.set("styles", ts21.createArrayLiteral(styles.map((s) => ts21.createStringLiteral(s))));
|
|
4864
5268
|
}
|
|
4865
5269
|
const newMetadataFields = [];
|
|
4866
5270
|
for (const [name, value] of metadata.entries()) {
|
|
4867
|
-
newMetadataFields.push(
|
|
5271
|
+
newMetadataFields.push(ts21.createPropertyAssignment(name, value));
|
|
4868
5272
|
}
|
|
4869
|
-
return __spreadProps(__spreadValues({}, dec), { args: [
|
|
5273
|
+
return __spreadProps(__spreadValues({}, dec), { args: [ts21.createObjectLiteral(newMetadataFields)] });
|
|
4870
5274
|
}
|
|
4871
5275
|
_resolveLiteral(decorator) {
|
|
4872
5276
|
if (this.literalCache.has(decorator)) {
|
|
@@ -4876,7 +5280,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4876
5280
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @Component decorator`);
|
|
4877
5281
|
}
|
|
4878
5282
|
const meta = unwrapExpression(decorator.args[0]);
|
|
4879
|
-
if (!
|
|
5283
|
+
if (!ts21.isObjectLiteralExpression(meta)) {
|
|
4880
5284
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `Decorator argument must be literal.`);
|
|
4881
5285
|
}
|
|
4882
5286
|
this.literalCache.set(decorator, meta);
|
|
@@ -4903,9 +5307,9 @@ var ComponentDecoratorHandler = class {
|
|
|
4903
5307
|
}
|
|
4904
5308
|
_extractStyleUrlsFromExpression(styleUrlsExpr) {
|
|
4905
5309
|
const styleUrls = [];
|
|
4906
|
-
if (
|
|
5310
|
+
if (ts21.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
4907
5311
|
for (const styleUrlExpr of styleUrlsExpr.elements) {
|
|
4908
|
-
if (
|
|
5312
|
+
if (ts21.isSpreadElement(styleUrlExpr)) {
|
|
4909
5313
|
styleUrls.push(...this._extractStyleUrlsFromExpression(styleUrlExpr.expression));
|
|
4910
5314
|
} else {
|
|
4911
5315
|
const styleUrl = this.evaluator.evaluate(styleUrlExpr);
|
|
@@ -4937,10 +5341,10 @@ var ComponentDecoratorHandler = class {
|
|
|
4937
5341
|
_extractStyleResources(component, containingFile) {
|
|
4938
5342
|
const styles = /* @__PURE__ */ new Set();
|
|
4939
5343
|
function stringLiteralElements(array) {
|
|
4940
|
-
return array.elements.filter((e) =>
|
|
5344
|
+
return array.elements.filter((e) => ts21.isStringLiteralLike(e));
|
|
4941
5345
|
}
|
|
4942
5346
|
const styleUrlsExpr = component.get("styleUrls");
|
|
4943
|
-
if (styleUrlsExpr !== void 0 &&
|
|
5347
|
+
if (styleUrlsExpr !== void 0 && ts21.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
4944
5348
|
for (const expression of stringLiteralElements(styleUrlsExpr)) {
|
|
4945
5349
|
try {
|
|
4946
5350
|
const resourceUrl = this.resourceLoader.resolve(expression.text, containingFile);
|
|
@@ -4950,7 +5354,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4950
5354
|
}
|
|
4951
5355
|
}
|
|
4952
5356
|
const stylesExpr = component.get("styles");
|
|
4953
|
-
if (stylesExpr !== void 0 &&
|
|
5357
|
+
if (stylesExpr !== void 0 && ts21.isArrayLiteralExpression(stylesExpr)) {
|
|
4954
5358
|
for (const expression of stringLiteralElements(stylesExpr)) {
|
|
4955
5359
|
styles.add({ path: null, expression });
|
|
4956
5360
|
}
|
|
@@ -4995,7 +5399,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4995
5399
|
let sourceMapping;
|
|
4996
5400
|
let escapedString = false;
|
|
4997
5401
|
let sourceMapUrl;
|
|
4998
|
-
if (
|
|
5402
|
+
if (ts21.isStringLiteral(template.expression) || ts21.isNoSubstitutionTemplateLiteral(template.expression)) {
|
|
4999
5403
|
sourceParseRange = getTemplateRange(template.expression);
|
|
5000
5404
|
sourceStr = template.expression.getSourceFile().text;
|
|
5001
5405
|
templateContent = template.expression.text;
|
|
@@ -5169,7 +5573,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5169
5573
|
};
|
|
5170
5574
|
function getTemplateRange(templateExpr) {
|
|
5171
5575
|
const startPos = templateExpr.getStart() + 1;
|
|
5172
|
-
const { line, character } =
|
|
5576
|
+
const { line, character } = ts21.getLineAndCharacterOfPosition(templateExpr.getSourceFile(), startPos);
|
|
5173
5577
|
return {
|
|
5174
5578
|
startPos,
|
|
5175
5579
|
startLine: line,
|
|
@@ -5210,9 +5614,9 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
5210
5614
|
return null;
|
|
5211
5615
|
}
|
|
5212
5616
|
|
|
5213
|
-
// bazel-out/
|
|
5617
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
5214
5618
|
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression2, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr6 } from "@angular/compiler";
|
|
5215
|
-
import
|
|
5619
|
+
import ts22 from "typescript";
|
|
5216
5620
|
var InjectableDecoratorHandler = class {
|
|
5217
5621
|
constructor(reflector, isCore, strictCtorDeps, injectableRegistry, perf, errorOnDuplicateProv = true) {
|
|
5218
5622
|
this.reflector = reflector;
|
|
@@ -5303,7 +5707,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
5303
5707
|
};
|
|
5304
5708
|
} else if (decorator.args.length === 1) {
|
|
5305
5709
|
const metaNode = decorator.args[0];
|
|
5306
|
-
if (!
|
|
5710
|
+
if (!ts22.isObjectLiteralExpression(metaNode)) {
|
|
5307
5711
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, metaNode, `@Injectable argument must be an object literal`);
|
|
5308
5712
|
}
|
|
5309
5713
|
const meta = reflectObjectLiteral(metaNode);
|
|
@@ -5311,7 +5715,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
5311
5715
|
let deps = void 0;
|
|
5312
5716
|
if ((meta.has("useClass") || meta.has("useFactory")) && meta.has("deps")) {
|
|
5313
5717
|
const depsExpr = meta.get("deps");
|
|
5314
|
-
if (!
|
|
5718
|
+
if (!ts22.isArrayLiteralExpression(depsExpr)) {
|
|
5315
5719
|
throw new FatalDiagnosticError(ErrorCode.VALUE_NOT_LITERAL, depsExpr, `@Injectable deps metadata must be an inline array`);
|
|
5316
5720
|
}
|
|
5317
5721
|
deps = depsExpr.elements.map((dep) => getDep(dep, reflector));
|
|
@@ -5393,12 +5797,12 @@ function getDep(dep, reflector) {
|
|
|
5393
5797
|
}
|
|
5394
5798
|
return true;
|
|
5395
5799
|
}
|
|
5396
|
-
if (
|
|
5800
|
+
if (ts22.isArrayLiteralExpression(dep)) {
|
|
5397
5801
|
dep.elements.forEach((el) => {
|
|
5398
5802
|
let isDecorator = false;
|
|
5399
|
-
if (
|
|
5803
|
+
if (ts22.isIdentifier(el)) {
|
|
5400
5804
|
isDecorator = maybeUpdateDecorator(el, reflector);
|
|
5401
|
-
} else if (
|
|
5805
|
+
} else if (ts22.isNewExpression(el) && ts22.isIdentifier(el.expression)) {
|
|
5402
5806
|
const token = el.arguments && el.arguments.length > 0 && el.arguments[0] || void 0;
|
|
5403
5807
|
isDecorator = maybeUpdateDecorator(el.expression, reflector, token);
|
|
5404
5808
|
}
|
|
@@ -5410,9 +5814,9 @@ function getDep(dep, reflector) {
|
|
|
5410
5814
|
return meta;
|
|
5411
5815
|
}
|
|
5412
5816
|
|
|
5413
|
-
// bazel-out/
|
|
5817
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
|
|
5414
5818
|
import { compileClassMetadata as compileClassMetadata5, compileDeclareClassMetadata as compileDeclareClassMetadata5, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
5415
|
-
import
|
|
5819
|
+
import ts23 from "typescript";
|
|
5416
5820
|
var PipeSymbol = class extends SemanticSymbol {
|
|
5417
5821
|
constructor(decl, name) {
|
|
5418
5822
|
super(decl);
|
|
@@ -5467,7 +5871,7 @@ var PipeDecoratorHandler = class {
|
|
|
5467
5871
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), "@Pipe must have exactly one argument");
|
|
5468
5872
|
}
|
|
5469
5873
|
const meta = unwrapExpression(decorator.args[0]);
|
|
5470
|
-
if (!
|
|
5874
|
+
if (!ts23.isObjectLiteralExpression(meta)) {
|
|
5471
5875
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@Pipe must have a literal argument");
|
|
5472
5876
|
}
|
|
5473
5877
|
const pipe = reflectObjectLiteral(meta);
|
|
@@ -5535,7 +5939,7 @@ var PipeDecoratorHandler = class {
|
|
|
5535
5939
|
}
|
|
5536
5940
|
};
|
|
5537
5941
|
|
|
5538
|
-
// bazel-out/
|
|
5942
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/references_registry.mjs
|
|
5539
5943
|
var NoopReferencesRegistry = class {
|
|
5540
5944
|
add(source, ...references) {
|
|
5541
5945
|
}
|
|
@@ -5556,6 +5960,15 @@ export {
|
|
|
5556
5960
|
CompilationMode,
|
|
5557
5961
|
HandlerFlags,
|
|
5558
5962
|
aliasTransformFactory,
|
|
5963
|
+
isShim,
|
|
5964
|
+
copyFileShimData,
|
|
5965
|
+
untagAllTsFiles,
|
|
5966
|
+
retagAllTsFiles,
|
|
5967
|
+
ShimAdapter,
|
|
5968
|
+
FactoryGenerator,
|
|
5969
|
+
generatedFactoryTransform,
|
|
5970
|
+
ShimReferenceTagger,
|
|
5971
|
+
SummaryGenerator,
|
|
5559
5972
|
TraitState,
|
|
5560
5973
|
TraitCompiler,
|
|
5561
5974
|
DtsTransformRegistry,
|
|
@@ -5577,4 +5990,5 @@ export {
|
|
|
5577
5990
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5578
5991
|
* found in the LICENSE file at https://angular.io/license
|
|
5579
5992
|
*/
|
|
5580
|
-
|
|
5993
|
+
// Closure Compiler ignores @suppress and similar if the comment contains @license.
|
|
5994
|
+
//# sourceMappingURL=chunk-L23I4NJT.js.map
|