@angular/compiler 20.3.4 → 20.3.5
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/fesm2022/compiler.mjs +34 -10
- package/fesm2022/compiler.mjs.map +1 -1
- package/index.d.ts +7 -1
- package/package.json +1 -1
package/fesm2022/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.3.
|
|
2
|
+
* @license Angular v20.3.5
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -2994,6 +2994,16 @@ class Identifiers {
|
|
|
2994
2994
|
name: 'ɵɵvalidateIframeAttribute',
|
|
2995
2995
|
moduleName: CORE,
|
|
2996
2996
|
};
|
|
2997
|
+
// Decorators
|
|
2998
|
+
static inputDecorator = { name: 'Input', moduleName: CORE };
|
|
2999
|
+
static outputDecorator = { name: 'Output', moduleName: CORE };
|
|
3000
|
+
static viewChildDecorator = { name: 'ViewChild', moduleName: CORE };
|
|
3001
|
+
static viewChildrenDecorator = { name: 'ViewChildren', moduleName: CORE };
|
|
3002
|
+
static contentChildDecorator = { name: 'ContentChild', moduleName: CORE };
|
|
3003
|
+
static contentChildrenDecorator = {
|
|
3004
|
+
name: 'ContentChildren',
|
|
3005
|
+
moduleName: CORE,
|
|
3006
|
+
};
|
|
2997
3007
|
// type-checking
|
|
2998
3008
|
static InputSignalBrandWriteType = { name: 'ɵINPUT_SIGNAL_BRAND_WRITE_TYPE', moduleName: CORE };
|
|
2999
3009
|
static UnwrapDirectiveSignalInputs = { name: 'ɵUnwrapDirectiveSignalInputs', moduleName: CORE };
|
|
@@ -28550,6 +28560,7 @@ function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
|
|
|
28550
28560
|
// main `for` body, use `mainSourceSpan`.
|
|
28551
28561
|
const endSpan = empty?.endSourceSpan ?? ast.endSourceSpan;
|
|
28552
28562
|
const sourceSpan = new ParseSourceSpan(ast.sourceSpan.start, endSpan?.end ?? ast.sourceSpan.end);
|
|
28563
|
+
validateTrackByExpression(params.trackBy.expression, params.trackBy.keywordSpan, errors);
|
|
28553
28564
|
node = new ForLoopBlock(params.itemName, params.expression, params.trackBy.expression, params.trackBy.keywordSpan, params.context, visitAll(visitor, ast.children, ast.children), empty, sourceSpan, ast.sourceSpan, ast.startSourceSpan, endSpan, ast.nameSpan, ast.i18n);
|
|
28554
28565
|
}
|
|
28555
28566
|
}
|
|
@@ -28649,6 +28660,13 @@ function parseForLoopParameters(block, errors, bindingParser) {
|
|
|
28649
28660
|
}
|
|
28650
28661
|
return result;
|
|
28651
28662
|
}
|
|
28663
|
+
function validateTrackByExpression(expression, parseSourceSpan, errors) {
|
|
28664
|
+
const visitor = new PipeVisitor();
|
|
28665
|
+
expression.ast.visit(visitor);
|
|
28666
|
+
if (visitor.hasPipe) {
|
|
28667
|
+
errors.push(new ParseError(parseSourceSpan, 'Cannot use pipes in track expressions'));
|
|
28668
|
+
}
|
|
28669
|
+
}
|
|
28652
28670
|
/** Parses the `let` parameter of a `for` loop block. */
|
|
28653
28671
|
function parseLetParameter(sourceSpan, expression, span, loopItemName, context, errors) {
|
|
28654
28672
|
const parts = expression.split(',');
|
|
@@ -28859,6 +28877,12 @@ function stripOptionalParentheses(param, errors) {
|
|
|
28859
28877
|
}
|
|
28860
28878
|
return expression.slice(start, end);
|
|
28861
28879
|
}
|
|
28880
|
+
class PipeVisitor extends RecursiveAstVisitor {
|
|
28881
|
+
hasPipe = false;
|
|
28882
|
+
visitPipe() {
|
|
28883
|
+
this.hasPipe = true;
|
|
28884
|
+
}
|
|
28885
|
+
}
|
|
28862
28886
|
|
|
28863
28887
|
/** Pattern for a timing value in a trigger. */
|
|
28864
28888
|
const TIME_PATTERN = /^\d+\.?\d*(ms|s)?$/;
|
|
@@ -34253,7 +34277,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
34253
34277
|
function compileDeclareClassMetadata(metadata) {
|
|
34254
34278
|
const definitionMap = new DefinitionMap();
|
|
34255
34279
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
34256
|
-
definitionMap.set('version', literal('20.3.
|
|
34280
|
+
definitionMap.set('version', literal('20.3.5'));
|
|
34257
34281
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34258
34282
|
definitionMap.set('type', metadata.type);
|
|
34259
34283
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -34271,7 +34295,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
34271
34295
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
|
|
34272
34296
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
|
|
34273
34297
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
34274
|
-
definitionMap.set('version', literal('20.3.
|
|
34298
|
+
definitionMap.set('version', literal('20.3.5'));
|
|
34275
34299
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34276
34300
|
definitionMap.set('type', metadata.type);
|
|
34277
34301
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -34366,7 +34390,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
34366
34390
|
const definitionMap = new DefinitionMap();
|
|
34367
34391
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
34368
34392
|
definitionMap.set('minVersion', literal(minVersion));
|
|
34369
|
-
definitionMap.set('version', literal('20.3.
|
|
34393
|
+
definitionMap.set('version', literal('20.3.5'));
|
|
34370
34394
|
// e.g. `type: MyDirective`
|
|
34371
34395
|
definitionMap.set('type', meta.type.value);
|
|
34372
34396
|
if (meta.isStandalone !== undefined) {
|
|
@@ -34782,7 +34806,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
34782
34806
|
function compileDeclareFactoryFunction(meta) {
|
|
34783
34807
|
const definitionMap = new DefinitionMap();
|
|
34784
34808
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
34785
|
-
definitionMap.set('version', literal('20.3.
|
|
34809
|
+
definitionMap.set('version', literal('20.3.5'));
|
|
34786
34810
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34787
34811
|
definitionMap.set('type', meta.type.value);
|
|
34788
34812
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -34817,7 +34841,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
34817
34841
|
function createInjectableDefinitionMap(meta) {
|
|
34818
34842
|
const definitionMap = new DefinitionMap();
|
|
34819
34843
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
34820
|
-
definitionMap.set('version', literal('20.3.
|
|
34844
|
+
definitionMap.set('version', literal('20.3.5'));
|
|
34821
34845
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34822
34846
|
definitionMap.set('type', meta.type.value);
|
|
34823
34847
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -34868,7 +34892,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
34868
34892
|
function createInjectorDefinitionMap(meta) {
|
|
34869
34893
|
const definitionMap = new DefinitionMap();
|
|
34870
34894
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
34871
|
-
definitionMap.set('version', literal('20.3.
|
|
34895
|
+
definitionMap.set('version', literal('20.3.5'));
|
|
34872
34896
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34873
34897
|
definitionMap.set('type', meta.type.value);
|
|
34874
34898
|
definitionMap.set('providers', meta.providers);
|
|
@@ -34901,7 +34925,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
34901
34925
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
34902
34926
|
}
|
|
34903
34927
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
34904
|
-
definitionMap.set('version', literal('20.3.
|
|
34928
|
+
definitionMap.set('version', literal('20.3.5'));
|
|
34905
34929
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34906
34930
|
definitionMap.set('type', meta.type.value);
|
|
34907
34931
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -34952,7 +34976,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
34952
34976
|
function createPipeDefinitionMap(meta) {
|
|
34953
34977
|
const definitionMap = new DefinitionMap();
|
|
34954
34978
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
34955
|
-
definitionMap.set('version', literal('20.3.
|
|
34979
|
+
definitionMap.set('version', literal('20.3.5'));
|
|
34956
34980
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34957
34981
|
// e.g. `type: MyPipe`
|
|
34958
34982
|
definitionMap.set('type', meta.type.value);
|
|
@@ -35108,7 +35132,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
|
35108
35132
|
* @description
|
|
35109
35133
|
* Entry point for all public APIs of the compiler package.
|
|
35110
35134
|
*/
|
|
35111
|
-
const VERSION = new Version('20.3.
|
|
35135
|
+
const VERSION = new Version('20.3.5');
|
|
35112
35136
|
|
|
35113
35137
|
//////////////////////////////////////
|
|
35114
35138
|
// THIS FILE HAS GLOBAL SIDE EFFECT //
|