@angular-eslint/bundled-angular-compiler 15.2.1-alpha.9 → 15.2.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +32 -57
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.1.0-rc.0
2
+ * @license Angular v15.1.4
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -7052,7 +7052,7 @@ class _AstToIrVisitor {
7052
7052
  return null;
7053
7053
  },
7054
7054
  visitNonNullAssert(ast) {
7055
- return null;
7055
+ return visit(this, ast.expression);
7056
7056
  },
7057
7057
  visitPropertyRead(ast) {
7058
7058
  return visit(this, ast.receiver);
@@ -7329,9 +7329,8 @@ const animationKeywords = new Set([
7329
7329
  'end', 'jump-both', 'jump-end', 'jump-none', 'jump-start', 'start'
7330
7330
  ]);
7331
7331
  /**
7332
- * The following class is a port of shadowCSS from webcomponents.js to TypeScript.
7333
- *
7334
- * Please make sure to keep to edits in sync with the source file.
7332
+ * The following class has its origin from a port of shadowCSS from webcomponents.js to TypeScript.
7333
+ * It has since diverge in many ways to tailor Angular's needs.
7335
7334
  *
7336
7335
  * Source:
7337
7336
  * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
@@ -7371,28 +7370,8 @@ const animationKeywords = new Set([
7371
7370
  }
7372
7371
 
7373
7372
  * encapsulation: Styles defined within ShadowDOM, apply only to
7374
- dom inside the ShadowDOM. Polymer uses one of two techniques to implement
7375
- this feature.
7376
-
7377
- By default, rules are prefixed with the host element tag name
7378
- as a descendant selector. This ensures styling does not leak out of the 'top'
7379
- of the element's ShadowDOM. For example,
7380
-
7381
- div {
7382
- font-weight: bold;
7383
- }
7384
-
7385
- becomes:
7386
-
7387
- x-foo div {
7388
- font-weight: bold;
7389
- }
7390
-
7391
- becomes:
7392
-
7393
-
7394
- Alternatively, if WebComponents.ShadowCSS.strictStyling is set to true then
7395
- selectors are scoped by adding an attribute selector suffix to each
7373
+ dom inside the ShadowDOM.
7374
+ The selectors are scoped by adding an attribute selector suffix to each
7396
7375
  simple selector that contains the host element tag name. Each element
7397
7376
  in the element's ShadowDOM template is also given the scope attribute.
7398
7377
  Thus, these rules match only elements that have the scope attribute.
@@ -7454,7 +7433,6 @@ const animationKeywords = new Set([
7454
7433
  */
7455
7434
  class ShadowCss {
7456
7435
  constructor() {
7457
- this.strictStyling = true;
7458
7436
  /**
7459
7437
  * Regular expression used to extrapolate the possible keyframes from an
7460
7438
  * animation declaration (with possibly multiple animation definitions)
@@ -7472,12 +7450,10 @@ class ShadowCss {
7472
7450
  this._animationDeclarationKeyframesRe = /(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
7473
7451
  }
7474
7452
  /*
7475
- * Shim some cssText with the given selector. Returns cssText that can
7476
- * be included in the document via WebComponents.ShadowCSS.addCssToDocument(css).
7453
+ * Shim some cssText with the given selector. Returns cssText that can be included in the document
7477
7454
  *
7478
- * When strictStyling is true:
7479
- * - selector is the attribute added to all elements inside the host,
7480
- * - hostSelector is the attribute added to the host itself.
7455
+ * The selector is the attribute added to all elements inside the host,
7456
+ * The hostSelector is the attribute added to the host itself.
7481
7457
  */
7482
7458
  shimCssText(cssText, selector, hostSelector = '') {
7483
7459
  const commentsWithHash = extractCommentsWithHash(cssText);
@@ -7639,7 +7615,6 @@ class ShadowCss {
7639
7615
  *
7640
7616
  **/
7641
7617
  _insertPolyfillDirectivesInCssText(cssText) {
7642
- // Difference with webcomponents.js: does not handle comments
7643
7618
  return cssText.replace(_cssContentNextSelectorRe, function (...m) {
7644
7619
  return m[2] + '{';
7645
7620
  });
@@ -7660,7 +7635,6 @@ class ShadowCss {
7660
7635
  *
7661
7636
  **/
7662
7637
  _insertPolyfillRulesInCssText(cssText) {
7663
- // Difference with webcomponents.js: does not handle comments
7664
7638
  return cssText.replace(_cssContentRuleRe, (...m) => {
7665
7639
  const rule = m[0].replace(m[1], '').replace(m[2], '');
7666
7640
  return m[4] + rule;
@@ -7704,7 +7678,6 @@ class ShadowCss {
7704
7678
  *
7705
7679
  **/
7706
7680
  _extractUnscopedRulesFromCssText(cssText) {
7707
- // Difference with webcomponents.js: does not handle comments
7708
7681
  let r = '';
7709
7682
  let m;
7710
7683
  _cssContentUnscopedRuleRe.lastIndex = 0;
@@ -7821,8 +7794,7 @@ class ShadowCss {
7821
7794
  let selector = rule.selector;
7822
7795
  let content = rule.content;
7823
7796
  if (rule.selector[0] !== '@') {
7824
- selector =
7825
- this._scopeSelector(rule.selector, scopeSelector, hostSelector, this.strictStyling);
7797
+ selector = this._scopeSelector(rule.selector, scopeSelector, hostSelector);
7826
7798
  }
7827
7799
  else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||
7828
7800
  rule.selector.startsWith('@document') || rule.selector.startsWith('@layer') ||
@@ -7863,16 +7835,14 @@ class ShadowCss {
7863
7835
  return new CssRule(selector, rule.content);
7864
7836
  });
7865
7837
  }
7866
- _scopeSelector(selector, scopeSelector, hostSelector, strict) {
7838
+ _scopeSelector(selector, scopeSelector, hostSelector) {
7867
7839
  return selector.split(',')
7868
7840
  .map(part => part.trim().split(_shadowDeepSelectors))
7869
7841
  .map((deepParts) => {
7870
7842
  const [shallowPart, ...otherParts] = deepParts;
7871
7843
  const applyScope = (shallowPart) => {
7872
7844
  if (this._selectorNeedsScoping(shallowPart, scopeSelector)) {
7873
- return strict ?
7874
- this._applyStrictSelectorScope(shallowPart, scopeSelector, hostSelector) :
7875
- this._applySelectorScope(shallowPart, scopeSelector, hostSelector);
7845
+ return this._applySelectorScope(shallowPart, scopeSelector, hostSelector);
7876
7846
  }
7877
7847
  else {
7878
7848
  return shallowPart;
@@ -7892,16 +7862,12 @@ class ShadowCss {
7892
7862
  scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
7893
7863
  return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
7894
7864
  }
7895
- _applySelectorScope(selector, scopeSelector, hostSelector) {
7896
- // Difference from webcomponents.js: scopeSelector could not be an array
7897
- return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector);
7898
- }
7899
7865
  // scope via name and [is=name]
7900
7866
  _applySimpleSelectorScope(selector, scopeSelector, hostSelector) {
7901
7867
  // In Android browser, the lastIndex is not reset when the regex is used in String.replace()
7902
7868
  _polyfillHostRe.lastIndex = 0;
7903
7869
  if (_polyfillHostRe.test(selector)) {
7904
- const replaceBy = this.strictStyling ? `[${hostSelector}]` : scopeSelector;
7870
+ const replaceBy = `[${hostSelector}]`;
7905
7871
  return selector
7906
7872
  .replace(_polyfillHostNoCombinatorRe, (hnc, selector) => {
7907
7873
  return selector.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => {
@@ -7914,7 +7880,8 @@ class ShadowCss {
7914
7880
  }
7915
7881
  // return a selector with [name] suffix on each simple selector
7916
7882
  // e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name] /** @internal */
7917
- _applyStrictSelectorScope(selector, scopeSelector, hostSelector) {
7883
+ _applySelectorScope(selector, scopeSelector, hostSelector) {
7884
+ var _a;
7918
7885
  const isRe = /\[is=([^\]]*)\]/g;
7919
7886
  scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
7920
7887
  const attrName = '[' + scopeSelector + ']';
@@ -7961,6 +7928,13 @@ class ShadowCss {
7961
7928
  while ((res = sep.exec(selector)) !== null) {
7962
7929
  const separator = res[1];
7963
7930
  const part = selector.slice(startIndex, res.index).trim();
7931
+ // A space following an escaped hex value and followed by another hex character
7932
+ // (ie: ".\fc ber" for ".über") is not a separator between 2 selectors
7933
+ // also keep in mind that backslashes are replaced by a placeholder by SafeSelector
7934
+ // These escaped selectors happen for example when esbuild runs with optimization.minify.
7935
+ if (part.match(_placeholderRe) && ((_a = selector[res.index + 1]) === null || _a === void 0 ? void 0 : _a.match(/[a-fA-F\d]/))) {
7936
+ continue;
7937
+ }
7964
7938
  shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
7965
7939
  const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
7966
7940
  scopedSelector += `${scopedPart} ${separator} `;
@@ -8000,7 +7974,7 @@ class SafeSelector {
8000
7974
  });
8001
7975
  }
8002
7976
  restore(content) {
8003
- return content.replace(/__ph-(\d+)__/g, (_ph, index) => this.placeholders[+index]);
7977
+ return content.replace(_placeholderRe, (_ph, index) => this.placeholders[+index]);
8004
7978
  }
8005
7979
  content() {
8006
7980
  return this._content;
@@ -8048,6 +8022,7 @@ const _polyfillHostRe = /-shadowcsshost/gim;
8048
8022
  const _colonHostRe = /:host/gim;
8049
8023
  const _colonHostContextRe = /:host-context/gim;
8050
8024
  const _commentRe = /\/\*[\s\S]*?\*\//g;
8025
+ const _placeholderRe = /__ph-(\d+)__/g;
8051
8026
  function stripComments(input) {
8052
8027
  return input.replace(_commentRe, '');
8053
8028
  }
@@ -19750,7 +19725,7 @@ function publishFacade(global) {
19750
19725
  * @description
19751
19726
  * Entry point for all public APIs of the compiler package.
19752
19727
  */
19753
- const VERSION = new Version('15.1.0');
19728
+ const VERSION = new Version('15.1.4');
19754
19729
 
19755
19730
  class CompilerConfig {
19756
19731
  constructor({ defaultEncapsulation = exports.ViewEncapsulation.Emulated, useJit = true, missingTranslation = null, preserveWhitespaces, strictInjectionParameters } = {}) {
@@ -21677,7 +21652,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
21677
21652
  function compileDeclareClassMetadata(metadata) {
21678
21653
  const definitionMap = new DefinitionMap();
21679
21654
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21680
- definitionMap.set('version', literal('15.1.0'));
21655
+ definitionMap.set('version', literal('15.1.4'));
21681
21656
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21682
21657
  definitionMap.set('type', metadata.type);
21683
21658
  definitionMap.set('decorators', metadata.decorators);
@@ -21781,7 +21756,7 @@ function createDirectiveDefinitionMap(meta) {
21781
21756
  var _a;
21782
21757
  const definitionMap = new DefinitionMap();
21783
21758
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
21784
- definitionMap.set('version', literal('15.1.0'));
21759
+ definitionMap.set('version', literal('15.1.4'));
21785
21760
  // e.g. `type: MyDirective`
21786
21761
  definitionMap.set('type', meta.internalType);
21787
21762
  if (meta.isStandalone) {
@@ -22003,7 +21978,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
22003
21978
  function compileDeclareFactoryFunction(meta) {
22004
21979
  const definitionMap = new DefinitionMap();
22005
21980
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
22006
- definitionMap.set('version', literal('15.1.0'));
21981
+ definitionMap.set('version', literal('15.1.4'));
22007
21982
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22008
21983
  definitionMap.set('type', meta.internalType);
22009
21984
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -22038,7 +22013,7 @@ function compileDeclareInjectableFromMetadata(meta) {
22038
22013
  function createInjectableDefinitionMap(meta) {
22039
22014
  const definitionMap = new DefinitionMap();
22040
22015
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
22041
- definitionMap.set('version', literal('15.1.0'));
22016
+ definitionMap.set('version', literal('15.1.4'));
22042
22017
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22043
22018
  definitionMap.set('type', meta.internalType);
22044
22019
  // Only generate providedIn property if it has a non-null value
@@ -22089,7 +22064,7 @@ function compileDeclareInjectorFromMetadata(meta) {
22089
22064
  function createInjectorDefinitionMap(meta) {
22090
22065
  const definitionMap = new DefinitionMap();
22091
22066
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22092
- definitionMap.set('version', literal('15.1.0'));
22067
+ definitionMap.set('version', literal('15.1.4'));
22093
22068
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22094
22069
  definitionMap.set('type', meta.internalType);
22095
22070
  definitionMap.set('providers', meta.providers);
@@ -22119,7 +22094,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
22119
22094
  function createNgModuleDefinitionMap(meta) {
22120
22095
  const definitionMap = new DefinitionMap();
22121
22096
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22122
- definitionMap.set('version', literal('15.1.0'));
22097
+ definitionMap.set('version', literal('15.1.4'));
22123
22098
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22124
22099
  definitionMap.set('type', meta.internalType);
22125
22100
  // We only generate the keys in the metadata if the arrays contain values.
@@ -22170,7 +22145,7 @@ function compileDeclarePipeFromMetadata(meta) {
22170
22145
  function createPipeDefinitionMap(meta) {
22171
22146
  const definitionMap = new DefinitionMap();
22172
22147
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22173
- definitionMap.set('version', literal('15.1.0'));
22148
+ definitionMap.set('version', literal('15.1.4'));
22174
22149
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22175
22150
  // e.g. `type: MyPipe`
22176
22151
  definitionMap.set('type', meta.internalType);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/bundled-angular-compiler",
3
- "version": "15.2.1-alpha.9+8b36532",
3
+ "version": "15.2.2-alpha.0+9ecf4ac",
4
4
  "description": "A CJS bundled version of @angular/compiler",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -15,5 +15,5 @@
15
15
  "package.json",
16
16
  "README.md"
17
17
  ],
18
- "gitHead": "8b3653207f3687885c4ecd24e9a35dd7fdc611d3"
18
+ "gitHead": "9ecf4acc786d8529c6110db8842303286df80103"
19
19
  }