typescript 4.6.0-dev.20211206 → 4.6.0-dev.20211207

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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.20211206";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20211207";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
@@ -5151,7 +5151,7 @@ var ts;
5151
5151
  Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
5152
5152
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
5153
5153
  A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
5154
- An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", "An object literal cannot have multiple properties with the same name in strict mode."),
5154
+ An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
5155
5155
  An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
5156
5156
  An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
5157
5157
  An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
@@ -27083,7 +27083,11 @@ var ts;
27083
27083
  if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
27084
27084
  return undefined;
27085
27085
  }
27086
- var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
27086
+ var unwrappedType = type;
27087
+ while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190) {
27088
+ unwrappedType = unwrappedType.type;
27089
+ }
27090
+ var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
27087
27091
  if (!allowAmbiguity && token() !== 38 && (hasJSDocFunctionType || token() !== 18)) {
27088
27092
  return undefined;
27089
27093
  }
@@ -36827,10 +36831,6 @@ var ts;
36827
36831
  seen.set(identifier.escapedText, currentKind);
36828
36832
  continue;
36829
36833
  }
36830
- if (currentKind === 1 && existingKind === 1) {
36831
- var span = ts.getErrorSpanForNode(file, identifier);
36832
- file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
36833
- }
36834
36834
  }
36835
36835
  }
36836
36836
  return bindAnonymousDeclaration(node, 4096, "__object");
@@ -37035,7 +37035,7 @@ var ts;
37035
37035
  }
37036
37036
  }
37037
37037
  function checkStrictModeNumericLiteral(node) {
37038
- if (inStrictMode && node.numericLiteralFlags & 32) {
37038
+ if (languageVersion < 1 && inStrictMode && node.numericLiteralFlags & 32) {
37039
37039
  file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
37040
37040
  }
37041
37041
  }
@@ -40032,7 +40032,8 @@ var ts;
40032
40032
  }
40033
40033
  }
40034
40034
  function isSameScopeDescendentOf(initial, parent, stopAt) {
40035
- return !!parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
40035
+ return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
40036
+ || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
40036
40037
  }
40037
40038
  function getAnyImportSyntax(node) {
40038
40039
  switch (node.kind) {
@@ -54666,7 +54667,7 @@ var ts;
54666
54667
  }
54667
54668
  function getBaseTypeOfLiteralType(type) {
54668
54669
  return type.flags & 1024 ? getBaseTypeOfEnumLiteralType(type) :
54669
- type.flags & 128 ? stringType :
54670
+ type.flags & (128 | 134217728 | 268435456) ? stringType :
54670
54671
  type.flags & 256 ? numberType :
54671
54672
  type.flags & 2048 ? bigintType :
54672
54673
  type.flags & 512 ? booleanType :
@@ -72226,9 +72227,12 @@ var ts;
72226
72227
  seen.set(effectiveName, currentKind);
72227
72228
  }
72228
72229
  else {
72229
- if ((currentKind & 12) && (existingKind & 12)) {
72230
+ if ((currentKind & 8) && (existingKind & 8)) {
72230
72231
  grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
72231
72232
  }
72233
+ else if ((currentKind & 4) && (existingKind & 4)) {
72234
+ grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
72235
+ }
72232
72236
  else if ((currentKind & 3) && (existingKind & 3)) {
72233
72237
  if (existingKind !== 3 && currentKind !== existingKind) {
72234
72238
  seen.set(effectiveName, currentKind | existingKind);
package/lib/tsserver.js CHANGED
@@ -100,7 +100,7 @@ var ts;
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = ts.versionMajorMinor + ".0-dev.20211206";
103
+ ts.version = ts.versionMajorMinor + ".0-dev.20211207";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -7937,7 +7937,7 @@ var ts;
7937
7937
  Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
7938
7938
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
7939
7939
  A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
7940
- An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", "An object literal cannot have multiple properties with the same name in strict mode."),
7940
+ An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
7941
7941
  An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
7942
7942
  An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
7943
7943
  An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
@@ -33620,10 +33620,14 @@ var ts;
33620
33620
  // - "(x,y)" is a comma expression parsed as a signature with two parameters.
33621
33621
  // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
33622
33622
  // - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
33623
- // - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
33623
+ // - "a ? (b): (function() {})" as well, but inside of a parenthesized type with an arbitrary amount of nesting.
33624
33624
  //
33625
33625
  // So we need just a bit of lookahead to ensure that it can only be a signature.
33626
- var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
33626
+ var unwrappedType = type;
33627
+ while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190 /* ParenthesizedType */) {
33628
+ unwrappedType = unwrappedType.type; // Skip parens if need be
33629
+ }
33630
+ var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
33627
33631
  if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
33628
33632
  // Returning undefined here will cause our caller to rewind to where we started from.
33629
33633
  return undefined;
@@ -44954,10 +44958,6 @@ var ts;
44954
44958
  seen.set(identifier.escapedText, currentKind);
44955
44959
  continue;
44956
44960
  }
44957
- if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) {
44958
- var span = ts.getErrorSpanForNode(file, identifier);
44959
- file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
44960
- }
44961
44961
  }
44962
44962
  }
44963
44963
  return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */);
@@ -45191,7 +45191,7 @@ var ts;
45191
45191
  }
45192
45192
  }
45193
45193
  function checkStrictModeNumericLiteral(node) {
45194
- if (inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45194
+ if (languageVersion < 1 /* ES5 */ && inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45195
45195
  file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
45196
45196
  }
45197
45197
  }
@@ -48796,10 +48796,12 @@ var ts;
48796
48796
  }
48797
48797
  /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached.
48798
48798
  * If at any point current node is equal to 'parent' node - return true.
48799
+ * If current node is an IIFE, continue walking up.
48799
48800
  * Return false if 'stopAt' node is reached or isFunctionLike(current) === true.
48800
48801
  */
48801
48802
  function isSameScopeDescendentOf(initial, parent, stopAt) {
48802
- return !!parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
48803
+ return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
48804
+ || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
48803
48805
  }
48804
48806
  function getAnyImportSyntax(node) {
48805
48807
  switch (node.kind) {
@@ -65581,7 +65583,7 @@ var ts;
65581
65583
  }
65582
65584
  function getBaseTypeOfLiteralType(type) {
65583
65585
  return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :
65584
- type.flags & 128 /* StringLiteral */ ? stringType :
65586
+ type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType :
65585
65587
  type.flags & 256 /* NumberLiteral */ ? numberType :
65586
65588
  type.flags & 2048 /* BigIntLiteral */ ? bigintType :
65587
65589
  type.flags & 512 /* BooleanLiteral */ ? booleanType :
@@ -85949,9 +85951,12 @@ var ts;
85949
85951
  seen.set(effectiveName, currentKind);
85950
85952
  }
85951
85953
  else {
85952
- if ((currentKind & 12 /* PropertyAssignmentOrMethod */) && (existingKind & 12 /* PropertyAssignmentOrMethod */)) {
85954
+ if ((currentKind & 8 /* Method */) && (existingKind & 8 /* Method */)) {
85953
85955
  grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
85954
85956
  }
85957
+ else if ((currentKind & 4 /* PropertyAssignment */) && (existingKind & 4 /* PropertyAssignment */)) {
85958
+ grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
85959
+ }
85955
85960
  else if ((currentKind & 3 /* GetOrSetAccessor */) && (existingKind & 3 /* GetOrSetAccessor */)) {
85956
85961
  if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) {
85957
85962
  seen.set(effectiveName, currentKind | existingKind);
@@ -140907,7 +140912,7 @@ var ts;
140907
140912
  displayParts.push(ts.spacePart());
140908
140913
  displayParts.push(ts.operatorPart(63 /* EqualsToken */));
140909
140914
  displayParts.push(ts.spacePart());
140910
- ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
140915
+ ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, ts.isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
140911
140916
  }
140912
140917
  if (symbolFlags & 384 /* Enum */) {
140913
140918
  prefixNextMeaning();
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20211206";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211207";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -8131,7 +8131,7 @@ var ts;
8131
8131
  Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
8132
8132
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
8133
8133
  A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
8134
- An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", "An object literal cannot have multiple properties with the same name in strict mode."),
8134
+ An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
8135
8135
  An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
8136
8136
  An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
8137
8137
  An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
@@ -33814,10 +33814,14 @@ var ts;
33814
33814
  // - "(x,y)" is a comma expression parsed as a signature with two parameters.
33815
33815
  // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
33816
33816
  // - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
33817
- // - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
33817
+ // - "a ? (b): (function() {})" as well, but inside of a parenthesized type with an arbitrary amount of nesting.
33818
33818
  //
33819
33819
  // So we need just a bit of lookahead to ensure that it can only be a signature.
33820
- var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
33820
+ var unwrappedType = type;
33821
+ while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190 /* ParenthesizedType */) {
33822
+ unwrappedType = unwrappedType.type; // Skip parens if need be
33823
+ }
33824
+ var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
33821
33825
  if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
33822
33826
  // Returning undefined here will cause our caller to rewind to where we started from.
33823
33827
  return undefined;
@@ -45148,10 +45152,6 @@ var ts;
45148
45152
  seen.set(identifier.escapedText, currentKind);
45149
45153
  continue;
45150
45154
  }
45151
- if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) {
45152
- var span = ts.getErrorSpanForNode(file, identifier);
45153
- file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
45154
- }
45155
45155
  }
45156
45156
  }
45157
45157
  return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */);
@@ -45385,7 +45385,7 @@ var ts;
45385
45385
  }
45386
45386
  }
45387
45387
  function checkStrictModeNumericLiteral(node) {
45388
- if (inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45388
+ if (languageVersion < 1 /* ES5 */ && inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45389
45389
  file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
45390
45390
  }
45391
45391
  }
@@ -48990,10 +48990,12 @@ var ts;
48990
48990
  }
48991
48991
  /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached.
48992
48992
  * If at any point current node is equal to 'parent' node - return true.
48993
+ * If current node is an IIFE, continue walking up.
48993
48994
  * Return false if 'stopAt' node is reached or isFunctionLike(current) === true.
48994
48995
  */
48995
48996
  function isSameScopeDescendentOf(initial, parent, stopAt) {
48996
- return !!parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
48997
+ return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
48998
+ || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
48997
48999
  }
48998
49000
  function getAnyImportSyntax(node) {
48999
49001
  switch (node.kind) {
@@ -65775,7 +65777,7 @@ var ts;
65775
65777
  }
65776
65778
  function getBaseTypeOfLiteralType(type) {
65777
65779
  return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :
65778
- type.flags & 128 /* StringLiteral */ ? stringType :
65780
+ type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType :
65779
65781
  type.flags & 256 /* NumberLiteral */ ? numberType :
65780
65782
  type.flags & 2048 /* BigIntLiteral */ ? bigintType :
65781
65783
  type.flags & 512 /* BooleanLiteral */ ? booleanType :
@@ -86143,9 +86145,12 @@ var ts;
86143
86145
  seen.set(effectiveName, currentKind);
86144
86146
  }
86145
86147
  else {
86146
- if ((currentKind & 12 /* PropertyAssignmentOrMethod */) && (existingKind & 12 /* PropertyAssignmentOrMethod */)) {
86148
+ if ((currentKind & 8 /* Method */) && (existingKind & 8 /* Method */)) {
86147
86149
  grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
86148
86150
  }
86151
+ else if ((currentKind & 4 /* PropertyAssignment */) && (existingKind & 4 /* PropertyAssignment */)) {
86152
+ grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
86153
+ }
86149
86154
  else if ((currentKind & 3 /* GetOrSetAccessor */) && (existingKind & 3 /* GetOrSetAccessor */)) {
86150
86155
  if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) {
86151
86156
  seen.set(effectiveName, currentKind | existingKind);
@@ -141489,7 +141494,7 @@ var ts;
141489
141494
  displayParts.push(ts.spacePart());
141490
141495
  displayParts.push(ts.operatorPart(63 /* EqualsToken */));
141491
141496
  displayParts.push(ts.spacePart());
141492
- ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
141497
+ ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, ts.isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
141493
141498
  }
141494
141499
  if (symbolFlags & 384 /* Enum */) {
141495
141500
  prefixNextMeaning();
package/lib/typescript.js CHANGED
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20211206";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211207";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -8131,7 +8131,7 @@ var ts;
8131
8131
  Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
8132
8132
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
8133
8133
  A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
8134
- An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", "An object literal cannot have multiple properties with the same name in strict mode."),
8134
+ An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
8135
8135
  An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
8136
8136
  An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
8137
8137
  An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
@@ -33814,10 +33814,14 @@ var ts;
33814
33814
  // - "(x,y)" is a comma expression parsed as a signature with two parameters.
33815
33815
  // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
33816
33816
  // - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
33817
- // - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
33817
+ // - "a ? (b): (function() {})" as well, but inside of a parenthesized type with an arbitrary amount of nesting.
33818
33818
  //
33819
33819
  // So we need just a bit of lookahead to ensure that it can only be a signature.
33820
- var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
33820
+ var unwrappedType = type;
33821
+ while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190 /* ParenthesizedType */) {
33822
+ unwrappedType = unwrappedType.type; // Skip parens if need be
33823
+ }
33824
+ var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
33821
33825
  if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
33822
33826
  // Returning undefined here will cause our caller to rewind to where we started from.
33823
33827
  return undefined;
@@ -45148,10 +45152,6 @@ var ts;
45148
45152
  seen.set(identifier.escapedText, currentKind);
45149
45153
  continue;
45150
45154
  }
45151
- if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) {
45152
- var span = ts.getErrorSpanForNode(file, identifier);
45153
- file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
45154
- }
45155
45155
  }
45156
45156
  }
45157
45157
  return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */);
@@ -45385,7 +45385,7 @@ var ts;
45385
45385
  }
45386
45386
  }
45387
45387
  function checkStrictModeNumericLiteral(node) {
45388
- if (inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45388
+ if (languageVersion < 1 /* ES5 */ && inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45389
45389
  file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
45390
45390
  }
45391
45391
  }
@@ -48990,10 +48990,12 @@ var ts;
48990
48990
  }
48991
48991
  /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached.
48992
48992
  * If at any point current node is equal to 'parent' node - return true.
48993
+ * If current node is an IIFE, continue walking up.
48993
48994
  * Return false if 'stopAt' node is reached or isFunctionLike(current) === true.
48994
48995
  */
48995
48996
  function isSameScopeDescendentOf(initial, parent, stopAt) {
48996
- return !!parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
48997
+ return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
48998
+ || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
48997
48999
  }
48998
49000
  function getAnyImportSyntax(node) {
48999
49001
  switch (node.kind) {
@@ -65775,7 +65777,7 @@ var ts;
65775
65777
  }
65776
65778
  function getBaseTypeOfLiteralType(type) {
65777
65779
  return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :
65778
- type.flags & 128 /* StringLiteral */ ? stringType :
65780
+ type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType :
65779
65781
  type.flags & 256 /* NumberLiteral */ ? numberType :
65780
65782
  type.flags & 2048 /* BigIntLiteral */ ? bigintType :
65781
65783
  type.flags & 512 /* BooleanLiteral */ ? booleanType :
@@ -86143,9 +86145,12 @@ var ts;
86143
86145
  seen.set(effectiveName, currentKind);
86144
86146
  }
86145
86147
  else {
86146
- if ((currentKind & 12 /* PropertyAssignmentOrMethod */) && (existingKind & 12 /* PropertyAssignmentOrMethod */)) {
86148
+ if ((currentKind & 8 /* Method */) && (existingKind & 8 /* Method */)) {
86147
86149
  grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
86148
86150
  }
86151
+ else if ((currentKind & 4 /* PropertyAssignment */) && (existingKind & 4 /* PropertyAssignment */)) {
86152
+ grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
86153
+ }
86149
86154
  else if ((currentKind & 3 /* GetOrSetAccessor */) && (existingKind & 3 /* GetOrSetAccessor */)) {
86150
86155
  if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) {
86151
86156
  seen.set(effectiveName, currentKind | existingKind);
@@ -141489,7 +141494,7 @@ var ts;
141489
141494
  displayParts.push(ts.spacePart());
141490
141495
  displayParts.push(ts.operatorPart(63 /* EqualsToken */));
141491
141496
  displayParts.push(ts.spacePart());
141492
- ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
141497
+ ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, ts.isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
141493
141498
  }
141494
141499
  if (symbolFlags & 384 /* Enum */) {
141495
141500
  prefixNextMeaning();
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20211206";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211207";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -8131,7 +8131,7 @@ var ts;
8131
8131
  Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
8132
8132
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
8133
8133
  A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
8134
- An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", "An object literal cannot have multiple properties with the same name in strict mode."),
8134
+ An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
8135
8135
  An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
8136
8136
  An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
8137
8137
  An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
@@ -33814,10 +33814,14 @@ var ts;
33814
33814
  // - "(x,y)" is a comma expression parsed as a signature with two parameters.
33815
33815
  // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
33816
33816
  // - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
33817
- // - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
33817
+ // - "a ? (b): (function() {})" as well, but inside of a parenthesized type with an arbitrary amount of nesting.
33818
33818
  //
33819
33819
  // So we need just a bit of lookahead to ensure that it can only be a signature.
33820
- var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
33820
+ var unwrappedType = type;
33821
+ while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190 /* ParenthesizedType */) {
33822
+ unwrappedType = unwrappedType.type; // Skip parens if need be
33823
+ }
33824
+ var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
33821
33825
  if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
33822
33826
  // Returning undefined here will cause our caller to rewind to where we started from.
33823
33827
  return undefined;
@@ -45148,10 +45152,6 @@ var ts;
45148
45152
  seen.set(identifier.escapedText, currentKind);
45149
45153
  continue;
45150
45154
  }
45151
- if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) {
45152
- var span = ts.getErrorSpanForNode(file, identifier);
45153
- file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
45154
- }
45155
45155
  }
45156
45156
  }
45157
45157
  return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */);
@@ -45385,7 +45385,7 @@ var ts;
45385
45385
  }
45386
45386
  }
45387
45387
  function checkStrictModeNumericLiteral(node) {
45388
- if (inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45388
+ if (languageVersion < 1 /* ES5 */ && inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45389
45389
  file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
45390
45390
  }
45391
45391
  }
@@ -48990,10 +48990,12 @@ var ts;
48990
48990
  }
48991
48991
  /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached.
48992
48992
  * If at any point current node is equal to 'parent' node - return true.
48993
+ * If current node is an IIFE, continue walking up.
48993
48994
  * Return false if 'stopAt' node is reached or isFunctionLike(current) === true.
48994
48995
  */
48995
48996
  function isSameScopeDescendentOf(initial, parent, stopAt) {
48996
- return !!parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
48997
+ return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
48998
+ || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
48997
48999
  }
48998
49000
  function getAnyImportSyntax(node) {
48999
49001
  switch (node.kind) {
@@ -65775,7 +65777,7 @@ var ts;
65775
65777
  }
65776
65778
  function getBaseTypeOfLiteralType(type) {
65777
65779
  return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :
65778
- type.flags & 128 /* StringLiteral */ ? stringType :
65780
+ type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType :
65779
65781
  type.flags & 256 /* NumberLiteral */ ? numberType :
65780
65782
  type.flags & 2048 /* BigIntLiteral */ ? bigintType :
65781
65783
  type.flags & 512 /* BooleanLiteral */ ? booleanType :
@@ -86143,9 +86145,12 @@ var ts;
86143
86145
  seen.set(effectiveName, currentKind);
86144
86146
  }
86145
86147
  else {
86146
- if ((currentKind & 12 /* PropertyAssignmentOrMethod */) && (existingKind & 12 /* PropertyAssignmentOrMethod */)) {
86148
+ if ((currentKind & 8 /* Method */) && (existingKind & 8 /* Method */)) {
86147
86149
  grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
86148
86150
  }
86151
+ else if ((currentKind & 4 /* PropertyAssignment */) && (existingKind & 4 /* PropertyAssignment */)) {
86152
+ grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
86153
+ }
86149
86154
  else if ((currentKind & 3 /* GetOrSetAccessor */) && (existingKind & 3 /* GetOrSetAccessor */)) {
86150
86155
  if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) {
86151
86156
  seen.set(effectiveName, currentKind | existingKind);
@@ -141489,7 +141494,7 @@ var ts;
141489
141494
  displayParts.push(ts.spacePart());
141490
141495
  displayParts.push(ts.operatorPart(63 /* EqualsToken */));
141491
141496
  displayParts.push(ts.spacePart());
141492
- ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
141497
+ ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, ts.isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
141493
141498
  }
141494
141499
  if (symbolFlags & 384 /* Enum */) {
141495
141500
  prefixNextMeaning();
@@ -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.20211206";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20211207";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -7926,7 +7926,7 @@ var ts;
7926
7926
  Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
7927
7927
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
7928
7928
  A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
7929
- An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", "An object literal cannot have multiple properties with the same name in strict mode."),
7929
+ An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
7930
7930
  An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
7931
7931
  An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
7932
7932
  An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
@@ -33609,10 +33609,14 @@ var ts;
33609
33609
  // - "(x,y)" is a comma expression parsed as a signature with two parameters.
33610
33610
  // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
33611
33611
  // - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
33612
- // - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
33612
+ // - "a ? (b): (function() {})" as well, but inside of a parenthesized type with an arbitrary amount of nesting.
33613
33613
  //
33614
33614
  // So we need just a bit of lookahead to ensure that it can only be a signature.
33615
- var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
33615
+ var unwrappedType = type;
33616
+ while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190 /* ParenthesizedType */) {
33617
+ unwrappedType = unwrappedType.type; // Skip parens if need be
33618
+ }
33619
+ var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
33616
33620
  if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
33617
33621
  // Returning undefined here will cause our caller to rewind to where we started from.
33618
33622
  return undefined;
@@ -44943,10 +44947,6 @@ var ts;
44943
44947
  seen.set(identifier.escapedText, currentKind);
44944
44948
  continue;
44945
44949
  }
44946
- if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) {
44947
- var span = ts.getErrorSpanForNode(file, identifier);
44948
- file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
44949
- }
44950
44950
  }
44951
44951
  }
44952
44952
  return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */);
@@ -45180,7 +45180,7 @@ var ts;
45180
45180
  }
45181
45181
  }
45182
45182
  function checkStrictModeNumericLiteral(node) {
45183
- if (inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45183
+ if (languageVersion < 1 /* ES5 */ && inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45184
45184
  file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
45185
45185
  }
45186
45186
  }
@@ -48785,10 +48785,12 @@ var ts;
48785
48785
  }
48786
48786
  /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached.
48787
48787
  * If at any point current node is equal to 'parent' node - return true.
48788
+ * If current node is an IIFE, continue walking up.
48788
48789
  * Return false if 'stopAt' node is reached or isFunctionLike(current) === true.
48789
48790
  */
48790
48791
  function isSameScopeDescendentOf(initial, parent, stopAt) {
48791
- return !!parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
48792
+ return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
48793
+ || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
48792
48794
  }
48793
48795
  function getAnyImportSyntax(node) {
48794
48796
  switch (node.kind) {
@@ -65570,7 +65572,7 @@ var ts;
65570
65572
  }
65571
65573
  function getBaseTypeOfLiteralType(type) {
65572
65574
  return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :
65573
- type.flags & 128 /* StringLiteral */ ? stringType :
65575
+ type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType :
65574
65576
  type.flags & 256 /* NumberLiteral */ ? numberType :
65575
65577
  type.flags & 2048 /* BigIntLiteral */ ? bigintType :
65576
65578
  type.flags & 512 /* BooleanLiteral */ ? booleanType :
@@ -85938,9 +85940,12 @@ var ts;
85938
85940
  seen.set(effectiveName, currentKind);
85939
85941
  }
85940
85942
  else {
85941
- if ((currentKind & 12 /* PropertyAssignmentOrMethod */) && (existingKind & 12 /* PropertyAssignmentOrMethod */)) {
85943
+ if ((currentKind & 8 /* Method */) && (existingKind & 8 /* Method */)) {
85942
85944
  grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
85943
85945
  }
85946
+ else if ((currentKind & 4 /* PropertyAssignment */) && (existingKind & 4 /* PropertyAssignment */)) {
85947
+ grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
85948
+ }
85944
85949
  else if ((currentKind & 3 /* GetOrSetAccessor */) && (existingKind & 3 /* GetOrSetAccessor */)) {
85945
85950
  if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) {
85946
85951
  seen.set(effectiveName, currentKind | existingKind);
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.6.0-dev.20211206",
5
+ "version": "4.6.0-dev.20211207",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [