@angular/language-service 10.1.6 → 10.2.3

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 v10.1.6
2
+ * @license Angular v10.2.3
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  * License: MIT
5
5
  */
@@ -6061,9 +6061,33 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
6061
6061
  }
6062
6062
  }
6063
6063
  class ParseSourceSpan {
6064
- constructor(start, end, details = null) {
6064
+ /**
6065
+ * Create an object that holds information about spans of tokens/nodes captured during
6066
+ * lexing/parsing of text.
6067
+ *
6068
+ * @param start
6069
+ * The location of the start of the span (having skipped leading trivia).
6070
+ * Skipping leading trivia makes source-spans more "user friendly", since things like HTML
6071
+ * elements will appear to begin at the start of the opening tag, rather than at the start of any
6072
+ * leading trivia, which could include newlines.
6073
+ *
6074
+ * @param end
6075
+ * The location of the end of the span.
6076
+ *
6077
+ * @param fullStart
6078
+ * The start of the token without skipping the leading trivia.
6079
+ * This is used by tooling that splits tokens further, such as extracting Angular interpolations
6080
+ * from text tokens. Such tooling creates new source-spans relative to the original token's
6081
+ * source-span. If leading trivia characters have been skipped then the new source-spans may be
6082
+ * incorrectly offset.
6083
+ *
6084
+ * @param details
6085
+ * Additional information (such as identifier names) that should be associated with the span.
6086
+ */
6087
+ constructor(start, end, fullStart = start, details = null) {
6065
6088
  this.start = start;
6066
6089
  this.end = end;
6090
+ this.fullStart = fullStart;
6067
6091
  this.details = details;
6068
6092
  }
6069
6093
  toString() {
@@ -10225,7 +10249,8 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
10225
10249
  if (this.baseSourceSpan) {
10226
10250
  const start = this.baseSourceSpan.start.moveBy(span.start);
10227
10251
  const end = this.baseSourceSpan.start.moveBy(span.end);
10228
- return new ParseSourceSpan(start, end);
10252
+ const fullStart = this.baseSourceSpan.fullStart.moveBy(span.start);
10253
+ return new ParseSourceSpan(start, end, fullStart);
10229
10254
  }
10230
10255
  else {
10231
10256
  return null;
@@ -11691,17 +11716,19 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
11691
11716
  }
11692
11717
  getSpan(start, leadingTriviaCodePoints) {
11693
11718
  start = start || this;
11694
- let cloned = false;
11719
+ let fullStart = start;
11695
11720
  if (leadingTriviaCodePoints) {
11696
11721
  while (this.diff(start) > 0 && leadingTriviaCodePoints.indexOf(start.peek()) !== -1) {
11697
- if (!cloned) {
11722
+ if (fullStart === start) {
11698
11723
  start = start.clone();
11699
- cloned = true;
11700
11724
  }
11701
11725
  start.advance();
11702
11726
  }
11703
11727
  }
11704
- return new ParseSourceSpan(new ParseLocation(start.file, start.state.offset, start.state.line, start.state.column), new ParseLocation(this.file, this.state.offset, this.state.line, this.state.column));
11728
+ const startLocation = this.locationFromCursor(start);
11729
+ const endLocation = this.locationFromCursor(this);
11730
+ const fullStartLocation = fullStart !== start ? this.locationFromCursor(fullStart) : startLocation;
11731
+ return new ParseSourceSpan(startLocation, endLocation, fullStartLocation);
11705
11732
  }
11706
11733
  getChars(start) {
11707
11734
  return this.input.substring(start.state.offset, this.state.offset);
@@ -11728,6 +11755,9 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
11728
11755
  updatePeek(state) {
11729
11756
  state.peek = state.offset >= this.end ? $EOF : this.charAt(state.offset);
11730
11757
  }
11758
+ locationFromCursor(cursor) {
11759
+ return new ParseLocation(cursor.file, cursor.state.offset, cursor.state.line, cursor.state.column);
11760
+ }
11731
11761
  }
11732
11762
  class EscapedCharacterCursor extends PlainCharacterCursor {
11733
11763
  constructor(fileOrCursor, range) {
@@ -11985,7 +12015,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
11985
12015
  this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`));
11986
12016
  return;
11987
12017
  }
11988
- const sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end);
12018
+ const sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end, token.sourceSpan.fullStart);
11989
12019
  this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));
11990
12020
  this._advance();
11991
12021
  }
@@ -12010,8 +12040,8 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
12010
12040
  this.errors = this.errors.concat(expansionCaseParser.errors);
12011
12041
  return null;
12012
12042
  }
12013
- const sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end);
12014
- const expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end);
12043
+ const sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end, value.sourceSpan.fullStart);
12044
+ const expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end, start.sourceSpan.fullStart);
12015
12045
  return new ExpansionCase(value.parts[0], expansionCaseParser.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan);
12016
12046
  }
12017
12047
  _collectExpansionExpTokens(start) {
@@ -12092,8 +12122,10 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
12092
12122
  selfClosing = false;
12093
12123
  }
12094
12124
  const end = this._peek.sourceSpan.start;
12095
- const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end);
12096
- const el = new Element$1(fullName, attrs, [], span, span, undefined);
12125
+ const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
12126
+ // Create a separate `startSpan` because `span` may be modified when there is an `end` span.
12127
+ const startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
12128
+ const el = new Element$1(fullName, attrs, [], span, startSpan, undefined);
12097
12129
  this._pushElement(el);
12098
12130
  if (selfClosing) {
12099
12131
  // Elements that are self-closed have their `endSourceSpan` set to the full span, as the
@@ -12154,7 +12186,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
12154
12186
  const quoteToken = this._advance();
12155
12187
  end = quoteToken.sourceSpan.end;
12156
12188
  }
12157
- return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end), valueSpan);
12189
+ return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end, attrName.sourceSpan.fullStart), valueSpan);
12158
12190
  }
12159
12191
  _getParentElement() {
12160
12192
  return this._elementStack.length > 0 ? this._elementStack[this._elementStack.length - 1] : null;
@@ -12735,7 +12767,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
12735
12767
  // The difference of two absolute offsets provide the relative offset
12736
12768
  const startDiff = absoluteSpan.start - sourceSpan.start.offset;
12737
12769
  const endDiff = absoluteSpan.end - sourceSpan.end.offset;
12738
- return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff));
12770
+ return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
12739
12771
  }
12740
12772
 
12741
12773
  /**
@@ -14229,10 +14261,13 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
14229
14261
  return;
14230
14262
  this.error(`Missing expected operator ${operator}`);
14231
14263
  }
14264
+ prettyPrintToken(tok) {
14265
+ return tok === EOF ? 'end of input' : `token ${tok}`;
14266
+ }
14232
14267
  expectIdentifierOrKeyword() {
14233
14268
  const n = this.next;
14234
14269
  if (!n.isIdentifier() && !n.isKeyword()) {
14235
- this.error(`Unexpected token ${n}, expected identifier or keyword`);
14270
+ this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier or keyword`);
14236
14271
  return '';
14237
14272
  }
14238
14273
  this.advance();
@@ -14241,7 +14276,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
14241
14276
  expectIdentifierOrKeywordOrString() {
14242
14277
  const n = this.next;
14243
14278
  if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) {
14244
- this.error(`Unexpected token ${n}, expected identifier, keyword, or string`);
14279
+ this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier, keyword, or string`);
14245
14280
  return '';
14246
14281
  }
14247
14282
  this.advance();
@@ -16241,7 +16276,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
16241
16276
  }
16242
16277
  }
16243
16278
  function getOffsetSourceSpan(sourceSpan, { start, end }) {
16244
- return new ParseSourceSpan(sourceSpan.start.moveBy(start), sourceSpan.start.moveBy(end));
16279
+ return new ParseSourceSpan(sourceSpan.fullStart.moveBy(start), sourceSpan.fullStart.moveBy(end));
16245
16280
  }
16246
16281
  const _CUSTOM_PH_EXP = /\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*("|')([\s\S]*?)\1[\s\S]*\)/g;
16247
16282
  function _extractPlaceholderName(input) {
@@ -16577,7 +16612,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
16577
16612
  function getSourceSpan(message) {
16578
16613
  const startNode = message.nodes[0];
16579
16614
  const endNode = message.nodes[message.nodes.length - 1];
16580
- return new ParseSourceSpan(startNode.sourceSpan.start, endNode.sourceSpan.end, startNode.sourceSpan.details);
16615
+ return new ParseSourceSpan(startNode.sourceSpan.start, endNode.sourceSpan.end, startNode.sourceSpan.fullStart, startNode.sourceSpan.details);
16581
16616
  }
16582
16617
  /**
16583
16618
  * Convert the list of serialized MessagePieces into two arrays.
@@ -16604,7 +16639,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
16604
16639
  placeHolders.push(part);
16605
16640
  if (pieces[i - 1] instanceof PlaceholderPiece) {
16606
16641
  // There were two placeholders in a row, so we need to add an empty message part.
16607
- messageParts.push(createEmptyMessagePart(part.sourceSpan.end));
16642
+ messageParts.push(createEmptyMessagePart(pieces[i - 1].sourceSpan.end));
16608
16643
  }
16609
16644
  }
16610
16645
  }
@@ -19163,7 +19198,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
19163
19198
  * Use of this source code is governed by an MIT-style license that can be
19164
19199
  * found in the LICENSE file at https://angular.io/license
19165
19200
  */
19166
- const VERSION$1 = new Version('10.1.6');
19201
+ const VERSION$1 = new Version('10.2.3');
19167
19202
 
19168
19203
  /**
19169
19204
  * @license
@@ -19756,7 +19791,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
19756
19791
  * Use of this source code is governed by an MIT-style license that can be
19757
19792
  * found in the LICENSE file at https://angular.io/license
19758
19793
  */
19759
- const VERSION$2 = new Version('10.1.6');
19794
+ const VERSION$2 = new Version('10.2.3');
19760
19795
 
19761
19796
  /**
19762
19797
  * @license
@@ -20175,12 +20210,20 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
20175
20210
  */
20176
20211
  class LocalIdentifierStrategy {
20177
20212
  emit(ref, context, importFlags) {
20213
+ const refSf = getSourceFile(ref.node);
20178
20214
  // If the emitter has specified ForceNewImport, then LocalIdentifierStrategy should not use a
20179
20215
  // local identifier at all, *except* in the source file where the node is actually declared.
20180
- if (importFlags & ImportFlags.ForceNewImport &&
20181
- getSourceFile(ref.node) !== getSourceFile(context)) {
20216
+ if (importFlags & ImportFlags.ForceNewImport && refSf !== context) {
20182
20217
  return null;
20183
20218
  }
20219
+ // If referenced node is not an actual TS declaration (e.g. `class Foo` or `function foo() {}`,
20220
+ // etc) and it is in the current file then just use it directly.
20221
+ // This is important because the reference could be a property access (e.g. `exports.foo`). In
20222
+ // such a case, the reference's `identities` property would be `[foo]`, which would result in an
20223
+ // invalid emission of a free-standing `foo` identifier, rather than `exports.foo`.
20224
+ if (!isDeclaration(ref.node) && refSf === context) {
20225
+ return new WrappedNodeExpr(ref.node);
20226
+ }
20184
20227
  // A Reference can have multiple identities in different files, so it may already have an
20185
20228
  // Identifier in the requested context file.
20186
20229
  const identifier = ref.getIdentityIn(context);
@@ -23061,10 +23104,12 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
23061
23104
  });
23062
23105
  }
23063
23106
  visitAmbiguousDeclaration(decl, declContext) {
23064
- return decl.kind === 1 /* Inline */ && decl.implementation !== undefined ?
23065
- // Inline declarations with an `implementation` should be visited as expressions
23107
+ return decl.kind === 1 /* Inline */ && decl.implementation !== undefined &&
23108
+ !isDeclaration(decl.implementation) ?
23109
+ // Inline declarations whose `implementation` is a `ts.Expression` should be visited as
23110
+ // an expression.
23066
23111
  this.visitExpression(decl.implementation, declContext) :
23067
- // Otherwise just visit the declaration `node`
23112
+ // Otherwise just visit the `node` as a declaration.
23068
23113
  this.visitDeclaration(decl.node, declContext);
23069
23114
  }
23070
23115
  accessHelper(node, lhs, rhs, context) {
@@ -32076,6 +32121,11 @@ Either add the @Injectable() decorator to '${provider.node.name
32076
32121
  constructor(resolver) {
32077
32122
  this.resolver = resolver;
32078
32123
  this._diagnostics = [];
32124
+ /**
32125
+ * Tracks which `BindingPipe` nodes have already been recorded as invalid, so only one diagnostic
32126
+ * is ever produced per node.
32127
+ */
32128
+ this.recordedPipes = new Set();
32079
32129
  }
32080
32130
  get diagnostics() {
32081
32131
  return this._diagnostics;
@@ -32087,6 +32137,9 @@ Either add the @Injectable() decorator to '${provider.node.name
32087
32137
  this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan, ts.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REFERENCE_TARGET), errorMsg));
32088
32138
  }
32089
32139
  missingPipe(templateId, ast) {
32140
+ if (this.recordedPipes.has(ast)) {
32141
+ return;
32142
+ }
32090
32143
  const mapping = this.resolver.getSourceMapping(templateId);
32091
32144
  const errorMsg = `No pipe found with name '${ast.name}'.`;
32092
32145
  const sourceSpan = this.resolver.toParseSourceSpan(templateId, ast.nameSpan);
@@ -32094,6 +32147,7 @@ Either add the @Injectable() decorator to '${provider.node.name
32094
32147
  throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
32095
32148
  }
32096
32149
  this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_PIPE), errorMsg));
32150
+ this.recordedPipes.add(ast);
32097
32151
  }
32098
32152
  illegalAssignmentToTemplateVar(templateId, assignment, target) {
32099
32153
  const mapping = this.resolver.getSourceMapping(templateId);
@@ -33505,7 +33559,7 @@ Either add the @Injectable() decorator to '${provider.node.name
33505
33559
  if (!this.pipes.has(name)) {
33506
33560
  return null;
33507
33561
  }
33508
- return this.env.pipeInst(this.pipes.get(name));
33562
+ return this.pipes.get(name);
33509
33563
  }
33510
33564
  }
33511
33565
  /**
@@ -33961,18 +34015,21 @@ Either add the @Injectable() decorator to '${provider.node.name
33961
34015
  }
33962
34016
  else if (ast instanceof BindingPipe) {
33963
34017
  const expr = this.translate(ast.exp);
34018
+ const pipeRef = this.tcb.getPipeByName(ast.name);
33964
34019
  let pipe;
33965
- if (this.tcb.env.config.checkTypeOfPipes) {
33966
- pipe = this.tcb.getPipeByName(ast.name);
33967
- if (pipe === null) {
33968
- // No pipe by that name exists in scope. Record this as an error.
33969
- this.tcb.oobRecorder.missingPipe(this.tcb.id, ast);
33970
- // Return an 'any' value to at least allow the rest of the expression to be checked.
33971
- pipe = NULL_AS_ANY;
33972
- }
34020
+ if (pipeRef === null) {
34021
+ // No pipe by that name exists in scope. Record this as an error.
34022
+ this.tcb.oobRecorder.missingPipe(this.tcb.id, ast);
34023
+ // Use an 'any' value to at least allow the rest of the expression to be checked.
34024
+ pipe = NULL_AS_ANY;
34025
+ }
34026
+ else if (this.tcb.env.config.checkTypeOfPipes) {
34027
+ // Use a variable declared as the pipe's type.
34028
+ pipe = this.tcb.env.pipeInst(pipeRef);
33973
34029
  }
33974
34030
  else {
33975
- pipe = ts.createParen(ts.createAsExpression(ts.createNull(), ts.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)));
34031
+ // Use an 'any' value when not checking the type of the pipe.
34032
+ pipe = NULL_AS_ANY;
33976
34033
  }
33977
34034
  const args = ast.args.map(arg => this.translate(arg));
33978
34035
  const result = tsCallMethod(pipe, 'transform', [expr, ...args]);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v10.1.6
2
+ * @license Angular v10.2.3
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  * License: MIT
5
5
  */
@@ -3294,9 +3294,33 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
3294
3294
  }
3295
3295
  }
3296
3296
  class ParseSourceSpan {
3297
- constructor(start, end, details = null) {
3297
+ /**
3298
+ * Create an object that holds information about spans of tokens/nodes captured during
3299
+ * lexing/parsing of text.
3300
+ *
3301
+ * @param start
3302
+ * The location of the start of the span (having skipped leading trivia).
3303
+ * Skipping leading trivia makes source-spans more "user friendly", since things like HTML
3304
+ * elements will appear to begin at the start of the opening tag, rather than at the start of any
3305
+ * leading trivia, which could include newlines.
3306
+ *
3307
+ * @param end
3308
+ * The location of the end of the span.
3309
+ *
3310
+ * @param fullStart
3311
+ * The start of the token without skipping the leading trivia.
3312
+ * This is used by tooling that splits tokens further, such as extracting Angular interpolations
3313
+ * from text tokens. Such tooling creates new source-spans relative to the original token's
3314
+ * source-span. If leading trivia characters have been skipped then the new source-spans may be
3315
+ * incorrectly offset.
3316
+ *
3317
+ * @param details
3318
+ * Additional information (such as identifier names) that should be associated with the span.
3319
+ */
3320
+ constructor(start, end, fullStart = start, details = null) {
3298
3321
  this.start = start;
3299
3322
  this.end = end;
3323
+ this.fullStart = fullStart;
3300
3324
  this.details = details;
3301
3325
  }
3302
3326
  toString() {
@@ -7449,7 +7473,8 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
7449
7473
  if (this.baseSourceSpan) {
7450
7474
  const start = this.baseSourceSpan.start.moveBy(span.start);
7451
7475
  const end = this.baseSourceSpan.start.moveBy(span.end);
7452
- return new ParseSourceSpan(start, end);
7476
+ const fullStart = this.baseSourceSpan.fullStart.moveBy(span.start);
7477
+ return new ParseSourceSpan(start, end, fullStart);
7453
7478
  }
7454
7479
  else {
7455
7480
  return null;
@@ -9002,17 +9027,19 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
9002
9027
  }
9003
9028
  getSpan(start, leadingTriviaCodePoints) {
9004
9029
  start = start || this;
9005
- let cloned = false;
9030
+ let fullStart = start;
9006
9031
  if (leadingTriviaCodePoints) {
9007
9032
  while (this.diff(start) > 0 && leadingTriviaCodePoints.indexOf(start.peek()) !== -1) {
9008
- if (!cloned) {
9033
+ if (fullStart === start) {
9009
9034
  start = start.clone();
9010
- cloned = true;
9011
9035
  }
9012
9036
  start.advance();
9013
9037
  }
9014
9038
  }
9015
- return new ParseSourceSpan(new ParseLocation(start.file, start.state.offset, start.state.line, start.state.column), new ParseLocation(this.file, this.state.offset, this.state.line, this.state.column));
9039
+ const startLocation = this.locationFromCursor(start);
9040
+ const endLocation = this.locationFromCursor(this);
9041
+ const fullStartLocation = fullStart !== start ? this.locationFromCursor(fullStart) : startLocation;
9042
+ return new ParseSourceSpan(startLocation, endLocation, fullStartLocation);
9016
9043
  }
9017
9044
  getChars(start) {
9018
9045
  return this.input.substring(start.state.offset, this.state.offset);
@@ -9039,6 +9066,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
9039
9066
  updatePeek(state) {
9040
9067
  state.peek = state.offset >= this.end ? $EOF : this.charAt(state.offset);
9041
9068
  }
9069
+ locationFromCursor(cursor) {
9070
+ return new ParseLocation(cursor.file, cursor.state.offset, cursor.state.line, cursor.state.column);
9071
+ }
9042
9072
  }
9043
9073
  class EscapedCharacterCursor extends PlainCharacterCursor {
9044
9074
  constructor(fileOrCursor, range) {
@@ -9296,7 +9326,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
9296
9326
  this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`));
9297
9327
  return;
9298
9328
  }
9299
- const sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end);
9329
+ const sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end, token.sourceSpan.fullStart);
9300
9330
  this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));
9301
9331
  this._advance();
9302
9332
  }
@@ -9321,8 +9351,8 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
9321
9351
  this.errors = this.errors.concat(expansionCaseParser.errors);
9322
9352
  return null;
9323
9353
  }
9324
- const sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end);
9325
- const expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end);
9354
+ const sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end, value.sourceSpan.fullStart);
9355
+ const expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end, start.sourceSpan.fullStart);
9326
9356
  return new ExpansionCase(value.parts[0], expansionCaseParser.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan);
9327
9357
  }
9328
9358
  _collectExpansionExpTokens(start) {
@@ -9403,8 +9433,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
9403
9433
  selfClosing = false;
9404
9434
  }
9405
9435
  const end = this._peek.sourceSpan.start;
9406
- const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end);
9407
- const el = new Element$1(fullName, attrs, [], span, span, undefined);
9436
+ const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
9437
+ // Create a separate `startSpan` because `span` may be modified when there is an `end` span.
9438
+ const startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
9439
+ const el = new Element$1(fullName, attrs, [], span, startSpan, undefined);
9408
9440
  this._pushElement(el);
9409
9441
  if (selfClosing) {
9410
9442
  // Elements that are self-closed have their `endSourceSpan` set to the full span, as the
@@ -9465,7 +9497,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
9465
9497
  const quoteToken = this._advance();
9466
9498
  end = quoteToken.sourceSpan.end;
9467
9499
  }
9468
- return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end), valueSpan);
9500
+ return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end, attrName.sourceSpan.fullStart), valueSpan);
9469
9501
  }
9470
9502
  _getParentElement() {
9471
9503
  return this._elementStack.length > 0 ? this._elementStack[this._elementStack.length - 1] : null;
@@ -10848,7 +10880,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
10848
10880
  // The difference of two absolute offsets provide the relative offset
10849
10881
  const startDiff = absoluteSpan.start - sourceSpan.start.offset;
10850
10882
  const endDiff = absoluteSpan.end - sourceSpan.end.offset;
10851
- return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff));
10883
+ return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
10852
10884
  }
10853
10885
 
10854
10886
  /**
@@ -11335,7 +11367,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
11335
11367
  const matchedReferences = new Set();
11336
11368
  let component = null;
11337
11369
  const directiveAsts = directives.map((directive) => {
11338
- const sourceSpan = new ParseSourceSpan(elementSourceSpan.start, elementSourceSpan.end, `Directive ${identifierName(directive.type)}`);
11370
+ const sourceSpan = new ParseSourceSpan(elementSourceSpan.start, elementSourceSpan.end, elementSourceSpan.fullStart, `Directive ${identifierName(directive.type)}`);
11339
11371
  if (directive.isComponent) {
11340
11372
  component = directive;
11341
11373
  }
@@ -13026,10 +13058,13 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
13026
13058
  return;
13027
13059
  this.error(`Missing expected operator ${operator}`);
13028
13060
  }
13061
+ prettyPrintToken(tok) {
13062
+ return tok === EOF ? 'end of input' : `token ${tok}`;
13063
+ }
13029
13064
  expectIdentifierOrKeyword() {
13030
13065
  const n = this.next;
13031
13066
  if (!n.isIdentifier() && !n.isKeyword()) {
13032
- this.error(`Unexpected token ${n}, expected identifier or keyword`);
13067
+ this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier or keyword`);
13033
13068
  return '';
13034
13069
  }
13035
13070
  this.advance();
@@ -13038,7 +13073,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
13038
13073
  expectIdentifierOrKeywordOrString() {
13039
13074
  const n = this.next;
13040
13075
  if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) {
13041
- this.error(`Unexpected token ${n}, expected identifier, keyword, or string`);
13076
+ this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier, keyword, or string`);
13042
13077
  return '';
13043
13078
  }
13044
13079
  this.advance();
@@ -15038,7 +15073,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
15038
15073
  }
15039
15074
  }
15040
15075
  function getOffsetSourceSpan(sourceSpan, { start, end }) {
15041
- return new ParseSourceSpan(sourceSpan.start.moveBy(start), sourceSpan.start.moveBy(end));
15076
+ return new ParseSourceSpan(sourceSpan.fullStart.moveBy(start), sourceSpan.fullStart.moveBy(end));
15042
15077
  }
15043
15078
  const _CUSTOM_PH_EXP = /\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*("|')([\s\S]*?)\1[\s\S]*\)/g;
15044
15079
  function _extractPlaceholderName(input) {
@@ -15374,7 +15409,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
15374
15409
  function getSourceSpan(message) {
15375
15410
  const startNode = message.nodes[0];
15376
15411
  const endNode = message.nodes[message.nodes.length - 1];
15377
- return new ParseSourceSpan(startNode.sourceSpan.start, endNode.sourceSpan.end, startNode.sourceSpan.details);
15412
+ return new ParseSourceSpan(startNode.sourceSpan.start, endNode.sourceSpan.end, startNode.sourceSpan.fullStart, startNode.sourceSpan.details);
15378
15413
  }
15379
15414
  /**
15380
15415
  * Convert the list of serialized MessagePieces into two arrays.
@@ -15401,7 +15436,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
15401
15436
  placeHolders.push(part);
15402
15437
  if (pieces[i - 1] instanceof PlaceholderPiece) {
15403
15438
  // There were two placeholders in a row, so we need to add an empty message part.
15404
- messageParts.push(createEmptyMessagePart(part.sourceSpan.end));
15439
+ messageParts.push(createEmptyMessagePart(pieces[i - 1].sourceSpan.end));
15405
15440
  }
15406
15441
  }
15407
15442
  }
@@ -17960,7 +17995,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
17960
17995
  * Use of this source code is governed by an MIT-style license that can be
17961
17996
  * found in the LICENSE file at https://angular.io/license
17962
17997
  */
17963
- const VERSION$1 = new Version('10.1.6');
17998
+ const VERSION$1 = new Version('10.2.3');
17964
17999
 
17965
18000
  /**
17966
18001
  * @license
@@ -26545,7 +26580,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
26545
26580
  if (typeof ngDevMode !== 'object') {
26546
26581
  ngDevModeResetPerfCounters();
26547
26582
  }
26548
- return !!ngDevMode;
26583
+ return typeof ngDevMode !== 'undefined' && !!ngDevMode;
26549
26584
  }
26550
26585
  return false;
26551
26586
  }
@@ -27242,6 +27277,56 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
27242
27277
  assertNumber(lView[injectorIndex + 8 /* PARENT */], 'injectorIndex should point to parent injector');
27243
27278
  }
27244
27279
 
27280
+ /**
27281
+ * @license
27282
+ * Copyright Google LLC All Rights Reserved.
27283
+ *
27284
+ * Use of this source code is governed by an MIT-style license that can be
27285
+ * found in the LICENSE file at https://angular.io/license
27286
+ */
27287
+ /**
27288
+ * Used for stringify render output in Ivy.
27289
+ * Important! This function is very performance-sensitive and we should
27290
+ * be extra careful not to introduce megamorphic reads in it.
27291
+ */
27292
+ function renderStringify(value) {
27293
+ if (typeof value === 'string')
27294
+ return value;
27295
+ if (value == null)
27296
+ return '';
27297
+ return '' + value;
27298
+ }
27299
+ /**
27300
+ * Used to stringify a value so that it can be displayed in an error message.
27301
+ * Important! This function contains a megamorphic read and should only be
27302
+ * used for error messages.
27303
+ */
27304
+ function stringifyForError(value) {
27305
+ if (typeof value === 'function')
27306
+ return value.name || value.toString();
27307
+ if (typeof value === 'object' && value != null && typeof value.type === 'function') {
27308
+ return value.type.name || value.type.toString();
27309
+ }
27310
+ return renderStringify(value);
27311
+ }
27312
+ const ɵ0$2 = () => (typeof requestAnimationFrame !== 'undefined' &&
27313
+ requestAnimationFrame || // browser only
27314
+ setTimeout // everything else
27315
+ )
27316
+ .bind(_global$1);
27317
+ const defaultScheduler = (ɵ0$2)();
27318
+
27319
+ /** Called when directives inject each other (creating a circular dependency) */
27320
+ function throwCyclicDependencyError(token, path) {
27321
+ const depPath = path ? `. Dependency path: ${path.join(' > ')} > ${token}` : '';
27322
+ throw new Error(`Circular dependency in DI detected for ${token}${depPath}`);
27323
+ }
27324
+ /** Throws an error when a token is not found in DI. */
27325
+ function throwProviderNotFoundError(token, injectorName) {
27326
+ const injectorDetails = injectorName ? ` in ${injectorName}` : '';
27327
+ throw new Error(`No provider for ${stringifyForError(token)} found${injectorDetails}`);
27328
+ }
27329
+
27245
27330
  /**
27246
27331
  * @license
27247
27332
  * Copyright Google LLC All Rights Reserved.
@@ -27396,11 +27481,11 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
27396
27481
  function isProceduralRenderer(renderer) {
27397
27482
  return !!(renderer.listen);
27398
27483
  }
27399
- const ɵ0$2 = (hostElement, rendererType) => {
27484
+ const ɵ0$3 = (hostElement, rendererType) => {
27400
27485
  return getDocument();
27401
27486
  };
27402
27487
  const domRendererFactory3 = {
27403
- createRenderer: ɵ0$2
27488
+ createRenderer: ɵ0$3
27404
27489
  };
27405
27490
 
27406
27491
  /**
@@ -27528,7 +27613,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
27528
27613
  const instructionState = {
27529
27614
  lFrame: createLFrame(null),
27530
27615
  bindingsEnabled: true,
27531
- checkNoChangesMode: false,
27616
+ isInCheckNoChangesMode: false,
27532
27617
  };
27533
27618
  /**
27534
27619
  * Return the current `TView`.
@@ -27547,12 +27632,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
27547
27632
  function isCurrentTNodeParent() {
27548
27633
  return instructionState.lFrame.isParent;
27549
27634
  }
27550
- function getCheckNoChangesMode() {
27635
+ function isInCheckNoChangesMode() {
27551
27636
  // TODO(misko): remove this from the LView since it is ngDevMode=true mode only.
27552
- return instructionState.checkNoChangesMode;
27637
+ return instructionState.isInCheckNoChangesMode;
27553
27638
  }
27554
- function setCheckNoChangesMode(mode) {
27555
- instructionState.checkNoChangesMode = mode;
27639
+ function setIsInCheckNoChangesMode(mode) {
27640
+ instructionState.isInCheckNoChangesMode = mode;
27556
27641
  }
27557
27642
  function setBindingIndex(value) {
27558
27643
  return instructionState.lFrame.bindingIndex = value;
@@ -27888,7 +27973,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
27888
27973
  */
27889
27974
  function callHooks(currentView, arr, initPhase, currentNodeIndex) {
27890
27975
  ngDevMode &&
27891
- assertEqual(getCheckNoChangesMode(), false, 'Hooks should never be run in the check no changes mode.');
27976
+ assertEqual(isInCheckNoChangesMode(), false, 'Hooks should never be run when in check no changes mode.');
27892
27977
  const startIndex = currentNodeIndex !== undefined ?
27893
27978
  (currentView[PREORDER_HOOK_FLAGS] & 65535 /* IndexOfTheNextPreOrderHookMaskMask */) :
27894
27979
  0;
@@ -28227,45 +28312,6 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
28227
28312
  return parentView;
28228
28313
  }
28229
28314
 
28230
- /**
28231
- * @license
28232
- * Copyright Google LLC All Rights Reserved.
28233
- *
28234
- * Use of this source code is governed by an MIT-style license that can be
28235
- * found in the LICENSE file at https://angular.io/license
28236
- */
28237
- /**
28238
- * Used for stringify render output in Ivy.
28239
- * Important! This function is very performance-sensitive and we should
28240
- * be extra careful not to introduce megamorphic reads in it.
28241
- */
28242
- function renderStringify(value) {
28243
- if (typeof value === 'string')
28244
- return value;
28245
- if (value == null)
28246
- return '';
28247
- return '' + value;
28248
- }
28249
- /**
28250
- * Used to stringify a value so that it can be displayed in an error message.
28251
- * Important! This function contains a megamorphic read and should only be
28252
- * used for error messages.
28253
- */
28254
- function stringifyForError(value) {
28255
- if (typeof value === 'function')
28256
- return value.name || value.toString();
28257
- if (typeof value === 'object' && value != null && typeof value.type === 'function') {
28258
- return value.type.name || value.type.toString();
28259
- }
28260
- return renderStringify(value);
28261
- }
28262
- const ɵ0$3 = () => (typeof requestAnimationFrame !== 'undefined' &&
28263
- requestAnimationFrame || // browser only
28264
- setTimeout // everything else
28265
- )
28266
- .bind(_global$1);
28267
- const defaultScheduler = (ɵ0$3)();
28268
-
28269
28315
  /**
28270
28316
  * @license
28271
28317
  * Copyright Google LLC All Rights Reserved.
@@ -28515,7 +28561,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
28515
28561
  try {
28516
28562
  const value = bloomHash();
28517
28563
  if (value == null && !(flags & InjectFlags.Optional)) {
28518
- throw new Error(`No provider for ${stringifyForError(token)}!`);
28564
+ throwProviderNotFoundError(token);
28519
28565
  }
28520
28566
  else {
28521
28567
  return value;
@@ -28614,7 +28660,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
28614
28660
  return notFoundValue;
28615
28661
  }
28616
28662
  else {
28617
- throw new Error(`NodeInjector: NOT_FOUND [${stringifyForError(token)}]`);
28663
+ throwProviderNotFoundError(token, 'NodeInjector');
28618
28664
  }
28619
28665
  }
28620
28666
  const NOT_FOUND = {};
@@ -28698,7 +28744,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
28698
28744
  if (isFactory(value)) {
28699
28745
  const factory = value;
28700
28746
  if (factory.resolving) {
28701
- throw new Error(`Circular dep for ${stringifyForError(tData[index])}`);
28747
+ throwCyclicDependencyError(stringifyForError(tData[index]));
28702
28748
  }
28703
28749
  const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);
28704
28750
  factory.resolving = true;
@@ -30192,7 +30238,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30192
30238
  if ((flags & 256 /* Destroyed */) === 256 /* Destroyed */)
30193
30239
  return;
30194
30240
  enterView(lView);
30195
- const checkNoChangesMode = getCheckNoChangesMode();
30241
+ // Check no changes mode is a dev only mode used to verify that bindings have not changed
30242
+ // since they were assigned. We do not want to execute lifecycle hooks in that mode.
30243
+ const isInCheckNoChangesPass = isInCheckNoChangesMode();
30196
30244
  try {
30197
30245
  resetPreOrderHookFlags(lView);
30198
30246
  setBindingIndex(tView.bindingStartIndex);
@@ -30202,7 +30250,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30202
30250
  const hooksInitPhaseCompleted = (flags & 3 /* InitPhaseStateMask */) === 3 /* InitPhaseCompleted */;
30203
30251
  // execute pre-order hooks (OnInit, OnChanges, DoCheck)
30204
30252
  // PERF WARNING: do NOT extract this to a separate function without running benchmarks
30205
- if (!checkNoChangesMode) {
30253
+ if (!isInCheckNoChangesPass) {
30206
30254
  if (hooksInitPhaseCompleted) {
30207
30255
  const preOrderCheckHooks = tView.preOrderCheckHooks;
30208
30256
  if (preOrderCheckHooks !== null) {
@@ -30228,7 +30276,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30228
30276
  }
30229
30277
  // execute content hooks (AfterContentInit, AfterContentChecked)
30230
30278
  // PERF WARNING: do NOT extract this to a separate function without running benchmarks
30231
- if (!checkNoChangesMode) {
30279
+ if (!isInCheckNoChangesPass) {
30232
30280
  if (hooksInitPhaseCompleted) {
30233
30281
  const contentCheckHooks = tView.contentCheckHooks;
30234
30282
  if (contentCheckHooks !== null) {
@@ -30258,7 +30306,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30258
30306
  }
30259
30307
  // execute view hooks (AfterViewInit, AfterViewChecked)
30260
30308
  // PERF WARNING: do NOT extract this to a separate function without running benchmarks
30261
- if (!checkNoChangesMode) {
30309
+ if (!isInCheckNoChangesPass) {
30262
30310
  if (hooksInitPhaseCompleted) {
30263
30311
  const viewCheckHooks = tView.viewCheckHooks;
30264
30312
  if (viewCheckHooks !== null) {
@@ -30288,7 +30336,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30288
30336
  // refresh a `NgClass` binding should work. If we would reset the dirty state in the check
30289
30337
  // no changes cycle, the component would be not be dirty for the next update pass. This would
30290
30338
  // be different in production mode where the component dirty state is not reset.
30291
- if (!checkNoChangesMode) {
30339
+ if (!isInCheckNoChangesPass) {
30292
30340
  lView[FLAGS] &= ~(64 /* Dirty */ | 8 /* FirstLViewPass */);
30293
30341
  }
30294
30342
  if (lView[FLAGS] & 1024 /* RefreshTransplantedView */) {
@@ -30302,7 +30350,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30302
30350
  }
30303
30351
  function renderComponentOrTemplate(tView, lView, templateFn, context) {
30304
30352
  const rendererFactory = lView[RENDERER_FACTORY];
30305
- const normalExecutionPath = !getCheckNoChangesMode();
30353
+ const normalExecutionPath = !isInCheckNoChangesMode();
30306
30354
  const creationModeIsActive = isCreationMode(lView);
30307
30355
  try {
30308
30356
  if (normalExecutionPath && !creationModeIsActive && rendererFactory.begin) {
@@ -30326,7 +30374,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30326
30374
  if (rf & 2 /* Update */ && lView.length > HEADER_OFFSET) {
30327
30375
  // When we're updating, inherently select 0 so we don't
30328
30376
  // have to generate that instruction for most update blocks.
30329
- selectIndexInternal(tView, lView, 0, getCheckNoChangesMode());
30377
+ selectIndexInternal(tView, lView, 0, isInCheckNoChangesMode());
30330
30378
  }
30331
30379
  templateFn(rf, context);
30332
30380
  }
@@ -30934,12 +30982,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30934
30982
  tickRootContext(lView[CONTEXT]);
30935
30983
  }
30936
30984
  function checkNoChangesInternal(tView, view, context) {
30937
- setCheckNoChangesMode(true);
30985
+ setIsInCheckNoChangesMode(true);
30938
30986
  try {
30939
30987
  detectChangesInternal(tView, view, context);
30940
30988
  }
30941
30989
  finally {
30942
- setCheckNoChangesMode(false);
30990
+ setIsInCheckNoChangesMode(false);
30943
30991
  }
30944
30992
  }
30945
30993
  /**
@@ -30952,12 +31000,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30952
31000
  * @param lView The view which the change detection should be checked on.
30953
31001
  */
30954
31002
  function checkNoChangesInRootView(lView) {
30955
- setCheckNoChangesMode(true);
31003
+ setIsInCheckNoChangesMode(true);
30956
31004
  try {
30957
31005
  detectChangesInRootView(lView);
30958
31006
  }
30959
31007
  finally {
30960
- setCheckNoChangesMode(false);
31008
+ setIsInCheckNoChangesMode(false);
30961
31009
  }
30962
31010
  }
30963
31011
  function executeViewQueryFn(flags, viewQueryFn, component) {
@@ -33773,6 +33821,110 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
33773
33821
  Object.freeze(EMPTY_ARRAY$2);
33774
33822
  }
33775
33823
 
33824
+ /**
33825
+ * @license
33826
+ * Copyright Google LLC All Rights Reserved.
33827
+ *
33828
+ * Use of this source code is governed by an MIT-style license that can be
33829
+ * found in the LICENSE file at https://angular.io/license
33830
+ */
33831
+ /**
33832
+ * NOTE: changes to the `ngI18nClosureMode` name must be synced with `compiler-cli/src/tooling.ts`.
33833
+ */
33834
+ if (typeof ngI18nClosureMode === 'undefined') {
33835
+ // These property accesses can be ignored because ngI18nClosureMode will be set to false
33836
+ // when optimizing code and the whole if statement will be dropped.
33837
+ // Make sure to refer to ngI18nClosureMode as ['ngI18nClosureMode'] for closure.
33838
+ // NOTE: we need to have it in IIFE so that the tree-shaker is happy.
33839
+ (function () {
33840
+ // tslint:disable-next-line:no-toplevel-property-access
33841
+ _global$1['ngI18nClosureMode'] =
33842
+ // TODO(FW-1250): validate that this actually, you know, works.
33843
+ // tslint:disable-next-line:no-toplevel-property-access
33844
+ typeof goog !== 'undefined' && typeof goog.getMsg === 'function';
33845
+ })();
33846
+ }
33847
+
33848
+ /**
33849
+ * @license
33850
+ * Copyright Google LLC All Rights Reserved.
33851
+ *
33852
+ * Use of this source code is governed by an MIT-style license that can be
33853
+ * found in the LICENSE file at https://angular.io/license
33854
+ */
33855
+ /**
33856
+ * Index of each type of locale data from the locale data array
33857
+ */
33858
+ var LocaleDataIndex;
33859
+ (function (LocaleDataIndex) {
33860
+ LocaleDataIndex[LocaleDataIndex["LocaleId"] = 0] = "LocaleId";
33861
+ LocaleDataIndex[LocaleDataIndex["DayPeriodsFormat"] = 1] = "DayPeriodsFormat";
33862
+ LocaleDataIndex[LocaleDataIndex["DayPeriodsStandalone"] = 2] = "DayPeriodsStandalone";
33863
+ LocaleDataIndex[LocaleDataIndex["DaysFormat"] = 3] = "DaysFormat";
33864
+ LocaleDataIndex[LocaleDataIndex["DaysStandalone"] = 4] = "DaysStandalone";
33865
+ LocaleDataIndex[LocaleDataIndex["MonthsFormat"] = 5] = "MonthsFormat";
33866
+ LocaleDataIndex[LocaleDataIndex["MonthsStandalone"] = 6] = "MonthsStandalone";
33867
+ LocaleDataIndex[LocaleDataIndex["Eras"] = 7] = "Eras";
33868
+ LocaleDataIndex[LocaleDataIndex["FirstDayOfWeek"] = 8] = "FirstDayOfWeek";
33869
+ LocaleDataIndex[LocaleDataIndex["WeekendRange"] = 9] = "WeekendRange";
33870
+ LocaleDataIndex[LocaleDataIndex["DateFormat"] = 10] = "DateFormat";
33871
+ LocaleDataIndex[LocaleDataIndex["TimeFormat"] = 11] = "TimeFormat";
33872
+ LocaleDataIndex[LocaleDataIndex["DateTimeFormat"] = 12] = "DateTimeFormat";
33873
+ LocaleDataIndex[LocaleDataIndex["NumberSymbols"] = 13] = "NumberSymbols";
33874
+ LocaleDataIndex[LocaleDataIndex["NumberFormats"] = 14] = "NumberFormats";
33875
+ LocaleDataIndex[LocaleDataIndex["CurrencyCode"] = 15] = "CurrencyCode";
33876
+ LocaleDataIndex[LocaleDataIndex["CurrencySymbol"] = 16] = "CurrencySymbol";
33877
+ LocaleDataIndex[LocaleDataIndex["CurrencyName"] = 17] = "CurrencyName";
33878
+ LocaleDataIndex[LocaleDataIndex["Currencies"] = 18] = "Currencies";
33879
+ LocaleDataIndex[LocaleDataIndex["Directionality"] = 19] = "Directionality";
33880
+ LocaleDataIndex[LocaleDataIndex["PluralCase"] = 20] = "PluralCase";
33881
+ LocaleDataIndex[LocaleDataIndex["ExtraData"] = 21] = "ExtraData";
33882
+ })(LocaleDataIndex || (LocaleDataIndex = {}));
33883
+
33884
+ /**
33885
+ * @license
33886
+ * Copyright Google LLC All Rights Reserved.
33887
+ *
33888
+ * Use of this source code is governed by an MIT-style license that can be
33889
+ * found in the LICENSE file at https://angular.io/license
33890
+ */
33891
+ /**
33892
+ * The locale id that the application is using by default (for translations and ICU expressions).
33893
+ */
33894
+ const DEFAULT_LOCALE_ID = 'en-US';
33895
+ /**
33896
+ * USD currency code that the application uses by default for CurrencyPipe when no
33897
+ * DEFAULT_CURRENCY_CODE is provided.
33898
+ */
33899
+ const USD_CURRENCY_CODE = 'USD';
33900
+
33901
+ /**
33902
+ * @license
33903
+ * Copyright Google LLC All Rights Reserved.
33904
+ *
33905
+ * Use of this source code is governed by an MIT-style license that can be
33906
+ * found in the LICENSE file at https://angular.io/license
33907
+ */
33908
+ /**
33909
+ * The locale id that the application is currently using (for translations and ICU expressions).
33910
+ * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine
33911
+ * but is now defined as a global value.
33912
+ */
33913
+ let LOCALE_ID = DEFAULT_LOCALE_ID;
33914
+ /**
33915
+ * Sets the locale id that will be used for translations and ICU expressions.
33916
+ * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine
33917
+ * but is now defined as a global value.
33918
+ *
33919
+ * @param localeId
33920
+ */
33921
+ function setLocaleId(localeId) {
33922
+ assertDefined(localeId, `Expected localeId to be defined`);
33923
+ if (typeof localeId === 'string') {
33924
+ LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');
33925
+ }
33926
+ }
33927
+
33776
33928
  /**
33777
33929
  * @license
33778
33930
  * Copyright Google LLC All Rights Reserved.
@@ -33995,7 +34147,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
33995
34147
  /**
33996
34148
  * @publicApi
33997
34149
  */
33998
- const VERSION$2 = new Version$1('10.1.6');
34150
+ const VERSION$2 = new Version$1('10.2.3');
33999
34151
 
34000
34152
  /**
34001
34153
  * @license
@@ -35400,110 +35552,6 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
35400
35552
  }
35401
35553
  }
35402
35554
 
35403
- /**
35404
- * @license
35405
- * Copyright Google LLC All Rights Reserved.
35406
- *
35407
- * Use of this source code is governed by an MIT-style license that can be
35408
- * found in the LICENSE file at https://angular.io/license
35409
- */
35410
- /**
35411
- * Index of each type of locale data from the locale data array
35412
- */
35413
- var LocaleDataIndex;
35414
- (function (LocaleDataIndex) {
35415
- LocaleDataIndex[LocaleDataIndex["LocaleId"] = 0] = "LocaleId";
35416
- LocaleDataIndex[LocaleDataIndex["DayPeriodsFormat"] = 1] = "DayPeriodsFormat";
35417
- LocaleDataIndex[LocaleDataIndex["DayPeriodsStandalone"] = 2] = "DayPeriodsStandalone";
35418
- LocaleDataIndex[LocaleDataIndex["DaysFormat"] = 3] = "DaysFormat";
35419
- LocaleDataIndex[LocaleDataIndex["DaysStandalone"] = 4] = "DaysStandalone";
35420
- LocaleDataIndex[LocaleDataIndex["MonthsFormat"] = 5] = "MonthsFormat";
35421
- LocaleDataIndex[LocaleDataIndex["MonthsStandalone"] = 6] = "MonthsStandalone";
35422
- LocaleDataIndex[LocaleDataIndex["Eras"] = 7] = "Eras";
35423
- LocaleDataIndex[LocaleDataIndex["FirstDayOfWeek"] = 8] = "FirstDayOfWeek";
35424
- LocaleDataIndex[LocaleDataIndex["WeekendRange"] = 9] = "WeekendRange";
35425
- LocaleDataIndex[LocaleDataIndex["DateFormat"] = 10] = "DateFormat";
35426
- LocaleDataIndex[LocaleDataIndex["TimeFormat"] = 11] = "TimeFormat";
35427
- LocaleDataIndex[LocaleDataIndex["DateTimeFormat"] = 12] = "DateTimeFormat";
35428
- LocaleDataIndex[LocaleDataIndex["NumberSymbols"] = 13] = "NumberSymbols";
35429
- LocaleDataIndex[LocaleDataIndex["NumberFormats"] = 14] = "NumberFormats";
35430
- LocaleDataIndex[LocaleDataIndex["CurrencyCode"] = 15] = "CurrencyCode";
35431
- LocaleDataIndex[LocaleDataIndex["CurrencySymbol"] = 16] = "CurrencySymbol";
35432
- LocaleDataIndex[LocaleDataIndex["CurrencyName"] = 17] = "CurrencyName";
35433
- LocaleDataIndex[LocaleDataIndex["Currencies"] = 18] = "Currencies";
35434
- LocaleDataIndex[LocaleDataIndex["Directionality"] = 19] = "Directionality";
35435
- LocaleDataIndex[LocaleDataIndex["PluralCase"] = 20] = "PluralCase";
35436
- LocaleDataIndex[LocaleDataIndex["ExtraData"] = 21] = "ExtraData";
35437
- })(LocaleDataIndex || (LocaleDataIndex = {}));
35438
-
35439
- /**
35440
- * @license
35441
- * Copyright Google LLC All Rights Reserved.
35442
- *
35443
- * Use of this source code is governed by an MIT-style license that can be
35444
- * found in the LICENSE file at https://angular.io/license
35445
- */
35446
- /**
35447
- * The locale id that the application is using by default (for translations and ICU expressions).
35448
- */
35449
- const DEFAULT_LOCALE_ID = 'en-US';
35450
- /**
35451
- * USD currency code that the application uses by default for CurrencyPipe when no
35452
- * DEFAULT_CURRENCY_CODE is provided.
35453
- */
35454
- const USD_CURRENCY_CODE = 'USD';
35455
-
35456
- /**
35457
- * @license
35458
- * Copyright Google LLC All Rights Reserved.
35459
- *
35460
- * Use of this source code is governed by an MIT-style license that can be
35461
- * found in the LICENSE file at https://angular.io/license
35462
- */
35463
- /**
35464
- * The locale id that the application is currently using (for translations and ICU expressions).
35465
- * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine
35466
- * but is now defined as a global value.
35467
- */
35468
- let LOCALE_ID = DEFAULT_LOCALE_ID;
35469
- /**
35470
- * Sets the locale id that will be used for translations and ICU expressions.
35471
- * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine
35472
- * but is now defined as a global value.
35473
- *
35474
- * @param localeId
35475
- */
35476
- function setLocaleId(localeId) {
35477
- assertDefined(localeId, `Expected localeId to be defined`);
35478
- if (typeof localeId === 'string') {
35479
- LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');
35480
- }
35481
- }
35482
-
35483
- /**
35484
- * @license
35485
- * Copyright Google LLC All Rights Reserved.
35486
- *
35487
- * Use of this source code is governed by an MIT-style license that can be
35488
- * found in the LICENSE file at https://angular.io/license
35489
- */
35490
- /**
35491
- * NOTE: changes to the `ngI18nClosureMode` name must be synced with `compiler-cli/src/tooling.ts`.
35492
- */
35493
- if (typeof ngI18nClosureMode === 'undefined') {
35494
- // These property accesses can be ignored because ngI18nClosureMode will be set to false
35495
- // when optimizing code and the whole if statement will be dropped.
35496
- // Make sure to refer to ngI18nClosureMode as ['ngI18nClosureMode'] for closure.
35497
- // NOTE: we need to have it in IIFE so that the tree-shaker is happy.
35498
- (function () {
35499
- // tslint:disable-next-line:no-toplevel-property-access
35500
- _global$1['ngI18nClosureMode'] =
35501
- // TODO(FW-1250): validate that this actually, you know, works.
35502
- // tslint:disable-next-line:no-toplevel-property-access
35503
- typeof goog !== 'undefined' && typeof goog.getMsg === 'function';
35504
- })();
35505
- }
35506
-
35507
35555
  /*! *****************************************************************************
35508
35556
  Copyright (c) Microsoft Corporation. All rights reserved.
35509
35557
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -38987,7 +39035,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
38987
39035
  * Use of this source code is governed by an MIT-style license that can be
38988
39036
  * found in the LICENSE file at https://angular.io/license
38989
39037
  */
38990
- if (ngDevMode) {
39038
+ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
38991
39039
  // This helper is to give a reasonable error message to people upgrading to v9 that have not yet
38992
39040
  // installed `@angular/localize` in their app.
38993
39041
  // tslint:disable-next-line: no-toplevel-property-access
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/language-service",
3
- "version": "10.1.6",
3
+ "version": "10.2.3",
4
4
  "description": "Angular - language services",
5
5
  "main": "./bundles/language-service.js",
6
6
  "typings": "./index.d.ts",