@angular/compiler-cli 19.2.1 → 19.2.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-RQP5TAHR.js → chunk-2OGNON3Y.js} +5 -5
- package/bundles/{chunk-77D5CI2U.js → chunk-5UDS2TPQ.js} +7 -7
- package/bundles/{chunk-FKXFEX7K.js → chunk-GBKXY6BH.js} +3 -3
- package/bundles/{chunk-Q2WE7ECN.js → chunk-I6R3GL3L.js} +5 -5
- package/bundles/{chunk-OZ2WSYWM.js → chunk-KOIBHR3X.js} +42 -42
- package/bundles/{chunk-J7S5XIBF.js → chunk-RNO4EXM5.js} +31 -31
- package/bundles/{chunk-37JMVF7H.js → chunk-STORTTKY.js} +8 -8
- package/bundles/{chunk-GYTY2X5V.js → chunk-YEQZ4XY7.js} +12 -12
- package/bundles/{chunk-J2ZUZS7X.js → chunk-YNWO773W.js} +728 -696
- package/bundles/chunk-YNWO773W.js.map +6 -0
- package/bundles/{chunk-YDD3LCLX.js → chunk-Z4732XCW.js} +138 -107
- package/bundles/chunk-Z4732XCW.js.map +6 -0
- package/bundles/{chunk-ZWSJXDI6.js → chunk-ZSPLLTLI.js} +3 -3
- package/bundles/index.js +12 -12
- package/bundles/linker/babel/index.js +12 -12
- package/bundles/linker/index.js +4 -4
- package/bundles/ngcc/index.js +1 -1
- 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 +6 -6
- package/bundles/src/bin/ng_xi18n.js +10 -10
- package/bundles/src/bin/ngc.js +8 -8
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +2 -2
- package/private/migrations.d.ts +1 -1
- package/src/ngtsc/annotations/common/src/evaluation.d.ts +1 -1
- package/src/ngtsc/annotations/common/src/util.d.ts +19 -2
- package/src/ngtsc/annotations/component/src/metadata.d.ts +2 -2
- package/src/ngtsc/annotations/component/src/resources.d.ts +2 -2
- package/src/ngtsc/annotations/index.d.ts +1 -1
- package/src/ngtsc/core/api/src/options.d.ts +8 -0
- package/src/ngtsc/core/src/compiler.d.ts +3 -3
- package/src/ngtsc/docs/src/function_extractor.d.ts +1 -1
- package/src/ngtsc/hmr/src/update_declaration.d.ts +3 -2
- package/src/ngtsc/metadata/index.d.ts +1 -1
- package/src/ngtsc/metadata/src/resource_registry.d.ts +9 -8
- package/src/ngtsc/typecheck/api/api.d.ts +22 -24
- package/src/ngtsc/typecheck/api/checker.d.ts +3 -3
- package/src/ngtsc/typecheck/api/context.d.ts +26 -17
- package/src/ngtsc/typecheck/diagnostics/src/diagnostic.d.ts +2 -2
- package/src/ngtsc/typecheck/diagnostics/src/id.d.ts +2 -2
- package/src/ngtsc/typecheck/src/checker.d.ts +6 -6
- package/src/ngtsc/typecheck/src/completion.d.ts +2 -2
- package/src/ngtsc/typecheck/src/context.d.ts +24 -26
- package/src/ngtsc/typecheck/src/diagnostics.d.ts +5 -5
- package/src/ngtsc/typecheck/src/dom.d.ts +5 -5
- package/src/ngtsc/typecheck/src/oob.d.ts +41 -45
- package/src/ngtsc/typecheck/src/source.d.ts +11 -11
- package/src/ngtsc/typecheck/src/tcb_util.d.ts +15 -15
- package/src/ngtsc/typecheck/src/template_symbol_builder.d.ts +3 -3
- package/src/ngtsc/typecheck/src/type_check_block.d.ts +3 -3
- package/bundles/chunk-J2ZUZS7X.js.map +0 -6
- package/bundles/chunk-YDD3LCLX.js.map +0 -6
- /package/bundles/{chunk-RQP5TAHR.js.map → chunk-2OGNON3Y.js.map} +0 -0
- /package/bundles/{chunk-77D5CI2U.js.map → chunk-5UDS2TPQ.js.map} +0 -0
- /package/bundles/{chunk-FKXFEX7K.js.map → chunk-GBKXY6BH.js.map} +0 -0
- /package/bundles/{chunk-Q2WE7ECN.js.map → chunk-I6R3GL3L.js.map} +0 -0
- /package/bundles/{chunk-OZ2WSYWM.js.map → chunk-KOIBHR3X.js.map} +0 -0
- /package/bundles/{chunk-J7S5XIBF.js.map → chunk-RNO4EXM5.js.map} +0 -0
- /package/bundles/{chunk-37JMVF7H.js.map → chunk-STORTTKY.js.map} +0 -0
- /package/bundles/{chunk-GYTY2X5V.js.map → chunk-YEQZ4XY7.js.map} +0 -0
- /package/bundles/{chunk-ZWSJXDI6.js.map → chunk-ZSPLLTLI.js.map} +0 -0
|
@@ -48,23 +48,23 @@ import {
|
|
|
48
48
|
translateStatement,
|
|
49
49
|
translateType,
|
|
50
50
|
typeNodeToValueExpr
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-KOIBHR3X.js";
|
|
52
52
|
import {
|
|
53
53
|
PerfCheckpoint,
|
|
54
54
|
PerfEvent,
|
|
55
55
|
PerfPhase
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-I6R3GL3L.js";
|
|
57
57
|
import {
|
|
58
58
|
absoluteFrom,
|
|
59
59
|
absoluteFromSourceFile,
|
|
60
60
|
getSourceFileOrError,
|
|
61
61
|
relative
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-STORTTKY.js";
|
|
63
63
|
import {
|
|
64
64
|
__publicField
|
|
65
65
|
} from "./chunk-KPQ72R34.js";
|
|
66
66
|
|
|
67
|
-
// bazel-out/
|
|
67
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/util.mjs
|
|
68
68
|
import { ExternalExpr, ParseLocation, ParseSourceFile, ParseSourceSpan, ReadPropExpr, WrappedNodeExpr } from "@angular/compiler";
|
|
69
69
|
import ts from "typescript";
|
|
70
70
|
var CORE_MODULE = "@angular/core";
|
|
@@ -103,8 +103,9 @@ function toR3Reference(origin, ref, context, refEmitter) {
|
|
|
103
103
|
function isAngularCore(decorator) {
|
|
104
104
|
return decorator.import !== null && decorator.import.from === CORE_MODULE;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
|
|
106
|
+
function isAngularCoreReferenceWithPotentialAliasing(reference, symbolName, isCore) {
|
|
107
|
+
var _a;
|
|
108
|
+
return (reference.ownedByModuleGuess === CORE_MODULE || isCore) && ((_a = reference.debugName) == null ? void 0 : _a.replace(/\$\d+$/, "")) === symbolName;
|
|
108
109
|
}
|
|
109
110
|
function findAngularDecorator(decorators, name, isCore) {
|
|
110
111
|
return decorators.find((decorator) => isAngularDecorator(decorator, name, isCore));
|
|
@@ -171,17 +172,19 @@ function tryUnwrapForwardRef(node, reflector) {
|
|
|
171
172
|
}
|
|
172
173
|
return expr;
|
|
173
174
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
175
|
+
function createForwardRefResolver(isCore) {
|
|
176
|
+
return (fn, callExpr, resolve, unresolvable) => {
|
|
177
|
+
if (!isAngularCoreReferenceWithPotentialAliasing(fn, "forwardRef", isCore) || callExpr.arguments.length !== 1) {
|
|
178
|
+
return unresolvable;
|
|
179
|
+
}
|
|
180
|
+
const expanded = expandForwardRef(callExpr.arguments[0]);
|
|
181
|
+
if (expanded !== null) {
|
|
182
|
+
return resolve(expanded);
|
|
183
|
+
} else {
|
|
184
|
+
return unresolvable;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
}
|
|
185
188
|
function combineResolvers(resolvers) {
|
|
186
189
|
return (fn, callExpr, resolve, unresolvable) => {
|
|
187
190
|
for (const resolver of resolvers) {
|
|
@@ -326,7 +329,7 @@ function isAbstractClassDeclaration(clazz) {
|
|
|
326
329
|
return ts.canHaveModifiers(clazz) && clazz.modifiers !== void 0 ? clazz.modifiers.some((mod) => mod.kind === ts.SyntaxKind.AbstractKeyword) : false;
|
|
327
330
|
}
|
|
328
331
|
|
|
329
|
-
// bazel-out/
|
|
332
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/dynamic.mjs
|
|
330
333
|
var DynamicValue = class {
|
|
331
334
|
node;
|
|
332
335
|
reason;
|
|
@@ -419,10 +422,10 @@ var DynamicValue = class {
|
|
|
419
422
|
}
|
|
420
423
|
};
|
|
421
424
|
|
|
422
|
-
// bazel-out/
|
|
425
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
423
426
|
import ts2 from "typescript";
|
|
424
427
|
|
|
425
|
-
// bazel-out/
|
|
428
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/result.mjs
|
|
426
429
|
var ResolvedModule = class {
|
|
427
430
|
exports;
|
|
428
431
|
evaluate;
|
|
@@ -457,7 +460,7 @@ var EnumValue = class {
|
|
|
457
460
|
var KnownFn = class {
|
|
458
461
|
};
|
|
459
462
|
|
|
460
|
-
// bazel-out/
|
|
463
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/builtin.mjs
|
|
461
464
|
var ArraySliceBuiltinFn = class extends KnownFn {
|
|
462
465
|
lhs;
|
|
463
466
|
constructor(lhs) {
|
|
@@ -512,7 +515,7 @@ var StringConcatBuiltinFn = class extends KnownFn {
|
|
|
512
515
|
}
|
|
513
516
|
};
|
|
514
517
|
|
|
515
|
-
// bazel-out/
|
|
518
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/synthetic.mjs
|
|
516
519
|
var SyntheticValue = class {
|
|
517
520
|
value;
|
|
518
521
|
constructor(value) {
|
|
@@ -520,7 +523,7 @@ var SyntheticValue = class {
|
|
|
520
523
|
}
|
|
521
524
|
};
|
|
522
525
|
|
|
523
|
-
// bazel-out/
|
|
526
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
524
527
|
function literalBinaryOp(op) {
|
|
525
528
|
return { op, literal: true };
|
|
526
529
|
}
|
|
@@ -1101,7 +1104,7 @@ function owningModule(context, override = null) {
|
|
|
1101
1104
|
}
|
|
1102
1105
|
}
|
|
1103
1106
|
|
|
1104
|
-
// bazel-out/
|
|
1107
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interface.mjs
|
|
1105
1108
|
var PartialEvaluator = class {
|
|
1106
1109
|
host;
|
|
1107
1110
|
checker;
|
|
@@ -1124,7 +1127,7 @@ var PartialEvaluator = class {
|
|
|
1124
1127
|
}
|
|
1125
1128
|
};
|
|
1126
1129
|
|
|
1127
|
-
// bazel-out/
|
|
1130
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
|
|
1128
1131
|
import ts3 from "typescript";
|
|
1129
1132
|
function describeResolvedType(value, maxDepth = 1) {
|
|
1130
1133
|
var _a, _b;
|
|
@@ -1259,14 +1262,14 @@ function getContainerNode(node) {
|
|
|
1259
1262
|
return node.getSourceFile();
|
|
1260
1263
|
}
|
|
1261
1264
|
|
|
1262
|
-
// bazel-out/
|
|
1265
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/checker.mjs
|
|
1263
1266
|
var OptimizeFor;
|
|
1264
1267
|
(function(OptimizeFor2) {
|
|
1265
1268
|
OptimizeFor2[OptimizeFor2["SingleFile"] = 0] = "SingleFile";
|
|
1266
1269
|
OptimizeFor2[OptimizeFor2["WholeProgram"] = 1] = "WholeProgram";
|
|
1267
1270
|
})(OptimizeFor || (OptimizeFor = {}));
|
|
1268
1271
|
|
|
1269
|
-
// bazel-out/
|
|
1272
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/scope.mjs
|
|
1270
1273
|
var PotentialImportKind;
|
|
1271
1274
|
(function(PotentialImportKind2) {
|
|
1272
1275
|
PotentialImportKind2[PotentialImportKind2["NgModule"] = 0] = "NgModule";
|
|
@@ -1278,7 +1281,7 @@ var PotentialImportMode;
|
|
|
1278
1281
|
PotentialImportMode2[PotentialImportMode2["ForceDirect"] = 1] = "ForceDirect";
|
|
1279
1282
|
})(PotentialImportMode || (PotentialImportMode = {}));
|
|
1280
1283
|
|
|
1281
|
-
// bazel-out/
|
|
1284
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/completion.mjs
|
|
1282
1285
|
var CompletionKind;
|
|
1283
1286
|
(function(CompletionKind2) {
|
|
1284
1287
|
CompletionKind2[CompletionKind2["Reference"] = 0] = "Reference";
|
|
@@ -1286,7 +1289,7 @@ var CompletionKind;
|
|
|
1286
1289
|
CompletionKind2[CompletionKind2["LetDeclaration"] = 2] = "LetDeclaration";
|
|
1287
1290
|
})(CompletionKind || (CompletionKind = {}));
|
|
1288
1291
|
|
|
1289
|
-
// bazel-out/
|
|
1292
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/symbols.mjs
|
|
1290
1293
|
var SymbolKind;
|
|
1291
1294
|
(function(SymbolKind2) {
|
|
1292
1295
|
SymbolKind2[SymbolKind2["Input"] = 0] = "Input";
|
|
@@ -1303,7 +1306,7 @@ var SymbolKind;
|
|
|
1303
1306
|
SymbolKind2[SymbolKind2["LetDeclaration"] = 11] = "LetDeclaration";
|
|
1304
1307
|
})(SymbolKind || (SymbolKind = {}));
|
|
1305
1308
|
|
|
1306
|
-
// bazel-out/
|
|
1309
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/di.mjs
|
|
1307
1310
|
import { LiteralExpr, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
|
|
1308
1311
|
import ts4 from "typescript";
|
|
1309
1312
|
function getConstructorDependencies(clazz, reflector, isCore) {
|
|
@@ -1449,10 +1452,10 @@ function createUnsuitableInjectionTokenError(clazz, error) {
|
|
|
1449
1452
|
return new FatalDiagnosticError(ErrorCode.PARAM_MISSING_TOKEN, param.nameNode, chain, hints);
|
|
1450
1453
|
}
|
|
1451
1454
|
|
|
1452
|
-
// bazel-out/
|
|
1455
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/diagnostics.mjs
|
|
1453
1456
|
import ts12 from "typescript";
|
|
1454
1457
|
|
|
1455
|
-
// bazel-out/
|
|
1458
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/api.mjs
|
|
1456
1459
|
var MetaKind;
|
|
1457
1460
|
(function(MetaKind2) {
|
|
1458
1461
|
MetaKind2[MetaKind2["Directive"] = 0] = "Directive";
|
|
@@ -1465,10 +1468,10 @@ var MatchSource;
|
|
|
1465
1468
|
MatchSource2[MatchSource2["HostDirective"] = 1] = "HostDirective";
|
|
1466
1469
|
})(MatchSource || (MatchSource = {}));
|
|
1467
1470
|
|
|
1468
|
-
// bazel-out/
|
|
1471
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1469
1472
|
import ts6 from "typescript";
|
|
1470
1473
|
|
|
1471
|
-
// bazel-out/
|
|
1474
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/property_mapping.mjs
|
|
1472
1475
|
var ClassPropertyMapping = class {
|
|
1473
1476
|
forwardMap;
|
|
1474
1477
|
reverseMap;
|
|
@@ -1550,7 +1553,7 @@ function reverseMapFromForwardMap(forwardMap) {
|
|
|
1550
1553
|
return reverseMap;
|
|
1551
1554
|
}
|
|
1552
1555
|
|
|
1553
|
-
// bazel-out/
|
|
1556
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/util.mjs
|
|
1554
1557
|
import ts5 from "typescript";
|
|
1555
1558
|
function extractReferencesFromType(checker, def, bestGuessOwningModule) {
|
|
1556
1559
|
if (!ts5.isTupleTypeNode(def)) {
|
|
@@ -1766,7 +1769,7 @@ function isHostDirectiveMetaForGlobalMode(hostDirectiveMeta) {
|
|
|
1766
1769
|
return hostDirectiveMeta.directive instanceof Reference;
|
|
1767
1770
|
}
|
|
1768
1771
|
|
|
1769
|
-
// bazel-out/
|
|
1772
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1770
1773
|
var DtsMetadataReader = class {
|
|
1771
1774
|
checker;
|
|
1772
1775
|
reflector;
|
|
@@ -1965,7 +1968,7 @@ function readHostDirectivesType(checker, type, bestGuessOwningModule) {
|
|
|
1965
1968
|
return result.length > 0 ? { result, isIncomplete } : null;
|
|
1966
1969
|
}
|
|
1967
1970
|
|
|
1968
|
-
// bazel-out/
|
|
1971
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/inheritance.mjs
|
|
1969
1972
|
function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
1970
1973
|
const topMeta = reader.getDirectiveMetadata(dir);
|
|
1971
1974
|
if (topMeta === null) {
|
|
@@ -2029,7 +2032,7 @@ function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
|
2029
2032
|
};
|
|
2030
2033
|
}
|
|
2031
2034
|
|
|
2032
|
-
// bazel-out/
|
|
2035
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/registry.mjs
|
|
2033
2036
|
var LocalMetadataRegistry = class {
|
|
2034
2037
|
directives = /* @__PURE__ */ new Map();
|
|
2035
2038
|
ngModules = /* @__PURE__ */ new Map();
|
|
@@ -2085,7 +2088,7 @@ var CompoundMetadataRegistry = class {
|
|
|
2085
2088
|
}
|
|
2086
2089
|
};
|
|
2087
2090
|
|
|
2088
|
-
// bazel-out/
|
|
2091
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/resource_registry.mjs
|
|
2089
2092
|
var ResourceRegistry = class {
|
|
2090
2093
|
externalTemplateToComponentsMap = /* @__PURE__ */ new Map();
|
|
2091
2094
|
componentToTemplateMap = /* @__PURE__ */ new Map();
|
|
@@ -2097,12 +2100,14 @@ var ResourceRegistry = class {
|
|
|
2097
2100
|
}
|
|
2098
2101
|
return this.externalTemplateToComponentsMap.get(template);
|
|
2099
2102
|
}
|
|
2100
|
-
registerResources(resources,
|
|
2103
|
+
registerResources(resources, directive) {
|
|
2101
2104
|
if (resources.template !== null) {
|
|
2102
|
-
this.registerTemplate(resources.template,
|
|
2105
|
+
this.registerTemplate(resources.template, directive);
|
|
2103
2106
|
}
|
|
2104
|
-
|
|
2105
|
-
|
|
2107
|
+
if (resources.styles !== null) {
|
|
2108
|
+
for (const style of resources.styles) {
|
|
2109
|
+
this.registerStyle(style, directive);
|
|
2110
|
+
}
|
|
2106
2111
|
}
|
|
2107
2112
|
}
|
|
2108
2113
|
registerTemplate(templateResource, component) {
|
|
@@ -2148,7 +2153,7 @@ var ResourceRegistry = class {
|
|
|
2148
2153
|
}
|
|
2149
2154
|
};
|
|
2150
2155
|
|
|
2151
|
-
// bazel-out/
|
|
2156
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/providers.mjs
|
|
2152
2157
|
var ExportedProviderStatusResolver = class {
|
|
2153
2158
|
metaReader;
|
|
2154
2159
|
calculating = /* @__PURE__ */ new Set();
|
|
@@ -2193,7 +2198,7 @@ var ExportedProviderStatusResolver = class {
|
|
|
2193
2198
|
}
|
|
2194
2199
|
};
|
|
2195
2200
|
|
|
2196
|
-
// bazel-out/
|
|
2201
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/host_directives_resolver.mjs
|
|
2197
2202
|
var EMPTY_ARRAY = [];
|
|
2198
2203
|
var HostDirectivesResolver = class {
|
|
2199
2204
|
metaReader;
|
|
@@ -2260,7 +2265,7 @@ function resolveOutput(bindingName) {
|
|
|
2260
2265
|
return bindingName;
|
|
2261
2266
|
}
|
|
2262
2267
|
|
|
2263
|
-
// bazel-out/
|
|
2268
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/api.mjs
|
|
2264
2269
|
var CompilationMode;
|
|
2265
2270
|
(function(CompilationMode2) {
|
|
2266
2271
|
CompilationMode2[CompilationMode2["FULL"] = 0] = "FULL";
|
|
@@ -2274,7 +2279,7 @@ var HandlerPrecedence;
|
|
|
2274
2279
|
HandlerPrecedence2[HandlerPrecedence2["WEAK"] = 2] = "WEAK";
|
|
2275
2280
|
})(HandlerPrecedence || (HandlerPrecedence = {}));
|
|
2276
2281
|
|
|
2277
|
-
// bazel-out/
|
|
2282
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/alias.mjs
|
|
2278
2283
|
import ts7 from "typescript";
|
|
2279
2284
|
function aliasTransformFactory(exportStatements) {
|
|
2280
2285
|
return () => {
|
|
@@ -2299,10 +2304,10 @@ function aliasTransformFactory(exportStatements) {
|
|
|
2299
2304
|
};
|
|
2300
2305
|
}
|
|
2301
2306
|
|
|
2302
|
-
// bazel-out/
|
|
2307
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
2303
2308
|
import ts8 from "typescript";
|
|
2304
2309
|
|
|
2305
|
-
// bazel-out/
|
|
2310
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/trait.mjs
|
|
2306
2311
|
var TraitState;
|
|
2307
2312
|
(function(TraitState2) {
|
|
2308
2313
|
TraitState2[TraitState2["Pending"] = 0] = "Pending";
|
|
@@ -2361,7 +2366,7 @@ var TraitImpl = class {
|
|
|
2361
2366
|
}
|
|
2362
2367
|
};
|
|
2363
2368
|
|
|
2364
|
-
// bazel-out/
|
|
2369
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
2365
2370
|
var TraitCompiler = class {
|
|
2366
2371
|
handlers;
|
|
2367
2372
|
reflector;
|
|
@@ -2842,7 +2847,7 @@ function containsErrors(diagnostics) {
|
|
|
2842
2847
|
return diagnostics !== null && diagnostics.some((diag) => diag.category === ts8.DiagnosticCategory.Error);
|
|
2843
2848
|
}
|
|
2844
2849
|
|
|
2845
|
-
// bazel-out/
|
|
2850
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
2846
2851
|
import ts9 from "typescript";
|
|
2847
2852
|
var DtsTransformRegistry = class {
|
|
2848
2853
|
ivyDeclarationTransforms = /* @__PURE__ */ new Map();
|
|
@@ -2992,11 +2997,11 @@ function markForEmitAsSingleLine(node) {
|
|
|
2992
2997
|
ts9.forEachChild(node, markForEmitAsSingleLine);
|
|
2993
2998
|
}
|
|
2994
2999
|
|
|
2995
|
-
// bazel-out/
|
|
3000
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
2996
3001
|
import { ConstantPool } from "@angular/compiler";
|
|
2997
3002
|
import ts11 from "typescript";
|
|
2998
3003
|
|
|
2999
|
-
// bazel-out/
|
|
3004
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
|
|
3000
3005
|
import ts10 from "typescript";
|
|
3001
3006
|
function visit(node, visitor, context) {
|
|
3002
3007
|
return visitor._visit(node, context);
|
|
@@ -3055,7 +3060,7 @@ var Visitor = class {
|
|
|
3055
3060
|
}
|
|
3056
3061
|
};
|
|
3057
3062
|
|
|
3058
|
-
// bazel-out/
|
|
3063
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
3059
3064
|
var NO_DECORATORS = /* @__PURE__ */ new Set();
|
|
3060
3065
|
var CLOSURE_FILE_OVERVIEW_REGEXP = /\s+@fileoverview\s+/i;
|
|
3061
3066
|
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, localCompilationExtraImportsTracker, perf, isCore, isClosureCompilerEnabled) {
|
|
@@ -3301,7 +3306,7 @@ function nodeArrayFromDecoratorsArray(decorators) {
|
|
|
3301
3306
|
return array;
|
|
3302
3307
|
}
|
|
3303
3308
|
|
|
3304
|
-
// bazel-out/
|
|
3309
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/diagnostics.mjs
|
|
3305
3310
|
function makeDuplicateDeclarationError(node, data, kind) {
|
|
3306
3311
|
const context = [];
|
|
3307
3312
|
for (const decl of data) {
|
|
@@ -3510,15 +3515,15 @@ function assertLocalCompilationUnresolvedConst(compilationMode, value, nodeToHig
|
|
|
3510
3515
|
}
|
|
3511
3516
|
}
|
|
3512
3517
|
|
|
3513
|
-
// bazel-out/
|
|
3518
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/evaluation.mjs
|
|
3514
3519
|
import { ViewEncapsulation } from "@angular/compiler";
|
|
3515
3520
|
import ts13 from "typescript";
|
|
3516
|
-
function resolveEnumValue(evaluator, metadata, field, enumSymbolName) {
|
|
3521
|
+
function resolveEnumValue(evaluator, metadata, field, enumSymbolName, isCore) {
|
|
3517
3522
|
let resolved = null;
|
|
3518
3523
|
if (metadata.has(field)) {
|
|
3519
3524
|
const expr = metadata.get(field);
|
|
3520
3525
|
const value = evaluator.evaluate(expr);
|
|
3521
|
-
if (value instanceof EnumValue &&
|
|
3526
|
+
if (value instanceof EnumValue && isAngularCoreReferenceWithPotentialAliasing(value.enumRef, enumSymbolName, isCore)) {
|
|
3522
3527
|
resolved = value.resolved;
|
|
3523
3528
|
} else {
|
|
3524
3529
|
throw createValueHasWrongTypeError(expr, value, `${field} must be a member of ${enumSymbolName} enum from @angular/core`);
|
|
@@ -3561,7 +3566,7 @@ function resolveLiteral(decorator, literalCache) {
|
|
|
3561
3566
|
return meta;
|
|
3562
3567
|
}
|
|
3563
3568
|
|
|
3564
|
-
// bazel-out/
|
|
3569
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/factory.mjs
|
|
3565
3570
|
import { compileDeclareFactoryFunction, compileFactoryFunction } from "@angular/compiler";
|
|
3566
3571
|
function compileNgFactoryDefField(metadata) {
|
|
3567
3572
|
const res = compileFactoryFunction(metadata);
|
|
@@ -3584,7 +3589,7 @@ function compileDeclareFactory(metadata) {
|
|
|
3584
3589
|
};
|
|
3585
3590
|
}
|
|
3586
3591
|
|
|
3587
|
-
// bazel-out/
|
|
3592
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/injectable_registry.mjs
|
|
3588
3593
|
var InjectableClassRegistry = class {
|
|
3589
3594
|
host;
|
|
3590
3595
|
isCore;
|
|
@@ -3612,7 +3617,7 @@ var InjectableClassRegistry = class {
|
|
|
3612
3617
|
}
|
|
3613
3618
|
};
|
|
3614
3619
|
|
|
3615
|
-
// bazel-out/
|
|
3620
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/metadata.mjs
|
|
3616
3621
|
import { ArrowFunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, WrappedNodeExpr as WrappedNodeExpr3 } from "@angular/compiler";
|
|
3617
3622
|
import ts14 from "typescript";
|
|
3618
3623
|
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
|
|
@@ -3699,7 +3704,7 @@ function removeIdentifierReferences(node, names) {
|
|
|
3699
3704
|
return result.transformed[0];
|
|
3700
3705
|
}
|
|
3701
3706
|
|
|
3702
|
-
// bazel-out/
|
|
3707
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/debug_info.mjs
|
|
3703
3708
|
import { literal as literal2, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
|
|
3704
3709
|
function extractClassDebugInfo(clazz, reflection, compilerHost, rootDirs, forbidOrphanRendering) {
|
|
3705
3710
|
if (!reflection.isClass(clazz)) {
|
|
@@ -3716,13 +3721,13 @@ function extractClassDebugInfo(clazz, reflection, compilerHost, rootDirs, forbid
|
|
|
3716
3721
|
};
|
|
3717
3722
|
}
|
|
3718
3723
|
|
|
3719
|
-
// bazel-out/
|
|
3724
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/references_registry.mjs
|
|
3720
3725
|
var NoopReferencesRegistry = class {
|
|
3721
3726
|
add(source, ...references) {
|
|
3722
3727
|
}
|
|
3723
3728
|
};
|
|
3724
3729
|
|
|
3725
|
-
// bazel-out/
|
|
3730
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/schema.mjs
|
|
3726
3731
|
import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from "@angular/compiler";
|
|
3727
3732
|
function extractSchemas(rawExpr, evaluator, context) {
|
|
3728
3733
|
const schemas = [];
|
|
@@ -3752,7 +3757,7 @@ function extractSchemas(rawExpr, evaluator, context) {
|
|
|
3752
3757
|
return schemas;
|
|
3753
3758
|
}
|
|
3754
3759
|
|
|
3755
|
-
// bazel-out/
|
|
3760
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/input_transforms.mjs
|
|
3756
3761
|
import { outputAst } from "@angular/compiler";
|
|
3757
3762
|
function compileInputTransformFields(inputs) {
|
|
3758
3763
|
const extraFields = [];
|
|
@@ -3770,16 +3775,16 @@ function compileInputTransformFields(inputs) {
|
|
|
3770
3775
|
return extraFields;
|
|
3771
3776
|
}
|
|
3772
3777
|
|
|
3773
|
-
// bazel-out/
|
|
3778
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/jit_declaration_registry.mjs
|
|
3774
3779
|
var JitDeclarationRegistry = class {
|
|
3775
3780
|
jitDeclarations = /* @__PURE__ */ new Set();
|
|
3776
3781
|
};
|
|
3777
3782
|
|
|
3778
|
-
// bazel-out/
|
|
3783
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
|
|
3779
3784
|
import { compileClassDebugInfo, compileHmrInitializer, compileComponentClassMetadata, compileComponentDeclareClassMetadata, compileComponentFromMetadata, compileDeclareComponentFromMetadata, compileDeferResolverFunction, ConstantPool as ConstantPool2, CssSelector as CssSelector4, DEFAULT_INTERPOLATION_CONFIG as DEFAULT_INTERPOLATION_CONFIG2, DomElementSchemaRegistry as DomElementSchemaRegistry3, ExternalExpr as ExternalExpr8, FactoryTarget as FactoryTarget3, makeBindingParser as makeBindingParser2, outputAst as o4, R3TargetBinder, R3TemplateDependencyKind, SelectorMatcher as SelectorMatcher3, ViewEncapsulation as ViewEncapsulation2 } from "@angular/compiler";
|
|
3780
|
-
import
|
|
3785
|
+
import ts49 from "typescript";
|
|
3781
3786
|
|
|
3782
|
-
// bazel-out/
|
|
3787
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
3783
3788
|
import ts15 from "typescript";
|
|
3784
3789
|
var SemanticSymbol = class {
|
|
3785
3790
|
decl;
|
|
@@ -3798,7 +3803,7 @@ function getSymbolIdentifier(decl) {
|
|
|
3798
3803
|
return decl.name.text;
|
|
3799
3804
|
}
|
|
3800
3805
|
|
|
3801
|
-
// bazel-out/
|
|
3806
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/graph.mjs
|
|
3802
3807
|
import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
|
|
3803
3808
|
var OpaqueSymbol = class extends SemanticSymbol {
|
|
3804
3809
|
isPublicApiAffected() {
|
|
@@ -3940,10 +3945,10 @@ function getImportPath(expr) {
|
|
|
3940
3945
|
}
|
|
3941
3946
|
}
|
|
3942
3947
|
|
|
3943
|
-
// bazel-out/
|
|
3948
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
3944
3949
|
import ts16 from "typescript";
|
|
3945
3950
|
|
|
3946
|
-
// bazel-out/
|
|
3951
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/util.mjs
|
|
3947
3952
|
function isSymbolEqual(a, b) {
|
|
3948
3953
|
if (a.decl === b.decl) {
|
|
3949
3954
|
return true;
|
|
@@ -3993,7 +3998,7 @@ function isSetEqual(a, b, equalityTester = referenceEquality) {
|
|
|
3993
3998
|
return true;
|
|
3994
3999
|
}
|
|
3995
4000
|
|
|
3996
|
-
// bazel-out/
|
|
4001
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
3997
4002
|
function extractSemanticTypeParameters(node) {
|
|
3998
4003
|
if (!ts16.isClassDeclaration(node) || node.typeParameters === void 0) {
|
|
3999
4004
|
return null;
|
|
@@ -4015,14 +4020,14 @@ function isTypeParameterEqual(a, b) {
|
|
|
4015
4020
|
return a.hasGenericTypeBound === b.hasGenericTypeBound;
|
|
4016
4021
|
}
|
|
4017
4022
|
|
|
4018
|
-
// bazel-out/
|
|
4023
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/api.mjs
|
|
4019
4024
|
var ComponentScopeKind;
|
|
4020
4025
|
(function(ComponentScopeKind2) {
|
|
4021
4026
|
ComponentScopeKind2[ComponentScopeKind2["NgModule"] = 0] = "NgModule";
|
|
4022
4027
|
ComponentScopeKind2[ComponentScopeKind2["Standalone"] = 1] = "Standalone";
|
|
4023
4028
|
})(ComponentScopeKind || (ComponentScopeKind = {}));
|
|
4024
4029
|
|
|
4025
|
-
// bazel-out/
|
|
4030
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/component_scope.mjs
|
|
4026
4031
|
var CompoundComponentScopeReader = class {
|
|
4027
4032
|
readers;
|
|
4028
4033
|
constructor(readers) {
|
|
@@ -4048,7 +4053,7 @@ var CompoundComponentScopeReader = class {
|
|
|
4048
4053
|
}
|
|
4049
4054
|
};
|
|
4050
4055
|
|
|
4051
|
-
// bazel-out/
|
|
4056
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/dependency.mjs
|
|
4052
4057
|
var MetadataDtsModuleScopeResolver = class {
|
|
4053
4058
|
dtsMetaReader;
|
|
4054
4059
|
aliasingHost;
|
|
@@ -4126,11 +4131,11 @@ var MetadataDtsModuleScopeResolver = class {
|
|
|
4126
4131
|
}
|
|
4127
4132
|
};
|
|
4128
4133
|
|
|
4129
|
-
// bazel-out/
|
|
4134
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/local.mjs
|
|
4130
4135
|
import { ExternalExpr as ExternalExpr3 } from "@angular/compiler";
|
|
4131
4136
|
import ts17 from "typescript";
|
|
4132
4137
|
|
|
4133
|
-
// bazel-out/
|
|
4138
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/util.mjs
|
|
4134
4139
|
function getDiagnosticNode(ref, rawExpr) {
|
|
4135
4140
|
return rawExpr !== null ? ref.getOriginForDiagnostics(rawExpr) : ref.node.name;
|
|
4136
4141
|
}
|
|
@@ -4156,7 +4161,7 @@ function makeUnknownComponentDeferredImportDiagnostic(ref, rawExpr) {
|
|
|
4156
4161
|
return makeDiagnostic(ErrorCode.COMPONENT_UNKNOWN_DEFERRED_IMPORT, getDiagnosticNode(ref, rawExpr), `Component deferred imports must be standalone components, directives or pipes.`);
|
|
4157
4162
|
}
|
|
4158
4163
|
|
|
4159
|
-
// bazel-out/
|
|
4164
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/local.mjs
|
|
4160
4165
|
var IN_PROGRESS_RESOLUTION = {};
|
|
4161
4166
|
var LocalModuleScopeRegistry = class {
|
|
4162
4167
|
localReader;
|
|
@@ -4515,7 +4520,7 @@ function reexportCollision(module, refA, refB) {
|
|
|
4515
4520
|
]);
|
|
4516
4521
|
}
|
|
4517
4522
|
|
|
4518
|
-
// bazel-out/
|
|
4523
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/typecheck.mjs
|
|
4519
4524
|
import { CssSelector, SelectorMatcher } from "@angular/compiler";
|
|
4520
4525
|
import ts18 from "typescript";
|
|
4521
4526
|
var TypeCheckScopeRegistry = class {
|
|
@@ -4599,14 +4604,14 @@ var TypeCheckScopeRegistry = class {
|
|
|
4599
4604
|
}
|
|
4600
4605
|
};
|
|
4601
4606
|
|
|
4602
|
-
// bazel-out/
|
|
4607
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/handler.mjs
|
|
4603
4608
|
import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, FactoryTarget, makeBindingParser, WrappedNodeExpr as WrappedNodeExpr6 } from "@angular/compiler";
|
|
4604
4609
|
|
|
4605
|
-
// bazel-out/
|
|
4610
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.mjs
|
|
4606
4611
|
import { createMayBeForwardRefExpression as createMayBeForwardRefExpression2, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr4, getSafePropertyAccessString, parseHostBindings, ParserError, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr5 } from "@angular/compiler";
|
|
4607
4612
|
import ts22 from "typescript";
|
|
4608
4613
|
|
|
4609
|
-
// bazel-out/
|
|
4614
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/initializer_function_access.mjs
|
|
4610
4615
|
function validateAccessOfInitializerApiMember({ api, call }, member) {
|
|
4611
4616
|
if (!api.allowedAccessLevels.includes(member.accessLevel)) {
|
|
4612
4617
|
throw new FatalDiagnosticError(ErrorCode.INITIALIZER_API_DISALLOWED_MEMBER_VISIBILITY, call, makeDiagnosticChain(`Cannot use "${api.functionName}" on a class member that is declared as ${classMemberAccessLevelToString(member.accessLevel)}.`, [
|
|
@@ -4615,7 +4620,7 @@ function validateAccessOfInitializerApiMember({ api, call }, member) {
|
|
|
4615
4620
|
}
|
|
4616
4621
|
}
|
|
4617
4622
|
|
|
4618
|
-
// bazel-out/
|
|
4623
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/initializer_functions.mjs
|
|
4619
4624
|
import ts19 from "typescript";
|
|
4620
4625
|
function tryParseInitializerApi(functions, expression, reflector, importTracker) {
|
|
4621
4626
|
if (!ts19.isCallExpression(expression)) {
|
|
@@ -4684,7 +4689,7 @@ function parseTopLevelCallFromNamespace(call, functions, importTracker) {
|
|
|
4684
4689
|
return { api: matchingApi, apiReference, isRequired };
|
|
4685
4690
|
}
|
|
4686
4691
|
|
|
4687
|
-
// bazel-out/
|
|
4692
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/input_output_parse_options.mjs
|
|
4688
4693
|
import ts20 from "typescript";
|
|
4689
4694
|
function parseAndValidateInputAndOutputOptions(optionsNode) {
|
|
4690
4695
|
if (!ts20.isObjectLiteralExpression(optionsNode)) {
|
|
@@ -4702,7 +4707,7 @@ function parseAndValidateInputAndOutputOptions(optionsNode) {
|
|
|
4702
4707
|
return { alias };
|
|
4703
4708
|
}
|
|
4704
4709
|
|
|
4705
|
-
// bazel-out/
|
|
4710
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/input_function.mjs
|
|
4706
4711
|
var INPUT_INITIALIZER_FN = {
|
|
4707
4712
|
functionName: "input",
|
|
4708
4713
|
owningModule: "@angular/core",
|
|
@@ -4734,7 +4739,7 @@ function tryParseSignalInputMapping(member, reflector, importTracker) {
|
|
|
4734
4739
|
};
|
|
4735
4740
|
}
|
|
4736
4741
|
|
|
4737
|
-
// bazel-out/
|
|
4742
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/model_function.mjs
|
|
4738
4743
|
var MODEL_INITIALIZER_FN = {
|
|
4739
4744
|
functionName: "model",
|
|
4740
4745
|
owningModule: "@angular/core",
|
|
@@ -4775,7 +4780,7 @@ function tryParseSignalModelMapping(member, reflector, importTracker) {
|
|
|
4775
4780
|
};
|
|
4776
4781
|
}
|
|
4777
4782
|
|
|
4778
|
-
// bazel-out/
|
|
4783
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/output_function.mjs
|
|
4779
4784
|
var allowedAccessLevels = [
|
|
4780
4785
|
ClassMemberAccessLevel.PublicWritable,
|
|
4781
4786
|
ClassMemberAccessLevel.PublicReadonly,
|
|
@@ -4819,7 +4824,7 @@ function tryParseInitializerBasedOutput(member, reflector, importTracker) {
|
|
|
4819
4824
|
};
|
|
4820
4825
|
}
|
|
4821
4826
|
|
|
4822
|
-
// bazel-out/
|
|
4827
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/query_functions.mjs
|
|
4823
4828
|
import { createMayBeForwardRefExpression, outputAst as o } from "@angular/compiler";
|
|
4824
4829
|
import ts21 from "typescript";
|
|
4825
4830
|
var queryFunctionNames = [
|
|
@@ -4904,7 +4909,7 @@ function parseDescendantsOption(value) {
|
|
|
4904
4909
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, value, `Expected "descendants" option to be a boolean literal.`);
|
|
4905
4910
|
}
|
|
4906
4911
|
|
|
4907
|
-
// bazel-out/
|
|
4912
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.mjs
|
|
4908
4913
|
var EMPTY_OBJECT = {};
|
|
4909
4914
|
var queryDecoratorNames = [
|
|
4910
4915
|
"ViewChild",
|
|
@@ -5005,7 +5010,7 @@ function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, ev
|
|
|
5005
5010
|
const sourceFile = clazz.getSourceFile();
|
|
5006
5011
|
const type = wrapTypeReference(reflector, clazz);
|
|
5007
5012
|
const rawHostDirectives = directive.get("hostDirectives") || null;
|
|
5008
|
-
const hostDirectives = rawHostDirectives === null ? null : extractHostDirectives(rawHostDirectives, evaluator, compilationMode);
|
|
5013
|
+
const hostDirectives = rawHostDirectives === null ? null : extractHostDirectives(rawHostDirectives, evaluator, compilationMode, createForwardRefResolver(isCore));
|
|
5009
5014
|
if (compilationMode !== CompilationMode.LOCAL && hostDirectives !== null) {
|
|
5010
5015
|
referencesRegistry.add(clazz, ...hostDirectives.map((hostDir) => {
|
|
5011
5016
|
if (!isHostDirectiveMetaForGlobalMode(hostDir)) {
|
|
@@ -5642,7 +5647,7 @@ function getHostBindingErrorNode(error, hostExpr) {
|
|
|
5642
5647
|
}
|
|
5643
5648
|
return hostExpr;
|
|
5644
5649
|
}
|
|
5645
|
-
function extractHostDirectives(rawHostDirectives, evaluator, compilationMode) {
|
|
5650
|
+
function extractHostDirectives(rawHostDirectives, evaluator, compilationMode, forwardRefResolver) {
|
|
5646
5651
|
const resolved = evaluator.evaluate(rawHostDirectives, forwardRefResolver);
|
|
5647
5652
|
if (!Array.isArray(resolved)) {
|
|
5648
5653
|
throw createValueHasWrongTypeError(rawHostDirectives, resolved, "hostDirectives must be an array");
|
|
@@ -5715,7 +5720,7 @@ function toR3InputMetadata(mapping) {
|
|
|
5715
5720
|
};
|
|
5716
5721
|
}
|
|
5717
5722
|
|
|
5718
|
-
// bazel-out/
|
|
5723
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/symbol.mjs
|
|
5719
5724
|
var DirectiveSymbol = class extends SemanticSymbol {
|
|
5720
5725
|
selector;
|
|
5721
5726
|
inputs;
|
|
@@ -5801,7 +5806,7 @@ function isBaseClassEqual(current, previous) {
|
|
|
5801
5806
|
return isSymbolEqual(current, previous);
|
|
5802
5807
|
}
|
|
5803
5808
|
|
|
5804
|
-
// bazel-out/
|
|
5809
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/handler.mjs
|
|
5805
5810
|
var FIELD_DECORATORS = [
|
|
5806
5811
|
"Input",
|
|
5807
5812
|
"Output",
|
|
@@ -6021,11 +6026,11 @@ var DirectiveDecoratorHandler = class {
|
|
|
6021
6026
|
}
|
|
6022
6027
|
};
|
|
6023
6028
|
|
|
6024
|
-
// bazel-out/
|
|
6029
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.mjs
|
|
6025
6030
|
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, ExternalExpr as ExternalExpr5, FactoryTarget as FactoryTarget2, FunctionExpr, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2, R3Identifiers, R3NgModuleMetadataKind, R3SelectorScopeMode, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
6026
6031
|
import ts24 from "typescript";
|
|
6027
6032
|
|
|
6028
|
-
// bazel-out/
|
|
6033
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/module_with_providers.mjs
|
|
6029
6034
|
import ts23 from "typescript";
|
|
6030
6035
|
function createModuleWithProvidersResolver(reflector, isCore) {
|
|
6031
6036
|
function _reflectModuleFromTypeParam(type, node) {
|
|
@@ -6097,7 +6102,7 @@ function isResolvedModuleWithProviders(sv) {
|
|
|
6097
6102
|
return typeof sv.value === "object" && sv.value != null && sv.value.hasOwnProperty("ngModule") && sv.value.hasOwnProperty("mwpCall");
|
|
6098
6103
|
}
|
|
6099
6104
|
|
|
6100
|
-
// bazel-out/
|
|
6105
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.mjs
|
|
6101
6106
|
var NgModuleSymbol = class extends SemanticSymbol {
|
|
6102
6107
|
hasProviders;
|
|
6103
6108
|
remotelyScopedComponents = [];
|
|
@@ -6238,6 +6243,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
6238
6243
|
this.jitDeclarationRegistry.jitDeclarations.add(node);
|
|
6239
6244
|
return {};
|
|
6240
6245
|
}
|
|
6246
|
+
const forwardRefResolver = createForwardRefResolver(this.isCore);
|
|
6241
6247
|
const moduleResolvers = combineResolvers([
|
|
6242
6248
|
createModuleWithProvidersResolver(this.reflector, this.isCore),
|
|
6243
6249
|
forwardRefResolver
|
|
@@ -6737,7 +6743,7 @@ function isSyntheticReference(ref) {
|
|
|
6737
6743
|
return ref.synthetic;
|
|
6738
6744
|
}
|
|
6739
6745
|
|
|
6740
|
-
// bazel-out/
|
|
6746
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/diagnostics.mjs
|
|
6741
6747
|
function makeCyclicImportInfo(ref, type, cycle) {
|
|
6742
6748
|
const name = ref.debugName || "(unknown)";
|
|
6743
6749
|
const path = cycle.getPath().map((sf) => sf.fileName).join(" -> ");
|
|
@@ -6760,7 +6766,7 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
6760
6766
|
return null;
|
|
6761
6767
|
}
|
|
6762
6768
|
|
|
6763
|
-
// bazel-out/
|
|
6769
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/resources.mjs
|
|
6764
6770
|
import { DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, ParseSourceFile as ParseSourceFile2, parseTemplate } from "@angular/compiler";
|
|
6765
6771
|
import ts25 from "typescript";
|
|
6766
6772
|
function getTemplateDeclarationNodeForError(declaration) {
|
|
@@ -7098,7 +7104,7 @@ function _extractTemplateStyleUrls(template) {
|
|
|
7098
7104
|
}));
|
|
7099
7105
|
}
|
|
7100
7106
|
|
|
7101
|
-
// bazel-out/
|
|
7107
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/symbol.mjs
|
|
7102
7108
|
var ComponentSymbol = class extends DirectiveSymbol {
|
|
7103
7109
|
usedDirectives = [];
|
|
7104
7110
|
usedPipes = [];
|
|
@@ -7130,7 +7136,8 @@ var ComponentSymbol = class extends DirectiveSymbol {
|
|
|
7130
7136
|
}
|
|
7131
7137
|
};
|
|
7132
7138
|
|
|
7133
|
-
// bazel-out/
|
|
7139
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/util.mjs
|
|
7140
|
+
import ts26 from "typescript";
|
|
7134
7141
|
function collectAnimationNames(value, animationTriggerNames) {
|
|
7135
7142
|
if (value instanceof Map) {
|
|
7136
7143
|
const name = value.get("name");
|
|
@@ -7174,7 +7181,8 @@ function validateAndFlattenComponentImports(imports, expr, isDeferred) {
|
|
|
7174
7181
|
};
|
|
7175
7182
|
}
|
|
7176
7183
|
const diagnostics = [];
|
|
7177
|
-
for (
|
|
7184
|
+
for (let i = 0; i < imports.length; i++) {
|
|
7185
|
+
const ref = imports[i];
|
|
7178
7186
|
if (Array.isArray(ref)) {
|
|
7179
7187
|
const { imports: childImports, diagnostics: childDiagnostics } = validateAndFlattenComponentImports(ref, expr, isDeferred);
|
|
7180
7188
|
flattened.push(...childImports);
|
|
@@ -7192,7 +7200,19 @@ function validateAndFlattenComponentImports(imports, expr, isDeferred) {
|
|
|
7192
7200
|
}
|
|
7193
7201
|
diagnostics.push(makeDiagnostic(ErrorCode.COMPONENT_UNKNOWN_IMPORT, origin, `Component 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.`));
|
|
7194
7202
|
} else {
|
|
7195
|
-
|
|
7203
|
+
let diagnosticNode;
|
|
7204
|
+
let diagnosticValue;
|
|
7205
|
+
if (ref instanceof DynamicValue) {
|
|
7206
|
+
diagnosticNode = ref.node;
|
|
7207
|
+
diagnosticValue = ref;
|
|
7208
|
+
} else if (ts26.isArrayLiteralExpression(expr) && expr.elements.length === imports.length && !expr.elements.some(ts26.isSpreadAssignment) && !imports.some(Array.isArray)) {
|
|
7209
|
+
diagnosticNode = expr.elements[i];
|
|
7210
|
+
diagnosticValue = ref;
|
|
7211
|
+
} else {
|
|
7212
|
+
diagnosticNode = expr;
|
|
7213
|
+
diagnosticValue = imports;
|
|
7214
|
+
}
|
|
7215
|
+
diagnostics.push(createValueHasWrongTypeError(diagnosticNode, diagnosticValue, errorMessage).toDiagnostic());
|
|
7196
7216
|
}
|
|
7197
7217
|
}
|
|
7198
7218
|
return { imports: flattened, diagnostics };
|
|
@@ -7207,10 +7227,10 @@ function isLikelyModuleWithProviders(value) {
|
|
|
7207
7227
|
return false;
|
|
7208
7228
|
}
|
|
7209
7229
|
|
|
7210
|
-
// bazel-out/
|
|
7230
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
|
|
7211
7231
|
import { CssSelector as CssSelector3, DomElementSchemaRegistry as DomElementSchemaRegistry2, ExternalExpr as ExternalExpr7, WrappedNodeExpr as WrappedNodeExpr9 } from "@angular/compiler";
|
|
7212
7232
|
|
|
7213
|
-
// bazel-out/
|
|
7233
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/api.mjs
|
|
7214
7234
|
var NgOriginalFile = Symbol("NgOriginalFile");
|
|
7215
7235
|
var UpdateMode;
|
|
7216
7236
|
(function(UpdateMode2) {
|
|
@@ -7218,13 +7238,13 @@ var UpdateMode;
|
|
|
7218
7238
|
UpdateMode2[UpdateMode2["Incremental"] = 1] = "Incremental";
|
|
7219
7239
|
})(UpdateMode || (UpdateMode = {}));
|
|
7220
7240
|
|
|
7221
|
-
// bazel-out/
|
|
7222
|
-
import
|
|
7241
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
7242
|
+
import ts28 from "typescript";
|
|
7223
7243
|
|
|
7224
|
-
// bazel-out/
|
|
7225
|
-
import
|
|
7244
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
7245
|
+
import ts27 from "typescript";
|
|
7226
7246
|
|
|
7227
|
-
// bazel-out/
|
|
7247
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/expando.mjs
|
|
7228
7248
|
var NgExtension = Symbol("NgExtension");
|
|
7229
7249
|
function isExtended(sf) {
|
|
7230
7250
|
return sf[NgExtension] !== void 0;
|
|
@@ -7284,13 +7304,13 @@ function retagTsFile(sf) {
|
|
|
7284
7304
|
}
|
|
7285
7305
|
}
|
|
7286
7306
|
|
|
7287
|
-
// bazel-out/
|
|
7307
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/util.mjs
|
|
7288
7308
|
var TS_EXTENSIONS = /\.tsx?$/i;
|
|
7289
7309
|
function makeShimFileName(fileName, suffix) {
|
|
7290
7310
|
return absoluteFrom(fileName.replace(TS_EXTENSIONS, suffix));
|
|
7291
7311
|
}
|
|
7292
7312
|
|
|
7293
|
-
// bazel-out/
|
|
7313
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
7294
7314
|
var ShimAdapter = class {
|
|
7295
7315
|
delegate;
|
|
7296
7316
|
shims = /* @__PURE__ */ new Map();
|
|
@@ -7355,10 +7375,10 @@ var ShimAdapter = class {
|
|
|
7355
7375
|
}
|
|
7356
7376
|
const prefix = match[1];
|
|
7357
7377
|
let baseFileName = absoluteFrom(prefix + ".ts");
|
|
7358
|
-
let inputFile = this.delegate.getSourceFile(baseFileName,
|
|
7378
|
+
let inputFile = this.delegate.getSourceFile(baseFileName, ts27.ScriptTarget.Latest);
|
|
7359
7379
|
if (inputFile === void 0) {
|
|
7360
7380
|
baseFileName = absoluteFrom(prefix + ".tsx");
|
|
7361
|
-
inputFile = this.delegate.getSourceFile(baseFileName,
|
|
7381
|
+
inputFile = this.delegate.getSourceFile(baseFileName, ts27.ScriptTarget.Latest);
|
|
7362
7382
|
}
|
|
7363
7383
|
if (inputFile === void 0 || isShim(inputFile)) {
|
|
7364
7384
|
return void 0;
|
|
@@ -7387,7 +7407,7 @@ var ShimAdapter = class {
|
|
|
7387
7407
|
}
|
|
7388
7408
|
};
|
|
7389
7409
|
|
|
7390
|
-
// bazel-out/
|
|
7410
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/reference_tagger.mjs
|
|
7391
7411
|
var ShimReferenceTagger = class {
|
|
7392
7412
|
suffixes;
|
|
7393
7413
|
tagged = /* @__PURE__ */ new Set();
|
|
@@ -7422,7 +7442,7 @@ var ShimReferenceTagger = class {
|
|
|
7422
7442
|
}
|
|
7423
7443
|
};
|
|
7424
7444
|
|
|
7425
|
-
// bazel-out/
|
|
7445
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
7426
7446
|
var DelegatingCompilerHost = class {
|
|
7427
7447
|
delegate;
|
|
7428
7448
|
createHash;
|
|
@@ -7553,7 +7573,7 @@ var TsCreateProgramDriver = class {
|
|
|
7553
7573
|
this.sfMap.clear();
|
|
7554
7574
|
}
|
|
7555
7575
|
for (const [filePath, { newText, originalFile }] of contents.entries()) {
|
|
7556
|
-
const sf =
|
|
7576
|
+
const sf = ts28.createSourceFile(filePath, newText, ts28.ScriptTarget.Latest, true);
|
|
7557
7577
|
if (originalFile !== null) {
|
|
7558
7578
|
sf[NgOriginalFile] = originalFile;
|
|
7559
7579
|
}
|
|
@@ -7562,7 +7582,7 @@ var TsCreateProgramDriver = class {
|
|
|
7562
7582
|
const host = new UpdatedProgramHost(this.sfMap, this.originalProgram, this.originalHost, this.shimExtensionPrefixes);
|
|
7563
7583
|
const oldProgram = this.program;
|
|
7564
7584
|
retagAllTsFiles(oldProgram);
|
|
7565
|
-
this.program =
|
|
7585
|
+
this.program = ts28.createProgram({
|
|
7566
7586
|
host,
|
|
7567
7587
|
rootNames: this.program.getRootFileNames(),
|
|
7568
7588
|
options: this.options,
|
|
@@ -7573,9 +7593,9 @@ var TsCreateProgramDriver = class {
|
|
|
7573
7593
|
}
|
|
7574
7594
|
};
|
|
7575
7595
|
|
|
7576
|
-
// bazel-out/
|
|
7577
|
-
import
|
|
7578
|
-
function makeTemplateDiagnostic(
|
|
7596
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/diagnostic.mjs
|
|
7597
|
+
import ts29 from "typescript";
|
|
7598
|
+
function makeTemplateDiagnostic(id, mapping, span, category, code, messageText, relatedMessages) {
|
|
7579
7599
|
var _a;
|
|
7580
7600
|
if (mapping.type === "direct") {
|
|
7581
7601
|
let relatedInformation = void 0;
|
|
@@ -7583,7 +7603,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
7583
7603
|
relatedInformation = [];
|
|
7584
7604
|
for (const relatedMessage of relatedMessages) {
|
|
7585
7605
|
relatedInformation.push({
|
|
7586
|
-
category:
|
|
7606
|
+
category: ts29.DiagnosticCategory.Message,
|
|
7587
7607
|
code: 0,
|
|
7588
7608
|
file: relatedMessage.sourceFile,
|
|
7589
7609
|
start: relatedMessage.start,
|
|
@@ -7598,8 +7618,8 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
7598
7618
|
category,
|
|
7599
7619
|
messageText,
|
|
7600
7620
|
file: mapping.node.getSourceFile(),
|
|
7601
|
-
|
|
7602
|
-
|
|
7621
|
+
sourceFile: mapping.node.getSourceFile(),
|
|
7622
|
+
typeCheckId: id,
|
|
7603
7623
|
start: span.start.offset,
|
|
7604
7624
|
length: span.end.offset - span.start.offset,
|
|
7605
7625
|
relatedInformation
|
|
@@ -7612,7 +7632,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
7612
7632
|
if (relatedMessages !== void 0) {
|
|
7613
7633
|
for (const relatedMessage of relatedMessages) {
|
|
7614
7634
|
relatedInformation.push({
|
|
7615
|
-
category:
|
|
7635
|
+
category: ts29.DiagnosticCategory.Message,
|
|
7616
7636
|
code: 0,
|
|
7617
7637
|
file: relatedMessage.sourceFile,
|
|
7618
7638
|
start: relatedMessage.start,
|
|
@@ -7632,15 +7652,15 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
7632
7652
|
code,
|
|
7633
7653
|
messageText: addDiagnosticChain(messageText, [failureChain]),
|
|
7634
7654
|
file: componentSf,
|
|
7635
|
-
|
|
7636
|
-
|
|
7655
|
+
sourceFile: componentSf,
|
|
7656
|
+
typeCheckId: id,
|
|
7637
7657
|
start: mapping.node.getStart(),
|
|
7638
7658
|
length: mapping.node.getEnd() - mapping.node.getStart(),
|
|
7639
7659
|
relatedInformation
|
|
7640
7660
|
};
|
|
7641
7661
|
}
|
|
7642
7662
|
relatedInformation.push({
|
|
7643
|
-
category:
|
|
7663
|
+
category: ts29.DiagnosticCategory.Message,
|
|
7644
7664
|
code: 0,
|
|
7645
7665
|
file: componentSf,
|
|
7646
7666
|
start: mapping.node.getStart(),
|
|
@@ -7653,8 +7673,8 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
7653
7673
|
code,
|
|
7654
7674
|
messageText,
|
|
7655
7675
|
file: sf,
|
|
7656
|
-
|
|
7657
|
-
|
|
7676
|
+
sourceFile: componentSf,
|
|
7677
|
+
typeCheckId: id,
|
|
7658
7678
|
start: span.start.offset,
|
|
7659
7679
|
length: span.end.offset - span.start.offset,
|
|
7660
7680
|
relatedInformation
|
|
@@ -7675,39 +7695,39 @@ function parseTemplateAsSourceFile(fileName, template) {
|
|
|
7675
7695
|
if (parseTemplateAsSourceFileForTest !== null) {
|
|
7676
7696
|
return parseTemplateAsSourceFileForTest(fileName, template);
|
|
7677
7697
|
}
|
|
7678
|
-
return
|
|
7698
|
+
return ts29.createSourceFile(
|
|
7679
7699
|
fileName,
|
|
7680
7700
|
template,
|
|
7681
|
-
|
|
7701
|
+
ts29.ScriptTarget.Latest,
|
|
7682
7702
|
false,
|
|
7683
|
-
|
|
7703
|
+
ts29.ScriptKind.JSX
|
|
7684
7704
|
);
|
|
7685
7705
|
}
|
|
7686
7706
|
|
|
7687
|
-
// bazel-out/
|
|
7688
|
-
var
|
|
7689
|
-
function
|
|
7707
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/id.mjs
|
|
7708
|
+
var TYPE_CHECK_ID_MAP = Symbol("TypeCheckId");
|
|
7709
|
+
function getTypeCheckId(clazz) {
|
|
7690
7710
|
const sf = clazz.getSourceFile();
|
|
7691
|
-
if (sf[
|
|
7692
|
-
sf[
|
|
7711
|
+
if (sf[TYPE_CHECK_ID_MAP] === void 0) {
|
|
7712
|
+
sf[TYPE_CHECK_ID_MAP] = /* @__PURE__ */ new Map();
|
|
7693
7713
|
}
|
|
7694
|
-
if (sf[
|
|
7695
|
-
sf[
|
|
7714
|
+
if (sf[TYPE_CHECK_ID_MAP].get(clazz) === void 0) {
|
|
7715
|
+
sf[TYPE_CHECK_ID_MAP].set(clazz, `tcb${sf[TYPE_CHECK_ID_MAP].size + 1}`);
|
|
7696
7716
|
}
|
|
7697
|
-
return sf[
|
|
7717
|
+
return sf[TYPE_CHECK_ID_MAP].get(clazz);
|
|
7698
7718
|
}
|
|
7699
7719
|
|
|
7700
|
-
// bazel-out/
|
|
7720
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
7701
7721
|
import { EmptyExpr, ImplicitReceiver, PropertyRead, PropertyWrite, SafePropertyRead, TmplAstLetDeclaration, TmplAstReference, TmplAstTextAttribute } from "@angular/compiler";
|
|
7702
|
-
import
|
|
7722
|
+
import ts31 from "typescript";
|
|
7703
7723
|
|
|
7704
|
-
// bazel-out/
|
|
7724
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/comments.mjs
|
|
7705
7725
|
import { AbsoluteSourceSpan } from "@angular/compiler";
|
|
7706
|
-
import
|
|
7726
|
+
import ts30 from "typescript";
|
|
7707
7727
|
var parseSpanComment = /^(\d+),(\d+)$/;
|
|
7708
7728
|
function readSpanComment(node, sourceFile = node.getSourceFile()) {
|
|
7709
|
-
return
|
|
7710
|
-
if (kind !==
|
|
7729
|
+
return ts30.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
7730
|
+
if (kind !== ts30.SyntaxKind.MultiLineCommentTrivia) {
|
|
7711
7731
|
return null;
|
|
7712
7732
|
}
|
|
7713
7733
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -7731,25 +7751,25 @@ var ExpressionIdentifier;
|
|
|
7731
7751
|
ExpressionIdentifier2["VARIABLE_AS_EXPRESSION"] = "VAE";
|
|
7732
7752
|
})(ExpressionIdentifier || (ExpressionIdentifier = {}));
|
|
7733
7753
|
function addExpressionIdentifier(node, identifier) {
|
|
7734
|
-
|
|
7754
|
+
ts30.addSyntheticTrailingComment(
|
|
7735
7755
|
node,
|
|
7736
|
-
|
|
7756
|
+
ts30.SyntaxKind.MultiLineCommentTrivia,
|
|
7737
7757
|
`${CommentTriviaType.EXPRESSION_TYPE_IDENTIFIER}:${identifier}`,
|
|
7738
7758
|
false
|
|
7739
7759
|
);
|
|
7740
7760
|
}
|
|
7741
7761
|
var IGNORE_FOR_DIAGNOSTICS_MARKER = `${CommentTriviaType.DIAGNOSTIC}:ignore`;
|
|
7742
7762
|
function markIgnoreDiagnostics(node) {
|
|
7743
|
-
|
|
7763
|
+
ts30.addSyntheticTrailingComment(
|
|
7744
7764
|
node,
|
|
7745
|
-
|
|
7765
|
+
ts30.SyntaxKind.MultiLineCommentTrivia,
|
|
7746
7766
|
IGNORE_FOR_DIAGNOSTICS_MARKER,
|
|
7747
7767
|
false
|
|
7748
7768
|
);
|
|
7749
7769
|
}
|
|
7750
7770
|
function hasIgnoreForDiagnosticsMarker(node, sourceFile) {
|
|
7751
|
-
return
|
|
7752
|
-
if (kind !==
|
|
7771
|
+
return ts30.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
7772
|
+
if (kind !== ts30.SyntaxKind.MultiLineCommentTrivia) {
|
|
7753
7773
|
return null;
|
|
7754
7774
|
}
|
|
7755
7775
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -7823,8 +7843,8 @@ function findAllMatchingNodes(tcb, opts) {
|
|
|
7823
7843
|
return results;
|
|
7824
7844
|
}
|
|
7825
7845
|
function hasExpressionIdentifier(sourceFile, node, identifier) {
|
|
7826
|
-
return
|
|
7827
|
-
if (kind !==
|
|
7846
|
+
return ts30.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
7847
|
+
if (kind !== ts30.SyntaxKind.MultiLineCommentTrivia) {
|
|
7828
7848
|
return false;
|
|
7829
7849
|
}
|
|
7830
7850
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -7832,7 +7852,7 @@ function hasExpressionIdentifier(sourceFile, node, identifier) {
|
|
|
7832
7852
|
}) || false;
|
|
7833
7853
|
}
|
|
7834
7854
|
|
|
7835
|
-
// bazel-out/
|
|
7855
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
7836
7856
|
var CompletionEngine = class {
|
|
7837
7857
|
tcb;
|
|
7838
7858
|
data;
|
|
@@ -7847,7 +7867,7 @@ var CompletionEngine = class {
|
|
|
7847
7867
|
this.tcbPath = tcbPath;
|
|
7848
7868
|
this.tcbIsShim = tcbIsShim;
|
|
7849
7869
|
const globalRead = findFirstMatchingNode(this.tcb, {
|
|
7850
|
-
filter:
|
|
7870
|
+
filter: ts31.isPropertyAccessExpression,
|
|
7851
7871
|
withExpressionIdentifier: ExpressionIdentifier.COMPONENT_COMPLETION
|
|
7852
7872
|
});
|
|
7853
7873
|
if (globalRead !== null) {
|
|
@@ -7871,7 +7891,7 @@ var CompletionEngine = class {
|
|
|
7871
7891
|
let nodeContext = null;
|
|
7872
7892
|
if (node instanceof EmptyExpr) {
|
|
7873
7893
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
7874
|
-
filter:
|
|
7894
|
+
filter: ts31.isIdentifier,
|
|
7875
7895
|
withSpan: node.sourceSpan
|
|
7876
7896
|
});
|
|
7877
7897
|
if (nodeLocation !== null) {
|
|
@@ -7884,7 +7904,7 @@ var CompletionEngine = class {
|
|
|
7884
7904
|
}
|
|
7885
7905
|
if (node instanceof PropertyRead && node.receiver instanceof ImplicitReceiver) {
|
|
7886
7906
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
7887
|
-
filter:
|
|
7907
|
+
filter: ts31.isPropertyAccessExpression,
|
|
7888
7908
|
withSpan: node.sourceSpan
|
|
7889
7909
|
});
|
|
7890
7910
|
if (nodeLocation) {
|
|
@@ -7908,21 +7928,21 @@ var CompletionEngine = class {
|
|
|
7908
7928
|
let tsExpr = null;
|
|
7909
7929
|
if (expr instanceof PropertyRead || expr instanceof PropertyWrite) {
|
|
7910
7930
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
7911
|
-
filter:
|
|
7931
|
+
filter: ts31.isPropertyAccessExpression,
|
|
7912
7932
|
withSpan: expr.nameSpan
|
|
7913
7933
|
});
|
|
7914
7934
|
} else if (expr instanceof SafePropertyRead) {
|
|
7915
7935
|
const ternaryExpr = findFirstMatchingNode(this.tcb, {
|
|
7916
|
-
filter:
|
|
7936
|
+
filter: ts31.isParenthesizedExpression,
|
|
7917
7937
|
withSpan: expr.sourceSpan
|
|
7918
7938
|
});
|
|
7919
|
-
if (ternaryExpr === null || !
|
|
7939
|
+
if (ternaryExpr === null || !ts31.isConditionalExpression(ternaryExpr.expression)) {
|
|
7920
7940
|
return null;
|
|
7921
7941
|
}
|
|
7922
7942
|
const whenTrue = ternaryExpr.expression.whenTrue;
|
|
7923
|
-
if (
|
|
7943
|
+
if (ts31.isPropertyAccessExpression(whenTrue)) {
|
|
7924
7944
|
tsExpr = whenTrue;
|
|
7925
|
-
} else if (
|
|
7945
|
+
} else if (ts31.isCallExpression(whenTrue) && ts31.isPropertyAccessExpression(whenTrue.expression)) {
|
|
7926
7946
|
tsExpr = whenTrue.expression;
|
|
7927
7947
|
}
|
|
7928
7948
|
}
|
|
@@ -7944,15 +7964,15 @@ var CompletionEngine = class {
|
|
|
7944
7964
|
let tsExpr = null;
|
|
7945
7965
|
if (expr instanceof TmplAstTextAttribute) {
|
|
7946
7966
|
const strNode = findFirstMatchingNode(this.tcb, {
|
|
7947
|
-
filter:
|
|
7967
|
+
filter: ts31.isParenthesizedExpression,
|
|
7948
7968
|
withSpan: expr.sourceSpan
|
|
7949
7969
|
});
|
|
7950
|
-
if (strNode !== null &&
|
|
7970
|
+
if (strNode !== null && ts31.isStringLiteral(strNode.expression)) {
|
|
7951
7971
|
tsExpr = strNode.expression;
|
|
7952
7972
|
}
|
|
7953
7973
|
} else {
|
|
7954
7974
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
7955
|
-
filter: (n2) =>
|
|
7975
|
+
filter: (n2) => ts31.isStringLiteral(n2) || ts31.isNumericLiteral(n2),
|
|
7956
7976
|
withSpan: expr.sourceSpan
|
|
7957
7977
|
});
|
|
7958
7978
|
}
|
|
@@ -7960,7 +7980,7 @@ var CompletionEngine = class {
|
|
|
7960
7980
|
return null;
|
|
7961
7981
|
}
|
|
7962
7982
|
let positionInShimFile = tsExpr.getEnd();
|
|
7963
|
-
if (
|
|
7983
|
+
if (ts31.isStringLiteral(tsExpr)) {
|
|
7964
7984
|
positionInShimFile -= 1;
|
|
7965
7985
|
}
|
|
7966
7986
|
const res = {
|
|
@@ -9039,12 +9059,12 @@ var MagicString = class {
|
|
|
9039
9059
|
}
|
|
9040
9060
|
};
|
|
9041
9061
|
|
|
9042
|
-
// bazel-out/
|
|
9043
|
-
import
|
|
9062
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
|
|
9063
|
+
import ts44 from "typescript";
|
|
9044
9064
|
|
|
9045
|
-
// bazel-out/
|
|
9065
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/dom.mjs
|
|
9046
9066
|
import { DomElementSchemaRegistry } from "@angular/compiler";
|
|
9047
|
-
import
|
|
9067
|
+
import ts32 from "typescript";
|
|
9048
9068
|
var REGISTRY = new DomElementSchemaRegistry();
|
|
9049
9069
|
var REMOVE_XHTML_REGEX = /^:xhtml:/;
|
|
9050
9070
|
var RegistryDomSchemaChecker = class {
|
|
@@ -9059,7 +9079,7 @@ var RegistryDomSchemaChecker = class {
|
|
|
9059
9079
|
checkElement(id, element, schemas, hostIsStandalone) {
|
|
9060
9080
|
const name = element.name.replace(REMOVE_XHTML_REGEX, "");
|
|
9061
9081
|
if (!REGISTRY.hasElement(name, schemas)) {
|
|
9062
|
-
const mapping = this.resolver.
|
|
9082
|
+
const mapping = this.resolver.getTemplateSourceMapping(id);
|
|
9063
9083
|
const schemas2 = `'${hostIsStandalone ? "@Component" : "@NgModule"}.schemas'`;
|
|
9064
9084
|
let errorMsg = `'${name}' is not a known element:
|
|
9065
9085
|
`;
|
|
@@ -9070,13 +9090,13 @@ var RegistryDomSchemaChecker = class {
|
|
|
9070
9090
|
} else {
|
|
9071
9091
|
errorMsg += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas2} of this component.`;
|
|
9072
9092
|
}
|
|
9073
|
-
const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan,
|
|
9093
|
+
const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan, ts32.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ELEMENT), errorMsg);
|
|
9074
9094
|
this._diagnostics.push(diag);
|
|
9075
9095
|
}
|
|
9076
9096
|
}
|
|
9077
9097
|
checkProperty(id, element, name, span, schemas, hostIsStandalone) {
|
|
9078
9098
|
if (!REGISTRY.hasProperty(element.name, name, schemas)) {
|
|
9079
|
-
const mapping = this.resolver.
|
|
9099
|
+
const mapping = this.resolver.getTemplateSourceMapping(id);
|
|
9080
9100
|
const decorator = hostIsStandalone ? "@Component" : "@NgModule";
|
|
9081
9101
|
const schemas2 = `'${decorator}.schemas'`;
|
|
9082
9102
|
let errorMsg = `Can't bind to '${name}' since it isn't a known property of '${element.name}'.`;
|
|
@@ -9090,16 +9110,16 @@ var RegistryDomSchemaChecker = class {
|
|
|
9090
9110
|
2. If '${element.name}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas2} of this component to suppress this message.
|
|
9091
9111
|
3. To allow any property add 'NO_ERRORS_SCHEMA' to the ${schemas2} of this component.`;
|
|
9092
9112
|
}
|
|
9093
|
-
const diag = makeTemplateDiagnostic(id, mapping, span,
|
|
9113
|
+
const diag = makeTemplateDiagnostic(id, mapping, span, ts32.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ATTRIBUTE), errorMsg);
|
|
9094
9114
|
this._diagnostics.push(diag);
|
|
9095
9115
|
}
|
|
9096
9116
|
}
|
|
9097
9117
|
};
|
|
9098
9118
|
|
|
9099
|
-
// bazel-out/
|
|
9100
|
-
import
|
|
9119
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
|
|
9120
|
+
import ts37 from "typescript";
|
|
9101
9121
|
|
|
9102
|
-
// bazel-out/
|
|
9122
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/reference_emit_environment.mjs
|
|
9103
9123
|
import { ExpressionType, ExternalExpr as ExternalExpr6, TypeModifier } from "@angular/compiler";
|
|
9104
9124
|
var ReferenceEmitEnvironment = class {
|
|
9105
9125
|
importManager;
|
|
@@ -9134,99 +9154,99 @@ var ReferenceEmitEnvironment = class {
|
|
|
9134
9154
|
}
|
|
9135
9155
|
};
|
|
9136
9156
|
|
|
9137
|
-
// bazel-out/
|
|
9138
|
-
import
|
|
9157
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/ts_util.mjs
|
|
9158
|
+
import ts33 from "typescript";
|
|
9139
9159
|
var SAFE_TO_CAST_WITHOUT_PARENS = /* @__PURE__ */ new Set([
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9160
|
+
ts33.SyntaxKind.ParenthesizedExpression,
|
|
9161
|
+
ts33.SyntaxKind.Identifier,
|
|
9162
|
+
ts33.SyntaxKind.CallExpression,
|
|
9163
|
+
ts33.SyntaxKind.NonNullExpression,
|
|
9164
|
+
ts33.SyntaxKind.ElementAccessExpression,
|
|
9165
|
+
ts33.SyntaxKind.PropertyAccessExpression,
|
|
9166
|
+
ts33.SyntaxKind.ArrayLiteralExpression,
|
|
9167
|
+
ts33.SyntaxKind.ObjectLiteralExpression,
|
|
9168
|
+
ts33.SyntaxKind.StringLiteral,
|
|
9169
|
+
ts33.SyntaxKind.NumericLiteral,
|
|
9170
|
+
ts33.SyntaxKind.TrueKeyword,
|
|
9171
|
+
ts33.SyntaxKind.FalseKeyword,
|
|
9172
|
+
ts33.SyntaxKind.NullKeyword,
|
|
9173
|
+
ts33.SyntaxKind.UndefinedKeyword
|
|
9154
9174
|
]);
|
|
9155
9175
|
function tsCastToAny(expr) {
|
|
9156
9176
|
if (!SAFE_TO_CAST_WITHOUT_PARENS.has(expr.kind)) {
|
|
9157
|
-
expr =
|
|
9177
|
+
expr = ts33.factory.createParenthesizedExpression(expr);
|
|
9158
9178
|
}
|
|
9159
|
-
return
|
|
9179
|
+
return ts33.factory.createParenthesizedExpression(ts33.factory.createAsExpression(expr, ts33.factory.createKeywordTypeNode(ts33.SyntaxKind.AnyKeyword)));
|
|
9160
9180
|
}
|
|
9161
9181
|
function tsCreateElement(tagName) {
|
|
9162
|
-
const createElement =
|
|
9163
|
-
|
|
9182
|
+
const createElement = ts33.factory.createPropertyAccessExpression(
|
|
9183
|
+
ts33.factory.createIdentifier("document"),
|
|
9164
9184
|
"createElement"
|
|
9165
9185
|
);
|
|
9166
|
-
return
|
|
9186
|
+
return ts33.factory.createCallExpression(
|
|
9167
9187
|
createElement,
|
|
9168
9188
|
void 0,
|
|
9169
|
-
[
|
|
9189
|
+
[ts33.factory.createStringLiteral(tagName)]
|
|
9170
9190
|
);
|
|
9171
9191
|
}
|
|
9172
9192
|
function tsDeclareVariable(id, type) {
|
|
9173
9193
|
addExpressionIdentifier(type, ExpressionIdentifier.VARIABLE_AS_EXPRESSION);
|
|
9174
|
-
const initializer =
|
|
9175
|
-
const decl =
|
|
9194
|
+
const initializer = ts33.factory.createAsExpression(ts33.factory.createNonNullExpression(ts33.factory.createNull()), type);
|
|
9195
|
+
const decl = ts33.factory.createVariableDeclaration(
|
|
9176
9196
|
id,
|
|
9177
9197
|
void 0,
|
|
9178
9198
|
void 0,
|
|
9179
9199
|
initializer
|
|
9180
9200
|
);
|
|
9181
|
-
return
|
|
9201
|
+
return ts33.factory.createVariableStatement(
|
|
9182
9202
|
void 0,
|
|
9183
9203
|
[decl]
|
|
9184
9204
|
);
|
|
9185
9205
|
}
|
|
9186
9206
|
function tsCreateTypeQueryForCoercedInput(typeName, coercedInputName) {
|
|
9187
|
-
return
|
|
9207
|
+
return ts33.factory.createTypeQueryNode(ts33.factory.createQualifiedName(typeName, `ngAcceptInputType_${coercedInputName}`));
|
|
9188
9208
|
}
|
|
9189
9209
|
function tsCreateVariable(id, initializer, flags = null) {
|
|
9190
|
-
const decl =
|
|
9210
|
+
const decl = ts33.factory.createVariableDeclaration(
|
|
9191
9211
|
id,
|
|
9192
9212
|
void 0,
|
|
9193
9213
|
void 0,
|
|
9194
9214
|
initializer
|
|
9195
9215
|
);
|
|
9196
|
-
return
|
|
9216
|
+
return ts33.factory.createVariableStatement(
|
|
9197
9217
|
void 0,
|
|
9198
|
-
flags === null ? [decl] :
|
|
9218
|
+
flags === null ? [decl] : ts33.factory.createVariableDeclarationList([decl], flags)
|
|
9199
9219
|
);
|
|
9200
9220
|
}
|
|
9201
9221
|
function tsCallMethod(receiver, methodName, args = []) {
|
|
9202
|
-
const methodAccess =
|
|
9203
|
-
return
|
|
9222
|
+
const methodAccess = ts33.factory.createPropertyAccessExpression(receiver, methodName);
|
|
9223
|
+
return ts33.factory.createCallExpression(
|
|
9204
9224
|
methodAccess,
|
|
9205
9225
|
void 0,
|
|
9206
9226
|
args
|
|
9207
9227
|
);
|
|
9208
9228
|
}
|
|
9209
9229
|
function isAccessExpression(node) {
|
|
9210
|
-
return
|
|
9230
|
+
return ts33.isPropertyAccessExpression(node) || ts33.isElementAccessExpression(node);
|
|
9211
9231
|
}
|
|
9212
9232
|
function tsNumericExpression(value) {
|
|
9213
9233
|
if (value < 0) {
|
|
9214
|
-
const operand =
|
|
9215
|
-
return
|
|
9234
|
+
const operand = ts33.factory.createNumericLiteral(Math.abs(value));
|
|
9235
|
+
return ts33.factory.createPrefixUnaryExpression(ts33.SyntaxKind.MinusToken, operand);
|
|
9216
9236
|
}
|
|
9217
|
-
return
|
|
9237
|
+
return ts33.factory.createNumericLiteral(value);
|
|
9218
9238
|
}
|
|
9219
9239
|
|
|
9220
|
-
// bazel-out/
|
|
9240
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
9221
9241
|
import { ExpressionType as ExpressionType2, R3Identifiers as R3Identifiers3, WrappedNodeExpr as WrappedNodeExpr8 } from "@angular/compiler";
|
|
9222
|
-
import
|
|
9242
|
+
import ts36 from "typescript";
|
|
9223
9243
|
|
|
9224
|
-
// bazel-out/
|
|
9244
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
9225
9245
|
import { R3Identifiers as R3Identifiers2 } from "@angular/compiler";
|
|
9226
|
-
import
|
|
9246
|
+
import ts35 from "typescript";
|
|
9227
9247
|
|
|
9228
|
-
// bazel-out/
|
|
9229
|
-
import
|
|
9248
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
|
|
9249
|
+
import ts34 from "typescript";
|
|
9230
9250
|
var TypeParameterEmitter = class {
|
|
9231
9251
|
typeParameters;
|
|
9232
9252
|
reflector;
|
|
@@ -9265,11 +9285,11 @@ var TypeParameterEmitter = class {
|
|
|
9265
9285
|
return this.typeParameters.map((typeParam) => {
|
|
9266
9286
|
const constraint = typeParam.constraint !== void 0 ? emitter.emitType(typeParam.constraint) : void 0;
|
|
9267
9287
|
const defaultType = typeParam.default !== void 0 ? emitter.emitType(typeParam.default) : void 0;
|
|
9268
|
-
return
|
|
9288
|
+
return ts34.factory.updateTypeParameterDeclaration(typeParam, typeParam.modifiers, typeParam.name, constraint, defaultType);
|
|
9269
9289
|
});
|
|
9270
9290
|
}
|
|
9271
9291
|
resolveTypeReference(type) {
|
|
9272
|
-
const target =
|
|
9292
|
+
const target = ts34.isIdentifier(type.typeName) ? type.typeName : type.typeName.right;
|
|
9273
9293
|
const declaration = this.reflector.getDeclarationOfIdentifier(target);
|
|
9274
9294
|
if (declaration === null || declaration.node === null) {
|
|
9275
9295
|
return null;
|
|
@@ -9295,8 +9315,8 @@ var TypeParameterEmitter = class {
|
|
|
9295
9315
|
if (typeNode === null) {
|
|
9296
9316
|
return null;
|
|
9297
9317
|
}
|
|
9298
|
-
if (!
|
|
9299
|
-
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${
|
|
9318
|
+
if (!ts34.isTypeReferenceNode(typeNode)) {
|
|
9319
|
+
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts34.SyntaxKind[typeNode.kind]}.`);
|
|
9300
9320
|
}
|
|
9301
9321
|
return typeNode;
|
|
9302
9322
|
}
|
|
@@ -9305,7 +9325,7 @@ var TypeParameterEmitter = class {
|
|
|
9305
9325
|
}
|
|
9306
9326
|
};
|
|
9307
9327
|
|
|
9308
|
-
// bazel-out/
|
|
9328
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
9309
9329
|
var TCB_FILE_IMPORT_GRAPH_PREPARE_IDENTIFIERS = [
|
|
9310
9330
|
R3Identifiers2.InputSignalBrandWriteType
|
|
9311
9331
|
];
|
|
@@ -9326,35 +9346,35 @@ function requiresInlineTypeCheckBlock(ref, env, usedPipes, reflector) {
|
|
|
9326
9346
|
return TcbInliningRequirement.None;
|
|
9327
9347
|
}
|
|
9328
9348
|
}
|
|
9329
|
-
function
|
|
9349
|
+
function getSourceMapping(shimSf, position, resolver, isDiagnosticRequest) {
|
|
9330
9350
|
const node = getTokenAtPosition(shimSf, position);
|
|
9331
9351
|
const sourceLocation = findSourceLocation(node, shimSf, isDiagnosticRequest);
|
|
9332
9352
|
if (sourceLocation === null) {
|
|
9333
9353
|
return null;
|
|
9334
9354
|
}
|
|
9335
|
-
const mapping = resolver.
|
|
9336
|
-
const span = resolver.
|
|
9355
|
+
const mapping = resolver.getTemplateSourceMapping(sourceLocation.id);
|
|
9356
|
+
const span = resolver.toTemplateParseSourceSpan(sourceLocation.id, sourceLocation.span);
|
|
9337
9357
|
if (span === null) {
|
|
9338
9358
|
return null;
|
|
9339
9359
|
}
|
|
9340
|
-
return { sourceLocation,
|
|
9360
|
+
return { sourceLocation, sourceMapping: mapping, span };
|
|
9341
9361
|
}
|
|
9342
9362
|
function findTypeCheckBlock(file, id, isDiagnosticRequest) {
|
|
9343
9363
|
for (const stmt of file.statements) {
|
|
9344
|
-
if (
|
|
9364
|
+
if (ts35.isFunctionDeclaration(stmt) && getTemplateId(stmt, file, isDiagnosticRequest) === id) {
|
|
9345
9365
|
return stmt;
|
|
9346
9366
|
}
|
|
9347
9367
|
}
|
|
9348
9368
|
return null;
|
|
9349
9369
|
}
|
|
9350
9370
|
function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
|
|
9351
|
-
while (node !== void 0 && !
|
|
9371
|
+
while (node !== void 0 && !ts35.isFunctionDeclaration(node)) {
|
|
9352
9372
|
if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticsRequest) {
|
|
9353
9373
|
return null;
|
|
9354
9374
|
}
|
|
9355
9375
|
const span = readSpanComment(node, sourceFile);
|
|
9356
9376
|
if (span !== null) {
|
|
9357
|
-
const id =
|
|
9377
|
+
const id = getTemplateId(node, sourceFile, isDiagnosticsRequest);
|
|
9358
9378
|
if (id === null) {
|
|
9359
9379
|
return null;
|
|
9360
9380
|
}
|
|
@@ -9364,8 +9384,8 @@ function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
|
|
|
9364
9384
|
}
|
|
9365
9385
|
return null;
|
|
9366
9386
|
}
|
|
9367
|
-
function
|
|
9368
|
-
while (!
|
|
9387
|
+
function getTemplateId(node, sourceFile, isDiagnosticRequest) {
|
|
9388
|
+
while (!ts35.isFunctionDeclaration(node)) {
|
|
9369
9389
|
if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticRequest) {
|
|
9370
9390
|
return null;
|
|
9371
9391
|
}
|
|
@@ -9375,8 +9395,8 @@ function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
|
|
|
9375
9395
|
}
|
|
9376
9396
|
}
|
|
9377
9397
|
const start = node.getFullStart();
|
|
9378
|
-
return
|
|
9379
|
-
if (kind !==
|
|
9398
|
+
return ts35.forEachLeadingCommentRange(sourceFile.text, start, (pos, end, kind) => {
|
|
9399
|
+
if (kind !== ts35.SyntaxKind.MultiLineCommentTrivia) {
|
|
9380
9400
|
return null;
|
|
9381
9401
|
}
|
|
9382
9402
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -9397,32 +9417,32 @@ function checkIfGenericTypeBoundsCanBeEmitted(node, reflector, env) {
|
|
|
9397
9417
|
return emitter.canEmit((ref) => env.canReferenceType(ref));
|
|
9398
9418
|
}
|
|
9399
9419
|
|
|
9400
|
-
// bazel-out/
|
|
9420
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
9401
9421
|
function generateTypeCtorDeclarationFn(env, meta, nodeTypeRef, typeParams) {
|
|
9402
9422
|
const rawTypeArgs = typeParams !== void 0 ? generateGenericArgs(typeParams) : void 0;
|
|
9403
|
-
const rawType =
|
|
9423
|
+
const rawType = ts36.factory.createTypeReferenceNode(nodeTypeRef, rawTypeArgs);
|
|
9404
9424
|
const initParam = constructTypeCtorParameter(env, meta, rawType);
|
|
9405
9425
|
const typeParameters = typeParametersWithDefaultTypes(typeParams);
|
|
9406
9426
|
if (meta.body) {
|
|
9407
|
-
const fnType =
|
|
9427
|
+
const fnType = ts36.factory.createFunctionTypeNode(
|
|
9408
9428
|
typeParameters,
|
|
9409
9429
|
[initParam],
|
|
9410
9430
|
rawType
|
|
9411
9431
|
);
|
|
9412
|
-
const decl =
|
|
9432
|
+
const decl = ts36.factory.createVariableDeclaration(
|
|
9413
9433
|
meta.fnName,
|
|
9414
9434
|
void 0,
|
|
9415
9435
|
fnType,
|
|
9416
|
-
|
|
9436
|
+
ts36.factory.createNonNullExpression(ts36.factory.createNull())
|
|
9417
9437
|
);
|
|
9418
|
-
const declList =
|
|
9419
|
-
return
|
|
9438
|
+
const declList = ts36.factory.createVariableDeclarationList([decl], ts36.NodeFlags.Const);
|
|
9439
|
+
return ts36.factory.createVariableStatement(
|
|
9420
9440
|
void 0,
|
|
9421
9441
|
declList
|
|
9422
9442
|
);
|
|
9423
9443
|
} else {
|
|
9424
|
-
return
|
|
9425
|
-
[
|
|
9444
|
+
return ts36.factory.createFunctionDeclaration(
|
|
9445
|
+
[ts36.factory.createModifier(ts36.SyntaxKind.DeclareKeyword)],
|
|
9426
9446
|
void 0,
|
|
9427
9447
|
meta.fnName,
|
|
9428
9448
|
typeParameters,
|
|
@@ -9434,16 +9454,16 @@ function generateTypeCtorDeclarationFn(env, meta, nodeTypeRef, typeParams) {
|
|
|
9434
9454
|
}
|
|
9435
9455
|
function generateInlineTypeCtor(env, node, meta) {
|
|
9436
9456
|
const rawTypeArgs = node.typeParameters !== void 0 ? generateGenericArgs(node.typeParameters) : void 0;
|
|
9437
|
-
const rawType =
|
|
9457
|
+
const rawType = ts36.factory.createTypeReferenceNode(node.name, rawTypeArgs);
|
|
9438
9458
|
const initParam = constructTypeCtorParameter(env, meta, rawType);
|
|
9439
9459
|
let body = void 0;
|
|
9440
9460
|
if (meta.body) {
|
|
9441
|
-
body =
|
|
9442
|
-
|
|
9461
|
+
body = ts36.factory.createBlock([
|
|
9462
|
+
ts36.factory.createReturnStatement(ts36.factory.createNonNullExpression(ts36.factory.createNull()))
|
|
9443
9463
|
]);
|
|
9444
9464
|
}
|
|
9445
|
-
return
|
|
9446
|
-
[
|
|
9465
|
+
return ts36.factory.createMethodDeclaration(
|
|
9466
|
+
[ts36.factory.createModifier(ts36.SyntaxKind.StaticKeyword)],
|
|
9447
9467
|
void 0,
|
|
9448
9468
|
meta.fnName,
|
|
9449
9469
|
void 0,
|
|
@@ -9460,12 +9480,12 @@ function constructTypeCtorParameter(env, meta, rawType) {
|
|
|
9460
9480
|
const signalInputKeys = [];
|
|
9461
9481
|
for (const { classPropertyName, transform, isSignal } of meta.fields.inputs) {
|
|
9462
9482
|
if (isSignal) {
|
|
9463
|
-
signalInputKeys.push(
|
|
9483
|
+
signalInputKeys.push(ts36.factory.createLiteralTypeNode(ts36.factory.createStringLiteral(classPropertyName)));
|
|
9464
9484
|
} else if (!meta.coercedInputFields.has(classPropertyName)) {
|
|
9465
|
-
plainKeys.push(
|
|
9485
|
+
plainKeys.push(ts36.factory.createLiteralTypeNode(ts36.factory.createStringLiteral(classPropertyName)));
|
|
9466
9486
|
} else {
|
|
9467
9487
|
const coercionType = transform != null ? transform.type.node : tsCreateTypeQueryForCoercedInput(rawType.typeName, classPropertyName);
|
|
9468
|
-
coercedKeys.push(
|
|
9488
|
+
coercedKeys.push(ts36.factory.createPropertySignature(
|
|
9469
9489
|
void 0,
|
|
9470
9490
|
classPropertyName,
|
|
9471
9491
|
void 0,
|
|
@@ -9474,25 +9494,25 @@ function constructTypeCtorParameter(env, meta, rawType) {
|
|
|
9474
9494
|
}
|
|
9475
9495
|
}
|
|
9476
9496
|
if (plainKeys.length > 0) {
|
|
9477
|
-
const keyTypeUnion =
|
|
9478
|
-
initType =
|
|
9497
|
+
const keyTypeUnion = ts36.factory.createUnionTypeNode(plainKeys);
|
|
9498
|
+
initType = ts36.factory.createTypeReferenceNode("Pick", [rawType, keyTypeUnion]);
|
|
9479
9499
|
}
|
|
9480
9500
|
if (coercedKeys.length > 0) {
|
|
9481
|
-
const coercedLiteral =
|
|
9482
|
-
initType = initType !== null ?
|
|
9501
|
+
const coercedLiteral = ts36.factory.createTypeLiteralNode(coercedKeys);
|
|
9502
|
+
initType = initType !== null ? ts36.factory.createIntersectionTypeNode([initType, coercedLiteral]) : coercedLiteral;
|
|
9483
9503
|
}
|
|
9484
9504
|
if (signalInputKeys.length > 0) {
|
|
9485
|
-
const keyTypeUnion =
|
|
9505
|
+
const keyTypeUnion = ts36.factory.createUnionTypeNode(signalInputKeys);
|
|
9486
9506
|
const unwrapDirectiveSignalInputsExpr = env.referenceExternalType(R3Identifiers3.UnwrapDirectiveSignalInputs.moduleName, R3Identifiers3.UnwrapDirectiveSignalInputs.name, [
|
|
9487
9507
|
new ExpressionType2(new WrappedNodeExpr8(rawType)),
|
|
9488
9508
|
new ExpressionType2(new WrappedNodeExpr8(keyTypeUnion))
|
|
9489
9509
|
]);
|
|
9490
|
-
initType = initType !== null ?
|
|
9510
|
+
initType = initType !== null ? ts36.factory.createIntersectionTypeNode([initType, unwrapDirectiveSignalInputsExpr]) : unwrapDirectiveSignalInputsExpr;
|
|
9491
9511
|
}
|
|
9492
9512
|
if (initType === null) {
|
|
9493
|
-
initType =
|
|
9513
|
+
initType = ts36.factory.createTypeLiteralNode([]);
|
|
9494
9514
|
}
|
|
9495
|
-
return
|
|
9515
|
+
return ts36.factory.createParameterDeclaration(
|
|
9496
9516
|
void 0,
|
|
9497
9517
|
void 0,
|
|
9498
9518
|
"init",
|
|
@@ -9502,7 +9522,7 @@ function constructTypeCtorParameter(env, meta, rawType) {
|
|
|
9502
9522
|
);
|
|
9503
9523
|
}
|
|
9504
9524
|
function generateGenericArgs(params) {
|
|
9505
|
-
return params.map((param) =>
|
|
9525
|
+
return params.map((param) => ts36.factory.createTypeReferenceNode(param.name, void 0));
|
|
9506
9526
|
}
|
|
9507
9527
|
function requiresInlineTypeCtor(node, host, env) {
|
|
9508
9528
|
return !checkIfGenericTypeBoundsCanBeEmitted(node, host, env);
|
|
@@ -9513,14 +9533,14 @@ function typeParametersWithDefaultTypes(params) {
|
|
|
9513
9533
|
}
|
|
9514
9534
|
return params.map((param) => {
|
|
9515
9535
|
if (param.default === void 0) {
|
|
9516
|
-
return
|
|
9536
|
+
return ts36.factory.updateTypeParameterDeclaration(param, param.modifiers, param.name, param.constraint, ts36.factory.createKeywordTypeNode(ts36.SyntaxKind.AnyKeyword));
|
|
9517
9537
|
} else {
|
|
9518
9538
|
return param;
|
|
9519
9539
|
}
|
|
9520
9540
|
});
|
|
9521
9541
|
}
|
|
9522
9542
|
|
|
9523
|
-
// bazel-out/
|
|
9543
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
|
|
9524
9544
|
var Environment = class extends ReferenceEmitEnvironment {
|
|
9525
9545
|
config;
|
|
9526
9546
|
nextIds = {
|
|
@@ -9543,13 +9563,13 @@ var Environment = class extends ReferenceEmitEnvironment {
|
|
|
9543
9563
|
}
|
|
9544
9564
|
if (requiresInlineTypeCtor(node, this.reflector, this)) {
|
|
9545
9565
|
const ref = this.reference(dirRef);
|
|
9546
|
-
const typeCtorExpr =
|
|
9566
|
+
const typeCtorExpr = ts37.factory.createPropertyAccessExpression(ref, "ngTypeCtor");
|
|
9547
9567
|
this.typeCtors.set(node, typeCtorExpr);
|
|
9548
9568
|
return typeCtorExpr;
|
|
9549
9569
|
} else {
|
|
9550
9570
|
const fnName = `_ctor${this.nextIds.typeCtor++}`;
|
|
9551
9571
|
const nodeTypeRef = this.referenceType(dirRef);
|
|
9552
|
-
if (!
|
|
9572
|
+
if (!ts37.isTypeReferenceNode(nodeTypeRef)) {
|
|
9553
9573
|
throw new Error(`Expected TypeReferenceNode from reference to ${dirRef.debugName}`);
|
|
9554
9574
|
}
|
|
9555
9575
|
const meta = {
|
|
@@ -9564,7 +9584,7 @@ var Environment = class extends ReferenceEmitEnvironment {
|
|
|
9564
9584
|
const typeParams = this.emitTypeParameters(node);
|
|
9565
9585
|
const typeCtor = generateTypeCtorDeclarationFn(this, meta, nodeTypeRef.typeName, typeParams);
|
|
9566
9586
|
this.typeCtorStatements.push(typeCtor);
|
|
9567
|
-
const fnId =
|
|
9587
|
+
const fnId = ts37.factory.createIdentifier(fnName);
|
|
9568
9588
|
this.typeCtors.set(node, fnId);
|
|
9569
9589
|
return fnId;
|
|
9570
9590
|
}
|
|
@@ -9574,7 +9594,7 @@ var Environment = class extends ReferenceEmitEnvironment {
|
|
|
9574
9594
|
return this.pipeInsts.get(ref.node);
|
|
9575
9595
|
}
|
|
9576
9596
|
const pipeType = this.referenceType(ref);
|
|
9577
|
-
const pipeInstId =
|
|
9597
|
+
const pipeInstId = ts37.factory.createIdentifier(`_pipe${this.nextIds.pipeInst++}`);
|
|
9578
9598
|
this.pipeInstStatements.push(tsDeclareVariable(pipeInstId, pipeType));
|
|
9579
9599
|
this.pipeInsts.set(ref.node, pipeInstId);
|
|
9580
9600
|
return pipeInstId;
|
|
@@ -9593,9 +9613,9 @@ var Environment = class extends ReferenceEmitEnvironment {
|
|
|
9593
9613
|
}
|
|
9594
9614
|
};
|
|
9595
9615
|
|
|
9596
|
-
// bazel-out/
|
|
9616
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/oob.mjs
|
|
9597
9617
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan2, TmplAstElement } from "@angular/compiler";
|
|
9598
|
-
import
|
|
9618
|
+
import ts38 from "typescript";
|
|
9599
9619
|
var OutOfBandDiagnosticRecorderImpl = class {
|
|
9600
9620
|
resolver;
|
|
9601
9621
|
_diagnostics = [];
|
|
@@ -9606,53 +9626,53 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
9606
9626
|
get diagnostics() {
|
|
9607
9627
|
return this._diagnostics;
|
|
9608
9628
|
}
|
|
9609
|
-
missingReferenceTarget(
|
|
9610
|
-
const mapping = this.resolver.
|
|
9629
|
+
missingReferenceTarget(id, ref) {
|
|
9630
|
+
const mapping = this.resolver.getTemplateSourceMapping(id);
|
|
9611
9631
|
const value = ref.value.trim();
|
|
9612
9632
|
const errorMsg = `No directive found with exportAs '${value}'.`;
|
|
9613
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9633
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, mapping, ref.valueSpan || ref.sourceSpan, ts38.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REFERENCE_TARGET), errorMsg));
|
|
9614
9634
|
}
|
|
9615
|
-
missingPipe(
|
|
9635
|
+
missingPipe(id, ast) {
|
|
9616
9636
|
if (this.recordedPipes.has(ast)) {
|
|
9617
9637
|
return;
|
|
9618
9638
|
}
|
|
9619
|
-
const mapping = this.resolver.
|
|
9639
|
+
const mapping = this.resolver.getTemplateSourceMapping(id);
|
|
9620
9640
|
const errorMsg = `No pipe found with name '${ast.name}'.`;
|
|
9621
|
-
const sourceSpan = this.resolver.
|
|
9641
|
+
const sourceSpan = this.resolver.toTemplateParseSourceSpan(id, ast.nameSpan);
|
|
9622
9642
|
if (sourceSpan === null) {
|
|
9623
9643
|
throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
|
|
9624
9644
|
}
|
|
9625
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9645
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, mapping, sourceSpan, ts38.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_PIPE), errorMsg));
|
|
9626
9646
|
this.recordedPipes.add(ast);
|
|
9627
9647
|
}
|
|
9628
|
-
deferredPipeUsedEagerly(
|
|
9648
|
+
deferredPipeUsedEagerly(id, ast) {
|
|
9629
9649
|
if (this.recordedPipes.has(ast)) {
|
|
9630
9650
|
return;
|
|
9631
9651
|
}
|
|
9632
|
-
const mapping = this.resolver.
|
|
9652
|
+
const mapping = this.resolver.getTemplateSourceMapping(id);
|
|
9633
9653
|
const errorMsg = `Pipe '${ast.name}' was imported via \`@Component.deferredImports\`, but was used outside of a \`@defer\` block in a template. To fix this, either use the '${ast.name}' pipe inside of a \`@defer\` block or import this dependency using the \`@Component.imports\` field.`;
|
|
9634
|
-
const sourceSpan = this.resolver.
|
|
9654
|
+
const sourceSpan = this.resolver.toTemplateParseSourceSpan(id, ast.nameSpan);
|
|
9635
9655
|
if (sourceSpan === null) {
|
|
9636
9656
|
throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
|
|
9637
9657
|
}
|
|
9638
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9658
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, mapping, sourceSpan, ts38.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_PIPE_USED_EAGERLY), errorMsg));
|
|
9639
9659
|
this.recordedPipes.add(ast);
|
|
9640
9660
|
}
|
|
9641
|
-
deferredComponentUsedEagerly(
|
|
9642
|
-
const mapping = this.resolver.
|
|
9661
|
+
deferredComponentUsedEagerly(id, element) {
|
|
9662
|
+
const mapping = this.resolver.getTemplateSourceMapping(id);
|
|
9643
9663
|
const errorMsg = `Element '${element.name}' contains a component or a directive that was imported via \`@Component.deferredImports\`, but the element itself is located outside of a \`@defer\` block in a template. To fix this, either use the '${element.name}' element inside of a \`@defer\` block or import referenced component/directive dependency using the \`@Component.imports\` field.`;
|
|
9644
9664
|
const { start, end } = element.startSourceSpan;
|
|
9645
9665
|
const absoluteSourceSpan = new AbsoluteSourceSpan2(start.offset, end.offset);
|
|
9646
|
-
const sourceSpan = this.resolver.
|
|
9666
|
+
const sourceSpan = this.resolver.toTemplateParseSourceSpan(id, absoluteSourceSpan);
|
|
9647
9667
|
if (sourceSpan === null) {
|
|
9648
9668
|
throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${element.name}'.`);
|
|
9649
9669
|
}
|
|
9650
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9670
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, mapping, sourceSpan, ts38.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_DIRECTIVE_USED_EAGERLY), errorMsg));
|
|
9651
9671
|
}
|
|
9652
|
-
duplicateTemplateVar(
|
|
9653
|
-
const mapping = this.resolver.
|
|
9672
|
+
duplicateTemplateVar(id, variable, firstDecl) {
|
|
9673
|
+
const mapping = this.resolver.getTemplateSourceMapping(id);
|
|
9654
9674
|
const errorMsg = `Cannot redeclare variable '${variable.name}' as it was previously declared elsewhere for the same template.`;
|
|
9655
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9675
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, mapping, variable.sourceSpan, ts38.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DUPLICATE_VARIABLE_DECLARATION), errorMsg, [
|
|
9656
9676
|
{
|
|
9657
9677
|
text: `The variable '${firstDecl.name}' was first declared here.`,
|
|
9658
9678
|
start: firstDecl.sourceSpan.start.offset,
|
|
@@ -9661,20 +9681,20 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
9661
9681
|
}
|
|
9662
9682
|
]));
|
|
9663
9683
|
}
|
|
9664
|
-
requiresInlineTcb(
|
|
9665
|
-
this._diagnostics.push(makeInlineDiagnostic(
|
|
9684
|
+
requiresInlineTcb(id, node) {
|
|
9685
|
+
this._diagnostics.push(makeInlineDiagnostic(id, ErrorCode.INLINE_TCB_REQUIRED, node.name, `This component requires inline template type-checking, which is not supported by the current environment.`));
|
|
9666
9686
|
}
|
|
9667
|
-
requiresInlineTypeConstructors(
|
|
9687
|
+
requiresInlineTypeConstructors(id, node, directives) {
|
|
9668
9688
|
let message;
|
|
9669
9689
|
if (directives.length > 1) {
|
|
9670
9690
|
message = `This component uses directives which require inline type constructors, which are not supported by the current environment.`;
|
|
9671
9691
|
} else {
|
|
9672
9692
|
message = `This component uses a directive which requires an inline type constructor, which is not supported by the current environment.`;
|
|
9673
9693
|
}
|
|
9674
|
-
this._diagnostics.push(makeInlineDiagnostic(
|
|
9694
|
+
this._diagnostics.push(makeInlineDiagnostic(id, ErrorCode.INLINE_TYPE_CTOR_REQUIRED, node.name, message, directives.map((dir) => makeRelatedInformation(dir.name, `Requires an inline type constructor.`))));
|
|
9675
9695
|
}
|
|
9676
|
-
suboptimalTypeInference(
|
|
9677
|
-
const mapping = this.resolver.
|
|
9696
|
+
suboptimalTypeInference(id, variables) {
|
|
9697
|
+
const mapping = this.resolver.getTemplateSourceMapping(id);
|
|
9678
9698
|
let diagnosticVar = null;
|
|
9679
9699
|
for (const variable of variables) {
|
|
9680
9700
|
if (diagnosticVar === null || variable.value === "" || variable.value === "$implicit") {
|
|
@@ -9693,10 +9713,10 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
9693
9713
|
const message = `This structural directive supports advanced type inference, but the current compiler configuration prevents its usage. The variable ${varIdentification} will have type 'any' as a result.
|
|
9694
9714
|
|
|
9695
9715
|
Consider enabling the 'strictTemplates' option in your tsconfig.json for better type inference within this template.`;
|
|
9696
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9716
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, mapping, diagnosticVar.keySpan, ts38.DiagnosticCategory.Suggestion, ngErrorCode(ErrorCode.SUGGEST_SUBOPTIMAL_TYPE_INFERENCE), message));
|
|
9697
9717
|
}
|
|
9698
|
-
splitTwoWayBinding(
|
|
9699
|
-
const mapping = this.resolver.
|
|
9718
|
+
splitTwoWayBinding(id, input, output, inputConsumer, outputConsumer) {
|
|
9719
|
+
const mapping = this.resolver.getTemplateSourceMapping(id);
|
|
9700
9720
|
const errorMsg = `The property and event halves of the two-way binding '${input.name}' are not bound to the same target.
|
|
9701
9721
|
Find more at https://angular.dev/guide/templates/two-way-binding#how-two-way-binding-works`;
|
|
9702
9722
|
const relatedMessages = [];
|
|
@@ -9727,22 +9747,22 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
9727
9747
|
sourceFile: outputConsumer.name.getSourceFile()
|
|
9728
9748
|
});
|
|
9729
9749
|
}
|
|
9730
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9750
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, mapping, input.keySpan, ts38.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SPLIT_TWO_WAY_BINDING), errorMsg, relatedMessages));
|
|
9731
9751
|
}
|
|
9732
|
-
missingRequiredInputs(
|
|
9752
|
+
missingRequiredInputs(id, element, directiveName, isComponent, inputAliases) {
|
|
9733
9753
|
const message = `Required input${inputAliases.length === 1 ? "" : "s"} ${inputAliases.map((n2) => `'${n2}'`).join(", ")} from ${isComponent ? "component" : "directive"} ${directiveName} must be specified.`;
|
|
9734
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9754
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), element.startSourceSpan, ts38.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REQUIRED_INPUTS), message));
|
|
9735
9755
|
}
|
|
9736
|
-
illegalForLoopTrackAccess(
|
|
9737
|
-
const sourceSpan = this.resolver.
|
|
9756
|
+
illegalForLoopTrackAccess(id, block, access) {
|
|
9757
|
+
const sourceSpan = this.resolver.toTemplateParseSourceSpan(id, access.sourceSpan);
|
|
9738
9758
|
if (sourceSpan === null) {
|
|
9739
9759
|
throw new Error(`Assertion failure: no SourceLocation found for property read.`);
|
|
9740
9760
|
}
|
|
9741
9761
|
const messageVars = [block.item, ...block.contextVariables.filter((v) => v.value === "$index")].map((v) => `'${v.name}'`).join(", ");
|
|
9742
9762
|
const message = `Cannot access '${access.name}' inside of a track expression. Only ${messageVars} and properties on the containing component are available to this expression.`;
|
|
9743
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9763
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), sourceSpan, ts38.DiagnosticCategory.Error, ngErrorCode(ErrorCode.ILLEGAL_FOR_LOOP_TRACK_ACCESS), message));
|
|
9744
9764
|
}
|
|
9745
|
-
inaccessibleDeferredTriggerElement(
|
|
9765
|
+
inaccessibleDeferredTriggerElement(id, trigger) {
|
|
9746
9766
|
let message;
|
|
9747
9767
|
if (trigger.reference === null) {
|
|
9748
9768
|
message = `Trigger cannot find reference. Make sure that the @defer block has a @placeholder with at least one root element node.`;
|
|
@@ -9751,9 +9771,9 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
9751
9771
|
Check that an element with #${trigger.reference} exists in the same template and it's accessible from the @defer block.
|
|
9752
9772
|
Deferred blocks can only access triggers in same view, a parent embedded view or the root view of the @placeholder block.`;
|
|
9753
9773
|
}
|
|
9754
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9774
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), trigger.sourceSpan, ts38.DiagnosticCategory.Error, ngErrorCode(ErrorCode.INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT), message));
|
|
9755
9775
|
}
|
|
9756
|
-
controlFlowPreventingContentProjection(
|
|
9776
|
+
controlFlowPreventingContentProjection(id, category, projectionNode, componentName, slotSelector, controlFlowNode, preservesWhitespaces) {
|
|
9757
9777
|
const blockName = controlFlowNode.nameSpan.toString().trim();
|
|
9758
9778
|
const lines = [
|
|
9759
9779
|
`Node matches the "${slotSelector}" slot of the "${componentName}" component, but will not be projected into the specific slot because the surrounding ${blockName} has more than one node at its root. To project the node in the right slot, you can:
|
|
@@ -9766,38 +9786,38 @@ Deferred blocks can only access triggers in same view, a parent embedded view or
|
|
|
9766
9786
|
lines.push("Note: the host component has `preserveWhitespaces: true` which may cause whitespace to affect content projection.");
|
|
9767
9787
|
}
|
|
9768
9788
|
lines.push("", 'This check can be disabled using the `extendedDiagnostics.checks.controlFlowPreventingContentProjection = "suppress" compiler option.`');
|
|
9769
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9789
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), projectionNode.startSourceSpan, category, ngErrorCode(ErrorCode.CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION), lines.join("\n")));
|
|
9770
9790
|
}
|
|
9771
|
-
illegalWriteToLetDeclaration(
|
|
9772
|
-
const sourceSpan = this.resolver.
|
|
9791
|
+
illegalWriteToLetDeclaration(id, node, target) {
|
|
9792
|
+
const sourceSpan = this.resolver.toTemplateParseSourceSpan(id, node.sourceSpan);
|
|
9773
9793
|
if (sourceSpan === null) {
|
|
9774
9794
|
throw new Error(`Assertion failure: no SourceLocation found for property write.`);
|
|
9775
9795
|
}
|
|
9776
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9796
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), sourceSpan, ts38.DiagnosticCategory.Error, ngErrorCode(ErrorCode.ILLEGAL_LET_WRITE), `Cannot assign to @let declaration '${target.name}'.`));
|
|
9777
9797
|
}
|
|
9778
|
-
letUsedBeforeDefinition(
|
|
9779
|
-
const sourceSpan = this.resolver.
|
|
9798
|
+
letUsedBeforeDefinition(id, node, target) {
|
|
9799
|
+
const sourceSpan = this.resolver.toTemplateParseSourceSpan(id, node.sourceSpan);
|
|
9780
9800
|
if (sourceSpan === null) {
|
|
9781
9801
|
throw new Error(`Assertion failure: no SourceLocation found for property read.`);
|
|
9782
9802
|
}
|
|
9783
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9803
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), sourceSpan, ts38.DiagnosticCategory.Error, ngErrorCode(ErrorCode.LET_USED_BEFORE_DEFINITION), `Cannot read @let declaration '${target.name}' before it has been defined.`));
|
|
9784
9804
|
}
|
|
9785
|
-
conflictingDeclaration(
|
|
9786
|
-
const mapping = this.resolver.
|
|
9805
|
+
conflictingDeclaration(id, decl) {
|
|
9806
|
+
const mapping = this.resolver.getTemplateSourceMapping(id);
|
|
9787
9807
|
const errorMsg = `Cannot declare @let called '${decl.name}' as there is another symbol in the template with the same name.`;
|
|
9788
|
-
this._diagnostics.push(makeTemplateDiagnostic(
|
|
9808
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, mapping, decl.sourceSpan, ts38.DiagnosticCategory.Error, ngErrorCode(ErrorCode.CONFLICTING_LET_DECLARATION), errorMsg));
|
|
9789
9809
|
}
|
|
9790
9810
|
};
|
|
9791
|
-
function makeInlineDiagnostic(
|
|
9811
|
+
function makeInlineDiagnostic(id, code, node, messageText, relatedInformation) {
|
|
9792
9812
|
return {
|
|
9793
9813
|
...makeDiagnostic(code, node, messageText, relatedInformation),
|
|
9794
|
-
|
|
9795
|
-
|
|
9814
|
+
sourceFile: node.getSourceFile(),
|
|
9815
|
+
typeCheckId: id
|
|
9796
9816
|
};
|
|
9797
9817
|
}
|
|
9798
9818
|
|
|
9799
|
-
// bazel-out/
|
|
9800
|
-
import
|
|
9819
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/shim.mjs
|
|
9820
|
+
import ts39 from "typescript";
|
|
9801
9821
|
var TypeCheckShimGenerator = class {
|
|
9802
9822
|
extensionPrefix = "ngtypecheck";
|
|
9803
9823
|
shouldEmit = false;
|
|
@@ -9805,25 +9825,25 @@ var TypeCheckShimGenerator = class {
|
|
|
9805
9825
|
if (priorShimSf !== null) {
|
|
9806
9826
|
return priorShimSf;
|
|
9807
9827
|
}
|
|
9808
|
-
return
|
|
9828
|
+
return ts39.createSourceFile(genFilePath, "export const USED_FOR_NG_TYPE_CHECKING = true;", ts39.ScriptTarget.Latest, true, ts39.ScriptKind.TS);
|
|
9809
9829
|
}
|
|
9810
9830
|
static shimFor(fileName) {
|
|
9811
9831
|
return absoluteFrom(fileName.replace(/\.tsx?$/, ".ngtypecheck.ts"));
|
|
9812
9832
|
}
|
|
9813
9833
|
};
|
|
9814
9834
|
|
|
9815
|
-
// bazel-out/
|
|
9835
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
9816
9836
|
import { BindingPipe, BindingType, Call as Call2, createCssSelectorFromNode, CssSelector as CssSelector2, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver2, ParsedEventType, PropertyRead as PropertyRead3, PropertyWrite as PropertyWrite2, R3Identifiers as R3Identifiers4, SafeCall, SafePropertyRead as SafePropertyRead3, SelectorMatcher as SelectorMatcher2, ThisReceiver, TmplAstBoundAttribute, TmplAstBoundText, TmplAstContent, TmplAstDeferredBlock, TmplAstElement as TmplAstElement2, TmplAstForLoopBlock, TmplAstIcu, TmplAstIfBlock, TmplAstIfBlockBranch, TmplAstLetDeclaration as TmplAstLetDeclaration2, TmplAstReference as TmplAstReference2, TmplAstSwitchBlock, TmplAstTemplate, TmplAstText, TmplAstTextAttribute as TmplAstTextAttribute2, TmplAstVariable, TransplantedType } from "@angular/compiler";
|
|
9817
|
-
import
|
|
9837
|
+
import ts42 from "typescript";
|
|
9818
9838
|
|
|
9819
|
-
// bazel-out/
|
|
9839
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.mjs
|
|
9820
9840
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan3 } from "@angular/compiler";
|
|
9821
|
-
import
|
|
9841
|
+
import ts40 from "typescript";
|
|
9822
9842
|
function wrapForDiagnostics(expr) {
|
|
9823
|
-
return
|
|
9843
|
+
return ts40.factory.createParenthesizedExpression(expr);
|
|
9824
9844
|
}
|
|
9825
9845
|
function wrapForTypeChecker(expr) {
|
|
9826
|
-
return
|
|
9846
|
+
return ts40.factory.createParenthesizedExpression(expr);
|
|
9827
9847
|
}
|
|
9828
9848
|
function addParseSpanInfo(node, span) {
|
|
9829
9849
|
let commentText;
|
|
@@ -9832,15 +9852,15 @@ function addParseSpanInfo(node, span) {
|
|
|
9832
9852
|
} else {
|
|
9833
9853
|
commentText = `${span.start.offset},${span.end.offset}`;
|
|
9834
9854
|
}
|
|
9835
|
-
|
|
9855
|
+
ts40.addSyntheticTrailingComment(
|
|
9836
9856
|
node,
|
|
9837
|
-
|
|
9857
|
+
ts40.SyntaxKind.MultiLineCommentTrivia,
|
|
9838
9858
|
commentText,
|
|
9839
9859
|
false
|
|
9840
9860
|
);
|
|
9841
9861
|
}
|
|
9842
|
-
function
|
|
9843
|
-
|
|
9862
|
+
function addTypeCheckId(tcb, id) {
|
|
9863
|
+
ts40.addSyntheticLeadingComment(tcb, ts40.SyntaxKind.MultiLineCommentTrivia, id, true);
|
|
9844
9864
|
}
|
|
9845
9865
|
function shouldReportDiagnostic(diagnostic) {
|
|
9846
9866
|
const { code } = diagnostic;
|
|
@@ -9859,7 +9879,7 @@ function translateDiagnostic(diagnostic, resolver) {
|
|
|
9859
9879
|
if (diagnostic.file === void 0 || diagnostic.start === void 0) {
|
|
9860
9880
|
return null;
|
|
9861
9881
|
}
|
|
9862
|
-
const fullMapping =
|
|
9882
|
+
const fullMapping = getSourceMapping(
|
|
9863
9883
|
diagnostic.file,
|
|
9864
9884
|
diagnostic.start,
|
|
9865
9885
|
resolver,
|
|
@@ -9868,38 +9888,38 @@ function translateDiagnostic(diagnostic, resolver) {
|
|
|
9868
9888
|
if (fullMapping === null) {
|
|
9869
9889
|
return null;
|
|
9870
9890
|
}
|
|
9871
|
-
const { sourceLocation, templateSourceMapping, span } = fullMapping;
|
|
9891
|
+
const { sourceLocation, sourceMapping: templateSourceMapping, span } = fullMapping;
|
|
9872
9892
|
return makeTemplateDiagnostic(sourceLocation.id, templateSourceMapping, span, diagnostic.category, diagnostic.code, diagnostic.messageText);
|
|
9873
9893
|
}
|
|
9874
9894
|
|
|
9875
|
-
// bazel-out/
|
|
9895
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/expression.mjs
|
|
9876
9896
|
import { ASTWithSource, Call, EmptyExpr as EmptyExpr2, PropertyRead as PropertyRead2, SafeKeyedRead, SafePropertyRead as SafePropertyRead2 } from "@angular/compiler";
|
|
9877
|
-
import
|
|
9878
|
-
var ANY_EXPRESSION =
|
|
9879
|
-
var UNDEFINED =
|
|
9897
|
+
import ts41 from "typescript";
|
|
9898
|
+
var ANY_EXPRESSION = ts41.factory.createAsExpression(ts41.factory.createNumericLiteral("0"), ts41.factory.createKeywordTypeNode(ts41.SyntaxKind.AnyKeyword));
|
|
9899
|
+
var UNDEFINED = ts41.factory.createIdentifier("undefined");
|
|
9880
9900
|
var UNARY_OPS = /* @__PURE__ */ new Map([
|
|
9881
|
-
["+",
|
|
9882
|
-
["-",
|
|
9901
|
+
["+", ts41.SyntaxKind.PlusToken],
|
|
9902
|
+
["-", ts41.SyntaxKind.MinusToken]
|
|
9883
9903
|
]);
|
|
9884
9904
|
var BINARY_OPS = /* @__PURE__ */ new Map([
|
|
9885
|
-
["+",
|
|
9886
|
-
["-",
|
|
9887
|
-
["<",
|
|
9888
|
-
[">",
|
|
9889
|
-
["<=",
|
|
9890
|
-
[">=",
|
|
9891
|
-
["==",
|
|
9892
|
-
["===",
|
|
9893
|
-
["*",
|
|
9894
|
-
["/",
|
|
9895
|
-
["%",
|
|
9896
|
-
["!=",
|
|
9897
|
-
["!==",
|
|
9898
|
-
["||",
|
|
9899
|
-
["&&",
|
|
9900
|
-
["&",
|
|
9901
|
-
["|",
|
|
9902
|
-
["??",
|
|
9905
|
+
["+", ts41.SyntaxKind.PlusToken],
|
|
9906
|
+
["-", ts41.SyntaxKind.MinusToken],
|
|
9907
|
+
["<", ts41.SyntaxKind.LessThanToken],
|
|
9908
|
+
[">", ts41.SyntaxKind.GreaterThanToken],
|
|
9909
|
+
["<=", ts41.SyntaxKind.LessThanEqualsToken],
|
|
9910
|
+
[">=", ts41.SyntaxKind.GreaterThanEqualsToken],
|
|
9911
|
+
["==", ts41.SyntaxKind.EqualsEqualsToken],
|
|
9912
|
+
["===", ts41.SyntaxKind.EqualsEqualsEqualsToken],
|
|
9913
|
+
["*", ts41.SyntaxKind.AsteriskToken],
|
|
9914
|
+
["/", ts41.SyntaxKind.SlashToken],
|
|
9915
|
+
["%", ts41.SyntaxKind.PercentToken],
|
|
9916
|
+
["!=", ts41.SyntaxKind.ExclamationEqualsToken],
|
|
9917
|
+
["!==", ts41.SyntaxKind.ExclamationEqualsEqualsToken],
|
|
9918
|
+
["||", ts41.SyntaxKind.BarBarToken],
|
|
9919
|
+
["&&", ts41.SyntaxKind.AmpersandAmpersandToken],
|
|
9920
|
+
["&", ts41.SyntaxKind.AmpersandToken],
|
|
9921
|
+
["|", ts41.SyntaxKind.BarToken],
|
|
9922
|
+
["??", ts41.SyntaxKind.QuestionQuestionToken]
|
|
9903
9923
|
]);
|
|
9904
9924
|
function astToTypescript(ast, maybeResolve, config) {
|
|
9905
9925
|
const translator = new AstTranslator(maybeResolve, config);
|
|
@@ -9917,7 +9937,7 @@ var AstTranslator = class {
|
|
|
9917
9937
|
ast = ast.ast;
|
|
9918
9938
|
}
|
|
9919
9939
|
if (ast instanceof EmptyExpr2) {
|
|
9920
|
-
const res =
|
|
9940
|
+
const res = ts41.factory.createIdentifier("undefined");
|
|
9921
9941
|
addParseSpanInfo(res, ast.sourceSpan);
|
|
9922
9942
|
return res;
|
|
9923
9943
|
}
|
|
@@ -9933,7 +9953,7 @@ var AstTranslator = class {
|
|
|
9933
9953
|
if (op === void 0) {
|
|
9934
9954
|
throw new Error(`Unsupported Unary.operator: ${ast.operator}`);
|
|
9935
9955
|
}
|
|
9936
|
-
const node = wrapForDiagnostics(
|
|
9956
|
+
const node = wrapForDiagnostics(ts41.factory.createPrefixUnaryExpression(op, expr));
|
|
9937
9957
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
9938
9958
|
return node;
|
|
9939
9959
|
}
|
|
@@ -9944,13 +9964,13 @@ var AstTranslator = class {
|
|
|
9944
9964
|
if (op === void 0) {
|
|
9945
9965
|
throw new Error(`Unsupported Binary.operation: ${ast.operation}`);
|
|
9946
9966
|
}
|
|
9947
|
-
const node =
|
|
9967
|
+
const node = ts41.factory.createBinaryExpression(lhs, op, rhs);
|
|
9948
9968
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
9949
9969
|
return node;
|
|
9950
9970
|
}
|
|
9951
9971
|
visitChain(ast) {
|
|
9952
9972
|
const elements = ast.expressions.map((expr) => this.translate(expr));
|
|
9953
|
-
const node = wrapForDiagnostics(
|
|
9973
|
+
const node = wrapForDiagnostics(ts41.factory.createCommaListExpression(elements));
|
|
9954
9974
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
9955
9975
|
return node;
|
|
9956
9976
|
}
|
|
@@ -9958,7 +9978,7 @@ var AstTranslator = class {
|
|
|
9958
9978
|
const condExpr = this.translate(ast.condition);
|
|
9959
9979
|
const trueExpr = this.translate(ast.trueExp);
|
|
9960
9980
|
const falseExpr = wrapForTypeChecker(this.translate(ast.falseExp));
|
|
9961
|
-
const node =
|
|
9981
|
+
const node = ts41.factory.createParenthesizedExpression(ts41.factory.createConditionalExpression(condExpr, void 0, trueExpr, void 0, falseExpr));
|
|
9962
9982
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
9963
9983
|
return node;
|
|
9964
9984
|
}
|
|
@@ -9969,26 +9989,26 @@ var AstTranslator = class {
|
|
|
9969
9989
|
throw new Error("Method not implemented.");
|
|
9970
9990
|
}
|
|
9971
9991
|
visitInterpolation(ast) {
|
|
9972
|
-
return ast.expressions.reduce((lhs, ast2) =>
|
|
9992
|
+
return ast.expressions.reduce((lhs, ast2) => ts41.factory.createBinaryExpression(lhs, ts41.SyntaxKind.PlusToken, wrapForTypeChecker(this.translate(ast2))), ts41.factory.createStringLiteral(""));
|
|
9973
9993
|
}
|
|
9974
9994
|
visitKeyedRead(ast) {
|
|
9975
9995
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
9976
9996
|
const key = this.translate(ast.key);
|
|
9977
|
-
const node =
|
|
9997
|
+
const node = ts41.factory.createElementAccessExpression(receiver, key);
|
|
9978
9998
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
9979
9999
|
return node;
|
|
9980
10000
|
}
|
|
9981
10001
|
visitKeyedWrite(ast) {
|
|
9982
10002
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
9983
|
-
const left =
|
|
10003
|
+
const left = ts41.factory.createElementAccessExpression(receiver, this.translate(ast.key));
|
|
9984
10004
|
const right = wrapForTypeChecker(this.translate(ast.value));
|
|
9985
|
-
const node = wrapForDiagnostics(
|
|
10005
|
+
const node = wrapForDiagnostics(ts41.factory.createBinaryExpression(left, ts41.SyntaxKind.EqualsToken, right));
|
|
9986
10006
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
9987
10007
|
return node;
|
|
9988
10008
|
}
|
|
9989
10009
|
visitLiteralArray(ast) {
|
|
9990
10010
|
const elements = ast.expressions.map((expr) => this.translate(expr));
|
|
9991
|
-
const literal3 =
|
|
10011
|
+
const literal3 = ts41.factory.createArrayLiteralExpression(elements);
|
|
9992
10012
|
const node = this.config.strictLiteralTypes ? literal3 : tsCastToAny(literal3);
|
|
9993
10013
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
9994
10014
|
return node;
|
|
@@ -9996,9 +10016,9 @@ var AstTranslator = class {
|
|
|
9996
10016
|
visitLiteralMap(ast) {
|
|
9997
10017
|
const properties = ast.keys.map(({ key }, idx) => {
|
|
9998
10018
|
const value = this.translate(ast.values[idx]);
|
|
9999
|
-
return
|
|
10019
|
+
return ts41.factory.createPropertyAssignment(ts41.factory.createStringLiteral(key), value);
|
|
10000
10020
|
});
|
|
10001
|
-
const literal3 =
|
|
10021
|
+
const literal3 = ts41.factory.createObjectLiteralExpression(properties, true);
|
|
10002
10022
|
const node = this.config.strictLiteralTypes ? literal3 : tsCastToAny(literal3);
|
|
10003
10023
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
10004
10024
|
return node;
|
|
@@ -10006,15 +10026,15 @@ var AstTranslator = class {
|
|
|
10006
10026
|
visitLiteralPrimitive(ast) {
|
|
10007
10027
|
let node;
|
|
10008
10028
|
if (ast.value === void 0) {
|
|
10009
|
-
node =
|
|
10029
|
+
node = ts41.factory.createIdentifier("undefined");
|
|
10010
10030
|
} else if (ast.value === null) {
|
|
10011
|
-
node =
|
|
10031
|
+
node = ts41.factory.createNull();
|
|
10012
10032
|
} else if (typeof ast.value === "string") {
|
|
10013
|
-
node =
|
|
10033
|
+
node = ts41.factory.createStringLiteral(ast.value);
|
|
10014
10034
|
} else if (typeof ast.value === "number") {
|
|
10015
10035
|
node = tsNumericExpression(ast.value);
|
|
10016
10036
|
} else if (typeof ast.value === "boolean") {
|
|
10017
|
-
node = ast.value ?
|
|
10037
|
+
node = ast.value ? ts41.factory.createTrue() : ts41.factory.createFalse();
|
|
10018
10038
|
} else {
|
|
10019
10039
|
throw Error(`Unsupported AST value of type ${typeof ast.value}`);
|
|
10020
10040
|
}
|
|
@@ -10023,7 +10043,7 @@ var AstTranslator = class {
|
|
|
10023
10043
|
}
|
|
10024
10044
|
visitNonNullAssert(ast) {
|
|
10025
10045
|
const expr = wrapForDiagnostics(this.translate(ast.expression));
|
|
10026
|
-
const node =
|
|
10046
|
+
const node = ts41.factory.createNonNullExpression(expr);
|
|
10027
10047
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
10028
10048
|
return node;
|
|
10029
10049
|
}
|
|
@@ -10032,19 +10052,19 @@ var AstTranslator = class {
|
|
|
10032
10052
|
}
|
|
10033
10053
|
visitPrefixNot(ast) {
|
|
10034
10054
|
const expression = wrapForDiagnostics(this.translate(ast.expression));
|
|
10035
|
-
const node =
|
|
10055
|
+
const node = ts41.factory.createLogicalNot(expression);
|
|
10036
10056
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
10037
10057
|
return node;
|
|
10038
10058
|
}
|
|
10039
10059
|
visitTypeofExpression(ast) {
|
|
10040
10060
|
const expression = wrapForDiagnostics(this.translate(ast.expression));
|
|
10041
|
-
const node =
|
|
10061
|
+
const node = ts41.factory.createTypeOfExpression(expression);
|
|
10042
10062
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
10043
10063
|
return node;
|
|
10044
10064
|
}
|
|
10045
10065
|
visitPropertyRead(ast) {
|
|
10046
10066
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
10047
|
-
const name =
|
|
10067
|
+
const name = ts41.factory.createPropertyAccessExpression(receiver, ast.name);
|
|
10048
10068
|
addParseSpanInfo(name, ast.nameSpan);
|
|
10049
10069
|
const node = wrapForDiagnostics(name);
|
|
10050
10070
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
@@ -10052,12 +10072,12 @@ var AstTranslator = class {
|
|
|
10052
10072
|
}
|
|
10053
10073
|
visitPropertyWrite(ast) {
|
|
10054
10074
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
10055
|
-
const left =
|
|
10075
|
+
const left = ts41.factory.createPropertyAccessExpression(receiver, ast.name);
|
|
10056
10076
|
addParseSpanInfo(left, ast.nameSpan);
|
|
10057
10077
|
const leftWithPath = wrapForDiagnostics(left);
|
|
10058
10078
|
addParseSpanInfo(leftWithPath, ast.sourceSpan);
|
|
10059
10079
|
const right = wrapForTypeChecker(this.translate(ast.value));
|
|
10060
|
-
const node = wrapForDiagnostics(
|
|
10080
|
+
const node = wrapForDiagnostics(ts41.factory.createBinaryExpression(leftWithPath, ts41.SyntaxKind.EqualsToken, right));
|
|
10061
10081
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
10062
10082
|
return node;
|
|
10063
10083
|
}
|
|
@@ -10065,13 +10085,13 @@ var AstTranslator = class {
|
|
|
10065
10085
|
let node;
|
|
10066
10086
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
10067
10087
|
if (this.config.strictSafeNavigationTypes) {
|
|
10068
|
-
const expr =
|
|
10088
|
+
const expr = ts41.factory.createPropertyAccessExpression(ts41.factory.createNonNullExpression(receiver), ast.name);
|
|
10069
10089
|
addParseSpanInfo(expr, ast.nameSpan);
|
|
10070
|
-
node =
|
|
10090
|
+
node = ts41.factory.createParenthesizedExpression(ts41.factory.createConditionalExpression(ANY_EXPRESSION, void 0, expr, void 0, UNDEFINED));
|
|
10071
10091
|
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
10072
|
-
node =
|
|
10092
|
+
node = ts41.factory.createPropertyAccessExpression(tsCastToAny(receiver), ast.name);
|
|
10073
10093
|
} else {
|
|
10074
|
-
const expr =
|
|
10094
|
+
const expr = ts41.factory.createPropertyAccessExpression(ts41.factory.createNonNullExpression(receiver), ast.name);
|
|
10075
10095
|
addParseSpanInfo(expr, ast.nameSpan);
|
|
10076
10096
|
node = tsCastToAny(expr);
|
|
10077
10097
|
}
|
|
@@ -10083,13 +10103,13 @@ var AstTranslator = class {
|
|
|
10083
10103
|
const key = this.translate(ast.key);
|
|
10084
10104
|
let node;
|
|
10085
10105
|
if (this.config.strictSafeNavigationTypes) {
|
|
10086
|
-
const expr =
|
|
10106
|
+
const expr = ts41.factory.createElementAccessExpression(ts41.factory.createNonNullExpression(receiver), key);
|
|
10087
10107
|
addParseSpanInfo(expr, ast.sourceSpan);
|
|
10088
|
-
node =
|
|
10108
|
+
node = ts41.factory.createParenthesizedExpression(ts41.factory.createConditionalExpression(ANY_EXPRESSION, void 0, expr, void 0, UNDEFINED));
|
|
10089
10109
|
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
10090
|
-
node =
|
|
10110
|
+
node = ts41.factory.createElementAccessExpression(tsCastToAny(receiver), key);
|
|
10091
10111
|
} else {
|
|
10092
|
-
const expr =
|
|
10112
|
+
const expr = ts41.factory.createElementAccessExpression(ts41.factory.createNonNullExpression(receiver), key);
|
|
10093
10113
|
addParseSpanInfo(expr, ast.sourceSpan);
|
|
10094
10114
|
node = tsCastToAny(expr);
|
|
10095
10115
|
}
|
|
@@ -10106,7 +10126,7 @@ var AstTranslator = class {
|
|
|
10106
10126
|
expr = resolved;
|
|
10107
10127
|
} else {
|
|
10108
10128
|
const propertyReceiver = wrapForDiagnostics(this.translate(receiver.receiver));
|
|
10109
|
-
expr =
|
|
10129
|
+
expr = ts41.factory.createPropertyAccessExpression(propertyReceiver, receiver.name);
|
|
10110
10130
|
addParseSpanInfo(expr, receiver.nameSpan);
|
|
10111
10131
|
}
|
|
10112
10132
|
} else {
|
|
@@ -10116,7 +10136,7 @@ var AstTranslator = class {
|
|
|
10116
10136
|
if (ast.receiver instanceof SafePropertyRead2 || ast.receiver instanceof SafeKeyedRead) {
|
|
10117
10137
|
node = this.convertToSafeCall(ast, expr, args);
|
|
10118
10138
|
} else {
|
|
10119
|
-
node =
|
|
10139
|
+
node = ts41.factory.createCallExpression(expr, void 0, args);
|
|
10120
10140
|
}
|
|
10121
10141
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
10122
10142
|
return node;
|
|
@@ -10133,18 +10153,18 @@ var AstTranslator = class {
|
|
|
10133
10153
|
const head = ast.elements[0];
|
|
10134
10154
|
let result;
|
|
10135
10155
|
if (length === 1) {
|
|
10136
|
-
result =
|
|
10156
|
+
result = ts41.factory.createNoSubstitutionTemplateLiteral(head.text);
|
|
10137
10157
|
} else {
|
|
10138
10158
|
const spans = [];
|
|
10139
10159
|
const tailIndex = length - 1;
|
|
10140
10160
|
for (let i = 1; i < tailIndex; i++) {
|
|
10141
|
-
const middle =
|
|
10142
|
-
spans.push(
|
|
10161
|
+
const middle = ts41.factory.createTemplateMiddle(ast.elements[i].text);
|
|
10162
|
+
spans.push(ts41.factory.createTemplateSpan(this.translate(ast.expressions[i - 1]), middle));
|
|
10143
10163
|
}
|
|
10144
10164
|
const resolvedExpression = this.translate(ast.expressions[tailIndex - 1]);
|
|
10145
|
-
const templateTail =
|
|
10146
|
-
spans.push(
|
|
10147
|
-
result =
|
|
10165
|
+
const templateTail = ts41.factory.createTemplateTail(ast.elements[tailIndex].text);
|
|
10166
|
+
spans.push(ts41.factory.createTemplateSpan(resolvedExpression, templateTail));
|
|
10167
|
+
result = ts41.factory.createTemplateExpression(ts41.factory.createTemplateHead(head.text), spans);
|
|
10148
10168
|
}
|
|
10149
10169
|
return result;
|
|
10150
10170
|
}
|
|
@@ -10153,13 +10173,13 @@ var AstTranslator = class {
|
|
|
10153
10173
|
}
|
|
10154
10174
|
convertToSafeCall(ast, expr, args) {
|
|
10155
10175
|
if (this.config.strictSafeNavigationTypes) {
|
|
10156
|
-
const call =
|
|
10157
|
-
return
|
|
10176
|
+
const call = ts41.factory.createCallExpression(ts41.factory.createNonNullExpression(expr), void 0, args);
|
|
10177
|
+
return ts41.factory.createParenthesizedExpression(ts41.factory.createConditionalExpression(ANY_EXPRESSION, void 0, call, void 0, UNDEFINED));
|
|
10158
10178
|
}
|
|
10159
10179
|
if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
10160
|
-
return
|
|
10180
|
+
return ts41.factory.createCallExpression(tsCastToAny(expr), void 0, args);
|
|
10161
10181
|
}
|
|
10162
|
-
return tsCastToAny(
|
|
10182
|
+
return tsCastToAny(ts41.factory.createCallExpression(ts41.factory.createNonNullExpression(expr), void 0, args));
|
|
10163
10183
|
}
|
|
10164
10184
|
};
|
|
10165
10185
|
var _VeSafeLhsInferenceBugDetector = class {
|
|
@@ -10243,7 +10263,7 @@ var _VeSafeLhsInferenceBugDetector = class {
|
|
|
10243
10263
|
var VeSafeLhsInferenceBugDetector = _VeSafeLhsInferenceBugDetector;
|
|
10244
10264
|
__publicField(VeSafeLhsInferenceBugDetector, "SINGLETON", new _VeSafeLhsInferenceBugDetector());
|
|
10245
10265
|
|
|
10246
|
-
// bazel-out/
|
|
10266
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
10247
10267
|
var TcbGenericContextBehavior;
|
|
10248
10268
|
(function(TcbGenericContextBehavior2) {
|
|
10249
10269
|
TcbGenericContextBehavior2[TcbGenericContextBehavior2["UseEmitter"] = 0] = "UseEmitter";
|
|
@@ -10254,7 +10274,7 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
10254
10274
|
const tcb = new Context(env, domSchemaChecker, oobRecorder, meta.id, meta.boundTarget, meta.pipes, meta.schemas, meta.isStandalone, meta.preserveWhitespaces);
|
|
10255
10275
|
const scope = Scope.forNodes(tcb, null, null, tcb.boundTarget.target.template, null);
|
|
10256
10276
|
const ctxRawType = env.referenceType(ref);
|
|
10257
|
-
if (!
|
|
10277
|
+
if (!ts42.isTypeReferenceNode(ctxRawType)) {
|
|
10258
10278
|
throw new Error(`Expected TypeReferenceNode when referencing the ctx param for ${ref.debugName}`);
|
|
10259
10279
|
}
|
|
10260
10280
|
let typeParameters = void 0;
|
|
@@ -10266,24 +10286,24 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
10266
10286
|
switch (genericContextBehavior) {
|
|
10267
10287
|
case TcbGenericContextBehavior.UseEmitter:
|
|
10268
10288
|
typeParameters = new TypeParameterEmitter(ref.node.typeParameters, env.reflector).emit((typeRef) => env.referenceType(typeRef));
|
|
10269
|
-
typeArguments = typeParameters.map((param) =>
|
|
10289
|
+
typeArguments = typeParameters.map((param) => ts42.factory.createTypeReferenceNode(param.name));
|
|
10270
10290
|
break;
|
|
10271
10291
|
case TcbGenericContextBehavior.CopyClassNodes:
|
|
10272
10292
|
typeParameters = [...ref.node.typeParameters];
|
|
10273
|
-
typeArguments = typeParameters.map((param) =>
|
|
10293
|
+
typeArguments = typeParameters.map((param) => ts42.factory.createTypeReferenceNode(param.name));
|
|
10274
10294
|
break;
|
|
10275
10295
|
case TcbGenericContextBehavior.FallbackToAny:
|
|
10276
|
-
typeArguments = ref.node.typeParameters.map(() =>
|
|
10296
|
+
typeArguments = ref.node.typeParameters.map(() => ts42.factory.createKeywordTypeNode(ts42.SyntaxKind.AnyKeyword));
|
|
10277
10297
|
break;
|
|
10278
10298
|
}
|
|
10279
10299
|
}
|
|
10280
10300
|
const paramList = [tcbThisParam(ctxRawType.typeName, typeArguments)];
|
|
10281
10301
|
const scopeStatements = scope.render();
|
|
10282
|
-
const innerBody =
|
|
10283
|
-
const body =
|
|
10284
|
-
|
|
10302
|
+
const innerBody = ts42.factory.createBlock([...env.getPreludeStatements(), ...scopeStatements]);
|
|
10303
|
+
const body = ts42.factory.createBlock([
|
|
10304
|
+
ts42.factory.createIfStatement(ts42.factory.createTrue(), innerBody, void 0)
|
|
10285
10305
|
]);
|
|
10286
|
-
const fnDecl =
|
|
10306
|
+
const fnDecl = ts42.factory.createFunctionDeclaration(
|
|
10287
10307
|
void 0,
|
|
10288
10308
|
void 0,
|
|
10289
10309
|
name,
|
|
@@ -10292,7 +10312,7 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
10292
10312
|
void 0,
|
|
10293
10313
|
body
|
|
10294
10314
|
);
|
|
10295
|
-
|
|
10315
|
+
addTypeCheckId(fnDecl, meta.id);
|
|
10296
10316
|
return fnDecl;
|
|
10297
10317
|
}
|
|
10298
10318
|
var TcbOp = class {
|
|
@@ -10339,7 +10359,7 @@ var TcbTemplateVariableOp = class extends TcbOp {
|
|
|
10339
10359
|
execute() {
|
|
10340
10360
|
const ctx = this.scope.resolve(this.template);
|
|
10341
10361
|
const id = this.tcb.allocateId();
|
|
10342
|
-
const initializer =
|
|
10362
|
+
const initializer = ts42.factory.createPropertyAccessExpression(
|
|
10343
10363
|
ctx,
|
|
10344
10364
|
this.variable.value || "$implicit"
|
|
10345
10365
|
);
|
|
@@ -10367,7 +10387,7 @@ var TcbTemplateContextOp = class extends TcbOp {
|
|
|
10367
10387
|
optional = true;
|
|
10368
10388
|
execute() {
|
|
10369
10389
|
const ctx = this.tcb.allocateId();
|
|
10370
|
-
const type =
|
|
10390
|
+
const type = ts42.factory.createKeywordTypeNode(ts42.SyntaxKind.AnyKeyword);
|
|
10371
10391
|
this.scope.addStatement(tsDeclareVariable(ctx, type));
|
|
10372
10392
|
return ctx;
|
|
10373
10393
|
}
|
|
@@ -10387,7 +10407,7 @@ var TcbLetDeclarationOp = class extends TcbOp {
|
|
|
10387
10407
|
const id = this.tcb.allocateId();
|
|
10388
10408
|
addParseSpanInfo(id, this.node.nameSpan);
|
|
10389
10409
|
const value = tcbExpression(this.node.value, this.tcb, this.scope);
|
|
10390
|
-
const varStatement = tsCreateVariable(id, wrapForTypeChecker(value),
|
|
10410
|
+
const varStatement = tsCreateVariable(id, wrapForTypeChecker(value), ts42.NodeFlags.Const);
|
|
10391
10411
|
addParseSpanInfo(varStatement.declarationList.declarations[0], this.node.sourceSpan);
|
|
10392
10412
|
this.scope.addStatement(varStatement);
|
|
10393
10413
|
return id;
|
|
@@ -10444,16 +10464,16 @@ var TcbTemplateBodyOp = class extends TcbOp {
|
|
|
10444
10464
|
}
|
|
10445
10465
|
let guard = null;
|
|
10446
10466
|
if (directiveGuards.length > 0) {
|
|
10447
|
-
guard = directiveGuards.reduce((expr, dirGuard) =>
|
|
10467
|
+
guard = directiveGuards.reduce((expr, dirGuard) => ts42.factory.createBinaryExpression(expr, ts42.SyntaxKind.AmpersandAmpersandToken, dirGuard), directiveGuards.pop());
|
|
10448
10468
|
}
|
|
10449
10469
|
const tmplScope = Scope.forNodes(this.tcb, this.scope, this.template, this.template.children, guard);
|
|
10450
10470
|
const statements = tmplScope.render();
|
|
10451
10471
|
if (statements.length === 0) {
|
|
10452
10472
|
return null;
|
|
10453
10473
|
}
|
|
10454
|
-
let tmplBlock =
|
|
10474
|
+
let tmplBlock = ts42.factory.createBlock(statements);
|
|
10455
10475
|
if (guard !== null) {
|
|
10456
|
-
tmplBlock =
|
|
10476
|
+
tmplBlock = ts42.factory.createIfStatement(
|
|
10457
10477
|
guard,
|
|
10458
10478
|
tmplBlock
|
|
10459
10479
|
);
|
|
@@ -10477,7 +10497,7 @@ var TcbExpressionOp = class extends TcbOp {
|
|
|
10477
10497
|
}
|
|
10478
10498
|
execute() {
|
|
10479
10499
|
const expr = tcbExpression(this.expression, this.tcb, this.scope);
|
|
10480
|
-
this.scope.addStatement(
|
|
10500
|
+
this.scope.addStatement(ts42.factory.createExpressionStatement(expr));
|
|
10481
10501
|
return null;
|
|
10482
10502
|
}
|
|
10483
10503
|
};
|
|
@@ -10503,11 +10523,11 @@ var TcbDirectiveTypeOpBase = class extends TcbOp {
|
|
|
10503
10523
|
if (this.dir.isGeneric === false || dirRef.node.typeParameters === void 0) {
|
|
10504
10524
|
type = rawType;
|
|
10505
10525
|
} else {
|
|
10506
|
-
if (!
|
|
10526
|
+
if (!ts42.isTypeReferenceNode(rawType)) {
|
|
10507
10527
|
throw new Error(`Expected TypeReferenceNode when referencing the type for ${this.dir.ref.debugName}`);
|
|
10508
10528
|
}
|
|
10509
|
-
const typeArguments = dirRef.node.typeParameters.map(() =>
|
|
10510
|
-
type =
|
|
10529
|
+
const typeArguments = dirRef.node.typeParameters.map(() => ts42.factory.createKeywordTypeNode(ts42.SyntaxKind.AnyKeyword));
|
|
10530
|
+
type = ts42.factory.createTypeReferenceNode(rawType.typeName, typeArguments);
|
|
10511
10531
|
}
|
|
10512
10532
|
const id = this.tcb.allocateId();
|
|
10513
10533
|
addExpressionIdentifier(id, ExpressionIdentifier.DIRECTIVE);
|
|
@@ -10553,11 +10573,11 @@ var TcbReferenceOp = class extends TcbOp {
|
|
|
10553
10573
|
const id = this.tcb.allocateId();
|
|
10554
10574
|
let initializer = this.target instanceof TmplAstTemplate || this.target instanceof TmplAstElement2 ? this.scope.resolve(this.target) : this.scope.resolve(this.host, this.target);
|
|
10555
10575
|
if (this.target instanceof TmplAstElement2 && !this.tcb.env.config.checkTypeOfDomReferences || !this.tcb.env.config.checkTypeOfNonDomReferences) {
|
|
10556
|
-
initializer =
|
|
10576
|
+
initializer = ts42.factory.createAsExpression(initializer, ts42.factory.createKeywordTypeNode(ts42.SyntaxKind.AnyKeyword));
|
|
10557
10577
|
} else if (this.target instanceof TmplAstTemplate) {
|
|
10558
|
-
initializer =
|
|
10559
|
-
initializer =
|
|
10560
|
-
initializer =
|
|
10578
|
+
initializer = ts42.factory.createAsExpression(initializer, ts42.factory.createKeywordTypeNode(ts42.SyntaxKind.AnyKeyword));
|
|
10579
|
+
initializer = ts42.factory.createAsExpression(initializer, this.tcb.env.referenceExternalType("@angular/core", "TemplateRef", [DYNAMIC_TYPE]));
|
|
10580
|
+
initializer = ts42.factory.createParenthesizedExpression(initializer);
|
|
10561
10581
|
}
|
|
10562
10582
|
addParseSpanInfo(initializer, this.node.sourceSpan);
|
|
10563
10583
|
addParseSpanInfo(id, this.node.keySpan);
|
|
@@ -10666,7 +10686,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
10666
10686
|
type = this.tcb.env.referenceTransplantedType(new TransplantedType(transformType));
|
|
10667
10687
|
} else {
|
|
10668
10688
|
const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
|
|
10669
|
-
if (!
|
|
10689
|
+
if (!ts42.isTypeReferenceNode(dirTypeRef)) {
|
|
10670
10690
|
throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
|
|
10671
10691
|
}
|
|
10672
10692
|
type = tsCreateTypeQueryForCoercedInput(dirTypeRef.typeName, fieldName);
|
|
@@ -10682,10 +10702,10 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
10682
10702
|
}
|
|
10683
10703
|
const id = this.tcb.allocateId();
|
|
10684
10704
|
const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
|
|
10685
|
-
if (!
|
|
10705
|
+
if (!ts42.isTypeReferenceNode(dirTypeRef)) {
|
|
10686
10706
|
throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
|
|
10687
10707
|
}
|
|
10688
|
-
const type =
|
|
10708
|
+
const type = ts42.factory.createIndexedAccessTypeNode(ts42.factory.createTypeQueryNode(dirId), ts42.factory.createLiteralTypeNode(ts42.factory.createStringLiteral(fieldName)));
|
|
10689
10709
|
const temp = tsDeclareVariable(id, type);
|
|
10690
10710
|
this.scope.addStatement(temp);
|
|
10691
10711
|
target = id;
|
|
@@ -10693,14 +10713,14 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
10693
10713
|
if (dirId === null) {
|
|
10694
10714
|
dirId = this.scope.resolve(this.node, this.dir);
|
|
10695
10715
|
}
|
|
10696
|
-
target = this.dir.stringLiteralInputFields.has(fieldName) ?
|
|
10716
|
+
target = this.dir.stringLiteralInputFields.has(fieldName) ? ts42.factory.createElementAccessExpression(dirId, ts42.factory.createStringLiteral(fieldName)) : ts42.factory.createPropertyAccessExpression(dirId, ts42.factory.createIdentifier(fieldName));
|
|
10697
10717
|
}
|
|
10698
10718
|
if (isSignal) {
|
|
10699
10719
|
const inputSignalBrandWriteSymbol = this.tcb.env.referenceExternalSymbol(R3Identifiers4.InputSignalBrandWriteType.moduleName, R3Identifiers4.InputSignalBrandWriteType.name);
|
|
10700
|
-
if (!
|
|
10720
|
+
if (!ts42.isIdentifier(inputSignalBrandWriteSymbol) && !ts42.isPropertyAccessExpression(inputSignalBrandWriteSymbol)) {
|
|
10701
10721
|
throw new Error(`Expected identifier or property access for reference to ${R3Identifiers4.InputSignalBrandWriteType.name}`);
|
|
10702
10722
|
}
|
|
10703
|
-
target =
|
|
10723
|
+
target = ts42.factory.createElementAccessExpression(target, inputSignalBrandWriteSymbol);
|
|
10704
10724
|
}
|
|
10705
10725
|
if (attr.attribute.keySpan !== void 0) {
|
|
10706
10726
|
addParseSpanInfo(target, attr.attribute.keySpan);
|
|
@@ -10708,13 +10728,13 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
10708
10728
|
if (isTwoWayBinding && this.tcb.env.config.allowSignalsInTwoWayBindings) {
|
|
10709
10729
|
assignment = unwrapWritableSignal(assignment, this.tcb);
|
|
10710
10730
|
}
|
|
10711
|
-
assignment =
|
|
10731
|
+
assignment = ts42.factory.createBinaryExpression(target, ts42.SyntaxKind.EqualsToken, assignment);
|
|
10712
10732
|
}
|
|
10713
10733
|
addParseSpanInfo(assignment, attr.attribute.sourceSpan);
|
|
10714
10734
|
if (!this.tcb.env.config.checkTypeOfAttributes && attr.attribute instanceof TmplAstTextAttribute2) {
|
|
10715
10735
|
markIgnoreDiagnostics(assignment);
|
|
10716
10736
|
}
|
|
10717
|
-
this.scope.addStatement(
|
|
10737
|
+
this.scope.addStatement(ts42.factory.createExpressionStatement(assignment));
|
|
10718
10738
|
}
|
|
10719
10739
|
this.checkRequiredInputs(seenRequiredInputs);
|
|
10720
10740
|
return null;
|
|
@@ -10749,10 +10769,10 @@ var TcbDirectiveCtorCircularFallbackOp = class extends TcbOp {
|
|
|
10749
10769
|
execute() {
|
|
10750
10770
|
const id = this.tcb.allocateId();
|
|
10751
10771
|
const typeCtor = this.tcb.env.typeCtorFor(this.dir);
|
|
10752
|
-
const circularPlaceholder =
|
|
10772
|
+
const circularPlaceholder = ts42.factory.createCallExpression(
|
|
10753
10773
|
typeCtor,
|
|
10754
10774
|
void 0,
|
|
10755
|
-
[
|
|
10775
|
+
[ts42.factory.createNonNullExpression(ts42.factory.createNull())]
|
|
10756
10776
|
);
|
|
10757
10777
|
this.scope.addStatement(tsCreateVariable(id, circularPlaceholder));
|
|
10758
10778
|
return id;
|
|
@@ -10803,7 +10823,7 @@ var TcbControlFlowContentProjectionOp = class extends TcbOp {
|
|
|
10803
10823
|
this.element = element;
|
|
10804
10824
|
this.ngContentSelectors = ngContentSelectors;
|
|
10805
10825
|
this.componentName = componentName;
|
|
10806
|
-
this.category = tcb.env.config.controlFlowPreventingContentProjection === "error" ?
|
|
10826
|
+
this.category = tcb.env.config.controlFlowPreventingContentProjection === "error" ? ts42.DiagnosticCategory.Error : ts42.DiagnosticCategory.Warning;
|
|
10807
10827
|
}
|
|
10808
10828
|
optional = false;
|
|
10809
10829
|
execute() {
|
|
@@ -10907,15 +10927,15 @@ var TcbUnclaimedInputsOp = class extends TcbOp {
|
|
|
10907
10927
|
elId = this.scope.resolve(this.element);
|
|
10908
10928
|
}
|
|
10909
10929
|
const propertyName = (_a = ATTR_TO_PROP.get(binding.name)) != null ? _a : binding.name;
|
|
10910
|
-
const prop =
|
|
10911
|
-
const stmt =
|
|
10930
|
+
const prop = ts42.factory.createElementAccessExpression(elId, ts42.factory.createStringLiteral(propertyName));
|
|
10931
|
+
const stmt = ts42.factory.createBinaryExpression(prop, ts42.SyntaxKind.EqualsToken, wrapForDiagnostics(expr));
|
|
10912
10932
|
addParseSpanInfo(stmt, binding.sourceSpan);
|
|
10913
|
-
this.scope.addStatement(
|
|
10933
|
+
this.scope.addStatement(ts42.factory.createExpressionStatement(stmt));
|
|
10914
10934
|
} else {
|
|
10915
|
-
this.scope.addStatement(
|
|
10935
|
+
this.scope.addStatement(ts42.factory.createExpressionStatement(expr));
|
|
10916
10936
|
}
|
|
10917
10937
|
} else {
|
|
10918
|
-
this.scope.addStatement(
|
|
10938
|
+
this.scope.addStatement(ts42.factory.createExpressionStatement(expr));
|
|
10919
10939
|
}
|
|
10920
10940
|
}
|
|
10921
10941
|
return null;
|
|
@@ -10951,20 +10971,20 @@ var TcbDirectiveOutputsOp = class extends TcbOp {
|
|
|
10951
10971
|
if (dirId === null) {
|
|
10952
10972
|
dirId = this.scope.resolve(this.node, this.dir);
|
|
10953
10973
|
}
|
|
10954
|
-
const outputField =
|
|
10974
|
+
const outputField = ts42.factory.createElementAccessExpression(dirId, ts42.factory.createStringLiteral(field));
|
|
10955
10975
|
addParseSpanInfo(outputField, output.keySpan);
|
|
10956
10976
|
if (this.tcb.env.config.checkTypeOfOutputEvents) {
|
|
10957
10977
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
|
|
10958
|
-
const subscribeFn =
|
|
10959
|
-
const call =
|
|
10978
|
+
const subscribeFn = ts42.factory.createPropertyAccessExpression(outputField, "subscribe");
|
|
10979
|
+
const call = ts42.factory.createCallExpression(subscribeFn, void 0, [
|
|
10960
10980
|
handler
|
|
10961
10981
|
]);
|
|
10962
10982
|
addParseSpanInfo(call, output.sourceSpan);
|
|
10963
|
-
this.scope.addStatement(
|
|
10983
|
+
this.scope.addStatement(ts42.factory.createExpressionStatement(call));
|
|
10964
10984
|
} else {
|
|
10965
|
-
this.scope.addStatement(
|
|
10985
|
+
this.scope.addStatement(ts42.factory.createExpressionStatement(outputField));
|
|
10966
10986
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
10967
|
-
this.scope.addStatement(
|
|
10987
|
+
this.scope.addStatement(ts42.factory.createExpressionStatement(handler));
|
|
10968
10988
|
}
|
|
10969
10989
|
}
|
|
10970
10990
|
return null;
|
|
@@ -11000,24 +11020,24 @@ var TcbUnclaimedOutputsOp = class extends TcbOp {
|
|
|
11000
11020
|
if (output.type === ParsedEventType.Animation) {
|
|
11001
11021
|
const eventType = this.tcb.env.config.checkTypeOfAnimationEvents ? this.tcb.env.referenceExternalType("@angular/animations", "AnimationEvent") : 1;
|
|
11002
11022
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, eventType);
|
|
11003
|
-
this.scope.addStatement(
|
|
11023
|
+
this.scope.addStatement(ts42.factory.createExpressionStatement(handler));
|
|
11004
11024
|
} else if (this.tcb.env.config.checkTypeOfDomEvents) {
|
|
11005
11025
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
|
|
11006
11026
|
if (elId === null) {
|
|
11007
11027
|
elId = this.scope.resolve(this.element);
|
|
11008
11028
|
}
|
|
11009
|
-
const propertyAccess =
|
|
11029
|
+
const propertyAccess = ts42.factory.createPropertyAccessExpression(elId, "addEventListener");
|
|
11010
11030
|
addParseSpanInfo(propertyAccess, output.keySpan);
|
|
11011
|
-
const call =
|
|
11031
|
+
const call = ts42.factory.createCallExpression(
|
|
11012
11032
|
propertyAccess,
|
|
11013
11033
|
void 0,
|
|
11014
|
-
[
|
|
11034
|
+
[ts42.factory.createStringLiteral(output.name), handler]
|
|
11015
11035
|
);
|
|
11016
11036
|
addParseSpanInfo(call, output.sourceSpan);
|
|
11017
|
-
this.scope.addStatement(
|
|
11037
|
+
this.scope.addStatement(ts42.factory.createExpressionStatement(call));
|
|
11018
11038
|
} else {
|
|
11019
11039
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
11020
|
-
this.scope.addStatement(
|
|
11040
|
+
this.scope.addStatement(ts42.factory.createExpressionStatement(handler));
|
|
11021
11041
|
}
|
|
11022
11042
|
}
|
|
11023
11043
|
return null;
|
|
@@ -11031,11 +11051,11 @@ var TcbComponentContextCompletionOp = class extends TcbOp {
|
|
|
11031
11051
|
}
|
|
11032
11052
|
optional = false;
|
|
11033
11053
|
execute() {
|
|
11034
|
-
const ctx =
|
|
11035
|
-
const ctxDot =
|
|
11054
|
+
const ctx = ts42.factory.createThis();
|
|
11055
|
+
const ctxDot = ts42.factory.createPropertyAccessExpression(ctx, "");
|
|
11036
11056
|
markIgnoreDiagnostics(ctxDot);
|
|
11037
11057
|
addExpressionIdentifier(ctxDot, ExpressionIdentifier.COMPONENT_COMPLETION);
|
|
11038
|
-
this.scope.addStatement(
|
|
11058
|
+
this.scope.addStatement(ts42.factory.createExpressionStatement(ctxDot));
|
|
11039
11059
|
return null;
|
|
11040
11060
|
}
|
|
11041
11061
|
};
|
|
@@ -11111,17 +11131,17 @@ var TcbIfOp = class extends TcbOp {
|
|
|
11111
11131
|
}
|
|
11112
11132
|
if (branch.expression === null) {
|
|
11113
11133
|
const branchScope = this.getBranchScope(this.scope, branch, index);
|
|
11114
|
-
return
|
|
11134
|
+
return ts42.factory.createBlock(branchScope.render());
|
|
11115
11135
|
}
|
|
11116
11136
|
const outerScope = Scope.forNodes(this.tcb, this.scope, branch, [], null);
|
|
11117
11137
|
outerScope.render().forEach((stmt) => this.scope.addStatement(stmt));
|
|
11118
11138
|
this.expressionScopes.set(branch, outerScope);
|
|
11119
11139
|
let expression = tcbExpression(branch.expression, this.tcb, this.scope);
|
|
11120
11140
|
if (branch.expressionAlias !== null) {
|
|
11121
|
-
expression =
|
|
11141
|
+
expression = ts42.factory.createBinaryExpression(ts42.factory.createParenthesizedExpression(expression), ts42.SyntaxKind.AmpersandAmpersandToken, outerScope.resolve(branch.expressionAlias));
|
|
11122
11142
|
}
|
|
11123
11143
|
const bodyScope = this.getBranchScope(outerScope, branch, index);
|
|
11124
|
-
return
|
|
11144
|
+
return ts42.factory.createIfStatement(expression, ts42.factory.createBlock(bodyScope.render()), this.generateBranch(index + 1));
|
|
11125
11145
|
}
|
|
11126
11146
|
getBranchScope(parentScope, branch, index) {
|
|
11127
11147
|
const checkBody = this.tcb.env.config.checkControlFlowBodies;
|
|
@@ -11141,11 +11161,11 @@ var TcbIfOp = class extends TcbOp {
|
|
|
11141
11161
|
let expression;
|
|
11142
11162
|
expression = tcbExpression(branch.expression, this.tcb, expressionScope);
|
|
11143
11163
|
if (branch.expressionAlias !== null) {
|
|
11144
|
-
expression =
|
|
11164
|
+
expression = ts42.factory.createBinaryExpression(ts42.factory.createParenthesizedExpression(expression), ts42.SyntaxKind.AmpersandAmpersandToken, expressionScope.resolve(branch.expressionAlias));
|
|
11145
11165
|
}
|
|
11146
11166
|
markIgnoreDiagnostics(expression);
|
|
11147
|
-
const comparisonExpression = i === index ? expression :
|
|
11148
|
-
guard = guard === null ? comparisonExpression :
|
|
11167
|
+
const comparisonExpression = i === index ? expression : ts42.factory.createPrefixUnaryExpression(ts42.SyntaxKind.ExclamationToken, ts42.factory.createParenthesizedExpression(expression));
|
|
11168
|
+
guard = guard === null ? comparisonExpression : ts42.factory.createBinaryExpression(guard, ts42.SyntaxKind.AmpersandAmpersandToken, comparisonExpression);
|
|
11149
11169
|
}
|
|
11150
11170
|
return guard;
|
|
11151
11171
|
}
|
|
@@ -11168,17 +11188,17 @@ var TcbSwitchOp = class extends TcbOp {
|
|
|
11168
11188
|
const clauses = this.block.cases.map((current) => {
|
|
11169
11189
|
const checkBody = this.tcb.env.config.checkControlFlowBodies;
|
|
11170
11190
|
const clauseScope = Scope.forNodes(this.tcb, this.scope, null, checkBody ? current.children : [], checkBody ? this.generateGuard(current, switchExpression) : null);
|
|
11171
|
-
const statements = [...clauseScope.render(),
|
|
11172
|
-
return current.expression === null ?
|
|
11191
|
+
const statements = [...clauseScope.render(), ts42.factory.createBreakStatement()];
|
|
11192
|
+
return current.expression === null ? ts42.factory.createDefaultClause(statements) : ts42.factory.createCaseClause(tcbExpression(current.expression, this.tcb, clauseScope), statements);
|
|
11173
11193
|
});
|
|
11174
|
-
this.scope.addStatement(
|
|
11194
|
+
this.scope.addStatement(ts42.factory.createSwitchStatement(switchExpression, ts42.factory.createCaseBlock(clauses)));
|
|
11175
11195
|
return null;
|
|
11176
11196
|
}
|
|
11177
11197
|
generateGuard(node, switchValue) {
|
|
11178
11198
|
if (node.expression !== null) {
|
|
11179
11199
|
const expression = tcbExpression(node.expression, this.tcb, this.scope);
|
|
11180
11200
|
markIgnoreDiagnostics(expression);
|
|
11181
|
-
return
|
|
11201
|
+
return ts42.factory.createBinaryExpression(switchValue, ts42.SyntaxKind.EqualsEqualsEqualsToken, expression);
|
|
11182
11202
|
}
|
|
11183
11203
|
let guard = null;
|
|
11184
11204
|
for (const current of this.block.cases) {
|
|
@@ -11187,11 +11207,11 @@ var TcbSwitchOp = class extends TcbOp {
|
|
|
11187
11207
|
}
|
|
11188
11208
|
const expression = tcbExpression(current.expression, this.tcb, this.scope);
|
|
11189
11209
|
markIgnoreDiagnostics(expression);
|
|
11190
|
-
const comparison =
|
|
11210
|
+
const comparison = ts42.factory.createBinaryExpression(switchValue, ts42.SyntaxKind.ExclamationEqualsEqualsToken, expression);
|
|
11191
11211
|
if (guard === null) {
|
|
11192
11212
|
guard = comparison;
|
|
11193
11213
|
} else {
|
|
11194
|
-
guard =
|
|
11214
|
+
guard = ts42.factory.createBinaryExpression(guard, ts42.SyntaxKind.AmpersandAmpersandToken, comparison);
|
|
11195
11215
|
}
|
|
11196
11216
|
}
|
|
11197
11217
|
return guard;
|
|
@@ -11213,23 +11233,23 @@ var TcbForOfOp = class extends TcbOp {
|
|
|
11213
11233
|
execute() {
|
|
11214
11234
|
const loopScope = Scope.forNodes(this.tcb, this.scope, this.block, this.tcb.env.config.checkControlFlowBodies ? this.block.children : [], null);
|
|
11215
11235
|
const initializerId = loopScope.resolve(this.block.item);
|
|
11216
|
-
if (!
|
|
11236
|
+
if (!ts42.isIdentifier(initializerId)) {
|
|
11217
11237
|
throw new Error(`Could not resolve for loop variable ${this.block.item.name} to an identifier`);
|
|
11218
11238
|
}
|
|
11219
|
-
const initializer =
|
|
11239
|
+
const initializer = ts42.factory.createVariableDeclarationList([ts42.factory.createVariableDeclaration(initializerId)], ts42.NodeFlags.Const);
|
|
11220
11240
|
addParseSpanInfo(initializer, this.block.item.keySpan);
|
|
11221
|
-
const expression =
|
|
11241
|
+
const expression = ts42.factory.createNonNullExpression(tcbExpression(this.block.expression, this.tcb, this.scope));
|
|
11222
11242
|
const trackTranslator = new TcbForLoopTrackTranslator(this.tcb, loopScope, this.block);
|
|
11223
11243
|
const trackExpression = trackTranslator.translate(this.block.trackBy);
|
|
11224
11244
|
const statements = [
|
|
11225
11245
|
...loopScope.render(),
|
|
11226
|
-
|
|
11246
|
+
ts42.factory.createExpressionStatement(trackExpression)
|
|
11227
11247
|
];
|
|
11228
|
-
this.scope.addStatement(
|
|
11248
|
+
this.scope.addStatement(ts42.factory.createForOfStatement(void 0, initializer, expression, ts42.factory.createBlock(statements)));
|
|
11229
11249
|
return null;
|
|
11230
11250
|
}
|
|
11231
11251
|
};
|
|
11232
|
-
var INFER_TYPE_FOR_CIRCULAR_OP_EXPR =
|
|
11252
|
+
var INFER_TYPE_FOR_CIRCULAR_OP_EXPR = ts42.factory.createNonNullExpression(ts42.factory.createNull());
|
|
11233
11253
|
var Context = class {
|
|
11234
11254
|
env;
|
|
11235
11255
|
domSchemaChecker;
|
|
@@ -11253,10 +11273,10 @@ var Context = class {
|
|
|
11253
11273
|
this.hostPreserveWhitespaces = hostPreserveWhitespaces;
|
|
11254
11274
|
}
|
|
11255
11275
|
allocateId() {
|
|
11256
|
-
return
|
|
11276
|
+
return ts42.factory.createIdentifier(`_t${this.nextId++}`);
|
|
11257
11277
|
}
|
|
11258
11278
|
getPipeByName(name) {
|
|
11259
|
-
if (!this.pipes.has(name)) {
|
|
11279
|
+
if (this.pipes === null || !this.pipes.has(name)) {
|
|
11260
11280
|
return null;
|
|
11261
11281
|
}
|
|
11262
11282
|
return this.pipes.get(name);
|
|
@@ -11308,7 +11328,7 @@ var _Scope = class {
|
|
|
11308
11328
|
if (!this.forLoopContextVariableTypes.has(variable.value)) {
|
|
11309
11329
|
throw new Error(`Unrecognized for loop context variable ${variable.name}`);
|
|
11310
11330
|
}
|
|
11311
|
-
const type =
|
|
11331
|
+
const type = ts42.factory.createKeywordTypeNode(this.forLoopContextVariableTypes.get(variable.value));
|
|
11312
11332
|
this.registerVariable(scope, variable, new TcbBlockImplicitVariableOp(tcb, scope, type, variable));
|
|
11313
11333
|
}
|
|
11314
11334
|
}
|
|
@@ -11331,16 +11351,16 @@ var _Scope = class {
|
|
|
11331
11351
|
const res = this.resolveLocal(node, directive);
|
|
11332
11352
|
if (res !== null) {
|
|
11333
11353
|
let clone;
|
|
11334
|
-
if (
|
|
11335
|
-
clone =
|
|
11336
|
-
} else if (
|
|
11337
|
-
clone =
|
|
11354
|
+
if (ts42.isIdentifier(res)) {
|
|
11355
|
+
clone = ts42.factory.createIdentifier(res.text);
|
|
11356
|
+
} else if (ts42.isNonNullExpression(res)) {
|
|
11357
|
+
clone = ts42.factory.createNonNullExpression(res.expression);
|
|
11338
11358
|
} else {
|
|
11339
11359
|
throw new Error(`Could not resolve ${node} to an Identifier or a NonNullExpression`);
|
|
11340
11360
|
}
|
|
11341
|
-
|
|
11361
|
+
ts42.setOriginalNode(clone, res);
|
|
11342
11362
|
clone.parent = clone.parent;
|
|
11343
|
-
return
|
|
11363
|
+
return ts42.setSyntheticTrailingComments(clone, []);
|
|
11344
11364
|
} else if (this.parent !== null) {
|
|
11345
11365
|
return this.parent.resolve(node, directive);
|
|
11346
11366
|
} else {
|
|
@@ -11367,7 +11387,7 @@ var _Scope = class {
|
|
|
11367
11387
|
} else if (parentGuards === null) {
|
|
11368
11388
|
return this.guard;
|
|
11369
11389
|
} else {
|
|
11370
|
-
return
|
|
11390
|
+
return ts42.factory.createBinaryExpression(parentGuards, ts42.SyntaxKind.AmpersandAmpersandToken, this.guard);
|
|
11371
11391
|
}
|
|
11372
11392
|
}
|
|
11373
11393
|
isLocal(node) {
|
|
@@ -11642,20 +11662,20 @@ var _Scope = class {
|
|
|
11642
11662
|
};
|
|
11643
11663
|
var Scope = _Scope;
|
|
11644
11664
|
__publicField(Scope, "forLoopContextVariableTypes", /* @__PURE__ */ new Map([
|
|
11645
|
-
["$first",
|
|
11646
|
-
["$last",
|
|
11647
|
-
["$even",
|
|
11648
|
-
["$odd",
|
|
11649
|
-
["$index",
|
|
11650
|
-
["$count",
|
|
11665
|
+
["$first", ts42.SyntaxKind.BooleanKeyword],
|
|
11666
|
+
["$last", ts42.SyntaxKind.BooleanKeyword],
|
|
11667
|
+
["$even", ts42.SyntaxKind.BooleanKeyword],
|
|
11668
|
+
["$odd", ts42.SyntaxKind.BooleanKeyword],
|
|
11669
|
+
["$index", ts42.SyntaxKind.NumberKeyword],
|
|
11670
|
+
["$count", ts42.SyntaxKind.NumberKeyword]
|
|
11651
11671
|
]));
|
|
11652
11672
|
function tcbThisParam(name, typeArguments) {
|
|
11653
|
-
return
|
|
11673
|
+
return ts42.factory.createParameterDeclaration(
|
|
11654
11674
|
void 0,
|
|
11655
11675
|
void 0,
|
|
11656
11676
|
"this",
|
|
11657
11677
|
void 0,
|
|
11658
|
-
|
|
11678
|
+
ts42.factory.createTypeReferenceNode(name, typeArguments),
|
|
11659
11679
|
void 0
|
|
11660
11680
|
);
|
|
11661
11681
|
}
|
|
@@ -11680,7 +11700,7 @@ var TcbExpressionTranslator = class {
|
|
|
11680
11700
|
if (target instanceof TmplAstLetDeclaration2 && !this.isValidLetDeclarationAccess(target, ast)) {
|
|
11681
11701
|
this.tcb.oobRecorder.letUsedBeforeDefinition(this.tcb.id, ast, target);
|
|
11682
11702
|
if (targetExpression !== null) {
|
|
11683
|
-
return
|
|
11703
|
+
return ts42.factory.createAsExpression(targetExpression, ts42.factory.createKeywordTypeNode(ts42.SyntaxKind.AnyKeyword));
|
|
11684
11704
|
}
|
|
11685
11705
|
}
|
|
11686
11706
|
return targetExpression;
|
|
@@ -11691,7 +11711,7 @@ var TcbExpressionTranslator = class {
|
|
|
11691
11711
|
}
|
|
11692
11712
|
const targetExpression = this.getTargetNodeExpression(target, ast);
|
|
11693
11713
|
const expr = this.translate(ast.value);
|
|
11694
|
-
const result =
|
|
11714
|
+
const result = ts42.factory.createParenthesizedExpression(ts42.factory.createBinaryExpression(targetExpression, ts42.SyntaxKind.EqualsToken, expr));
|
|
11695
11715
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
11696
11716
|
if (target instanceof TmplAstLetDeclaration2) {
|
|
11697
11717
|
markIgnoreDiagnostics(result);
|
|
@@ -11699,7 +11719,7 @@ var TcbExpressionTranslator = class {
|
|
|
11699
11719
|
}
|
|
11700
11720
|
return result;
|
|
11701
11721
|
} else if (ast instanceof ImplicitReceiver2) {
|
|
11702
|
-
return
|
|
11722
|
+
return ts42.factory.createThis();
|
|
11703
11723
|
} else if (ast instanceof BindingPipe) {
|
|
11704
11724
|
const expr = this.translate(ast.exp);
|
|
11705
11725
|
const pipeMeta = this.tcb.getPipeByName(ast.name);
|
|
@@ -11714,12 +11734,12 @@ var TcbExpressionTranslator = class {
|
|
|
11714
11734
|
pipe = this.tcb.env.pipeInst(pipeMeta.ref);
|
|
11715
11735
|
}
|
|
11716
11736
|
const args = ast.args.map((arg) => this.translate(arg));
|
|
11717
|
-
let methodAccess =
|
|
11737
|
+
let methodAccess = ts42.factory.createPropertyAccessExpression(pipe, "transform");
|
|
11718
11738
|
addParseSpanInfo(methodAccess, ast.nameSpan);
|
|
11719
11739
|
if (!this.tcb.env.config.checkTypeOfPipes) {
|
|
11720
|
-
methodAccess =
|
|
11740
|
+
methodAccess = ts42.factory.createAsExpression(methodAccess, ts42.factory.createKeywordTypeNode(ts42.SyntaxKind.AnyKeyword));
|
|
11721
11741
|
}
|
|
11722
|
-
const result =
|
|
11742
|
+
const result = ts42.factory.createCallExpression(
|
|
11723
11743
|
methodAccess,
|
|
11724
11744
|
void 0,
|
|
11725
11745
|
[expr, ...args]
|
|
@@ -11729,8 +11749,8 @@ var TcbExpressionTranslator = class {
|
|
|
11729
11749
|
} else if ((ast instanceof Call2 || ast instanceof SafeCall) && (ast.receiver instanceof PropertyRead3 || ast.receiver instanceof SafePropertyRead3)) {
|
|
11730
11750
|
if (ast.receiver.receiver instanceof ImplicitReceiver2 && !(ast.receiver.receiver instanceof ThisReceiver) && ast.receiver.name === "$any" && ast.args.length === 1) {
|
|
11731
11751
|
const expr = this.translate(ast.args[0]);
|
|
11732
|
-
const exprAsAny =
|
|
11733
|
-
const result =
|
|
11752
|
+
const exprAsAny = ts42.factory.createAsExpression(expr, ts42.factory.createKeywordTypeNode(ts42.SyntaxKind.AnyKeyword));
|
|
11753
|
+
const result = ts42.factory.createParenthesizedExpression(exprAsAny);
|
|
11734
11754
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
11735
11755
|
return result;
|
|
11736
11756
|
}
|
|
@@ -11742,7 +11762,7 @@ var TcbExpressionTranslator = class {
|
|
|
11742
11762
|
const method = wrapForDiagnostics(receiver);
|
|
11743
11763
|
addParseSpanInfo(method, ast.receiver.nameSpan);
|
|
11744
11764
|
const args = ast.args.map((arg) => this.translate(arg));
|
|
11745
|
-
const node =
|
|
11765
|
+
const node = ts42.factory.createCallExpression(method, void 0, args);
|
|
11746
11766
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
11747
11767
|
return node;
|
|
11748
11768
|
} else {
|
|
@@ -11764,23 +11784,23 @@ var TcbExpressionTranslator = class {
|
|
|
11764
11784
|
function tcbCallTypeCtor(dir, tcb, inputs) {
|
|
11765
11785
|
const typeCtor = tcb.env.typeCtorFor(dir);
|
|
11766
11786
|
const members = inputs.map((input) => {
|
|
11767
|
-
const propertyName =
|
|
11787
|
+
const propertyName = ts42.factory.createStringLiteral(input.field);
|
|
11768
11788
|
if (input.type === "binding") {
|
|
11769
11789
|
let expr = widenBinding(input.expression, tcb);
|
|
11770
11790
|
if (input.isTwoWayBinding && tcb.env.config.allowSignalsInTwoWayBindings) {
|
|
11771
11791
|
expr = unwrapWritableSignal(expr, tcb);
|
|
11772
11792
|
}
|
|
11773
|
-
const assignment =
|
|
11793
|
+
const assignment = ts42.factory.createPropertyAssignment(propertyName, wrapForDiagnostics(expr));
|
|
11774
11794
|
addParseSpanInfo(assignment, input.sourceSpan);
|
|
11775
11795
|
return assignment;
|
|
11776
11796
|
} else {
|
|
11777
|
-
return
|
|
11797
|
+
return ts42.factory.createPropertyAssignment(propertyName, ANY_EXPRESSION);
|
|
11778
11798
|
}
|
|
11779
11799
|
});
|
|
11780
|
-
return
|
|
11800
|
+
return ts42.factory.createCallExpression(
|
|
11781
11801
|
typeCtor,
|
|
11782
11802
|
void 0,
|
|
11783
|
-
[
|
|
11803
|
+
[ts42.factory.createObjectLiteralExpression(members)]
|
|
11784
11804
|
);
|
|
11785
11805
|
}
|
|
11786
11806
|
function getBoundAttributes(directive, node) {
|
|
@@ -11817,17 +11837,17 @@ function translateInput(attr, tcb, scope) {
|
|
|
11817
11837
|
if (attr instanceof TmplAstBoundAttribute) {
|
|
11818
11838
|
return tcbExpression(attr.value, tcb, scope);
|
|
11819
11839
|
} else {
|
|
11820
|
-
return
|
|
11840
|
+
return ts42.factory.createStringLiteral(attr.value);
|
|
11821
11841
|
}
|
|
11822
11842
|
}
|
|
11823
11843
|
function widenBinding(expr, tcb) {
|
|
11824
11844
|
if (!tcb.env.config.checkTypeOfInputBindings) {
|
|
11825
11845
|
return tsCastToAny(expr);
|
|
11826
11846
|
} else if (!tcb.env.config.strictNullInputBindings) {
|
|
11827
|
-
if (
|
|
11847
|
+
if (ts42.isObjectLiteralExpression(expr) || ts42.isArrayLiteralExpression(expr)) {
|
|
11828
11848
|
return expr;
|
|
11829
11849
|
} else {
|
|
11830
|
-
return
|
|
11850
|
+
return ts42.factory.createNonNullExpression(expr);
|
|
11831
11851
|
}
|
|
11832
11852
|
} else {
|
|
11833
11853
|
return expr;
|
|
@@ -11835,7 +11855,7 @@ function widenBinding(expr, tcb) {
|
|
|
11835
11855
|
}
|
|
11836
11856
|
function unwrapWritableSignal(expression, tcb) {
|
|
11837
11857
|
const unwrapRef = tcb.env.referenceExternalSymbol(R3Identifiers4.unwrapWritableSignal.moduleName, R3Identifiers4.unwrapWritableSignal.name);
|
|
11838
|
-
return
|
|
11858
|
+
return ts42.factory.createCallExpression(unwrapRef, void 0, [expression]);
|
|
11839
11859
|
}
|
|
11840
11860
|
var EVENT_PARAMETER = "$event";
|
|
11841
11861
|
function tcbCreateEventHandler(event, tcb, scope, eventType) {
|
|
@@ -11843,25 +11863,25 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
|
|
|
11843
11863
|
const statements = [];
|
|
11844
11864
|
if (event.type === ParsedEventType.TwoWay && tcb.env.config.checkTwoWayBoundEvents) {
|
|
11845
11865
|
const target = tcb.allocateId();
|
|
11846
|
-
const assignment =
|
|
11847
|
-
statements.push(tsCreateVariable(target, tcb.env.config.allowSignalsInTwoWayBindings ? unwrapWritableSignal(handler, tcb) : handler),
|
|
11866
|
+
const assignment = ts42.factory.createBinaryExpression(target, ts42.SyntaxKind.EqualsToken, ts42.factory.createIdentifier(EVENT_PARAMETER));
|
|
11867
|
+
statements.push(tsCreateVariable(target, tcb.env.config.allowSignalsInTwoWayBindings ? unwrapWritableSignal(handler, tcb) : handler), ts42.factory.createExpressionStatement(assignment));
|
|
11848
11868
|
} else {
|
|
11849
|
-
statements.push(
|
|
11869
|
+
statements.push(ts42.factory.createExpressionStatement(handler));
|
|
11850
11870
|
}
|
|
11851
11871
|
let eventParamType;
|
|
11852
11872
|
if (eventType === 0) {
|
|
11853
11873
|
eventParamType = void 0;
|
|
11854
11874
|
} else if (eventType === 1) {
|
|
11855
|
-
eventParamType =
|
|
11875
|
+
eventParamType = ts42.factory.createKeywordTypeNode(ts42.SyntaxKind.AnyKeyword);
|
|
11856
11876
|
} else {
|
|
11857
11877
|
eventParamType = eventType;
|
|
11858
11878
|
}
|
|
11859
11879
|
const guards = scope.guards();
|
|
11860
|
-
let body =
|
|
11880
|
+
let body = ts42.factory.createBlock(statements);
|
|
11861
11881
|
if (guards !== null) {
|
|
11862
|
-
body =
|
|
11882
|
+
body = ts42.factory.createBlock([ts42.factory.createIfStatement(guards, body)]);
|
|
11863
11883
|
}
|
|
11864
|
-
const eventParam =
|
|
11884
|
+
const eventParam = ts42.factory.createParameterDeclaration(
|
|
11865
11885
|
void 0,
|
|
11866
11886
|
void 0,
|
|
11867
11887
|
EVENT_PARAMETER,
|
|
@@ -11869,11 +11889,11 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
|
|
|
11869
11889
|
eventParamType
|
|
11870
11890
|
);
|
|
11871
11891
|
addExpressionIdentifier(eventParam, ExpressionIdentifier.EVENT_PARAMETER);
|
|
11872
|
-
return
|
|
11892
|
+
return ts42.factory.createArrowFunction(
|
|
11873
11893
|
void 0,
|
|
11874
11894
|
void 0,
|
|
11875
11895
|
[eventParam],
|
|
11876
|
-
|
|
11896
|
+
ts42.factory.createKeywordTypeNode(ts42.SyntaxKind.AnyKeyword),
|
|
11877
11897
|
void 0,
|
|
11878
11898
|
body
|
|
11879
11899
|
);
|
|
@@ -11904,7 +11924,7 @@ function checkSplitTwoWayBinding(inputName, output, inputs, tcb) {
|
|
|
11904
11924
|
var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
|
|
11905
11925
|
resolve(ast) {
|
|
11906
11926
|
if (ast instanceof PropertyRead3 && ast.receiver instanceof ImplicitReceiver2 && !(ast.receiver instanceof ThisReceiver) && ast.name === EVENT_PARAMETER) {
|
|
11907
|
-
const event =
|
|
11927
|
+
const event = ts42.factory.createIdentifier(EVENT_PARAMETER);
|
|
11908
11928
|
addParseSpanInfo(event, ast.nameSpan);
|
|
11909
11929
|
return event;
|
|
11910
11930
|
}
|
|
@@ -11938,8 +11958,8 @@ var TcbForLoopTrackTranslator = class extends TcbExpressionTranslator {
|
|
|
11938
11958
|
}
|
|
11939
11959
|
};
|
|
11940
11960
|
|
|
11941
|
-
// bazel-out/
|
|
11942
|
-
import
|
|
11961
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_file.mjs
|
|
11962
|
+
import ts43 from "typescript";
|
|
11943
11963
|
var TypeCheckFile = class extends Environment {
|
|
11944
11964
|
fileName;
|
|
11945
11965
|
nextTcbId = 1;
|
|
@@ -11948,11 +11968,11 @@ var TypeCheckFile = class extends Environment {
|
|
|
11948
11968
|
super(config, new ImportManager({
|
|
11949
11969
|
forceGenerateNamespacesForNewImports: true,
|
|
11950
11970
|
shouldUseSingleQuotes: () => true
|
|
11951
|
-
}), refEmitter, reflector,
|
|
11971
|
+
}), refEmitter, reflector, ts43.createSourceFile(compilerHost.getCanonicalFileName(fileName), "", ts43.ScriptTarget.Latest, true));
|
|
11952
11972
|
this.fileName = fileName;
|
|
11953
11973
|
}
|
|
11954
11974
|
addTypeCheckBlock(ref, meta, domSchemaChecker, oobRecorder, genericContextBehavior) {
|
|
11955
|
-
const fnId =
|
|
11975
|
+
const fnId = ts43.factory.createIdentifier(`_tcb${this.nextTcbId++}`);
|
|
11956
11976
|
const fn = generateTypeCheckBlock(this, ref, fnId, meta, domSchemaChecker, oobRecorder, genericContextBehavior);
|
|
11957
11977
|
this.tcbStatements.push(fn);
|
|
11958
11978
|
}
|
|
@@ -11962,22 +11982,22 @@ var TypeCheckFile = class extends Environment {
|
|
|
11962
11982
|
if (importChanges.updatedImports.size > 0) {
|
|
11963
11983
|
throw new Error("AssertionError: Expected no imports to be updated for a new type check file.");
|
|
11964
11984
|
}
|
|
11965
|
-
const printer =
|
|
11985
|
+
const printer = ts43.createPrinter({ removeComments });
|
|
11966
11986
|
let source = "";
|
|
11967
11987
|
const newImports = importChanges.newImports.get(this.contextFile.fileName);
|
|
11968
11988
|
if (newImports !== void 0) {
|
|
11969
|
-
source += newImports.map((i) => printer.printNode(
|
|
11989
|
+
source += newImports.map((i) => printer.printNode(ts43.EmitHint.Unspecified, i, this.contextFile)).join("\n");
|
|
11970
11990
|
}
|
|
11971
11991
|
source += "\n";
|
|
11972
11992
|
for (const stmt of this.pipeInstStatements) {
|
|
11973
|
-
source += printer.printNode(
|
|
11993
|
+
source += printer.printNode(ts43.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
11974
11994
|
}
|
|
11975
11995
|
for (const stmt of this.typeCtorStatements) {
|
|
11976
|
-
source += printer.printNode(
|
|
11996
|
+
source += printer.printNode(ts43.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
11977
11997
|
}
|
|
11978
11998
|
source += "\n";
|
|
11979
11999
|
for (const stmt of this.tcbStatements) {
|
|
11980
|
-
source += printer.printNode(
|
|
12000
|
+
source += printer.printNode(ts43.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
11981
12001
|
}
|
|
11982
12002
|
source += "\nexport const IS_A_MODULE = true;\n";
|
|
11983
12003
|
return source;
|
|
@@ -11987,7 +12007,7 @@ var TypeCheckFile = class extends Environment {
|
|
|
11987
12007
|
}
|
|
11988
12008
|
};
|
|
11989
12009
|
|
|
11990
|
-
// bazel-out/
|
|
12010
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
|
|
11991
12011
|
var InliningMode;
|
|
11992
12012
|
(function(InliningMode2) {
|
|
11993
12013
|
InliningMode2[InliningMode2["InlineOps"] = 0] = "InlineOps";
|
|
@@ -12016,18 +12036,19 @@ var TypeCheckContextImpl = class {
|
|
|
12016
12036
|
}
|
|
12017
12037
|
opMap = /* @__PURE__ */ new Map();
|
|
12018
12038
|
typeCtorPending = /* @__PURE__ */ new Set();
|
|
12019
|
-
|
|
12020
|
-
|
|
12039
|
+
addDirective(ref, binder, schemas, templateContext, isStandalone) {
|
|
12040
|
+
var _a;
|
|
12041
|
+
if (!this.host.shouldCheckClass(ref.node)) {
|
|
12021
12042
|
return;
|
|
12022
12043
|
}
|
|
12023
12044
|
const fileData = this.dataForFile(ref.node.getSourceFile());
|
|
12024
|
-
const shimData = this.
|
|
12025
|
-
const
|
|
12026
|
-
const
|
|
12027
|
-
if (parseErrors !== null) {
|
|
12028
|
-
|
|
12045
|
+
const shimData = this.pendingShimForClass(ref.node);
|
|
12046
|
+
const id = fileData.sourceManager.getTypeCheckId(ref.node);
|
|
12047
|
+
const templateParsingDiagnostics = [];
|
|
12048
|
+
if (templateContext !== null && templateContext.parseErrors !== null) {
|
|
12049
|
+
templateParsingDiagnostics.push(...getTemplateDiagnostics(templateContext.parseErrors, id, templateContext.sourceMapping));
|
|
12029
12050
|
}
|
|
12030
|
-
const boundTarget = binder.bind({ template });
|
|
12051
|
+
const boundTarget = binder.bind({ template: templateContext == null ? void 0 : templateContext.nodes });
|
|
12031
12052
|
if (this.inlining === InliningMode.InlineOps) {
|
|
12032
12053
|
for (const dir of boundTarget.getUsedDirectives()) {
|
|
12033
12054
|
const dirRef = dir.ref;
|
|
@@ -12046,31 +12067,35 @@ var TypeCheckContextImpl = class {
|
|
|
12046
12067
|
});
|
|
12047
12068
|
}
|
|
12048
12069
|
}
|
|
12049
|
-
shimData.
|
|
12050
|
-
template,
|
|
12070
|
+
shimData.data.set(id, {
|
|
12071
|
+
template: (templateContext == null ? void 0 : templateContext.nodes) || null,
|
|
12051
12072
|
boundTarget,
|
|
12052
|
-
|
|
12073
|
+
templateParsingDiagnostics
|
|
12053
12074
|
});
|
|
12054
12075
|
const usedPipes = [];
|
|
12055
|
-
|
|
12056
|
-
|
|
12057
|
-
|
|
12076
|
+
if (templateContext !== null) {
|
|
12077
|
+
for (const name of boundTarget.getUsedPipes()) {
|
|
12078
|
+
if (templateContext.pipes.has(name)) {
|
|
12079
|
+
usedPipes.push(templateContext.pipes.get(name).ref);
|
|
12080
|
+
}
|
|
12058
12081
|
}
|
|
12059
|
-
usedPipes.push(pipes.get(name).ref);
|
|
12060
12082
|
}
|
|
12061
12083
|
const inliningRequirement = requiresInlineTypeCheckBlock(ref, shimData.file, usedPipes, this.reflector);
|
|
12062
12084
|
if (this.inlining === InliningMode.Error && inliningRequirement === TcbInliningRequirement.MustInline) {
|
|
12063
|
-
shimData.oobRecorder.requiresInlineTcb(
|
|
12085
|
+
shimData.oobRecorder.requiresInlineTcb(id, ref.node);
|
|
12064
12086
|
this.perf.eventCount(PerfEvent.SkipGenerateTcbNoInline);
|
|
12065
12087
|
return;
|
|
12066
12088
|
}
|
|
12089
|
+
if (templateContext !== null) {
|
|
12090
|
+
fileData.sourceManager.captureTemplateSource(id, templateContext.sourceMapping, templateContext.file);
|
|
12091
|
+
}
|
|
12067
12092
|
const meta = {
|
|
12068
|
-
id
|
|
12093
|
+
id,
|
|
12069
12094
|
boundTarget,
|
|
12070
|
-
pipes,
|
|
12095
|
+
pipes: (templateContext == null ? void 0 : templateContext.pipes) || null,
|
|
12071
12096
|
schemas,
|
|
12072
12097
|
isStandalone,
|
|
12073
|
-
preserveWhitespaces
|
|
12098
|
+
preserveWhitespaces: (_a = templateContext == null ? void 0 : templateContext.preserveWhitespaces) != null ? _a : false
|
|
12074
12099
|
};
|
|
12075
12100
|
this.perf.eventCount(PerfEvent.GenerateTcb);
|
|
12076
12101
|
if (inliningRequirement !== TcbInliningRequirement.None && this.inlining === InliningMode.InlineOps) {
|
|
@@ -12097,7 +12122,7 @@ var TypeCheckContextImpl = class {
|
|
|
12097
12122
|
if (!this.opMap.has(sf)) {
|
|
12098
12123
|
return null;
|
|
12099
12124
|
}
|
|
12100
|
-
const printer =
|
|
12125
|
+
const printer = ts44.createPrinter({ omitTrailingSemicolon: true });
|
|
12101
12126
|
const importManager = new ImportManager({
|
|
12102
12127
|
forceGenerateNamespacesForNewImports: true,
|
|
12103
12128
|
shouldUseSingleQuotes: () => true
|
|
@@ -12113,7 +12138,7 @@ var TypeCheckContextImpl = class {
|
|
|
12113
12138
|
newImports.get(sf.fileName).forEach((newImport) => {
|
|
12114
12139
|
updates.push({
|
|
12115
12140
|
pos: 0,
|
|
12116
|
-
text: printer.printNode(
|
|
12141
|
+
text: printer.printNode(ts44.EmitHint.Unspecified, newImport, sf)
|
|
12117
12142
|
});
|
|
12118
12143
|
});
|
|
12119
12144
|
}
|
|
@@ -12124,7 +12149,7 @@ var TypeCheckContextImpl = class {
|
|
|
12124
12149
|
updates.push({
|
|
12125
12150
|
pos: oldBindings.getStart(),
|
|
12126
12151
|
deletePos: oldBindings.getEnd(),
|
|
12127
|
-
text: printer.printNode(
|
|
12152
|
+
text: printer.printNode(ts44.EmitHint.Unspecified, newBindings, sf)
|
|
12128
12153
|
});
|
|
12129
12154
|
}
|
|
12130
12155
|
const result = new MagicString(sf.text, { filename: sf.fileName });
|
|
@@ -12156,7 +12181,7 @@ var TypeCheckContextImpl = class {
|
|
|
12156
12181
|
],
|
|
12157
12182
|
hasInlines: pendingFileData.hasInlines,
|
|
12158
12183
|
path: pendingShimData.file.fileName,
|
|
12159
|
-
|
|
12184
|
+
data: pendingShimData.data
|
|
12160
12185
|
});
|
|
12161
12186
|
const sfText = pendingShimData.file.render(false);
|
|
12162
12187
|
updates.set(pendingShimData.file.fileName, {
|
|
@@ -12176,7 +12201,7 @@ var TypeCheckContextImpl = class {
|
|
|
12176
12201
|
ops.push(new InlineTcbOp(ref, tcbMeta, this.config, this.reflector, shimData.domSchemaChecker, shimData.oobRecorder));
|
|
12177
12202
|
fileData.hasInlines = true;
|
|
12178
12203
|
}
|
|
12179
|
-
|
|
12204
|
+
pendingShimForClass(node) {
|
|
12180
12205
|
const fileData = this.dataForFile(node.getSourceFile());
|
|
12181
12206
|
const shimPath = TypeCheckShimGenerator.shimFor(absoluteFromSourceFile(node.getSourceFile()));
|
|
12182
12207
|
if (!fileData.shimData.has(shimPath)) {
|
|
@@ -12184,7 +12209,7 @@ var TypeCheckContextImpl = class {
|
|
|
12184
12209
|
domSchemaChecker: new RegistryDomSchemaChecker(fileData.sourceManager),
|
|
12185
12210
|
oobRecorder: new OutOfBandDiagnosticRecorderImpl(fileData.sourceManager),
|
|
12186
12211
|
file: new TypeCheckFile(shimPath, this.config, this.refEmitter, this.reflector, this.compilerHost),
|
|
12187
|
-
|
|
12212
|
+
data: /* @__PURE__ */ new Map()
|
|
12188
12213
|
});
|
|
12189
12214
|
}
|
|
12190
12215
|
return fileData.shimData.get(shimPath);
|
|
@@ -12208,7 +12233,7 @@ function getTemplateDiagnostics(parseErrors, templateId, sourceMapping) {
|
|
|
12208
12233
|
if (span.start.offset === span.end.offset) {
|
|
12209
12234
|
span.end.offset++;
|
|
12210
12235
|
}
|
|
12211
|
-
return makeTemplateDiagnostic(templateId, sourceMapping, span,
|
|
12236
|
+
return makeTemplateDiagnostic(templateId, sourceMapping, span, ts44.DiagnosticCategory.Error, ngErrorCode(ErrorCode.TEMPLATE_PARSE_ERROR), error.msg);
|
|
12212
12237
|
});
|
|
12213
12238
|
}
|
|
12214
12239
|
var InlineTcbOp = class {
|
|
@@ -12231,9 +12256,9 @@ var InlineTcbOp = class {
|
|
|
12231
12256
|
}
|
|
12232
12257
|
execute(im, sf, refEmitter, printer) {
|
|
12233
12258
|
const env = new Environment(this.config, im, refEmitter, this.reflector, sf);
|
|
12234
|
-
const fnName =
|
|
12259
|
+
const fnName = ts44.factory.createIdentifier(`_tcb_${this.ref.node.pos}`);
|
|
12235
12260
|
const fn = generateTypeCheckBlock(env, this.ref, fnName, this.meta, this.domSchemaChecker, this.oobRecorder, TcbGenericContextBehavior.CopyClassNodes);
|
|
12236
|
-
return printer.printNode(
|
|
12261
|
+
return printer.printNode(ts44.EmitHint.Unspecified, fn, sf);
|
|
12237
12262
|
}
|
|
12238
12263
|
};
|
|
12239
12264
|
var TypeCtorOp = class {
|
|
@@ -12251,14 +12276,14 @@ var TypeCtorOp = class {
|
|
|
12251
12276
|
execute(im, sf, refEmitter, printer) {
|
|
12252
12277
|
const emitEnv = new ReferenceEmitEnvironment(im, refEmitter, this.reflector, sf);
|
|
12253
12278
|
const tcb = generateInlineTypeCtor(emitEnv, this.ref.node, this.meta);
|
|
12254
|
-
return printer.printNode(
|
|
12279
|
+
return printer.printNode(ts44.EmitHint.Unspecified, tcb, sf);
|
|
12255
12280
|
}
|
|
12256
12281
|
};
|
|
12257
12282
|
|
|
12258
|
-
// bazel-out/
|
|
12283
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/source.mjs
|
|
12259
12284
|
import { ParseLocation as ParseLocation2, ParseSourceSpan as ParseSourceSpan2 } from "@angular/compiler";
|
|
12260
12285
|
|
|
12261
|
-
// bazel-out/
|
|
12286
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/line_mappings.mjs
|
|
12262
12287
|
var LF_CHAR = 10;
|
|
12263
12288
|
var CR_CHAR = 13;
|
|
12264
12289
|
var LINE_SEP_CHAR = 8232;
|
|
@@ -12299,7 +12324,7 @@ function findClosestLineStartPosition(linesMap, position, low = 0, high = linesM
|
|
|
12299
12324
|
return low - 1;
|
|
12300
12325
|
}
|
|
12301
12326
|
|
|
12302
|
-
// bazel-out/
|
|
12327
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/source.mjs
|
|
12303
12328
|
var TemplateSource = class {
|
|
12304
12329
|
mapping;
|
|
12305
12330
|
file;
|
|
@@ -12325,23 +12350,21 @@ var TemplateSource = class {
|
|
|
12325
12350
|
return this.lineStarts;
|
|
12326
12351
|
}
|
|
12327
12352
|
};
|
|
12328
|
-
var
|
|
12353
|
+
var DirectiveSourceManager = class {
|
|
12329
12354
|
templateSources = /* @__PURE__ */ new Map();
|
|
12330
|
-
|
|
12331
|
-
return
|
|
12355
|
+
getTypeCheckId(node) {
|
|
12356
|
+
return getTypeCheckId(node);
|
|
12332
12357
|
}
|
|
12333
|
-
|
|
12334
|
-
const id = getTemplateId(node);
|
|
12358
|
+
captureTemplateSource(id, mapping, file) {
|
|
12335
12359
|
this.templateSources.set(id, new TemplateSource(mapping, file));
|
|
12336
|
-
return id;
|
|
12337
12360
|
}
|
|
12338
|
-
|
|
12361
|
+
getTemplateSourceMapping(id) {
|
|
12339
12362
|
if (!this.templateSources.has(id)) {
|
|
12340
|
-
throw new Error(`Unexpected unknown
|
|
12363
|
+
throw new Error(`Unexpected unknown type check ID: ${id}`);
|
|
12341
12364
|
}
|
|
12342
12365
|
return this.templateSources.get(id).mapping;
|
|
12343
12366
|
}
|
|
12344
|
-
|
|
12367
|
+
toTemplateParseSourceSpan(id, span) {
|
|
12345
12368
|
if (!this.templateSources.has(id)) {
|
|
12346
12369
|
return null;
|
|
12347
12370
|
}
|
|
@@ -12350,22 +12373,22 @@ var TemplateSourceManager = class {
|
|
|
12350
12373
|
}
|
|
12351
12374
|
};
|
|
12352
12375
|
|
|
12353
|
-
// bazel-out/
|
|
12376
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_symbol_builder.mjs
|
|
12354
12377
|
import { AST, ASTWithName, ASTWithSource as ASTWithSource2, BindingPipe as BindingPipe2, PropertyRead as PropertyRead4, PropertyWrite as PropertyWrite3, R3Identifiers as R3Identifiers5, SafePropertyRead as SafePropertyRead4, TmplAstBoundAttribute as TmplAstBoundAttribute2, TmplAstBoundEvent, TmplAstElement as TmplAstElement3, TmplAstLetDeclaration as TmplAstLetDeclaration3, TmplAstReference as TmplAstReference3, TmplAstTemplate as TmplAstTemplate2, TmplAstTextAttribute as TmplAstTextAttribute3, TmplAstVariable as TmplAstVariable2 } from "@angular/compiler";
|
|
12355
|
-
import
|
|
12378
|
+
import ts45 from "typescript";
|
|
12356
12379
|
var SymbolBuilder = class {
|
|
12357
12380
|
tcbPath;
|
|
12358
12381
|
tcbIsShim;
|
|
12359
12382
|
typeCheckBlock;
|
|
12360
|
-
|
|
12383
|
+
typeCheckData;
|
|
12361
12384
|
componentScopeReader;
|
|
12362
12385
|
getTypeChecker;
|
|
12363
12386
|
symbolCache = /* @__PURE__ */ new Map();
|
|
12364
|
-
constructor(tcbPath, tcbIsShim, typeCheckBlock,
|
|
12387
|
+
constructor(tcbPath, tcbIsShim, typeCheckBlock, typeCheckData, componentScopeReader, getTypeChecker) {
|
|
12365
12388
|
this.tcbPath = tcbPath;
|
|
12366
12389
|
this.tcbIsShim = tcbIsShim;
|
|
12367
12390
|
this.typeCheckBlock = typeCheckBlock;
|
|
12368
|
-
this.
|
|
12391
|
+
this.typeCheckData = typeCheckData;
|
|
12369
12392
|
this.componentScopeReader = componentScopeReader;
|
|
12370
12393
|
this.getTypeChecker = getTypeChecker;
|
|
12371
12394
|
}
|
|
@@ -12406,7 +12429,7 @@ var SymbolBuilder = class {
|
|
|
12406
12429
|
const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
|
|
12407
12430
|
const node = findFirstMatchingNode(this.typeCheckBlock, {
|
|
12408
12431
|
withSpan: elementSourceSpan,
|
|
12409
|
-
filter:
|
|
12432
|
+
filter: ts45.isVariableDeclaration
|
|
12410
12433
|
});
|
|
12411
12434
|
if (node === null) {
|
|
12412
12435
|
return null;
|
|
@@ -12427,7 +12450,7 @@ var SymbolBuilder = class {
|
|
|
12427
12450
|
var _a;
|
|
12428
12451
|
const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
|
|
12429
12452
|
const tcbSourceFile = this.typeCheckBlock.getSourceFile();
|
|
12430
|
-
const isDirectiveDeclaration = (node) => (
|
|
12453
|
+
const isDirectiveDeclaration = (node) => (ts45.isTypeNode(node) || ts45.isIdentifier(node)) && ts45.isVariableDeclaration(node.parent) && hasExpressionIdentifier(tcbSourceFile, node, ExpressionIdentifier.DIRECTIVE);
|
|
12431
12454
|
const nodes = findAllMatchingNodes(this.typeCheckBlock, {
|
|
12432
12455
|
withSpan: elementSourceSpan,
|
|
12433
12456
|
filter: isDirectiveDeclaration
|
|
@@ -12435,7 +12458,7 @@ var SymbolBuilder = class {
|
|
|
12435
12458
|
const symbols = [];
|
|
12436
12459
|
for (const node of nodes) {
|
|
12437
12460
|
const symbol = this.getSymbolOfTsNode(node.parent);
|
|
12438
|
-
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !
|
|
12461
|
+
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts45.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
|
|
12439
12462
|
continue;
|
|
12440
12463
|
}
|
|
12441
12464
|
const meta = this.getDirectiveMeta(element, symbol.tsSymbol.valueDeclaration);
|
|
@@ -12466,7 +12489,7 @@ var SymbolBuilder = class {
|
|
|
12466
12489
|
if (!isHostDirectiveMetaForGlobalMode(current)) {
|
|
12467
12490
|
throw new Error("Impossible state: typecheck code path in local compilation mode.");
|
|
12468
12491
|
}
|
|
12469
|
-
if (!
|
|
12492
|
+
if (!ts45.isClassDeclaration(current.directive.node)) {
|
|
12470
12493
|
continue;
|
|
12471
12494
|
}
|
|
12472
12495
|
const symbol = this.getSymbolOfTsNode(current.directive.node);
|
|
@@ -12495,12 +12518,12 @@ var SymbolBuilder = class {
|
|
|
12495
12518
|
}
|
|
12496
12519
|
getDirectiveMeta(host, directiveDeclaration) {
|
|
12497
12520
|
var _a;
|
|
12498
|
-
let directives = this.
|
|
12521
|
+
let directives = this.typeCheckData.boundTarget.getDirectivesOfNode(host);
|
|
12499
12522
|
const firstChild = host.children[0];
|
|
12500
12523
|
if (firstChild instanceof TmplAstElement3) {
|
|
12501
12524
|
const isMicrosyntaxTemplate = host instanceof TmplAstTemplate2 && sourceSpanEqual(firstChild.sourceSpan, host.sourceSpan);
|
|
12502
12525
|
if (isMicrosyntaxTemplate) {
|
|
12503
|
-
const firstChildDirectives = this.
|
|
12526
|
+
const firstChildDirectives = this.typeCheckData.boundTarget.getDirectivesOfNode(firstChild);
|
|
12504
12527
|
if (firstChildDirectives !== null && directives !== null) {
|
|
12505
12528
|
directives = directives.concat(firstChildDirectives);
|
|
12506
12529
|
} else {
|
|
@@ -12521,7 +12544,7 @@ var SymbolBuilder = class {
|
|
|
12521
12544
|
return scope.ngModule;
|
|
12522
12545
|
}
|
|
12523
12546
|
getSymbolOfBoundEvent(eventBinding) {
|
|
12524
|
-
const consumer = this.
|
|
12547
|
+
const consumer = this.typeCheckData.boundTarget.getConsumerOfBinding(eventBinding);
|
|
12525
12548
|
if (consumer === null) {
|
|
12526
12549
|
return null;
|
|
12527
12550
|
}
|
|
@@ -12539,10 +12562,10 @@ var SymbolBuilder = class {
|
|
|
12539
12562
|
if (!isAccessExpression(n2)) {
|
|
12540
12563
|
return false;
|
|
12541
12564
|
}
|
|
12542
|
-
if (
|
|
12565
|
+
if (ts45.isPropertyAccessExpression(n2)) {
|
|
12543
12566
|
return n2.name.getText() === expectedAccess;
|
|
12544
12567
|
} else {
|
|
12545
|
-
return
|
|
12568
|
+
return ts45.isStringLiteral(n2.argumentExpression) && n2.argumentExpression.text === expectedAccess;
|
|
12546
12569
|
}
|
|
12547
12570
|
}
|
|
12548
12571
|
const outputFieldAccesses = findAllMatchingNodes(this.typeCheckBlock, {
|
|
@@ -12552,7 +12575,7 @@ var SymbolBuilder = class {
|
|
|
12552
12575
|
const bindings = [];
|
|
12553
12576
|
for (const outputFieldAccess of outputFieldAccesses) {
|
|
12554
12577
|
if (consumer instanceof TmplAstTemplate2 || consumer instanceof TmplAstElement3) {
|
|
12555
|
-
if (!
|
|
12578
|
+
if (!ts45.isPropertyAccessExpression(outputFieldAccess)) {
|
|
12556
12579
|
continue;
|
|
12557
12580
|
}
|
|
12558
12581
|
const addEventListener = outputFieldAccess.name;
|
|
@@ -12575,7 +12598,7 @@ var SymbolBuilder = class {
|
|
|
12575
12598
|
}
|
|
12576
12599
|
});
|
|
12577
12600
|
} else {
|
|
12578
|
-
if (!
|
|
12601
|
+
if (!ts45.isElementAccessExpression(outputFieldAccess)) {
|
|
12579
12602
|
continue;
|
|
12580
12603
|
}
|
|
12581
12604
|
const tsSymbol = this.getTypeChecker().getSymbolAtLocation(outputFieldAccess.argumentExpression);
|
|
@@ -12607,7 +12630,7 @@ var SymbolBuilder = class {
|
|
|
12607
12630
|
return { kind: SymbolKind.Output, bindings };
|
|
12608
12631
|
}
|
|
12609
12632
|
getSymbolOfInputBinding(binding) {
|
|
12610
|
-
const consumer = this.
|
|
12633
|
+
const consumer = this.typeCheckData.boundTarget.getConsumerOfBinding(binding);
|
|
12611
12634
|
if (consumer === null) {
|
|
12612
12635
|
return null;
|
|
12613
12636
|
}
|
|
@@ -12628,7 +12651,7 @@ var SymbolBuilder = class {
|
|
|
12628
12651
|
let fieldAccessExpr;
|
|
12629
12652
|
let symbolInfo = null;
|
|
12630
12653
|
if (signalInputAssignment !== null) {
|
|
12631
|
-
if (
|
|
12654
|
+
if (ts45.isIdentifier(signalInputAssignment.fieldExpr)) {
|
|
12632
12655
|
continue;
|
|
12633
12656
|
}
|
|
12634
12657
|
const fieldSymbol = this.getSymbolOfTsNode(signalInputAssignment.fieldExpr);
|
|
@@ -12669,7 +12692,7 @@ var SymbolBuilder = class {
|
|
|
12669
12692
|
return null;
|
|
12670
12693
|
}
|
|
12671
12694
|
const [declaration] = tsSymbol.declarations;
|
|
12672
|
-
if (!
|
|
12695
|
+
if (!ts45.isVariableDeclaration(declaration) || !hasExpressionIdentifier(
|
|
12673
12696
|
declaration.getSourceFile(),
|
|
12674
12697
|
(_a = declaration.type) != null ? _a : declaration.name,
|
|
12675
12698
|
ExpressionIdentifier.DIRECTIVE
|
|
@@ -12677,7 +12700,7 @@ var SymbolBuilder = class {
|
|
|
12677
12700
|
return null;
|
|
12678
12701
|
}
|
|
12679
12702
|
const symbol = this.getSymbolOfTsNode(declaration);
|
|
12680
|
-
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !
|
|
12703
|
+
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts45.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
|
|
12681
12704
|
return null;
|
|
12682
12705
|
}
|
|
12683
12706
|
const ref = new Reference(symbol.tsSymbol.valueDeclaration);
|
|
@@ -12699,13 +12722,13 @@ var SymbolBuilder = class {
|
|
|
12699
12722
|
getSymbolOfVariable(variable) {
|
|
12700
12723
|
const node = findFirstMatchingNode(this.typeCheckBlock, {
|
|
12701
12724
|
withSpan: variable.sourceSpan,
|
|
12702
|
-
filter:
|
|
12725
|
+
filter: ts45.isVariableDeclaration
|
|
12703
12726
|
});
|
|
12704
12727
|
if (node === null) {
|
|
12705
12728
|
return null;
|
|
12706
12729
|
}
|
|
12707
12730
|
let nodeValueSymbol = null;
|
|
12708
|
-
if (
|
|
12731
|
+
if (ts45.isForOfStatement(node.parent.parent)) {
|
|
12709
12732
|
nodeValueSymbol = this.getSymbolOfTsNode(node);
|
|
12710
12733
|
} else if (node.initializer !== void 0) {
|
|
12711
12734
|
nodeValueSymbol = this.getSymbolOfTsNode(node.initializer);
|
|
@@ -12727,15 +12750,15 @@ var SymbolBuilder = class {
|
|
|
12727
12750
|
};
|
|
12728
12751
|
}
|
|
12729
12752
|
getSymbolOfReference(ref) {
|
|
12730
|
-
const target = this.
|
|
12753
|
+
const target = this.typeCheckData.boundTarget.getReferenceTarget(ref);
|
|
12731
12754
|
let node = findFirstMatchingNode(this.typeCheckBlock, {
|
|
12732
12755
|
withSpan: ref.sourceSpan,
|
|
12733
|
-
filter:
|
|
12756
|
+
filter: ts45.isVariableDeclaration
|
|
12734
12757
|
});
|
|
12735
12758
|
if (node === null || target === null || node.initializer === void 0) {
|
|
12736
12759
|
return null;
|
|
12737
12760
|
}
|
|
12738
|
-
const originalDeclaration =
|
|
12761
|
+
const originalDeclaration = ts45.isParenthesizedExpression(node.initializer) && ts45.isAsExpression(node.initializer.expression) ? this.getTypeChecker().getSymbolAtLocation(node.name) : this.getTypeChecker().getSymbolAtLocation(node.initializer);
|
|
12739
12762
|
if (originalDeclaration === void 0 || originalDeclaration.valueDeclaration === void 0) {
|
|
12740
12763
|
return null;
|
|
12741
12764
|
}
|
|
@@ -12759,7 +12782,7 @@ var SymbolBuilder = class {
|
|
|
12759
12782
|
referenceVarLocation: referenceVarTcbLocation
|
|
12760
12783
|
};
|
|
12761
12784
|
} else {
|
|
12762
|
-
if (!
|
|
12785
|
+
if (!ts45.isClassDeclaration(target.directive.ref.node)) {
|
|
12763
12786
|
return null;
|
|
12764
12787
|
}
|
|
12765
12788
|
return {
|
|
@@ -12776,7 +12799,7 @@ var SymbolBuilder = class {
|
|
|
12776
12799
|
getSymbolOfLetDeclaration(decl) {
|
|
12777
12800
|
const node = findFirstMatchingNode(this.typeCheckBlock, {
|
|
12778
12801
|
withSpan: decl.sourceSpan,
|
|
12779
|
-
filter:
|
|
12802
|
+
filter: ts45.isVariableDeclaration
|
|
12780
12803
|
});
|
|
12781
12804
|
if (node === null) {
|
|
12782
12805
|
return null;
|
|
@@ -12801,7 +12824,7 @@ var SymbolBuilder = class {
|
|
|
12801
12824
|
getSymbolOfPipe(expression) {
|
|
12802
12825
|
const methodAccess = findFirstMatchingNode(this.typeCheckBlock, {
|
|
12803
12826
|
withSpan: expression.nameSpan,
|
|
12804
|
-
filter:
|
|
12827
|
+
filter: ts45.isPropertyAccessExpression
|
|
12805
12828
|
});
|
|
12806
12829
|
if (methodAccess === null) {
|
|
12807
12830
|
return null;
|
|
@@ -12832,7 +12855,7 @@ var SymbolBuilder = class {
|
|
|
12832
12855
|
if (expression instanceof ASTWithSource2) {
|
|
12833
12856
|
expression = expression.ast;
|
|
12834
12857
|
}
|
|
12835
|
-
const expressionTarget = this.
|
|
12858
|
+
const expressionTarget = this.typeCheckData.boundTarget.getExpressionTarget(expression);
|
|
12836
12859
|
if (expressionTarget !== null) {
|
|
12837
12860
|
return this.getSymbol(expressionTarget);
|
|
12838
12861
|
}
|
|
@@ -12844,7 +12867,7 @@ var SymbolBuilder = class {
|
|
|
12844
12867
|
if (expression instanceof PropertyRead4) {
|
|
12845
12868
|
node = findFirstMatchingNode(this.typeCheckBlock, {
|
|
12846
12869
|
withSpan,
|
|
12847
|
-
filter:
|
|
12870
|
+
filter: ts45.isPropertyAccessExpression
|
|
12848
12871
|
});
|
|
12849
12872
|
}
|
|
12850
12873
|
if (node === null) {
|
|
@@ -12853,10 +12876,10 @@ var SymbolBuilder = class {
|
|
|
12853
12876
|
if (node === null) {
|
|
12854
12877
|
return null;
|
|
12855
12878
|
}
|
|
12856
|
-
while (
|
|
12879
|
+
while (ts45.isParenthesizedExpression(node)) {
|
|
12857
12880
|
node = node.expression;
|
|
12858
12881
|
}
|
|
12859
|
-
if (expression instanceof SafePropertyRead4 &&
|
|
12882
|
+
if (expression instanceof SafePropertyRead4 && ts45.isConditionalExpression(node)) {
|
|
12860
12883
|
const whenTrueSymbol = this.getSymbolOfTsNode(node.whenTrue);
|
|
12861
12884
|
if (whenTrueSymbol === null) {
|
|
12862
12885
|
return null;
|
|
@@ -12873,13 +12896,13 @@ var SymbolBuilder = class {
|
|
|
12873
12896
|
}
|
|
12874
12897
|
getSymbolOfTsNode(node) {
|
|
12875
12898
|
var _a;
|
|
12876
|
-
while (
|
|
12899
|
+
while (ts45.isParenthesizedExpression(node)) {
|
|
12877
12900
|
node = node.expression;
|
|
12878
12901
|
}
|
|
12879
12902
|
let tsSymbol;
|
|
12880
|
-
if (
|
|
12903
|
+
if (ts45.isPropertyAccessExpression(node)) {
|
|
12881
12904
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.name);
|
|
12882
|
-
} else if (
|
|
12905
|
+
} else if (ts45.isCallExpression(node)) {
|
|
12883
12906
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.expression);
|
|
12884
12907
|
} else {
|
|
12885
12908
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node);
|
|
@@ -12897,13 +12920,13 @@ var SymbolBuilder = class {
|
|
|
12897
12920
|
};
|
|
12898
12921
|
}
|
|
12899
12922
|
getTcbPositionForNode(node) {
|
|
12900
|
-
if (
|
|
12923
|
+
if (ts45.isTypeReferenceNode(node)) {
|
|
12901
12924
|
return this.getTcbPositionForNode(node.typeName);
|
|
12902
|
-
} else if (
|
|
12925
|
+
} else if (ts45.isQualifiedName(node)) {
|
|
12903
12926
|
return node.right.getStart();
|
|
12904
|
-
} else if (
|
|
12927
|
+
} else if (ts45.isPropertyAccessExpression(node)) {
|
|
12905
12928
|
return node.name.getStart();
|
|
12906
|
-
} else if (
|
|
12929
|
+
} else if (ts45.isElementAccessExpression(node)) {
|
|
12907
12930
|
return node.argumentExpression.getStart();
|
|
12908
12931
|
} else {
|
|
12909
12932
|
return node.getStart();
|
|
@@ -12917,13 +12940,13 @@ function sourceSpanEqual(a, b) {
|
|
|
12917
12940
|
return a.start.offset === b.start.offset && a.end.offset === b.end.offset;
|
|
12918
12941
|
}
|
|
12919
12942
|
function unwrapSignalInputWriteTAccessor(expr) {
|
|
12920
|
-
if (!
|
|
12943
|
+
if (!ts45.isElementAccessExpression(expr) || !ts45.isPropertyAccessExpression(expr.argumentExpression)) {
|
|
12921
12944
|
return null;
|
|
12922
12945
|
}
|
|
12923
|
-
if (!
|
|
12946
|
+
if (!ts45.isIdentifier(expr.argumentExpression.name) || expr.argumentExpression.name.text !== R3Identifiers5.InputSignalBrandWriteType.name) {
|
|
12924
12947
|
return null;
|
|
12925
12948
|
}
|
|
12926
|
-
if (!
|
|
12949
|
+
if (!ts45.isPropertyAccessExpression(expr.expression) && !ts45.isElementAccessExpression(expr.expression) && !ts45.isIdentifier(expr.expression)) {
|
|
12927
12950
|
throw new Error("Unexpected expression for signal input write type.");
|
|
12928
12951
|
}
|
|
12929
12952
|
return {
|
|
@@ -12932,7 +12955,7 @@ function unwrapSignalInputWriteTAccessor(expr) {
|
|
|
12932
12955
|
};
|
|
12933
12956
|
}
|
|
12934
12957
|
|
|
12935
|
-
// bazel-out/
|
|
12958
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
|
|
12936
12959
|
var REGISTRY2 = new DomElementSchemaRegistry2();
|
|
12937
12960
|
var TemplateTypeCheckerImpl = class {
|
|
12938
12961
|
originalProgram;
|
|
@@ -13002,9 +13025,8 @@ var TemplateTypeCheckerImpl = class {
|
|
|
13002
13025
|
if (!fileRecord.shimData.has(shimPath)) {
|
|
13003
13026
|
return { data: null, tcb: null, tcbPath: shimPath, tcbIsShim: true };
|
|
13004
13027
|
}
|
|
13005
|
-
const
|
|
13028
|
+
const id = fileRecord.sourceManager.getTypeCheckId(component);
|
|
13006
13029
|
const shimRecord = fileRecord.shimData.get(shimPath);
|
|
13007
|
-
const id = fileRecord.sourceManager.getTemplateId(component);
|
|
13008
13030
|
const program = this.programDriver.getProgram();
|
|
13009
13031
|
const shimSf = getSourceFileOrNull(program, shimPath);
|
|
13010
13032
|
if (shimSf === null || !fileRecord.shimData.has(shimPath)) {
|
|
@@ -13020,8 +13042,8 @@ var TemplateTypeCheckerImpl = class {
|
|
|
13020
13042
|
}
|
|
13021
13043
|
}
|
|
13022
13044
|
let data = null;
|
|
13023
|
-
if (shimRecord.
|
|
13024
|
-
data = shimRecord.
|
|
13045
|
+
if (shimRecord.data.has(id)) {
|
|
13046
|
+
data = shimRecord.data.get(id);
|
|
13025
13047
|
}
|
|
13026
13048
|
return { data, tcb, tcbPath, tcbIsShim: tcbPath === shimPath };
|
|
13027
13049
|
}
|
|
@@ -13051,7 +13073,7 @@ var TemplateTypeCheckerImpl = class {
|
|
|
13051
13073
|
}
|
|
13052
13074
|
return null;
|
|
13053
13075
|
}
|
|
13054
|
-
|
|
13076
|
+
getSourceMappingAtTcbLocation(tcbLocation) {
|
|
13055
13077
|
const fileRecord = this.getFileRecordForTcbLocation(tcbLocation);
|
|
13056
13078
|
if (fileRecord === null) {
|
|
13057
13079
|
return null;
|
|
@@ -13060,7 +13082,7 @@ var TemplateTypeCheckerImpl = class {
|
|
|
13060
13082
|
if (shimSf === void 0) {
|
|
13061
13083
|
return null;
|
|
13062
13084
|
}
|
|
13063
|
-
return
|
|
13085
|
+
return getSourceMapping(
|
|
13064
13086
|
shimSf,
|
|
13065
13087
|
tcbLocation.positionInFile,
|
|
13066
13088
|
fileRecord.sourceManager,
|
|
@@ -13092,8 +13114,8 @@ var TemplateTypeCheckerImpl = class {
|
|
|
13092
13114
|
const shimSf = getSourceFileOrError(typeCheckProgram, shimPath);
|
|
13093
13115
|
diagnostics.push(...typeCheckProgram.getSemanticDiagnostics(shimSf).map((diag) => convertDiagnostic(diag, fileRecord.sourceManager)));
|
|
13094
13116
|
diagnostics.push(...shimRecord.genesisDiagnostics);
|
|
13095
|
-
for (const templateData of shimRecord.
|
|
13096
|
-
diagnostics.push(...templateData.
|
|
13117
|
+
for (const templateData of shimRecord.data.values()) {
|
|
13118
|
+
diagnostics.push(...templateData.templateParsingDiagnostics);
|
|
13097
13119
|
}
|
|
13098
13120
|
}
|
|
13099
13121
|
return diagnostics.filter((diag) => diag !== null);
|
|
@@ -13109,7 +13131,7 @@ var TemplateTypeCheckerImpl = class {
|
|
|
13109
13131
|
if (!fileRecord.shimData.has(shimPath)) {
|
|
13110
13132
|
return [];
|
|
13111
13133
|
}
|
|
13112
|
-
const
|
|
13134
|
+
const id = fileRecord.sourceManager.getTypeCheckId(component);
|
|
13113
13135
|
const shimRecord = fileRecord.shimData.get(shimPath);
|
|
13114
13136
|
const typeCheckProgram = this.programDriver.getProgram();
|
|
13115
13137
|
const diagnostics = [];
|
|
@@ -13120,10 +13142,10 @@ var TemplateTypeCheckerImpl = class {
|
|
|
13120
13142
|
const shimSf = getSourceFileOrError(typeCheckProgram, shimPath);
|
|
13121
13143
|
diagnostics.push(...typeCheckProgram.getSemanticDiagnostics(shimSf).map((diag) => convertDiagnostic(diag, fileRecord.sourceManager)));
|
|
13122
13144
|
diagnostics.push(...shimRecord.genesisDiagnostics);
|
|
13123
|
-
for (const templateData of shimRecord.
|
|
13124
|
-
diagnostics.push(...templateData.
|
|
13145
|
+
for (const templateData of shimRecord.data.values()) {
|
|
13146
|
+
diagnostics.push(...templateData.templateParsingDiagnostics);
|
|
13125
13147
|
}
|
|
13126
|
-
return diagnostics.filter((diag) => diag !== null && diag.
|
|
13148
|
+
return diagnostics.filter((diag) => diag !== null && diag.typeCheckId === id);
|
|
13127
13149
|
});
|
|
13128
13150
|
}
|
|
13129
13151
|
getTypeCheckBlock(component) {
|
|
@@ -13159,7 +13181,7 @@ var TemplateTypeCheckerImpl = class {
|
|
|
13159
13181
|
const sfPath = absoluteFromSourceFile(sf);
|
|
13160
13182
|
const shimPath = TypeCheckShimGenerator.shimFor(sfPath);
|
|
13161
13183
|
const fileData = this.getFileData(sfPath);
|
|
13162
|
-
const
|
|
13184
|
+
const id = fileData.sourceManager.getTypeCheckId(clazz);
|
|
13163
13185
|
fileData.shimData.delete(shimPath);
|
|
13164
13186
|
fileData.isComplete = false;
|
|
13165
13187
|
this.isComplete = false;
|
|
@@ -13171,10 +13193,10 @@ var TemplateTypeCheckerImpl = class {
|
|
|
13171
13193
|
makeTemplateDiagnostic(clazz, sourceSpan, category, errorCode, message, relatedInformation) {
|
|
13172
13194
|
const sfPath = absoluteFromSourceFile(clazz.getSourceFile());
|
|
13173
13195
|
const fileRecord = this.state.get(sfPath);
|
|
13174
|
-
const
|
|
13175
|
-
const mapping = fileRecord.sourceManager.
|
|
13196
|
+
const id = fileRecord.sourceManager.getTypeCheckId(clazz);
|
|
13197
|
+
const mapping = fileRecord.sourceManager.getTemplateSourceMapping(id);
|
|
13176
13198
|
return {
|
|
13177
|
-
...makeTemplateDiagnostic(
|
|
13199
|
+
...makeTemplateDiagnostic(id, mapping, sourceSpan, category, ngErrorCode(errorCode), message, relatedInformation),
|
|
13178
13200
|
__ngCode: errorCode
|
|
13179
13201
|
};
|
|
13180
13202
|
}
|
|
@@ -13292,7 +13314,7 @@ var TemplateTypeCheckerImpl = class {
|
|
|
13292
13314
|
if (!this.state.has(path)) {
|
|
13293
13315
|
this.state.set(path, {
|
|
13294
13316
|
hasInlines: false,
|
|
13295
|
-
sourceManager: new
|
|
13317
|
+
sourceManager: new DirectiveSourceManager(),
|
|
13296
13318
|
isComplete: false,
|
|
13297
13319
|
shimData: /* @__PURE__ */ new Map()
|
|
13298
13320
|
});
|
|
@@ -13580,7 +13602,7 @@ var WholeProgramTypeCheckingHost = class {
|
|
|
13580
13602
|
getSourceManager(sfPath) {
|
|
13581
13603
|
return this.impl.getFileData(sfPath).sourceManager;
|
|
13582
13604
|
}
|
|
13583
|
-
|
|
13605
|
+
shouldCheckClass(node) {
|
|
13584
13606
|
const sfPath = absoluteFromSourceFile(node.getSourceFile());
|
|
13585
13607
|
const shimPath = TypeCheckShimGenerator.shimFor(sfPath);
|
|
13586
13608
|
const fileData = this.impl.getFileData(sfPath);
|
|
@@ -13616,7 +13638,7 @@ var SingleFileTypeCheckingHost = class {
|
|
|
13616
13638
|
this.assertPath(sfPath);
|
|
13617
13639
|
return this.fileData.sourceManager;
|
|
13618
13640
|
}
|
|
13619
|
-
|
|
13641
|
+
shouldCheckClass(node) {
|
|
13620
13642
|
if (this.sfPath !== absoluteFromSourceFile(node.getSourceFile())) {
|
|
13621
13643
|
return false;
|
|
13622
13644
|
}
|
|
@@ -13657,17 +13679,17 @@ var SingleShimTypeCheckingHost = class extends SingleFileTypeCheckingHost {
|
|
|
13657
13679
|
}
|
|
13658
13680
|
};
|
|
13659
13681
|
|
|
13660
|
-
// bazel-out/
|
|
13682
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/hmr/src/metadata.mjs
|
|
13661
13683
|
import { outputAst as o3 } from "@angular/compiler";
|
|
13662
13684
|
|
|
13663
|
-
// bazel-out/
|
|
13685
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/hmr/src/extract_dependencies.mjs
|
|
13664
13686
|
import { outputAst as o2 } from "@angular/compiler";
|
|
13665
|
-
import
|
|
13687
|
+
import ts46 from "typescript";
|
|
13666
13688
|
function extractHmrDependencies(node, definition, factory, deferBlockMetadata, classMetadata, debugInfo, reflection, evaluator) {
|
|
13667
13689
|
var _a, _b;
|
|
13668
|
-
const name =
|
|
13690
|
+
const name = ts46.isClassDeclaration(node) && node.name ? node.name.text : null;
|
|
13669
13691
|
const visitor = new PotentialTopLevelReadsVisitor();
|
|
13670
|
-
const sourceFile = node.getSourceFile();
|
|
13692
|
+
const sourceFile = ts46.getOriginalNode(node).getSourceFile();
|
|
13671
13693
|
definition.expression.visitExpression(visitor, null);
|
|
13672
13694
|
definition.statements.forEach((statement) => statement.visitStatement(visitor, null));
|
|
13673
13695
|
(_a = factory.initializer) == null ? void 0 : _a.visitExpression(visitor, null);
|
|
@@ -13728,19 +13750,19 @@ function getRuntimeRepresentation(node, reflection, evaluator) {
|
|
|
13728
13750
|
function getTopLevelDeclarationNames(sourceFile) {
|
|
13729
13751
|
const results = /* @__PURE__ */ new Set();
|
|
13730
13752
|
for (const node of sourceFile.statements) {
|
|
13731
|
-
if (
|
|
13753
|
+
if (ts46.isClassDeclaration(node) || ts46.isFunctionDeclaration(node) || ts46.isEnumDeclaration(node)) {
|
|
13732
13754
|
if (node.name) {
|
|
13733
13755
|
results.add(node.name.text);
|
|
13734
13756
|
}
|
|
13735
13757
|
continue;
|
|
13736
13758
|
}
|
|
13737
|
-
if (
|
|
13759
|
+
if (ts46.isVariableStatement(node)) {
|
|
13738
13760
|
for (const decl of node.declarationList.declarations) {
|
|
13739
13761
|
trackBindingName(decl.name, results);
|
|
13740
13762
|
}
|
|
13741
13763
|
continue;
|
|
13742
13764
|
}
|
|
13743
|
-
if (
|
|
13765
|
+
if (ts46.isImportDeclaration(node) && node.importClause) {
|
|
13744
13766
|
const importClause = node.importClause;
|
|
13745
13767
|
if (importClause.isTypeOnly) {
|
|
13746
13768
|
continue;
|
|
@@ -13750,7 +13772,7 @@ function getTopLevelDeclarationNames(sourceFile) {
|
|
|
13750
13772
|
}
|
|
13751
13773
|
if (importClause.namedBindings) {
|
|
13752
13774
|
const namedBindings = importClause.namedBindings;
|
|
13753
|
-
if (
|
|
13775
|
+
if (ts46.isNamespaceImport(namedBindings)) {
|
|
13754
13776
|
results.add(namedBindings.name.text);
|
|
13755
13777
|
} else {
|
|
13756
13778
|
namedBindings.elements.forEach((el) => {
|
|
@@ -13766,11 +13788,11 @@ function getTopLevelDeclarationNames(sourceFile) {
|
|
|
13766
13788
|
return results;
|
|
13767
13789
|
}
|
|
13768
13790
|
function trackBindingName(node, results) {
|
|
13769
|
-
if (
|
|
13791
|
+
if (ts46.isIdentifier(node)) {
|
|
13770
13792
|
results.add(node.text);
|
|
13771
13793
|
} else {
|
|
13772
13794
|
for (const el of node.elements) {
|
|
13773
|
-
if (!
|
|
13795
|
+
if (!ts46.isOmittedExpression(el)) {
|
|
13774
13796
|
trackBindingName(el.name, results);
|
|
13775
13797
|
}
|
|
13776
13798
|
}
|
|
@@ -13796,10 +13818,10 @@ var PotentialTopLevelReadsVisitor = class extends o2.RecursiveAstVisitor {
|
|
|
13796
13818
|
super.visitWrappedNodeExpr(ast, context);
|
|
13797
13819
|
}
|
|
13798
13820
|
addAllTopLevelIdentifiers = (node) => {
|
|
13799
|
-
if (
|
|
13821
|
+
if (ts46.isIdentifier(node) && this.isTopLevelIdentifierReference(node)) {
|
|
13800
13822
|
this.allReads.add(node);
|
|
13801
13823
|
} else {
|
|
13802
|
-
|
|
13824
|
+
ts46.forEachChild(node, this.addAllTopLevelIdentifiers);
|
|
13803
13825
|
}
|
|
13804
13826
|
};
|
|
13805
13827
|
isTopLevelIdentifierReference(identifier) {
|
|
@@ -13808,52 +13830,52 @@ var PotentialTopLevelReadsVisitor = class extends o2.RecursiveAstVisitor {
|
|
|
13808
13830
|
if (!parent) {
|
|
13809
13831
|
return false;
|
|
13810
13832
|
}
|
|
13811
|
-
if (
|
|
13812
|
-
while (parent &&
|
|
13833
|
+
if (ts46.isParenthesizedExpression(parent) && parent.expression === node) {
|
|
13834
|
+
while (parent && ts46.isParenthesizedExpression(parent)) {
|
|
13813
13835
|
node = parent;
|
|
13814
13836
|
parent = parent.parent;
|
|
13815
13837
|
}
|
|
13816
13838
|
}
|
|
13817
|
-
if (
|
|
13839
|
+
if (ts46.isSourceFile(parent)) {
|
|
13818
13840
|
return true;
|
|
13819
13841
|
}
|
|
13820
|
-
if (
|
|
13842
|
+
if (ts46.isCallExpression(parent)) {
|
|
13821
13843
|
return parent.expression === node || parent.arguments.includes(node);
|
|
13822
13844
|
}
|
|
13823
|
-
if (
|
|
13845
|
+
if (ts46.isExpressionStatement(parent) || ts46.isPropertyAccessExpression(parent) || ts46.isComputedPropertyName(parent) || ts46.isTemplateSpan(parent) || ts46.isSpreadAssignment(parent) || ts46.isSpreadElement(parent) || ts46.isAwaitExpression(parent) || ts46.isNonNullExpression(parent) || ts46.isIfStatement(parent) || ts46.isDoStatement(parent) || ts46.isWhileStatement(parent) || ts46.isSwitchStatement(parent) || ts46.isCaseClause(parent) || ts46.isThrowStatement(parent) || ts46.isNewExpression(parent)) {
|
|
13824
13846
|
return parent.expression === node;
|
|
13825
13847
|
}
|
|
13826
|
-
if (
|
|
13848
|
+
if (ts46.isArrayLiteralExpression(parent)) {
|
|
13827
13849
|
return parent.elements.includes(node);
|
|
13828
13850
|
}
|
|
13829
|
-
if (
|
|
13851
|
+
if (ts46.isPropertyAssignment(parent) || ts46.isParameter(parent) || ts46.isBindingElement(parent) || ts46.isPropertyDeclaration(parent) || ts46.isEnumMember(parent)) {
|
|
13830
13852
|
return parent.initializer === node;
|
|
13831
13853
|
}
|
|
13832
|
-
if (
|
|
13854
|
+
if (ts46.isVariableDeclaration(parent)) {
|
|
13833
13855
|
return parent.name === node || parent.initializer === node;
|
|
13834
13856
|
}
|
|
13835
|
-
if (
|
|
13857
|
+
if (ts46.isClassDeclaration(parent) || ts46.isFunctionDeclaration(parent) || ts46.isShorthandPropertyAssignment(parent)) {
|
|
13836
13858
|
return parent.name === node;
|
|
13837
13859
|
}
|
|
13838
|
-
if (
|
|
13860
|
+
if (ts46.isElementAccessExpression(parent)) {
|
|
13839
13861
|
return parent.expression === node || parent.argumentExpression === node;
|
|
13840
13862
|
}
|
|
13841
|
-
if (
|
|
13863
|
+
if (ts46.isBinaryExpression(parent)) {
|
|
13842
13864
|
return parent.left === node || parent.right === node;
|
|
13843
13865
|
}
|
|
13844
|
-
if (
|
|
13866
|
+
if (ts46.isForInStatement(parent) || ts46.isForOfStatement(parent)) {
|
|
13845
13867
|
return parent.expression === node || parent.initializer === node;
|
|
13846
13868
|
}
|
|
13847
|
-
if (
|
|
13869
|
+
if (ts46.isForStatement(parent)) {
|
|
13848
13870
|
return parent.condition === node || parent.initializer === node || parent.incrementor === node;
|
|
13849
13871
|
}
|
|
13850
|
-
if (
|
|
13872
|
+
if (ts46.isArrowFunction(parent)) {
|
|
13851
13873
|
return parent.body === node;
|
|
13852
13874
|
}
|
|
13853
|
-
if (
|
|
13875
|
+
if (ts46.isImportSpecifier(parent) || ts46.isExportSpecifier(parent)) {
|
|
13854
13876
|
return (parent.propertyName || parent.name) === node;
|
|
13855
13877
|
}
|
|
13856
|
-
if (
|
|
13878
|
+
if (ts46.isConditionalExpression(parent)) {
|
|
13857
13879
|
return parent.condition === node || parent.whenFalse === node || parent.whenTrue === node;
|
|
13858
13880
|
}
|
|
13859
13881
|
return false;
|
|
@@ -13865,19 +13887,20 @@ var PotentialTopLevelReadsVisitor = class extends o2.RecursiveAstVisitor {
|
|
|
13865
13887
|
function isConstEnumReference(node, reflection) {
|
|
13866
13888
|
var _a;
|
|
13867
13889
|
const parent = node.parent;
|
|
13868
|
-
if (!parent || !
|
|
13890
|
+
if (!parent || !ts46.isPropertyAccessExpression(parent) || parent.expression !== node || !ts46.isIdentifier(parent.name)) {
|
|
13869
13891
|
return false;
|
|
13870
13892
|
}
|
|
13871
13893
|
const declaration = reflection.getDeclarationOfIdentifier(node);
|
|
13872
|
-
return declaration !== null &&
|
|
13894
|
+
return declaration !== null && ts46.isEnumDeclaration(declaration.node) && !!((_a = declaration.node.modifiers) == null ? void 0 : _a.some((m) => m.kind === ts46.SyntaxKind.ConstKeyword));
|
|
13873
13895
|
}
|
|
13874
13896
|
|
|
13875
|
-
// bazel-out/
|
|
13897
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/hmr/src/metadata.mjs
|
|
13898
|
+
import ts47 from "typescript";
|
|
13876
13899
|
function extractHmrMetatadata(clazz, reflection, evaluator, compilerHost, rootDirs, definition, factory, deferBlockMetadata, classMetadata, debugInfo) {
|
|
13877
13900
|
if (!reflection.isClass(clazz)) {
|
|
13878
13901
|
return null;
|
|
13879
13902
|
}
|
|
13880
|
-
const sourceFile = clazz.getSourceFile();
|
|
13903
|
+
const sourceFile = ts47.getOriginalNode(clazz).getSourceFile();
|
|
13881
13904
|
const filePath = getProjectRelativePath(sourceFile.fileName, rootDirs, compilerHost) || compilerHost.getCanonicalFileName(sourceFile.fileName);
|
|
13882
13905
|
const dependencies = extractHmrDependencies(clazz, definition, factory, deferBlockMetadata, classMetadata, debugInfo, reflection, evaluator);
|
|
13883
13906
|
if (dependencies === null) {
|
|
@@ -13893,10 +13916,10 @@ function extractHmrMetatadata(clazz, reflection, evaluator, compilerHost, rootDi
|
|
|
13893
13916
|
return meta;
|
|
13894
13917
|
}
|
|
13895
13918
|
|
|
13896
|
-
// bazel-out/
|
|
13919
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/hmr/src/update_declaration.mjs
|
|
13897
13920
|
import { compileHmrUpdateCallback } from "@angular/compiler";
|
|
13898
|
-
import
|
|
13899
|
-
function getHmrUpdateDeclaration(compilationResults, constantStatements, meta,
|
|
13921
|
+
import ts48 from "typescript";
|
|
13922
|
+
function getHmrUpdateDeclaration(compilationResults, constantStatements, meta, declaration) {
|
|
13900
13923
|
const namespaceSpecifiers = meta.namespaceDependencies.reduce((result, current) => {
|
|
13901
13924
|
result.set(current.moduleName, current.assignedName);
|
|
13902
13925
|
return result;
|
|
@@ -13907,10 +13930,11 @@ function getHmrUpdateDeclaration(compilationResults, constantStatements, meta, s
|
|
|
13907
13930
|
rewriter: importRewriter
|
|
13908
13931
|
});
|
|
13909
13932
|
const callback = compileHmrUpdateCallback(compilationResults, constantStatements, meta);
|
|
13933
|
+
const sourceFile = ts48.getOriginalNode(declaration).getSourceFile();
|
|
13910
13934
|
const node = translateStatement(sourceFile, callback, importManager);
|
|
13911
|
-
return
|
|
13912
|
-
|
|
13913
|
-
|
|
13935
|
+
return ts48.factory.updateFunctionDeclaration(node, [
|
|
13936
|
+
ts48.factory.createToken(ts48.SyntaxKind.ExportKeyword),
|
|
13937
|
+
ts48.factory.createToken(ts48.SyntaxKind.DefaultKeyword)
|
|
13914
13938
|
], node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body);
|
|
13915
13939
|
}
|
|
13916
13940
|
var HmrModuleImportRewriter = class {
|
|
@@ -13929,7 +13953,7 @@ var HmrModuleImportRewriter = class {
|
|
|
13929
13953
|
}
|
|
13930
13954
|
};
|
|
13931
13955
|
|
|
13932
|
-
// bazel-out/
|
|
13956
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
|
|
13933
13957
|
var EMPTY_ARRAY2 = [];
|
|
13934
13958
|
var isUsedDirective = (decl) => decl.kind === R3TemplateDependencyKind.Directive;
|
|
13935
13959
|
var isUsedPipe = (decl) => decl.kind === R3TemplateDependencyKind.Pipe;
|
|
@@ -14135,10 +14159,10 @@ var ComponentDecoratorHandler = class {
|
|
|
14135
14159
|
return {};
|
|
14136
14160
|
}
|
|
14137
14161
|
const { decorator: component, metadata, inputs, outputs, hostDirectives, rawHostDirectives } = directiveResult;
|
|
14138
|
-
const encapsulation = (_a = this.compilationMode !== CompilationMode.LOCAL ? resolveEnumValue(this.evaluator, component, "encapsulation", "ViewEncapsulation") : resolveEncapsulationEnumValueLocally(component.get("encapsulation"))) != null ? _a : ViewEncapsulation2.Emulated;
|
|
14162
|
+
const encapsulation = (_a = this.compilationMode !== CompilationMode.LOCAL ? resolveEnumValue(this.evaluator, component, "encapsulation", "ViewEncapsulation", this.isCore) : resolveEncapsulationEnumValueLocally(component.get("encapsulation"))) != null ? _a : ViewEncapsulation2.Emulated;
|
|
14139
14163
|
let changeDetection = null;
|
|
14140
14164
|
if (this.compilationMode !== CompilationMode.LOCAL) {
|
|
14141
|
-
changeDetection = resolveEnumValue(this.evaluator, component, "changeDetection", "ChangeDetectionStrategy");
|
|
14165
|
+
changeDetection = resolveEnumValue(this.evaluator, component, "changeDetection", "ChangeDetectionStrategy", this.isCore);
|
|
14142
14166
|
} else if (component.has("changeDetection")) {
|
|
14143
14167
|
changeDetection = new o4.WrappedNodeExpr(component.get("changeDetection"));
|
|
14144
14168
|
}
|
|
@@ -14186,7 +14210,7 @@ var ComponentDecoratorHandler = class {
|
|
|
14186
14210
|
} else if (this.compilationMode !== CompilationMode.LOCAL && (rawImports || rawDeferredImports)) {
|
|
14187
14211
|
const importResolvers = combineResolvers([
|
|
14188
14212
|
createModuleWithProvidersResolver(this.reflector, this.isCore),
|
|
14189
|
-
|
|
14213
|
+
createForwardRefResolver(this.isCore)
|
|
14190
14214
|
]);
|
|
14191
14215
|
const importDiagnostics = [];
|
|
14192
14216
|
if (rawImports) {
|
|
@@ -14254,7 +14278,7 @@ var ComponentDecoratorHandler = class {
|
|
|
14254
14278
|
path: absoluteFrom(template.declaration.resolvedTemplateUrl),
|
|
14255
14279
|
expression: template.sourceMapping.node
|
|
14256
14280
|
};
|
|
14257
|
-
const relativeTemplatePath = getProjectRelativePath((_d = templateResource.path) != null ? _d :
|
|
14281
|
+
const relativeTemplatePath = getProjectRelativePath((_d = templateResource.path) != null ? _d : ts49.getOriginalNode(node).getSourceFile().fileName, this.rootDirs, this.compilerHost);
|
|
14258
14282
|
let styles = [];
|
|
14259
14283
|
const externalStyles = [];
|
|
14260
14284
|
const styleResources = extractInlineStyleResources(component);
|
|
@@ -14269,7 +14293,7 @@ var ComponentDecoratorHandler = class {
|
|
|
14269
14293
|
externalStyles.push(resourceUrl);
|
|
14270
14294
|
continue;
|
|
14271
14295
|
}
|
|
14272
|
-
if (styleUrl.source === 2 &&
|
|
14296
|
+
if (styleUrl.source === 2 && ts49.isStringLiteralLike(styleUrl.expression)) {
|
|
14273
14297
|
styleResources.add({
|
|
14274
14298
|
path: absoluteFrom(resourceUrl),
|
|
14275
14299
|
expression: styleUrl.expression
|
|
@@ -14472,7 +14496,7 @@ var ComponentDecoratorHandler = class {
|
|
|
14472
14496
|
}
|
|
14473
14497
|
typeCheck(ctx, node, meta) {
|
|
14474
14498
|
var _a;
|
|
14475
|
-
if (this.typeCheckScopeRegistry === null || !
|
|
14499
|
+
if (this.typeCheckScopeRegistry === null || !ts49.isClassDeclaration(node)) {
|
|
14476
14500
|
return;
|
|
14477
14501
|
}
|
|
14478
14502
|
if (meta.isPoisoned && !this.usePoisonedData) {
|
|
@@ -14483,7 +14507,15 @@ var ComponentDecoratorHandler = class {
|
|
|
14483
14507
|
return;
|
|
14484
14508
|
}
|
|
14485
14509
|
const binder = new R3TargetBinder(scope.matcher);
|
|
14486
|
-
|
|
14510
|
+
const templateContext = {
|
|
14511
|
+
nodes: meta.template.diagNodes,
|
|
14512
|
+
pipes: scope.pipes,
|
|
14513
|
+
sourceMapping: meta.template.sourceMapping,
|
|
14514
|
+
file: meta.template.file,
|
|
14515
|
+
parseErrors: meta.template.errors,
|
|
14516
|
+
preserveWhitespaces: (_a = meta.meta.template.preserveWhitespaces) != null ? _a : false
|
|
14517
|
+
};
|
|
14518
|
+
ctx.addDirective(new Reference(node), binder, scope.schemas, templateContext, meta.meta.isStandalone);
|
|
14487
14519
|
}
|
|
14488
14520
|
extendedTemplateCheck(component, extendedTemplateChecker) {
|
|
14489
14521
|
return extendedTemplateChecker.getDiagnosticsForComponent(component);
|
|
@@ -14863,7 +14895,7 @@ var ComponentDecoratorHandler = class {
|
|
|
14863
14895
|
const debugInfo = analysis.classDebugInfo !== null ? compileClassDebugInfo(analysis.classDebugInfo).toStmt() : null;
|
|
14864
14896
|
const hmrMeta = this.enableHmr ? extractHmrMetatadata(node, this.reflector, this.evaluator, this.compilerHost, this.rootDirs, def, fac, defer, classMetadata, debugInfo) : null;
|
|
14865
14897
|
const res = compileResults(fac, def, classMetadata, "\u0275cmp", null, null, debugInfo, null);
|
|
14866
|
-
return hmrMeta === null || res.length === 0 ? null : getHmrUpdateDeclaration(res, pool.statements, hmrMeta, node
|
|
14898
|
+
return hmrMeta === null || res.length === 0 ? null : getHmrUpdateDeclaration(res, pool.statements, hmrMeta, node);
|
|
14867
14899
|
}
|
|
14868
14900
|
locateDeferBlocksWithoutScope(template) {
|
|
14869
14901
|
const deferBlocks = /* @__PURE__ */ new Map();
|
|
@@ -14898,12 +14930,12 @@ var ComponentDecoratorHandler = class {
|
|
|
14898
14930
|
}
|
|
14899
14931
|
collectExplicitlyDeferredSymbols(rawDeferredImports) {
|
|
14900
14932
|
const deferredTypes = /* @__PURE__ */ new Map();
|
|
14901
|
-
if (!
|
|
14933
|
+
if (!ts49.isArrayLiteralExpression(rawDeferredImports)) {
|
|
14902
14934
|
return deferredTypes;
|
|
14903
14935
|
}
|
|
14904
14936
|
for (const element of rawDeferredImports.elements) {
|
|
14905
14937
|
const node = tryUnwrapForwardRef(element, this.reflector) || element;
|
|
14906
|
-
if (!
|
|
14938
|
+
if (!ts49.isIdentifier(node)) {
|
|
14907
14939
|
continue;
|
|
14908
14940
|
}
|
|
14909
14941
|
const imp = this.reflector.getImportOfIdentifier(node);
|
|
@@ -14970,12 +15002,12 @@ var ComponentDecoratorHandler = class {
|
|
|
14970
15002
|
}
|
|
14971
15003
|
}
|
|
14972
15004
|
registerDeferrableCandidates(componentClassDecl, importsExpr, isDeferredImport, allDeferredDecls, eagerlyUsedDecls, resolutionData) {
|
|
14973
|
-
if (!
|
|
15005
|
+
if (!ts49.isArrayLiteralExpression(importsExpr)) {
|
|
14974
15006
|
return;
|
|
14975
15007
|
}
|
|
14976
15008
|
for (const element of importsExpr.elements) {
|
|
14977
15009
|
const node = tryUnwrapForwardRef(element, this.reflector) || element;
|
|
14978
|
-
if (!
|
|
15010
|
+
if (!ts49.isIdentifier(node)) {
|
|
14979
15011
|
continue;
|
|
14980
15012
|
}
|
|
14981
15013
|
const imp = this.reflector.getImportOfIdentifier(node);
|
|
@@ -15107,9 +15139,9 @@ function isDefaultImport(node) {
|
|
|
15107
15139
|
return node.importClause !== void 0 && node.importClause.namedBindings === void 0;
|
|
15108
15140
|
}
|
|
15109
15141
|
|
|
15110
|
-
// bazel-out/
|
|
15142
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
15111
15143
|
import { compileClassMetadata as compileClassMetadata3, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression3, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr10 } from "@angular/compiler";
|
|
15112
|
-
import
|
|
15144
|
+
import ts50 from "typescript";
|
|
15113
15145
|
var InjectableDecoratorHandler = class {
|
|
15114
15146
|
reflector;
|
|
15115
15147
|
evaluator;
|
|
@@ -15238,7 +15270,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
15238
15270
|
};
|
|
15239
15271
|
} else if (decorator.args.length === 1) {
|
|
15240
15272
|
const metaNode = decorator.args[0];
|
|
15241
|
-
if (!
|
|
15273
|
+
if (!ts50.isObjectLiteralExpression(metaNode)) {
|
|
15242
15274
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, metaNode, `@Injectable argument must be an object literal`);
|
|
15243
15275
|
}
|
|
15244
15276
|
const meta = reflectObjectLiteral(metaNode);
|
|
@@ -15246,7 +15278,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
15246
15278
|
let deps = void 0;
|
|
15247
15279
|
if ((meta.has("useClass") || meta.has("useFactory")) && meta.has("deps")) {
|
|
15248
15280
|
const depsExpr = meta.get("deps");
|
|
15249
|
-
if (!
|
|
15281
|
+
if (!ts50.isArrayLiteralExpression(depsExpr)) {
|
|
15250
15282
|
throw new FatalDiagnosticError(ErrorCode.VALUE_NOT_LITERAL, depsExpr, `@Injectable deps metadata must be an inline array`);
|
|
15251
15283
|
}
|
|
15252
15284
|
deps = depsExpr.elements.map((dep) => getDep(dep, reflector));
|
|
@@ -15331,12 +15363,12 @@ function getDep(dep, reflector) {
|
|
|
15331
15363
|
}
|
|
15332
15364
|
return true;
|
|
15333
15365
|
}
|
|
15334
|
-
if (
|
|
15366
|
+
if (ts50.isArrayLiteralExpression(dep)) {
|
|
15335
15367
|
dep.elements.forEach((el) => {
|
|
15336
15368
|
let isDecorator = false;
|
|
15337
|
-
if (
|
|
15369
|
+
if (ts50.isIdentifier(el)) {
|
|
15338
15370
|
isDecorator = maybeUpdateDecorator(el, reflector);
|
|
15339
|
-
} else if (
|
|
15371
|
+
} else if (ts50.isNewExpression(el) && ts50.isIdentifier(el.expression)) {
|
|
15340
15372
|
const token = el.arguments && el.arguments.length > 0 && el.arguments[0] || void 0;
|
|
15341
15373
|
isDecorator = maybeUpdateDecorator(el.expression, reflector, token);
|
|
15342
15374
|
}
|
|
@@ -15348,9 +15380,9 @@ function getDep(dep, reflector) {
|
|
|
15348
15380
|
return meta;
|
|
15349
15381
|
}
|
|
15350
15382
|
|
|
15351
|
-
// bazel-out/
|
|
15383
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
|
|
15352
15384
|
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5 } from "@angular/compiler";
|
|
15353
|
-
import
|
|
15385
|
+
import ts51 from "typescript";
|
|
15354
15386
|
var PipeSymbol = class extends SemanticSymbol {
|
|
15355
15387
|
name;
|
|
15356
15388
|
constructor(decl, name) {
|
|
@@ -15423,7 +15455,7 @@ var PipeDecoratorHandler = class {
|
|
|
15423
15455
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, decorator.node, "@Pipe must have exactly one argument");
|
|
15424
15456
|
}
|
|
15425
15457
|
const meta = unwrapExpression(decorator.args[0]);
|
|
15426
|
-
if (!
|
|
15458
|
+
if (!ts51.isObjectLiteralExpression(meta)) {
|
|
15427
15459
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@Pipe must have a literal argument");
|
|
15428
15460
|
}
|
|
15429
15461
|
const pipe = reflectObjectLiteral(meta);
|
|
@@ -15526,7 +15558,7 @@ var PipeDecoratorHandler = class {
|
|
|
15526
15558
|
export {
|
|
15527
15559
|
isAngularDecorator,
|
|
15528
15560
|
getAngularDecorators,
|
|
15529
|
-
|
|
15561
|
+
createForwardRefResolver,
|
|
15530
15562
|
MetaKind,
|
|
15531
15563
|
CompoundMetadataReader,
|
|
15532
15564
|
DtsMetadataReader,
|
|
@@ -15596,4 +15628,4 @@ export {
|
|
|
15596
15628
|
* Use of this source code is governed by an MIT-style license that can be
|
|
15597
15629
|
* found in the LICENSE file at https://angular.dev/license
|
|
15598
15630
|
*/
|
|
15599
|
-
//# sourceMappingURL=chunk-
|
|
15631
|
+
//# sourceMappingURL=chunk-YNWO773W.js.map
|