@angular/compiler 14.2.0 → 14.2.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/esm2020/src/render3/partial/class_metadata.mjs +1 -1
- package/esm2020/src/render3/partial/directive.mjs +1 -1
- package/esm2020/src/render3/partial/factory.mjs +1 -1
- package/esm2020/src/render3/partial/injectable.mjs +1 -1
- package/esm2020/src/render3/partial/injector.mjs +1 -1
- package/esm2020/src/render3/partial/ng_module.mjs +1 -1
- package/esm2020/src/render3/partial/pipe.mjs +1 -1
- package/esm2020/src/schema/dom_element_schema_registry.mjs +28 -28
- package/esm2020/src/schema/dom_security_schema.mjs +19 -5
- package/esm2020/src/version.mjs +1 -1
- package/fesm2015/compiler.mjs +55 -40
- package/fesm2015/compiler.mjs.map +1 -1
- package/fesm2015/testing.mjs +1 -1
- package/fesm2020/compiler.mjs +54 -40
- package/fesm2020/compiler.mjs.map +1 -1
- package/fesm2020/testing.mjs +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -2
- package/testing/index.d.ts +1 -1
package/fesm2015/testing.mjs
CHANGED
package/fesm2020/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.2.
|
|
2
|
+
* @license Angular v14.2.2
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -14525,10 +14525,24 @@ function SECURITY_SCHEMA() {
|
|
|
14525
14525
|
registerContext(SecurityContext.STYLE, ['*|style']);
|
|
14526
14526
|
// NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.
|
|
14527
14527
|
registerContext(SecurityContext.URL, [
|
|
14528
|
-
'*|formAction',
|
|
14529
|
-
'
|
|
14530
|
-
'
|
|
14531
|
-
'
|
|
14528
|
+
'*|formAction',
|
|
14529
|
+
'area|href',
|
|
14530
|
+
'area|ping',
|
|
14531
|
+
'audio|src',
|
|
14532
|
+
'a|href',
|
|
14533
|
+
'a|ping',
|
|
14534
|
+
'blockquote|cite',
|
|
14535
|
+
'body|background',
|
|
14536
|
+
'del|cite',
|
|
14537
|
+
'form|action',
|
|
14538
|
+
'img|src',
|
|
14539
|
+
'input|src',
|
|
14540
|
+
'ins|cite',
|
|
14541
|
+
'q|cite',
|
|
14542
|
+
'source|src',
|
|
14543
|
+
'track|src',
|
|
14544
|
+
'video|poster',
|
|
14545
|
+
'video|src',
|
|
14532
14546
|
]);
|
|
14533
14547
|
registerContext(SecurityContext.RESOURCE_URL, [
|
|
14534
14548
|
'applet|code',
|
|
@@ -14784,42 +14798,42 @@ const SCHEMA = [
|
|
|
14784
14798
|
'time^[HTMLElement]|dateTime',
|
|
14785
14799
|
':svg:cursor^:svg:|',
|
|
14786
14800
|
];
|
|
14787
|
-
const _ATTR_TO_PROP = {
|
|
14801
|
+
const _ATTR_TO_PROP = new Map(Object.entries({
|
|
14788
14802
|
'class': 'className',
|
|
14789
14803
|
'for': 'htmlFor',
|
|
14790
14804
|
'formaction': 'formAction',
|
|
14791
14805
|
'innerHtml': 'innerHTML',
|
|
14792
14806
|
'readonly': 'readOnly',
|
|
14793
14807
|
'tabindex': 'tabIndex',
|
|
14794
|
-
};
|
|
14808
|
+
}));
|
|
14795
14809
|
// Invert _ATTR_TO_PROP.
|
|
14796
|
-
const _PROP_TO_ATTR =
|
|
14797
|
-
inverted
|
|
14810
|
+
const _PROP_TO_ATTR = Array.from(_ATTR_TO_PROP).reduce((inverted, [propertyName, attributeName]) => {
|
|
14811
|
+
inverted.set(propertyName, attributeName);
|
|
14798
14812
|
return inverted;
|
|
14799
|
-
},
|
|
14813
|
+
}, new Map());
|
|
14800
14814
|
class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
|
14801
14815
|
constructor() {
|
|
14802
14816
|
super();
|
|
14803
|
-
this._schema =
|
|
14817
|
+
this._schema = new Map();
|
|
14804
14818
|
// We don't allow binding to events for security reasons. Allowing event bindings would almost
|
|
14805
14819
|
// certainly introduce bad XSS vulnerabilities. Instead, we store events in a separate schema.
|
|
14806
|
-
this._eventSchema =
|
|
14820
|
+
this._eventSchema = new Map;
|
|
14807
14821
|
SCHEMA.forEach(encodedType => {
|
|
14808
|
-
const type =
|
|
14822
|
+
const type = new Map();
|
|
14809
14823
|
const events = new Set();
|
|
14810
14824
|
const [strType, strProperties] = encodedType.split('|');
|
|
14811
14825
|
const properties = strProperties.split(',');
|
|
14812
14826
|
const [typeNames, superName] = strType.split('^');
|
|
14813
14827
|
typeNames.split(',').forEach(tag => {
|
|
14814
|
-
this._schema
|
|
14815
|
-
this._eventSchema
|
|
14828
|
+
this._schema.set(tag.toLowerCase(), type);
|
|
14829
|
+
this._eventSchema.set(tag.toLowerCase(), events);
|
|
14816
14830
|
});
|
|
14817
|
-
const superType = superName && this._schema
|
|
14831
|
+
const superType = superName && this._schema.get(superName.toLowerCase());
|
|
14818
14832
|
if (superType) {
|
|
14819
|
-
|
|
14820
|
-
type
|
|
14821
|
-
}
|
|
14822
|
-
for (const superEvent of this._eventSchema
|
|
14833
|
+
for (const [prop, value] of superType) {
|
|
14834
|
+
type.set(prop, value);
|
|
14835
|
+
}
|
|
14836
|
+
for (const superEvent of this._eventSchema.get(superName.toLowerCase())) {
|
|
14823
14837
|
events.add(superEvent);
|
|
14824
14838
|
}
|
|
14825
14839
|
}
|
|
@@ -14830,16 +14844,16 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
|
|
14830
14844
|
events.add(property.substring(1));
|
|
14831
14845
|
break;
|
|
14832
14846
|
case '!':
|
|
14833
|
-
type
|
|
14847
|
+
type.set(property.substring(1), BOOLEAN);
|
|
14834
14848
|
break;
|
|
14835
14849
|
case '#':
|
|
14836
|
-
type
|
|
14850
|
+
type.set(property.substring(1), NUMBER);
|
|
14837
14851
|
break;
|
|
14838
14852
|
case '%':
|
|
14839
|
-
type
|
|
14853
|
+
type.set(property.substring(1), OBJECT);
|
|
14840
14854
|
break;
|
|
14841
14855
|
default:
|
|
14842
|
-
type
|
|
14856
|
+
type.set(property, STRING);
|
|
14843
14857
|
}
|
|
14844
14858
|
}
|
|
14845
14859
|
});
|
|
@@ -14859,8 +14873,8 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
|
|
14859
14873
|
return true;
|
|
14860
14874
|
}
|
|
14861
14875
|
}
|
|
14862
|
-
const elementProperties = this._schema
|
|
14863
|
-
return
|
|
14876
|
+
const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown');
|
|
14877
|
+
return elementProperties.has(propName);
|
|
14864
14878
|
}
|
|
14865
14879
|
hasElement(tagName, schemaMetas) {
|
|
14866
14880
|
if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) {
|
|
@@ -14875,7 +14889,7 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
|
|
14875
14889
|
return true;
|
|
14876
14890
|
}
|
|
14877
14891
|
}
|
|
14878
|
-
return
|
|
14892
|
+
return this._schema.has(tagName.toLowerCase());
|
|
14879
14893
|
}
|
|
14880
14894
|
/**
|
|
14881
14895
|
* securityContext returns the security context for the given property on the given DOM tag.
|
|
@@ -14904,7 +14918,7 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
|
|
14904
14918
|
return ctx ? ctx : SecurityContext.NONE;
|
|
14905
14919
|
}
|
|
14906
14920
|
getMappedPropName(propName) {
|
|
14907
|
-
return _ATTR_TO_PROP
|
|
14921
|
+
return _ATTR_TO_PROP.get(propName) ?? propName;
|
|
14908
14922
|
}
|
|
14909
14923
|
getDefaultComponentElementName() {
|
|
14910
14924
|
return 'ng-component';
|
|
@@ -14932,15 +14946,15 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
|
|
14932
14946
|
}
|
|
14933
14947
|
}
|
|
14934
14948
|
allKnownElementNames() {
|
|
14935
|
-
return
|
|
14949
|
+
return Array.from(this._schema.keys());
|
|
14936
14950
|
}
|
|
14937
14951
|
allKnownAttributesOfElement(tagName) {
|
|
14938
|
-
const elementProperties = this._schema
|
|
14952
|
+
const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown');
|
|
14939
14953
|
// Convert properties to attributes.
|
|
14940
|
-
return
|
|
14954
|
+
return Array.from(elementProperties.keys()).map(prop => _PROP_TO_ATTR.get(prop) ?? prop);
|
|
14941
14955
|
}
|
|
14942
14956
|
allKnownEventsOfElement(tagName) {
|
|
14943
|
-
return Array.from(this._eventSchema
|
|
14957
|
+
return Array.from(this._eventSchema.get(tagName.toLowerCase()) ?? []);
|
|
14944
14958
|
}
|
|
14945
14959
|
normalizeAnimationStyleProperty(propName) {
|
|
14946
14960
|
return dashCaseToCamelCase(propName);
|
|
@@ -19904,7 +19918,7 @@ function publishFacade(global) {
|
|
|
19904
19918
|
* Use of this source code is governed by an MIT-style license that can be
|
|
19905
19919
|
* found in the LICENSE file at https://angular.io/license
|
|
19906
19920
|
*/
|
|
19907
|
-
const VERSION = new Version('14.2.
|
|
19921
|
+
const VERSION = new Version('14.2.2');
|
|
19908
19922
|
|
|
19909
19923
|
/**
|
|
19910
19924
|
* @license
|
|
@@ -21937,7 +21951,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
|
|
|
21937
21951
|
function compileDeclareClassMetadata(metadata) {
|
|
21938
21952
|
const definitionMap = new DefinitionMap();
|
|
21939
21953
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
|
|
21940
|
-
definitionMap.set('version', literal('14.2.
|
|
21954
|
+
definitionMap.set('version', literal('14.2.2'));
|
|
21941
21955
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
21942
21956
|
definitionMap.set('type', metadata.type);
|
|
21943
21957
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -22054,7 +22068,7 @@ function compileDeclareDirectiveFromMetadata(meta) {
|
|
|
22054
22068
|
function createDirectiveDefinitionMap(meta) {
|
|
22055
22069
|
const definitionMap = new DefinitionMap();
|
|
22056
22070
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
22057
|
-
definitionMap.set('version', literal('14.2.
|
|
22071
|
+
definitionMap.set('version', literal('14.2.2'));
|
|
22058
22072
|
// e.g. `type: MyDirective`
|
|
22059
22073
|
definitionMap.set('type', meta.internalType);
|
|
22060
22074
|
if (meta.isStandalone) {
|
|
@@ -22268,7 +22282,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
22268
22282
|
function compileDeclareFactoryFunction(meta) {
|
|
22269
22283
|
const definitionMap = new DefinitionMap();
|
|
22270
22284
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
22271
|
-
definitionMap.set('version', literal('14.2.
|
|
22285
|
+
definitionMap.set('version', literal('14.2.2'));
|
|
22272
22286
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22273
22287
|
definitionMap.set('type', meta.internalType);
|
|
22274
22288
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -22310,7 +22324,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
22310
22324
|
function createInjectableDefinitionMap(meta) {
|
|
22311
22325
|
const definitionMap = new DefinitionMap();
|
|
22312
22326
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
22313
|
-
definitionMap.set('version', literal('14.2.
|
|
22327
|
+
definitionMap.set('version', literal('14.2.2'));
|
|
22314
22328
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22315
22329
|
definitionMap.set('type', meta.internalType);
|
|
22316
22330
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -22368,7 +22382,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
22368
22382
|
function createInjectorDefinitionMap(meta) {
|
|
22369
22383
|
const definitionMap = new DefinitionMap();
|
|
22370
22384
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
22371
|
-
definitionMap.set('version', literal('14.2.
|
|
22385
|
+
definitionMap.set('version', literal('14.2.2'));
|
|
22372
22386
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22373
22387
|
definitionMap.set('type', meta.internalType);
|
|
22374
22388
|
definitionMap.set('providers', meta.providers);
|
|
@@ -22405,7 +22419,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
|
|
|
22405
22419
|
function createNgModuleDefinitionMap(meta) {
|
|
22406
22420
|
const definitionMap = new DefinitionMap();
|
|
22407
22421
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
22408
|
-
definitionMap.set('version', literal('14.2.
|
|
22422
|
+
definitionMap.set('version', literal('14.2.2'));
|
|
22409
22423
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22410
22424
|
definitionMap.set('type', meta.internalType);
|
|
22411
22425
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -22463,7 +22477,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
22463
22477
|
function createPipeDefinitionMap(meta) {
|
|
22464
22478
|
const definitionMap = new DefinitionMap();
|
|
22465
22479
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
22466
|
-
definitionMap.set('version', literal('14.2.
|
|
22480
|
+
definitionMap.set('version', literal('14.2.2'));
|
|
22467
22481
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22468
22482
|
// e.g. `type: MyPipe`
|
|
22469
22483
|
definitionMap.set('type', meta.internalType);
|