typescript 4.3.0-dev.20210510 → 4.3.4

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.
@@ -85,7 +85,7 @@ var ts;
85
85
  // The following is baselined as a literal template type without intervention
86
86
  /** The version of the TypeScript compiler release */
87
87
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
88
- ts.version = ts.versionMajorMinor + ".0-dev.20210510";
88
+ ts.version = "4.3.4";
89
89
  /* @internal */
90
90
  var Comparison;
91
91
  (function (Comparison) {
@@ -7678,7 +7678,7 @@ var ts;
7678
7678
  Identifier_expected: diag(1003, ts.DiagnosticCategory.Error, "Identifier_expected_1003", "Identifier expected."),
7679
7679
  _0_expected: diag(1005, ts.DiagnosticCategory.Error, "_0_expected_1005", "'{0}' expected."),
7680
7680
  A_file_cannot_have_a_reference_to_itself: diag(1006, ts.DiagnosticCategory.Error, "A_file_cannot_have_a_reference_to_itself_1006", "A file cannot have a reference to itself."),
7681
- The_parser_expected_to_find_a_1_to_match_the_0_token_here: diag(1007, ts.DiagnosticCategory.Error, "The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007", "The parser expected to find a '{1}' to match the '{0}' token here."),
7681
+ The_parser_expected_to_find_a_to_match_the_token_here: diag(1007, ts.DiagnosticCategory.Error, "The_parser_expected_to_find_a_to_match_the_token_here_1007", "The parser expected to find a '}' to match the '{' token here."),
7682
7682
  Trailing_comma_not_allowed: diag(1009, ts.DiagnosticCategory.Error, "Trailing_comma_not_allowed_1009", "Trailing comma not allowed."),
7683
7683
  Asterisk_Slash_expected: diag(1010, ts.DiagnosticCategory.Error, "Asterisk_Slash_expected_1010", "'*/' expected."),
7684
7684
  An_element_access_expression_should_take_an_argument: diag(1011, ts.DiagnosticCategory.Error, "An_element_access_expression_should_take_an_argument_1011", "An element access expression should take an argument."),
@@ -17310,56 +17310,43 @@ var ts;
17310
17310
  }
17311
17311
  return __assign(__assign({}, writer), { writeTrailingSemicolon: function () {
17312
17312
  pendingTrailingSemicolon = true;
17313
- },
17314
- writeLiteral: function (s) {
17313
+ }, writeLiteral: function (s) {
17315
17314
  commitPendingTrailingSemicolon();
17316
17315
  writer.writeLiteral(s);
17317
- },
17318
- writeStringLiteral: function (s) {
17316
+ }, writeStringLiteral: function (s) {
17319
17317
  commitPendingTrailingSemicolon();
17320
17318
  writer.writeStringLiteral(s);
17321
- },
17322
- writeSymbol: function (s, sym) {
17319
+ }, writeSymbol: function (s, sym) {
17323
17320
  commitPendingTrailingSemicolon();
17324
17321
  writer.writeSymbol(s, sym);
17325
- },
17326
- writePunctuation: function (s) {
17322
+ }, writePunctuation: function (s) {
17327
17323
  commitPendingTrailingSemicolon();
17328
17324
  writer.writePunctuation(s);
17329
- },
17330
- writeKeyword: function (s) {
17325
+ }, writeKeyword: function (s) {
17331
17326
  commitPendingTrailingSemicolon();
17332
17327
  writer.writeKeyword(s);
17333
- },
17334
- writeOperator: function (s) {
17328
+ }, writeOperator: function (s) {
17335
17329
  commitPendingTrailingSemicolon();
17336
17330
  writer.writeOperator(s);
17337
- },
17338
- writeParameter: function (s) {
17331
+ }, writeParameter: function (s) {
17339
17332
  commitPendingTrailingSemicolon();
17340
17333
  writer.writeParameter(s);
17341
- },
17342
- writeSpace: function (s) {
17334
+ }, writeSpace: function (s) {
17343
17335
  commitPendingTrailingSemicolon();
17344
17336
  writer.writeSpace(s);
17345
- },
17346
- writeProperty: function (s) {
17337
+ }, writeProperty: function (s) {
17347
17338
  commitPendingTrailingSemicolon();
17348
17339
  writer.writeProperty(s);
17349
- },
17350
- writeComment: function (s) {
17340
+ }, writeComment: function (s) {
17351
17341
  commitPendingTrailingSemicolon();
17352
17342
  writer.writeComment(s);
17353
- },
17354
- writeLine: function () {
17343
+ }, writeLine: function () {
17355
17344
  commitPendingTrailingSemicolon();
17356
17345
  writer.writeLine();
17357
- },
17358
- increaseIndent: function () {
17346
+ }, increaseIndent: function () {
17359
17347
  commitPendingTrailingSemicolon();
17360
17348
  writer.increaseIndent();
17361
- },
17362
- decreaseIndent: function () {
17349
+ }, decreaseIndent: function () {
17363
17350
  commitPendingTrailingSemicolon();
17364
17351
  writer.decreaseIndent();
17365
17352
  } });
@@ -29257,8 +29244,8 @@ var ts;
29257
29244
  visitNode(cbNode, node.typeExpression) ||
29258
29245
  (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment))
29259
29246
  : visitNode(cbNode, node.typeExpression) ||
29260
- visitNode(cbNode, node.name)) ||
29261
- (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
29247
+ visitNode(cbNode, node.name) ||
29248
+ (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment)));
29262
29249
  case 320 /* JSDocAuthorTag */:
29263
29250
  return visitNode(cbNode, node.tagName) ||
29264
29251
  (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
@@ -30019,23 +30006,20 @@ var ts;
30019
30006
  return inContext(32768 /* AwaitContext */);
30020
30007
  }
30021
30008
  function parseErrorAtCurrentToken(message, arg0) {
30022
- return parseErrorAt(scanner.getTokenPos(), scanner.getTextPos(), message, arg0);
30009
+ parseErrorAt(scanner.getTokenPos(), scanner.getTextPos(), message, arg0);
30023
30010
  }
30024
30011
  function parseErrorAtPosition(start, length, message, arg0) {
30025
30012
  // Don't report another error if it would just be at the same position as the last error.
30026
30013
  var lastError = ts.lastOrUndefined(parseDiagnostics);
30027
- var result;
30028
30014
  if (!lastError || start !== lastError.start) {
30029
- result = ts.createDetachedDiagnostic(fileName, start, length, message, arg0);
30030
- parseDiagnostics.push(result);
30015
+ parseDiagnostics.push(ts.createDetachedDiagnostic(fileName, start, length, message, arg0));
30031
30016
  }
30032
30017
  // Mark that we've encountered an error. We'll set an appropriate bit on the next
30033
30018
  // node we finish so that it can't be reused incrementally.
30034
30019
  parseErrorBeforeNextFinishedNode = true;
30035
- return result;
30036
30020
  }
30037
30021
  function parseErrorAt(start, end, message, arg0) {
30038
- return parseErrorAtPosition(start, end - start, message, arg0);
30022
+ parseErrorAtPosition(start, end - start, message, arg0);
30039
30023
  }
30040
30024
  function parseErrorAtRange(range, message, arg0) {
30041
30025
  parseErrorAt(range.pos, range.end, message, arg0);
@@ -30192,16 +30176,6 @@ var ts;
30192
30176
  parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(kind));
30193
30177
  return false;
30194
30178
  }
30195
- function parseExpectedMatchingBrackets(openKind, closeKind, openPosition) {
30196
- if (token() === closeKind) {
30197
- nextToken();
30198
- return;
30199
- }
30200
- var lastError = parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(closeKind));
30201
- if (lastError) {
30202
- ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, openPosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, ts.tokenToString(openKind), ts.tokenToString(closeKind)));
30203
- }
30204
- }
30205
30179
  function parseOptional(t) {
30206
30180
  if (token() === t) {
30207
30181
  nextToken();
@@ -33569,11 +33543,10 @@ var ts;
33569
33543
  }
33570
33544
  function parseArrayLiteralExpression() {
33571
33545
  var pos = getNodePos();
33572
- var openBracketPosition = scanner.getTokenPos();
33573
33546
  parseExpected(22 /* OpenBracketToken */);
33574
33547
  var multiLine = scanner.hasPrecedingLineBreak();
33575
33548
  var elements = parseDelimitedList(15 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement);
33576
- parseExpectedMatchingBrackets(22 /* OpenBracketToken */, 23 /* CloseBracketToken */, openBracketPosition);
33549
+ parseExpected(23 /* CloseBracketToken */);
33577
33550
  return finishNode(factory.createArrayLiteralExpression(elements, multiLine), pos);
33578
33551
  }
33579
33552
  function parseObjectLiteralElement() {
@@ -33633,7 +33606,12 @@ var ts;
33633
33606
  parseExpected(18 /* OpenBraceToken */);
33634
33607
  var multiLine = scanner.hasPrecedingLineBreak();
33635
33608
  var properties = parseDelimitedList(12 /* ObjectLiteralMembers */, parseObjectLiteralElement, /*considerSemicolonAsDelimiter*/ true);
33636
- parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBracePosition);
33609
+ if (!parseExpected(19 /* CloseBraceToken */)) {
33610
+ var lastError = ts.lastOrUndefined(parseDiagnostics);
33611
+ if (lastError && lastError.code === ts.Diagnostics._0_expected.code) {
33612
+ ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));
33613
+ }
33614
+ }
33637
33615
  return finishNode(factory.createObjectLiteralExpression(properties, multiLine), pos);
33638
33616
  }
33639
33617
  function parseFunctionExpression() {
@@ -33707,7 +33685,12 @@ var ts;
33707
33685
  if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) {
33708
33686
  var multiLine = scanner.hasPrecedingLineBreak();
33709
33687
  var statements = parseList(1 /* BlockStatements */, parseStatement);
33710
- parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBracePosition);
33688
+ if (!parseExpected(19 /* CloseBraceToken */)) {
33689
+ var lastError = ts.lastOrUndefined(parseDiagnostics);
33690
+ if (lastError && lastError.code === ts.Diagnostics._0_expected.code) {
33691
+ ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));
33692
+ }
33693
+ }
33711
33694
  var result = withJSDoc(finishNode(factory.createBlock(statements, multiLine), pos), hasJSDoc);
33712
33695
  if (token() === 62 /* EqualsToken */) {
33713
33696
  parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses);
@@ -33752,10 +33735,9 @@ var ts;
33752
33735
  var pos = getNodePos();
33753
33736
  var hasJSDoc = hasPrecedingJSDocComment();
33754
33737
  parseExpected(98 /* IfKeyword */);
33755
- var openParenPosition = scanner.getTokenPos();
33756
33738
  parseExpected(20 /* OpenParenToken */);
33757
33739
  var expression = allowInAnd(parseExpression);
33758
- parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenPosition);
33740
+ parseExpected(21 /* CloseParenToken */);
33759
33741
  var thenStatement = parseStatement();
33760
33742
  var elseStatement = parseOptional(90 /* ElseKeyword */) ? parseStatement() : undefined;
33761
33743
  return withJSDoc(finishNode(factory.createIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc);
@@ -33766,10 +33748,9 @@ var ts;
33766
33748
  parseExpected(89 /* DoKeyword */);
33767
33749
  var statement = parseStatement();
33768
33750
  parseExpected(114 /* WhileKeyword */);
33769
- var openParenPosition = scanner.getTokenPos();
33770
33751
  parseExpected(20 /* OpenParenToken */);
33771
33752
  var expression = allowInAnd(parseExpression);
33772
- parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenPosition);
33753
+ parseExpected(21 /* CloseParenToken */);
33773
33754
  // From: https://mail.mozilla.org/pipermail/es-discuss/2011-August/016188.html
33774
33755
  // 157 min --- All allen at wirfs-brock.com CONF --- "do{;}while(false)false" prohibited in
33775
33756
  // spec but allowed in consensus reality. Approved -- this is the de-facto standard whereby
@@ -33781,10 +33762,9 @@ var ts;
33781
33762
  var pos = getNodePos();
33782
33763
  var hasJSDoc = hasPrecedingJSDocComment();
33783
33764
  parseExpected(114 /* WhileKeyword */);
33784
- var openParenPosition = scanner.getTokenPos();
33785
33765
  parseExpected(20 /* OpenParenToken */);
33786
33766
  var expression = allowInAnd(parseExpression);
33787
- parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenPosition);
33767
+ parseExpected(21 /* CloseParenToken */);
33788
33768
  var statement = parseStatement();
33789
33769
  return withJSDoc(finishNode(factory.createWhileStatement(expression, statement), pos), hasJSDoc);
33790
33770
  }
@@ -33851,10 +33831,9 @@ var ts;
33851
33831
  var pos = getNodePos();
33852
33832
  var hasJSDoc = hasPrecedingJSDocComment();
33853
33833
  parseExpected(115 /* WithKeyword */);
33854
- var openParenPosition = scanner.getTokenPos();
33855
33834
  parseExpected(20 /* OpenParenToken */);
33856
33835
  var expression = allowInAnd(parseExpression);
33857
- parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenPosition);
33836
+ parseExpected(21 /* CloseParenToken */);
33858
33837
  var statement = doInsideOfContext(16777216 /* InWithStatement */, parseStatement);
33859
33838
  return withJSDoc(finishNode(factory.createWithStatement(expression, statement), pos), hasJSDoc);
33860
33839
  }
@@ -35845,7 +35824,8 @@ var ts;
35845
35824
  hasChildren = true;
35846
35825
  if (child.kind === 333 /* JSDocTypeTag */) {
35847
35826
  if (childTypeTag) {
35848
- var lastError = parseErrorAtCurrentToken(ts.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
35827
+ parseErrorAtCurrentToken(ts.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
35828
+ var lastError = ts.lastOrUndefined(parseDiagnostics);
35849
35829
  if (lastError) {
35850
35830
  ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, 0, 0, ts.Diagnostics.The_tag_was_first_specified_here));
35851
35831
  }
@@ -37378,6 +37358,8 @@ var ts;
37378
37358
  {
37379
37359
  name: "strict",
37380
37360
  type: "boolean",
37361
+ // Though this affects semantic diagnostics, affectsSemanticDiagnostics is not set here
37362
+ // The value of each strictFlag depends on own strictFlag value or this and never accessed directly.
37381
37363
  showInSimplifiedHelpView: true,
37382
37364
  category: ts.Diagnostics.Strict_Type_Checking_Options,
37383
37365
  description: ts.Diagnostics.Enable_all_strict_type_checking_options
@@ -40299,9 +40281,7 @@ var ts;
40299
40281
  var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options)));
40300
40282
  moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options));
40301
40283
  var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
40302
- return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName,
40303
- clear: clear,
40304
- update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } });
40284
+ return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } });
40305
40285
  function clear() {
40306
40286
  preDirectoryResolutionCache.clear();
40307
40287
  moduleNameToDirectoryMap.clear();
@@ -56006,6 +55986,10 @@ var ts;
56006
55986
  var indexSymbol = symbol && getIndexSymbol(symbol);
56007
55987
  return indexSymbol && getIndexDeclarationOfIndexSymbol(indexSymbol, kind);
56008
55988
  }
55989
+ function getIndexDeclarationOfSymbolTable(symbolTable, kind) {
55990
+ var indexSymbol = symbolTable && getIndexSymbolFromSymbolTable(symbolTable);
55991
+ return indexSymbol && getIndexDeclarationOfIndexSymbol(indexSymbol, kind);
55992
+ }
56009
55993
  function getIndexDeclarationOfIndexSymbol(indexSymbol, kind) {
56010
55994
  var syntaxKind = kind === 1 /* Number */ ? 144 /* NumberKeyword */ : 147 /* StringKeyword */;
56011
55995
  if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
@@ -59160,8 +59144,7 @@ var ts;
59160
59144
  return type;
59161
59145
  }
59162
59146
  function maybeTypeParameterReference(node) {
59163
- return !(node.kind === 158 /* QualifiedName */ ||
59164
- node.parent.kind === 174 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName ||
59147
+ return !(node.parent.kind === 174 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName ||
59165
59148
  node.parent.kind === 196 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);
59166
59149
  }
59167
59150
  function isTypeParameterPossiblyReferenced(tp, node) {
@@ -59189,7 +59172,10 @@ var ts;
59189
59172
  return true;
59190
59173
  case 166 /* MethodDeclaration */:
59191
59174
  case 165 /* MethodSignature */:
59192
- return (!node.type && !!node.body) || !!ts.forEachChild(node, containsReference);
59175
+ return !node.type && !!node.body ||
59176
+ ts.some(node.typeParameters, containsReference) ||
59177
+ ts.some(node.parameters, containsReference) ||
59178
+ !!node.type && containsReference(node.type);
59193
59179
  }
59194
59180
  return !!ts.forEachChild(node, containsReference);
59195
59181
  }
@@ -63214,14 +63200,17 @@ var ts;
63214
63200
  return type.flags & 32768 /* Undefined */ ? type : getUnionType([type, undefinedType]);
63215
63201
  }
63216
63202
  function getGlobalNonNullableTypeInstantiation(type) {
63203
+ // First reduce away any constituents that are assignable to 'undefined' or 'null'. This not only eliminates
63204
+ // 'undefined' and 'null', but also higher-order types such as a type parameter 'U extends undefined | null'
63205
+ // that isn't eliminated by a NonNullable<T> instantiation.
63206
+ var reducedType = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
63217
63207
  if (!deferredGlobalNonNullableTypeAlias) {
63218
63208
  deferredGlobalNonNullableTypeAlias = getGlobalSymbol("NonNullable", 524288 /* TypeAlias */, /*diagnostic*/ undefined) || unknownSymbol;
63219
63209
  }
63220
- // Use NonNullable global type alias if available to improve quick info/declaration emit
63221
- if (deferredGlobalNonNullableTypeAlias !== unknownSymbol) {
63222
- return getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [type]);
63223
- }
63224
- return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */); // Type alias unavailable, fall back to non-higher-order behavior
63210
+ // If the NonNullable<T> type is available, return an instantiation. Otherwise just return the reduced type.
63211
+ return deferredGlobalNonNullableTypeAlias !== unknownSymbol ?
63212
+ getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [reducedType]) :
63213
+ reducedType;
63225
63214
  }
63226
63215
  function getNonNullableType(type) {
63227
63216
  return strictNullChecks ? getGlobalNonNullableTypeInstantiation(type) : type;
@@ -64569,12 +64558,14 @@ var ts;
64569
64558
  applyToReturnTypes(source, target, inferFromTypes);
64570
64559
  }
64571
64560
  function inferFromIndexTypes(source, target) {
64561
+ // Inferences across mapped type index signatures are pretty much the same a inferences to homomorphic variables
64562
+ var priority = (ts.getObjectFlags(source) & ts.getObjectFlags(target) & 32 /* Mapped */) ? 8 /* HomomorphicMappedType */ : 0;
64572
64563
  var targetStringIndexType = getIndexTypeOfType(target, 0 /* String */);
64573
64564
  if (targetStringIndexType) {
64574
64565
  var sourceIndexType = getIndexTypeOfType(source, 0 /* String */) ||
64575
64566
  getImplicitIndexTypeOfType(source, 0 /* String */);
64576
64567
  if (sourceIndexType) {
64577
- inferFromTypes(sourceIndexType, targetStringIndexType);
64568
+ inferWithPriority(sourceIndexType, targetStringIndexType, priority);
64578
64569
  }
64579
64570
  }
64580
64571
  var targetNumberIndexType = getIndexTypeOfType(target, 1 /* Number */);
@@ -64583,7 +64574,7 @@ var ts;
64583
64574
  getIndexTypeOfType(source, 0 /* String */) ||
64584
64575
  getImplicitIndexTypeOfType(source, 1 /* Number */);
64585
64576
  if (sourceIndexType) {
64586
- inferFromTypes(sourceIndexType, targetNumberIndexType);
64577
+ inferWithPriority(sourceIndexType, targetNumberIndexType, priority);
64587
64578
  }
64588
64579
  }
64589
64580
  }
@@ -66809,7 +66800,7 @@ var ts;
66809
66800
  !isGenericIndexType(getTypeOfExpression(parent.argumentExpression));
66810
66801
  }
66811
66802
  function isGenericTypeWithUnionConstraint(type) {
66812
- return !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & 1048576 /* Union */);
66803
+ return !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */));
66813
66804
  }
66814
66805
  function containsGenericType(type) {
66815
66806
  return !!(type.flags & 465829888 /* Instantiable */ || type.flags & 3145728 /* UnionOrIntersection */ && ts.some(type.types, containsGenericType));
@@ -78283,21 +78274,24 @@ var ts;
78283
78274
  checkBlock(node.finallyBlock);
78284
78275
  }
78285
78276
  }
78286
- function checkIndexConstraints(type) {
78287
- var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1 /* Number */);
78288
- var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0 /* String */);
78277
+ function checkIndexConstraints(type, isStatic) {
78278
+ var _a, _b, _c, _d;
78279
+ var declaredNumberIndexer = getIndexDeclarationOfSymbolTable(isStatic ? (_a = type.symbol) === null || _a === void 0 ? void 0 : _a.exports : (_b = type.symbol) === null || _b === void 0 ? void 0 : _b.members, 1 /* Number */);
78280
+ var declaredStringIndexer = getIndexDeclarationOfSymbolTable(isStatic ? (_c = type.symbol) === null || _c === void 0 ? void 0 : _c.exports : (_d = type.symbol) === null || _d === void 0 ? void 0 : _d.members, 0 /* String */);
78289
78281
  var stringIndexType = getIndexTypeOfType(type, 0 /* String */);
78290
78282
  var numberIndexType = getIndexTypeOfType(type, 1 /* Number */);
78291
78283
  if (stringIndexType || numberIndexType) {
78292
78284
  ts.forEach(getPropertiesOfObjectType(type), function (prop) {
78285
+ if (isStatic && prop.flags & 4194304 /* Prototype */)
78286
+ return;
78293
78287
  var propType = getTypeOfSymbol(prop);
78294
78288
  checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */);
78295
78289
  checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */);
78296
78290
  });
78297
78291
  var classDeclaration = type.symbol.valueDeclaration;
78298
78292
  if (ts.getObjectFlags(type) & 1 /* Class */ && classDeclaration && ts.isClassLike(classDeclaration)) {
78299
- for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) {
78300
- var member = _a[_i];
78293
+ for (var _i = 0, _e = classDeclaration.members; _i < _e.length; _i++) {
78294
+ var member = _e[_i];
78301
78295
  // Only process instance properties with computed names here.
78302
78296
  // Static properties cannot be in conflict with indexers,
78303
78297
  // and properties with literal names were already checked.
@@ -78627,7 +78621,7 @@ var ts;
78627
78621
  }
78628
78622
  if (produceDiagnostics) {
78629
78623
  checkIndexConstraints(type);
78630
- checkIndexConstraints(staticType);
78624
+ checkIndexConstraints(staticType, /*isStatic*/ true);
78631
78625
  checkTypeForDuplicateIndexSignatures(node);
78632
78626
  checkPropertyInitialization(node);
78633
78627
  }
@@ -85896,6 +85890,7 @@ var ts;
85896
85890
  case 120 /* PrivateKeyword */:
85897
85891
  case 121 /* ProtectedKeyword */:
85898
85892
  case 125 /* AbstractKeyword */:
85893
+ case 156 /* OverrideKeyword */:
85899
85894
  case 84 /* ConstKeyword */:
85900
85895
  case 133 /* DeclareKeyword */:
85901
85896
  case 142 /* ReadonlyKeyword */:
@@ -88686,10 +88681,11 @@ var ts;
88686
88681
  return ts.visitEachChild(node, visitor, context);
88687
88682
  }
88688
88683
  var staticProperties = ts.getProperties(node, /*requireInitializer*/ false, /*isStatic*/ true);
88684
+ var pendingPrivateStateAssignment;
88689
88685
  if (shouldTransformPrivateElements && ts.some(node.members, function (m) { return ts.hasStaticModifier(m) && !!m.name && ts.isPrivateIdentifier(m.name); })) {
88690
88686
  var temp = factory.createTempVariable(hoistVariableDeclaration, /* reservedInNestedScopes */ true);
88691
88687
  getPrivateIdentifierEnvironment().classConstructor = factory.cloneNode(temp);
88692
- getPendingExpressions().push(factory.createAssignment(temp, factory.getInternalName(node)));
88688
+ pendingPrivateStateAssignment = factory.createAssignment(temp, factory.getInternalName(node));
88693
88689
  }
88694
88690
  var extendsClauseElement = ts.getEffectiveBaseTypeNode(node);
88695
88691
  var isDerivedClass = !!(extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 103 /* NullKeyword */);
@@ -88698,6 +88694,9 @@ var ts;
88698
88694
  /*decorators*/ undefined, node.modifiers, node.name,
88699
88695
  /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, isDerivedClass))
88700
88696
  ];
88697
+ if (pendingPrivateStateAssignment) {
88698
+ getPendingExpressions().unshift(pendingPrivateStateAssignment);
88699
+ }
88701
88700
  // Write any pending expressions from elided or moved computed property names
88702
88701
  if (ts.some(pendingExpressions)) {
88703
88702
  statements.push(factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions)));
@@ -107084,11 +107083,21 @@ var ts;
107084
107083
  // JsxText will be written with its leading whitespace, so don't add more manually.
107085
107084
  return 0;
107086
107085
  }
107087
- else if (preserveSourceNewlines && siblingNodePositionsAreComparable(previousNode, nextNode)) {
107088
- return getEffectiveLines(function (includeComments) { return ts.getLinesBetweenRangeEndAndRangeStart(previousNode, nextNode, currentSourceFile, includeComments); });
107089
- }
107090
- else if (!preserveSourceNewlines && !ts.nodeIsSynthesized(previousNode) && !ts.nodeIsSynthesized(nextNode)) {
107091
- return ts.rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1;
107086
+ else if (!ts.nodeIsSynthesized(previousNode) && !ts.nodeIsSynthesized(nextNode)) {
107087
+ if (preserveSourceNewlines && siblingNodePositionsAreComparable(previousNode, nextNode)) {
107088
+ return getEffectiveLines(function (includeComments) { return ts.getLinesBetweenRangeEndAndRangeStart(previousNode, nextNode, currentSourceFile, includeComments); });
107089
+ }
107090
+ // If `preserveSourceNewlines` is `false` we do not intend to preserve the effective lines between the
107091
+ // previous and next node. Instead we naively check whether nodes are on separate lines within the
107092
+ // same node parent. If so, we intend to preserve a single line terminator. This is less precise and
107093
+ // expensive than checking with `preserveSourceNewlines` as above, but the goal is not to preserve the
107094
+ // effective source lines between two sibling nodes.
107095
+ else if (!preserveSourceNewlines && originalNodesHaveSameParent(previousNode, nextNode)) {
107096
+ return ts.rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1;
107097
+ }
107098
+ // If the two nodes are not comparable, add a line terminator based on the format that can indicate
107099
+ // whether new lines are preferred or not.
107100
+ return format & 65536 /* PreferNewLine */ ? 1 : 0;
107092
107101
  }
107093
107102
  else if (synthesizedNodeStartsOnNewLine(previousNode, format) || synthesizedNodeStartsOnNewLine(nextNode, format)) {
107094
107103
  return 1;
@@ -107728,10 +107737,13 @@ var ts;
107728
107737
  }
107729
107738
  exitComment();
107730
107739
  }
107740
+ function originalNodesHaveSameParent(nodeA, nodeB) {
107741
+ nodeA = ts.getOriginalNode(nodeA);
107742
+ // For performance, do not call `getOriginalNode` for `nodeB` if `nodeA` doesn't even
107743
+ // have a parent node.
107744
+ return nodeA.parent && nodeA.parent === ts.getOriginalNode(nodeB).parent;
107745
+ }
107731
107746
  function siblingNodePositionsAreComparable(previousNode, nextNode) {
107732
- if (ts.nodeIsSynthesized(previousNode) || ts.nodeIsSynthesized(nextNode)) {
107733
- return false;
107734
- }
107735
107747
  if (nextNode.pos < previousNode.end) {
107736
107748
  return false;
107737
107749
  }
@@ -113104,8 +113116,14 @@ var ts;
113104
113116
  var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
113105
113117
  for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
113106
113118
  var name = _a[_i];
113107
- var optionInfo = optionsNameMap.get(name.toLowerCase());
113108
- if ((optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsEmit) || (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsSemanticDiagnostics) || name === "skipLibCheck" || name === "skipDefaultLibCheck") {
113119
+ var optionKey = name.toLowerCase();
113120
+ var optionInfo = optionsNameMap.get(optionKey);
113121
+ if ((optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsEmit) || (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsSemanticDiagnostics) ||
113122
+ // We need to store `strict`, even though it won't be examined directly, so that the
113123
+ // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly from the buildinfo
113124
+ optionKey === "strict" ||
113125
+ // We need to store these to determine whether `lib` files need to be rechecked.
113126
+ optionKey === "skiplibcheck" || optionKey === "skipdefaultlibcheck") {
113109
113127
  (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfo);
113110
113128
  }
113111
113129
  }
@@ -116614,7 +116632,7 @@ var ts;
116614
116632
  },
116615
116633
  emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
116616
116634
  if (targetSourceFile || emitOnlyDtsFiles) {
116617
- return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); });
116635
+ return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); });
116618
116636
  }
116619
116637
  executeSteps(BuildStep.SemanticDiagnostics, cancellationToken);
116620
116638
  if (step === BuildStep.EmitBuildInfo) {
@@ -116699,6 +116717,7 @@ var ts;
116699
116717
  }
116700
116718
  function emit(writeFileCallback, cancellationToken, customTransformers) {
116701
116719
  var _a;
116720
+ var _b, _c;
116702
116721
  ts.Debug.assertIsDefined(program);
116703
116722
  ts.Debug.assert(step === BuildStep.Emit);
116704
116723
  // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly
@@ -116709,7 +116728,7 @@ var ts;
116709
116728
  var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics,
116710
116729
  /*write*/ undefined,
116711
116730
  /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken,
116712
- /*emitOnlyDts*/ false, customTransformers).emitResult;
116731
+ /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult;
116713
116732
  // Don't emit .d.ts if there are decl file errors
116714
116733
  if (declDiagnostics) {
116715
116734
  program.restoreState();
@@ -116791,6 +116810,7 @@ var ts;
116791
116810
  return emitDiagnostics;
116792
116811
  }
116793
116812
  function emitBundle(writeFileCallback, customTransformers) {
116813
+ var _a, _b;
116794
116814
  ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle);
116795
116815
  if (state.options.dry) {
116796
116816
  reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project);
@@ -116806,7 +116826,7 @@ var ts;
116806
116826
  var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) {
116807
116827
  var refName = resolveProjectName(state, ref.path);
116808
116828
  return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName));
116809
- }, customTransformers);
116829
+ }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project)));
116810
116830
  if (ts.isString(outputFiles)) {
116811
116831
  reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles));
116812
116832
  step = BuildStep.BuildInvalidatedProjectOfBundle;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.3.0-dev.20210510",
5
+ "version": "4.3.4",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -130,4 +130,4 @@
130
130
  "volta": {
131
131
  "node": "14.15.5"
132
132
  }
133
- }
133
+ }