@angular/core 18.1.0-next.3 → 18.1.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/primitives/event-dispatch/index.mjs +3 -2
- package/esm2022/primitives/event-dispatch/src/action_resolver.mjs +3 -3
- package/esm2022/primitives/event-dispatch/src/attribute.mjs +16 -52
- package/esm2022/primitives/event-dispatch/src/cache.mjs +17 -6
- package/esm2022/primitives/event-dispatch/src/char.mjs +1 -16
- package/esm2022/primitives/event-dispatch/src/event.mjs +2 -3
- package/esm2022/primitives/event-dispatch/src/eventcontract.mjs +6 -67
- package/esm2022/primitives/event-dispatch/src/property.mjs +17 -22
- package/esm2022/primitives/signals/index.mjs +3 -3
- package/esm2022/primitives/signals/src/signal.mjs +4 -1
- package/esm2022/src/change_detection/change_detector_ref.mjs +3 -2
- package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +2 -2
- package/esm2022/src/core_private_export.mjs +3 -1
- package/esm2022/src/defer/instructions.mjs +2 -2
- package/esm2022/src/di/host_tag_name_token.mjs +4 -1
- package/esm2022/src/errors.mjs +1 -1
- package/esm2022/src/event_delegation_utils.mjs +40 -22
- package/esm2022/src/event_dispatch/event_delegation.mjs +38 -0
- package/esm2022/src/hydration/annotate.mjs +29 -18
- package/esm2022/src/hydration/error_handling.mjs +3 -1
- package/esm2022/src/hydration/event_replay.mjs +6 -5
- package/esm2022/src/hydration/i18n.mjs +102 -18
- package/esm2022/src/hydration/node_lookup_utils.mjs +12 -6
- package/esm2022/src/render3/collect_native_nodes.mjs +6 -1
- package/esm2022/src/render3/component_ref.mjs +1 -1
- package/esm2022/src/render3/instructions/i18n_icu_container_visitor.mjs +61 -51
- package/esm2022/src/render3/instructions/let_declaration.mjs +30 -7
- package/esm2022/src/render3/instructions/projection.mjs +14 -11
- package/esm2022/src/render3/instructions/shared.mjs +1 -1
- package/esm2022/src/render3/interfaces/node.mjs +2 -1
- package/esm2022/src/render3/node_assert.mjs +9 -8
- package/esm2022/src/render3/node_manipulation.mjs +10 -3
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/logger.mjs +3 -3
- package/fesm2022/core.mjs +358 -164
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +54 -243
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +5 -2
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/index.d.ts +39 -4
- package/package.json +1 -1
- package/primitives/event-dispatch/index.d.ts +22 -102
- package/primitives/signals/index.d.ts +10 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/invalid-two-way-bindings/bundle.js +31 -11
- package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +3 -3
- package/schematics/ng-generate/control-flow-migration/bundle.js +31 -11
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +3 -3
- package/schematics/ng-generate/standalone-migration/bundle.js +126 -47
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
- package/esm2022/primitives/event-dispatch/src/dom.mjs +0 -48
|
@@ -12237,7 +12237,8 @@ function getScopeForView(view, parent) {
|
|
|
12237
12237
|
scope.contextVariables.set(identifier, {
|
|
12238
12238
|
kind: SemanticVariableKind.Identifier,
|
|
12239
12239
|
name: null,
|
|
12240
|
-
identifier
|
|
12240
|
+
identifier,
|
|
12241
|
+
local: false
|
|
12241
12242
|
});
|
|
12242
12243
|
}
|
|
12243
12244
|
for (const op of view.create) {
|
|
@@ -12256,7 +12257,8 @@ function getScopeForView(view, parent) {
|
|
|
12256
12257
|
variable: {
|
|
12257
12258
|
kind: SemanticVariableKind.Identifier,
|
|
12258
12259
|
name: null,
|
|
12259
|
-
identifier: op.localRefs[offset].name
|
|
12260
|
+
identifier: op.localRefs[offset].name,
|
|
12261
|
+
local: false
|
|
12260
12262
|
}
|
|
12261
12263
|
});
|
|
12262
12264
|
}
|
|
@@ -12268,7 +12270,8 @@ function getScopeForView(view, parent) {
|
|
|
12268
12270
|
variable: {
|
|
12269
12271
|
kind: SemanticVariableKind.Identifier,
|
|
12270
12272
|
name: null,
|
|
12271
|
-
identifier: op.declaredName
|
|
12273
|
+
identifier: op.declaredName,
|
|
12274
|
+
local: false
|
|
12272
12275
|
}
|
|
12273
12276
|
});
|
|
12274
12277
|
break;
|
|
@@ -16855,7 +16858,7 @@ var _ControlFlowError = class {
|
|
|
16855
16858
|
};
|
|
16856
16859
|
var _Tokenizer = class {
|
|
16857
16860
|
constructor(_file, _getTagDefinition, options) {
|
|
16858
|
-
var _a2;
|
|
16861
|
+
var _a2, _b2;
|
|
16859
16862
|
this._getTagDefinition = _getTagDefinition;
|
|
16860
16863
|
this._currentTokenStart = null;
|
|
16861
16864
|
this._currentTokenType = null;
|
|
@@ -16877,7 +16880,7 @@ var _Tokenizer = class {
|
|
|
16877
16880
|
this._preserveLineEndings = options.preserveLineEndings || false;
|
|
16878
16881
|
this._i18nNormalizeLineEndingsInICUs = options.i18nNormalizeLineEndingsInICUs || false;
|
|
16879
16882
|
this._tokenizeBlocks = (_a2 = options.tokenizeBlocks) != null ? _a2 : true;
|
|
16880
|
-
this._tokenizeLet = options.tokenizeLet
|
|
16883
|
+
this._tokenizeLet = (_b2 = options.tokenizeLet) != null ? _b2 : true;
|
|
16881
16884
|
try {
|
|
16882
16885
|
this._cursor.init();
|
|
16883
16886
|
} catch (e) {
|
|
@@ -17025,7 +17028,7 @@ var _Tokenizer = class {
|
|
|
17025
17028
|
const nameCursor = this._cursor.clone();
|
|
17026
17029
|
let allowDigit = false;
|
|
17027
17030
|
this._attemptCharCodeUntilFn((code) => {
|
|
17028
|
-
if (isAsciiLetter(code) || code === $_ || allowDigit && isDigit(code)) {
|
|
17031
|
+
if (isAsciiLetter(code) || code == $$ || code === $_ || allowDigit && isDigit(code)) {
|
|
17029
17032
|
allowDigit = true;
|
|
17030
17033
|
return false;
|
|
17031
17034
|
}
|
|
@@ -20768,11 +20771,22 @@ function resolveNames(job) {
|
|
|
20768
20771
|
}
|
|
20769
20772
|
function processLexicalScope2(unit, ops, savedView) {
|
|
20770
20773
|
const scope = /* @__PURE__ */ new Map();
|
|
20774
|
+
const localDefinitions = /* @__PURE__ */ new Map();
|
|
20771
20775
|
for (const op of ops) {
|
|
20772
20776
|
switch (op.kind) {
|
|
20773
20777
|
case OpKind.Variable:
|
|
20774
20778
|
switch (op.variable.kind) {
|
|
20775
20779
|
case SemanticVariableKind.Identifier:
|
|
20780
|
+
if (op.variable.local) {
|
|
20781
|
+
if (localDefinitions.has(op.variable.identifier)) {
|
|
20782
|
+
continue;
|
|
20783
|
+
}
|
|
20784
|
+
localDefinitions.set(op.variable.identifier, op.xref);
|
|
20785
|
+
} else if (scope.has(op.variable.identifier)) {
|
|
20786
|
+
continue;
|
|
20787
|
+
}
|
|
20788
|
+
scope.set(op.variable.identifier, op.xref);
|
|
20789
|
+
break;
|
|
20776
20790
|
case SemanticVariableKind.Alias:
|
|
20777
20791
|
if (scope.has(op.variable.identifier)) {
|
|
20778
20792
|
continue;
|
|
@@ -20799,7 +20813,9 @@ function processLexicalScope2(unit, ops, savedView) {
|
|
|
20799
20813
|
}
|
|
20800
20814
|
transformExpressionsInOp(op, (expr) => {
|
|
20801
20815
|
if (expr instanceof LexicalReadExpr) {
|
|
20802
|
-
if (
|
|
20816
|
+
if (localDefinitions.has(expr.name)) {
|
|
20817
|
+
return new ReadVariableExpr(localDefinitions.get(expr.name));
|
|
20818
|
+
} else if (scope.has(expr.name)) {
|
|
20803
20819
|
return new ReadVariableExpr(scope.get(expr.name));
|
|
20804
20820
|
} else {
|
|
20805
20821
|
return new ReadPropExpr(new ContextExpr(unit.job.root.xref), expr.name);
|
|
@@ -21620,7 +21636,8 @@ function generateLocalLetReferences(job) {
|
|
|
21620
21636
|
const variable2 = {
|
|
21621
21637
|
kind: SemanticVariableKind.Identifier,
|
|
21622
21638
|
name: null,
|
|
21623
|
-
identifier: op.declaredName
|
|
21639
|
+
identifier: op.declaredName,
|
|
21640
|
+
local: true
|
|
21624
21641
|
};
|
|
21625
21642
|
OpList.replace(op, createVariableOp(job.allocateXrefId(), variable2, new StoreLetExpr(op.target, op.value, op.sourceSpan), VariableFlags.None));
|
|
21626
21643
|
}
|
|
@@ -24375,7 +24392,7 @@ function parseTemplate(template2, templateUrl, options = {}) {
|
|
|
24375
24392
|
}, options), {
|
|
24376
24393
|
tokenizeExpansionForms: true,
|
|
24377
24394
|
tokenizeBlocks: (_a2 = options.enableBlockSyntax) != null ? _a2 : true,
|
|
24378
|
-
tokenizeLet: (_b2 = options.enableLetSyntax) != null ? _b2 :
|
|
24395
|
+
tokenizeLet: (_b2 = options.enableLetSyntax) != null ? _b2 : true
|
|
24379
24396
|
}));
|
|
24380
24397
|
if (!options.alwaysAttemptHtmlToR3AstConversion && parseResult.errors && parseResult.errors.length > 0) {
|
|
24381
24398
|
const parsedTemplate2 = {
|
|
@@ -25866,7 +25883,10 @@ function convertPipeDeclarationToMetadata(pipe2) {
|
|
|
25866
25883
|
}
|
|
25867
25884
|
function parseJitTemplate(template2, typeName, sourceMapUrl, preserveWhitespaces, interpolation, deferBlockDependencies) {
|
|
25868
25885
|
const interpolationConfig = interpolation ? InterpolationConfig.fromArray(interpolation) : DEFAULT_INTERPOLATION_CONFIG;
|
|
25869
|
-
const parsed = parseTemplate(template2, sourceMapUrl, {
|
|
25886
|
+
const parsed = parseTemplate(template2, sourceMapUrl, {
|
|
25887
|
+
preserveWhitespaces,
|
|
25888
|
+
interpolationConfig
|
|
25889
|
+
});
|
|
25870
25890
|
if (parsed.errors !== null) {
|
|
25871
25891
|
const errors = parsed.errors.map((err) => err.toString()).join(", ");
|
|
25872
25892
|
throw new Error(`Errors during JIT compilation of template for ${typeName}: ${errors}`);
|
|
@@ -26051,7 +26071,7 @@ function publishFacade(global) {
|
|
|
26051
26071
|
}
|
|
26052
26072
|
|
|
26053
26073
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
|
|
26054
|
-
var VERSION2 = new Version("18.1.0-
|
|
26074
|
+
var VERSION2 = new Version("18.1.0-rc.0");
|
|
26055
26075
|
|
|
26056
26076
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
26057
26077
|
var _I18N_ATTR = "i18n";
|
|
@@ -27155,7 +27175,7 @@ var MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = "18.0.0";
|
|
|
27155
27175
|
function compileDeclareClassMetadata(metadata) {
|
|
27156
27176
|
const definitionMap = new DefinitionMap();
|
|
27157
27177
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
27158
|
-
definitionMap.set("version", literal("18.1.0-
|
|
27178
|
+
definitionMap.set("version", literal("18.1.0-rc.0"));
|
|
27159
27179
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27160
27180
|
definitionMap.set("type", metadata.type);
|
|
27161
27181
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -27174,7 +27194,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
27174
27194
|
callbackReturnDefinitionMap.set("ctorParameters", (_a2 = metadata.ctorParameters) != null ? _a2 : literal(null));
|
|
27175
27195
|
callbackReturnDefinitionMap.set("propDecorators", (_b2 = metadata.propDecorators) != null ? _b2 : literal(null));
|
|
27176
27196
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
27177
|
-
definitionMap.set("version", literal("18.1.0-
|
|
27197
|
+
definitionMap.set("version", literal("18.1.0-rc.0"));
|
|
27178
27198
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27179
27199
|
definitionMap.set("type", metadata.type);
|
|
27180
27200
|
definitionMap.set("resolveDeferredDeps", compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -27242,7 +27262,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
27242
27262
|
const definitionMap = new DefinitionMap();
|
|
27243
27263
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
27244
27264
|
definitionMap.set("minVersion", literal(minVersion));
|
|
27245
|
-
definitionMap.set("version", literal("18.1.0-
|
|
27265
|
+
definitionMap.set("version", literal("18.1.0-rc.0"));
|
|
27246
27266
|
definitionMap.set("type", meta.type.value);
|
|
27247
27267
|
if (meta.isStandalone) {
|
|
27248
27268
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -27560,7 +27580,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION2 = "12.0.0";
|
|
|
27560
27580
|
function compileDeclareFactoryFunction(meta) {
|
|
27561
27581
|
const definitionMap = new DefinitionMap();
|
|
27562
27582
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION2));
|
|
27563
|
-
definitionMap.set("version", literal("18.1.0-
|
|
27583
|
+
definitionMap.set("version", literal("18.1.0-rc.0"));
|
|
27564
27584
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27565
27585
|
definitionMap.set("type", meta.type.value);
|
|
27566
27586
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -27583,7 +27603,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
27583
27603
|
function createInjectableDefinitionMap(meta) {
|
|
27584
27604
|
const definitionMap = new DefinitionMap();
|
|
27585
27605
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
|
|
27586
|
-
definitionMap.set("version", literal("18.1.0-
|
|
27606
|
+
definitionMap.set("version", literal("18.1.0-rc.0"));
|
|
27587
27607
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27588
27608
|
definitionMap.set("type", meta.type.value);
|
|
27589
27609
|
if (meta.providedIn !== void 0) {
|
|
@@ -27621,7 +27641,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
27621
27641
|
function createInjectorDefinitionMap(meta) {
|
|
27622
27642
|
const definitionMap = new DefinitionMap();
|
|
27623
27643
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
|
|
27624
|
-
definitionMap.set("version", literal("18.1.0-
|
|
27644
|
+
definitionMap.set("version", literal("18.1.0-rc.0"));
|
|
27625
27645
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27626
27646
|
definitionMap.set("type", meta.type.value);
|
|
27627
27647
|
definitionMap.set("providers", meta.providers);
|
|
@@ -27645,7 +27665,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
27645
27665
|
throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
|
|
27646
27666
|
}
|
|
27647
27667
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
|
|
27648
|
-
definitionMap.set("version", literal("18.1.0-
|
|
27668
|
+
definitionMap.set("version", literal("18.1.0-rc.0"));
|
|
27649
27669
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27650
27670
|
definitionMap.set("type", meta.type.value);
|
|
27651
27671
|
if (meta.bootstrap.length > 0) {
|
|
@@ -27680,7 +27700,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
27680
27700
|
function createPipeDefinitionMap(meta) {
|
|
27681
27701
|
const definitionMap = new DefinitionMap();
|
|
27682
27702
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
|
|
27683
|
-
definitionMap.set("version", literal("18.1.0-
|
|
27703
|
+
definitionMap.set("version", literal("18.1.0-rc.0"));
|
|
27684
27704
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27685
27705
|
definitionMap.set("type", meta.type.value);
|
|
27686
27706
|
if (meta.isStandalone) {
|
|
@@ -27697,7 +27717,7 @@ function createPipeDefinitionMap(meta) {
|
|
|
27697
27717
|
publishFacade(_global);
|
|
27698
27718
|
|
|
27699
27719
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/version.mjs
|
|
27700
|
-
var VERSION3 = new Version("18.1.0-
|
|
27720
|
+
var VERSION3 = new Version("18.1.0-rc.0");
|
|
27701
27721
|
|
|
27702
27722
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
|
|
27703
27723
|
var import_typescript5 = __toESM(require("typescript"), 1);
|
|
@@ -27775,7 +27795,7 @@ var ErrorCode;
|
|
|
27775
27795
|
ErrorCode2[ErrorCode2["DEFERRED_DEPENDENCY_IMPORTED_EAGERLY"] = 8014] = "DEFERRED_DEPENDENCY_IMPORTED_EAGERLY";
|
|
27776
27796
|
ErrorCode2[ErrorCode2["ILLEGAL_LET_WRITE"] = 8015] = "ILLEGAL_LET_WRITE";
|
|
27777
27797
|
ErrorCode2[ErrorCode2["LET_USED_BEFORE_DEFINITION"] = 8016] = "LET_USED_BEFORE_DEFINITION";
|
|
27778
|
-
ErrorCode2[ErrorCode2["
|
|
27798
|
+
ErrorCode2[ErrorCode2["CONFLICTING_LET_DECLARATION"] = 8017] = "CONFLICTING_LET_DECLARATION";
|
|
27779
27799
|
ErrorCode2[ErrorCode2["INVALID_BANANA_IN_BOX"] = 8101] = "INVALID_BANANA_IN_BOX";
|
|
27780
27800
|
ErrorCode2[ErrorCode2["NULLISH_COALESCING_NOT_NULLABLE"] = 8102] = "NULLISH_COALESCING_NOT_NULLABLE";
|
|
27781
27801
|
ErrorCode2[ErrorCode2["MISSING_CONTROL_FLOW_DIRECTIVE"] = 8103] = "MISSING_CONTROL_FLOW_DIRECTIVE";
|
|
@@ -27786,6 +27806,7 @@ var ErrorCode;
|
|
|
27786
27806
|
ErrorCode2[ErrorCode2["SKIP_HYDRATION_NOT_STATIC"] = 8108] = "SKIP_HYDRATION_NOT_STATIC";
|
|
27787
27807
|
ErrorCode2[ErrorCode2["INTERPOLATED_SIGNAL_NOT_INVOKED"] = 8109] = "INTERPOLATED_SIGNAL_NOT_INVOKED";
|
|
27788
27808
|
ErrorCode2[ErrorCode2["UNSUPPORTED_INITIALIZER_API_USAGE"] = 8110] = "UNSUPPORTED_INITIALIZER_API_USAGE";
|
|
27809
|
+
ErrorCode2[ErrorCode2["UNINVOKED_FUNCTION_IN_EVENT_BINDING"] = 8111] = "UNINVOKED_FUNCTION_IN_EVENT_BINDING";
|
|
27789
27810
|
ErrorCode2[ErrorCode2["INLINE_TCB_REQUIRED"] = 8900] = "INLINE_TCB_REQUIRED";
|
|
27790
27811
|
ErrorCode2[ErrorCode2["INLINE_TYPE_CTOR_REQUIRED"] = 8901] = "INLINE_TYPE_CTOR_REQUIRED";
|
|
27791
27812
|
ErrorCode2[ErrorCode2["INJECTABLE_DUPLICATE_PROV"] = 9001] = "INJECTABLE_DUPLICATE_PROV";
|
|
@@ -27887,6 +27908,7 @@ var ExtendedTemplateDiagnosticName;
|
|
|
27887
27908
|
ExtendedTemplateDiagnosticName2["OPTIONAL_CHAIN_NOT_NULLABLE"] = "optionalChainNotNullable";
|
|
27888
27909
|
ExtendedTemplateDiagnosticName2["MISSING_CONTROL_FLOW_DIRECTIVE"] = "missingControlFlowDirective";
|
|
27889
27910
|
ExtendedTemplateDiagnosticName2["TEXT_ATTRIBUTE_NOT_BINDING"] = "textAttributeNotBinding";
|
|
27911
|
+
ExtendedTemplateDiagnosticName2["UNINVOKED_FUNCTION_IN_EVENT_BINDING"] = "uninvokedFunctionInEventBinding";
|
|
27890
27912
|
ExtendedTemplateDiagnosticName2["MISSING_NGFOROF_LET"] = "missingNgForOfLet";
|
|
27891
27913
|
ExtendedTemplateDiagnosticName2["SUFFIX_NOT_SUPPORTED"] = "suffixNotSupported";
|
|
27892
27914
|
ExtendedTemplateDiagnosticName2["SKIP_HYDRATION_NOT_STATIC"] = "skipHydrationNotStatic";
|
|
@@ -32705,8 +32727,8 @@ var BINARY_OPERATORS3 = /* @__PURE__ */ new Map([
|
|
|
32705
32727
|
[BinaryOperator.NullishCoalesce, "??"]
|
|
32706
32728
|
]);
|
|
32707
32729
|
var ExpressionTranslatorVisitor = class {
|
|
32708
|
-
constructor(
|
|
32709
|
-
this.factory =
|
|
32730
|
+
constructor(factory10, imports, contextFile, options) {
|
|
32731
|
+
this.factory = factory10;
|
|
32710
32732
|
this.imports = imports;
|
|
32711
32733
|
this.contextFile = contextFile;
|
|
32712
32734
|
this.downlevelTaggedTemplates = options.downlevelTaggedTemplates === true;
|
|
@@ -38004,10 +38026,7 @@ var TsCreateProgramDriver = class {
|
|
|
38004
38026
|
this.sfMap.clear();
|
|
38005
38027
|
}
|
|
38006
38028
|
for (const [filePath, { newText, originalFile }] of contents.entries()) {
|
|
38007
|
-
const sf = import_typescript66.default.createSourceFile(filePath, newText,
|
|
38008
|
-
impliedNodeFormat: void 0,
|
|
38009
|
-
languageVersion: import_typescript66.default.ScriptTarget.Latest
|
|
38010
|
-
}, true);
|
|
38029
|
+
const sf = import_typescript66.default.createSourceFile(filePath, newText, import_typescript66.default.ScriptTarget.Latest, true);
|
|
38011
38030
|
if (originalFile !== null) {
|
|
38012
38031
|
sf[NgOriginalFile] = originalFile;
|
|
38013
38032
|
}
|
|
@@ -38023,7 +38042,6 @@ var TsCreateProgramDriver = class {
|
|
|
38023
38042
|
oldProgram
|
|
38024
38043
|
});
|
|
38025
38044
|
host.postProgramCreationCleanup();
|
|
38026
|
-
untagAllTsFiles(this.program);
|
|
38027
38045
|
untagAllTsFiles(oldProgram);
|
|
38028
38046
|
}
|
|
38029
38047
|
};
|
|
@@ -40325,10 +40343,10 @@ Deferred blocks can only access triggers in same view, a parent embedded view or
|
|
|
40325
40343
|
}
|
|
40326
40344
|
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), sourceSpan, import_typescript78.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.LET_USED_BEFORE_DEFINITION), `Cannot read @let declaration '${target.name}' before it has been defined.`));
|
|
40327
40345
|
}
|
|
40328
|
-
|
|
40346
|
+
conflictingDeclaration(templateId, decl) {
|
|
40329
40347
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
40330
|
-
const errorMsg = `Cannot declare @let called '${
|
|
40331
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping,
|
|
40348
|
+
const errorMsg = `Cannot declare @let called '${decl.name}' as there is another symbol in the template with the same name.`;
|
|
40349
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, decl.sourceSpan, import_typescript78.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.CONFLICTING_LET_DECLARATION), errorMsg));
|
|
40332
40350
|
}
|
|
40333
40351
|
};
|
|
40334
40352
|
function makeInlineDiagnostic(templateId, code, node, messageText, relatedInformation) {
|
|
@@ -41725,14 +41743,12 @@ var _Scope = class {
|
|
|
41725
41743
|
}
|
|
41726
41744
|
for (const node of children) {
|
|
41727
41745
|
scope.appendNode(node);
|
|
41728
|
-
|
|
41729
|
-
|
|
41730
|
-
|
|
41731
|
-
|
|
41732
|
-
|
|
41733
|
-
|
|
41734
|
-
}
|
|
41735
|
-
}
|
|
41746
|
+
}
|
|
41747
|
+
for (const variable2 of scope.varMap.keys()) {
|
|
41748
|
+
_Scope.checkConflictingLet(scope, variable2);
|
|
41749
|
+
}
|
|
41750
|
+
for (const ref of scope.referenceOpMap.keys()) {
|
|
41751
|
+
_Scope.checkConflictingLet(scope, ref);
|
|
41736
41752
|
}
|
|
41737
41753
|
return scope;
|
|
41738
41754
|
}
|
|
@@ -41796,7 +41812,7 @@ var _Scope = class {
|
|
|
41796
41812
|
if (ref instanceof Reference && this.referenceOpMap.has(ref)) {
|
|
41797
41813
|
return this.resolveOp(this.referenceOpMap.get(ref));
|
|
41798
41814
|
} else if (ref instanceof LetDeclaration && this.letDeclOpMap.has(ref.name)) {
|
|
41799
|
-
return this.resolveOp(this.letDeclOpMap.get(ref.name));
|
|
41815
|
+
return this.resolveOp(this.letDeclOpMap.get(ref.name).opIndex);
|
|
41800
41816
|
} else if (ref instanceof Variable && this.varMap.has(ref)) {
|
|
41801
41817
|
const opIndexOrNode = this.varMap.get(ref);
|
|
41802
41818
|
return typeof opIndexOrNode === "number" ? this.resolveOp(opIndexOrNode) : opIndexOrNode;
|
|
@@ -41872,6 +41888,13 @@ var _Scope = class {
|
|
|
41872
41888
|
this.appendIcuExpressions(node);
|
|
41873
41889
|
} else if (node instanceof Content) {
|
|
41874
41890
|
this.appendChildren(node);
|
|
41891
|
+
} else if (node instanceof LetDeclaration) {
|
|
41892
|
+
const opIndex = this.opQueue.push(new TcbLetDeclarationOp(this.tcb, this, node)) - 1;
|
|
41893
|
+
if (this.isLocal(node)) {
|
|
41894
|
+
this.tcb.oobRecorder.conflictingDeclaration(this.tcb.id, node);
|
|
41895
|
+
} else {
|
|
41896
|
+
this.letDeclOpMap.set(node.name, { opIndex, node });
|
|
41897
|
+
}
|
|
41875
41898
|
}
|
|
41876
41899
|
}
|
|
41877
41900
|
appendChildren(node) {
|
|
@@ -42037,6 +42060,11 @@ var _Scope = class {
|
|
|
42037
42060
|
this.tcb.oobRecorder.inaccessibleDeferredTriggerElement(this.tcb.id, trigger);
|
|
42038
42061
|
}
|
|
42039
42062
|
}
|
|
42063
|
+
static checkConflictingLet(scope, node) {
|
|
42064
|
+
if (scope.letDeclOpMap.has(node.name)) {
|
|
42065
|
+
scope.tcb.oobRecorder.conflictingDeclaration(scope.tcb.id, scope.letDeclOpMap.get(node.name).node);
|
|
42066
|
+
}
|
|
42067
|
+
}
|
|
42040
42068
|
};
|
|
42041
42069
|
var Scope3 = _Scope;
|
|
42042
42070
|
(() => {
|
|
@@ -48142,6 +48170,57 @@ var factory8 = {
|
|
|
48142
48170
|
create: () => new TextAttributeNotBindingSpec()
|
|
48143
48171
|
};
|
|
48144
48172
|
|
|
48173
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/uninvoked_function_in_event_binding/index.mjs
|
|
48174
|
+
var UninvokedFunctionInEventBindingSpec = class extends TemplateCheckWithVisitor {
|
|
48175
|
+
constructor() {
|
|
48176
|
+
super(...arguments);
|
|
48177
|
+
this.code = ErrorCode.UNINVOKED_FUNCTION_IN_EVENT_BINDING;
|
|
48178
|
+
}
|
|
48179
|
+
visitNode(ctx, component, node) {
|
|
48180
|
+
if (!(node instanceof BoundEvent))
|
|
48181
|
+
return [];
|
|
48182
|
+
if (node.type !== ParsedEventType.Regular && node.type !== ParsedEventType.Animation)
|
|
48183
|
+
return [];
|
|
48184
|
+
if (!(node.handler instanceof ASTWithSource))
|
|
48185
|
+
return [];
|
|
48186
|
+
const sourceExpressionText = node.handler.source || "";
|
|
48187
|
+
if (node.handler.ast instanceof Chain) {
|
|
48188
|
+
return node.handler.ast.expressions.flatMap((expression) => assertExpressionInvoked(expression, component, node, sourceExpressionText, ctx));
|
|
48189
|
+
}
|
|
48190
|
+
if (node.handler.ast instanceof Conditional) {
|
|
48191
|
+
const { trueExp, falseExp } = node.handler.ast;
|
|
48192
|
+
return [trueExp, falseExp].flatMap((expression) => assertExpressionInvoked(expression, component, node, sourceExpressionText, ctx));
|
|
48193
|
+
}
|
|
48194
|
+
return assertExpressionInvoked(node.handler.ast, component, node, sourceExpressionText, ctx);
|
|
48195
|
+
}
|
|
48196
|
+
};
|
|
48197
|
+
function assertExpressionInvoked(expression, component, node, expressionText, ctx) {
|
|
48198
|
+
var _a2;
|
|
48199
|
+
if (expression instanceof Call || expression instanceof SafeCall) {
|
|
48200
|
+
return [];
|
|
48201
|
+
}
|
|
48202
|
+
if (!(expression instanceof PropertyRead) && !(expression instanceof SafePropertyRead)) {
|
|
48203
|
+
return [];
|
|
48204
|
+
}
|
|
48205
|
+
const symbol = ctx.templateTypeChecker.getSymbolOfNode(expression, component);
|
|
48206
|
+
if (symbol !== null && symbol.kind === SymbolKind.Expression) {
|
|
48207
|
+
if (((_a2 = symbol.tsType.getCallSignatures()) == null ? void 0 : _a2.length) > 0) {
|
|
48208
|
+
const fullExpressionText = generateStringFromExpression(expression, expressionText);
|
|
48209
|
+
const errorString = `Function in event binding should be invoked: ${fullExpressionText}()`;
|
|
48210
|
+
return [ctx.makeTemplateDiagnostic(node.sourceSpan, errorString)];
|
|
48211
|
+
}
|
|
48212
|
+
}
|
|
48213
|
+
return [];
|
|
48214
|
+
}
|
|
48215
|
+
function generateStringFromExpression(expression, source) {
|
|
48216
|
+
return source.substring(expression.span.start, expression.span.end);
|
|
48217
|
+
}
|
|
48218
|
+
var factory9 = {
|
|
48219
|
+
code: ErrorCode.UNINVOKED_FUNCTION_IN_EVENT_BINDING,
|
|
48220
|
+
name: ExtendedTemplateDiagnosticName.UNINVOKED_FUNCTION_IN_EVENT_BINDING,
|
|
48221
|
+
create: () => new UninvokedFunctionInEventBindingSpec()
|
|
48222
|
+
};
|
|
48223
|
+
|
|
48145
48224
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
|
|
48146
48225
|
var import_typescript116 = __toESM(require("typescript"), 1);
|
|
48147
48226
|
|
|
@@ -48159,12 +48238,12 @@ var ExtendedTemplateCheckerImpl = class {
|
|
|
48159
48238
|
var _a2, _b2, _c2, _d2, _e2;
|
|
48160
48239
|
this.partialCtx = { templateTypeChecker, typeChecker };
|
|
48161
48240
|
this.templateChecks = /* @__PURE__ */ new Map();
|
|
48162
|
-
for (const
|
|
48163
|
-
const category = diagnosticLabelToCategory((_e2 = (_d2 = (_b2 = (_a2 = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _a2.checks) == null ? void 0 : _b2[
|
|
48241
|
+
for (const factory10 of templateCheckFactories) {
|
|
48242
|
+
const category = diagnosticLabelToCategory((_e2 = (_d2 = (_b2 = (_a2 = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _a2.checks) == null ? void 0 : _b2[factory10.name]) != null ? _d2 : (_c2 = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _c2.defaultCategory) != null ? _e2 : DiagnosticCategoryLabel.Warning);
|
|
48164
48243
|
if (category === null) {
|
|
48165
48244
|
continue;
|
|
48166
48245
|
}
|
|
48167
|
-
const check =
|
|
48246
|
+
const check = factory10.create(options);
|
|
48168
48247
|
if (check === null) {
|
|
48169
48248
|
continue;
|
|
48170
48249
|
}
|
|
@@ -48214,11 +48293,12 @@ var ALL_DIAGNOSTIC_FACTORIES = [
|
|
|
48214
48293
|
factory8,
|
|
48215
48294
|
factory4,
|
|
48216
48295
|
factory7,
|
|
48217
|
-
factory
|
|
48296
|
+
factory,
|
|
48297
|
+
factory9
|
|
48218
48298
|
];
|
|
48219
48299
|
var SUPPORTED_DIAGNOSTIC_NAMES = /* @__PURE__ */ new Set([
|
|
48220
48300
|
ExtendedTemplateDiagnosticName.CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION,
|
|
48221
|
-
...ALL_DIAGNOSTIC_FACTORIES.map((
|
|
48301
|
+
...ALL_DIAGNOSTIC_FACTORIES.map((factory10) => factory10.name)
|
|
48222
48302
|
]);
|
|
48223
48303
|
|
|
48224
48304
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.mjs
|
|
@@ -48498,7 +48578,7 @@ var NgCompiler = class {
|
|
|
48498
48578
|
this.delegatingPerfRecorder = new DelegatingPerfRecorder(this.perfRecorder);
|
|
48499
48579
|
this.enableTemplateTypeChecker = enableTemplateTypeChecker || ((_a2 = options["_enableTemplateTypeChecker"]) != null ? _a2 : false);
|
|
48500
48580
|
this.enableBlockSyntax = (_b2 = options["_enableBlockSyntax"]) != null ? _b2 : true;
|
|
48501
|
-
this.enableLetSyntax = (_c2 = options["_enableLetSyntax"]) != null ? _c2 :
|
|
48581
|
+
this.enableLetSyntax = (_c2 = options["_enableLetSyntax"]) != null ? _c2 : true;
|
|
48502
48582
|
this.angularCoreVersion = (_d2 = options["_angularCoreVersion"]) != null ? _d2 : null;
|
|
48503
48583
|
this.constructionDiagnostics.push(...this.adapter.constructionDiagnostics, ...verifyCompatibleTypeCheckOptions(this.options));
|
|
48504
48584
|
this.currentProgram = inputProgram;
|
|
@@ -49371,7 +49451,6 @@ var NgtscProgram = class {
|
|
|
49371
49451
|
perfRecorder.phase(PerfPhase.Unaccounted);
|
|
49372
49452
|
perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
|
|
49373
49453
|
this.host.postProgramCreationCleanup();
|
|
49374
|
-
untagAllTsFiles(this.tsProgram);
|
|
49375
49454
|
const programDriver = new TsCreateProgramDriver(this.tsProgram, this.host, this.options, this.host.shimExtensionPrefixes);
|
|
49376
49455
|
this.incrementalStrategy = oldProgram !== void 0 ? oldProgram.incrementalStrategy.toNextBuildStrategy() : new TrackedIncrementalBuildStrategy();
|
|
49377
49456
|
const modifiedResourceFiles = /* @__PURE__ */ new Set();
|