typescript 4.9.0-dev.20220822 → 4.9.0-dev.20220825

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.
@@ -99,7 +99,7 @@ var ts;
99
99
  // The following is baselined as a literal template type without intervention
100
100
  /** The version of the TypeScript compiler release */
101
101
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
102
- ts.version = ts.versionMajorMinor + ".0-dev.20220822";
102
+ ts.version = ts.versionMajorMinor + ".0-dev.20220825";
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -120,7 +120,7 @@ var ts;
120
120
  function tryGetNativeMap() {
121
121
  // Internet Explorer's Map doesn't support iteration, so don't use it.
122
122
  var gMap = globals === null || globals === void 0 ? void 0 : globals.Map;
123
- // eslint-disable-next-line no-in-operator
123
+ // eslint-disable-next-line local/no-in-operator
124
124
  var constructor = typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
125
125
  if (!constructor) {
126
126
  throw new Error("No compatible Map implementation found.");
@@ -134,7 +134,7 @@ var ts;
134
134
  function tryGetNativeSet() {
135
135
  // Internet Explorer's Set doesn't support iteration, so don't use it.
136
136
  var gSet = globals === null || globals === void 0 ? void 0 : globals.Set;
137
- // eslint-disable-next-line no-in-operator
137
+ // eslint-disable-next-line local/no-in-operator
138
138
  var constructor = typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
139
139
  if (!constructor) {
140
140
  throw new Error("No compatible Set implementation found.");
@@ -2833,7 +2833,7 @@ var ts;
2833
2833
  Debug.formatControlFlowGraph = formatControlFlowGraph;
2834
2834
  var flowNodeProto;
2835
2835
  function attachFlowNodeDebugInfoWorker(flowNode) {
2836
- if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line no-in-operator
2836
+ if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line local/no-in-operator
2837
2837
  Object.defineProperties(flowNode, {
2838
2838
  // for use with vscode-js-debug's new customDescriptionGenerator in launch.json
2839
2839
  __tsDebuggerDisplay: {
@@ -2879,7 +2879,7 @@ var ts;
2879
2879
  Debug.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo;
2880
2880
  var nodeArrayProto;
2881
2881
  function attachNodeArrayDebugInfoWorker(array) {
2882
- if (!("__tsDebuggerDisplay" in array)) { // eslint-disable-line no-in-operator
2882
+ if (!("__tsDebuggerDisplay" in array)) { // eslint-disable-line local/no-in-operator
2883
2883
  Object.defineProperties(array, {
2884
2884
  __tsDebuggerDisplay: {
2885
2885
  value: function (defaultValue) {
@@ -4831,6 +4831,7 @@ var ts;
4831
4831
  NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple";
4832
4832
  NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType";
4833
4833
  NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType";
4834
+ /* @internal */ NodeBuilderFlags[NodeBuilderFlags["WriteComputedProps"] = 1073741824] = "WriteComputedProps";
4834
4835
  // Errors (cont.)
4835
4836
  NodeBuilderFlags[NodeBuilderFlags["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths";
4836
4837
  /* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain";
@@ -4891,8 +4892,10 @@ var ts;
4891
4892
  SymbolFormatFlags[SymbolFormatFlags["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind";
4892
4893
  // Prefer aliases which are not directly visible
4893
4894
  SymbolFormatFlags[SymbolFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope";
4895
+ // { [E.A]: 1 }
4896
+ /* @internal */ SymbolFormatFlags[SymbolFormatFlags["WriteComputedProps"] = 16] = "WriteComputedProps";
4894
4897
  // Skip building an accessible symbol chain
4895
- /* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] = 16] = "DoNotIncludeSymbolChain";
4898
+ /* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] = 32] = "DoNotIncludeSymbolChain";
4896
4899
  })(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {}));
4897
4900
  /* @internal */
4898
4901
  var SymbolAccessibility;
@@ -30534,17 +30537,6 @@ var ts;
30534
30537
  || kind === 173 /* SetAccessor */;
30535
30538
  }
30536
30539
  ts.canHaveIllegalTypeParameters = canHaveIllegalTypeParameters;
30537
- function canHaveDecorators(node) {
30538
- var kind = node.kind;
30539
- return kind === 164 /* Parameter */
30540
- || kind === 167 /* PropertyDeclaration */
30541
- || kind === 169 /* MethodDeclaration */
30542
- || kind === 172 /* GetAccessor */
30543
- || kind === 173 /* SetAccessor */
30544
- || kind === 226 /* ClassExpression */
30545
- || kind === 257 /* ClassDeclaration */;
30546
- }
30547
- ts.canHaveDecorators = canHaveDecorators;
30548
30540
  function canHaveIllegalDecorators(node) {
30549
30541
  var kind = node.kind;
30550
30542
  return kind === 296 /* PropertyAssignment */
@@ -30566,35 +30558,6 @@ var ts;
30566
30558
  || kind === 271 /* ExportAssignment */;
30567
30559
  }
30568
30560
  ts.canHaveIllegalDecorators = canHaveIllegalDecorators;
30569
- function canHaveModifiers(node) {
30570
- var kind = node.kind;
30571
- return kind === 163 /* TypeParameter */
30572
- || kind === 164 /* Parameter */
30573
- || kind === 166 /* PropertySignature */
30574
- || kind === 167 /* PropertyDeclaration */
30575
- || kind === 168 /* MethodSignature */
30576
- || kind === 169 /* MethodDeclaration */
30577
- || kind === 171 /* Constructor */
30578
- || kind === 172 /* GetAccessor */
30579
- || kind === 173 /* SetAccessor */
30580
- || kind === 176 /* IndexSignature */
30581
- || kind === 180 /* ConstructorType */
30582
- || kind === 213 /* FunctionExpression */
30583
- || kind === 214 /* ArrowFunction */
30584
- || kind === 226 /* ClassExpression */
30585
- || kind === 237 /* VariableStatement */
30586
- || kind === 256 /* FunctionDeclaration */
30587
- || kind === 257 /* ClassDeclaration */
30588
- || kind === 258 /* InterfaceDeclaration */
30589
- || kind === 259 /* TypeAliasDeclaration */
30590
- || kind === 260 /* EnumDeclaration */
30591
- || kind === 261 /* ModuleDeclaration */
30592
- || kind === 265 /* ImportEqualsDeclaration */
30593
- || kind === 266 /* ImportDeclaration */
30594
- || kind === 271 /* ExportAssignment */
30595
- || kind === 272 /* ExportDeclaration */;
30596
- }
30597
- ts.canHaveModifiers = canHaveModifiers;
30598
30561
  function canHaveIllegalModifiers(node) {
30599
30562
  var kind = node.kind;
30600
30563
  return kind === 170 /* ClassStaticBlockDeclaration */
@@ -30883,6 +30846,46 @@ var ts;
30883
30846
  return location ? ts.setTextRangePosEnd(range, location.pos, location.end) : range;
30884
30847
  }
30885
30848
  ts.setTextRange = setTextRange;
30849
+ function canHaveModifiers(node) {
30850
+ var kind = node.kind;
30851
+ return kind === 163 /* TypeParameter */
30852
+ || kind === 164 /* Parameter */
30853
+ || kind === 166 /* PropertySignature */
30854
+ || kind === 167 /* PropertyDeclaration */
30855
+ || kind === 168 /* MethodSignature */
30856
+ || kind === 169 /* MethodDeclaration */
30857
+ || kind === 171 /* Constructor */
30858
+ || kind === 172 /* GetAccessor */
30859
+ || kind === 173 /* SetAccessor */
30860
+ || kind === 176 /* IndexSignature */
30861
+ || kind === 180 /* ConstructorType */
30862
+ || kind === 213 /* FunctionExpression */
30863
+ || kind === 214 /* ArrowFunction */
30864
+ || kind === 226 /* ClassExpression */
30865
+ || kind === 237 /* VariableStatement */
30866
+ || kind === 256 /* FunctionDeclaration */
30867
+ || kind === 257 /* ClassDeclaration */
30868
+ || kind === 258 /* InterfaceDeclaration */
30869
+ || kind === 259 /* TypeAliasDeclaration */
30870
+ || kind === 260 /* EnumDeclaration */
30871
+ || kind === 261 /* ModuleDeclaration */
30872
+ || kind === 265 /* ImportEqualsDeclaration */
30873
+ || kind === 266 /* ImportDeclaration */
30874
+ || kind === 271 /* ExportAssignment */
30875
+ || kind === 272 /* ExportDeclaration */;
30876
+ }
30877
+ ts.canHaveModifiers = canHaveModifiers;
30878
+ function canHaveDecorators(node) {
30879
+ var kind = node.kind;
30880
+ return kind === 164 /* Parameter */
30881
+ || kind === 167 /* PropertyDeclaration */
30882
+ || kind === 169 /* MethodDeclaration */
30883
+ || kind === 172 /* GetAccessor */
30884
+ || kind === 173 /* SetAccessor */
30885
+ || kind === 226 /* ClassExpression */
30886
+ || kind === 257 /* ClassDeclaration */;
30887
+ }
30888
+ ts.canHaveDecorators = canHaveDecorators;
30886
30889
  })(ts || (ts = {}));
30887
30890
  var ts;
30888
30891
  (function (ts) {
@@ -49050,6 +49053,7 @@ var ts;
49050
49053
  signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,
49051
49054
  symbolToEntityName: nodeBuilder.symbolToEntityName,
49052
49055
  symbolToExpression: nodeBuilder.symbolToExpression,
49056
+ symbolToNode: nodeBuilder.symbolToNode,
49053
49057
  symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations,
49054
49058
  symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration,
49055
49059
  typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration,
@@ -49719,10 +49723,10 @@ var ts;
49719
49723
  }
49720
49724
  // Issue errors globally
49721
49725
  var file = ts.getSourceFileOfNode(location);
49722
- addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message)); // eslint-disable-line no-in-operator
49726
+ addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message)); // eslint-disable-line local/no-in-operator
49723
49727
  return;
49724
49728
  }
49725
- addErrorOrSuggestion(isError, "message" in message ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForNodeFromMessageChain(location, message)); // eslint-disable-line no-in-operator
49729
+ addErrorOrSuggestion(isError, "message" in message ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForNodeFromMessageChain(location, message)); // eslint-disable-line local/no-in-operator
49726
49730
  }
49727
49731
  function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) {
49728
49732
  var diagnostic = error(location, message, arg0, arg1, arg2, arg3);
@@ -51705,7 +51709,7 @@ var ts;
51705
51709
  }
51706
51710
  }
51707
51711
  function getFullyQualifiedName(symbol, containingLocation) {
51708
- return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined, 16 /* DoNotIncludeSymbolChain */ | 4 /* AllowAnyNodeKind */);
51712
+ return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined, 32 /* DoNotIncludeSymbolChain */ | 4 /* AllowAnyNodeKind */);
51709
51713
  }
51710
51714
  function getContainingQualifiedNameNode(node) {
51711
51715
  while (ts.isQualifiedName(node.parent)) {
@@ -53020,10 +53024,13 @@ var ts;
53020
53024
  if (flags & 8 /* UseAliasDefinedOutsideCurrentScope */) {
53021
53025
  nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */;
53022
53026
  }
53023
- if (flags & 16 /* DoNotIncludeSymbolChain */) {
53027
+ if (flags & 32 /* DoNotIncludeSymbolChain */) {
53024
53028
  nodeFlags |= 134217728 /* DoNotIncludeSymbolChain */;
53025
53029
  }
53026
- var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName;
53030
+ if (flags & 16 /* WriteComputedProps */) {
53031
+ nodeFlags |= 1073741824 /* WriteComputedProps */;
53032
+ }
53033
+ var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToNode : nodeBuilder.symbolToEntityName;
53027
53034
  return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker);
53028
53035
  function symbolToStringWorker(writer) {
53029
53036
  var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217
@@ -53123,7 +53130,25 @@ var ts;
53123
53130
  symbolTableToDeclarationStatements: function (symbolTable, enclosingDeclaration, flags, tracker, bundled) {
53124
53131
  return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolTableToDeclarationStatements(symbolTable, context, bundled); });
53125
53132
  },
53133
+ symbolToNode: function (symbol, meaning, enclosingDeclaration, flags, tracker) {
53134
+ return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToNode(symbol, context, meaning); });
53135
+ },
53126
53136
  };
53137
+ function symbolToNode(symbol, context, meaning) {
53138
+ if (context.flags & 1073741824 /* WriteComputedProps */) {
53139
+ if (symbol.valueDeclaration) {
53140
+ var name = ts.getNameOfDeclaration(symbol.valueDeclaration);
53141
+ if (name && ts.isComputedPropertyName(name))
53142
+ return name;
53143
+ }
53144
+ var nameType = getSymbolLinks(symbol).nameType;
53145
+ if (nameType && nameType.flags & (1024 /* EnumLiteral */ | 8192 /* UniqueESSymbol */)) {
53146
+ context.enclosingDeclaration = nameType.symbol.valueDeclaration;
53147
+ return ts.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, meaning));
53148
+ }
53149
+ }
53150
+ return symbolToExpression(symbol, context, meaning);
53151
+ }
53127
53152
  function withContext(enclosingDeclaration, flags, tracker, cb) {
53128
53153
  var _a, _b;
53129
53154
  ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0);
@@ -65927,7 +65952,7 @@ var ts;
65927
65952
  return 0 /* False */;
65928
65953
  }
65929
65954
  }
65930
- var isPerformingCommonPropertyChecks = (relation !== comparableRelation || relation === comparableRelation && isLiteralType(source)) &&
65955
+ var isPerformingCommonPropertyChecks = (relation !== comparableRelation || !(source.flags & 1048576 /* Union */) && isLiteralType(source)) &&
65931
65956
  !(intersectionState & 2 /* Target */) &&
65932
65957
  source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
65933
65958
  target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
@@ -67306,7 +67331,7 @@ var ts;
67306
67331
  shouldSkipElaboration = true; // Retain top-level error for interface implementing issues, otherwise omit it
67307
67332
  }
67308
67333
  if (props.length === 1) {
67309
- var propName = symbolToString(unmatchedProperty);
67334
+ var propName = symbolToString(unmatchedProperty, /*enclosingDeclaration*/ undefined, 0 /* None */, 4 /* AllowAnyNodeKind */ | 16 /* WriteComputedProps */);
67310
67335
  reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target), false));
67311
67336
  if (ts.length(unmatchedProperty.declarations)) {
67312
67337
  associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
@@ -91349,7 +91374,7 @@ var ts;
91349
91374
  exit();
91350
91375
  return sourceIndex;
91351
91376
  }
91352
- /* eslint-disable boolean-trivia, no-null/no-null */
91377
+ /* eslint-disable local/boolean-trivia, no-null/no-null */
91353
91378
  function setSourceContent(sourceIndex, content) {
91354
91379
  enter();
91355
91380
  if (content !== null) {
@@ -91362,7 +91387,7 @@ var ts;
91362
91387
  }
91363
91388
  exit();
91364
91389
  }
91365
- /* eslint-enable boolean-trivia, no-null/no-null */
91390
+ /* eslint-enable local/boolean-trivia, no-null/no-null */
91366
91391
  function addName(name) {
91367
91392
  enter();
91368
91393
  if (!nameToNameIndexMap)
@@ -133037,7 +133062,7 @@ var ts;
133037
133062
  // defined in `ts.commentPragmas` would be excessive, but we can avoid
133038
133063
  // some obvious false positives (e.g. in XML-like doc comments) by
133039
133064
  // checking the element name.
133040
- // eslint-disable-next-line no-in-operator
133065
+ // eslint-disable-next-line local/no-in-operator
133041
133066
  if (!match[3] || !(match[3] in ts.commentPragmas)) {
133042
133067
  return false;
133043
133068
  }
@@ -133739,7 +133764,7 @@ var ts;
133739
133764
  // Get string literal completions from specialized signatures of the target
133740
133765
  // i.e. declare function f(a: 'A');
133741
133766
  // f("/*completion position*/")
133742
- return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) : fromContextualType();
133767
+ return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType();
133743
133768
  }
133744
133769
  // falls through (is `require("")` or `require(""` or `import("")`)
133745
133770
  case 266 /* ImportDeclaration */:
@@ -133795,7 +133820,7 @@ var ts;
133795
133820
  isNewIdentifier = isNewIdentifier || !!(type.flags & 4 /* String */);
133796
133821
  return getStringLiteralTypes(type, uniques);
133797
133822
  });
133798
- return { kind: 2 /* Types */, types: types, isNewIdentifier: isNewIdentifier };
133823
+ return ts.length(types) ? { kind: 2 /* Types */, types: types, isNewIdentifier: isNewIdentifier } : undefined;
133799
133824
  }
133800
133825
  function stringLiteralCompletionsFromProperties(type) {
133801
133826
  return type && {
@@ -140734,7 +140759,7 @@ var ts;
140734
140759
  }
140735
140760
  }
140736
140761
  function addReference(referenceLocation, relatedSymbol, state) {
140737
- var _a = "kind" in relatedSymbol ? relatedSymbol : { kind: undefined, symbol: relatedSymbol }, kind = _a.kind, symbol = _a.symbol; // eslint-disable-line no-in-operator
140762
+ var _a = "kind" in relatedSymbol ? relatedSymbol : { kind: undefined, symbol: relatedSymbol }, kind = _a.kind, symbol = _a.symbol; // eslint-disable-line local/no-in-operator
140738
140763
  // if rename symbol from default export anonymous function, for example `export default function() {}`, we do not need to add reference
140739
140764
  if (state.options.use === 2 /* Rename */ && referenceLocation.kind === 88 /* DefaultKeyword */) {
140740
140765
  return;
@@ -146520,11 +146545,11 @@ var ts;
146520
146545
  // not enough to put us in the substitution expression; we should consider ourselves part of
146521
146546
  // the *next* span's expression by offsetting the index (argIndex = (spanIndex + 1) + 1).
146522
146547
  //
146523
- /* eslint-disable no-double-space */
146548
+ /* eslint-disable local/no-double-space */
146524
146549
  // Example: f `# abcd $#{# 1 + 1# }# efghi ${ #"#hello"# } # `
146525
146550
  // ^ ^ ^ ^ ^ ^ ^ ^ ^
146526
146551
  // Case: 1 1 3 2 1 3 2 2 1
146527
- /* eslint-enable no-double-space */
146552
+ /* eslint-enable local/no-double-space */
146528
146553
  ts.Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node.");
146529
146554
  if (ts.isTemplateLiteralToken(node)) {
146530
146555
  if (ts.isInsideTemplateLiteral(node, position, sourceFile)) {
@@ -154545,7 +154570,7 @@ var ts;
154545
154570
  name = getMapEntryOrDefault(funcNode.name);
154546
154571
  }
154547
154572
  // return undefined argName when arg is null or undefined
154548
- // eslint-disable-next-line no-in-operator
154573
+ // eslint-disable-next-line local/no-in-operator
154549
154574
  if (!name || "identifier" in name && name.identifier.text === "undefined") {
154550
154575
  return undefined;
154551
154576
  }
@@ -157813,11 +157838,10 @@ var ts;
157813
157838
  return declaration && declaration.parent === node ? declaration : undefined;
157814
157839
  }
157815
157840
  function createPropertyNameFromSymbol(symbol, target, quotePreference, checker) {
157816
- if (ts.isTransientSymbol(symbol) && symbol.nameType && symbol.nameType.flags & 8192 /* UniqueESSymbol */) {
157817
- var expression = checker.symbolToExpression(symbol.nameType.symbol, 111551 /* Value */, symbol.valueDeclaration, 1048576 /* AllowUniqueESSymbolType */);
157818
- if (expression) {
157819
- return ts.factory.createComputedPropertyName(expression);
157820
- }
157841
+ if (ts.isTransientSymbol(symbol)) {
157842
+ var prop = checker.symbolToNode(symbol, 111551 /* Value */, /*enclosingDeclaration*/ undefined, 1073741824 /* WriteComputedProps */);
157843
+ if (prop && ts.isComputedPropertyName(prop))
157844
+ return prop;
157821
157845
  }
157822
157846
  return ts.createPropertyNameNodeForIdentifierOrLiteral(symbol.name, target, quotePreference === 0 /* Single */);
157823
157847
  }
@@ -166731,7 +166755,7 @@ var ts;
166731
166755
  this.kind = kind;
166732
166756
  }
166733
166757
  NodeObject.prototype.assertHasRealPosition = function (message) {
166734
- // eslint-disable-next-line debug-assert
166758
+ // eslint-disable-next-line local/debug-assert
166735
166759
  ts.Debug.assert(!ts.positionIsSynthesized(this.pos) && !ts.positionIsSynthesized(this.end), message || "Node must have a real position for this operation");
166736
166760
  };
166737
166761
  NodeObject.prototype.getSourceFile = function () {
@@ -169775,7 +169799,7 @@ var debugObjectHost = (function () {
169775
169799
  return this;
169776
169800
  })();
169777
169801
  // We need to use 'null' to interface with the managed side.
169778
- /* eslint-disable no-in-operator */
169802
+ /* eslint-disable local/no-in-operator */
169779
169803
  /* @internal */
169780
169804
  var ts;
169781
169805
  (function (ts) {
@@ -170575,7 +170599,7 @@ var ts;
170575
170599
  }());
170576
170600
  ts.TypeScriptServicesFactory = TypeScriptServicesFactory;
170577
170601
  })(ts || (ts = {}));
170578
- /* eslint-enable no-in-operator */
170602
+ /* eslint-enable local/no-in-operator */
170579
170603
  // We polyfill `globalThis` here so re can reliably patch the global scope
170580
170604
  // in the contexts we want to in the same way across script and module formats
170581
170605
  /* eslint-enable no-var */
@@ -171345,7 +171369,7 @@ var ts;
171345
171369
  if (typeof value === "number") {
171346
171370
  return ts.factory.createNumericLiteral(value);
171347
171371
  }
171348
- // eslint-disable-next-line no-in-operator
171372
+ // eslint-disable-next-line local/no-in-operator
171349
171373
  if (typeof value === "object" && "base10Value" in value) { // PseudoBigInt
171350
171374
  return ts.factory.createBigIntLiteral(value);
171351
171375
  }
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-dev.20220822";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20220825";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -110,7 +110,7 @@ var ts;
110
110
  function tryGetNativeMap() {
111
111
  // Internet Explorer's Map doesn't support iteration, so don't use it.
112
112
  var gMap = globals === null || globals === void 0 ? void 0 : globals.Map;
113
- // eslint-disable-next-line no-in-operator
113
+ // eslint-disable-next-line local/no-in-operator
114
114
  var constructor = typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
115
115
  if (!constructor) {
116
116
  throw new Error("No compatible Map implementation found.");
@@ -124,7 +124,7 @@ var ts;
124
124
  function tryGetNativeSet() {
125
125
  // Internet Explorer's Set doesn't support iteration, so don't use it.
126
126
  var gSet = globals === null || globals === void 0 ? void 0 : globals.Set;
127
- // eslint-disable-next-line no-in-operator
127
+ // eslint-disable-next-line local/no-in-operator
128
128
  var constructor = typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
129
129
  if (!constructor) {
130
130
  throw new Error("No compatible Set implementation found.");
@@ -2823,7 +2823,7 @@ var ts;
2823
2823
  Debug.formatControlFlowGraph = formatControlFlowGraph;
2824
2824
  var flowNodeProto;
2825
2825
  function attachFlowNodeDebugInfoWorker(flowNode) {
2826
- if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line no-in-operator
2826
+ if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line local/no-in-operator
2827
2827
  Object.defineProperties(flowNode, {
2828
2828
  // for use with vscode-js-debug's new customDescriptionGenerator in launch.json
2829
2829
  __tsDebuggerDisplay: {
@@ -2869,7 +2869,7 @@ var ts;
2869
2869
  Debug.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo;
2870
2870
  var nodeArrayProto;
2871
2871
  function attachNodeArrayDebugInfoWorker(array) {
2872
- if (!("__tsDebuggerDisplay" in array)) { // eslint-disable-line no-in-operator
2872
+ if (!("__tsDebuggerDisplay" in array)) { // eslint-disable-line local/no-in-operator
2873
2873
  Object.defineProperties(array, {
2874
2874
  __tsDebuggerDisplay: {
2875
2875
  value: function (defaultValue) {
@@ -4821,6 +4821,7 @@ var ts;
4821
4821
  NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple";
4822
4822
  NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType";
4823
4823
  NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType";
4824
+ /* @internal */ NodeBuilderFlags[NodeBuilderFlags["WriteComputedProps"] = 1073741824] = "WriteComputedProps";
4824
4825
  // Errors (cont.)
4825
4826
  NodeBuilderFlags[NodeBuilderFlags["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths";
4826
4827
  /* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain";
@@ -4881,8 +4882,10 @@ var ts;
4881
4882
  SymbolFormatFlags[SymbolFormatFlags["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind";
4882
4883
  // Prefer aliases which are not directly visible
4883
4884
  SymbolFormatFlags[SymbolFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope";
4885
+ // { [E.A]: 1 }
4886
+ /* @internal */ SymbolFormatFlags[SymbolFormatFlags["WriteComputedProps"] = 16] = "WriteComputedProps";
4884
4887
  // Skip building an accessible symbol chain
4885
- /* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] = 16] = "DoNotIncludeSymbolChain";
4888
+ /* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] = 32] = "DoNotIncludeSymbolChain";
4886
4889
  })(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {}));
4887
4890
  /* @internal */
4888
4891
  var SymbolAccessibility;
@@ -30524,17 +30527,6 @@ var ts;
30524
30527
  || kind === 173 /* SetAccessor */;
30525
30528
  }
30526
30529
  ts.canHaveIllegalTypeParameters = canHaveIllegalTypeParameters;
30527
- function canHaveDecorators(node) {
30528
- var kind = node.kind;
30529
- return kind === 164 /* Parameter */
30530
- || kind === 167 /* PropertyDeclaration */
30531
- || kind === 169 /* MethodDeclaration */
30532
- || kind === 172 /* GetAccessor */
30533
- || kind === 173 /* SetAccessor */
30534
- || kind === 226 /* ClassExpression */
30535
- || kind === 257 /* ClassDeclaration */;
30536
- }
30537
- ts.canHaveDecorators = canHaveDecorators;
30538
30530
  function canHaveIllegalDecorators(node) {
30539
30531
  var kind = node.kind;
30540
30532
  return kind === 296 /* PropertyAssignment */
@@ -30556,35 +30548,6 @@ var ts;
30556
30548
  || kind === 271 /* ExportAssignment */;
30557
30549
  }
30558
30550
  ts.canHaveIllegalDecorators = canHaveIllegalDecorators;
30559
- function canHaveModifiers(node) {
30560
- var kind = node.kind;
30561
- return kind === 163 /* TypeParameter */
30562
- || kind === 164 /* Parameter */
30563
- || kind === 166 /* PropertySignature */
30564
- || kind === 167 /* PropertyDeclaration */
30565
- || kind === 168 /* MethodSignature */
30566
- || kind === 169 /* MethodDeclaration */
30567
- || kind === 171 /* Constructor */
30568
- || kind === 172 /* GetAccessor */
30569
- || kind === 173 /* SetAccessor */
30570
- || kind === 176 /* IndexSignature */
30571
- || kind === 180 /* ConstructorType */
30572
- || kind === 213 /* FunctionExpression */
30573
- || kind === 214 /* ArrowFunction */
30574
- || kind === 226 /* ClassExpression */
30575
- || kind === 237 /* VariableStatement */
30576
- || kind === 256 /* FunctionDeclaration */
30577
- || kind === 257 /* ClassDeclaration */
30578
- || kind === 258 /* InterfaceDeclaration */
30579
- || kind === 259 /* TypeAliasDeclaration */
30580
- || kind === 260 /* EnumDeclaration */
30581
- || kind === 261 /* ModuleDeclaration */
30582
- || kind === 265 /* ImportEqualsDeclaration */
30583
- || kind === 266 /* ImportDeclaration */
30584
- || kind === 271 /* ExportAssignment */
30585
- || kind === 272 /* ExportDeclaration */;
30586
- }
30587
- ts.canHaveModifiers = canHaveModifiers;
30588
30551
  function canHaveIllegalModifiers(node) {
30589
30552
  var kind = node.kind;
30590
30553
  return kind === 170 /* ClassStaticBlockDeclaration */
@@ -30873,6 +30836,46 @@ var ts;
30873
30836
  return location ? ts.setTextRangePosEnd(range, location.pos, location.end) : range;
30874
30837
  }
30875
30838
  ts.setTextRange = setTextRange;
30839
+ function canHaveModifiers(node) {
30840
+ var kind = node.kind;
30841
+ return kind === 163 /* TypeParameter */
30842
+ || kind === 164 /* Parameter */
30843
+ || kind === 166 /* PropertySignature */
30844
+ || kind === 167 /* PropertyDeclaration */
30845
+ || kind === 168 /* MethodSignature */
30846
+ || kind === 169 /* MethodDeclaration */
30847
+ || kind === 171 /* Constructor */
30848
+ || kind === 172 /* GetAccessor */
30849
+ || kind === 173 /* SetAccessor */
30850
+ || kind === 176 /* IndexSignature */
30851
+ || kind === 180 /* ConstructorType */
30852
+ || kind === 213 /* FunctionExpression */
30853
+ || kind === 214 /* ArrowFunction */
30854
+ || kind === 226 /* ClassExpression */
30855
+ || kind === 237 /* VariableStatement */
30856
+ || kind === 256 /* FunctionDeclaration */
30857
+ || kind === 257 /* ClassDeclaration */
30858
+ || kind === 258 /* InterfaceDeclaration */
30859
+ || kind === 259 /* TypeAliasDeclaration */
30860
+ || kind === 260 /* EnumDeclaration */
30861
+ || kind === 261 /* ModuleDeclaration */
30862
+ || kind === 265 /* ImportEqualsDeclaration */
30863
+ || kind === 266 /* ImportDeclaration */
30864
+ || kind === 271 /* ExportAssignment */
30865
+ || kind === 272 /* ExportDeclaration */;
30866
+ }
30867
+ ts.canHaveModifiers = canHaveModifiers;
30868
+ function canHaveDecorators(node) {
30869
+ var kind = node.kind;
30870
+ return kind === 164 /* Parameter */
30871
+ || kind === 167 /* PropertyDeclaration */
30872
+ || kind === 169 /* MethodDeclaration */
30873
+ || kind === 172 /* GetAccessor */
30874
+ || kind === 173 /* SetAccessor */
30875
+ || kind === 226 /* ClassExpression */
30876
+ || kind === 257 /* ClassDeclaration */;
30877
+ }
30878
+ ts.canHaveDecorators = canHaveDecorators;
30876
30879
  })(ts || (ts = {}));
30877
30880
  var ts;
30878
30881
  (function (ts) {
@@ -49040,6 +49043,7 @@ var ts;
49040
49043
  signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,
49041
49044
  symbolToEntityName: nodeBuilder.symbolToEntityName,
49042
49045
  symbolToExpression: nodeBuilder.symbolToExpression,
49046
+ symbolToNode: nodeBuilder.symbolToNode,
49043
49047
  symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations,
49044
49048
  symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration,
49045
49049
  typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration,
@@ -49709,10 +49713,10 @@ var ts;
49709
49713
  }
49710
49714
  // Issue errors globally
49711
49715
  var file = ts.getSourceFileOfNode(location);
49712
- addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message)); // eslint-disable-line no-in-operator
49716
+ addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message)); // eslint-disable-line local/no-in-operator
49713
49717
  return;
49714
49718
  }
49715
- addErrorOrSuggestion(isError, "message" in message ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForNodeFromMessageChain(location, message)); // eslint-disable-line no-in-operator
49719
+ addErrorOrSuggestion(isError, "message" in message ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForNodeFromMessageChain(location, message)); // eslint-disable-line local/no-in-operator
49716
49720
  }
49717
49721
  function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) {
49718
49722
  var diagnostic = error(location, message, arg0, arg1, arg2, arg3);
@@ -51695,7 +51699,7 @@ var ts;
51695
51699
  }
51696
51700
  }
51697
51701
  function getFullyQualifiedName(symbol, containingLocation) {
51698
- return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined, 16 /* DoNotIncludeSymbolChain */ | 4 /* AllowAnyNodeKind */);
51702
+ return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined, 32 /* DoNotIncludeSymbolChain */ | 4 /* AllowAnyNodeKind */);
51699
51703
  }
51700
51704
  function getContainingQualifiedNameNode(node) {
51701
51705
  while (ts.isQualifiedName(node.parent)) {
@@ -53010,10 +53014,13 @@ var ts;
53010
53014
  if (flags & 8 /* UseAliasDefinedOutsideCurrentScope */) {
53011
53015
  nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */;
53012
53016
  }
53013
- if (flags & 16 /* DoNotIncludeSymbolChain */) {
53017
+ if (flags & 32 /* DoNotIncludeSymbolChain */) {
53014
53018
  nodeFlags |= 134217728 /* DoNotIncludeSymbolChain */;
53015
53019
  }
53016
- var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName;
53020
+ if (flags & 16 /* WriteComputedProps */) {
53021
+ nodeFlags |= 1073741824 /* WriteComputedProps */;
53022
+ }
53023
+ var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToNode : nodeBuilder.symbolToEntityName;
53017
53024
  return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker);
53018
53025
  function symbolToStringWorker(writer) {
53019
53026
  var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217
@@ -53113,7 +53120,25 @@ var ts;
53113
53120
  symbolTableToDeclarationStatements: function (symbolTable, enclosingDeclaration, flags, tracker, bundled) {
53114
53121
  return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolTableToDeclarationStatements(symbolTable, context, bundled); });
53115
53122
  },
53123
+ symbolToNode: function (symbol, meaning, enclosingDeclaration, flags, tracker) {
53124
+ return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToNode(symbol, context, meaning); });
53125
+ },
53116
53126
  };
53127
+ function symbolToNode(symbol, context, meaning) {
53128
+ if (context.flags & 1073741824 /* WriteComputedProps */) {
53129
+ if (symbol.valueDeclaration) {
53130
+ var name = ts.getNameOfDeclaration(symbol.valueDeclaration);
53131
+ if (name && ts.isComputedPropertyName(name))
53132
+ return name;
53133
+ }
53134
+ var nameType = getSymbolLinks(symbol).nameType;
53135
+ if (nameType && nameType.flags & (1024 /* EnumLiteral */ | 8192 /* UniqueESSymbol */)) {
53136
+ context.enclosingDeclaration = nameType.symbol.valueDeclaration;
53137
+ return ts.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, meaning));
53138
+ }
53139
+ }
53140
+ return symbolToExpression(symbol, context, meaning);
53141
+ }
53117
53142
  function withContext(enclosingDeclaration, flags, tracker, cb) {
53118
53143
  var _a, _b;
53119
53144
  ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0);
@@ -65917,7 +65942,7 @@ var ts;
65917
65942
  return 0 /* False */;
65918
65943
  }
65919
65944
  }
65920
- var isPerformingCommonPropertyChecks = (relation !== comparableRelation || relation === comparableRelation && isLiteralType(source)) &&
65945
+ var isPerformingCommonPropertyChecks = (relation !== comparableRelation || !(source.flags & 1048576 /* Union */) && isLiteralType(source)) &&
65921
65946
  !(intersectionState & 2 /* Target */) &&
65922
65947
  source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
65923
65948
  target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
@@ -67296,7 +67321,7 @@ var ts;
67296
67321
  shouldSkipElaboration = true; // Retain top-level error for interface implementing issues, otherwise omit it
67297
67322
  }
67298
67323
  if (props.length === 1) {
67299
- var propName = symbolToString(unmatchedProperty);
67324
+ var propName = symbolToString(unmatchedProperty, /*enclosingDeclaration*/ undefined, 0 /* None */, 4 /* AllowAnyNodeKind */ | 16 /* WriteComputedProps */);
67300
67325
  reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target), false));
67301
67326
  if (ts.length(unmatchedProperty.declarations)) {
67302
67327
  associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
@@ -91339,7 +91364,7 @@ var ts;
91339
91364
  exit();
91340
91365
  return sourceIndex;
91341
91366
  }
91342
- /* eslint-disable boolean-trivia, no-null/no-null */
91367
+ /* eslint-disable local/boolean-trivia, no-null/no-null */
91343
91368
  function setSourceContent(sourceIndex, content) {
91344
91369
  enter();
91345
91370
  if (content !== null) {
@@ -91352,7 +91377,7 @@ var ts;
91352
91377
  }
91353
91378
  exit();
91354
91379
  }
91355
- /* eslint-enable boolean-trivia, no-null/no-null */
91380
+ /* eslint-enable local/boolean-trivia, no-null/no-null */
91356
91381
  function addName(name) {
91357
91382
  enter();
91358
91383
  if (!nameToNameIndexMap)