@angular/compiler 21.0.1 → 21.0.2
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 +19 -40
- package/fesm2022/compiler.mjs.map +1 -1
- package/package.json +1 -1
- package/types/compiler.d.ts +4 -3
package/fesm2022/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.
|
|
2
|
+
* @license Angular v21.0.2
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -352,6 +352,7 @@ var SecurityContext;
|
|
|
352
352
|
SecurityContext[SecurityContext["SCRIPT"] = 3] = "SCRIPT";
|
|
353
353
|
SecurityContext[SecurityContext["URL"] = 4] = "URL";
|
|
354
354
|
SecurityContext[SecurityContext["RESOURCE_URL"] = 5] = "RESOURCE_URL";
|
|
355
|
+
SecurityContext[SecurityContext["ATTRIBUTE_NO_BINDING"] = 6] = "ATTRIBUTE_NO_BINDING";
|
|
355
356
|
})(SecurityContext || (SecurityContext = {}));
|
|
356
357
|
var MissingTranslationStrategy;
|
|
357
358
|
(function (MissingTranslationStrategy) {
|
|
@@ -3019,6 +3020,10 @@ class Identifiers {
|
|
|
3019
3020
|
name: 'ɵɵsanitizeStyle',
|
|
3020
3021
|
moduleName: CORE
|
|
3021
3022
|
};
|
|
3023
|
+
static validateAttribute = {
|
|
3024
|
+
name: 'ɵɵvalidateAttribute',
|
|
3025
|
+
moduleName: CORE
|
|
3026
|
+
};
|
|
3022
3027
|
static sanitizeResourceUrl = {
|
|
3023
3028
|
name: 'ɵɵsanitizeResourceUrl',
|
|
3024
3029
|
moduleName: CORE
|
|
@@ -3043,10 +3048,6 @@ class Identifiers {
|
|
|
3043
3048
|
name: 'ɵɵtrustConstantResourceUrl',
|
|
3044
3049
|
moduleName: CORE
|
|
3045
3050
|
};
|
|
3046
|
-
static validateIframeAttribute = {
|
|
3047
|
-
name: 'ɵɵvalidateIframeAttribute',
|
|
3048
|
-
moduleName: CORE
|
|
3049
|
-
};
|
|
3050
3051
|
static inputDecorator = {
|
|
3051
3052
|
name: 'Input',
|
|
3052
3053
|
moduleName: CORE
|
|
@@ -17042,18 +17043,15 @@ function SECURITY_SCHEMA() {
|
|
|
17042
17043
|
_SECURITY_SCHEMA = {};
|
|
17043
17044
|
registerContext(SecurityContext.HTML, ['iframe|srcdoc', '*|innerHTML', '*|outerHTML']);
|
|
17044
17045
|
registerContext(SecurityContext.STYLE, ['*|style']);
|
|
17045
|
-
registerContext(SecurityContext.URL, ['*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href', 'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action', 'img|src', 'input|src', 'ins|cite', 'q|cite', 'source|src', 'track|src', 'video|poster', 'video|src']);
|
|
17046
|
+
registerContext(SecurityContext.URL, ['*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href', 'a|xlink:href', 'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action', 'img|src', 'input|src', 'ins|cite', 'q|cite', 'source|src', 'track|src', 'video|poster', 'video|src', 'annotation|href', 'annotation|xlink:href', 'annotation-xml|href', 'annotation-xml|xlink:href', 'maction|href', 'maction|xlink:href', 'malignmark|href', 'malignmark|xlink:href', 'math|href', 'math|xlink:href', 'mroot|href', 'mroot|xlink:href', 'msqrt|href', 'msqrt|xlink:href', 'merror|href', 'merror|xlink:href', 'mfrac|href', 'mfrac|xlink:href', 'mglyph|href', 'mglyph|xlink:href', 'msub|href', 'msub|xlink:href', 'msup|href', 'msup|xlink:href', 'msubsup|href', 'msubsup|xlink:href', 'mmultiscripts|href', 'mmultiscripts|xlink:href', 'mprescripts|href', 'mprescripts|xlink:href', 'mi|href', 'mi|xlink:href', 'mn|href', 'mn|xlink:href', 'mo|href', 'mo|xlink:href', 'mpadded|href', 'mpadded|xlink:href', 'mphantom|href', 'mphantom|xlink:href', 'mrow|href', 'mrow|xlink:href', 'ms|href', 'ms|xlink:href', 'mspace|href', 'mspace|xlink:href', 'mstyle|href', 'mstyle|xlink:href', 'mtable|href', 'mtable|xlink:href', 'mtd|href', 'mtd|xlink:href', 'mtr|href', 'mtr|xlink:href', 'mtext|href', 'mtext|xlink:href', 'mover|href', 'mover|xlink:href', 'munder|href', 'munder|xlink:href', 'munderover|href', 'munderover|xlink:href', 'semantics|href', 'semantics|xlink:href', 'none|href', 'none|xlink:href']);
|
|
17046
17047
|
registerContext(SecurityContext.RESOURCE_URL, ['applet|code', 'applet|codebase', 'base|href', 'embed|src', 'frame|src', 'head|profile', 'html|manifest', 'iframe|src', 'link|href', 'media|src', 'object|codebase', 'object|data', 'script|src']);
|
|
17048
|
+
registerContext(SecurityContext.ATTRIBUTE_NO_BINDING, ['animate|attributeName', 'set|attributeName', 'animateMotion|attributeName', 'animateTransform|attributeName', 'unknown|attributeName', 'iframe|sandbox', 'iframe|allow', 'iframe|allowFullscreen', 'iframe|referrerPolicy', 'iframe|csp', 'iframe|fetchPriority', 'unknown|sandbox', 'unknown|allow', 'unknown|allowFullscreen', 'unknown|referrerPolicy', 'unknown|csp', 'unknown|fetchPriority']);
|
|
17047
17049
|
}
|
|
17048
17050
|
return _SECURITY_SCHEMA;
|
|
17049
17051
|
}
|
|
17050
17052
|
function registerContext(ctx, specs) {
|
|
17051
17053
|
for (const spec of specs) _SECURITY_SCHEMA[spec.toLowerCase()] = ctx;
|
|
17052
17054
|
}
|
|
17053
|
-
const IFRAME_SECURITY_SENSITIVE_ATTRS = new Set(['sandbox', 'allow', 'allowfullscreen', 'referrerpolicy', 'csp', 'fetchpriority']);
|
|
17054
|
-
function isIframeSecuritySensitiveAttr(attrName) {
|
|
17055
|
-
return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
|
|
17056
|
-
}
|
|
17057
17055
|
|
|
17058
17056
|
class ElementSchemaRegistry {}
|
|
17059
17057
|
|
|
@@ -20617,11 +20615,10 @@ function processLexicalScope(unit, ops, savedView) {
|
|
|
20617
20615
|
}
|
|
20618
20616
|
}
|
|
20619
20617
|
|
|
20620
|
-
const sanitizerFns = new Map([[SecurityContext.HTML, Identifiers.sanitizeHtml], [SecurityContext.RESOURCE_URL, Identifiers.sanitizeResourceUrl], [SecurityContext.SCRIPT, Identifiers.sanitizeScript], [SecurityContext.STYLE, Identifiers.sanitizeStyle], [SecurityContext.URL, Identifiers.sanitizeUrl]]);
|
|
20618
|
+
const sanitizerFns = new Map([[SecurityContext.HTML, Identifiers.sanitizeHtml], [SecurityContext.RESOURCE_URL, Identifiers.sanitizeResourceUrl], [SecurityContext.SCRIPT, Identifiers.sanitizeScript], [SecurityContext.STYLE, Identifiers.sanitizeStyle], [SecurityContext.URL, Identifiers.sanitizeUrl], [SecurityContext.ATTRIBUTE_NO_BINDING, Identifiers.validateAttribute]]);
|
|
20621
20619
|
const trustedValueFns = new Map([[SecurityContext.HTML, Identifiers.trustConstantHtml], [SecurityContext.RESOURCE_URL, Identifiers.trustConstantResourceUrl]]);
|
|
20622
20620
|
function resolveSanitizers(job) {
|
|
20623
20621
|
for (const unit of job.units) {
|
|
20624
|
-
const elements = createOpXrefMap(unit);
|
|
20625
20622
|
if (job.kind !== CompilationJobKind.Host) {
|
|
20626
20623
|
for (const op of unit.create) {
|
|
20627
20624
|
if (op.kind === OpKind.ExtractedAttribute) {
|
|
@@ -20636,35 +20633,17 @@ function resolveSanitizers(job) {
|
|
|
20636
20633
|
case OpKind.Attribute:
|
|
20637
20634
|
case OpKind.DomProperty:
|
|
20638
20635
|
let sanitizerFn = null;
|
|
20639
|
-
if (Array.isArray(op.securityContext) && op.securityContext.length === 2 && op.securityContext.
|
|
20636
|
+
if (Array.isArray(op.securityContext) && op.securityContext.length === 2 && op.securityContext.includes(SecurityContext.URL) && op.securityContext.includes(SecurityContext.RESOURCE_URL)) {
|
|
20640
20637
|
sanitizerFn = Identifiers.sanitizeUrlOrResourceUrl;
|
|
20641
20638
|
} else {
|
|
20642
20639
|
sanitizerFn = sanitizerFns.get(getOnlySecurityContext(op.securityContext)) ?? null;
|
|
20643
20640
|
}
|
|
20644
20641
|
op.sanitizer = sanitizerFn !== null ? importExpr(sanitizerFn) : null;
|
|
20645
|
-
if (op.sanitizer === null) {
|
|
20646
|
-
let isIframe = false;
|
|
20647
|
-
if (job.kind === CompilationJobKind.Host || op.kind === OpKind.DomProperty) {
|
|
20648
|
-
isIframe = true;
|
|
20649
|
-
} else {
|
|
20650
|
-
const ownerOp = elements.get(op.target);
|
|
20651
|
-
if (ownerOp === undefined || !isElementOrContainerOp(ownerOp)) {
|
|
20652
|
-
throw Error('Property should have an element-like owner');
|
|
20653
|
-
}
|
|
20654
|
-
isIframe = isIframeElement(ownerOp);
|
|
20655
|
-
}
|
|
20656
|
-
if (isIframe && isIframeSecuritySensitiveAttr(op.name)) {
|
|
20657
|
-
op.sanitizer = importExpr(Identifiers.validateIframeAttribute);
|
|
20658
|
-
}
|
|
20659
|
-
}
|
|
20660
20642
|
break;
|
|
20661
20643
|
}
|
|
20662
20644
|
}
|
|
20663
20645
|
}
|
|
20664
20646
|
}
|
|
20665
|
-
function isIframeElement(op) {
|
|
20666
|
-
return op.kind === OpKind.ElementStart && op.tag?.toLowerCase() === 'iframe';
|
|
20667
|
-
}
|
|
20668
20647
|
function getOnlySecurityContext(securityContext) {
|
|
20669
20648
|
if (Array.isArray(securityContext)) {
|
|
20670
20649
|
if (securityContext.length > 1) {
|
|
@@ -28044,7 +28023,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
28044
28023
|
function compileDeclareClassMetadata(metadata) {
|
|
28045
28024
|
const definitionMap = new DefinitionMap();
|
|
28046
28025
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
28047
|
-
definitionMap.set('version', literal('21.0.
|
|
28026
|
+
definitionMap.set('version', literal('21.0.2'));
|
|
28048
28027
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28049
28028
|
definitionMap.set('type', metadata.type);
|
|
28050
28029
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -28062,7 +28041,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
28062
28041
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
|
|
28063
28042
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
|
|
28064
28043
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
28065
|
-
definitionMap.set('version', literal('21.0.
|
|
28044
|
+
definitionMap.set('version', literal('21.0.2'));
|
|
28066
28045
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28067
28046
|
definitionMap.set('type', metadata.type);
|
|
28068
28047
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -28135,7 +28114,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
28135
28114
|
const definitionMap = new DefinitionMap();
|
|
28136
28115
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
28137
28116
|
definitionMap.set('minVersion', literal(minVersion));
|
|
28138
|
-
definitionMap.set('version', literal('21.0.
|
|
28117
|
+
definitionMap.set('version', literal('21.0.2'));
|
|
28139
28118
|
definitionMap.set('type', meta.type.value);
|
|
28140
28119
|
if (meta.isStandalone !== undefined) {
|
|
28141
28120
|
definitionMap.set('isStandalone', literal(meta.isStandalone));
|
|
@@ -28467,7 +28446,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
28467
28446
|
function compileDeclareFactoryFunction(meta) {
|
|
28468
28447
|
const definitionMap = new DefinitionMap();
|
|
28469
28448
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
28470
|
-
definitionMap.set('version', literal('21.0.
|
|
28449
|
+
definitionMap.set('version', literal('21.0.2'));
|
|
28471
28450
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28472
28451
|
definitionMap.set('type', meta.type.value);
|
|
28473
28452
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -28493,7 +28472,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
28493
28472
|
function createInjectableDefinitionMap(meta) {
|
|
28494
28473
|
const definitionMap = new DefinitionMap();
|
|
28495
28474
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
28496
|
-
definitionMap.set('version', literal('21.0.
|
|
28475
|
+
definitionMap.set('version', literal('21.0.2'));
|
|
28497
28476
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28498
28477
|
definitionMap.set('type', meta.type.value);
|
|
28499
28478
|
if (meta.providedIn !== undefined) {
|
|
@@ -28534,7 +28513,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
28534
28513
|
function createInjectorDefinitionMap(meta) {
|
|
28535
28514
|
const definitionMap = new DefinitionMap();
|
|
28536
28515
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
28537
|
-
definitionMap.set('version', literal('21.0.
|
|
28516
|
+
definitionMap.set('version', literal('21.0.2'));
|
|
28538
28517
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28539
28518
|
definitionMap.set('type', meta.type.value);
|
|
28540
28519
|
definitionMap.set('providers', meta.providers);
|
|
@@ -28561,7 +28540,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
28561
28540
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
28562
28541
|
}
|
|
28563
28542
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
28564
|
-
definitionMap.set('version', literal('21.0.
|
|
28543
|
+
definitionMap.set('version', literal('21.0.2'));
|
|
28565
28544
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28566
28545
|
definitionMap.set('type', meta.type.value);
|
|
28567
28546
|
if (meta.bootstrap.length > 0) {
|
|
@@ -28599,7 +28578,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
28599
28578
|
function createPipeDefinitionMap(meta) {
|
|
28600
28579
|
const definitionMap = new DefinitionMap();
|
|
28601
28580
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
28602
|
-
definitionMap.set('version', literal('21.0.
|
|
28581
|
+
definitionMap.set('version', literal('21.0.2'));
|
|
28603
28582
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28604
28583
|
definitionMap.set('type', meta.type.value);
|
|
28605
28584
|
if (meta.isStandalone !== undefined) {
|
|
@@ -28673,7 +28652,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
|
28673
28652
|
return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
|
|
28674
28653
|
}
|
|
28675
28654
|
|
|
28676
|
-
const VERSION = new Version('21.0.
|
|
28655
|
+
const VERSION = new Version('21.0.2');
|
|
28677
28656
|
|
|
28678
28657
|
publishFacade(_global);
|
|
28679
28658
|
|