@angular/language-service 12.2.15 → 12.2.17

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/ivy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.2.15
2
+ * @license Angular v12.2.17
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  * License: MIT
5
5
  */
@@ -2557,6 +2557,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
2557
2557
  Identifiers.sanitizeUrlOrResourceUrl = { name: 'ɵɵsanitizeUrlOrResourceUrl', moduleName: CORE };
2558
2558
  Identifiers.trustConstantHtml = { name: 'ɵɵtrustConstantHtml', moduleName: CORE };
2559
2559
  Identifiers.trustConstantResourceUrl = { name: 'ɵɵtrustConstantResourceUrl', moduleName: CORE };
2560
+ Identifiers.validateIframeAttribute = { name: 'ɵɵvalidateIframeAttribute', moduleName: CORE };
2560
2561
 
2561
2562
  /**
2562
2563
  * @license
@@ -7817,6 +7818,84 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
7817
7818
  }
7818
7819
  }
7819
7820
 
7821
+ /**
7822
+ * @license
7823
+ * Copyright Google LLC All Rights Reserved.
7824
+ *
7825
+ * Use of this source code is governed by an MIT-style license that can be
7826
+ * found in the LICENSE file at https://angular.io/license
7827
+ */
7828
+ // =================================================================================================
7829
+ // =================================================================================================
7830
+ // =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P ===========
7831
+ // =================================================================================================
7832
+ // =================================================================================================
7833
+ //
7834
+ // DO NOT EDIT THIS LIST OF SECURITY SENSITIVE PROPERTIES WITHOUT A SECURITY REVIEW!
7835
+ // Reach out to mprobst for details.
7836
+ //
7837
+ // =================================================================================================
7838
+ /** Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'. */
7839
+ let _SECURITY_SCHEMA;
7840
+ function SECURITY_SCHEMA() {
7841
+ if (!_SECURITY_SCHEMA) {
7842
+ _SECURITY_SCHEMA = {};
7843
+ // Case is insignificant below, all element and attribute names are lower-cased for lookup.
7844
+ registerContext(SecurityContext.HTML, [
7845
+ 'iframe|srcdoc',
7846
+ '*|innerHTML',
7847
+ '*|outerHTML',
7848
+ ]);
7849
+ registerContext(SecurityContext.STYLE, ['*|style']);
7850
+ // NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.
7851
+ registerContext(SecurityContext.URL, [
7852
+ '*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href',
7853
+ 'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action',
7854
+ 'img|src', 'img|srcset', 'input|src', 'ins|cite', 'q|cite',
7855
+ 'source|src', 'source|srcset', 'track|src', 'video|poster', 'video|src',
7856
+ ]);
7857
+ registerContext(SecurityContext.RESOURCE_URL, [
7858
+ 'applet|code',
7859
+ 'applet|codebase',
7860
+ 'base|href',
7861
+ 'embed|src',
7862
+ 'frame|src',
7863
+ 'head|profile',
7864
+ 'html|manifest',
7865
+ 'iframe|src',
7866
+ 'link|href',
7867
+ 'media|src',
7868
+ 'object|codebase',
7869
+ 'object|data',
7870
+ 'script|src',
7871
+ ]);
7872
+ }
7873
+ return _SECURITY_SCHEMA;
7874
+ }
7875
+ function registerContext(ctx, specs) {
7876
+ for (const spec of specs)
7877
+ _SECURITY_SCHEMA[spec.toLowerCase()] = ctx;
7878
+ }
7879
+ /**
7880
+ * The set of security-sensitive attributes of an `<iframe>` that *must* be
7881
+ * applied as a static attribute only. This ensures that all security-sensitive
7882
+ * attributes are taken into account while creating an instance of an `<iframe>`
7883
+ * at runtime.
7884
+ *
7885
+ * Note: avoid using this set directly, use the `isIframeSecuritySensitiveAttr` function
7886
+ * in the code instead.
7887
+ */
7888
+ const IFRAME_SECURITY_SENSITIVE_ATTRS = new Set(['sandbox', 'allow', 'allowfullscreen', 'referrerpolicy', 'csp', 'fetchpriority']);
7889
+ /**
7890
+ * Checks whether a given attribute name might represent a security-sensitive
7891
+ * attribute of an <iframe>.
7892
+ */
7893
+ function isIframeSecuritySensitiveAttr(attrName) {
7894
+ // The `setAttribute` DOM API is case-insensitive, so we lowercase the value
7895
+ // before checking it against a known security-sensitive attributes.
7896
+ return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
7897
+ }
7898
+
7820
7899
  /**
7821
7900
  * @license
7822
7901
  * Copyright Google LLC All Rights Reserved.
@@ -15231,65 +15310,6 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
15231
15310
  })));
15232
15311
  }
15233
15312
 
15234
- /**
15235
- * @license
15236
- * Copyright Google LLC All Rights Reserved.
15237
- *
15238
- * Use of this source code is governed by an MIT-style license that can be
15239
- * found in the LICENSE file at https://angular.io/license
15240
- */
15241
- // =================================================================================================
15242
- // =================================================================================================
15243
- // =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P ===========
15244
- // =================================================================================================
15245
- // =================================================================================================
15246
- //
15247
- // DO NOT EDIT THIS LIST OF SECURITY SENSITIVE PROPERTIES WITHOUT A SECURITY REVIEW!
15248
- // Reach out to mprobst for details.
15249
- //
15250
- // =================================================================================================
15251
- /** Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'. */
15252
- let _SECURITY_SCHEMA;
15253
- function SECURITY_SCHEMA() {
15254
- if (!_SECURITY_SCHEMA) {
15255
- _SECURITY_SCHEMA = {};
15256
- // Case is insignificant below, all element and attribute names are lower-cased for lookup.
15257
- registerContext(SecurityContext.HTML, [
15258
- 'iframe|srcdoc',
15259
- '*|innerHTML',
15260
- '*|outerHTML',
15261
- ]);
15262
- registerContext(SecurityContext.STYLE, ['*|style']);
15263
- // NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.
15264
- registerContext(SecurityContext.URL, [
15265
- '*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href',
15266
- 'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action',
15267
- 'img|src', 'img|srcset', 'input|src', 'ins|cite', 'q|cite',
15268
- 'source|src', 'source|srcset', 'track|src', 'video|poster', 'video|src',
15269
- ]);
15270
- registerContext(SecurityContext.RESOURCE_URL, [
15271
- 'applet|code',
15272
- 'applet|codebase',
15273
- 'base|href',
15274
- 'embed|src',
15275
- 'frame|src',
15276
- 'head|profile',
15277
- 'html|manifest',
15278
- 'iframe|src',
15279
- 'link|href',
15280
- 'media|src',
15281
- 'object|codebase',
15282
- 'object|data',
15283
- 'script|src',
15284
- ]);
15285
- }
15286
- return _SECURITY_SCHEMA;
15287
- }
15288
- function registerContext(ctx, specs) {
15289
- for (const spec of specs)
15290
- _SECURITY_SCHEMA[spec.toLowerCase()] = ctx;
15291
- }
15292
-
15293
15313
  /**
15294
15314
  * @license
15295
15315
  * Copyright Google LLC All Rights Reserved.
@@ -17768,9 +17788,19 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
17768
17788
  const params = [];
17769
17789
  const [attrNamespace, attrName] = splitNsName(input.name);
17770
17790
  const isAttributeBinding = inputType === 1 /* Attribute */;
17771
- const sanitizationRef = resolveSanitizationFn(input.securityContext, isAttributeBinding);
17772
- if (sanitizationRef)
17791
+ let sanitizationRef = resolveSanitizationFn(input.securityContext, isAttributeBinding);
17792
+ if (!sanitizationRef) {
17793
+ // If there was no sanitization function found based on the security context
17794
+ // of an attribute/property - check whether this attribute/property is
17795
+ // one of the security-sensitive <iframe> attributes (and that the current
17796
+ // element is actually an <iframe>).
17797
+ if (isIframeElement(element.name) && isIframeSecuritySensitiveAttr(input.name)) {
17798
+ sanitizationRef = importExpr(Identifiers.validateIframeAttribute);
17799
+ }
17800
+ }
17801
+ if (sanitizationRef) {
17773
17802
  params.push(sanitizationRef);
17803
+ }
17774
17804
  if (attrNamespace) {
17775
17805
  const namespaceLiteral = literal(attrNamespace);
17776
17806
  if (sanitizationRef) {
@@ -18893,6 +18923,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
18893
18923
  function isTextNode(node) {
18894
18924
  return node instanceof Text || node instanceof BoundText || node instanceof Icu;
18895
18925
  }
18926
+ function isIframeElement(tagName) {
18927
+ return tagName.toLowerCase() === 'iframe';
18928
+ }
18896
18929
  function hasTextChildrenOnly(children) {
18897
18930
  return children.every(isTextNode);
18898
18931
  }
@@ -19349,6 +19382,20 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
19349
19382
  if (sanitizerFn) {
19350
19383
  instructionParams.push(sanitizerFn);
19351
19384
  }
19385
+ else {
19386
+ // If there was no sanitization function found based on the security context
19387
+ // of an attribute/property binding - check whether this attribute/property is
19388
+ // one of the security-sensitive <iframe> attributes.
19389
+ // Note: for host bindings defined on a directive, we do not try to find all
19390
+ // possible places where it can be matched, so we can not determine whether
19391
+ // the host element is an <iframe>. In this case, if an attribute/binding
19392
+ // name is in the `IFRAME_SECURITY_SENSITIVE_ATTRS` set - append a validation
19393
+ // function, which would be invoked at runtime and would have access to the
19394
+ // underlying DOM element, check if it's an <iframe> and if so - runs extra checks.
19395
+ if (isIframeSecuritySensitiveAttr(bindingName)) {
19396
+ instructionParams.push(importExpr(Identifiers.validateIframeAttribute));
19397
+ }
19398
+ }
19352
19399
  updateStatements.push(...bindingExpr.stmts);
19353
19400
  if (instruction === Identifiers.hostProperty) {
19354
19401
  propertyBindings.push(instructionParams);
@@ -20028,7 +20075,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
20028
20075
  * Use of this source code is governed by an MIT-style license that can be
20029
20076
  * found in the LICENSE file at https://angular.io/license
20030
20077
  */
20031
- const VERSION$1 = new Version('12.2.15');
20078
+ const VERSION$1 = new Version('12.2.17');
20032
20079
 
20033
20080
  /**
20034
20081
  * @license
@@ -20667,7 +20714,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
20667
20714
  function compileDeclareClassMetadata(metadata) {
20668
20715
  const definitionMap = new DefinitionMap();
20669
20716
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
20670
- definitionMap.set('version', literal('12.2.15'));
20717
+ definitionMap.set('version', literal('12.2.17'));
20671
20718
  definitionMap.set('ngImport', importExpr(Identifiers.core));
20672
20719
  definitionMap.set('type', metadata.type);
20673
20720
  definitionMap.set('decorators', metadata.decorators);
@@ -20784,7 +20831,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
20784
20831
  function createDirectiveDefinitionMap(meta) {
20785
20832
  const definitionMap = new DefinitionMap();
20786
20833
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
20787
- definitionMap.set('version', literal('12.2.15'));
20834
+ definitionMap.set('version', literal('12.2.17'));
20788
20835
  // e.g. `type: MyDirective`
20789
20836
  definitionMap.set('type', meta.internalType);
20790
20837
  // e.g. `selector: 'some-dir'`
@@ -21002,7 +21049,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
21002
21049
  function compileDeclareFactoryFunction(meta) {
21003
21050
  const definitionMap = new DefinitionMap();
21004
21051
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
21005
- definitionMap.set('version', literal('12.2.15'));
21052
+ definitionMap.set('version', literal('12.2.17'));
21006
21053
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21007
21054
  definitionMap.set('type', meta.internalType);
21008
21055
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -21044,7 +21091,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
21044
21091
  function createInjectableDefinitionMap(meta) {
21045
21092
  const definitionMap = new DefinitionMap();
21046
21093
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
21047
- definitionMap.set('version', literal('12.2.15'));
21094
+ definitionMap.set('version', literal('12.2.17'));
21048
21095
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21049
21096
  definitionMap.set('type', meta.internalType);
21050
21097
  // Only generate providedIn property if it has a non-null value
@@ -21102,7 +21149,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
21102
21149
  function createInjectorDefinitionMap(meta) {
21103
21150
  const definitionMap = new DefinitionMap();
21104
21151
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
21105
- definitionMap.set('version', literal('12.2.15'));
21152
+ definitionMap.set('version', literal('12.2.17'));
21106
21153
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21107
21154
  definitionMap.set('type', meta.internalType);
21108
21155
  definitionMap.set('providers', meta.providers);
@@ -21139,7 +21186,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
21139
21186
  function createNgModuleDefinitionMap(meta) {
21140
21187
  const definitionMap = new DefinitionMap();
21141
21188
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
21142
- definitionMap.set('version', literal('12.2.15'));
21189
+ definitionMap.set('version', literal('12.2.17'));
21143
21190
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21144
21191
  definitionMap.set('type', meta.internalType);
21145
21192
  // We only generate the keys in the metadata if the arrays contain values.
@@ -21197,7 +21244,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
21197
21244
  function createPipeDefinitionMap(meta) {
21198
21245
  const definitionMap = new DefinitionMap();
21199
21246
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21200
- definitionMap.set('version', literal('12.2.15'));
21247
+ definitionMap.set('version', literal('12.2.17'));
21201
21248
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21202
21249
  // e.g. `type: MyPipe`
21203
21250
  definitionMap.set('type', meta.internalType);
@@ -21229,7 +21276,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
21229
21276
  * Use of this source code is governed by an MIT-style license that can be
21230
21277
  * found in the LICENSE file at https://angular.io/license
21231
21278
  */
21232
- const VERSION$2 = new Version('12.2.15');
21279
+ const VERSION$2 = new Version('12.2.17');
21233
21280
 
21234
21281
  /**
21235
21282
  * @license
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.2.15
2
+ * @license Angular v12.2.17
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  * License: MIT
5
5
  */
@@ -2176,6 +2176,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
2176
2176
  Identifiers.sanitizeUrlOrResourceUrl = { name: 'ɵɵsanitizeUrlOrResourceUrl', moduleName: CORE };
2177
2177
  Identifiers.trustConstantHtml = { name: 'ɵɵtrustConstantHtml', moduleName: CORE };
2178
2178
  Identifiers.trustConstantResourceUrl = { name: 'ɵɵtrustConstantResourceUrl', moduleName: CORE };
2179
+ Identifiers.validateIframeAttribute = { name: 'ɵɵvalidateIframeAttribute', moduleName: CORE };
2179
2180
 
2180
2181
  /**
2181
2182
  * @license
@@ -7529,6 +7530,84 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
7529
7530
  }
7530
7531
  }
7531
7532
 
7533
+ /**
7534
+ * @license
7535
+ * Copyright Google LLC All Rights Reserved.
7536
+ *
7537
+ * Use of this source code is governed by an MIT-style license that can be
7538
+ * found in the LICENSE file at https://angular.io/license
7539
+ */
7540
+ // =================================================================================================
7541
+ // =================================================================================================
7542
+ // =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P ===========
7543
+ // =================================================================================================
7544
+ // =================================================================================================
7545
+ //
7546
+ // DO NOT EDIT THIS LIST OF SECURITY SENSITIVE PROPERTIES WITHOUT A SECURITY REVIEW!
7547
+ // Reach out to mprobst for details.
7548
+ //
7549
+ // =================================================================================================
7550
+ /** Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'. */
7551
+ let _SECURITY_SCHEMA;
7552
+ function SECURITY_SCHEMA() {
7553
+ if (!_SECURITY_SCHEMA) {
7554
+ _SECURITY_SCHEMA = {};
7555
+ // Case is insignificant below, all element and attribute names are lower-cased for lookup.
7556
+ registerContext(SecurityContext.HTML, [
7557
+ 'iframe|srcdoc',
7558
+ '*|innerHTML',
7559
+ '*|outerHTML',
7560
+ ]);
7561
+ registerContext(SecurityContext.STYLE, ['*|style']);
7562
+ // NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.
7563
+ registerContext(SecurityContext.URL, [
7564
+ '*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href',
7565
+ 'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action',
7566
+ 'img|src', 'img|srcset', 'input|src', 'ins|cite', 'q|cite',
7567
+ 'source|src', 'source|srcset', 'track|src', 'video|poster', 'video|src',
7568
+ ]);
7569
+ registerContext(SecurityContext.RESOURCE_URL, [
7570
+ 'applet|code',
7571
+ 'applet|codebase',
7572
+ 'base|href',
7573
+ 'embed|src',
7574
+ 'frame|src',
7575
+ 'head|profile',
7576
+ 'html|manifest',
7577
+ 'iframe|src',
7578
+ 'link|href',
7579
+ 'media|src',
7580
+ 'object|codebase',
7581
+ 'object|data',
7582
+ 'script|src',
7583
+ ]);
7584
+ }
7585
+ return _SECURITY_SCHEMA;
7586
+ }
7587
+ function registerContext(ctx, specs) {
7588
+ for (const spec of specs)
7589
+ _SECURITY_SCHEMA[spec.toLowerCase()] = ctx;
7590
+ }
7591
+ /**
7592
+ * The set of security-sensitive attributes of an `<iframe>` that *must* be
7593
+ * applied as a static attribute only. This ensures that all security-sensitive
7594
+ * attributes are taken into account while creating an instance of an `<iframe>`
7595
+ * at runtime.
7596
+ *
7597
+ * Note: avoid using this set directly, use the `isIframeSecuritySensitiveAttr` function
7598
+ * in the code instead.
7599
+ */
7600
+ const IFRAME_SECURITY_SENSITIVE_ATTRS = new Set(['sandbox', 'allow', 'allowfullscreen', 'referrerpolicy', 'csp', 'fetchpriority']);
7601
+ /**
7602
+ * Checks whether a given attribute name might represent a security-sensitive
7603
+ * attribute of an <iframe>.
7604
+ */
7605
+ function isIframeSecuritySensitiveAttr(attrName) {
7606
+ // The `setAttribute` DOM API is case-insensitive, so we lowercase the value
7607
+ // before checking it against a known security-sensitive attributes.
7608
+ return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
7609
+ }
7610
+
7532
7611
  /**
7533
7612
  * @license
7534
7613
  * Copyright Google LLC All Rights Reserved.
@@ -16837,65 +16916,6 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
16837
16916
  })));
16838
16917
  }
16839
16918
 
16840
- /**
16841
- * @license
16842
- * Copyright Google LLC All Rights Reserved.
16843
- *
16844
- * Use of this source code is governed by an MIT-style license that can be
16845
- * found in the LICENSE file at https://angular.io/license
16846
- */
16847
- // =================================================================================================
16848
- // =================================================================================================
16849
- // =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P ===========
16850
- // =================================================================================================
16851
- // =================================================================================================
16852
- //
16853
- // DO NOT EDIT THIS LIST OF SECURITY SENSITIVE PROPERTIES WITHOUT A SECURITY REVIEW!
16854
- // Reach out to mprobst for details.
16855
- //
16856
- // =================================================================================================
16857
- /** Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'. */
16858
- let _SECURITY_SCHEMA;
16859
- function SECURITY_SCHEMA() {
16860
- if (!_SECURITY_SCHEMA) {
16861
- _SECURITY_SCHEMA = {};
16862
- // Case is insignificant below, all element and attribute names are lower-cased for lookup.
16863
- registerContext(SecurityContext.HTML, [
16864
- 'iframe|srcdoc',
16865
- '*|innerHTML',
16866
- '*|outerHTML',
16867
- ]);
16868
- registerContext(SecurityContext.STYLE, ['*|style']);
16869
- // NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.
16870
- registerContext(SecurityContext.URL, [
16871
- '*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href',
16872
- 'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action',
16873
- 'img|src', 'img|srcset', 'input|src', 'ins|cite', 'q|cite',
16874
- 'source|src', 'source|srcset', 'track|src', 'video|poster', 'video|src',
16875
- ]);
16876
- registerContext(SecurityContext.RESOURCE_URL, [
16877
- 'applet|code',
16878
- 'applet|codebase',
16879
- 'base|href',
16880
- 'embed|src',
16881
- 'frame|src',
16882
- 'head|profile',
16883
- 'html|manifest',
16884
- 'iframe|src',
16885
- 'link|href',
16886
- 'media|src',
16887
- 'object|codebase',
16888
- 'object|data',
16889
- 'script|src',
16890
- ]);
16891
- }
16892
- return _SECURITY_SCHEMA;
16893
- }
16894
- function registerContext(ctx, specs) {
16895
- for (const spec of specs)
16896
- _SECURITY_SCHEMA[spec.toLowerCase()] = ctx;
16897
- }
16898
-
16899
16919
  /**
16900
16920
  * @license
16901
16921
  * Copyright Google LLC All Rights Reserved.
@@ -19374,9 +19394,19 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
19374
19394
  const params = [];
19375
19395
  const [attrNamespace, attrName] = splitNsName(input.name);
19376
19396
  const isAttributeBinding = inputType === 1 /* Attribute */;
19377
- const sanitizationRef = resolveSanitizationFn(input.securityContext, isAttributeBinding);
19378
- if (sanitizationRef)
19397
+ let sanitizationRef = resolveSanitizationFn(input.securityContext, isAttributeBinding);
19398
+ if (!sanitizationRef) {
19399
+ // If there was no sanitization function found based on the security context
19400
+ // of an attribute/property - check whether this attribute/property is
19401
+ // one of the security-sensitive <iframe> attributes (and that the current
19402
+ // element is actually an <iframe>).
19403
+ if (isIframeElement(element.name) && isIframeSecuritySensitiveAttr(input.name)) {
19404
+ sanitizationRef = importExpr(Identifiers.validateIframeAttribute);
19405
+ }
19406
+ }
19407
+ if (sanitizationRef) {
19379
19408
  params.push(sanitizationRef);
19409
+ }
19380
19410
  if (attrNamespace) {
19381
19411
  const namespaceLiteral = literal(attrNamespace);
19382
19412
  if (sanitizationRef) {
@@ -20499,6 +20529,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
20499
20529
  function isTextNode(node) {
20500
20530
  return node instanceof Text || node instanceof BoundText || node instanceof Icu;
20501
20531
  }
20532
+ function isIframeElement(tagName) {
20533
+ return tagName.toLowerCase() === 'iframe';
20534
+ }
20502
20535
  function hasTextChildrenOnly(children) {
20503
20536
  return children.every(isTextNode);
20504
20537
  }
@@ -20955,6 +20988,20 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
20955
20988
  if (sanitizerFn) {
20956
20989
  instructionParams.push(sanitizerFn);
20957
20990
  }
20991
+ else {
20992
+ // If there was no sanitization function found based on the security context
20993
+ // of an attribute/property binding - check whether this attribute/property is
20994
+ // one of the security-sensitive <iframe> attributes.
20995
+ // Note: for host bindings defined on a directive, we do not try to find all
20996
+ // possible places where it can be matched, so we can not determine whether
20997
+ // the host element is an <iframe>. In this case, if an attribute/binding
20998
+ // name is in the `IFRAME_SECURITY_SENSITIVE_ATTRS` set - append a validation
20999
+ // function, which would be invoked at runtime and would have access to the
21000
+ // underlying DOM element, check if it's an <iframe> and if so - runs extra checks.
21001
+ if (isIframeSecuritySensitiveAttr(bindingName)) {
21002
+ instructionParams.push(importExpr(Identifiers.validateIframeAttribute));
21003
+ }
21004
+ }
20958
21005
  updateStatements.push(...bindingExpr.stmts);
20959
21006
  if (instruction === Identifiers.hostProperty) {
20960
21007
  propertyBindings.push(instructionParams);
@@ -21634,7 +21681,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
21634
21681
  * Use of this source code is governed by an MIT-style license that can be
21635
21682
  * found in the LICENSE file at https://angular.io/license
21636
21683
  */
21637
- const VERSION$1 = new Version('12.2.15');
21684
+ const VERSION$1 = new Version('12.2.17');
21638
21685
 
21639
21686
  /**
21640
21687
  * @license
@@ -29569,6 +29616,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
29569
29616
  "300" /* MULTIPLE_COMPONENTS_MATCH */,
29570
29617
  "301" /* EXPORT_NOT_FOUND */,
29571
29618
  "302" /* PIPE_NOT_FOUND */,
29619
+ "910" /* UNSAFE_IFRAME_ATTRS */,
29572
29620
  ]);
29573
29621
  /* tslint:enable:no-toplevel-property-access */
29574
29622
  /** Called to format a runtime error */
@@ -32902,194 +32950,23 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
32902
32950
  * found in the LICENSE file at https://angular.io/license
32903
32951
  */
32904
32952
  /**
32905
- * The Trusted Types policy, or null if Trusted Types are not
32906
- * enabled/supported, or undefined if the policy has not been created yet.
32907
- */
32908
- let policy$1;
32909
- /**
32910
- * Returns the Trusted Types policy, or null if Trusted Types are not
32911
- * enabled/supported. The first call to this function will create the policy.
32912
- */
32913
- function getPolicy$1() {
32914
- if (policy$1 === undefined) {
32915
- policy$1 = null;
32916
- if (_global$1.trustedTypes) {
32917
- try {
32918
- policy$1 = _global$1.trustedTypes.createPolicy('angular', {
32919
- createHTML: (s) => s,
32920
- createScript: (s) => s,
32921
- createScriptURL: (s) => s,
32922
- });
32923
- }
32924
- catch (_a) {
32925
- // trustedTypes.createPolicy throws if called with a name that is
32926
- // already registered, even in report-only mode. Until the API changes,
32927
- // catch the error not to break the applications functionally. In such
32928
- // cases, the code will fall back to using strings.
32929
- }
32930
- }
32931
- }
32932
- return policy$1;
32933
- }
32934
- /**
32935
- * Unsafely promote a string to a TrustedScript, falling back to strings when
32936
- * Trusted Types are not available.
32937
- * @security In particular, it must be assured that the provided string will
32938
- * never cause an XSS vulnerability if used in a context that will be
32939
- * interpreted and executed as a script by a browser, e.g. when calling eval.
32940
- */
32941
- function trustedScriptFromString$1(script) {
32942
- var _a;
32943
- return ((_a = getPolicy$1()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;
32944
- }
32945
- /**
32946
- * Unsafely call the Function constructor with the given string arguments. It
32947
- * is only available in development mode, and should be stripped out of
32948
- * production code.
32949
- * @security This is a security-sensitive function; any use of this function
32950
- * must go through security review. In particular, it must be assured that it
32951
- * is only called from development code, as use in production code can lead to
32952
- * XSS vulnerabilities.
32953
- */
32954
- function newTrustedFunctionForDev(...args) {
32955
- if (typeof ngDevMode === 'undefined') {
32956
- throw new Error('newTrustedFunctionForDev should never be called in production');
32957
- }
32958
- if (!_global$1.trustedTypes) {
32959
- // In environments that don't support Trusted Types, fall back to the most
32960
- // straightforward implementation:
32961
- return new Function(...args);
32962
- }
32963
- // Chrome currently does not support passing TrustedScript to the Function
32964
- // constructor. The following implements the workaround proposed on the page
32965
- // below, where the Chromium bug is also referenced:
32966
- // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor
32967
- const fnArgs = args.slice(0, -1).join(',');
32968
- const fnBody = args[args.length - 1];
32969
- const body = `(function anonymous(${fnArgs}
32970
- ) { ${fnBody}
32971
- })`;
32972
- // Using eval directly confuses the compiler and prevents this module from
32973
- // being stripped out of JS binaries even if not used. The global['eval']
32974
- // indirection fixes that.
32975
- const fn = _global$1['eval'](trustedScriptFromString$1(body));
32976
- if (fn.bind === undefined) {
32977
- // Workaround for a browser bug that only exists in Chrome 83, where passing
32978
- // a TrustedScript to eval just returns the TrustedScript back without
32979
- // evaluating it. In that case, fall back to the most straightforward
32980
- // implementation:
32981
- return new Function(...args);
32982
- }
32983
- // To completely mimic the behavior of calling "new Function", two more
32984
- // things need to happen:
32985
- // 1. Stringifying the resulting function should return its source code
32986
- fn.toString = () => body;
32987
- // 2. When calling the resulting function, `this` should refer to `global`
32988
- return fn.bind(_global$1);
32989
- // When Trusted Types support in Function constructors is widely available,
32990
- // the implementation of this function can be simplified to:
32991
- // return new Function(...args.map(a => trustedScriptFromString(a)));
32992
- }
32993
-
32994
- /**
32995
- * @license
32996
- * Copyright Google LLC All Rights Reserved.
32997
- *
32998
- * Use of this source code is governed by an MIT-style license that can be
32999
- * found in the LICENSE file at https://angular.io/license
33000
- */
33001
- function tagSet(tags) {
33002
- const res = {};
33003
- for (const t of tags.split(','))
33004
- res[t] = true;
33005
- return res;
33006
- }
33007
- function merge(...sets) {
33008
- const res = {};
33009
- for (const s of sets) {
33010
- for (const v in s) {
33011
- if (s.hasOwnProperty(v))
33012
- res[v] = true;
33013
- }
33014
- }
33015
- return res;
33016
- }
33017
- // Good source of info about elements and attributes
33018
- // https://html.spec.whatwg.org/#semantics
33019
- // https://simon.html5.org/html-elements
33020
- // Safe Void Elements - HTML5
33021
- // https://html.spec.whatwg.org/#void-elements
33022
- const VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');
33023
- // Elements that you can, intentionally, leave open (and which close themselves)
33024
- // https://html.spec.whatwg.org/#optional-tags
33025
- const OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');
33026
- const OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');
33027
- const OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);
33028
- // Safe Block Elements - HTML5
33029
- const BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' +
33030
- 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +
33031
- 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));
33032
- // Inline Elements - HTML5
33033
- const INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' +
33034
- 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +
33035
- 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));
33036
- const VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);
33037
- // Attributes that have href and hence need to be sanitized
33038
- const URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');
33039
- // Attributes that have special href set hence need to be sanitized
33040
- const SRCSET_ATTRS = tagSet('srcset');
33041
- const HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +
33042
- 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +
33043
- 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +
33044
- 'scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,' +
33045
- 'valign,value,vspace,width');
33046
- // Accessibility attributes as per WAI-ARIA 1.1 (W3C Working Draft 14 December 2018)
33047
- const ARIA_ATTRS = tagSet('aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,' +
33048
- 'aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,' +
33049
- 'aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,' +
33050
- 'aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,' +
33051
- 'aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,' +
33052
- 'aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,' +
33053
- 'aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext');
33054
- // NB: This currently consciously doesn't support SVG. SVG sanitization has had several security
33055
- // issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via
33056
- // innerHTML is required, SVG attributes should be added here.
33057
- // NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those
33058
- // can be sanitized, but they increase security surface area without a legitimate use case, so they
33059
- // are left out here.
33060
- const VALID_ATTRS = merge(URI_ATTRS, SRCSET_ATTRS, HTML_ATTRS, ARIA_ATTRS);
33061
- // Elements whose content should not be traversed/preserved, if the elements themselves are invalid.
33062
- //
33063
- // Typically, `<invalid>Some content</invalid>` would traverse (and in this case preserve)
33064
- // `Some content`, but strip `invalid-element` opening/closing tags. For some elements, though, we
33065
- // don't want to preserve the content, if the elements themselves are going to be removed.
33066
- const SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet('script,style,template');
33067
-
33068
- /**
33069
- * @license
33070
- * Copyright Google LLC All Rights Reserved.
33071
- *
33072
- * Use of this source code is governed by an MIT-style license that can be
33073
- * found in the LICENSE file at https://angular.io/license
33074
- */
33075
- /**
33076
- * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property
33077
- * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly
33078
- * handled.
33079
- *
33080
- * See DomSanitizer for more details on security in Angular applications.
33081
- *
32953
+ * Flags for renderer-specific style modifiers.
33082
32954
  * @publicApi
33083
32955
  */
33084
- var SecurityContext$1;
33085
- (function (SecurityContext) {
33086
- SecurityContext[SecurityContext["NONE"] = 0] = "NONE";
33087
- SecurityContext[SecurityContext["HTML"] = 1] = "HTML";
33088
- SecurityContext[SecurityContext["STYLE"] = 2] = "STYLE";
33089
- SecurityContext[SecurityContext["SCRIPT"] = 3] = "SCRIPT";
33090
- SecurityContext[SecurityContext["URL"] = 4] = "URL";
33091
- SecurityContext[SecurityContext["RESOURCE_URL"] = 5] = "RESOURCE_URL";
33092
- })(SecurityContext$1 || (SecurityContext$1 = {}));
32956
+ var RendererStyleFlags2;
32957
+ (function (RendererStyleFlags2) {
32958
+ // TODO(misko): This needs to be refactored into a separate file so that it can be imported from
32959
+ // `node_manipulation.ts` Currently doing the import cause resolution order to change and fails
32960
+ // the tests. The work around is to have hard coded value in `node_manipulation.ts` for now.
32961
+ /**
32962
+ * Marks a style as important.
32963
+ */
32964
+ RendererStyleFlags2[RendererStyleFlags2["Important"] = 1] = "Important";
32965
+ /**
32966
+ * Marks a style as using dash case naming (this-is-dash-case).
32967
+ */
32968
+ RendererStyleFlags2[RendererStyleFlags2["DashCase"] = 2] = "DashCase";
32969
+ })(RendererStyleFlags2 || (RendererStyleFlags2 = {}));
33093
32970
 
33094
32971
  /**
33095
32972
  * @license
@@ -33126,182 +33003,6 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
33126
33003
  return null;
33127
33004
  }
33128
33005
 
33129
- /**
33130
- * @license
33131
- * Copyright Google LLC All Rights Reserved.
33132
- *
33133
- * Use of this source code is governed by an MIT-style license that can be
33134
- * found in the LICENSE file at https://angular.io/license
33135
- */
33136
- const ERROR_DEBUG_CONTEXT = 'ngDebugContext';
33137
- const ERROR_ORIGINAL_ERROR = 'ngOriginalError';
33138
- const ERROR_LOGGER = 'ngErrorLogger';
33139
-
33140
- /**
33141
- * @license
33142
- * Copyright Google LLC All Rights Reserved.
33143
- *
33144
- * Use of this source code is governed by an MIT-style license that can be
33145
- * found in the LICENSE file at https://angular.io/license
33146
- */
33147
- function getDebugContext(error) {
33148
- return error[ERROR_DEBUG_CONTEXT];
33149
- }
33150
- function getOriginalError(error) {
33151
- return error[ERROR_ORIGINAL_ERROR];
33152
- }
33153
- function getErrorLogger(error) {
33154
- return error && error[ERROR_LOGGER] || defaultErrorLogger;
33155
- }
33156
- function defaultErrorLogger(console, ...values) {
33157
- console.error(...values);
33158
- }
33159
-
33160
- /**
33161
- * @license
33162
- * Copyright Google LLC All Rights Reserved.
33163
- *
33164
- * Use of this source code is governed by an MIT-style license that can be
33165
- * found in the LICENSE file at https://angular.io/license
33166
- */
33167
- /**
33168
- * Provides a hook for centralized exception handling.
33169
- *
33170
- * The default implementation of `ErrorHandler` prints error messages to the `console`. To
33171
- * intercept error handling, write a custom exception handler that replaces this default as
33172
- * appropriate for your app.
33173
- *
33174
- * @usageNotes
33175
- * ### Example
33176
- *
33177
- * ```
33178
- * class MyErrorHandler implements ErrorHandler {
33179
- * handleError(error) {
33180
- * // do something with the exception
33181
- * }
33182
- * }
33183
- *
33184
- * @NgModule({
33185
- * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
33186
- * })
33187
- * class MyModule {}
33188
- * ```
33189
- *
33190
- * @publicApi
33191
- */
33192
- class ErrorHandler {
33193
- constructor() {
33194
- /**
33195
- * @internal
33196
- */
33197
- this._console = console;
33198
- }
33199
- handleError(error) {
33200
- const originalError = this._findOriginalError(error);
33201
- const context = this._findContext(error);
33202
- // Note: Browser consoles show the place from where console.error was called.
33203
- // We can use this to give users additional information about the error.
33204
- const errorLogger = getErrorLogger(error);
33205
- errorLogger(this._console, `ERROR`, error);
33206
- if (originalError) {
33207
- errorLogger(this._console, `ORIGINAL ERROR`, originalError);
33208
- }
33209
- if (context) {
33210
- errorLogger(this._console, 'ERROR CONTEXT', context);
33211
- }
33212
- }
33213
- /** @internal */
33214
- _findContext(error) {
33215
- return error ? (getDebugContext(error) || this._findContext(getOriginalError(error))) : null;
33216
- }
33217
- /** @internal */
33218
- _findOriginalError(error) {
33219
- let e = error && getOriginalError(error);
33220
- while (e && getOriginalError(e)) {
33221
- e = getOriginalError(e);
33222
- }
33223
- return e || null;
33224
- }
33225
- }
33226
-
33227
- /**
33228
- * @license
33229
- * Copyright Google LLC All Rights Reserved.
33230
- *
33231
- * Use of this source code is governed by an MIT-style license that can be
33232
- * found in the LICENSE file at https://angular.io/license
33233
- */
33234
- /**
33235
- * THIS FILE CONTAINS CODE WHICH SHOULD BE TREE SHAKEN AND NEVER CALLED FROM PRODUCTION CODE!!!
33236
- */
33237
- /**
33238
- * Creates an `Array` construction with a given name. This is useful when
33239
- * looking for memory consumption to see what time of array it is.
33240
- *
33241
- *
33242
- * @param name Name to give to the constructor
33243
- * @returns A subclass of `Array` if possible. This can only be done in
33244
- * environments which support `class` construct.
33245
- */
33246
- function createNamedArrayType(name) {
33247
- // This should never be called in prod mode, so let's verify that is the case.
33248
- if (ngDevMode) {
33249
- try {
33250
- // If this function were compromised the following could lead to arbitrary
33251
- // script execution. We bless it with Trusted Types anyway since this
33252
- // function is stripped out of production binaries.
33253
- return (newTrustedFunctionForDev('Array', `return class ${name} extends Array{}`))(Array);
33254
- }
33255
- catch (e) {
33256
- // If it does not work just give up and fall back to regular Array.
33257
- return Array;
33258
- }
33259
- }
33260
- else {
33261
- throw new Error('Looks like we are in \'prod mode\', but we are creating a named Array type, which is wrong! Check your code');
33262
- }
33263
- }
33264
-
33265
- /**
33266
- * @license
33267
- * Copyright Google LLC All Rights Reserved.
33268
- *
33269
- * Use of this source code is governed by an MIT-style license that can be
33270
- * found in the LICENSE file at https://angular.io/license
33271
- */
33272
- const ɵ0$4 = () => (typeof requestAnimationFrame !== 'undefined' &&
33273
- requestAnimationFrame || // browser only
33274
- setTimeout // everything else
33275
- )
33276
- .bind(_global$1);
33277
- const defaultScheduler = (ɵ0$4)();
33278
-
33279
- /**
33280
- * @license
33281
- * Copyright Google LLC All Rights Reserved.
33282
- *
33283
- * Use of this source code is governed by an MIT-style license that can be
33284
- * found in the LICENSE file at https://angular.io/license
33285
- */
33286
- /**
33287
- * Flags for renderer-specific style modifiers.
33288
- * @publicApi
33289
- */
33290
- var RendererStyleFlags2;
33291
- (function (RendererStyleFlags2) {
33292
- // TODO(misko): This needs to be refactored into a separate file so that it can be imported from
33293
- // `node_manipulation.ts` Currently doing the import cause resolution order to change and fails
33294
- // the tests. The work around is to have hard coded value in `node_manipulation.ts` for now.
33295
- /**
33296
- * Marks a style as important.
33297
- */
33298
- RendererStyleFlags2[RendererStyleFlags2["Important"] = 1] = "Important";
33299
- /**
33300
- * Marks a style as using dash case naming (this-is-dash-case).
33301
- */
33302
- RendererStyleFlags2[RendererStyleFlags2["DashCase"] = 2] = "DashCase";
33303
- })(RendererStyleFlags2 || (RendererStyleFlags2 = {}));
33304
-
33305
33006
  /**
33306
33007
  * @license
33307
33008
  * Copyright Google LLC All Rights Reserved.
@@ -33921,6 +33622,353 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
33921
33622
  ngDevMode && ngDevMode.rendererSetClassName++;
33922
33623
  }
33923
33624
 
33625
+ /**
33626
+ * @license
33627
+ * Copyright Google LLC All Rights Reserved.
33628
+ *
33629
+ * Use of this source code is governed by an MIT-style license that can be
33630
+ * found in the LICENSE file at https://angular.io/license
33631
+ */
33632
+ /**
33633
+ * The Trusted Types policy, or null if Trusted Types are not
33634
+ * enabled/supported, or undefined if the policy has not been created yet.
33635
+ */
33636
+ let policy$1;
33637
+ /**
33638
+ * Returns the Trusted Types policy, or null if Trusted Types are not
33639
+ * enabled/supported. The first call to this function will create the policy.
33640
+ */
33641
+ function getPolicy$1() {
33642
+ if (policy$1 === undefined) {
33643
+ policy$1 = null;
33644
+ if (_global$1.trustedTypes) {
33645
+ try {
33646
+ policy$1 = _global$1.trustedTypes.createPolicy('angular', {
33647
+ createHTML: (s) => s,
33648
+ createScript: (s) => s,
33649
+ createScriptURL: (s) => s,
33650
+ });
33651
+ }
33652
+ catch (_a) {
33653
+ // trustedTypes.createPolicy throws if called with a name that is
33654
+ // already registered, even in report-only mode. Until the API changes,
33655
+ // catch the error not to break the applications functionally. In such
33656
+ // cases, the code will fall back to using strings.
33657
+ }
33658
+ }
33659
+ }
33660
+ return policy$1;
33661
+ }
33662
+ /**
33663
+ * Unsafely promote a string to a TrustedScript, falling back to strings when
33664
+ * Trusted Types are not available.
33665
+ * @security In particular, it must be assured that the provided string will
33666
+ * never cause an XSS vulnerability if used in a context that will be
33667
+ * interpreted and executed as a script by a browser, e.g. when calling eval.
33668
+ */
33669
+ function trustedScriptFromString$1(script) {
33670
+ var _a;
33671
+ return ((_a = getPolicy$1()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;
33672
+ }
33673
+ /**
33674
+ * Unsafely call the Function constructor with the given string arguments. It
33675
+ * is only available in development mode, and should be stripped out of
33676
+ * production code.
33677
+ * @security This is a security-sensitive function; any use of this function
33678
+ * must go through security review. In particular, it must be assured that it
33679
+ * is only called from development code, as use in production code can lead to
33680
+ * XSS vulnerabilities.
33681
+ */
33682
+ function newTrustedFunctionForDev(...args) {
33683
+ if (typeof ngDevMode === 'undefined') {
33684
+ throw new Error('newTrustedFunctionForDev should never be called in production');
33685
+ }
33686
+ if (!_global$1.trustedTypes) {
33687
+ // In environments that don't support Trusted Types, fall back to the most
33688
+ // straightforward implementation:
33689
+ return new Function(...args);
33690
+ }
33691
+ // Chrome currently does not support passing TrustedScript to the Function
33692
+ // constructor. The following implements the workaround proposed on the page
33693
+ // below, where the Chromium bug is also referenced:
33694
+ // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor
33695
+ const fnArgs = args.slice(0, -1).join(',');
33696
+ const fnBody = args[args.length - 1];
33697
+ const body = `(function anonymous(${fnArgs}
33698
+ ) { ${fnBody}
33699
+ })`;
33700
+ // Using eval directly confuses the compiler and prevents this module from
33701
+ // being stripped out of JS binaries even if not used. The global['eval']
33702
+ // indirection fixes that.
33703
+ const fn = _global$1['eval'](trustedScriptFromString$1(body));
33704
+ if (fn.bind === undefined) {
33705
+ // Workaround for a browser bug that only exists in Chrome 83, where passing
33706
+ // a TrustedScript to eval just returns the TrustedScript back without
33707
+ // evaluating it. In that case, fall back to the most straightforward
33708
+ // implementation:
33709
+ return new Function(...args);
33710
+ }
33711
+ // To completely mimic the behavior of calling "new Function", two more
33712
+ // things need to happen:
33713
+ // 1. Stringifying the resulting function should return its source code
33714
+ fn.toString = () => body;
33715
+ // 2. When calling the resulting function, `this` should refer to `global`
33716
+ return fn.bind(_global$1);
33717
+ // When Trusted Types support in Function constructors is widely available,
33718
+ // the implementation of this function can be simplified to:
33719
+ // return new Function(...args.map(a => trustedScriptFromString(a)));
33720
+ }
33721
+
33722
+ /**
33723
+ * @license
33724
+ * Copyright Google LLC All Rights Reserved.
33725
+ *
33726
+ * Use of this source code is governed by an MIT-style license that can be
33727
+ * found in the LICENSE file at https://angular.io/license
33728
+ */
33729
+ function tagSet(tags) {
33730
+ const res = {};
33731
+ for (const t of tags.split(','))
33732
+ res[t] = true;
33733
+ return res;
33734
+ }
33735
+ function merge(...sets) {
33736
+ const res = {};
33737
+ for (const s of sets) {
33738
+ for (const v in s) {
33739
+ if (s.hasOwnProperty(v))
33740
+ res[v] = true;
33741
+ }
33742
+ }
33743
+ return res;
33744
+ }
33745
+ // Good source of info about elements and attributes
33746
+ // https://html.spec.whatwg.org/#semantics
33747
+ // https://simon.html5.org/html-elements
33748
+ // Safe Void Elements - HTML5
33749
+ // https://html.spec.whatwg.org/#void-elements
33750
+ const VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');
33751
+ // Elements that you can, intentionally, leave open (and which close themselves)
33752
+ // https://html.spec.whatwg.org/#optional-tags
33753
+ const OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');
33754
+ const OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');
33755
+ const OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);
33756
+ // Safe Block Elements - HTML5
33757
+ const BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' +
33758
+ 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +
33759
+ 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));
33760
+ // Inline Elements - HTML5
33761
+ const INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' +
33762
+ 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +
33763
+ 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));
33764
+ const VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);
33765
+ // Attributes that have href and hence need to be sanitized
33766
+ const URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');
33767
+ // Attributes that have special href set hence need to be sanitized
33768
+ const SRCSET_ATTRS = tagSet('srcset');
33769
+ const HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +
33770
+ 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +
33771
+ 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +
33772
+ 'scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,' +
33773
+ 'valign,value,vspace,width');
33774
+ // Accessibility attributes as per WAI-ARIA 1.1 (W3C Working Draft 14 December 2018)
33775
+ const ARIA_ATTRS = tagSet('aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,' +
33776
+ 'aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,' +
33777
+ 'aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,' +
33778
+ 'aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,' +
33779
+ 'aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,' +
33780
+ 'aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,' +
33781
+ 'aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext');
33782
+ // NB: This currently consciously doesn't support SVG. SVG sanitization has had several security
33783
+ // issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via
33784
+ // innerHTML is required, SVG attributes should be added here.
33785
+ // NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those
33786
+ // can be sanitized, but they increase security surface area without a legitimate use case, so they
33787
+ // are left out here.
33788
+ const VALID_ATTRS = merge(URI_ATTRS, SRCSET_ATTRS, HTML_ATTRS, ARIA_ATTRS);
33789
+ // Elements whose content should not be traversed/preserved, if the elements themselves are invalid.
33790
+ //
33791
+ // Typically, `<invalid>Some content</invalid>` would traverse (and in this case preserve)
33792
+ // `Some content`, but strip `invalid-element` opening/closing tags. For some elements, though, we
33793
+ // don't want to preserve the content, if the elements themselves are going to be removed.
33794
+ const SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet('script,style,template');
33795
+
33796
+ /**
33797
+ * @license
33798
+ * Copyright Google LLC All Rights Reserved.
33799
+ *
33800
+ * Use of this source code is governed by an MIT-style license that can be
33801
+ * found in the LICENSE file at https://angular.io/license
33802
+ */
33803
+ /**
33804
+ * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property
33805
+ * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly
33806
+ * handled.
33807
+ *
33808
+ * See DomSanitizer for more details on security in Angular applications.
33809
+ *
33810
+ * @publicApi
33811
+ */
33812
+ var SecurityContext$1;
33813
+ (function (SecurityContext) {
33814
+ SecurityContext[SecurityContext["NONE"] = 0] = "NONE";
33815
+ SecurityContext[SecurityContext["HTML"] = 1] = "HTML";
33816
+ SecurityContext[SecurityContext["STYLE"] = 2] = "STYLE";
33817
+ SecurityContext[SecurityContext["SCRIPT"] = 3] = "SCRIPT";
33818
+ SecurityContext[SecurityContext["URL"] = 4] = "URL";
33819
+ SecurityContext[SecurityContext["RESOURCE_URL"] = 5] = "RESOURCE_URL";
33820
+ })(SecurityContext$1 || (SecurityContext$1 = {}));
33821
+
33822
+ /**
33823
+ * @license
33824
+ * Copyright Google LLC All Rights Reserved.
33825
+ *
33826
+ * Use of this source code is governed by an MIT-style license that can be
33827
+ * found in the LICENSE file at https://angular.io/license
33828
+ */
33829
+ const ERROR_DEBUG_CONTEXT = 'ngDebugContext';
33830
+ const ERROR_ORIGINAL_ERROR = 'ngOriginalError';
33831
+ const ERROR_LOGGER = 'ngErrorLogger';
33832
+
33833
+ /**
33834
+ * @license
33835
+ * Copyright Google LLC All Rights Reserved.
33836
+ *
33837
+ * Use of this source code is governed by an MIT-style license that can be
33838
+ * found in the LICENSE file at https://angular.io/license
33839
+ */
33840
+ function getDebugContext(error) {
33841
+ return error[ERROR_DEBUG_CONTEXT];
33842
+ }
33843
+ function getOriginalError(error) {
33844
+ return error[ERROR_ORIGINAL_ERROR];
33845
+ }
33846
+ function getErrorLogger(error) {
33847
+ return error && error[ERROR_LOGGER] || defaultErrorLogger;
33848
+ }
33849
+ function defaultErrorLogger(console, ...values) {
33850
+ console.error(...values);
33851
+ }
33852
+
33853
+ /**
33854
+ * @license
33855
+ * Copyright Google LLC All Rights Reserved.
33856
+ *
33857
+ * Use of this source code is governed by an MIT-style license that can be
33858
+ * found in the LICENSE file at https://angular.io/license
33859
+ */
33860
+ /**
33861
+ * Provides a hook for centralized exception handling.
33862
+ *
33863
+ * The default implementation of `ErrorHandler` prints error messages to the `console`. To
33864
+ * intercept error handling, write a custom exception handler that replaces this default as
33865
+ * appropriate for your app.
33866
+ *
33867
+ * @usageNotes
33868
+ * ### Example
33869
+ *
33870
+ * ```
33871
+ * class MyErrorHandler implements ErrorHandler {
33872
+ * handleError(error) {
33873
+ * // do something with the exception
33874
+ * }
33875
+ * }
33876
+ *
33877
+ * @NgModule({
33878
+ * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
33879
+ * })
33880
+ * class MyModule {}
33881
+ * ```
33882
+ *
33883
+ * @publicApi
33884
+ */
33885
+ class ErrorHandler {
33886
+ constructor() {
33887
+ /**
33888
+ * @internal
33889
+ */
33890
+ this._console = console;
33891
+ }
33892
+ handleError(error) {
33893
+ const originalError = this._findOriginalError(error);
33894
+ const context = this._findContext(error);
33895
+ // Note: Browser consoles show the place from where console.error was called.
33896
+ // We can use this to give users additional information about the error.
33897
+ const errorLogger = getErrorLogger(error);
33898
+ errorLogger(this._console, `ERROR`, error);
33899
+ if (originalError) {
33900
+ errorLogger(this._console, `ORIGINAL ERROR`, originalError);
33901
+ }
33902
+ if (context) {
33903
+ errorLogger(this._console, 'ERROR CONTEXT', context);
33904
+ }
33905
+ }
33906
+ /** @internal */
33907
+ _findContext(error) {
33908
+ return error ? (getDebugContext(error) || this._findContext(getOriginalError(error))) : null;
33909
+ }
33910
+ /** @internal */
33911
+ _findOriginalError(error) {
33912
+ let e = error && getOriginalError(error);
33913
+ while (e && getOriginalError(e)) {
33914
+ e = getOriginalError(e);
33915
+ }
33916
+ return e || null;
33917
+ }
33918
+ }
33919
+
33920
+ /**
33921
+ * @license
33922
+ * Copyright Google LLC All Rights Reserved.
33923
+ *
33924
+ * Use of this source code is governed by an MIT-style license that can be
33925
+ * found in the LICENSE file at https://angular.io/license
33926
+ */
33927
+ /**
33928
+ * THIS FILE CONTAINS CODE WHICH SHOULD BE TREE SHAKEN AND NEVER CALLED FROM PRODUCTION CODE!!!
33929
+ */
33930
+ /**
33931
+ * Creates an `Array` construction with a given name. This is useful when
33932
+ * looking for memory consumption to see what time of array it is.
33933
+ *
33934
+ *
33935
+ * @param name Name to give to the constructor
33936
+ * @returns A subclass of `Array` if possible. This can only be done in
33937
+ * environments which support `class` construct.
33938
+ */
33939
+ function createNamedArrayType(name) {
33940
+ // This should never be called in prod mode, so let's verify that is the case.
33941
+ if (ngDevMode) {
33942
+ try {
33943
+ // If this function were compromised the following could lead to arbitrary
33944
+ // script execution. We bless it with Trusted Types anyway since this
33945
+ // function is stripped out of production binaries.
33946
+ return (newTrustedFunctionForDev('Array', `return class ${name} extends Array{}`))(Array);
33947
+ }
33948
+ catch (e) {
33949
+ // If it does not work just give up and fall back to regular Array.
33950
+ return Array;
33951
+ }
33952
+ }
33953
+ else {
33954
+ throw new Error('Looks like we are in \'prod mode\', but we are creating a named Array type, which is wrong! Check your code');
33955
+ }
33956
+ }
33957
+
33958
+ /**
33959
+ * @license
33960
+ * Copyright Google LLC All Rights Reserved.
33961
+ *
33962
+ * Use of this source code is governed by an MIT-style license that can be
33963
+ * found in the LICENSE file at https://angular.io/license
33964
+ */
33965
+ const ɵ0$4 = () => (typeof requestAnimationFrame !== 'undefined' &&
33966
+ requestAnimationFrame || // browser only
33967
+ setTimeout // everything else
33968
+ )
33969
+ .bind(_global$1);
33970
+ const defaultScheduler = (ɵ0$4)();
33971
+
33924
33972
  /**
33925
33973
  * @license
33926
33974
  * Copyright Google LLC All Rights Reserved.
@@ -36868,7 +36916,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
36868
36916
  /**
36869
36917
  * @publicApi
36870
36918
  */
36871
- const VERSION$2 = new Version$1('12.2.15');
36919
+ const VERSION$2 = new Version$1('12.2.17');
36872
36920
 
36873
36921
  /**
36874
36922
  * @license
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/language-service",
3
- "version": "12.2.15",
3
+ "version": "12.2.17",
4
4
  "description": "Angular - language services",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",