@angular/language-service 12.0.0-rc.0 → 12.0.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.
package/bundles/ivy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.0.0-rc.0
2
+ * @license Angular v12.0.0
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  * License: MIT
5
5
  */
@@ -8424,17 +8424,48 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
8424
8424
  return processRules(cssText, (rule) => {
8425
8425
  let selector = rule.selector;
8426
8426
  let content = rule.content;
8427
- if (rule.selector[0] != '@') {
8427
+ if (rule.selector[0] !== '@') {
8428
8428
  selector =
8429
8429
  this._scopeSelector(rule.selector, scopeSelector, hostSelector, this.strictStyling);
8430
8430
  }
8431
8431
  else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||
8432
- rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) {
8432
+ rule.selector.startsWith('@document')) {
8433
8433
  content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
8434
8434
  }
8435
+ else if (rule.selector.startsWith('@font-face') || rule.selector.startsWith('@page')) {
8436
+ content = this._stripScopingSelectors(rule.content);
8437
+ }
8435
8438
  return new CssRule(selector, content);
8436
8439
  });
8437
8440
  }
8441
+ /**
8442
+ * Handle a css text that is within a rule that should not contain scope selectors by simply
8443
+ * removing them! An example of such a rule is `@font-face`.
8444
+ *
8445
+ * `@font-face` rules cannot contain nested selectors. Nor can they be nested under a selector.
8446
+ * Normally this would be a syntax error by the author of the styles. But in some rare cases, such
8447
+ * as importing styles from a library, and applying `:host ::ng-deep` to the imported styles, we
8448
+ * can end up with broken css if the imported styles happen to contain @font-face rules.
8449
+ *
8450
+ * For example:
8451
+ *
8452
+ * ```
8453
+ * :host ::ng-deep {
8454
+ * import 'some/lib/containing/font-face';
8455
+ * }
8456
+ *
8457
+ * Similar logic applies to `@page` rules which can contain a particular set of properties,
8458
+ * as well as some specific at-rules. Since they can't be encapsulated, we have to strip
8459
+ * any scoping selectors from them. For more information: https://www.w3.org/TR/css-page-3
8460
+ * ```
8461
+ */
8462
+ _stripScopingSelectors(cssText) {
8463
+ return processRules(cssText, rule => {
8464
+ const selector = rule.selector.replace(_shadowDeepSelectors, ' ')
8465
+ .replace(_polyfillHostNoCombinatorRe, ' ');
8466
+ return new CssRule(selector, rule.content);
8467
+ });
8468
+ }
8438
8469
  _scopeSelector(selector, scopeSelector, hostSelector, strict) {
8439
8470
  return selector.split(',')
8440
8471
  .map(part => part.trim().split(_shadowDeepSelectors))
@@ -17840,7 +17871,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
17840
17871
  * Use of this source code is governed by an MIT-style license that can be
17841
17872
  * found in the LICENSE file at https://angular.io/license
17842
17873
  */
17843
- const VERSION$1 = new Version('12.0.0-rc.0');
17874
+ const VERSION$1 = new Version('12.0.0');
17844
17875
 
17845
17876
  /**
17846
17877
  * @license
@@ -18479,7 +18510,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
18479
18510
  function compileDeclareClassMetadata(metadata) {
18480
18511
  const definitionMap = new DefinitionMap();
18481
18512
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
18482
- definitionMap.set('version', literal('12.0.0-rc.0'));
18513
+ definitionMap.set('version', literal('12.0.0'));
18483
18514
  definitionMap.set('ngImport', importExpr(Identifiers.core));
18484
18515
  definitionMap.set('type', metadata.type);
18485
18516
  definitionMap.set('decorators', metadata.decorators);
@@ -18519,7 +18550,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
18519
18550
  function createDirectiveDefinitionMap(meta) {
18520
18551
  const definitionMap = new DefinitionMap();
18521
18552
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
18522
- definitionMap.set('version', literal('12.0.0-rc.0'));
18553
+ definitionMap.set('version', literal('12.0.0'));
18523
18554
  // e.g. `type: MyDirective`
18524
18555
  definitionMap.set('type', meta.internalType);
18525
18556
  // e.g. `selector: 'some-dir'`
@@ -18736,7 +18767,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
18736
18767
  function compileDeclareFactoryFunction(meta) {
18737
18768
  const definitionMap = new DefinitionMap();
18738
18769
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
18739
- definitionMap.set('version', literal('12.0.0-rc.0'));
18770
+ definitionMap.set('version', literal('12.0.0'));
18740
18771
  definitionMap.set('ngImport', importExpr(Identifiers.core));
18741
18772
  definitionMap.set('type', meta.internalType);
18742
18773
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -18778,7 +18809,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
18778
18809
  function createInjectableDefinitionMap(meta) {
18779
18810
  const definitionMap = new DefinitionMap();
18780
18811
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
18781
- definitionMap.set('version', literal('12.0.0-rc.0'));
18812
+ definitionMap.set('version', literal('12.0.0'));
18782
18813
  definitionMap.set('ngImport', importExpr(Identifiers.core));
18783
18814
  definitionMap.set('type', meta.internalType);
18784
18815
  // Only generate providedIn property if it has a non-null value
@@ -18857,7 +18888,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
18857
18888
  function createInjectorDefinitionMap(meta) {
18858
18889
  const definitionMap = new DefinitionMap();
18859
18890
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
18860
- definitionMap.set('version', literal('12.0.0-rc.0'));
18891
+ definitionMap.set('version', literal('12.0.0'));
18861
18892
  definitionMap.set('ngImport', importExpr(Identifiers.core));
18862
18893
  definitionMap.set('type', meta.internalType);
18863
18894
  definitionMap.set('providers', meta.providers);
@@ -18894,7 +18925,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
18894
18925
  function createNgModuleDefinitionMap(meta) {
18895
18926
  const definitionMap = new DefinitionMap();
18896
18927
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
18897
- definitionMap.set('version', literal('12.0.0-rc.0'));
18928
+ definitionMap.set('version', literal('12.0.0'));
18898
18929
  definitionMap.set('ngImport', importExpr(Identifiers.core));
18899
18930
  definitionMap.set('type', meta.internalType);
18900
18931
  // We only generate the keys in the metadata if the arrays contain values.
@@ -18952,7 +18983,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
18952
18983
  function createPipeDefinitionMap(meta) {
18953
18984
  const definitionMap = new DefinitionMap();
18954
18985
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
18955
- definitionMap.set('version', literal('12.0.0-rc.0'));
18986
+ definitionMap.set('version', literal('12.0.0'));
18956
18987
  definitionMap.set('ngImport', importExpr(Identifiers.core));
18957
18988
  // e.g. `type: MyPipe`
18958
18989
  definitionMap.set('type', meta.internalType);
@@ -18984,7 +19015,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
18984
19015
  * Use of this source code is governed by an MIT-style license that can be
18985
19016
  * found in the LICENSE file at https://angular.io/license
18986
19017
  */
18987
- const VERSION$2 = new Version('12.0.0-rc.0');
19018
+ const VERSION$2 = new Version('12.0.0');
18988
19019
 
18989
19020
  /**
18990
19021
  * @license
@@ -19333,6 +19364,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
19333
19364
  return ts$1.isEnumDeclaration(node) || ts$1.isTypeAliasDeclaration(node) ||
19334
19365
  ts$1.isInterfaceDeclaration(node);
19335
19366
  }
19367
+ function isNamedDeclaration(node) {
19368
+ const namedNode = node;
19369
+ return namedNode.name !== undefined && ts$1.isIdentifier(namedNode.name);
19370
+ }
19336
19371
  function isExported(node) {
19337
19372
  let topLevel = node;
19338
19373
  if (ts$1.isVariableDeclaration(node) && ts$1.isVariableDeclarationList(node.parent)) {
@@ -19412,16 +19447,23 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
19412
19447
  if (exports === null) {
19413
19448
  return null;
19414
19449
  }
19450
+ const declaredName = isNamedDeclaration(target) ? target.name.text : null;
19415
19451
  // Look for the export which declares the node.
19416
- const keys = Array.from(exports.keys());
19417
- const name = keys.find(key => {
19418
- const decl = exports.get(key);
19419
- return decl !== undefined && decl.node === target;
19420
- });
19421
- if (name === undefined) {
19452
+ let foundExportName = null;
19453
+ for (const [exportName, declaration] of exports) {
19454
+ if (declaration.node !== target) {
19455
+ continue;
19456
+ }
19457
+ if (exportName === declaredName) {
19458
+ // A non-alias export exists which is always preferred, so use that one.
19459
+ return exportName;
19460
+ }
19461
+ foundExportName = exportName;
19462
+ }
19463
+ if (foundExportName === null) {
19422
19464
  throw new Error(`Failed to find exported name of node (${target.getText()}) in '${file.fileName}'.`);
19423
19465
  }
19424
- return name;
19466
+ return foundExportName;
19425
19467
  }
19426
19468
 
19427
19469
  /**
@@ -19582,9 +19624,20 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
19582
19624
  return null;
19583
19625
  }
19584
19626
  const exportMap = new Map();
19585
- exports.forEach((declaration, name) => {
19627
+ for (const [name, declaration] of exports) {
19628
+ if (exportMap.has(declaration.node)) {
19629
+ // An export for this declaration has already been registered. We prefer an export that
19630
+ // has the same name as the declared name, i.e. is not an aliased export. This is relevant
19631
+ // for partial compilations where emitted references should import symbols using a stable
19632
+ // name. This is particularly relevant for declarations inside VE-generated libraries, as
19633
+ // such libraries contain private, unstable reexports of symbols.
19634
+ const existingExport = exportMap.get(declaration.node);
19635
+ if (isNamedDeclaration(declaration.node) && declaration.node.name.text === existingExport) {
19636
+ continue;
19637
+ }
19638
+ }
19586
19639
  exportMap.set(declaration.node, name);
19587
- });
19640
+ }
19588
19641
  return { module: entryPointFile, exportMap };
19589
19642
  }
19590
19643
  }
@@ -25850,89 +25903,6 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
25850
25903
  };
25851
25904
  }
25852
25905
 
25853
- /**
25854
- * @license
25855
- * Copyright Google LLC All Rights Reserved.
25856
- *
25857
- * Use of this source code is governed by an MIT-style license that can be
25858
- * found in the LICENSE file at https://angular.io/license
25859
- */
25860
- let _tsSourceMapBug29300Fixed;
25861
- /**
25862
- * Test the current version of TypeScript to see if it has fixed the external SourceMap
25863
- * file bug: https://github.com/Microsoft/TypeScript/issues/29300.
25864
- *
25865
- * The bug is fixed in TS 3.3+ but this check avoid us having to rely upon the version number,
25866
- * and allows us to gracefully fail if the TS version still has the bug.
25867
- *
25868
- * We check for the bug by compiling a very small program `a;` and transforming it to `b;`,
25869
- * where we map the new `b` identifier to an external source file, which has different lines to
25870
- * the original source file. If the bug is fixed then the output SourceMap should contain
25871
- * mappings that correspond ot the correct line/col pairs for this transformed node.
25872
- *
25873
- * @returns true if the bug is fixed.
25874
- */
25875
- function tsSourceMapBug29300Fixed() {
25876
- if (_tsSourceMapBug29300Fixed === undefined) {
25877
- let writtenFiles = {};
25878
- const sourceFile = ts$1.createSourceFile('test.ts', 'a;', ts$1.ScriptTarget.ES2015, true, ts$1.ScriptKind.TS);
25879
- const host = {
25880
- getSourceFile() {
25881
- return sourceFile;
25882
- },
25883
- fileExists() {
25884
- return true;
25885
- },
25886
- readFile() {
25887
- return '';
25888
- },
25889
- writeFile(fileName, data) {
25890
- writtenFiles[fileName] = data;
25891
- },
25892
- getDefaultLibFileName() {
25893
- return '';
25894
- },
25895
- getCurrentDirectory() {
25896
- return '';
25897
- },
25898
- getDirectories() {
25899
- return [];
25900
- },
25901
- getCanonicalFileName() {
25902
- return '';
25903
- },
25904
- useCaseSensitiveFileNames() {
25905
- return true;
25906
- },
25907
- getNewLine() {
25908
- return '\n';
25909
- },
25910
- };
25911
- const transform = (context) => {
25912
- return (node) => ts$1.visitNode(node, visitor);
25913
- function visitor(node) {
25914
- if (ts$1.isIdentifier(node) && node.text === 'a') {
25915
- const newNode = ts$1.createIdentifier('b');
25916
- ts$1.setSourceMapRange(newNode, {
25917
- pos: 16,
25918
- end: 16,
25919
- source: ts$1.createSourceMapSource('test.html', 'abc\ndef\nghi\njkl\nmno\npqr')
25920
- });
25921
- return newNode;
25922
- }
25923
- return ts$1.visitEachChild(node, visitor, context);
25924
- }
25925
- };
25926
- const program = ts$1.createProgram(['test.ts'], { sourceMap: true }, host);
25927
- program.emit(sourceFile, undefined, undefined, undefined, { after: [transform] });
25928
- // The first two mappings in the source map should look like:
25929
- // [0,1,4,0] col 0 => source file 1, row 4, column 0)
25930
- // [1,0,0,0] col 1 => source file 1, row 4, column 0)
25931
- _tsSourceMapBug29300Fixed = /ACIA,CAAA/.test(writtenFiles['test.js.map']);
25932
- }
25933
- return _tsSourceMapBug29300Fixed;
25934
- }
25935
-
25936
25906
  /**
25937
25907
  * @license
25938
25908
  * Copyright Google LLC All Rights Reserved.
@@ -28719,6 +28689,7 @@ Either add the @Injectable() decorator to '${provider.node.name
28719
28689
  let templateContent;
28720
28690
  let sourceMapping;
28721
28691
  let escapedString = false;
28692
+ let sourceMapUrl;
28722
28693
  // We only support SourceMaps for inline templates that are simple string literals.
28723
28694
  if (ts$1.isStringLiteral(template.expression) ||
28724
28695
  ts$1.isNoSubstitutionTemplateLiteral(template.expression)) {
@@ -28732,6 +28703,7 @@ Either add the @Injectable() decorator to '${provider.node.name
28732
28703
  type: 'direct',
28733
28704
  node: template.expression,
28734
28705
  };
28706
+ sourceMapUrl = template.resolvedTemplateUrl;
28735
28707
  }
28736
28708
  else {
28737
28709
  const resolvedTemplate = this.evaluator.evaluate(template.expression);
@@ -28748,8 +28720,12 @@ Either add the @Injectable() decorator to '${provider.node.name
28748
28720
  componentClass: node,
28749
28721
  template: templateContent,
28750
28722
  };
28723
+ // Indirect templates cannot be mapped to a particular byte range of any input file, since
28724
+ // they're computed by expressions that may span many files. Don't attempt to map them back
28725
+ // to a given file.
28726
+ sourceMapUrl = null;
28751
28727
  }
28752
- return Object.assign(Object.assign({}, this._parseTemplate(template, sourceStr, sourceParseRange, escapedString)), { content: templateContent, sourceMapping, declaration: template });
28728
+ return Object.assign(Object.assign({}, this._parseTemplate(template, sourceStr, sourceParseRange, escapedString, sourceMapUrl)), { content: templateContent, sourceMapping, declaration: template });
28753
28729
  }
28754
28730
  else {
28755
28731
  const templateContent = this.resourceLoader.load(template.resolvedTemplateUrl);
@@ -28757,7 +28733,8 @@ Either add the @Injectable() decorator to '${provider.node.name
28757
28733
  this.depTracker.addResourceDependency(node.getSourceFile(), absoluteFrom(template.resolvedTemplateUrl));
28758
28734
  }
28759
28735
  return Object.assign(Object.assign({}, this._parseTemplate(template, /* sourceStr */ templateContent, /* sourceParseRange */ null,
28760
- /* escapedString */ false)), { content: templateContent, sourceMapping: {
28736
+ /* escapedString */ false,
28737
+ /* sourceMapUrl */ template.resolvedTemplateUrl)), { content: templateContent, sourceMapping: {
28761
28738
  type: 'external',
28762
28739
  componentClass: node,
28763
28740
  // TODO(alxhub): TS in g3 is unable to make this inference on its own, so cast it here
@@ -28768,10 +28745,10 @@ Either add the @Injectable() decorator to '${provider.node.name
28768
28745
  }, declaration: template });
28769
28746
  }
28770
28747
  }
28771
- _parseTemplate(template, sourceStr, sourceParseRange, escapedString) {
28748
+ _parseTemplate(template, sourceStr, sourceParseRange, escapedString, sourceMapUrl) {
28772
28749
  // We always normalize line endings if the template has been escaped (i.e. is inline).
28773
28750
  const i18nNormalizeLineEndingsInICUs = escapedString || this.i18nNormalizeLineEndingsInICUs;
28774
- const parsedTemplate = parseTemplate(sourceStr, template.sourceMapUrl, {
28751
+ const parsedTemplate = parseTemplate(sourceStr, sourceMapUrl !== null && sourceMapUrl !== void 0 ? sourceMapUrl : '', {
28775
28752
  preserveWhitespaces: template.preserveWhitespaces,
28776
28753
  interpolationConfig: template.interpolationConfig,
28777
28754
  range: sourceParseRange !== null && sourceParseRange !== void 0 ? sourceParseRange : undefined,
@@ -28794,7 +28771,7 @@ Either add the @Injectable() decorator to '${provider.node.name
28794
28771
  //
28795
28772
  // In order to guarantee the correctness of diagnostics, templates are parsed a second time
28796
28773
  // with the above options set to preserve source mappings.
28797
- const { nodes: diagNodes } = parseTemplate(sourceStr, template.sourceMapUrl, {
28774
+ const { nodes: diagNodes } = parseTemplate(sourceStr, sourceMapUrl !== null && sourceMapUrl !== void 0 ? sourceMapUrl : '', {
28798
28775
  preserveWhitespaces: true,
28799
28776
  preserveLineEndings: true,
28800
28777
  interpolationConfig: template.interpolationConfig,
@@ -28805,7 +28782,7 @@ Either add the @Injectable() decorator to '${provider.node.name
28805
28782
  leadingTriviaChars: [],
28806
28783
  alwaysAttemptHtmlToR3AstConversion: this.usePoisonedData,
28807
28784
  });
28808
- return Object.assign(Object.assign({}, parsedTemplate), { diagNodes, file: new ParseSourceFile(sourceStr, template.resolvedTemplateUrl) });
28785
+ return Object.assign(Object.assign({}, parsedTemplate), { diagNodes, file: new ParseSourceFile(sourceStr, sourceMapUrl !== null && sourceMapUrl !== void 0 ? sourceMapUrl : '') });
28809
28786
  }
28810
28787
  parseTemplateDeclaration(decorator, component, containingFile) {
28811
28788
  let preserveWhitespaces = this.defaultPreserveWhitespaces;
@@ -28842,7 +28819,6 @@ Either add the @Injectable() decorator to '${provider.node.name
28842
28819
  templateUrl,
28843
28820
  templateUrlExpression: templateUrlExpr,
28844
28821
  resolvedTemplateUrl: resourceUrl,
28845
- sourceMapUrl: sourceMapUrl(resourceUrl),
28846
28822
  };
28847
28823
  }
28848
28824
  catch (e) {
@@ -28857,7 +28833,6 @@ Either add the @Injectable() decorator to '${provider.node.name
28857
28833
  expression: component.get('template'),
28858
28834
  templateUrl: containingFile,
28859
28835
  resolvedTemplateUrl: containingFile,
28860
- sourceMapUrl: containingFile,
28861
28836
  };
28862
28837
  }
28863
28838
  else {
@@ -28933,17 +28908,6 @@ Either add the @Injectable() decorator to '${provider.node.name
28933
28908
  endPos: templateExpr.getEnd() - 1,
28934
28909
  };
28935
28910
  }
28936
- function sourceMapUrl(resourceUrl) {
28937
- if (!tsSourceMapBug29300Fixed()) {
28938
- // By removing the template URL we are telling the translator not to try to
28939
- // map the external source file to the generated code, since the version
28940
- // of TS that is running does not support it.
28941
- return '';
28942
- }
28943
- else {
28944
- return resourceUrl;
28945
- }
28946
- }
28947
28911
  /** Determines if the result of an evaluation is a string array. */
28948
28912
  function isStringArray(resolvedValue) {
28949
28913
  return Array.isArray(resolvedValue) && resolvedValue.every(elem => typeof elem === 'string');
@@ -41517,6 +41481,9 @@ https://v9.angular.io/guide/template-typecheck#template-type-checking`,
41517
41481
  entries.set(createLocationKey(entry), entry);
41518
41482
  }
41519
41483
  }
41484
+ else {
41485
+ entries.set(createLocationKey(ref), ref);
41486
+ }
41520
41487
  }
41521
41488
  return Array.from(entries.values());
41522
41489
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.0.0-rc.0
2
+ * @license Angular v12.0.0
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  * License: MIT
5
5
  */
@@ -8392,17 +8392,48 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
8392
8392
  return processRules(cssText, (rule) => {
8393
8393
  let selector = rule.selector;
8394
8394
  let content = rule.content;
8395
- if (rule.selector[0] != '@') {
8395
+ if (rule.selector[0] !== '@') {
8396
8396
  selector =
8397
8397
  this._scopeSelector(rule.selector, scopeSelector, hostSelector, this.strictStyling);
8398
8398
  }
8399
8399
  else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||
8400
- rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) {
8400
+ rule.selector.startsWith('@document')) {
8401
8401
  content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
8402
8402
  }
8403
+ else if (rule.selector.startsWith('@font-face') || rule.selector.startsWith('@page')) {
8404
+ content = this._stripScopingSelectors(rule.content);
8405
+ }
8403
8406
  return new CssRule(selector, content);
8404
8407
  });
8405
8408
  }
8409
+ /**
8410
+ * Handle a css text that is within a rule that should not contain scope selectors by simply
8411
+ * removing them! An example of such a rule is `@font-face`.
8412
+ *
8413
+ * `@font-face` rules cannot contain nested selectors. Nor can they be nested under a selector.
8414
+ * Normally this would be a syntax error by the author of the styles. But in some rare cases, such
8415
+ * as importing styles from a library, and applying `:host ::ng-deep` to the imported styles, we
8416
+ * can end up with broken css if the imported styles happen to contain @font-face rules.
8417
+ *
8418
+ * For example:
8419
+ *
8420
+ * ```
8421
+ * :host ::ng-deep {
8422
+ * import 'some/lib/containing/font-face';
8423
+ * }
8424
+ *
8425
+ * Similar logic applies to `@page` rules which can contain a particular set of properties,
8426
+ * as well as some specific at-rules. Since they can't be encapsulated, we have to strip
8427
+ * any scoping selectors from them. For more information: https://www.w3.org/TR/css-page-3
8428
+ * ```
8429
+ */
8430
+ _stripScopingSelectors(cssText) {
8431
+ return processRules(cssText, rule => {
8432
+ const selector = rule.selector.replace(_shadowDeepSelectors, ' ')
8433
+ .replace(_polyfillHostNoCombinatorRe, ' ');
8434
+ return new CssRule(selector, rule.content);
8435
+ });
8436
+ }
8406
8437
  _scopeSelector(selector, scopeSelector, hostSelector, strict) {
8407
8438
  return selector.split(',')
8408
8439
  .map(part => part.trim().split(_shadowDeepSelectors))
@@ -19381,7 +19412,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
19381
19412
  * Use of this source code is governed by an MIT-style license that can be
19382
19413
  * found in the LICENSE file at https://angular.io/license
19383
19414
  */
19384
- const VERSION$1 = new Version('12.0.0-rc.0');
19415
+ const VERSION$1 = new Version('12.0.0');
19385
19416
 
19386
19417
  /**
19387
19418
  * @license
@@ -31400,11 +31431,21 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
31400
31431
  const toCall = destroyHooks[i + 1];
31401
31432
  if (Array.isArray(toCall)) {
31402
31433
  for (let j = 0; j < toCall.length; j += 2) {
31403
- toCall[j + 1].call(context[toCall[j]]);
31434
+ const callContext = context[toCall[j]];
31435
+ const hook = toCall[j + 1];
31436
+ try {
31437
+ hook.call(callContext);
31438
+ }
31439
+ finally {
31440
+ }
31404
31441
  }
31405
31442
  }
31406
31443
  else {
31407
- toCall.call(context);
31444
+ try {
31445
+ toCall.call(context);
31446
+ }
31447
+ finally {
31448
+ }
31408
31449
  }
31409
31450
  }
31410
31451
  }
@@ -35439,7 +35480,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
35439
35480
  /**
35440
35481
  * @publicApi
35441
35482
  */
35442
- const VERSION$2 = new Version$1('12.0.0-rc.0');
35483
+ const VERSION$2 = new Version$1('12.0.0');
35443
35484
 
35444
35485
  /**
35445
35486
  * @license
@@ -36628,9 +36669,6 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
36628
36669
  /**
36629
36670
  * Marks a view and all of its ancestors dirty.
36630
36671
  *
36631
- * It also triggers change detection by calling `scheduleTick` internally, which coalesces
36632
- * multiple `markForCheck` calls to into one change detection run.
36633
- *
36634
36672
  * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush OnPush} component is
36635
36673
  * checked when it needs to be re-rendered but the two normal triggers haven't marked it
36636
36674
  * dirty (i.e. inputs haven't changed and events haven't fired in the view).
@@ -39833,8 +39871,8 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
39833
39871
  */
39834
39872
  /**
39835
39873
  * The Testability service provides testing hooks that can be accessed from
39836
- * the browser and by services such as Protractor. Each bootstrapped Angular
39837
- * application on the page will have an instance of Testability.
39874
+ * the browser. Each bootstrapped Angular application on the page will have
39875
+ * an instance of Testability.
39838
39876
  * @publicApi
39839
39877
  */
39840
39878
  class Testability {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@angular/language-service",
3
- "version": "12.0.0-rc.0",
3
+ "version": "12.0.0",
4
4
  "description": "Angular - language services",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
7
7
  "author": "angular",
8
8
  "license": "MIT",
9
9
  "engines": {
10
- "node": ">=12.14.1 <16.0.0"
10
+ "node": "^12.14.1 || ^14.0.0"
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",