@angular/language-service 12.1.0-next.4 → 12.1.1

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 v12.1.0-next.4
2
+ * @license Angular v12.1.1
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  * License: MIT
5
5
  */
@@ -4700,8 +4700,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
4700
4700
  // There is a base factory variable so wrap its declaration along with the factory function into
4701
4701
  // an IIFE.
4702
4702
  factoryFn = fn([], [
4703
- new DeclareVarStmt(baseFactoryVar.name),
4704
- new ReturnStatement(factoryFn)
4703
+ new DeclareVarStmt(baseFactoryVar.name), new ReturnStatement(factoryFn)
4705
4704
  ]).callFn([], /* sourceSpan */ undefined, /* pure */ true);
4706
4705
  }
4707
4706
  return {
@@ -6492,19 +6491,29 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
6492
6491
  }
6493
6492
  }
6494
6493
  class KeyedRead extends AST {
6495
- constructor(span, sourceSpan, obj, key) {
6494
+ constructor(span, sourceSpan, receiver, key) {
6496
6495
  super(span, sourceSpan);
6497
- this.obj = obj;
6496
+ this.receiver = receiver;
6498
6497
  this.key = key;
6499
6498
  }
6500
6499
  visit(visitor, context = null) {
6501
6500
  return visitor.visitKeyedRead(this, context);
6502
6501
  }
6503
6502
  }
6503
+ class SafeKeyedRead extends AST {
6504
+ constructor(span, sourceSpan, receiver, key) {
6505
+ super(span, sourceSpan);
6506
+ this.receiver = receiver;
6507
+ this.key = key;
6508
+ }
6509
+ visit(visitor, context = null) {
6510
+ return visitor.visitSafeKeyedRead(this, context);
6511
+ }
6512
+ }
6504
6513
  class KeyedWrite extends AST {
6505
- constructor(span, sourceSpan, obj, key, value) {
6514
+ constructor(span, sourceSpan, receiver, key, value) {
6506
6515
  super(span, sourceSpan);
6507
- this.obj = obj;
6516
+ this.receiver = receiver;
6508
6517
  this.key = key;
6509
6518
  this.value = value;
6510
6519
  }
@@ -6753,11 +6762,11 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
6753
6762
  this.visitAll(ast.expressions, context);
6754
6763
  }
6755
6764
  visitKeyedRead(ast, context) {
6756
- this.visit(ast.obj, context);
6765
+ this.visit(ast.receiver, context);
6757
6766
  this.visit(ast.key, context);
6758
6767
  }
6759
6768
  visitKeyedWrite(ast, context) {
6760
- this.visit(ast.obj, context);
6769
+ this.visit(ast.receiver, context);
6761
6770
  this.visit(ast.key, context);
6762
6771
  this.visit(ast.value, context);
6763
6772
  }
@@ -6792,6 +6801,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
6792
6801
  this.visit(ast.receiver, context);
6793
6802
  this.visitAll(ast.args, context);
6794
6803
  }
6804
+ visitSafeKeyedRead(ast, context) {
6805
+ this.visit(ast.receiver, context);
6806
+ this.visit(ast.key, context);
6807
+ }
6795
6808
  visitQuote(ast, context) { }
6796
6809
  // This is not part of the AstVisitor interface, just a helper method
6797
6810
  visitAll(asts, context) {
@@ -6863,10 +6876,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
6863
6876
  return new BindingPipe(ast.span, ast.sourceSpan, ast.exp.visit(this), ast.name, this.visitAll(ast.args), ast.nameSpan);
6864
6877
  }
6865
6878
  visitKeyedRead(ast, context) {
6866
- return new KeyedRead(ast.span, ast.sourceSpan, ast.obj.visit(this), ast.key.visit(this));
6879
+ return new KeyedRead(ast.span, ast.sourceSpan, ast.receiver.visit(this), ast.key.visit(this));
6867
6880
  }
6868
6881
  visitKeyedWrite(ast, context) {
6869
- return new KeyedWrite(ast.span, ast.sourceSpan, ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this));
6882
+ return new KeyedWrite(ast.span, ast.sourceSpan, ast.receiver.visit(this), ast.key.visit(this), ast.value.visit(this));
6870
6883
  }
6871
6884
  visitAll(asts) {
6872
6885
  const res = [];
@@ -6881,6 +6894,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
6881
6894
  visitQuote(ast, context) {
6882
6895
  return new Quote(ast.span, ast.sourceSpan, ast.prefix, ast.uninterpretedExpression, ast.location);
6883
6896
  }
6897
+ visitSafeKeyedRead(ast, context) {
6898
+ return new SafeKeyedRead(ast.span, ast.sourceSpan, ast.receiver.visit(this), ast.key.visit(this));
6899
+ }
6884
6900
  }
6885
6901
  // A transformer that only creates new nodes if the transformer makes a change or
6886
6902
  // a change is made a child node.
@@ -7014,18 +7030,18 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
7014
7030
  return ast;
7015
7031
  }
7016
7032
  visitKeyedRead(ast, context) {
7017
- const obj = ast.obj.visit(this);
7033
+ const obj = ast.receiver.visit(this);
7018
7034
  const key = ast.key.visit(this);
7019
- if (obj !== ast.obj || key !== ast.key) {
7035
+ if (obj !== ast.receiver || key !== ast.key) {
7020
7036
  return new KeyedRead(ast.span, ast.sourceSpan, obj, key);
7021
7037
  }
7022
7038
  return ast;
7023
7039
  }
7024
7040
  visitKeyedWrite(ast, context) {
7025
- const obj = ast.obj.visit(this);
7041
+ const obj = ast.receiver.visit(this);
7026
7042
  const key = ast.key.visit(this);
7027
7043
  const value = ast.value.visit(this);
7028
- if (obj !== ast.obj || key !== ast.key || value !== ast.value) {
7044
+ if (obj !== ast.receiver || key !== ast.key || value !== ast.value) {
7029
7045
  return new KeyedWrite(ast.span, ast.sourceSpan, obj, key, value);
7030
7046
  }
7031
7047
  return ast;
@@ -7051,6 +7067,14 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
7051
7067
  visitQuote(ast, context) {
7052
7068
  return ast;
7053
7069
  }
7070
+ visitSafeKeyedRead(ast, context) {
7071
+ const obj = ast.receiver.visit(this);
7072
+ const key = ast.key.visit(this);
7073
+ if (obj !== ast.receiver || key !== ast.key) {
7074
+ return new SafeKeyedRead(ast.span, ast.sourceSpan, obj, key);
7075
+ }
7076
+ return ast;
7077
+ }
7054
7078
  }
7055
7079
  // Bindings
7056
7080
  class ParsedProperty {
@@ -7615,13 +7639,16 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
7615
7639
  return this.convertSafeAccess(ast, leftMostSafe, mode);
7616
7640
  }
7617
7641
  else {
7618
- return convertToStatementIfNeeded(mode, this._visit(ast.obj, _Mode.Expression).key(this._visit(ast.key, _Mode.Expression)));
7642
+ return convertToStatementIfNeeded(mode, this._visit(ast.receiver, _Mode.Expression).key(this._visit(ast.key, _Mode.Expression)));
7619
7643
  }
7620
7644
  }
7621
7645
  visitKeyedWrite(ast, mode) {
7622
- const obj = this._visit(ast.obj, _Mode.Expression);
7646
+ const obj = this._visit(ast.receiver, _Mode.Expression);
7623
7647
  const key = this._visit(ast.key, _Mode.Expression);
7624
7648
  const value = this._visit(ast.value, _Mode.Expression);
7649
+ if (obj === this._implicitReceiver) {
7650
+ this._localResolver.maybeRestoreView(0, false);
7651
+ }
7625
7652
  return convertToStatementIfNeeded(mode, obj.key(key).set(value));
7626
7653
  }
7627
7654
  visitLiteralArray(ast, mode) {
@@ -7747,6 +7774,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
7747
7774
  visitSafeMethodCall(ast, mode) {
7748
7775
  return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode);
7749
7776
  }
7777
+ visitSafeKeyedRead(ast, mode) {
7778
+ return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode);
7779
+ }
7750
7780
  visitAll(asts, mode) {
7751
7781
  return asts.map(ast => this._visit(ast, mode));
7752
7782
  }
@@ -7813,6 +7843,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
7813
7843
  if (leftMostSafe instanceof SafeMethodCall) {
7814
7844
  this._nodeMap.set(leftMostSafe, new MethodCall(leftMostSafe.span, leftMostSafe.sourceSpan, leftMostSafe.nameSpan, leftMostSafe.receiver, leftMostSafe.name, leftMostSafe.args, leftMostSafe.argumentSpan));
7815
7845
  }
7846
+ else if (leftMostSafe instanceof SafeKeyedRead) {
7847
+ this._nodeMap.set(leftMostSafe, new KeyedRead(leftMostSafe.span, leftMostSafe.sourceSpan, leftMostSafe.receiver, leftMostSafe.key));
7848
+ }
7816
7849
  else {
7817
7850
  this._nodeMap.set(leftMostSafe, new PropertyRead(leftMostSafe.span, leftMostSafe.sourceSpan, leftMostSafe.nameSpan, leftMostSafe.receiver, leftMostSafe.name));
7818
7851
  }
@@ -7879,7 +7912,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
7879
7912
  return null;
7880
7913
  },
7881
7914
  visitKeyedRead(ast) {
7882
- return visit(this, ast.obj);
7915
+ return visit(this, ast.receiver);
7883
7916
  },
7884
7917
  visitKeyedWrite(ast) {
7885
7918
  return null;
@@ -7919,6 +7952,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
7919
7952
  },
7920
7953
  visitSafePropertyRead(ast) {
7921
7954
  return visit(this, ast.receiver) || ast;
7955
+ },
7956
+ visitSafeKeyedRead(ast) {
7957
+ return visit(this, ast.receiver) || ast;
7922
7958
  }
7923
7959
  });
7924
7960
  }
@@ -7998,6 +8034,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
7998
8034
  },
7999
8035
  visitSafePropertyRead(ast) {
8000
8036
  return false;
8037
+ },
8038
+ visitSafeKeyedRead(ast) {
8039
+ return false;
8001
8040
  }
8002
8041
  });
8003
8042
  }
@@ -8054,6 +8093,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
8054
8093
  this.globals = globals;
8055
8094
  }
8056
8095
  notifyImplicitReceiverUse() { }
8096
+ maybeRestoreView() { }
8057
8097
  getLocal(name) {
8058
8098
  if (name === EventHandlerVars.event.name) {
8059
8099
  return EventHandlerVars.event;
@@ -9599,10 +9639,13 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
9599
9639
  parts.push(this._readChar(true));
9600
9640
  }
9601
9641
  } while (!this._isTextEnd());
9642
+ // It is possible that an interpolation was started but not ended inside this text token.
9643
+ // Make sure that we reset the state of the lexer correctly.
9644
+ this._inInterpolation = false;
9602
9645
  this._endToken([this._processCarriageReturns(parts.join(''))]);
9603
9646
  }
9604
9647
  _isTextEnd() {
9605
- if (this._cursor.peek() === $LT || this._cursor.peek() === $EOF) {
9648
+ if (this._isTagStart() || this._cursor.peek() === $EOF) {
9606
9649
  return true;
9607
9650
  }
9608
9651
  if (this._tokenizeIcu && !this._inInterpolation) {
@@ -9617,6 +9660,24 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
9617
9660
  }
9618
9661
  return false;
9619
9662
  }
9663
+ /**
9664
+ * Returns true if the current cursor is pointing to the start of a tag
9665
+ * (opening/closing/comments/cdata/etc).
9666
+ */
9667
+ _isTagStart() {
9668
+ if (this._cursor.peek() === $LT) {
9669
+ // We assume that `<` followed by whitespace is not the start of an HTML element.
9670
+ const tmp = this._cursor.clone();
9671
+ tmp.advance();
9672
+ // If the next character is alphabetic, ! nor / then it is a tag start
9673
+ const code = tmp.peek();
9674
+ if (($a <= code && code <= $z) || ($A <= code && code <= $Z) ||
9675
+ code === $SLASH || code === $BANG) {
9676
+ return true;
9677
+ }
9678
+ }
9679
+ return false;
9680
+ }
9620
9681
  _readUntil(char) {
9621
9682
  const start = this._cursor.clone();
9622
9683
  this._attemptUntilChar(char);
@@ -10189,6 +10250,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
10189
10250
  * opening tag is recovered).
10190
10251
  */
10191
10252
  _popElement(fullName, endSourceSpan) {
10253
+ let unexpectedCloseTagDetected = false;
10192
10254
  for (let stackIndex = this._elementStack.length - 1; stackIndex >= 0; stackIndex--) {
10193
10255
  const el = this._elementStack[stackIndex];
10194
10256
  if (el.name == fullName) {
@@ -10198,10 +10260,13 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
10198
10260
  el.endSourceSpan = endSourceSpan;
10199
10261
  el.sourceSpan.end = endSourceSpan !== null ? endSourceSpan.end : el.sourceSpan.end;
10200
10262
  this._elementStack.splice(stackIndex, this._elementStack.length - stackIndex);
10201
- return true;
10263
+ return !unexpectedCloseTagDetected;
10202
10264
  }
10203
10265
  if (!this.getTagDefinition(el.name).closedByParent) {
10204
- return false;
10266
+ // Note that we encountered an unexpected close tag but continue processing the element
10267
+ // stack so we can assign an `endSourceSpan` if there is a corresponding start tag for this
10268
+ // end tag in the stack.
10269
+ unexpectedCloseTagDetected = true;
10205
10270
  }
10206
10271
  }
10207
10272
  return false;
@@ -14199,25 +14264,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
14199
14264
  result = this.parseAccessMemberOrMethodCall(result, start, false);
14200
14265
  }
14201
14266
  else if (this.consumeOptionalOperator('?.')) {
14202
- result = this.parseAccessMemberOrMethodCall(result, start, true);
14267
+ result = this.consumeOptionalCharacter($LBRACKET) ?
14268
+ this.parseKeyedReadOrWrite(result, start, true) :
14269
+ this.parseAccessMemberOrMethodCall(result, start, true);
14203
14270
  }
14204
14271
  else if (this.consumeOptionalCharacter($LBRACKET)) {
14205
- this.withContext(ParseContextFlags.Writable, () => {
14206
- this.rbracketsExpected++;
14207
- const key = this.parsePipe();
14208
- if (key instanceof EmptyExpr) {
14209
- this.error(`Key access cannot be empty`);
14210
- }
14211
- this.rbracketsExpected--;
14212
- this.expectCharacter($RBRACKET);
14213
- if (this.consumeOptionalOperator('=')) {
14214
- const value = this.parseConditional();
14215
- result = new KeyedWrite(this.span(start), this.sourceSpan(start), result, key, value);
14216
- }
14217
- else {
14218
- result = new KeyedRead(this.span(start), this.sourceSpan(start), result, key);
14219
- }
14220
- });
14272
+ result = this.parseKeyedReadOrWrite(result, start, false);
14221
14273
  }
14222
14274
  else if (this.consumeOptionalCharacter($LPAREN)) {
14223
14275
  this.rparensExpected++;
@@ -14319,18 +14371,30 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
14319
14371
  if (!this.consumeOptionalCharacter($RBRACE)) {
14320
14372
  this.rbracesExpected++;
14321
14373
  do {
14374
+ const keyStart = this.inputIndex;
14322
14375
  const quoted = this.next.isString();
14323
14376
  const key = this.expectIdentifierOrKeywordOrString();
14324
14377
  keys.push({ key, quoted });
14325
- this.expectCharacter($COLON);
14326
- values.push(this.parsePipe());
14378
+ // Properties with quoted keys can't use the shorthand syntax.
14379
+ if (quoted) {
14380
+ this.expectCharacter($COLON);
14381
+ values.push(this.parsePipe());
14382
+ }
14383
+ else if (this.consumeOptionalCharacter($COLON)) {
14384
+ values.push(this.parsePipe());
14385
+ }
14386
+ else {
14387
+ const span = this.span(keyStart);
14388
+ const sourceSpan = this.sourceSpan(keyStart);
14389
+ values.push(new PropertyRead(span, sourceSpan, sourceSpan, new ImplicitReceiver(span, sourceSpan), key));
14390
+ }
14327
14391
  } while (this.consumeOptionalCharacter($COMMA));
14328
14392
  this.rbracesExpected--;
14329
14393
  this.expectCharacter($RBRACE);
14330
14394
  }
14331
14395
  return new LiteralMap(this.span(start), this.sourceSpan(start), keys, values);
14332
14396
  }
14333
- parseAccessMemberOrMethodCall(receiver, start, isSafe = false) {
14397
+ parseAccessMemberOrMethodCall(receiver, start, isSafe) {
14334
14398
  const nameStart = this.inputIndex;
14335
14399
  const id = this.withContext(ParseContextFlags.Writable, () => {
14336
14400
  var _a;
@@ -14465,6 +14529,31 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
14465
14529
  }
14466
14530
  return new TemplateBindingParseResult(bindings, [] /* warnings */, this.errors);
14467
14531
  }
14532
+ parseKeyedReadOrWrite(receiver, start, isSafe) {
14533
+ return this.withContext(ParseContextFlags.Writable, () => {
14534
+ this.rbracketsExpected++;
14535
+ const key = this.parsePipe();
14536
+ if (key instanceof EmptyExpr) {
14537
+ this.error(`Key access cannot be empty`);
14538
+ }
14539
+ this.rbracketsExpected--;
14540
+ this.expectCharacter($RBRACKET);
14541
+ if (this.consumeOptionalOperator('=')) {
14542
+ if (isSafe) {
14543
+ this.error('The \'?.\' operator cannot be used in the assignment');
14544
+ }
14545
+ else {
14546
+ const value = this.parseConditional();
14547
+ return new KeyedWrite(this.span(start), this.sourceSpan(start), receiver, key, value);
14548
+ }
14549
+ }
14550
+ else {
14551
+ return isSafe ? new SafeKeyedRead(this.span(start), this.sourceSpan(start), receiver, key) :
14552
+ new KeyedRead(this.span(start), this.sourceSpan(start), receiver, key);
14553
+ }
14554
+ return new EmptyExpr(this.span(start), this.sourceSpan(start));
14555
+ });
14556
+ }
14468
14557
  /**
14469
14558
  * Parse a directive keyword, followed by a mandatory expression.
14470
14559
  * For example, "of items", "trackBy: func".
@@ -14672,6 +14761,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
14672
14761
  }
14673
14762
  visitChain(ast, context) { }
14674
14763
  visitQuote(ast, context) { }
14764
+ visitSafeKeyedRead(ast, context) { }
14675
14765
  }
14676
14766
  /**
14677
14767
  * This class implements SimpleExpressionChecker used in View Engine and performs more strict checks
@@ -16860,6 +16950,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
16860
16950
  notifyImplicitReceiverUse() {
16861
16951
  this._bindingScope.notifyImplicitReceiverUse();
16862
16952
  }
16953
+ // LocalResolver
16954
+ maybeRestoreView(retrievalLevel, localRefLookup) {
16955
+ this._bindingScope.maybeRestoreView(retrievalLevel, localRefLookup);
16956
+ }
16863
16957
  i18nTranslate(message, params = {}, ref, transformFn) {
16864
16958
  const _ref = ref || this.i18nGenerateMainBlockVar();
16865
16959
  // Closure Compiler requires const names to start with `MSG_` but disallows any other const to
@@ -19500,7 +19594,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
19500
19594
  * Use of this source code is governed by an MIT-style license that can be
19501
19595
  * found in the LICENSE file at https://angular.io/license
19502
19596
  */
19503
- const VERSION$1 = new Version('12.1.0-next.4');
19597
+ const VERSION$1 = new Version('12.1.1');
19504
19598
 
19505
19599
  /**
19506
19600
  * @license
@@ -23665,7 +23759,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
23665
23759
  return this.undefinedType;
23666
23760
  }
23667
23761
  visitKeyedRead(ast) {
23668
- const targetType = this.getType(ast.obj);
23762
+ const targetType = this.getType(ast.receiver);
23669
23763
  const keyType = this.getType(ast.key);
23670
23764
  const result = targetType.indexed(keyType, ast.key instanceof LiteralPrimitive ? ast.key.value : undefined);
23671
23765
  return result || this.anyType;
@@ -23754,6 +23848,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
23754
23848
  visitSafePropertyRead(ast) {
23755
23849
  return this.resolvePropertyRead(this.query.getNonNullableType(this.getType(ast.receiver)), ast);
23756
23850
  }
23851
+ visitSafeKeyedRead(ast) {
23852
+ const targetType = this.query.getNonNullableType(this.getType(ast.receiver));
23853
+ const keyType = this.getType(ast.key);
23854
+ const result = targetType.indexed(keyType, ast.key instanceof LiteralPrimitive ? ast.key.value : undefined);
23855
+ return result || this.anyType;
23856
+ }
23757
23857
  /**
23758
23858
  * Gets the source of an expession AST.
23759
23859
  * The AST's sourceSpan is relative to the start of the template source code, which is contained
@@ -24248,6 +24348,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
24248
24348
  result = undefined;
24249
24349
  },
24250
24350
  visitKeyedRead(_ast) { },
24351
+ visitSafeKeyedRead(_ast) { },
24251
24352
  visitKeyedWrite(_ast) { },
24252
24353
  visitLiteralArray(_ast) { },
24253
24354
  visitLiteralMap(_ast) { },
@@ -24335,6 +24436,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
24335
24436
  visitThisReceiver(_ast) { },
24336
24437
  visitInterpolation(_ast) { },
24337
24438
  visitKeyedRead(_ast) { },
24439
+ visitSafeKeyedRead(_ast) { },
24338
24440
  visitKeyedWrite(_ast) { },
24339
24441
  visitLiteralArray(_ast) { },
24340
24442
  visitLiteralMap(_ast) { },
@@ -25048,6 +25150,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
25048
25150
  function allParameterTypesMatch(signature) {
25049
25151
  const tc = context.checker;
25050
25152
  return signature.getParameters().every((parameter, i) => {
25153
+ if (parameter.valueDeclaration === undefined) {
25154
+ return false;
25155
+ }
25051
25156
  const type = tc.getTypeOfSymbolAtLocation(parameter, parameter.valueDeclaration);
25052
25157
  return type === passedInTypes[i];
25053
25158
  });
@@ -35407,6 +35512,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
35407
35512
  * then use the factory's `create()` method to create a component of that type.
35408
35513
  *
35409
35514
  * @see [Dynamic Components](guide/dynamic-component-loader)
35515
+ * @see [Usage Example](guide/dynamic-component-loader#resolving-components)
35516
+ * @see <live-example name="dynamic-component-loader" noDownload></live-example>
35517
+ of the code in this cookbook
35410
35518
  * @publicApi
35411
35519
  */
35412
35520
  class ComponentFactoryResolver {
@@ -35568,7 +35676,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
35568
35676
  /**
35569
35677
  * @publicApi
35570
35678
  */
35571
- const VERSION$2 = new Version$1('12.1.0-next.4');
35679
+ const VERSION$2 = new Version$1('12.1.1');
35572
35680
 
35573
35681
  /**
35574
35682
  * @license
@@ -40676,20 +40784,41 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
40676
40784
  merge$1(isCurrentlyStable, isStable.pipe(share()));
40677
40785
  }
40678
40786
  /**
40679
- * Bootstrap a new component at the root level of the application.
40787
+ * Bootstrap a component onto the element identified by its selector or, optionally, to a
40788
+ * specified element.
40680
40789
  *
40681
40790
  * @usageNotes
40682
40791
  * ### Bootstrap process
40683
40792
  *
40684
- * When bootstrapping a new root component into an application, Angular mounts the
40685
- * specified application component onto DOM elements identified by the componentType's
40686
- * selector and kicks off automatic change detection to finish initializing the component.
40793
+ * When bootstrapping a component, Angular mounts it onto a target DOM element
40794
+ * and kicks off automatic change detection. The target DOM element can be
40795
+ * provided using the `rootSelectorOrNode` argument.
40687
40796
  *
40688
- * Optionally, a component can be mounted onto a DOM element that does not match the
40689
- * componentType's selector.
40797
+ * If the target DOM element is not provided, Angular tries to find one on a page
40798
+ * using the `selector` of the component that is being bootstrapped
40799
+ * (first matched element is used).
40690
40800
  *
40691
40801
  * ### Example
40692
- * {@example core/ts/platform/platform.ts region='longform'}
40802
+ *
40803
+ * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,
40804
+ * but it requires us to know the component while writing the application code.
40805
+ *
40806
+ * Imagine a situation where we have to wait for an API call to decide about the component to
40807
+ * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to
40808
+ * dynamically bootstrap a component.
40809
+ *
40810
+ * {@example core/ts/platform/platform.ts region='componentSelector'}
40811
+ *
40812
+ * Optionally, a component can be mounted onto a DOM element that does not match the
40813
+ * selector of the bootstrapped component.
40814
+ *
40815
+ * In the following example, we are providing a CSS selector to match the target element.
40816
+ *
40817
+ * {@example core/ts/platform/platform.ts region='cssSelector'}
40818
+ *
40819
+ * While in this example, we are providing reference to a DOM node.
40820
+ *
40821
+ * {@example core/ts/platform/platform.ts region='domNode'}
40693
40822
  */
40694
40823
  bootstrap(componentOrFactory, rootSelectorOrNode) {
40695
40824
  if (!this._initStatus.done) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/language-service",
3
- "version": "12.1.0-next.4",
3
+ "version": "12.1.1",
4
4
  "description": "Angular - language services",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",