typescript 4.6.0-dev.20220104 → 4.6.0-dev.20220108

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.
@@ -19,10 +19,57 @@ and limitations under the License.
19
19
 
20
20
 
21
21
  interface ErrorOptions {
22
- cause?: Error;
22
+ cause?: Error;
23
+ }
24
+
25
+ interface Error {
26
+ cause?: Error;
23
27
  }
24
28
 
25
29
  interface ErrorConstructor {
26
- new(message?: string, options?: ErrorOptions): Error;
27
- (message?: string, options?: ErrorOptions): Error;
30
+ new (message?: string, options?: ErrorOptions): Error;
31
+ (message?: string, options?: ErrorOptions): Error;
32
+ }
33
+
34
+ interface EvalErrorConstructor {
35
+ new (message?: string, options?: ErrorOptions): EvalError;
36
+ (message?: string, options?: ErrorOptions): EvalError;
37
+ }
38
+
39
+ interface RangeErrorConstructor {
40
+ new (message?: string, options?: ErrorOptions): RangeError;
41
+ (message?: string, options?: ErrorOptions): RangeError;
42
+ }
43
+
44
+ interface ReferenceErrorConstructor {
45
+ new (message?: string, options?: ErrorOptions): ReferenceError;
46
+ (message?: string, options?: ErrorOptions): ReferenceError;
47
+ }
48
+
49
+ interface SyntaxErrorConstructor {
50
+ new (message?: string, options?: ErrorOptions): SyntaxError;
51
+ (message?: string, options?: ErrorOptions): SyntaxError;
52
+ }
53
+
54
+ interface TypeErrorConstructor {
55
+ new (message?: string, options?: ErrorOptions): TypeError;
56
+ (message?: string, options?: ErrorOptions): TypeError;
57
+ }
58
+
59
+ interface URIErrorConstructor {
60
+ new (message?: string, options?: ErrorOptions): URIError;
61
+ (message?: string, options?: ErrorOptions): URIError;
62
+ }
63
+
64
+ interface AggregateErrorConstructor {
65
+ new (
66
+ errors: Iterable<any>,
67
+ message?: string,
68
+ options?: ErrorOptions
69
+ ): AggregateError;
70
+ (
71
+ errors: Iterable<any>,
72
+ message?: string,
73
+ options?: ErrorOptions
74
+ ): AggregateError;
28
75
  }
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.6";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20220104";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20220108";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
@@ -11002,7 +11002,8 @@ var ts;
11002
11002
  Float64Array: ["at"],
11003
11003
  BigInt64Array: ["at"],
11004
11004
  BigUint64Array: ["at"],
11005
- ObjectConstructor: ["hasOwn"]
11005
+ ObjectConstructor: ["hasOwn"],
11006
+ Error: ["cause"]
11006
11007
  }
11007
11008
  };
11008
11009
  }
@@ -16525,9 +16526,19 @@ var ts;
16525
16526
  }
16526
16527
  ts.isFunctionExpressionOrArrowFunction = isFunctionExpressionOrArrowFunction;
16527
16528
  function escapeSnippetText(text) {
16528
- return text.replace(/\$/gm, "\\$");
16529
+ return text.replace(/\$/gm, function () { return "\\$"; });
16529
16530
  }
16530
16531
  ts.escapeSnippetText = escapeSnippetText;
16532
+ function isNumericLiteralName(name) {
16533
+ return (+name).toString() === name;
16534
+ }
16535
+ ts.isNumericLiteralName = isNumericLiteralName;
16536
+ function createPropertyNameNodeForIdentifierOrLiteral(name, target, singleQuote, stringNamed) {
16537
+ return ts.isIdentifierText(name, target) ? ts.factory.createIdentifier(name) :
16538
+ !stringNamed && isNumericLiteralName(name) && +name >= 0 ? ts.factory.createNumericLiteral(+name) :
16539
+ ts.factory.createStringLiteral(name, !!singleQuote);
16540
+ }
16541
+ ts.createPropertyNameNodeForIdentifierOrLiteral = createPropertyNameNodeForIdentifierOrLiteral;
16531
16542
  function isThisTypeParameter(type) {
16532
16543
  return !!(type.flags & 262144 && type.isThisType);
16533
16544
  }
@@ -17785,7 +17796,7 @@ var ts;
17785
17796
  result.push(createModifier(144));
17786
17797
  if (flags & 256)
17787
17798
  result.push(createModifier(131));
17788
- return result;
17799
+ return result.length ? result : undefined;
17789
17800
  }
17790
17801
  function createQualifiedName(left, right) {
17791
17802
  var node = createBaseNode(160);
@@ -21036,32 +21047,36 @@ var ts;
21036
21047
  }
21037
21048
  function updateModifiers(node, modifiers) {
21038
21049
  var _a;
21050
+ var modifierArray;
21039
21051
  if (typeof modifiers === "number") {
21040
- modifiers = createModifiersFromModifierFlags(modifiers);
21041
- }
21042
- return ts.isParameter(node) ? updateParameterDeclaration(node, node.decorators, modifiers, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) :
21043
- ts.isPropertySignature(node) ? updatePropertySignature(node, modifiers, node.name, node.questionToken, node.type) :
21044
- ts.isPropertyDeclaration(node) ? updatePropertyDeclaration(node, node.decorators, modifiers, node.name, (_a = node.questionToken) !== null && _a !== void 0 ? _a : node.exclamationToken, node.type, node.initializer) :
21045
- ts.isMethodSignature(node) ? updateMethodSignature(node, modifiers, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) :
21046
- ts.isMethodDeclaration(node) ? updateMethodDeclaration(node, node.decorators, modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) :
21047
- ts.isConstructorDeclaration(node) ? updateConstructorDeclaration(node, node.decorators, modifiers, node.parameters, node.body) :
21048
- ts.isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, node.decorators, modifiers, node.name, node.parameters, node.type, node.body) :
21049
- ts.isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, node.decorators, modifiers, node.name, node.parameters, node.body) :
21050
- ts.isIndexSignatureDeclaration(node) ? updateIndexSignature(node, node.decorators, modifiers, node.parameters, node.type) :
21051
- ts.isFunctionExpression(node) ? updateFunctionExpression(node, modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
21052
- ts.isArrowFunction(node) ? updateArrowFunction(node, modifiers, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) :
21053
- ts.isClassExpression(node) ? updateClassExpression(node, node.decorators, modifiers, node.name, node.typeParameters, node.heritageClauses, node.members) :
21054
- ts.isVariableStatement(node) ? updateVariableStatement(node, modifiers, node.declarationList) :
21055
- ts.isFunctionDeclaration(node) ? updateFunctionDeclaration(node, node.decorators, modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
21056
- ts.isClassDeclaration(node) ? updateClassDeclaration(node, node.decorators, modifiers, node.name, node.typeParameters, node.heritageClauses, node.members) :
21057
- ts.isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, node.decorators, modifiers, node.name, node.typeParameters, node.heritageClauses, node.members) :
21058
- ts.isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, node.decorators, modifiers, node.name, node.typeParameters, node.type) :
21059
- ts.isEnumDeclaration(node) ? updateEnumDeclaration(node, node.decorators, modifiers, node.name, node.members) :
21060
- ts.isModuleDeclaration(node) ? updateModuleDeclaration(node, node.decorators, modifiers, node.name, node.body) :
21061
- ts.isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, node.decorators, modifiers, node.isTypeOnly, node.name, node.moduleReference) :
21062
- ts.isImportDeclaration(node) ? updateImportDeclaration(node, node.decorators, modifiers, node.importClause, node.moduleSpecifier, node.assertClause) :
21063
- ts.isExportAssignment(node) ? updateExportAssignment(node, node.decorators, modifiers, node.expression) :
21064
- ts.isExportDeclaration(node) ? updateExportDeclaration(node, node.decorators, modifiers, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) :
21052
+ modifierArray = createModifiersFromModifierFlags(modifiers);
21053
+ }
21054
+ else {
21055
+ modifierArray = modifiers;
21056
+ }
21057
+ return ts.isParameter(node) ? updateParameterDeclaration(node, node.decorators, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) :
21058
+ ts.isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) :
21059
+ ts.isPropertyDeclaration(node) ? updatePropertyDeclaration(node, node.decorators, modifierArray, node.name, (_a = node.questionToken) !== null && _a !== void 0 ? _a : node.exclamationToken, node.type, node.initializer) :
21060
+ ts.isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) :
21061
+ ts.isMethodDeclaration(node) ? updateMethodDeclaration(node, node.decorators, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) :
21062
+ ts.isConstructorDeclaration(node) ? updateConstructorDeclaration(node, node.decorators, modifierArray, node.parameters, node.body) :
21063
+ ts.isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, node.decorators, modifierArray, node.name, node.parameters, node.type, node.body) :
21064
+ ts.isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, node.decorators, modifierArray, node.name, node.parameters, node.body) :
21065
+ ts.isIndexSignatureDeclaration(node) ? updateIndexSignature(node, node.decorators, modifierArray, node.parameters, node.type) :
21066
+ ts.isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
21067
+ ts.isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) :
21068
+ ts.isClassExpression(node) ? updateClassExpression(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
21069
+ ts.isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) :
21070
+ ts.isFunctionDeclaration(node) ? updateFunctionDeclaration(node, node.decorators, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
21071
+ ts.isClassDeclaration(node) ? updateClassDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
21072
+ ts.isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
21073
+ ts.isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.type) :
21074
+ ts.isEnumDeclaration(node) ? updateEnumDeclaration(node, node.decorators, modifierArray, node.name, node.members) :
21075
+ ts.isModuleDeclaration(node) ? updateModuleDeclaration(node, node.decorators, modifierArray, node.name, node.body) :
21076
+ ts.isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, node.decorators, modifierArray, node.isTypeOnly, node.name, node.moduleReference) :
21077
+ ts.isImportDeclaration(node) ? updateImportDeclaration(node, node.decorators, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) :
21078
+ ts.isExportAssignment(node) ? updateExportAssignment(node, node.decorators, modifierArray, node.expression) :
21079
+ ts.isExportDeclaration(node) ? updateExportDeclaration(node, node.decorators, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) :
21065
21080
  ts.Debug.assertNever(node);
21066
21081
  }
21067
21082
  function asNodeArray(array) {
@@ -38295,6 +38310,7 @@ var ts;
38295
38310
  var location = ts.getParseTreeNode(locationIn);
38296
38311
  return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType;
38297
38312
  },
38313
+ getTypeOfSymbol: getTypeOfSymbol,
38298
38314
  getSymbolsOfParameterPropertyDeclaration: function (parameterIn, parameterName) {
38299
38315
  var parameter = ts.getParseTreeNode(parameterIn, ts.isParameter);
38300
38316
  if (parameter === undefined)
@@ -43092,31 +43108,26 @@ var ts;
43092
43108
  }
43093
43109
  var rawName = ts.unescapeLeadingUnderscores(symbol.escapedName);
43094
43110
  var stringNamed = !!ts.length(symbol.declarations) && ts.every(symbol.declarations, isStringNamed);
43095
- return createPropertyNameNodeForIdentifierOrLiteral(rawName, stringNamed, singleQuote);
43111
+ return ts.createPropertyNameNodeForIdentifierOrLiteral(rawName, ts.getEmitScriptTarget(compilerOptions), singleQuote, stringNamed);
43096
43112
  }
43097
43113
  function getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote) {
43098
43114
  var nameType = getSymbolLinks(symbol).nameType;
43099
43115
  if (nameType) {
43100
43116
  if (nameType.flags & 384) {
43101
43117
  var name = "" + nameType.value;
43102
- if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
43118
+ if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
43103
43119
  return ts.factory.createStringLiteral(name, !!singleQuote);
43104
43120
  }
43105
- if (isNumericLiteralName(name) && ts.startsWith(name, "-")) {
43121
+ if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
43106
43122
  return ts.factory.createComputedPropertyName(ts.factory.createNumericLiteral(+name));
43107
43123
  }
43108
- return createPropertyNameNodeForIdentifierOrLiteral(name);
43124
+ return ts.createPropertyNameNodeForIdentifierOrLiteral(name, ts.getEmitScriptTarget(compilerOptions));
43109
43125
  }
43110
43126
  if (nameType.flags & 8192) {
43111
43127
  return ts.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, 111551));
43112
43128
  }
43113
43129
  }
43114
43130
  }
43115
- function createPropertyNameNodeForIdentifierOrLiteral(name, stringNamed, singleQuote) {
43116
- return ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) ? ts.factory.createIdentifier(name) :
43117
- !stringNamed && isNumericLiteralName(name) && +name >= 0 ? ts.factory.createNumericLiteral(+name) :
43118
- ts.factory.createStringLiteral(name, !!singleQuote);
43119
- }
43120
43131
  function cloneNodeBuilderContext(context) {
43121
43132
  var initial = __assign({}, context);
43122
43133
  if (initial.typeParameterNames) {
@@ -44312,10 +44323,10 @@ var ts;
44312
44323
  if (nameType) {
44313
44324
  if (nameType.flags & 384) {
44314
44325
  var name = "" + nameType.value;
44315
- if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
44326
+ if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
44316
44327
  return "\"" + ts.escapeString(name, 34) + "\"";
44317
44328
  }
44318
- if (isNumericLiteralName(name) && ts.startsWith(name, "-")) {
44329
+ if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
44319
44330
  return "[" + name + "]";
44320
44331
  }
44321
44332
  return name;
@@ -47813,7 +47824,7 @@ var ts;
47813
47824
  function isApplicableIndexType(source, target) {
47814
47825
  return isTypeAssignableTo(source, target) ||
47815
47826
  target === stringType && isTypeAssignableTo(source, numberType) ||
47816
- target === numberType && !!(source.flags & 128) && isNumericLiteralName(source.value);
47827
+ target === numberType && !!(source.flags & 128) && ts.isNumericLiteralName(source.value);
47817
47828
  }
47818
47829
  function getIndexInfosOfStructuredType(type) {
47819
47830
  if (type.flags & 3670016) {
@@ -50116,7 +50127,7 @@ var ts;
50116
50127
  getFlowTypeOfReference(accessExpression, propType) :
50117
50128
  propType;
50118
50129
  }
50119
- if (everyType(objectType, isTupleType) && isNumericLiteralName(propName) && +propName >= 0) {
50130
+ if (everyType(objectType, isTupleType) && ts.isNumericLiteralName(propName) && +propName >= 0) {
50120
50131
  if (accessNode && everyType(objectType, function (t) { return !t.target.hasRestElement; }) && !(accessFlags & 16)) {
50121
50132
  var indexNode = getIndexNodeForAccessExpression(accessNode);
50122
50133
  if (isTupleType(objectType)) {
@@ -50371,7 +50382,7 @@ var ts;
50371
50382
  return everyType(indexType, function (t) {
50372
50383
  if (t.flags & 384) {
50373
50384
  var propName = getPropertyNameFromType(t);
50374
- if (isNumericLiteralName(propName)) {
50385
+ if (ts.isNumericLiteralName(propName)) {
50375
50386
  var index = +propName;
50376
50387
  return index >= 0 && index < limit;
50377
50388
  }
@@ -53456,7 +53467,7 @@ var ts;
53456
53467
  }
53457
53468
  }
53458
53469
  else {
53459
- var distributiveConstraint = getConstraintOfDistributiveConditionalType(source);
53470
+ var distributiveConstraint = hasNonCircularBaseConstraint(source) ? getConstraintOfDistributiveConditionalType(source) : undefined;
53460
53471
  if (distributiveConstraint) {
53461
53472
  if (result = isRelatedTo(distributiveConstraint, target, 1, reportErrors)) {
53462
53473
  resetErrorInfo(saveErrorInfo);
@@ -53914,7 +53925,7 @@ var ts;
53914
53925
  for (var _b = 0, _c = excludeProperties(properties, excludedProperties); _b < _c.length; _b++) {
53915
53926
  var targetProp = _c[_b];
53916
53927
  var name = targetProp.escapedName;
53917
- if (!(targetProp.flags & 4194304) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length")) {
53928
+ if (!(targetProp.flags & 4194304) && (!numericNamesOnly || ts.isNumericLiteralName(name) || name === "length")) {
53918
53929
  var sourceProp = getPropertyOfType(source, name);
53919
53930
  if (sourceProp && sourceProp !== targetProp) {
53920
53931
  var related = propertyRelatedTo(source, target, sourceProp, targetProp, getNonMissingTypeOfSymbol, reportErrors, intersectionState, relation === comparableRelation);
@@ -53983,7 +53994,8 @@ var ts;
53983
53994
  var incompatibleReporter = kind === 1 ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
53984
53995
  var sourceObjectFlags = ts.getObjectFlags(source);
53985
53996
  var targetObjectFlags = ts.getObjectFlags(target);
53986
- if (sourceObjectFlags & 64 && targetObjectFlags & 64 && source.symbol === target.symbol) {
53997
+ if (sourceObjectFlags & 64 && targetObjectFlags & 64 && source.symbol === target.symbol ||
53998
+ sourceObjectFlags & 4 && targetObjectFlags & 4 && source.target === target.target) {
53987
53999
  for (var i = 0; i < targetSignatures.length; i++) {
53988
54000
  var related = signatureRelatedTo(sourceSignatures[i], targetSignatures[i], true, reportErrors, incompatibleReporter(sourceSignatures[i], targetSignatures[i]));
53989
54001
  if (!related) {
@@ -54864,9 +54876,12 @@ var ts;
54864
54876
  && ((target.flags & (8 | 4 | 16)) !== 0);
54865
54877
  }
54866
54878
  function isObjectTypeWithInferableIndex(type) {
54867
- return type.flags & 2097152 ? ts.every(type.types, isObjectTypeWithInferableIndex) :
54868
- !!(type.symbol && (type.symbol.flags & (4096 | 2048 | 384 | 512)) !== 0 &&
54869
- !typeHasCallOrConstructSignatures(type)) || !!(ts.getObjectFlags(type) & 1024 && isObjectTypeWithInferableIndex(type.source));
54879
+ return type.flags & 2097152
54880
+ ? ts.every(type.types, isObjectTypeWithInferableIndex)
54881
+ : !!(type.symbol
54882
+ && (type.symbol.flags & (4096 | 2048 | 384 | 512)) !== 0
54883
+ && !(type.symbol.flags & 32)
54884
+ && !typeHasCallOrConstructSignatures(type)) || !!(ts.getObjectFlags(type) & 1024 && isObjectTypeWithInferableIndex(type.source));
54870
54885
  }
54871
54886
  function createSymbolWithType(source, type) {
54872
54887
  var symbol = createSymbol(source.flags, source.escapedName, ts.getCheckFlags(source) & 8);
@@ -56269,7 +56284,8 @@ var ts;
56269
56284
  return access.kind === 205 ? access.name.escapedText :
56270
56285
  access.kind === 206 && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
56271
56286
  access.kind === 202 && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
56272
- undefined;
56287
+ access.kind === 163 ? ("" + access.parent.parameters.indexOf(access)) :
56288
+ undefined;
56273
56289
  }
56274
56290
  function containsMatchingReference(source, target) {
56275
56291
  while (ts.isAccessExpression(source)) {
@@ -57470,11 +57486,11 @@ var ts;
57470
57486
  return result;
57471
57487
  }
57472
57488
  function getCandidateDiscriminantPropertyAccess(expr) {
57473
- if (ts.isBindingPattern(reference)) {
57489
+ if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference)) {
57474
57490
  if (ts.isIdentifier(expr)) {
57475
57491
  var symbol = getResolvedSymbol(expr);
57476
57492
  var declaration = symbol.valueDeclaration;
57477
- if (declaration && ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && reference === declaration.parent) {
57493
+ if (declaration && (ts.isBindingElement(declaration) || ts.isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
57478
57494
  return declaration;
57479
57495
  }
57480
57496
  }
@@ -58159,18 +58175,34 @@ var ts;
58159
58175
  }
58160
58176
  function getNarrowedTypeOfSymbol(symbol, location) {
58161
58177
  var declaration = symbol.valueDeclaration;
58162
- if (declaration && ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
58163
- var parent = declaration.parent.parent;
58164
- if (parent.kind === 253 && ts.getCombinedNodeFlags(declaration) & 2 || parent.kind === 163) {
58165
- var links = getNodeLinks(location);
58166
- if (!(links.flags & 268435456)) {
58167
- links.flags |= 268435456;
58168
- var parentType = getTypeForBindingElementParent(parent);
58169
- links.flags &= ~268435456;
58170
- if (parentType && parentType.flags & 1048576 && !(parent.kind === 163 && isSymbolAssigned(symbol))) {
58171
- var pattern = declaration.parent;
58172
- var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, undefined, location.flowNode);
58173
- return getBindingElementTypeFromParentType(declaration, narrowedType);
58178
+ if (declaration) {
58179
+ if (ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
58180
+ var parent = declaration.parent.parent;
58181
+ if (parent.kind === 253 && ts.getCombinedNodeFlags(declaration) & 2 || parent.kind === 163) {
58182
+ var links = getNodeLinks(location);
58183
+ if (!(links.flags & 268435456)) {
58184
+ links.flags |= 268435456;
58185
+ var parentType = getTypeForBindingElementParent(parent);
58186
+ links.flags &= ~268435456;
58187
+ if (parentType && parentType.flags & 1048576 && !(parent.kind === 163 && isSymbolAssigned(symbol))) {
58188
+ var pattern = declaration.parent;
58189
+ var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, undefined, location.flowNode);
58190
+ return getBindingElementTypeFromParentType(declaration, narrowedType);
58191
+ }
58192
+ }
58193
+ }
58194
+ }
58195
+ if (ts.isParameter(declaration) && !declaration.type && !declaration.initializer && !declaration.dotDotDotToken) {
58196
+ var func = declaration.parent;
58197
+ if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
58198
+ var contextualSignature = getContextualSignature(func);
58199
+ if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
58200
+ var restType = getTypeOfSymbol(contextualSignature.parameters[0]);
58201
+ if (restType.flags & 1048576 && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
58202
+ var narrowedType = getFlowTypeOfReference(func, restType, restType, undefined, location.flowNode);
58203
+ var index = func.parameters.indexOf(declaration) - (ts.getThisParameter(func) ? 1 : 0);
58204
+ return getIndexedAccessType(narrowedType, getNumberLiteralType(index));
58205
+ }
58174
58206
  }
58175
58207
  }
58176
58208
  }
@@ -59116,7 +59148,7 @@ var ts;
59116
59148
  }
59117
59149
  if (isTupleType(t)) {
59118
59150
  var restType = getRestTypeOfTupleType(t);
59119
- if (restType && isNumericLiteralName(name) && +name >= 0) {
59151
+ if (restType && ts.isNumericLiteralName(name) && +name >= 0) {
59120
59152
  return restType;
59121
59153
  }
59122
59154
  }
@@ -59659,10 +59691,10 @@ var ts;
59659
59691
  case 161:
59660
59692
  return isNumericComputedName(name);
59661
59693
  case 79:
59662
- return isNumericLiteralName(name.escapedText);
59694
+ return ts.isNumericLiteralName(name.escapedText);
59663
59695
  case 8:
59664
59696
  case 10:
59665
- return isNumericLiteralName(name.text);
59697
+ return ts.isNumericLiteralName(name.text);
59666
59698
  default:
59667
59699
  return false;
59668
59700
  }
@@ -59670,9 +59702,6 @@ var ts;
59670
59702
  function isNumericComputedName(name) {
59671
59703
  return isTypeAssignableToKind(checkComputedPropertyName(name), 296);
59672
59704
  }
59673
- function isNumericLiteralName(name) {
59674
- return (+name).toString() === name;
59675
- }
59676
59705
  function checkComputedPropertyName(node) {
59677
59706
  var links = getNodeLinks(node.expression);
59678
59707
  if (!links.resolvedType) {
@@ -59701,7 +59730,7 @@ var ts;
59701
59730
  function isSymbolWithNumericName(symbol) {
59702
59731
  var _a;
59703
59732
  var firstDecl = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a[0];
59704
- return isNumericLiteralName(symbol.escapedName) || (firstDecl && ts.isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name));
59733
+ return ts.isNumericLiteralName(symbol.escapedName) || (firstDecl && ts.isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name));
59705
59734
  }
59706
59735
  function isSymbolWithSymbolName(symbol) {
59707
59736
  var _a;
@@ -69014,7 +69043,7 @@ var ts;
69014
69043
  }
69015
69044
  else {
69016
69045
  var text = ts.getTextOfPropertyName(member.name);
69017
- if (isNumericLiteralName(text) && !ts.isInfinityOrNaNString(text)) {
69046
+ if (ts.isNumericLiteralName(text) && !ts.isInfinityOrNaNString(text)) {
69018
69047
  error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name);
69019
69048
  }
69020
69049
  }
@@ -89528,7 +89557,7 @@ var ts;
89528
89557
  emitPlaceholder(hint, node, snippet);
89529
89558
  break;
89530
89559
  case 0:
89531
- emitTabStop(snippet);
89560
+ emitTabStop(hint, node, snippet);
89532
89561
  break;
89533
89562
  }
89534
89563
  }
@@ -89537,7 +89566,9 @@ var ts;
89537
89566
  pipelineEmitWithHintWorker(hint, node, false);
89538
89567
  nonEscapingWrite("}");
89539
89568
  }
89540
- function emitTabStop(snippet) {
89569
+ function emitTabStop(hint, node, snippet) {
89570
+ ts.Debug.assert(node.kind === 235, "A tab stop cannot be attached to a node of kind " + ts.Debug.formatSyntaxKind(node.kind) + ".");
89571
+ ts.Debug.assert(hint !== 5, "A tab stop cannot be attached to an embedded statement.");
89541
89572
  nonEscapingWrite("$" + snippet.order);
89542
89573
  }
89543
89574
  function emitIdentifier(node) {
@@ -99128,7 +99159,7 @@ var ts;
99128
99159
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
99129
99160
  }
99130
99161
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
99131
- function getErrorSummaryText(errorCount, filesInError, newLine) {
99162
+ function getErrorSummaryText(errorCount, filesInError, newLine, host) {
99132
99163
  if (errorCount === 0)
99133
99164
  return "";
99134
99165
  var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
@@ -99143,10 +99174,10 @@ var ts;
99143
99174
  distinctFileNamesWithLines.length === 1 ?
99144
99175
  ts.Diagnostics.Found_0_errors_in_1_file :
99145
99176
  ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
99146
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
99177
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "");
99147
99178
  }
99148
99179
  ts.getErrorSummaryText = getErrorSummaryText;
99149
- function createTabularErrorsDisplay(filesInError) {
99180
+ function createTabularErrorsDisplay(filesInError, host) {
99150
99181
  var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
99151
99182
  if (distinctFiles.length === 0)
99152
99183
  return "";
@@ -99165,7 +99196,8 @@ var ts;
99165
99196
  var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
99166
99197
  " ".repeat(leftPaddingGoal - errorCountDigitsLength)
99167
99198
  : "";
99168
- tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
99199
+ var relativePath = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), file.fileName, false);
99200
+ tabularData += "" + leftPadding + errorCount + " " + relativePath + ":" + file.line + "\n";
99169
99201
  });
99170
99202
  return tabularData;
99171
99203
  }
@@ -99547,7 +99579,7 @@ var ts;
99547
99579
  var system = input.system || ts.sys;
99548
99580
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
99549
99581
  var builderProgram = ts.createIncrementalProgram(input);
99550
- var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
99582
+ var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine, host)); } : undefined);
99551
99583
  if (input.afterProgramEmitAndDiagnostics)
99552
99584
  input.afterProgramEmitAndDiagnostics(builderProgram);
99553
99585
  return exitStatus;
@@ -102257,7 +102289,7 @@ var ts;
102257
102289
  }
102258
102290
  function createReportErrorSummary(sys, options) {
102259
102291
  return shouldBePretty(sys, options) ?
102260
- function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine)); } :
102292
+ function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine, sys)); } :
102261
102293
  undefined;
102262
102294
  }
102263
102295
  function performCompilation(sys, cb, reportDiagnostic, config) {