@angular/compiler-cli 17.3.0-rc.0 → 17.3.1
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-WYZJV3LZ.js → chunk-3ESFLGKJ.js} +8 -5
- package/bundles/chunk-3ESFLGKJ.js.map +6 -0
- package/bundles/chunk-E5DF5SRS.js +1 -1
- package/bundles/{chunk-MNT5B5MH.js → chunk-F2QV65AH.js} +2 -2
- package/bundles/{chunk-Q4UHSSKO.js → chunk-OXIOYWLB.js} +2 -2
- package/bundles/{chunk-FH3I22MY.js → chunk-VH6EDOMC.js} +211 -136
- package/bundles/chunk-VH6EDOMC.js.map +6 -0
- package/bundles/{chunk-Q5Y7HH3O.js → chunk-YUMIYLNL.js} +1 -1
- package/bundles/{chunk-Q5Y7HH3O.js.map → chunk-YUMIYLNL.js.map} +1 -1
- package/bundles/index.js +5 -5
- package/bundles/private/migrations.js +2 -2
- package/bundles/private/tooling.js +2 -2
- package/bundles/src/bin/ng_xi18n.js +4 -4
- package/bundles/src/bin/ngc.js +4 -4
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/annotations/component/src/handler.d.ts +2 -0
- package/src/ngtsc/annotations/directive/src/initializer_functions.d.ts +1 -1
- package/src/ngtsc/core/src/compiler.d.ts +1 -7
- package/src/ngtsc/core/src/core_version.d.ts +11 -0
- package/src/ngtsc/transform/src/api.d.ts +2 -0
- package/src/ngtsc/transform/src/compilation.d.ts +1 -2
- package/src/ngtsc/typecheck/api/checker.d.ts +6 -1
- package/src/ngtsc/typecheck/src/checker.d.ts +2 -1
- package/src/ngtsc/typecheck/src/oob.d.ts +1 -3
- package/src/ngtsc/typecheck/src/symbol_util.d.ts +10 -0
- package/src/ngtsc/typecheck/template_semantics/api/api.d.ts +18 -0
- package/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.d.ts +15 -0
- package/bundles/chunk-FH3I22MY.js.map +0 -6
- package/bundles/chunk-WYZJV3LZ.js.map +0 -6
- package/src/ngtsc/typecheck/src/template_semantics.d.ts +0 -21
- /package/bundles/{chunk-MNT5B5MH.js.map → chunk-F2QV65AH.js.map} +0 -0
- /package/bundles/{chunk-Q4UHSSKO.js.map → chunk-OXIOYWLB.js.map} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
PotentialImportKind,
|
|
9
9
|
PotentialImportMode,
|
|
10
10
|
SymbolKind
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YUMIYLNL.js";
|
|
12
12
|
import {
|
|
13
13
|
CompilationMode,
|
|
14
14
|
ComponentDecoratorHandler,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
declarationTransformFactory,
|
|
40
40
|
isHostDirectiveMetaForGlobalMode,
|
|
41
41
|
ivyTransformFactory
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-3ESFLGKJ.js";
|
|
43
43
|
import {
|
|
44
44
|
AbsoluteModuleStrategy,
|
|
45
45
|
AliasStrategy,
|
|
@@ -181,7 +181,7 @@ var MemberTags;
|
|
|
181
181
|
|
|
182
182
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
183
183
|
import { HtmlParser, MessageBundle } from "@angular/compiler";
|
|
184
|
-
import
|
|
184
|
+
import ts40 from "typescript";
|
|
185
185
|
|
|
186
186
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
|
|
187
187
|
import { Xliff, Xliff2, Xmb } from "@angular/compiler";
|
|
@@ -286,7 +286,8 @@ function verifySupportedTypeScriptVersion() {
|
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
289
|
-
import
|
|
289
|
+
import { R3Identifiers as R3Identifiers5 } from "@angular/compiler";
|
|
290
|
+
import ts38 from "typescript";
|
|
290
291
|
|
|
291
292
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
|
|
292
293
|
var CycleAnalyzer = class {
|
|
@@ -3411,8 +3412,8 @@ function constructTypeCtorParameter(env, meta, rawType) {
|
|
|
3411
3412
|
const plainKeys = [];
|
|
3412
3413
|
const coercedKeys = [];
|
|
3413
3414
|
const signalInputKeys = [];
|
|
3414
|
-
for (const { classPropertyName, transform, isSignal
|
|
3415
|
-
if (
|
|
3415
|
+
for (const { classPropertyName, transform, isSignal } of meta.fields.inputs) {
|
|
3416
|
+
if (isSignal) {
|
|
3416
3417
|
signalInputKeys.push(ts23.factory.createLiteralTypeNode(ts23.factory.createStringLiteral(classPropertyName)));
|
|
3417
3418
|
} else if (!meta.coercedInputFields.has(classPropertyName)) {
|
|
3418
3419
|
plainKeys.push(ts23.factory.createLiteralTypeNode(ts23.factory.createStringLiteral(classPropertyName)));
|
|
@@ -3603,21 +3604,6 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
3603
3604
|
}
|
|
3604
3605
|
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_DIRECTIVE_USED_EAGERLY), errorMsg));
|
|
3605
3606
|
}
|
|
3606
|
-
illegalAssignmentToTemplateVar(templateId, assignment, target) {
|
|
3607
|
-
var _a, _b;
|
|
3608
|
-
const mapping = this.resolver.getSourceMapping(templateId);
|
|
3609
|
-
const errorMsg = `Cannot use variable '${assignment.name}' as the left-hand side of an assignment expression. Template variables are read-only.`;
|
|
3610
|
-
const sourceSpan = this.resolver.toParseSourceSpan(templateId, assignment.sourceSpan);
|
|
3611
|
-
if (sourceSpan === null) {
|
|
3612
|
-
throw new Error(`Assertion failure: no SourceLocation found for property binding.`);
|
|
3613
|
-
}
|
|
3614
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMsg, [{
|
|
3615
|
-
text: `The variable ${assignment.name} is declared here.`,
|
|
3616
|
-
start: ((_a = target.valueSpan) == null ? void 0 : _a.start.offset) || target.sourceSpan.start.offset,
|
|
3617
|
-
end: ((_b = target.valueSpan) == null ? void 0 : _b.end.offset) || target.sourceSpan.end.offset,
|
|
3618
|
-
sourceFile: mapping.node.getSourceFile()
|
|
3619
|
-
}]));
|
|
3620
|
-
}
|
|
3621
3607
|
duplicateTemplateVar(templateId, variable, firstDecl) {
|
|
3622
3608
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
3623
3609
|
const errorMsg = `Cannot redeclare variable '${variable.name}' as it was previously declared elsewhere for the same template.`;
|
|
@@ -3769,7 +3755,7 @@ var TypeCheckShimGenerator = class {
|
|
|
3769
3755
|
};
|
|
3770
3756
|
|
|
3771
3757
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
3772
|
-
import { BindingPipe, Call as Call2, createCssSelectorFromNode, CssSelector, DYNAMIC_TYPE, ImplicitReceiver as
|
|
3758
|
+
import { BindingPipe, Call as Call2, createCssSelectorFromNode, CssSelector, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver3, PropertyRead as PropertyRead4, PropertyWrite as PropertyWrite3, R3Identifiers as R3Identifiers3, SafeCall, SafePropertyRead as SafePropertyRead3, SelectorMatcher, ThisReceiver, TmplAstBoundAttribute, TmplAstBoundText, TmplAstDeferredBlock, TmplAstElement as TmplAstElement3, TmplAstForLoopBlock as TmplAstForLoopBlock2, TmplAstIcu, TmplAstIfBlock, TmplAstIfBlockBranch, TmplAstReference as TmplAstReference3, TmplAstSwitchBlock, TmplAstTemplate as TmplAstTemplate2, TmplAstText, TmplAstTextAttribute as TmplAstTextAttribute2, TmplAstVariable, TransplantedType } from "@angular/compiler";
|
|
3773
3759
|
import ts29 from "typescript";
|
|
3774
3760
|
|
|
3775
3761
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.mjs
|
|
@@ -4151,30 +4137,6 @@ var VeSafeLhsInferenceBugDetector = _VeSafeLhsInferenceBugDetector;
|
|
|
4151
4137
|
_VeSafeLhsInferenceBugDetector.SINGLETON = new _VeSafeLhsInferenceBugDetector();
|
|
4152
4138
|
})();
|
|
4153
4139
|
|
|
4154
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_semantics.mjs
|
|
4155
|
-
import { ImplicitReceiver as ImplicitReceiver3, RecursiveAstVisitor as RecursiveAstVisitor2, TmplAstVariable } from "@angular/compiler";
|
|
4156
|
-
var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
|
|
4157
|
-
constructor(templateId, boundTarget, oob) {
|
|
4158
|
-
super();
|
|
4159
|
-
this.templateId = templateId;
|
|
4160
|
-
this.boundTarget = boundTarget;
|
|
4161
|
-
this.oob = oob;
|
|
4162
|
-
}
|
|
4163
|
-
visitPropertyWrite(ast, context) {
|
|
4164
|
-
super.visitPropertyWrite(ast, context);
|
|
4165
|
-
if (!(ast.receiver instanceof ImplicitReceiver3)) {
|
|
4166
|
-
return;
|
|
4167
|
-
}
|
|
4168
|
-
const target = this.boundTarget.getExpressionTarget(ast);
|
|
4169
|
-
if (target instanceof TmplAstVariable) {
|
|
4170
|
-
this.oob.illegalAssignmentToTemplateVar(this.templateId, ast, target);
|
|
4171
|
-
}
|
|
4172
|
-
}
|
|
4173
|
-
static visit(ast, id, boundTarget, oob) {
|
|
4174
|
-
ast.visit(new ExpressionSemanticVisitor(id, boundTarget, oob));
|
|
4175
|
-
}
|
|
4176
|
-
};
|
|
4177
|
-
|
|
4178
4140
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
4179
4141
|
var TcbGenericContextBehavior;
|
|
4180
4142
|
(function(TcbGenericContextBehavior2) {
|
|
@@ -4530,7 +4492,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
4530
4492
|
for (const attr of boundAttrs) {
|
|
4531
4493
|
const expr = widenBinding(translateInput(attr.attribute, this.tcb, this.scope), this.tcb);
|
|
4532
4494
|
let assignment = wrapForDiagnostics(expr);
|
|
4533
|
-
for (const { fieldName, required, transformType, isSignal
|
|
4495
|
+
for (const { fieldName, required, transformType, isSignal, isTwoWayBinding } of attr.inputs) {
|
|
4534
4496
|
let target;
|
|
4535
4497
|
if (required) {
|
|
4536
4498
|
seenRequiredInputs.add(fieldName);
|
|
@@ -4570,7 +4532,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
4570
4532
|
}
|
|
4571
4533
|
target = this.dir.stringLiteralInputFields.has(fieldName) ? ts29.factory.createElementAccessExpression(dirId, ts29.factory.createStringLiteral(fieldName)) : ts29.factory.createPropertyAccessExpression(dirId, ts29.factory.createIdentifier(fieldName));
|
|
4572
4534
|
}
|
|
4573
|
-
if (
|
|
4535
|
+
if (isSignal) {
|
|
4574
4536
|
const inputSignalBrandWriteSymbol = this.tcb.env.referenceExternalSymbol(R3Identifiers3.InputSignalBrandWriteType.moduleName, R3Identifiers3.InputSignalBrandWriteType.name);
|
|
4575
4537
|
if (!ts29.isIdentifier(inputSignalBrandWriteSymbol) && !ts29.isPropertyAccessExpression(inputSignalBrandWriteSymbol)) {
|
|
4576
4538
|
throw new Error(`Expected identifier or property access for reference to ${R3Identifiers3.InputSignalBrandWriteType.name}`);
|
|
@@ -4814,7 +4776,6 @@ var TcbDirectiveOutputsOp = class extends TcbOp {
|
|
|
4814
4776
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
4815
4777
|
this.scope.addStatement(ts29.factory.createExpressionStatement(handler));
|
|
4816
4778
|
}
|
|
4817
|
-
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
4818
4779
|
}
|
|
4819
4780
|
return null;
|
|
4820
4781
|
}
|
|
@@ -4864,7 +4825,6 @@ var TcbUnclaimedOutputsOp = class extends TcbOp {
|
|
|
4864
4825
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
4865
4826
|
this.scope.addStatement(ts29.factory.createExpressionStatement(handler));
|
|
4866
4827
|
}
|
|
4867
|
-
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
4868
4828
|
}
|
|
4869
4829
|
return null;
|
|
4870
4830
|
}
|
|
@@ -5191,7 +5151,7 @@ var _Scope = class {
|
|
|
5191
5151
|
resolveLocal(ref, directive) {
|
|
5192
5152
|
if (ref instanceof TmplAstReference3 && this.referenceOpMap.has(ref)) {
|
|
5193
5153
|
return this.resolveOp(this.referenceOpMap.get(ref));
|
|
5194
|
-
} else if (ref instanceof
|
|
5154
|
+
} else if (ref instanceof TmplAstVariable && this.varMap.has(ref)) {
|
|
5195
5155
|
const opIndexOrNode = this.varMap.get(ref);
|
|
5196
5156
|
return typeof opIndexOrNode === "number" ? this.resolveOp(opIndexOrNode) : opIndexOrNode;
|
|
5197
5157
|
} else if (ref instanceof TmplAstTemplate2 && directive === void 0 && this.templateCtxOpMap.has(ref)) {
|
|
@@ -5464,9 +5424,9 @@ var TcbExpressionTranslator = class {
|
|
|
5464
5424
|
return astToTypescript(ast, (ast2) => this.resolve(ast2), this.tcb.env.config);
|
|
5465
5425
|
}
|
|
5466
5426
|
resolve(ast) {
|
|
5467
|
-
if (ast instanceof PropertyRead4 && ast.receiver instanceof
|
|
5427
|
+
if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver3) {
|
|
5468
5428
|
return this.resolveTarget(ast);
|
|
5469
|
-
} else if (ast instanceof PropertyWrite3 && ast.receiver instanceof
|
|
5429
|
+
} else if (ast instanceof PropertyWrite3 && ast.receiver instanceof ImplicitReceiver3) {
|
|
5470
5430
|
const target = this.resolveTarget(ast);
|
|
5471
5431
|
if (target === null) {
|
|
5472
5432
|
return null;
|
|
@@ -5475,7 +5435,7 @@ var TcbExpressionTranslator = class {
|
|
|
5475
5435
|
const result = ts29.factory.createParenthesizedExpression(ts29.factory.createBinaryExpression(target, ts29.SyntaxKind.EqualsToken, expr));
|
|
5476
5436
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
5477
5437
|
return result;
|
|
5478
|
-
} else if (ast instanceof
|
|
5438
|
+
} else if (ast instanceof ImplicitReceiver3) {
|
|
5479
5439
|
return ts29.factory.createThis();
|
|
5480
5440
|
} else if (ast instanceof BindingPipe) {
|
|
5481
5441
|
const expr = this.translate(ast.exp);
|
|
@@ -5504,7 +5464,7 @@ var TcbExpressionTranslator = class {
|
|
|
5504
5464
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
5505
5465
|
return result;
|
|
5506
5466
|
} else if ((ast instanceof Call2 || ast instanceof SafeCall) && (ast.receiver instanceof PropertyRead4 || ast.receiver instanceof SafePropertyRead3)) {
|
|
5507
|
-
if (ast.receiver.receiver instanceof
|
|
5467
|
+
if (ast.receiver.receiver instanceof ImplicitReceiver3 && !(ast.receiver.receiver instanceof ThisReceiver) && ast.receiver.name === "$any" && ast.args.length === 1) {
|
|
5508
5468
|
const expr = this.translate(ast.args[0]);
|
|
5509
5469
|
const exprAsAny = ts29.factory.createAsExpression(expr, ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
|
|
5510
5470
|
const result = ts29.factory.createParenthesizedExpression(exprAsAny);
|
|
@@ -5669,7 +5629,7 @@ function isSplitTwoWayBinding(inputName, output, inputs, tcb) {
|
|
|
5669
5629
|
}
|
|
5670
5630
|
var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
|
|
5671
5631
|
resolve(ast) {
|
|
5672
|
-
if (ast instanceof PropertyRead4 && ast.receiver instanceof
|
|
5632
|
+
if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver3 && !(ast.receiver instanceof ThisReceiver) && ast.name === EVENT_PARAMETER) {
|
|
5673
5633
|
const event = ts29.factory.createIdentifier(EVENT_PARAMETER);
|
|
5674
5634
|
addParseSpanInfo(event, ast.nameSpan);
|
|
5675
5635
|
return event;
|
|
@@ -5683,7 +5643,7 @@ var TcbForLoopTrackTranslator = class extends TcbExpressionTranslator {
|
|
|
5683
5643
|
this.block = block;
|
|
5684
5644
|
}
|
|
5685
5645
|
resolve(ast) {
|
|
5686
|
-
if (ast instanceof PropertyRead4 && ast.receiver instanceof
|
|
5646
|
+
if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver3) {
|
|
5687
5647
|
const target = this.tcb.boundTarget.getExpressionTarget(ast);
|
|
5688
5648
|
if (target !== null && target !== this.block.item && target !== this.block.contextVariables.$index) {
|
|
5689
5649
|
this.tcb.oobRecorder.illegalForLoopTrackAccess(this.tcb.id, this.block, ast);
|
|
@@ -6066,7 +6026,7 @@ var TemplateSourceManager = class {
|
|
|
6066
6026
|
};
|
|
6067
6027
|
|
|
6068
6028
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_symbol_builder.mjs
|
|
6069
|
-
import { AST, ASTWithSource as ASTWithSource3, BindingPipe as BindingPipe2, PropertyRead as PropertyRead5, PropertyWrite as PropertyWrite4, R3Identifiers as R3Identifiers4, SafePropertyRead as SafePropertyRead4, TmplAstBoundAttribute as TmplAstBoundAttribute2, TmplAstBoundEvent, TmplAstElement as TmplAstElement4, TmplAstReference as TmplAstReference4, TmplAstTemplate as TmplAstTemplate3, TmplAstTextAttribute as TmplAstTextAttribute3, TmplAstVariable as
|
|
6029
|
+
import { AST, ASTWithSource as ASTWithSource3, BindingPipe as BindingPipe2, PropertyRead as PropertyRead5, PropertyWrite as PropertyWrite4, R3Identifiers as R3Identifiers4, SafePropertyRead as SafePropertyRead4, TmplAstBoundAttribute as TmplAstBoundAttribute2, TmplAstBoundEvent, TmplAstElement as TmplAstElement4, TmplAstReference as TmplAstReference4, TmplAstTemplate as TmplAstTemplate3, TmplAstTextAttribute as TmplAstTextAttribute3, TmplAstVariable as TmplAstVariable2 } from "@angular/compiler";
|
|
6070
6030
|
import ts32 from "typescript";
|
|
6071
6031
|
var SymbolBuilder = class {
|
|
6072
6032
|
constructor(tcbPath, tcbIsShim, typeCheckBlock, templateData, componentScopeReader, getTypeChecker) {
|
|
@@ -6091,7 +6051,7 @@ var SymbolBuilder = class {
|
|
|
6091
6051
|
symbol = this.getSymbolOfElement(node);
|
|
6092
6052
|
} else if (node instanceof TmplAstTemplate3) {
|
|
6093
6053
|
symbol = this.getSymbolOfAstTemplate(node);
|
|
6094
|
-
} else if (node instanceof
|
|
6054
|
+
} else if (node instanceof TmplAstVariable2) {
|
|
6095
6055
|
symbol = this.getSymbolOfVariable(node);
|
|
6096
6056
|
} else if (node instanceof TmplAstReference4) {
|
|
6097
6057
|
symbol = this.getSymbolOfReference(node);
|
|
@@ -6794,6 +6754,10 @@ var TemplateTypeCheckerImpl = class {
|
|
|
6794
6754
|
fileData.isComplete = false;
|
|
6795
6755
|
this.isComplete = false;
|
|
6796
6756
|
}
|
|
6757
|
+
getExpressionTarget(expression, clazz) {
|
|
6758
|
+
var _a;
|
|
6759
|
+
return ((_a = this.getLatestComponentState(clazz).data) == null ? void 0 : _a.boundTarget.getExpressionTarget(expression)) || null;
|
|
6760
|
+
}
|
|
6797
6761
|
makeTemplateDiagnostic(clazz, sourceSpan, category, errorCode, message, relatedInformation) {
|
|
6798
6762
|
const sfPath = absoluteFromSourceFile(clazz.getSourceFile());
|
|
6799
6763
|
const fileRecord = this.state.get(sfPath);
|
|
@@ -7282,17 +7246,36 @@ var SingleShimTypeCheckingHost = class extends SingleFileTypeCheckingHost {
|
|
|
7282
7246
|
|
|
7283
7247
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.mjs
|
|
7284
7248
|
import { Interpolation, PropertyRead as PropertyRead6 } from "@angular/compiler";
|
|
7249
|
+
|
|
7250
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/symbol_util.mjs
|
|
7285
7251
|
import ts33 from "typescript";
|
|
7252
|
+
var SIGNAL_FNS = /* @__PURE__ */ new Set([
|
|
7253
|
+
"WritableSignal",
|
|
7254
|
+
"Signal",
|
|
7255
|
+
"InputSignal",
|
|
7256
|
+
"InputSignalWithTransform",
|
|
7257
|
+
"ModelSignal"
|
|
7258
|
+
]);
|
|
7259
|
+
function isSignalReference(symbol) {
|
|
7260
|
+
return (symbol.kind === SymbolKind.Expression || symbol.kind === SymbolKind.Variable) && (symbol.tsType.symbol !== void 0 && isSignalSymbol(symbol.tsType.symbol) || symbol.tsType.aliasSymbol !== void 0 && isSignalSymbol(symbol.tsType.aliasSymbol));
|
|
7261
|
+
}
|
|
7262
|
+
function isSignalSymbol(symbol) {
|
|
7263
|
+
const declarations = symbol.getDeclarations();
|
|
7264
|
+
return declarations !== void 0 && declarations.some((decl) => {
|
|
7265
|
+
const fileName = decl.getSourceFile().fileName;
|
|
7266
|
+
return (ts33.isInterfaceDeclaration(decl) || ts33.isTypeAliasDeclaration(decl)) && SIGNAL_FNS.has(decl.name.text) && (fileName.includes("@angular/core") || fileName.includes("angular2/rc/packages/core"));
|
|
7267
|
+
});
|
|
7268
|
+
}
|
|
7286
7269
|
|
|
7287
7270
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/api/api.mjs
|
|
7288
|
-
import { ASTWithSource as ASTWithSource4, RecursiveAstVisitor as
|
|
7271
|
+
import { ASTWithSource as ASTWithSource4, RecursiveAstVisitor as RecursiveAstVisitor2, TmplAstBoundDeferredTrigger as TmplAstBoundDeferredTrigger2 } from "@angular/compiler";
|
|
7289
7272
|
var TemplateCheckWithVisitor = class {
|
|
7290
7273
|
run(ctx, component, template) {
|
|
7291
7274
|
const visitor = new TemplateVisitor2(ctx, component, this);
|
|
7292
7275
|
return visitor.getDiagnostics(template);
|
|
7293
7276
|
}
|
|
7294
7277
|
};
|
|
7295
|
-
var TemplateVisitor2 = class extends
|
|
7278
|
+
var TemplateVisitor2 = class extends RecursiveAstVisitor2 {
|
|
7296
7279
|
constructor(ctx, component, check) {
|
|
7297
7280
|
super();
|
|
7298
7281
|
this.ctx = ctx;
|
|
@@ -7409,13 +7392,6 @@ var TemplateVisitor2 = class extends RecursiveAstVisitor3 {
|
|
|
7409
7392
|
};
|
|
7410
7393
|
|
|
7411
7394
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.mjs
|
|
7412
|
-
var SIGNAL_FNS = /* @__PURE__ */ new Set([
|
|
7413
|
-
"WritableSignal",
|
|
7414
|
-
"Signal",
|
|
7415
|
-
"InputSignal",
|
|
7416
|
-
"InputSignalWithTransform",
|
|
7417
|
-
"ModelSignal"
|
|
7418
|
-
]);
|
|
7419
7395
|
var SIGNAL_INSTANCE_PROPERTIES = /* @__PURE__ */ new Set(["set", "update", "asReadonly"]);
|
|
7420
7396
|
var FUNCTION_INSTANCE_PROPERTIES = /* @__PURE__ */ new Set(["name", "length", "prototype"]);
|
|
7421
7397
|
var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
|
|
@@ -7430,13 +7406,6 @@ var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
|
|
|
7430
7406
|
return [];
|
|
7431
7407
|
}
|
|
7432
7408
|
};
|
|
7433
|
-
function isSignal(symbol) {
|
|
7434
|
-
const declarations = symbol == null ? void 0 : symbol.getDeclarations();
|
|
7435
|
-
return declarations !== void 0 && declarations.some((decl) => {
|
|
7436
|
-
const fileName = decl.getSourceFile().fileName;
|
|
7437
|
-
return (ts33.isInterfaceDeclaration(decl) || ts33.isTypeAliasDeclaration(decl)) && SIGNAL_FNS.has(decl.name.text) && (fileName.includes("@angular/core") || fileName.includes("angular2/rc/packages/core"));
|
|
7438
|
-
});
|
|
7439
|
-
}
|
|
7440
7409
|
function isFunctionInstanceProperty(name) {
|
|
7441
7410
|
return FUNCTION_INSTANCE_PROPERTIES.has(name);
|
|
7442
7411
|
}
|
|
@@ -7445,14 +7414,14 @@ function isSignalInstanceProperty(name) {
|
|
|
7445
7414
|
}
|
|
7446
7415
|
function buildDiagnosticForSignal(ctx, node, component) {
|
|
7447
7416
|
const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
|
|
7448
|
-
if (
|
|
7417
|
+
if (symbol !== null && symbol.kind === SymbolKind.Expression && isSignalReference(symbol)) {
|
|
7449
7418
|
const templateMapping = ctx.templateTypeChecker.getTemplateMappingAtTcbLocation(symbol.tcbLocation);
|
|
7450
7419
|
const errorString = `${node.name} is a function and should be invoked: ${node.name}()`;
|
|
7451
7420
|
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
|
|
7452
7421
|
return [diagnostic];
|
|
7453
7422
|
}
|
|
7454
7423
|
const symbolOfReceiver = ctx.templateTypeChecker.getSymbolOfNode(node.receiver, component);
|
|
7455
|
-
if ((isFunctionInstanceProperty(node.name) || isSignalInstanceProperty(node.name)) &&
|
|
7424
|
+
if ((isFunctionInstanceProperty(node.name) || isSignalInstanceProperty(node.name)) && symbolOfReceiver !== null && symbolOfReceiver.kind === SymbolKind.Expression && isSignalReference(symbolOfReceiver)) {
|
|
7456
7425
|
const templateMapping = ctx.templateTypeChecker.getTemplateMappingAtTcbLocation(symbolOfReceiver.tcbLocation);
|
|
7457
7426
|
const errorString = `${node.receiver.name} is a function and should be invoked: ${node.receiver.name}()`;
|
|
7458
7427
|
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
|
|
@@ -7804,6 +7773,107 @@ var SUPPORTED_DIAGNOSTIC_NAMES = /* @__PURE__ */ new Set([
|
|
|
7804
7773
|
...ALL_DIAGNOSTIC_FACTORIES.map((factory9) => factory9.name)
|
|
7805
7774
|
]);
|
|
7806
7775
|
|
|
7776
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.mjs
|
|
7777
|
+
import { ASTWithSource as ASTWithSource5, ImplicitReceiver as ImplicitReceiver4, RecursiveAstVisitor as RecursiveAstVisitor3, TmplAstBoundEvent as TmplAstBoundEvent3, TmplAstRecursiveVisitor as TmplAstRecursiveVisitor2, TmplAstVariable as TmplAstVariable3 } from "@angular/compiler";
|
|
7778
|
+
import ts37 from "typescript";
|
|
7779
|
+
var TemplateSemanticsCheckerImpl = class {
|
|
7780
|
+
constructor(templateTypeChecker) {
|
|
7781
|
+
this.templateTypeChecker = templateTypeChecker;
|
|
7782
|
+
}
|
|
7783
|
+
getDiagnosticsForComponent(component) {
|
|
7784
|
+
const template = this.templateTypeChecker.getTemplate(component);
|
|
7785
|
+
return template !== null ? TemplateSemanticsVisitor.visit(template, component, this.templateTypeChecker) : [];
|
|
7786
|
+
}
|
|
7787
|
+
};
|
|
7788
|
+
var TemplateSemanticsVisitor = class extends TmplAstRecursiveVisitor2 {
|
|
7789
|
+
constructor(expressionVisitor) {
|
|
7790
|
+
super();
|
|
7791
|
+
this.expressionVisitor = expressionVisitor;
|
|
7792
|
+
}
|
|
7793
|
+
static visit(nodes, component, templateTypeChecker) {
|
|
7794
|
+
const diagnostics = [];
|
|
7795
|
+
const expressionVisitor = new ExpressionsSemanticsVisitor(templateTypeChecker, component, diagnostics);
|
|
7796
|
+
const templateVisitor = new TemplateSemanticsVisitor(expressionVisitor);
|
|
7797
|
+
nodes.forEach((node) => node.visit(templateVisitor));
|
|
7798
|
+
return diagnostics;
|
|
7799
|
+
}
|
|
7800
|
+
visitBoundEvent(event) {
|
|
7801
|
+
super.visitBoundEvent(event);
|
|
7802
|
+
event.handler.visit(this.expressionVisitor, event);
|
|
7803
|
+
}
|
|
7804
|
+
};
|
|
7805
|
+
var ExpressionsSemanticsVisitor = class extends RecursiveAstVisitor3 {
|
|
7806
|
+
constructor(templateTypeChecker, component, diagnostics) {
|
|
7807
|
+
super();
|
|
7808
|
+
this.templateTypeChecker = templateTypeChecker;
|
|
7809
|
+
this.component = component;
|
|
7810
|
+
this.diagnostics = diagnostics;
|
|
7811
|
+
}
|
|
7812
|
+
visitPropertyWrite(ast, context) {
|
|
7813
|
+
super.visitPropertyWrite(ast, context);
|
|
7814
|
+
this.checkForIllegalWriteInEventBinding(ast, context);
|
|
7815
|
+
}
|
|
7816
|
+
visitPropertyRead(ast, context) {
|
|
7817
|
+
super.visitPropertyRead(ast, context);
|
|
7818
|
+
this.checkForIllegalWriteInTwoWayBinding(ast, context);
|
|
7819
|
+
}
|
|
7820
|
+
checkForIllegalWriteInEventBinding(ast, context) {
|
|
7821
|
+
if (!(context instanceof TmplAstBoundEvent3) || !(ast.receiver instanceof ImplicitReceiver4)) {
|
|
7822
|
+
return;
|
|
7823
|
+
}
|
|
7824
|
+
const target = this.templateTypeChecker.getExpressionTarget(ast, this.component);
|
|
7825
|
+
if (target instanceof TmplAstVariable3) {
|
|
7826
|
+
const errorMessage = `Cannot use variable '${target.name}' as the left-hand side of an assignment expression. Template variables are read-only.`;
|
|
7827
|
+
this.diagnostics.push(this.makeIllegalTemplateVarDiagnostic(target, context, errorMessage));
|
|
7828
|
+
}
|
|
7829
|
+
}
|
|
7830
|
+
checkForIllegalWriteInTwoWayBinding(ast, context) {
|
|
7831
|
+
if (!(context instanceof TmplAstBoundEvent3) || context.type !== 2 || !(ast.receiver instanceof ImplicitReceiver4) || ast !== unwrapAstWithSource(context.handler)) {
|
|
7832
|
+
return;
|
|
7833
|
+
}
|
|
7834
|
+
const target = this.templateTypeChecker.getExpressionTarget(ast, this.component);
|
|
7835
|
+
if (!(target instanceof TmplAstVariable3)) {
|
|
7836
|
+
return;
|
|
7837
|
+
}
|
|
7838
|
+
const symbol = this.templateTypeChecker.getSymbolOfNode(target, this.component);
|
|
7839
|
+
if (symbol !== null && !isSignalReference(symbol)) {
|
|
7840
|
+
const errorMessage = `Cannot use a non-signal variable '${target.name}' in a two-way binding expression. Template variables are read-only.`;
|
|
7841
|
+
this.diagnostics.push(this.makeIllegalTemplateVarDiagnostic(target, context, errorMessage));
|
|
7842
|
+
}
|
|
7843
|
+
}
|
|
7844
|
+
makeIllegalTemplateVarDiagnostic(target, expressionNode, errorMessage) {
|
|
7845
|
+
var _a, _b;
|
|
7846
|
+
return this.templateTypeChecker.makeTemplateDiagnostic(this.component, expressionNode.handlerSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMessage, [{
|
|
7847
|
+
text: `The variable ${target.name} is declared here.`,
|
|
7848
|
+
start: ((_a = target.valueSpan) == null ? void 0 : _a.start.offset) || target.sourceSpan.start.offset,
|
|
7849
|
+
end: ((_b = target.valueSpan) == null ? void 0 : _b.end.offset) || target.sourceSpan.end.offset,
|
|
7850
|
+
sourceFile: this.component.getSourceFile()
|
|
7851
|
+
}]);
|
|
7852
|
+
}
|
|
7853
|
+
};
|
|
7854
|
+
function unwrapAstWithSource(ast) {
|
|
7855
|
+
return ast instanceof ASTWithSource5 ? ast.ast : ast;
|
|
7856
|
+
}
|
|
7857
|
+
|
|
7858
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/core_version.mjs
|
|
7859
|
+
function coreHasSymbol(program, symbol) {
|
|
7860
|
+
const checker = program.getTypeChecker();
|
|
7861
|
+
for (const sf of program.getSourceFiles().filter(isMaybeCore)) {
|
|
7862
|
+
const sym = checker.getSymbolAtLocation(sf);
|
|
7863
|
+
if (sym === void 0 || sym.exports === void 0) {
|
|
7864
|
+
continue;
|
|
7865
|
+
}
|
|
7866
|
+
if (!sym.exports.has("\u0275\u0275template")) {
|
|
7867
|
+
continue;
|
|
7868
|
+
}
|
|
7869
|
+
return sym.exports.has(symbol.name);
|
|
7870
|
+
}
|
|
7871
|
+
return null;
|
|
7872
|
+
}
|
|
7873
|
+
function isMaybeCore(sf) {
|
|
7874
|
+
return sf.isDeclarationFile && sf.fileName.includes("@angular/core") && sf.fileName.endsWith("index.d.ts");
|
|
7875
|
+
}
|
|
7876
|
+
|
|
7807
7877
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/feature_detection.mjs
|
|
7808
7878
|
import semver from "semver";
|
|
7809
7879
|
function coreVersionSupportsFeature(coreVersion, minVersion) {
|
|
@@ -7906,7 +7976,7 @@ var NgCompiler = class {
|
|
|
7906
7976
|
this.currentProgram = inputProgram;
|
|
7907
7977
|
this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
|
|
7908
7978
|
this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
|
|
7909
|
-
const moduleResolutionCache =
|
|
7979
|
+
const moduleResolutionCache = ts38.createModuleResolutionCache(
|
|
7910
7980
|
this.adapter.getCurrentDirectory(),
|
|
7911
7981
|
this.adapter.getCanonicalFileName.bind(this.adapter)
|
|
7912
7982
|
);
|
|
@@ -7950,7 +8020,7 @@ var NgCompiler = class {
|
|
|
7950
8020
|
}
|
|
7951
8021
|
for (const clazz of classesToUpdate) {
|
|
7952
8022
|
this.compilation.traitCompiler.updateResources(clazz);
|
|
7953
|
-
if (!
|
|
8023
|
+
if (!ts38.isClassDeclaration(clazz)) {
|
|
7954
8024
|
continue;
|
|
7955
8025
|
}
|
|
7956
8026
|
this.compilation.templateTypeChecker.invalidateClass(clazz);
|
|
@@ -7966,10 +8036,7 @@ var NgCompiler = class {
|
|
|
7966
8036
|
...this.getNonTemplateDiagnostics()
|
|
7967
8037
|
];
|
|
7968
8038
|
try {
|
|
7969
|
-
diagnostics.push(...this.getTemplateDiagnostics());
|
|
7970
|
-
if (this.options.strictTemplates) {
|
|
7971
|
-
diagnostics.push(...this.getExtendedTemplateDiagnostics());
|
|
7972
|
-
}
|
|
8039
|
+
diagnostics.push(...this.getTemplateDiagnostics(), ...this.runAdditionalChecks());
|
|
7973
8040
|
} catch (err) {
|
|
7974
8041
|
if (!isFatalDiagnosticError(err)) {
|
|
7975
8042
|
throw err;
|
|
@@ -7981,10 +8048,7 @@ var NgCompiler = class {
|
|
|
7981
8048
|
getDiagnosticsForFile(file, optimizeFor) {
|
|
7982
8049
|
const diagnostics = [...this.getNonTemplateDiagnostics().filter((diag) => diag.file === file)];
|
|
7983
8050
|
try {
|
|
7984
|
-
diagnostics.push(...this.getTemplateDiagnosticsForFile(file, optimizeFor));
|
|
7985
|
-
if (this.options.strictTemplates) {
|
|
7986
|
-
diagnostics.push(...this.getExtendedTemplateDiagnostics(file));
|
|
7987
|
-
}
|
|
8051
|
+
diagnostics.push(...this.getTemplateDiagnosticsForFile(file, optimizeFor), ...this.runAdditionalChecks(file));
|
|
7988
8052
|
} catch (err) {
|
|
7989
8053
|
if (!isFatalDiagnosticError(err)) {
|
|
7990
8054
|
throw err;
|
|
@@ -7999,8 +8063,11 @@ var NgCompiler = class {
|
|
|
7999
8063
|
const diagnostics = [];
|
|
8000
8064
|
try {
|
|
8001
8065
|
diagnostics.push(...ttc.getDiagnosticsForComponent(component));
|
|
8002
|
-
const extendedTemplateChecker = compilation
|
|
8003
|
-
if (
|
|
8066
|
+
const { extendedTemplateChecker, templateSemanticsChecker } = compilation;
|
|
8067
|
+
if (templateSemanticsChecker !== null) {
|
|
8068
|
+
diagnostics.push(...templateSemanticsChecker.getDiagnosticsForComponent(component));
|
|
8069
|
+
}
|
|
8070
|
+
if (this.options.strictTemplates && extendedTemplateChecker !== null) {
|
|
8004
8071
|
diagnostics.push(...extendedTemplateChecker.getDiagnosticsForComponent(component));
|
|
8005
8072
|
}
|
|
8006
8073
|
} catch (err) {
|
|
@@ -8165,10 +8232,10 @@ var NgCompiler = class {
|
|
|
8165
8232
|
return strictTemplates || !!this.options.fullTemplateTypeCheck;
|
|
8166
8233
|
}
|
|
8167
8234
|
getTypeCheckingConfig() {
|
|
8168
|
-
var _a, _b, _c, _d;
|
|
8235
|
+
var _a, _b, _c, _d, _e;
|
|
8169
8236
|
const strictTemplates = !!this.options.strictTemplates;
|
|
8170
8237
|
const useInlineTypeConstructors = this.programDriver.supportsInlineOperations;
|
|
8171
|
-
|
|
8238
|
+
let allowSignalsInTwoWayBindings = (_a = coreHasSymbol(this.inputProgram, R3Identifiers5.unwrapWritableSignal)) != null ? _a : this.angularCoreVersion === null || coreVersionSupportsFeature(this.angularCoreVersion, ">= 17.2.0-0");
|
|
8172
8239
|
let typeCheckingConfig;
|
|
8173
8240
|
if (this.fullTemplateTypeCheck) {
|
|
8174
8241
|
typeCheckingConfig = {
|
|
@@ -8193,7 +8260,7 @@ var NgCompiler = class {
|
|
|
8193
8260
|
enableTemplateTypeChecker: this.enableTemplateTypeChecker,
|
|
8194
8261
|
useInlineTypeConstructors,
|
|
8195
8262
|
suggestionsForSuboptimalTypeInference: this.enableTemplateTypeChecker && !strictTemplates,
|
|
8196
|
-
controlFlowPreventingContentProjection: ((
|
|
8263
|
+
controlFlowPreventingContentProjection: ((_b = this.options.extendedDiagnostics) == null ? void 0 : _b.defaultCategory) || DiagnosticCategoryLabel.Warning,
|
|
8197
8264
|
allowSignalsInTwoWayBindings
|
|
8198
8265
|
};
|
|
8199
8266
|
} else {
|
|
@@ -8219,7 +8286,7 @@ var NgCompiler = class {
|
|
|
8219
8286
|
enableTemplateTypeChecker: this.enableTemplateTypeChecker,
|
|
8220
8287
|
useInlineTypeConstructors,
|
|
8221
8288
|
suggestionsForSuboptimalTypeInference: false,
|
|
8222
|
-
controlFlowPreventingContentProjection: ((
|
|
8289
|
+
controlFlowPreventingContentProjection: ((_c = this.options.extendedDiagnostics) == null ? void 0 : _c.defaultCategory) || DiagnosticCategoryLabel.Warning,
|
|
8223
8290
|
allowSignalsInTwoWayBindings
|
|
8224
8291
|
};
|
|
8225
8292
|
}
|
|
@@ -8255,7 +8322,7 @@ var NgCompiler = class {
|
|
|
8255
8322
|
if (this.options.strictLiteralTypes !== void 0) {
|
|
8256
8323
|
typeCheckingConfig.strictLiteralTypes = this.options.strictLiteralTypes;
|
|
8257
8324
|
}
|
|
8258
|
-
if (((
|
|
8325
|
+
if (((_e = (_d = this.options.extendedDiagnostics) == null ? void 0 : _d.checks) == null ? void 0 : _e.controlFlowPreventingContentProjection) !== void 0) {
|
|
8259
8326
|
typeCheckingConfig.controlFlowPreventingContentProjection = this.options.extendedDiagnostics.checks.controlFlowPreventingContentProjection;
|
|
8260
8327
|
}
|
|
8261
8328
|
return typeCheckingConfig;
|
|
@@ -8295,18 +8362,24 @@ var NgCompiler = class {
|
|
|
8295
8362
|
}
|
|
8296
8363
|
return this.nonTemplateDiagnostics;
|
|
8297
8364
|
}
|
|
8298
|
-
|
|
8365
|
+
runAdditionalChecks(sf) {
|
|
8299
8366
|
const diagnostics = [];
|
|
8300
8367
|
const compilation = this.ensureAnalyzed();
|
|
8301
|
-
const extendedTemplateChecker = compilation
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8368
|
+
const { extendedTemplateChecker, templateSemanticsChecker } = compilation;
|
|
8369
|
+
const files = sf ? [sf] : this.inputProgram.getSourceFiles();
|
|
8370
|
+
for (const sf2 of files) {
|
|
8371
|
+
if (templateSemanticsChecker !== null) {
|
|
8372
|
+
diagnostics.push(...compilation.traitCompiler.runAdditionalChecks(sf2, (clazz, handler) => {
|
|
8373
|
+
var _a;
|
|
8374
|
+
return ((_a = handler.templateSemanticsCheck) == null ? void 0 : _a.call(handler, clazz, templateSemanticsChecker)) || null;
|
|
8375
|
+
}));
|
|
8376
|
+
}
|
|
8377
|
+
if (this.options.strictTemplates && extendedTemplateChecker !== null) {
|
|
8378
|
+
diagnostics.push(...compilation.traitCompiler.runAdditionalChecks(sf2, (clazz, handler) => {
|
|
8379
|
+
var _a;
|
|
8380
|
+
return ((_a = handler.extendedTemplateCheck) == null ? void 0 : _a.call(handler, clazz, extendedTemplateChecker)) || null;
|
|
8381
|
+
}));
|
|
8382
|
+
}
|
|
8310
8383
|
}
|
|
8311
8384
|
return diagnostics;
|
|
8312
8385
|
}
|
|
@@ -8415,6 +8488,7 @@ var NgCompiler = class {
|
|
|
8415
8488
|
});
|
|
8416
8489
|
const templateTypeChecker = new TemplateTypeCheckerImpl(this.inputProgram, notifyingDriver, traitCompiler, this.getTypeCheckingConfig(), refEmitter, reflector, this.adapter, this.incrementalCompilation, metaReader, localMetaReader, ngModuleIndex, scopeReader, typeCheckScopeRegistry, this.delegatingPerfRecorder);
|
|
8417
8490
|
const extendedTemplateChecker = this.constructionDiagnostics.length === 0 ? new ExtendedTemplateCheckerImpl(templateTypeChecker, checker, ALL_DIAGNOSTIC_FACTORIES, this.options) : null;
|
|
8491
|
+
const templateSemanticsChecker = this.constructionDiagnostics.length === 0 ? new TemplateSemanticsCheckerImpl(templateTypeChecker) : null;
|
|
8418
8492
|
return {
|
|
8419
8493
|
isCore,
|
|
8420
8494
|
traitCompiler,
|
|
@@ -8429,7 +8503,8 @@ var NgCompiler = class {
|
|
|
8429
8503
|
templateTypeChecker,
|
|
8430
8504
|
resourceRegistry,
|
|
8431
8505
|
extendedTemplateChecker,
|
|
8432
|
-
localCompilationExtraImportsTracker
|
|
8506
|
+
localCompilationExtraImportsTracker,
|
|
8507
|
+
templateSemanticsChecker
|
|
8433
8508
|
};
|
|
8434
8509
|
}
|
|
8435
8510
|
};
|
|
@@ -8439,18 +8514,18 @@ function isAngularCorePackage(program) {
|
|
|
8439
8514
|
return false;
|
|
8440
8515
|
}
|
|
8441
8516
|
return r3Symbols.statements.some((stmt) => {
|
|
8442
|
-
if (!
|
|
8517
|
+
if (!ts38.isVariableStatement(stmt)) {
|
|
8443
8518
|
return false;
|
|
8444
8519
|
}
|
|
8445
|
-
const modifiers =
|
|
8446
|
-
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind ===
|
|
8520
|
+
const modifiers = ts38.getModifiers(stmt);
|
|
8521
|
+
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind === ts38.SyntaxKind.ExportKeyword)) {
|
|
8447
8522
|
return false;
|
|
8448
8523
|
}
|
|
8449
8524
|
return stmt.declarationList.declarations.some((decl) => {
|
|
8450
|
-
if (!
|
|
8525
|
+
if (!ts38.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
|
|
8451
8526
|
return false;
|
|
8452
8527
|
}
|
|
8453
|
-
if (decl.initializer === void 0 || decl.initializer.kind !==
|
|
8528
|
+
if (decl.initializer === void 0 || decl.initializer.kind !== ts38.SyntaxKind.TrueKeyword) {
|
|
8454
8529
|
return false;
|
|
8455
8530
|
}
|
|
8456
8531
|
return true;
|
|
@@ -8464,7 +8539,7 @@ function* verifyCompatibleTypeCheckOptions(options) {
|
|
|
8464
8539
|
var _a, _b, _c;
|
|
8465
8540
|
if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
|
|
8466
8541
|
yield makeConfigDiagnostic({
|
|
8467
|
-
category:
|
|
8542
|
+
category: ts38.DiagnosticCategory.Error,
|
|
8468
8543
|
code: ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK,
|
|
8469
8544
|
messageText: `
|
|
8470
8545
|
Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
|
|
@@ -8483,7 +8558,7 @@ https://angular.io/guide/template-typecheck
|
|
|
8483
8558
|
}
|
|
8484
8559
|
if (options.extendedDiagnostics && options.strictTemplates === false) {
|
|
8485
8560
|
yield makeConfigDiagnostic({
|
|
8486
|
-
category:
|
|
8561
|
+
category: ts38.DiagnosticCategory.Error,
|
|
8487
8562
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES,
|
|
8488
8563
|
messageText: `
|
|
8489
8564
|
Angular compiler option "extendedDiagnostics" is configured, however "strictTemplates" is disabled.
|
|
@@ -8500,7 +8575,7 @@ One of the following actions is required:
|
|
|
8500
8575
|
const defaultCategory = (_a = options.extendedDiagnostics) == null ? void 0 : _a.defaultCategory;
|
|
8501
8576
|
if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
|
|
8502
8577
|
yield makeConfigDiagnostic({
|
|
8503
|
-
category:
|
|
8578
|
+
category: ts38.DiagnosticCategory.Error,
|
|
8504
8579
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
8505
8580
|
messageText: `
|
|
8506
8581
|
Angular compiler option "extendedDiagnostics.defaultCategory" has an unknown diagnostic category: "${defaultCategory}".
|
|
@@ -8513,7 +8588,7 @@ ${allowedCategoryLabels.join("\n")}
|
|
|
8513
8588
|
for (const [checkName, category] of Object.entries((_c = (_b = options.extendedDiagnostics) == null ? void 0 : _b.checks) != null ? _c : {})) {
|
|
8514
8589
|
if (!SUPPORTED_DIAGNOSTIC_NAMES.has(checkName)) {
|
|
8515
8590
|
yield makeConfigDiagnostic({
|
|
8516
|
-
category:
|
|
8591
|
+
category: ts38.DiagnosticCategory.Error,
|
|
8517
8592
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK,
|
|
8518
8593
|
messageText: `
|
|
8519
8594
|
Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${checkName}".
|
|
@@ -8525,7 +8600,7 @@ ${Array.from(SUPPORTED_DIAGNOSTIC_NAMES).join("\n")}
|
|
|
8525
8600
|
}
|
|
8526
8601
|
if (!allowedCategoryLabels.includes(category)) {
|
|
8527
8602
|
yield makeConfigDiagnostic({
|
|
8528
|
-
category:
|
|
8603
|
+
category: ts38.DiagnosticCategory.Error,
|
|
8529
8604
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
8530
8605
|
messageText: `
|
|
8531
8606
|
Angular compiler option "extendedDiagnostics.checks['${checkName}']" has an unknown diagnostic category: "${category}".
|
|
@@ -8555,7 +8630,7 @@ var ReferenceGraphAdapter = class {
|
|
|
8555
8630
|
for (const { node } of references) {
|
|
8556
8631
|
let sourceFile = node.getSourceFile();
|
|
8557
8632
|
if (sourceFile === void 0) {
|
|
8558
|
-
sourceFile =
|
|
8633
|
+
sourceFile = ts38.getOriginalNode(node).getSourceFile();
|
|
8559
8634
|
}
|
|
8560
8635
|
if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
|
|
8561
8636
|
this.graph.add(source, node);
|
|
@@ -8594,7 +8669,7 @@ function versionMapFromProgram(program, driver) {
|
|
|
8594
8669
|
}
|
|
8595
8670
|
|
|
8596
8671
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
|
|
8597
|
-
import
|
|
8672
|
+
import ts39 from "typescript";
|
|
8598
8673
|
var DelegatingCompilerHost2 = class {
|
|
8599
8674
|
get jsDocParsingMode() {
|
|
8600
8675
|
return this.delegate.jsDocParsingMode;
|
|
@@ -8679,7 +8754,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
8679
8754
|
entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
|
|
8680
8755
|
if (entryPoint === null) {
|
|
8681
8756
|
diagnostics.push({
|
|
8682
|
-
category:
|
|
8757
|
+
category: ts39.DiagnosticCategory.Error,
|
|
8683
8758
|
code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
|
|
8684
8759
|
file: void 0,
|
|
8685
8760
|
start: void 0,
|
|
@@ -8722,10 +8797,10 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
8722
8797
|
return this.fileNameToModuleName !== void 0 ? this : null;
|
|
8723
8798
|
}
|
|
8724
8799
|
createCachedResolveModuleNamesFunction() {
|
|
8725
|
-
const moduleResolutionCache =
|
|
8800
|
+
const moduleResolutionCache = ts39.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
|
|
8726
8801
|
return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
|
|
8727
8802
|
return moduleNames.map((moduleName) => {
|
|
8728
|
-
const module =
|
|
8803
|
+
const module = ts39.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
|
|
8729
8804
|
return module.resolvedModule;
|
|
8730
8805
|
});
|
|
8731
8806
|
};
|
|
@@ -8749,7 +8824,7 @@ var NgtscProgram = class {
|
|
|
8749
8824
|
if (reuseProgram !== void 0) {
|
|
8750
8825
|
retagAllTsFiles(reuseProgram);
|
|
8751
8826
|
}
|
|
8752
|
-
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () =>
|
|
8827
|
+
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts40.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
|
|
8753
8828
|
perfRecorder.phase(PerfPhase.Unaccounted);
|
|
8754
8829
|
perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
|
|
8755
8830
|
this.host.postProgramCreationCleanup();
|
|
@@ -8965,16 +9040,16 @@ function createProgram({ rootNames, options, host, oldProgram }) {
|
|
|
8965
9040
|
}
|
|
8966
9041
|
|
|
8967
9042
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
8968
|
-
import
|
|
9043
|
+
import ts42 from "typescript";
|
|
8969
9044
|
|
|
8970
9045
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
|
|
8971
|
-
import
|
|
9046
|
+
import ts41 from "typescript";
|
|
8972
9047
|
function createMessageDiagnostic(messageText) {
|
|
8973
9048
|
return {
|
|
8974
9049
|
file: void 0,
|
|
8975
9050
|
start: void 0,
|
|
8976
9051
|
length: void 0,
|
|
8977
|
-
category:
|
|
9052
|
+
category: ts41.DiagnosticCategory.Message,
|
|
8978
9053
|
messageText,
|
|
8979
9054
|
code: DEFAULT_ERROR_CODE,
|
|
8980
9055
|
source: SOURCE
|
|
@@ -8983,13 +9058,13 @@ function createMessageDiagnostic(messageText) {
|
|
|
8983
9058
|
|
|
8984
9059
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
8985
9060
|
var defaultFormatHost = {
|
|
8986
|
-
getCurrentDirectory: () =>
|
|
9061
|
+
getCurrentDirectory: () => ts42.sys.getCurrentDirectory(),
|
|
8987
9062
|
getCanonicalFileName: (fileName) => fileName,
|
|
8988
|
-
getNewLine: () =>
|
|
9063
|
+
getNewLine: () => ts42.sys.newLine
|
|
8989
9064
|
};
|
|
8990
9065
|
function formatDiagnostics(diags, host = defaultFormatHost) {
|
|
8991
9066
|
if (diags && diags.length) {
|
|
8992
|
-
return diags.map((diagnostic) => replaceTsWithNgInErrors(
|
|
9067
|
+
return diags.map((diagnostic) => replaceTsWithNgInErrors(ts42.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
|
|
8993
9068
|
} else {
|
|
8994
9069
|
return "";
|
|
8995
9070
|
}
|
|
@@ -9006,7 +9081,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
9006
9081
|
var _a;
|
|
9007
9082
|
try {
|
|
9008
9083
|
const fs = getFileSystem();
|
|
9009
|
-
const readConfigFile = (configFile) =>
|
|
9084
|
+
const readConfigFile = (configFile) => ts42.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
|
|
9010
9085
|
const readAngularCompilerOptions = (configFile, parentOptions = {}) => {
|
|
9011
9086
|
const { config: config2, error: error2 } = readConfigFile(configFile);
|
|
9012
9087
|
if (error2) {
|
|
@@ -9041,7 +9116,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
9041
9116
|
...existingOptions
|
|
9042
9117
|
};
|
|
9043
9118
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
9044
|
-
const { options, errors, fileNames: rootNames, projectReferences } =
|
|
9119
|
+
const { options, errors, fileNames: rootNames, projectReferences } = ts42.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
|
|
9045
9120
|
let emitFlags = EmitFlags.Default;
|
|
9046
9121
|
if (!(options["skipMetadataEmit"] || options["flatModuleOutFile"])) {
|
|
9047
9122
|
emitFlags |= EmitFlags.Metadata;
|
|
@@ -9052,7 +9127,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
9052
9127
|
return { project: projectFile, rootNames, projectReferences, options, errors, emitFlags };
|
|
9053
9128
|
} catch (e) {
|
|
9054
9129
|
const errors = [{
|
|
9055
|
-
category:
|
|
9130
|
+
category: ts42.DiagnosticCategory.Error,
|
|
9056
9131
|
messageText: (_a = e.stack) != null ? _a : e.message,
|
|
9057
9132
|
file: void 0,
|
|
9058
9133
|
start: void 0,
|
|
@@ -9066,7 +9141,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
9066
9141
|
function createParseConfigHost(host, fs = getFileSystem()) {
|
|
9067
9142
|
return {
|
|
9068
9143
|
fileExists: host.exists.bind(host),
|
|
9069
|
-
readDirectory:
|
|
9144
|
+
readDirectory: ts42.sys.readDirectory,
|
|
9070
9145
|
readFile: host.readFile.bind(host),
|
|
9071
9146
|
useCaseSensitiveFileNames: fs.isCaseSensitive()
|
|
9072
9147
|
};
|
|
@@ -9086,7 +9161,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
9086
9161
|
}
|
|
9087
9162
|
} else {
|
|
9088
9163
|
const parseConfigHost = createParseConfigHost(host, fs);
|
|
9089
|
-
const { resolvedModule } =
|
|
9164
|
+
const { resolvedModule } = ts42.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts42.ModuleResolutionKind.Node10, resolveJsonModule: true }, parseConfigHost);
|
|
9090
9165
|
if (resolvedModule) {
|
|
9091
9166
|
return absoluteFrom(resolvedModule.resolvedFileName);
|
|
9092
9167
|
}
|
|
@@ -9096,7 +9171,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
|
|
|
9096
9171
|
function exitCodeFromResult(diags) {
|
|
9097
9172
|
if (!diags)
|
|
9098
9173
|
return 0;
|
|
9099
|
-
if (diags.every((diag) => diag.category !==
|
|
9174
|
+
if (diags.every((diag) => diag.category !== ts42.DiagnosticCategory.Error)) {
|
|
9100
9175
|
return 0;
|
|
9101
9176
|
}
|
|
9102
9177
|
return diags.some((d) => d.source === "angular" && d.code === UNKNOWN_ERROR_CODE) ? 2 : 1;
|
|
@@ -9129,7 +9204,7 @@ function performCompilation({ rootNames, options, host, oldProgram, emitCallback
|
|
|
9129
9204
|
} catch (e) {
|
|
9130
9205
|
program = void 0;
|
|
9131
9206
|
allDiagnostics.push({
|
|
9132
|
-
category:
|
|
9207
|
+
category: ts42.DiagnosticCategory.Error,
|
|
9133
9208
|
messageText: (_a = e.stack) != null ? _a : e.message,
|
|
9134
9209
|
code: UNKNOWN_ERROR_CODE,
|
|
9135
9210
|
file: void 0,
|
|
@@ -9156,7 +9231,7 @@ function defaultGatherDiagnostics(program) {
|
|
|
9156
9231
|
return allDiagnostics;
|
|
9157
9232
|
}
|
|
9158
9233
|
function hasErrors(diags) {
|
|
9159
|
-
return diags.some((d) => d.category ===
|
|
9234
|
+
return diags.some((d) => d.category === ts42.DiagnosticCategory.Error);
|
|
9160
9235
|
}
|
|
9161
9236
|
|
|
9162
9237
|
export {
|
|
@@ -9201,4 +9276,4 @@ export {
|
|
|
9201
9276
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9202
9277
|
* found in the LICENSE file at https://angular.io/license
|
|
9203
9278
|
*/
|
|
9204
|
-
//# sourceMappingURL=chunk-
|
|
9279
|
+
//# sourceMappingURL=chunk-VH6EDOMC.js.map
|