@angular/language-service 11.1.0-next.5 → 11.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v11.1.0-next.5
2
+ * @license Angular v11.1.2
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  * License: MIT
5
5
  */
@@ -822,9 +822,13 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
822
822
  const createInject = makeMetadataFactory('Inject', (token) => ({ token }));
823
823
  const createInjectionToken = makeMetadataFactory('InjectionToken', (desc) => ({ _desc: desc, ɵprov: undefined }));
824
824
  const createAttribute = makeMetadataFactory('Attribute', (attributeName) => ({ attributeName }));
825
- const createContentChildren = makeMetadataFactory('ContentChildren', (selector, data = {}) => (Object.assign({ selector, first: false, isViewQuery: false, descendants: false }, data)));
825
+ // Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not
826
+ // explicitly set. This value will be changed to `true` in v12.
827
+ // TODO(misko): switch the default in v12 to `true`. See: packages/core/src/metadata/di.ts
828
+ const emitDistinctChangesOnlyDefaultValue = false;
829
+ const createContentChildren = makeMetadataFactory('ContentChildren', (selector, data = {}) => (Object.assign({ selector, first: false, isViewQuery: false, descendants: false, emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue }, data)));
826
830
  const createContentChild = makeMetadataFactory('ContentChild', (selector, data = {}) => (Object.assign({ selector, first: true, isViewQuery: false, descendants: true }, data)));
827
- const createViewChildren = makeMetadataFactory('ViewChildren', (selector, data = {}) => (Object.assign({ selector, first: false, isViewQuery: true, descendants: true }, data)));
831
+ const createViewChildren = makeMetadataFactory('ViewChildren', (selector, data = {}) => (Object.assign({ selector, first: false, isViewQuery: true, descendants: true, emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue }, data)));
828
832
  const createViewChild = makeMetadataFactory('ViewChild', (selector, data) => (Object.assign({ selector, first: true, isViewQuery: true, descendants: true }, data)));
829
833
  const createDirective = makeMetadataFactory('Directive', (dir = {}) => dir);
830
834
  var ViewEncapsulation;
@@ -3104,8 +3108,6 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
3104
3108
  Identifiers$1.definePipe = { name: 'ɵɵdefinePipe', moduleName: CORE$1 };
3105
3109
  Identifiers$1.queryRefresh = { name: 'ɵɵqueryRefresh', moduleName: CORE$1 };
3106
3110
  Identifiers$1.viewQuery = { name: 'ɵɵviewQuery', moduleName: CORE$1 };
3107
- Identifiers$1.staticViewQuery = { name: 'ɵɵstaticViewQuery', moduleName: CORE$1 };
3108
- Identifiers$1.staticContentQuery = { name: 'ɵɵstaticContentQuery', moduleName: CORE$1 };
3109
3111
  Identifiers$1.loadQuery = { name: 'ɵɵloadQuery', moduleName: CORE$1 };
3110
3112
  Identifiers$1.contentQuery = { name: 'ɵɵcontentQuery', moduleName: CORE$1 };
3111
3113
  Identifiers$1.NgOnChangesFeature = { name: 'ɵɵNgOnChangesFeature', moduleName: CORE$1 };
@@ -9879,7 +9881,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
9879
9881
  this._advance();
9880
9882
  selfClosing = false;
9881
9883
  }
9882
- const end = this._peek.sourceSpan.start;
9884
+ const end = this._peek.sourceSpan.fullStart;
9883
9885
  const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
9884
9886
  // Create a separate `startSpan` because `span` will be modified when there is an `end` span.
9885
9887
  const startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
@@ -11013,8 +11015,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
11013
11015
  }
11014
11016
  parseInterpolation(value, sourceSpan) {
11015
11017
  const sourceInfo = sourceSpan.start.toString();
11018
+ const absoluteOffset = sourceSpan.fullStart.offset;
11016
11019
  try {
11017
- const ast = this._exprParser.parseInterpolation(value, sourceInfo, sourceSpan.start.offset, this._interpolationConfig);
11020
+ const ast = this._exprParser.parseInterpolation(value, sourceInfo, absoluteOffset, this._interpolationConfig);
11018
11021
  if (ast)
11019
11022
  this._reportExpressionParserErrors(ast.errors, sourceSpan);
11020
11023
  this._checkPipes(ast, sourceSpan);
@@ -11022,7 +11025,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
11022
11025
  }
11023
11026
  catch (e) {
11024
11027
  this._reportError(`${e}`, sourceSpan);
11025
- return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, sourceSpan.start.offset);
11028
+ return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset);
11026
11029
  }
11027
11030
  }
11028
11031
  /**
@@ -11032,8 +11035,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
11032
11035
  */
11033
11036
  parseInterpolationExpression(expression, sourceSpan) {
11034
11037
  const sourceInfo = sourceSpan.start.toString();
11038
+ const absoluteOffset = sourceSpan.start.offset;
11035
11039
  try {
11036
- const ast = this._exprParser.parseInterpolationExpression(expression, sourceInfo, sourceSpan.start.offset);
11040
+ const ast = this._exprParser.parseInterpolationExpression(expression, sourceInfo, absoluteOffset);
11037
11041
  if (ast)
11038
11042
  this._reportExpressionParserErrors(ast.errors, sourceSpan);
11039
11043
  this._checkPipes(ast, sourceSpan);
@@ -11041,7 +11045,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
11041
11045
  }
11042
11046
  catch (e) {
11043
11047
  this._reportError(`${e}`, sourceSpan);
11044
- return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, sourceSpan.start.offset);
11048
+ return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset);
11045
11049
  }
11046
11050
  }
11047
11051
  /**
@@ -11121,6 +11125,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
11121
11125
  targetProps, keySpan) {
11122
11126
  if (isAnimationLabel(name)) {
11123
11127
  name = name.substring(1);
11128
+ if (keySpan !== undefined) {
11129
+ keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));
11130
+ }
11124
11131
  if (value) {
11125
11132
  this._reportError(`Assigning animation triggers via @prop="exp" attributes with an expression is invalid.` +
11126
11133
  ` Use property bindings (e.g. [@prop]="exp") or use an attribute without a value (e.g. @prop) instead.`, sourceSpan, ParseErrorLevel.ERROR);
@@ -11142,10 +11149,16 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
11142
11149
  if (name.startsWith(ANIMATE_PROP_PREFIX)) {
11143
11150
  isAnimationProp = true;
11144
11151
  name = name.substring(ANIMATE_PROP_PREFIX.length);
11152
+ if (keySpan !== undefined) {
11153
+ keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + ANIMATE_PROP_PREFIX.length, keySpan.end.offset));
11154
+ }
11145
11155
  }
11146
11156
  else if (isAnimationLabel(name)) {
11147
11157
  isAnimationProp = true;
11148
11158
  name = name.substring(1);
11159
+ if (keySpan !== undefined) {
11160
+ keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));
11161
+ }
11149
11162
  }
11150
11163
  if (isAnimationProp) {
11151
11164
  this._parseAnimation(name, expression, sourceSpan, absoluteOffset, keySpan, valueSpan, targetMatchableAttrs, targetProps);
@@ -11252,6 +11265,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
11252
11265
  }
11253
11266
  if (isAnimationLabel(name)) {
11254
11267
  name = name.substr(1);
11268
+ if (keySpan !== undefined) {
11269
+ keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));
11270
+ }
11255
11271
  this._parseAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan);
11256
11272
  }
11257
11273
  else {
@@ -13350,13 +13366,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
13350
13366
  }
13351
13367
  const fullEnd = exprEnd + interpEnd.length;
13352
13368
  const text = input.substring(exprStart, exprEnd);
13353
- if (text.trim().length > 0) {
13354
- expressions.push({ text, start: fullStart, end: fullEnd });
13355
- }
13356
- else {
13369
+ if (text.trim().length === 0) {
13357
13370
  this._reportError('Blank expressions are not allowed in interpolated strings', input, `at column ${i} in`, location);
13358
- expressions.push({ text: '$implicit', start: fullStart, end: fullEnd });
13359
13371
  }
13372
+ expressions.push({ text, start: fullStart, end: fullEnd });
13360
13373
  offsets.push(exprStart);
13361
13374
  i = fullEnd;
13362
13375
  atInterpolation = false;
@@ -13539,13 +13552,25 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
13539
13552
  get currentAbsoluteOffset() {
13540
13553
  return this.absoluteOffset + this.inputIndex;
13541
13554
  }
13542
- span(start) {
13543
- return new ParseSpan(start, this.currentEndIndex);
13555
+ /**
13556
+ * Retrieve a `ParseSpan` from `start` to the current position (or to `artificialEndIndex` if
13557
+ * provided).
13558
+ *
13559
+ * @param start Position from which the `ParseSpan` will start.
13560
+ * @param artificialEndIndex Optional ending index to be used if provided (and if greater than the
13561
+ * natural ending index)
13562
+ */
13563
+ span(start, artificialEndIndex) {
13564
+ let endIndex = this.currentEndIndex;
13565
+ if (artificialEndIndex !== undefined && artificialEndIndex > this.currentEndIndex) {
13566
+ endIndex = artificialEndIndex;
13567
+ }
13568
+ return new ParseSpan(start, endIndex);
13544
13569
  }
13545
- sourceSpan(start) {
13546
- const serial = `${start}@${this.inputIndex}`;
13570
+ sourceSpan(start, artificialEndIndex) {
13571
+ const serial = `${start}@${this.inputIndex}:${artificialEndIndex}`;
13547
13572
  if (!this.sourceSpanCache.has(serial)) {
13548
- this.sourceSpanCache.set(serial, this.span(start).toAbsolute(this.absoluteOffset));
13573
+ this.sourceSpanCache.set(serial, this.span(start, artificialEndIndex).toAbsolute(this.absoluteOffset));
13549
13574
  }
13550
13575
  return this.sourceSpanCache.get(serial);
13551
13576
  }
@@ -13608,7 +13633,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
13608
13633
  const n = this.next;
13609
13634
  if (!n.isIdentifier() && !n.isKeyword()) {
13610
13635
  this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier or keyword`);
13611
- return '';
13636
+ return null;
13612
13637
  }
13613
13638
  this.advance();
13614
13639
  return n.toString();
@@ -13639,8 +13664,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
13639
13664
  this.error(`Unexpected token '${this.next}'`);
13640
13665
  }
13641
13666
  }
13642
- if (exprs.length == 0)
13643
- return new EmptyExpr(this.span(start), this.sourceSpan(start));
13667
+ if (exprs.length == 0) {
13668
+ // We have no expressions so create an empty expression that spans the entire input length
13669
+ const artificialStart = this.offset;
13670
+ const artificialEnd = this.offset + this.inputLength;
13671
+ return new EmptyExpr(this.span(artificialStart, artificialEnd), this.sourceSpan(artificialStart, artificialEnd));
13672
+ }
13644
13673
  if (exprs.length == 1)
13645
13674
  return exprs[0];
13646
13675
  return new Chain(this.span(start), this.sourceSpan(start), exprs);
@@ -13653,15 +13682,36 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
13653
13682
  }
13654
13683
  do {
13655
13684
  const nameStart = this.inputIndex;
13656
- const name = this.expectIdentifierOrKeyword();
13657
- const nameSpan = this.sourceSpan(nameStart);
13685
+ let nameId = this.expectIdentifierOrKeyword();
13686
+ let nameSpan;
13687
+ let fullSpanEnd = undefined;
13688
+ if (nameId !== null) {
13689
+ nameSpan = this.sourceSpan(nameStart);
13690
+ }
13691
+ else {
13692
+ // No valid identifier was found, so we'll assume an empty pipe name ('').
13693
+ nameId = '';
13694
+ // However, there may have been whitespace present between the pipe character and the next
13695
+ // token in the sequence (or the end of input). We want to track this whitespace so that
13696
+ // the `BindingPipe` we produce covers not just the pipe character, but any trailing
13697
+ // whitespace beyond it. Another way of thinking about this is that the zero-length name
13698
+ // is assumed to be at the end of any whitespace beyond the pipe character.
13699
+ //
13700
+ // Therefore, we push the end of the `ParseSpan` for this pipe all the way up to the
13701
+ // beginning of the next token, or until the end of input if the next token is EOF.
13702
+ fullSpanEnd = this.next.index !== -1 ? this.next.index : this.inputLength + this.offset;
13703
+ // The `nameSpan` for an empty pipe name is zero-length at the end of any whitespace
13704
+ // beyond the pipe character.
13705
+ nameSpan = new ParseSpan(fullSpanEnd, fullSpanEnd).toAbsolute(this.absoluteOffset);
13706
+ }
13658
13707
  const args = [];
13659
13708
  while (this.consumeOptionalCharacter($COLON)) {
13660
13709
  args.push(this.parseExpression());
13710
+ // If there are additional expressions beyond the name, then the artificial end for the
13711
+ // name is no longer relevant.
13661
13712
  }
13662
13713
  const { start } = result.span;
13663
- result =
13664
- new BindingPipe(this.span(start), this.sourceSpan(start), result, name, args, nameSpan);
13714
+ result = new BindingPipe(this.span(start), this.sourceSpan(start, fullSpanEnd), result, nameId, args, nameSpan);
13665
13715
  } while (this.consumeOptionalOperator('|'));
13666
13716
  }
13667
13717
  return result;
@@ -13950,7 +14000,8 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
13950
14000
  const start = receiver.span.start;
13951
14001
  const nameStart = this.inputIndex;
13952
14002
  const id = this.withContext(ParseContextFlags.Writable, () => {
13953
- const id = this.expectIdentifierOrKeyword();
14003
+ var _a;
14004
+ const id = (_a = this.expectIdentifierOrKeyword()) !== null && _a !== void 0 ? _a : '';
13954
14005
  if (id.length === 0) {
13955
14006
  this.error(`Expected identifier for property access`, receiver.span.end);
13956
14007
  }
@@ -18179,12 +18230,21 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
18179
18230
  }
18180
18231
  }
18181
18232
  function prepareQueryParams(query, constantPool) {
18182
- const parameters = [getQueryPredicate(query, constantPool), literal(query.descendants)];
18233
+ const parameters = [getQueryPredicate(query, constantPool), literal(toQueryFlags(query))];
18183
18234
  if (query.read) {
18184
18235
  parameters.push(query.read);
18185
18236
  }
18186
18237
  return parameters;
18187
18238
  }
18239
+ /**
18240
+ * Translates query flags into `TQueryFlags` type in packages/core/src/render3/interfaces/query.ts
18241
+ * @param query
18242
+ */
18243
+ function toQueryFlags(query) {
18244
+ return (query.descendants ? 1 /* descendants */ : 0 /* none */) |
18245
+ (query.static ? 2 /* isStatic */ : 0 /* none */) |
18246
+ (query.emitDistinctChangesOnly ? 4 /* emitDistinctChangesOnly */ : 0 /* none */);
18247
+ }
18188
18248
  function convertAttributesToExpressions(attributes) {
18189
18249
  const values = [];
18190
18250
  for (let key of Object.getOwnPropertyNames(attributes)) {
@@ -18199,9 +18259,8 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
18199
18259
  const updateStatements = [];
18200
18260
  const tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);
18201
18261
  for (const query of queries) {
18202
- const queryInstruction = query.static ? Identifiers$1.staticContentQuery : Identifiers$1.contentQuery;
18203
18262
  // creation, e.g. r3.contentQuery(dirIndex, somePredicate, true, null);
18204
- createStatements.push(importExpr(queryInstruction)
18263
+ createStatements.push(importExpr(Identifiers$1.contentQuery)
18205
18264
  .callFn([variable('dirIndex'), ...prepareQueryParams(query, constantPool)])
18206
18265
  .toStmt());
18207
18266
  // update, e.g. (r3.queryRefresh(tmp = r3.loadQuery()) && (ctx.someDir = tmp));
@@ -18267,9 +18326,8 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
18267
18326
  const updateStatements = [];
18268
18327
  const tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);
18269
18328
  viewQueries.forEach((query) => {
18270
- const queryInstruction = query.static ? Identifiers$1.staticViewQuery : Identifiers$1.viewQuery;
18271
18329
  // creation, e.g. r3.viewQuery(somePredicate, true);
18272
- const queryDefinition = importExpr(queryInstruction).callFn(prepareQueryParams(query, constantPool));
18330
+ const queryDefinition = importExpr(Identifiers$1.viewQuery).callFn(prepareQueryParams(query, constantPool));
18273
18331
  createStatements.push(queryDefinition.toStmt());
18274
18332
  // update, e.g. (r3.queryRefresh(tmp = r3.loadQuery()) && (ctx.someDir = tmp));
18275
18333
  const temporary = tempAllocator();
@@ -18748,10 +18806,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
18748
18806
  };
18749
18807
  function convertToR3QueryMetadata(facade) {
18750
18808
  return Object.assign(Object.assign({}, facade), { predicate: Array.isArray(facade.predicate) ? facade.predicate :
18751
- new WrappedNodeExpr(facade.predicate), read: facade.read ? new WrappedNodeExpr(facade.read) : null, static: facade.static });
18809
+ new WrappedNodeExpr(facade.predicate), read: facade.read ? new WrappedNodeExpr(facade.read) : null, static: facade.static, emitDistinctChangesOnly: facade.emitDistinctChangesOnly });
18752
18810
  }
18753
18811
  function convertQueryDeclarationToMetadata(declaration) {
18754
- var _a, _b, _c;
18812
+ var _a, _b, _c, _d;
18755
18813
  return {
18756
18814
  propertyName: declaration.propertyName,
18757
18815
  first: (_a = declaration.first) !== null && _a !== void 0 ? _a : false,
@@ -18760,6 +18818,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
18760
18818
  descendants: (_b = declaration.descendants) !== null && _b !== void 0 ? _b : false,
18761
18819
  read: declaration.read ? new WrappedNodeExpr(declaration.read) : null,
18762
18820
  static: (_c = declaration.static) !== null && _c !== void 0 ? _c : false,
18821
+ emitDistinctChangesOnly: (_d = declaration.emitDistinctChangesOnly) !== null && _d !== void 0 ? _d : true,
18763
18822
  };
18764
18823
  }
18765
18824
  function convertDirectiveFacadeToMetadata(facade) {
@@ -18962,7 +19021,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
18962
19021
  * Use of this source code is governed by an MIT-style license that can be
18963
19022
  * found in the LICENSE file at https://angular.io/license
18964
19023
  */
18965
- const VERSION$1 = new Version('11.1.0-next.5');
19024
+ const VERSION$1 = new Version('11.1.2');
18966
19025
 
18967
19026
  /**
18968
19027
  * @license
@@ -20488,6 +20547,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
20488
20547
  selectors,
20489
20548
  first: q.first,
20490
20549
  descendants: q.descendants,
20550
+ emitDistinctChangesOnly: q.emitDistinctChangesOnly,
20491
20551
  propertyName,
20492
20552
  read: q.read ? this._getTokenMetadata(q.read) : null,
20493
20553
  static: q.static
@@ -27002,7 +27062,8 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
27002
27062
  */
27003
27063
  var InjectFlags;
27004
27064
  (function (InjectFlags) {
27005
- // TODO(alxhub): make this 'const' when ngc no longer writes exports of it into ngfactory files.
27065
+ // TODO(alxhub): make this 'const' (and remove `InternalInjectFlags` enum) when ngc no longer
27066
+ // writes exports of it into ngfactory files.
27006
27067
  /** Check self and check parent injector if needed */
27007
27068
  InjectFlags[InjectFlags["Default"] = 0] = "Default";
27008
27069
  /**
@@ -27193,7 +27254,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
27193
27254
  * Use Shadow DOM to encapsulate styles.
27194
27255
  *
27195
27256
  * For the DOM this means using modern [Shadow
27196
- * DOM](https://w3c.github.io/webcomponents/spec/shadow/) and
27257
+ * DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM) and
27197
27258
  * creating a ShadowRoot for Component's Host Element.
27198
27259
  */
27199
27260
  ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
@@ -27584,16 +27645,42 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
27584
27645
  * Use of this source code is governed by an MIT-style license that can be
27585
27646
  * found in the LICENSE file at https://angular.io/license
27586
27647
  */
27648
+ // Base URL for the error details page.
27649
+ // Keep this value in sync with a similar const in
27650
+ // `packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.ts`.
27651
+ const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
27587
27652
  class RuntimeError extends Error {
27588
27653
  constructor(code, message) {
27589
27654
  super(formatRuntimeError(code, message));
27590
27655
  this.code = code;
27591
27656
  }
27592
27657
  }
27658
+ // Contains a set of error messages that have details guides at angular.io.
27659
+ // Full list of available error guides can be found at https://angular.io/errors
27660
+ /* tslint:disable:no-toplevel-property-access */
27661
+ const RUNTIME_ERRORS_WITH_GUIDES = new Set([
27662
+ "100" /* EXPRESSION_CHANGED_AFTER_CHECKED */,
27663
+ "200" /* CYCLIC_DI_DEPENDENCY */,
27664
+ "201" /* PROVIDER_NOT_FOUND */,
27665
+ "300" /* MULTIPLE_COMPONENTS_MATCH */,
27666
+ "301" /* EXPORT_NOT_FOUND */,
27667
+ "302" /* PIPE_NOT_FOUND */,
27668
+ ]);
27669
+ /* tslint:enable:no-toplevel-property-access */
27593
27670
  /** Called to format a runtime error */
27594
27671
  function formatRuntimeError(code, message) {
27595
27672
  const fullCode = code ? `NG0${code}: ` : '';
27596
- return `${fullCode}${message}`;
27673
+ let errorMessage = `${fullCode}${message}`;
27674
+ // Some runtime errors are still thrown without `ngDevMode` (for example
27675
+ // `throwProviderNotFoundError`), so we add `ngDevMode` check here to avoid pulling
27676
+ // `RUNTIME_ERRORS_WITH_GUIDES` symbol into prod bundles.
27677
+ // TODO: revisit all instances where `RuntimeError` is thrown and see if `ngDevMode` can be added
27678
+ // there instead to tree-shake more devmode-only code (and eventually remove `ngDevMode` check
27679
+ // from this code).
27680
+ if (ngDevMode && RUNTIME_ERRORS_WITH_GUIDES.has(code)) {
27681
+ errorMessage = `${errorMessage}. Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/NG0${code}`;
27682
+ }
27683
+ return errorMessage;
27597
27684
  }
27598
27685
 
27599
27686
  /**
@@ -28796,6 +28883,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
28796
28883
  */
28797
28884
  const BLOOM_SIZE = 256;
28798
28885
  const BLOOM_MASK = BLOOM_SIZE - 1;
28886
+ /**
28887
+ * The number of bits that is represented by a single bloom bucket. JS bit operations are 32 bits,
28888
+ * so each bucket represents 32 distinct tokens which accounts for log2(32) = 5 bits of a bloom hash
28889
+ * number.
28890
+ */
28891
+ const BLOOM_BUCKET_BITS = 5;
28799
28892
  /** Counter used to generate unique IDs for directives. */
28800
28893
  let nextNgElementId = 0;
28801
28894
  /**
@@ -28822,25 +28915,15 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
28822
28915
  }
28823
28916
  // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),
28824
28917
  // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.
28825
- const bloomBit = id & BLOOM_MASK;
28918
+ const bloomHash = id & BLOOM_MASK;
28826
28919
  // Create a mask that targets the specific bit associated with the directive.
28827
28920
  // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding
28828
28921
  // to bit positions 0 - 31 in a 32 bit integer.
28829
- const mask = 1 << bloomBit;
28830
- // Use the raw bloomBit number to determine which bloom filter bucket we should check
28831
- // e.g: bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc
28832
- const b7 = bloomBit & 0x80;
28833
- const b6 = bloomBit & 0x40;
28834
- const b5 = bloomBit & 0x20;
28835
- const tData = tView.data;
28836
- if (b7) {
28837
- b6 ? (b5 ? (tData[injectorIndex + 7] |= mask) : (tData[injectorIndex + 6] |= mask)) :
28838
- (b5 ? (tData[injectorIndex + 5] |= mask) : (tData[injectorIndex + 4] |= mask));
28839
- }
28840
- else {
28841
- b6 ? (b5 ? (tData[injectorIndex + 3] |= mask) : (tData[injectorIndex + 2] |= mask)) :
28842
- (b5 ? (tData[injectorIndex + 1] |= mask) : (tData[injectorIndex] |= mask));
28843
- }
28922
+ const mask = 1 << bloomHash;
28923
+ // Each bloom bucket in `tData` represents `BLOOM_BUCKET_BITS` number of bits of `bloomHash`.
28924
+ // Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset that the mask
28925
+ // should be written to.
28926
+ tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;
28844
28927
  }
28845
28928
  /**
28846
28929
  * Creates (or gets an existing) injector for a given element or container.
@@ -29261,21 +29344,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
29261
29344
  // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding
29262
29345
  // to bit positions 0 - 31 in a 32 bit integer.
29263
29346
  const mask = 1 << bloomHash;
29264
- const b7 = bloomHash & 0x80;
29265
- const b6 = bloomHash & 0x40;
29266
- const b5 = bloomHash & 0x20;
29267
- // Our bloom filter size is 256 bits, which is eight 32-bit bloom filter buckets:
29268
- // bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc.
29269
- // Get the bloom filter value from the appropriate bucket based on the directive's bloomBit.
29270
- let value;
29271
- if (b7) {
29272
- value = b6 ? (b5 ? injectorView[injectorIndex + 7] : injectorView[injectorIndex + 6]) :
29273
- (b5 ? injectorView[injectorIndex + 5] : injectorView[injectorIndex + 4]);
29274
- }
29275
- else {
29276
- value = b6 ? (b5 ? injectorView[injectorIndex + 3] : injectorView[injectorIndex + 2]) :
29277
- (b5 ? injectorView[injectorIndex + 1] : injectorView[injectorIndex]);
29278
- }
29347
+ // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of
29348
+ // `bloomHash`. Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset
29349
+ // that should be used.
29350
+ const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];
29279
29351
  // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,
29280
29352
  // this injector is a potential match.
29281
29353
  return !!(value & mask);
@@ -29551,6 +29623,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
29551
29623
  * @deprecated Since 9.0.0. With Ivy, this property is no longer necessary.
29552
29624
  */
29553
29625
  const ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken('AnalyzeForEntryComponents');
29626
+ // Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not
29627
+ // explicitly set. This value will be changed to `true` in v12.
29628
+ // TODO(misko): switch the default in v12 to `true`. See: packages/compiler/src/core.ts
29629
+ const emitDistinctChangesOnlyDefaultValue$1 = false;
29554
29630
  /**
29555
29631
  * Base class for query metadata.
29556
29632
  *
@@ -29563,7 +29639,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
29563
29639
  */
29564
29640
  class Query {
29565
29641
  }
29566
- const ɵ0$1 = (selector, data = {}) => (Object.assign({ selector, first: false, isViewQuery: false, descendants: false }, data));
29642
+ const ɵ0$1 = (selector, data = {}) => (Object.assign({ selector, first: false, isViewQuery: false, descendants: false, emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue$1 }, data));
29567
29643
  /**
29568
29644
  * ContentChildren decorator and metadata.
29569
29645
  *
@@ -29582,7 +29658,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
29582
29658
  * @publicApi
29583
29659
  */
29584
29660
  const ContentChild = makePropDecorator('ContentChild', ɵ1, Query);
29585
- const ɵ2 = (selector, data = {}) => (Object.assign({ selector, first: false, isViewQuery: true, descendants: true }, data));
29661
+ const ɵ2 = (selector, data = {}) => (Object.assign({ selector, first: false, isViewQuery: true, descendants: true, emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue$1 }, data));
29586
29662
  /**
29587
29663
  * ViewChildren decorator and metadata.
29588
29664
  *
@@ -29961,50 +30037,6 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
29961
30037
  return parentCtor || Object;
29962
30038
  }
29963
30039
 
29964
- /**
29965
- * @license
29966
- * Copyright Google LLC All Rights Reserved.
29967
- *
29968
- * Use of this source code is governed by an MIT-style license that can be
29969
- * found in the LICENSE file at https://angular.io/license
29970
- */
29971
- const ɵ0$2 = (token) => ({ token });
29972
- /**
29973
- * Inject decorator and metadata.
29974
- *
29975
- * @Annotation
29976
- * @publicApi
29977
- */
29978
- const Inject = makeParamDecorator('Inject', ɵ0$2);
29979
- /**
29980
- * Optional decorator and metadata.
29981
- *
29982
- * @Annotation
29983
- * @publicApi
29984
- */
29985
- const Optional = makeParamDecorator('Optional');
29986
- /**
29987
- * Self decorator and metadata.
29988
- *
29989
- * @Annotation
29990
- * @publicApi
29991
- */
29992
- const Self = makeParamDecorator('Self');
29993
- /**
29994
- * `SkipSelf` decorator and metadata.
29995
- *
29996
- * @Annotation
29997
- * @publicApi
29998
- */
29999
- const SkipSelf = makeParamDecorator('SkipSelf');
30000
- /**
30001
- * Host decorator and metadata.
30002
- *
30003
- * @Annotation
30004
- * @publicApi
30005
- */
30006
- const Host = makeParamDecorator('Host');
30007
-
30008
30040
  /**
30009
30041
  * @license
30010
30042
  * Copyright Google LLC All Rights Reserved.
@@ -30014,13 +30046,19 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30014
30046
  */
30015
30047
  const _THROW_IF_NOT_FOUND = {};
30016
30048
  const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
30049
+ /*
30050
+ * Name of a property (that we patch onto DI decorator), which is used as an annotation of which
30051
+ * InjectFlag this decorator represents. This allows to avoid direct references to the DI decorators
30052
+ * in the code, thus making them tree-shakable.
30053
+ */
30054
+ const DI_DECORATOR_FLAG = '__NG_DI_FLAG__';
30017
30055
  const NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';
30018
30056
  const NG_TOKEN_PATH = 'ngTokenPath';
30019
30057
  const NEW_LINE = /\n/gm;
30020
30058
  const NO_NEW_LINE = 'ɵ';
30021
30059
  const SOURCE = '__source';
30022
- const ɵ0$3 = getClosureSafeProperty;
30023
- const USE_VALUE$2 = getClosureSafeProperty({ provide: String, useValue: ɵ0$3 });
30060
+ const ɵ0$2 = getClosureSafeProperty;
30061
+ const USE_VALUE$2 = getClosureSafeProperty({ provide: String, useValue: ɵ0$2 });
30024
30062
  /**
30025
30063
  * Current injector value used by `inject`.
30026
30064
  * - `undefined`: it is an error to call `inject`
@@ -30059,20 +30097,15 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30059
30097
  let flags = InjectFlags.Default;
30060
30098
  for (let j = 0; j < arg.length; j++) {
30061
30099
  const meta = arg[j];
30062
- if (meta instanceof Optional || meta.ngMetadataName === 'Optional' || meta === Optional) {
30063
- flags |= InjectFlags.Optional;
30064
- }
30065
- else if (meta instanceof SkipSelf || meta.ngMetadataName === 'SkipSelf' || meta === SkipSelf) {
30066
- flags |= InjectFlags.SkipSelf;
30067
- }
30068
- else if (meta instanceof Self || meta.ngMetadataName === 'Self' || meta === Self) {
30069
- flags |= InjectFlags.Self;
30070
- }
30071
- else if (meta instanceof Host || meta.ngMetadataName === 'Host' || meta === Host) {
30072
- flags |= InjectFlags.Host;
30073
- }
30074
- else if (meta instanceof Inject || meta === Inject) {
30075
- type = meta.token;
30100
+ const flag = getInjectFlag(meta);
30101
+ if (typeof flag === 'number') {
30102
+ // Special case when we handle @Inject decorator.
30103
+ if (flag === -1 /* Inject */) {
30104
+ type = meta.token;
30105
+ }
30106
+ else {
30107
+ flags |= flag;
30108
+ }
30076
30109
  }
30077
30110
  else {
30078
30111
  type = meta;
@@ -30086,6 +30119,29 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30086
30119
  }
30087
30120
  return args;
30088
30121
  }
30122
+ /**
30123
+ * Attaches a given InjectFlag to a given decorator using monkey-patching.
30124
+ * Since DI decorators can be used in providers `deps` array (when provider is configured using
30125
+ * `useFactory`) without initialization (e.g. `Host`) and as an instance (e.g. `new Host()`), we
30126
+ * attach the flag to make it available both as a static property and as a field on decorator
30127
+ * instance.
30128
+ *
30129
+ * @param decorator Provided DI decorator.
30130
+ * @param flag InjectFlag that should be applied.
30131
+ */
30132
+ function attachInjectFlag(decorator, flag) {
30133
+ decorator[DI_DECORATOR_FLAG] = flag;
30134
+ decorator.prototype[DI_DECORATOR_FLAG] = flag;
30135
+ return decorator;
30136
+ }
30137
+ /**
30138
+ * Reads monkey-patched property that contains InjectFlag attached to a decorator.
30139
+ *
30140
+ * @param token Token that may contain monkey-patched DI flags property.
30141
+ */
30142
+ function getInjectFlag(token) {
30143
+ return token[DI_DECORATOR_FLAG];
30144
+ }
30089
30145
  function catchInjectorError(e, token, injectorErrorName, source) {
30090
30146
  const tokenPath = e[NG_TEMP_TOKEN_PATH];
30091
30147
  if (token[SOURCE]) {
@@ -30115,6 +30171,65 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30115
30171
  return `${injectorErrorName}${source ? '(' + source + ')' : ''}[${context}]: ${text.replace(NEW_LINE, '\n ')}`;
30116
30172
  }
30117
30173
 
30174
+ /**
30175
+ * @license
30176
+ * Copyright Google LLC All Rights Reserved.
30177
+ *
30178
+ * Use of this source code is governed by an MIT-style license that can be
30179
+ * found in the LICENSE file at https://angular.io/license
30180
+ */
30181
+ const ɵ0$3 = (token) => ({ token });
30182
+ /**
30183
+ * Inject decorator and metadata.
30184
+ *
30185
+ * @Annotation
30186
+ * @publicApi
30187
+ */
30188
+ const Inject = attachInjectFlag(
30189
+ // Disable tslint because `DecoratorFlags` is a const enum which gets inlined.
30190
+ // tslint:disable-next-line: no-toplevel-property-access
30191
+ makeParamDecorator('Inject', ɵ0$3), -1 /* Inject */);
30192
+ /**
30193
+ * Optional decorator and metadata.
30194
+ *
30195
+ * @Annotation
30196
+ * @publicApi
30197
+ */
30198
+ const Optional =
30199
+ // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
30200
+ // tslint:disable-next-line: no-toplevel-property-access
30201
+ attachInjectFlag(makeParamDecorator('Optional'), 8 /* Optional */);
30202
+ /**
30203
+ * Self decorator and metadata.
30204
+ *
30205
+ * @Annotation
30206
+ * @publicApi
30207
+ */
30208
+ const Self =
30209
+ // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
30210
+ // tslint:disable-next-line: no-toplevel-property-access
30211
+ attachInjectFlag(makeParamDecorator('Self'), 2 /* Self */);
30212
+ /**
30213
+ * `SkipSelf` decorator and metadata.
30214
+ *
30215
+ * @Annotation
30216
+ * @publicApi
30217
+ */
30218
+ const SkipSelf =
30219
+ // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
30220
+ // tslint:disable-next-line: no-toplevel-property-access
30221
+ attachInjectFlag(makeParamDecorator('SkipSelf'), 4 /* SkipSelf */);
30222
+ /**
30223
+ * Host decorator and metadata.
30224
+ *
30225
+ * @Annotation
30226
+ * @publicApi
30227
+ */
30228
+ const Host =
30229
+ // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
30230
+ // tslint:disable-next-line: no-toplevel-property-access
30231
+ attachInjectFlag(makeParamDecorator('Host'), 1 /* Host */);
30232
+
30118
30233
  /**
30119
30234
  * @license
30120
30235
  * Copyright Google LLC All Rights Reserved.
@@ -31534,8 +31649,18 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
31534
31649
  debugNodeInjectorPath(lView) {
31535
31650
  const path = [];
31536
31651
  let injectorIndex = getInjectorIndex(this, lView);
31537
- ngDevMode && assertNodeInjector(lView, injectorIndex);
31652
+ if (injectorIndex === -1) {
31653
+ // Looks like the current `TNode` does not have `NodeInjector` associated with it => look for
31654
+ // parent NodeInjector.
31655
+ const parentLocation = getParentInjectorLocation(this, lView);
31656
+ if (parentLocation !== NO_PARENT_INJECTOR) {
31657
+ // We found a parent, so start searching from the parent location.
31658
+ injectorIndex = getParentInjectorIndex(parentLocation);
31659
+ lView = getParentInjectorView(parentLocation, lView);
31660
+ }
31661
+ }
31538
31662
  while (injectorIndex !== -1) {
31663
+ ngDevMode && assertNodeInjector(lView, injectorIndex);
31539
31664
  const tNode = lView[TVIEW].data[injectorIndex + 8 /* TNODE */];
31540
31665
  path.push(buildDebugNode(tNode, lView));
31541
31666
  const parentLocation = lView[injectorIndex + 8 /* PARENT */];
@@ -31866,11 +31991,15 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
31866
31991
  return {
31867
31992
  html: toHtml(native),
31868
31993
  type: toTNodeTypeAsString(tNode.type),
31994
+ tNode,
31869
31995
  native: native,
31870
31996
  children: toDebugNodes(tNode.child, lView),
31871
31997
  factories,
31872
31998
  instances,
31873
- injector: buildNodeInjectorDebug(tNode, tView, lView)
31999
+ injector: buildNodeInjectorDebug(tNode, tView, lView),
32000
+ get injectorResolutionPath() {
32001
+ return tNode.debugNodeInjectorPath(lView);
32002
+ },
31874
32003
  };
31875
32004
  }
31876
32005
  function buildNodeInjectorDebug(tNode, tView, lView) {
@@ -31914,6 +32043,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
31914
32043
  * @param idx
31915
32044
  */
31916
32045
  function toBloom(array, idx) {
32046
+ if (idx < 0) {
32047
+ return 'NO_NODE_INJECTOR';
32048
+ }
31917
32049
  return `${binary(array, idx + 7)}_${binary(array, idx + 6)}_${binary(array, idx + 5)}_${binary(array, idx + 4)}_${binary(array, idx + 3)}_${binary(array, idx + 2)}_${binary(array, idx + 1)}_${binary(array, idx + 0)}`;
31918
32050
  }
31919
32051
 
@@ -33417,7 +33549,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
33417
33549
  ngDevMode && assertIndexInRange(rootView, index);
33418
33550
  rootView[index] = rNode;
33419
33551
  // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
33420
- // the same time we want to communicate the the debug `TNode` that this is a special `TNode`
33552
+ // the same time we want to communicate the debug `TNode` that this is a special `TNode`
33421
33553
  // representing a host element.
33422
33554
  const tNode = getOrCreateTNode(tView, index, 2 /* Element */, '#host', null);
33423
33555
  const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
@@ -34897,7 +35029,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
34897
35029
  /**
34898
35030
  * @publicApi
34899
35031
  */
34900
- const VERSION$2 = new Version$1('11.1.0-next.5');
35032
+ const VERSION$2 = new Version$1('11.1.2');
34901
35033
 
34902
35034
  /**
34903
35035
  * @license
@@ -38169,36 +38301,36 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
38169
38301
  emit(value) {
38170
38302
  super.next(value);
38171
38303
  }
38172
- subscribe(generatorOrNext, error, complete) {
38304
+ subscribe(observerOrNext, error, complete) {
38173
38305
  let schedulerFn;
38174
38306
  let errorFn = (err) => null;
38175
38307
  let completeFn = () => null;
38176
- if (generatorOrNext && typeof generatorOrNext === 'object') {
38308
+ if (observerOrNext && typeof observerOrNext === 'object') {
38177
38309
  schedulerFn = this.__isAsync ? (value) => {
38178
- setTimeout(() => generatorOrNext.next(value));
38310
+ setTimeout(() => observerOrNext.next(value));
38179
38311
  } : (value) => {
38180
- generatorOrNext.next(value);
38312
+ observerOrNext.next(value);
38181
38313
  };
38182
- if (generatorOrNext.error) {
38314
+ if (observerOrNext.error) {
38183
38315
  errorFn = this.__isAsync ? (err) => {
38184
- setTimeout(() => generatorOrNext.error(err));
38316
+ setTimeout(() => observerOrNext.error(err));
38185
38317
  } : (err) => {
38186
- generatorOrNext.error(err);
38318
+ observerOrNext.error(err);
38187
38319
  };
38188
38320
  }
38189
- if (generatorOrNext.complete) {
38321
+ if (observerOrNext.complete) {
38190
38322
  completeFn = this.__isAsync ? () => {
38191
- setTimeout(() => generatorOrNext.complete());
38323
+ setTimeout(() => observerOrNext.complete());
38192
38324
  } : () => {
38193
- generatorOrNext.complete();
38325
+ observerOrNext.complete();
38194
38326
  };
38195
38327
  }
38196
38328
  }
38197
38329
  else {
38198
38330
  schedulerFn = this.__isAsync ? (value) => {
38199
- setTimeout(() => generatorOrNext(value));
38331
+ setTimeout(() => observerOrNext(value));
38200
38332
  } : (value) => {
38201
- generatorOrNext(value);
38333
+ observerOrNext(value);
38202
38334
  };
38203
38335
  if (error) {
38204
38336
  errorFn = this.__isAsync ? (err) => {
@@ -38216,8 +38348,8 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
38216
38348
  }
38217
38349
  }
38218
38350
  const sink = super.subscribe(schedulerFn, errorFn, completeFn);
38219
- if (generatorOrNext instanceof Subscription) {
38220
- generatorOrNext.add(sink);
38351
+ if (observerOrNext instanceof Subscription) {
38352
+ observerOrNext.add(sink);
38221
38353
  }
38222
38354
  return sink;
38223
38355
  }
@@ -42017,14 +42149,6 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
42017
42149
  * Use of this source code is governed by an MIT-style license that can be
42018
42150
  * found in the LICENSE file at https://angular.io/license
42019
42151
  */
42020
- /**
42021
- * Create a `LanguageServiceHost`
42022
- */
42023
- function createLanguageServiceFromTypescript(host, service) {
42024
- const ngHost = new TypeScriptServiceHost(host, service);
42025
- const ngServer = createLanguageService(ngHost);
42026
- return ngServer;
42027
- }
42028
42152
  /**
42029
42153
  * The language service never needs the normalized versions of the metadata. To avoid parsing
42030
42154
  * the content and resolving references, return an empty file. This also allows normalizing
@@ -42057,6 +42181,11 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
42057
42181
  this.tsLsHost = tsLsHost;
42058
42182
  this.tsLS = tsLS;
42059
42183
  this.staticSymbolCache = new StaticSymbolCache();
42184
+ /**
42185
+ * Key of the `fileToComponent` map must be TS internal normalized path (path
42186
+ * separator must be `/`), value of the map is the StaticSymbol for the
42187
+ * Component class declaration.
42188
+ */
42060
42189
  this.fileToComponent = new Map();
42061
42190
  this.collectedErrors = new Map();
42062
42191
  this.fileVersions = new Map();
@@ -42173,7 +42302,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
42173
42302
  const { metadata } = this.resolver.getNonNormalizedDirectiveMetadata(directive.reference);
42174
42303
  if (metadata.isComponent && metadata.template && metadata.template.templateUrl) {
42175
42304
  const templateName = this.urlResolver.resolve(this.reflector.componentModuleUrl(directive.reference), metadata.template.templateUrl);
42176
- this.fileToComponent.set(templateName, directive.reference);
42305
+ this.fileToComponent.set(tss.server.toNormalizedPath(templateName), directive.reference);
42177
42306
  }
42178
42307
  }
42179
42308
  }
@@ -42370,7 +42499,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
42370
42499
  }
42371
42500
  const source = snapshot.getText(0, snapshot.getLength());
42372
42501
  // Next find the component class symbol
42373
- const classSymbol = this.fileToComponent.get(fileName);
42502
+ const classSymbol = this.fileToComponent.get(tss.server.toNormalizedPath(fileName));
42374
42503
  if (!classSymbol) {
42375
42504
  return;
42376
42505
  }
@@ -42700,6 +42829,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
42700
42829
  // not implemented in VE Language Service
42701
42830
  return undefined;
42702
42831
  }
42832
+ function getTcb(fileName, position) {
42833
+ // Not implemented in VE Language Service
42834
+ return undefined;
42835
+ }
42703
42836
  return Object.assign(Object.assign({}, tsLS), {
42704
42837
  // Then override the methods supported by Angular language service
42705
42838
  getCompletionsAtPosition,
@@ -42709,13 +42842,11 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
42709
42842
  getDefinitionAndBoundSpan,
42710
42843
  getTypeDefinitionAtPosition,
42711
42844
  getReferencesAtPosition,
42712
- findRenameLocations });
42845
+ findRenameLocations,
42846
+ getTcb });
42713
42847
  }
42714
42848
 
42715
- exports.TypeScriptServiceHost = TypeScriptServiceHost;
42716
42849
  exports.create = create;
42717
- exports.createLanguageService = createLanguageService;
42718
- exports.createLanguageServiceFromTypescript = createLanguageServiceFromTypescript;
42719
42850
  exports.getExternalFiles = getExternalFiles;
42720
42851
 
42721
42852
  Object.defineProperty(exports, '__esModule', { value: true });