@typescript-deploys/pr-build 5.2.0-pr-54657-9 → 5.2.0-pr-54781-9

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.
@@ -35,8 +35,10 @@ type DecoratorContext =
35
35
  | ClassMemberDecoratorContext
36
36
  ;
37
37
 
38
+ type DecoratorMetadataObject = Record<PropertyKey, unknown> & object;
39
+
38
40
  type DecoratorMetadata =
39
- typeof globalThis extends { Symbol: { readonly metadata: symbol } } ? object : object | undefined;
41
+ typeof globalThis extends { Symbol: { readonly metadata: symbol } } ? DecoratorMetadataObject : DecoratorMetadataObject | undefined;
40
42
 
41
43
  /**
42
44
  * Context provided to a class decorator.
@@ -17,7 +17,12 @@ and limitations under the License.
17
17
  /// <reference no-default-lib="true"/>
18
18
 
19
19
  /// <reference lib="es2015.symbol" />
20
+ /// <reference lib="decorators" />
20
21
 
21
22
  interface SymbolConstructor {
22
23
  readonly metadata: unique symbol;
23
24
  }
25
+
26
+ interface Function {
27
+ [Symbol.metadata]: DecoratorMetadata | null;
28
+ }
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.2";
21
- var version = `${versionMajorMinor}.0-insiders.20230622`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230626`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -5792,6 +5792,7 @@ var Diagnostics = {
5792
5792
  A_return_statement_can_only_be_used_within_a_function_body: diag(1108, 1 /* Error */, "A_return_statement_can_only_be_used_within_a_function_body_1108", "A 'return' statement can only be used within a function body."),
5793
5793
  Expression_expected: diag(1109, 1 /* Error */, "Expression_expected_1109", "Expression expected."),
5794
5794
  Type_expected: diag(1110, 1 /* Error */, "Type_expected_1110", "Type expected."),
5795
+ Private_field_0_must_be_declared_in_an_enclosing_class: diag(1111, 1 /* Error */, "Private_field_0_must_be_declared_in_an_enclosing_class_1111", "Private field '{0}' must be declared in an enclosing class."),
5795
5796
  A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: diag(1113, 1 /* Error */, "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", "A 'default' clause cannot appear more than once in a 'switch' statement."),
5796
5797
  Duplicate_label_0: diag(1114, 1 /* Error */, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
5797
5798
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, 1 /* 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."),
@@ -12915,6 +12916,10 @@ function getContainingClassStaticBlock(node) {
12915
12916
  function getContainingFunctionOrClassStaticBlock(node) {
12916
12917
  return findAncestor(node.parent, isFunctionLikeOrClassStaticBlockDeclaration);
12917
12918
  }
12919
+ function getContainingClassExcludingClassDecorators(node) {
12920
+ const decorator = findAncestor(node.parent, (n) => isClassLike(n) ? "quit" : isDecorator(n));
12921
+ return decorator && isClassLike(decorator.parent) ? getContainingClass(decorator.parent) : getContainingClass(decorator ?? node);
12922
+ }
12918
12923
  function getThisContainer(node, includeArrowFunctions, includeClassComputedPropertyName) {
12919
12924
  Debug.assert(node.kind !== 312 /* SourceFile */);
12920
12925
  while (true) {
@@ -60948,7 +60953,6 @@ function createTypeChecker(host) {
60948
60953
  } else if (targetFlags & 8388608 /* IndexedAccess */) {
60949
60954
  if (sourceFlags & 8388608 /* IndexedAccess */) {
60950
60955
  if (result2 = isRelatedTo(source2.objectType, target2.objectType, 3 /* Both */, reportErrors2)) {
60951
- instantiateType(source2.objectType, reportUnreliableMapper);
60952
60956
  result2 &= isRelatedTo(source2.indexType, target2.indexType, 3 /* Both */, reportErrors2);
60953
60957
  }
60954
60958
  if (result2) {
@@ -66037,7 +66041,7 @@ function createTypeChecker(host) {
66037
66041
  location = location.parent;
66038
66042
  }
66039
66043
  if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
66040
- const type = getTypeOfExpression(location);
66044
+ const type = removeOptionalTypeMarker(getTypeOfExpression(location));
66041
66045
  if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
66042
66046
  return type;
66043
66047
  }
@@ -69048,7 +69052,7 @@ function createTypeChecker(host) {
69048
69052
  return isCallOrNewExpression(node.parent) && node.parent.expression === node;
69049
69053
  }
69050
69054
  function lookupSymbolForPrivateIdentifierDeclaration(propName, location) {
69051
- for (let containingClass = getContainingClass(location); !!containingClass; containingClass = getContainingClass(containingClass)) {
69055
+ for (let containingClass = getContainingClassExcludingClassDecorators(location); !!containingClass; containingClass = getContainingClass(containingClass)) {
69052
69056
  const { symbol } = containingClass;
69053
69057
  const name = getSymbolNameForPrivateIdentifier(symbol, propName);
69054
69058
  const prop = symbol.members && symbol.members.get(name) || symbol.exports && symbol.exports.get(name);
@@ -69184,16 +69188,22 @@ function createTypeChecker(host) {
69184
69188
  if (lexicallyScopedSymbol) {
69185
69189
  return isErrorType(apparentType) ? errorType : apparentType;
69186
69190
  }
69187
- if (!getContainingClass(right)) {
69191
+ if (getContainingClassExcludingClassDecorators(right) === void 0) {
69188
69192
  grammarErrorOnNode(right, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
69189
69193
  return anyType;
69190
69194
  }
69191
69195
  }
69192
- prop = lexicallyScopedSymbol ? getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedSymbol) : void 0;
69193
- if (!prop && checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) {
69194
- return errorType;
69196
+ prop = lexicallyScopedSymbol && getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedSymbol);
69197
+ if (prop === void 0) {
69198
+ if (checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) {
69199
+ return errorType;
69200
+ }
69201
+ const containingClass = getContainingClassExcludingClassDecorators(right);
69202
+ if (containingClass && isPlainJsFile(getSourceFileOfNode(containingClass), compilerOptions.checkJs)) {
69203
+ grammarErrorOnNode(right, Diagnostics.Private_field_0_must_be_declared_in_an_enclosing_class, idText(right));
69204
+ }
69195
69205
  } else {
69196
- const isSetonlyAccessor = prop && prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
69206
+ const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
69197
69207
  if (isSetonlyAccessor && assignmentKind !== 1 /* Definite */) {
69198
69208
  error(node, Diagnostics.Private_accessor_was_defined_without_a_getter);
69199
69209
  }
@@ -89781,9 +89791,12 @@ function transformClassFields(context) {
89781
89791
  return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis;
89782
89792
  }
89783
89793
  const classCheckFlags = resolver.getNodeCheckFlags(node);
89784
- const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */;
89785
89794
  const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
89786
- const temp2 = factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2);
89795
+ const temp2 = factory2.createTempVariable(
89796
+ requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration,
89797
+ /*reservedInNestedScopes*/
89798
+ true
89799
+ );
89787
89800
  getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp2);
89788
89801
  return temp2;
89789
89802
  }
@@ -107522,6 +107535,21 @@ function transformDeclarations(context) {
107522
107535
  const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (258047 /* All */ ^ 1 /* Export */));
107523
107536
  return factory2.updateModifiers(statement, modifiers);
107524
107537
  }
107538
+ function updateModuleDeclarationAndKeyword(node, modifiers, name, body) {
107539
+ const updated = factory2.updateModuleDeclaration(node, modifiers, name, body);
107540
+ if (isAmbientModule(updated) || updated.flags & 32 /* Namespace */) {
107541
+ return updated;
107542
+ }
107543
+ const fixed = factory2.createModuleDeclaration(
107544
+ updated.modifiers,
107545
+ updated.name,
107546
+ updated.body,
107547
+ updated.flags | 32 /* Namespace */
107548
+ );
107549
+ setOriginalNode(fixed, updated);
107550
+ setTextRange(fixed, updated);
107551
+ return fixed;
107552
+ }
107525
107553
  function transformTopLevelDeclaration(input) {
107526
107554
  if (lateMarkedStatements) {
107527
107555
  while (orderedRemoveItem(lateMarkedStatements, input))
@@ -107709,7 +107737,7 @@ function transformDeclarations(context) {
107709
107737
  needsScopeFixMarker = oldNeedsScopeFix;
107710
107738
  resultHasScopeMarker = oldHasScopeFix;
107711
107739
  const mods = ensureModifiers(input);
107712
- return cleanup(factory2.updateModuleDeclaration(
107740
+ return cleanup(updateModuleDeclarationAndKeyword(
107713
107741
  input,
107714
107742
  mods,
107715
107743
  isExternalModuleAugmentation(input) ? rewriteModuleSpecifier(input, input.name) : input.name,
@@ -107723,7 +107751,7 @@ function transformDeclarations(context) {
107723
107751
  const id = getOriginalNodeId(inner);
107724
107752
  const body = lateStatementReplacementMap.get(id);
107725
107753
  lateStatementReplacementMap.delete(id);
107726
- return cleanup(factory2.updateModuleDeclaration(
107754
+ return cleanup(updateModuleDeclarationAndKeyword(
107727
107755
  input,
107728
107756
  mods,
107729
107757
  input.name,
@@ -115181,6 +115209,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
115181
115209
  Diagnostics.Class_constructor_may_not_be_an_accessor.code,
115182
115210
  Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
115183
115211
  Diagnostics.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
115212
+ Diagnostics.Private_field_0_must_be_declared_in_an_enclosing_class.code,
115184
115213
  // Type errors
115185
115214
  Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value.code
115186
115215
  ]);
package/lib/tsserver.js CHANGED
@@ -693,6 +693,7 @@ __export(server_exports, {
693
693
  getContainerFlags: () => getContainerFlags,
694
694
  getContainerNode: () => getContainerNode,
695
695
  getContainingClass: () => getContainingClass,
696
+ getContainingClassExcludingClassDecorators: () => getContainingClassExcludingClassDecorators,
696
697
  getContainingClassStaticBlock: () => getContainingClassStaticBlock,
697
698
  getContainingFunction: () => getContainingFunction,
698
699
  getContainingFunctionDeclaration: () => getContainingFunctionDeclaration,
@@ -2326,7 +2327,7 @@ module.exports = __toCommonJS(server_exports);
2326
2327
 
2327
2328
  // src/compiler/corePublic.ts
2328
2329
  var versionMajorMinor = "5.2";
2329
- var version = `${versionMajorMinor}.0-insiders.20230622`;
2330
+ var version = `${versionMajorMinor}.0-insiders.20230626`;
2330
2331
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2331
2332
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2332
2333
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9312,6 +9313,7 @@ var Diagnostics = {
9312
9313
  A_return_statement_can_only_be_used_within_a_function_body: diag(1108, 1 /* Error */, "A_return_statement_can_only_be_used_within_a_function_body_1108", "A 'return' statement can only be used within a function body."),
9313
9314
  Expression_expected: diag(1109, 1 /* Error */, "Expression_expected_1109", "Expression expected."),
9314
9315
  Type_expected: diag(1110, 1 /* Error */, "Type_expected_1110", "Type expected."),
9316
+ Private_field_0_must_be_declared_in_an_enclosing_class: diag(1111, 1 /* Error */, "Private_field_0_must_be_declared_in_an_enclosing_class_1111", "Private field '{0}' must be declared in an enclosing class."),
9315
9317
  A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: diag(1113, 1 /* Error */, "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", "A 'default' clause cannot appear more than once in a 'switch' statement."),
9316
9318
  Duplicate_label_0: diag(1114, 1 /* Error */, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
9317
9319
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, 1 /* 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."),
@@ -16749,6 +16751,10 @@ function getContainingClassStaticBlock(node) {
16749
16751
  function getContainingFunctionOrClassStaticBlock(node) {
16750
16752
  return findAncestor(node.parent, isFunctionLikeOrClassStaticBlockDeclaration);
16751
16753
  }
16754
+ function getContainingClassExcludingClassDecorators(node) {
16755
+ const decorator = findAncestor(node.parent, (n) => isClassLike(n) ? "quit" : isDecorator(n));
16756
+ return decorator && isClassLike(decorator.parent) ? getContainingClass(decorator.parent) : getContainingClass(decorator ?? node);
16757
+ }
16752
16758
  function getThisContainer(node, includeArrowFunctions, includeClassComputedPropertyName) {
16753
16759
  Debug.assert(node.kind !== 312 /* SourceFile */);
16754
16760
  while (true) {
@@ -65623,7 +65629,6 @@ function createTypeChecker(host) {
65623
65629
  } else if (targetFlags & 8388608 /* IndexedAccess */) {
65624
65630
  if (sourceFlags & 8388608 /* IndexedAccess */) {
65625
65631
  if (result2 = isRelatedTo(source2.objectType, target2.objectType, 3 /* Both */, reportErrors2)) {
65626
- instantiateType(source2.objectType, reportUnreliableMapper);
65627
65632
  result2 &= isRelatedTo(source2.indexType, target2.indexType, 3 /* Both */, reportErrors2);
65628
65633
  }
65629
65634
  if (result2) {
@@ -70712,7 +70717,7 @@ function createTypeChecker(host) {
70712
70717
  location = location.parent;
70713
70718
  }
70714
70719
  if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
70715
- const type = getTypeOfExpression(location);
70720
+ const type = removeOptionalTypeMarker(getTypeOfExpression(location));
70716
70721
  if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
70717
70722
  return type;
70718
70723
  }
@@ -73723,7 +73728,7 @@ function createTypeChecker(host) {
73723
73728
  return isCallOrNewExpression(node.parent) && node.parent.expression === node;
73724
73729
  }
73725
73730
  function lookupSymbolForPrivateIdentifierDeclaration(propName, location) {
73726
- for (let containingClass = getContainingClass(location); !!containingClass; containingClass = getContainingClass(containingClass)) {
73731
+ for (let containingClass = getContainingClassExcludingClassDecorators(location); !!containingClass; containingClass = getContainingClass(containingClass)) {
73727
73732
  const { symbol } = containingClass;
73728
73733
  const name = getSymbolNameForPrivateIdentifier(symbol, propName);
73729
73734
  const prop = symbol.members && symbol.members.get(name) || symbol.exports && symbol.exports.get(name);
@@ -73859,16 +73864,22 @@ function createTypeChecker(host) {
73859
73864
  if (lexicallyScopedSymbol) {
73860
73865
  return isErrorType(apparentType) ? errorType : apparentType;
73861
73866
  }
73862
- if (!getContainingClass(right)) {
73867
+ if (getContainingClassExcludingClassDecorators(right) === void 0) {
73863
73868
  grammarErrorOnNode(right, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
73864
73869
  return anyType;
73865
73870
  }
73866
73871
  }
73867
- prop = lexicallyScopedSymbol ? getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedSymbol) : void 0;
73868
- if (!prop && checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) {
73869
- return errorType;
73872
+ prop = lexicallyScopedSymbol && getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedSymbol);
73873
+ if (prop === void 0) {
73874
+ if (checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) {
73875
+ return errorType;
73876
+ }
73877
+ const containingClass = getContainingClassExcludingClassDecorators(right);
73878
+ if (containingClass && isPlainJsFile(getSourceFileOfNode(containingClass), compilerOptions.checkJs)) {
73879
+ grammarErrorOnNode(right, Diagnostics.Private_field_0_must_be_declared_in_an_enclosing_class, idText(right));
73880
+ }
73870
73881
  } else {
73871
- const isSetonlyAccessor = prop && prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
73882
+ const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
73872
73883
  if (isSetonlyAccessor && assignmentKind !== 1 /* Definite */) {
73873
73884
  error2(node, Diagnostics.Private_accessor_was_defined_without_a_getter);
73874
73885
  }
@@ -94627,9 +94638,12 @@ function transformClassFields(context) {
94627
94638
  return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis;
94628
94639
  }
94629
94640
  const classCheckFlags = resolver.getNodeCheckFlags(node);
94630
- const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */;
94631
94641
  const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
94632
- const temp2 = factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2);
94642
+ const temp2 = factory2.createTempVariable(
94643
+ requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration,
94644
+ /*reservedInNestedScopes*/
94645
+ true
94646
+ );
94633
94647
  getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp2);
94634
94648
  return temp2;
94635
94649
  }
@@ -112368,6 +112382,21 @@ function transformDeclarations(context) {
112368
112382
  const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (258047 /* All */ ^ 1 /* Export */));
112369
112383
  return factory2.updateModifiers(statement, modifiers);
112370
112384
  }
112385
+ function updateModuleDeclarationAndKeyword(node, modifiers, name, body) {
112386
+ const updated = factory2.updateModuleDeclaration(node, modifiers, name, body);
112387
+ if (isAmbientModule(updated) || updated.flags & 32 /* Namespace */) {
112388
+ return updated;
112389
+ }
112390
+ const fixed = factory2.createModuleDeclaration(
112391
+ updated.modifiers,
112392
+ updated.name,
112393
+ updated.body,
112394
+ updated.flags | 32 /* Namespace */
112395
+ );
112396
+ setOriginalNode(fixed, updated);
112397
+ setTextRange(fixed, updated);
112398
+ return fixed;
112399
+ }
112371
112400
  function transformTopLevelDeclaration(input) {
112372
112401
  if (lateMarkedStatements) {
112373
112402
  while (orderedRemoveItem(lateMarkedStatements, input))
@@ -112555,7 +112584,7 @@ function transformDeclarations(context) {
112555
112584
  needsScopeFixMarker = oldNeedsScopeFix;
112556
112585
  resultHasScopeMarker = oldHasScopeFix;
112557
112586
  const mods = ensureModifiers(input);
112558
- return cleanup(factory2.updateModuleDeclaration(
112587
+ return cleanup(updateModuleDeclarationAndKeyword(
112559
112588
  input,
112560
112589
  mods,
112561
112590
  isExternalModuleAugmentation(input) ? rewriteModuleSpecifier(input, input.name) : input.name,
@@ -112569,7 +112598,7 @@ function transformDeclarations(context) {
112569
112598
  const id = getOriginalNodeId(inner);
112570
112599
  const body = lateStatementReplacementMap.get(id);
112571
112600
  lateStatementReplacementMap.delete(id);
112572
- return cleanup(factory2.updateModuleDeclaration(
112601
+ return cleanup(updateModuleDeclarationAndKeyword(
112573
112602
  input,
112574
112603
  mods,
112575
112604
  input.name,
@@ -120092,6 +120121,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
120092
120121
  Diagnostics.Class_constructor_may_not_be_an_accessor.code,
120093
120122
  Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
120094
120123
  Diagnostics.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
120124
+ Diagnostics.Private_field_0_must_be_declared_in_an_enclosing_class.code,
120095
120125
  // Type errors
120096
120126
  Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value.code
120097
120127
  ]);
@@ -172206,6 +172236,7 @@ __export(ts_exports2, {
172206
172236
  getContainerFlags: () => getContainerFlags,
172207
172237
  getContainerNode: () => getContainerNode,
172208
172238
  getContainingClass: () => getContainingClass,
172239
+ getContainingClassExcludingClassDecorators: () => getContainingClassExcludingClassDecorators,
172209
172240
  getContainingClassStaticBlock: () => getContainingClassStaticBlock,
172210
172241
  getContainingFunction: () => getContainingFunction,
172211
172242
  getContainingFunctionDeclaration: () => getContainingFunctionDeclaration,
@@ -186718,6 +186749,7 @@ start(initializeNodeSystem(), require("os").platform());
186718
186749
  getContainerFlags,
186719
186750
  getContainerNode,
186720
186751
  getContainingClass,
186752
+ getContainingClassExcludingClassDecorators,
186721
186753
  getContainingClassStaticBlock,
186722
186754
  getContainingFunction,
186723
186755
  getContainingFunctionDeclaration,
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-insiders.20230622`;
38
+ version = `${versionMajorMinor}.0-insiders.20230626`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -7096,6 +7096,7 @@ ${lanes.join("\n")}
7096
7096
  A_return_statement_can_only_be_used_within_a_function_body: diag(1108, 1 /* Error */, "A_return_statement_can_only_be_used_within_a_function_body_1108", "A 'return' statement can only be used within a function body."),
7097
7097
  Expression_expected: diag(1109, 1 /* Error */, "Expression_expected_1109", "Expression expected."),
7098
7098
  Type_expected: diag(1110, 1 /* Error */, "Type_expected_1110", "Type expected."),
7099
+ Private_field_0_must_be_declared_in_an_enclosing_class: diag(1111, 1 /* Error */, "Private_field_0_must_be_declared_in_an_enclosing_class_1111", "Private field '{0}' must be declared in an enclosing class."),
7099
7100
  A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: diag(1113, 1 /* Error */, "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", "A 'default' clause cannot appear more than once in a 'switch' statement."),
7100
7101
  Duplicate_label_0: diag(1114, 1 /* Error */, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
7101
7102
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, 1 /* 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."),
@@ -14530,6 +14531,10 @@ ${lanes.join("\n")}
14530
14531
  function getContainingFunctionOrClassStaticBlock(node) {
14531
14532
  return findAncestor(node.parent, isFunctionLikeOrClassStaticBlockDeclaration);
14532
14533
  }
14534
+ function getContainingClassExcludingClassDecorators(node) {
14535
+ const decorator = findAncestor(node.parent, (n) => isClassLike(n) ? "quit" : isDecorator(n));
14536
+ return decorator && isClassLike(decorator.parent) ? getContainingClass(decorator.parent) : getContainingClass(decorator ?? node);
14537
+ }
14533
14538
  function getThisContainer(node, includeArrowFunctions, includeClassComputedPropertyName) {
14534
14539
  Debug.assert(node.kind !== 312 /* SourceFile */);
14535
14540
  while (true) {
@@ -63391,7 +63396,6 @@ ${lanes.join("\n")}
63391
63396
  } else if (targetFlags & 8388608 /* IndexedAccess */) {
63392
63397
  if (sourceFlags & 8388608 /* IndexedAccess */) {
63393
63398
  if (result2 = isRelatedTo(source2.objectType, target2.objectType, 3 /* Both */, reportErrors2)) {
63394
- instantiateType(source2.objectType, reportUnreliableMapper);
63395
63399
  result2 &= isRelatedTo(source2.indexType, target2.indexType, 3 /* Both */, reportErrors2);
63396
63400
  }
63397
63401
  if (result2) {
@@ -68480,7 +68484,7 @@ ${lanes.join("\n")}
68480
68484
  location = location.parent;
68481
68485
  }
68482
68486
  if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
68483
- const type = getTypeOfExpression(location);
68487
+ const type = removeOptionalTypeMarker(getTypeOfExpression(location));
68484
68488
  if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
68485
68489
  return type;
68486
68490
  }
@@ -71491,7 +71495,7 @@ ${lanes.join("\n")}
71491
71495
  return isCallOrNewExpression(node.parent) && node.parent.expression === node;
71492
71496
  }
71493
71497
  function lookupSymbolForPrivateIdentifierDeclaration(propName, location) {
71494
- for (let containingClass = getContainingClass(location); !!containingClass; containingClass = getContainingClass(containingClass)) {
71498
+ for (let containingClass = getContainingClassExcludingClassDecorators(location); !!containingClass; containingClass = getContainingClass(containingClass)) {
71495
71499
  const { symbol } = containingClass;
71496
71500
  const name = getSymbolNameForPrivateIdentifier(symbol, propName);
71497
71501
  const prop = symbol.members && symbol.members.get(name) || symbol.exports && symbol.exports.get(name);
@@ -71627,16 +71631,22 @@ ${lanes.join("\n")}
71627
71631
  if (lexicallyScopedSymbol) {
71628
71632
  return isErrorType(apparentType) ? errorType : apparentType;
71629
71633
  }
71630
- if (!getContainingClass(right)) {
71634
+ if (getContainingClassExcludingClassDecorators(right) === void 0) {
71631
71635
  grammarErrorOnNode(right, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
71632
71636
  return anyType;
71633
71637
  }
71634
71638
  }
71635
- prop = lexicallyScopedSymbol ? getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedSymbol) : void 0;
71636
- if (!prop && checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) {
71637
- return errorType;
71639
+ prop = lexicallyScopedSymbol && getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedSymbol);
71640
+ if (prop === void 0) {
71641
+ if (checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) {
71642
+ return errorType;
71643
+ }
71644
+ const containingClass = getContainingClassExcludingClassDecorators(right);
71645
+ if (containingClass && isPlainJsFile(getSourceFileOfNode(containingClass), compilerOptions.checkJs)) {
71646
+ grammarErrorOnNode(right, Diagnostics.Private_field_0_must_be_declared_in_an_enclosing_class, idText(right));
71647
+ }
71638
71648
  } else {
71639
- const isSetonlyAccessor = prop && prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
71649
+ const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
71640
71650
  if (isSetonlyAccessor && assignmentKind !== 1 /* Definite */) {
71641
71651
  error2(node, Diagnostics.Private_accessor_was_defined_without_a_getter);
71642
71652
  }
@@ -92584,9 +92594,12 @@ ${lanes.join("\n")}
92584
92594
  return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis;
92585
92595
  }
92586
92596
  const classCheckFlags = resolver.getNodeCheckFlags(node);
92587
- const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */;
92588
92597
  const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
92589
- const temp2 = factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2);
92598
+ const temp2 = factory2.createTempVariable(
92599
+ requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration,
92600
+ /*reservedInNestedScopes*/
92601
+ true
92602
+ );
92590
92603
  getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp2);
92591
92604
  return temp2;
92592
92605
  }
@@ -110446,6 +110459,21 @@ ${lanes.join("\n")}
110446
110459
  const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (258047 /* All */ ^ 1 /* Export */));
110447
110460
  return factory2.updateModifiers(statement, modifiers);
110448
110461
  }
110462
+ function updateModuleDeclarationAndKeyword(node, modifiers, name, body) {
110463
+ const updated = factory2.updateModuleDeclaration(node, modifiers, name, body);
110464
+ if (isAmbientModule(updated) || updated.flags & 32 /* Namespace */) {
110465
+ return updated;
110466
+ }
110467
+ const fixed = factory2.createModuleDeclaration(
110468
+ updated.modifiers,
110469
+ updated.name,
110470
+ updated.body,
110471
+ updated.flags | 32 /* Namespace */
110472
+ );
110473
+ setOriginalNode(fixed, updated);
110474
+ setTextRange(fixed, updated);
110475
+ return fixed;
110476
+ }
110449
110477
  function transformTopLevelDeclaration(input) {
110450
110478
  if (lateMarkedStatements) {
110451
110479
  while (orderedRemoveItem(lateMarkedStatements, input))
@@ -110633,7 +110661,7 @@ ${lanes.join("\n")}
110633
110661
  needsScopeFixMarker = oldNeedsScopeFix;
110634
110662
  resultHasScopeMarker = oldHasScopeFix;
110635
110663
  const mods = ensureModifiers(input);
110636
- return cleanup(factory2.updateModuleDeclaration(
110664
+ return cleanup(updateModuleDeclarationAndKeyword(
110637
110665
  input,
110638
110666
  mods,
110639
110667
  isExternalModuleAugmentation(input) ? rewriteModuleSpecifier(input, input.name) : input.name,
@@ -110647,7 +110675,7 @@ ${lanes.join("\n")}
110647
110675
  const id = getOriginalNodeId(inner);
110648
110676
  const body = lateStatementReplacementMap.get(id);
110649
110677
  lateStatementReplacementMap.delete(id);
110650
- return cleanup(factory2.updateModuleDeclaration(
110678
+ return cleanup(updateModuleDeclarationAndKeyword(
110651
110679
  input,
110652
110680
  mods,
110653
110681
  input.name,
@@ -121475,6 +121503,7 @@ ${lanes.join("\n")}
121475
121503
  Diagnostics.Class_constructor_may_not_be_an_accessor.code,
121476
121504
  Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
121477
121505
  Diagnostics.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
121506
+ Diagnostics.Private_field_0_must_be_declared_in_an_enclosing_class.code,
121478
121507
  // Type errors
121479
121508
  Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value.code
121480
121509
  ]);
@@ -183347,6 +183376,7 @@ ${e.message}`;
183347
183376
  getContainerFlags: () => getContainerFlags,
183348
183377
  getContainerNode: () => getContainerNode,
183349
183378
  getContainingClass: () => getContainingClass,
183379
+ getContainingClassExcludingClassDecorators: () => getContainingClassExcludingClassDecorators,
183350
183380
  getContainingClassStaticBlock: () => getContainingClassStaticBlock,
183351
183381
  getContainingFunction: () => getContainingFunction,
183352
183382
  getContainingFunctionDeclaration: () => getContainingFunctionDeclaration,
@@ -185749,6 +185779,7 @@ ${e.message}`;
185749
185779
  getContainerFlags: () => getContainerFlags,
185750
185780
  getContainerNode: () => getContainerNode,
185751
185781
  getContainingClass: () => getContainingClass,
185782
+ getContainingClassExcludingClassDecorators: () => getContainingClassExcludingClassDecorators,
185752
185783
  getContainingClassStaticBlock: () => getContainingClassStaticBlock,
185753
185784
  getContainingFunction: () => getContainingFunction,
185754
185785
  getContainingFunctionDeclaration: () => getContainingFunctionDeclaration,
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-insiders.20230622`;
38
+ version = `${versionMajorMinor}.0-insiders.20230626`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -7096,6 +7096,7 @@ ${lanes.join("\n")}
7096
7096
  A_return_statement_can_only_be_used_within_a_function_body: diag(1108, 1 /* Error */, "A_return_statement_can_only_be_used_within_a_function_body_1108", "A 'return' statement can only be used within a function body."),
7097
7097
  Expression_expected: diag(1109, 1 /* Error */, "Expression_expected_1109", "Expression expected."),
7098
7098
  Type_expected: diag(1110, 1 /* Error */, "Type_expected_1110", "Type expected."),
7099
+ Private_field_0_must_be_declared_in_an_enclosing_class: diag(1111, 1 /* Error */, "Private_field_0_must_be_declared_in_an_enclosing_class_1111", "Private field '{0}' must be declared in an enclosing class."),
7099
7100
  A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: diag(1113, 1 /* Error */, "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", "A 'default' clause cannot appear more than once in a 'switch' statement."),
7100
7101
  Duplicate_label_0: diag(1114, 1 /* Error */, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
7101
7102
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, 1 /* 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."),
@@ -14530,6 +14531,10 @@ ${lanes.join("\n")}
14530
14531
  function getContainingFunctionOrClassStaticBlock(node) {
14531
14532
  return findAncestor(node.parent, isFunctionLikeOrClassStaticBlockDeclaration);
14532
14533
  }
14534
+ function getContainingClassExcludingClassDecorators(node) {
14535
+ const decorator = findAncestor(node.parent, (n) => isClassLike(n) ? "quit" : isDecorator(n));
14536
+ return decorator && isClassLike(decorator.parent) ? getContainingClass(decorator.parent) : getContainingClass(decorator ?? node);
14537
+ }
14533
14538
  function getThisContainer(node, includeArrowFunctions, includeClassComputedPropertyName) {
14534
14539
  Debug.assert(node.kind !== 312 /* SourceFile */);
14535
14540
  while (true) {
@@ -63391,7 +63396,6 @@ ${lanes.join("\n")}
63391
63396
  } else if (targetFlags & 8388608 /* IndexedAccess */) {
63392
63397
  if (sourceFlags & 8388608 /* IndexedAccess */) {
63393
63398
  if (result2 = isRelatedTo(source2.objectType, target2.objectType, 3 /* Both */, reportErrors2)) {
63394
- instantiateType(source2.objectType, reportUnreliableMapper);
63395
63399
  result2 &= isRelatedTo(source2.indexType, target2.indexType, 3 /* Both */, reportErrors2);
63396
63400
  }
63397
63401
  if (result2) {
@@ -68480,7 +68484,7 @@ ${lanes.join("\n")}
68480
68484
  location = location.parent;
68481
68485
  }
68482
68486
  if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
68483
- const type = getTypeOfExpression(location);
68487
+ const type = removeOptionalTypeMarker(getTypeOfExpression(location));
68484
68488
  if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
68485
68489
  return type;
68486
68490
  }
@@ -71491,7 +71495,7 @@ ${lanes.join("\n")}
71491
71495
  return isCallOrNewExpression(node.parent) && node.parent.expression === node;
71492
71496
  }
71493
71497
  function lookupSymbolForPrivateIdentifierDeclaration(propName, location) {
71494
- for (let containingClass = getContainingClass(location); !!containingClass; containingClass = getContainingClass(containingClass)) {
71498
+ for (let containingClass = getContainingClassExcludingClassDecorators(location); !!containingClass; containingClass = getContainingClass(containingClass)) {
71495
71499
  const { symbol } = containingClass;
71496
71500
  const name = getSymbolNameForPrivateIdentifier(symbol, propName);
71497
71501
  const prop = symbol.members && symbol.members.get(name) || symbol.exports && symbol.exports.get(name);
@@ -71627,16 +71631,22 @@ ${lanes.join("\n")}
71627
71631
  if (lexicallyScopedSymbol) {
71628
71632
  return isErrorType(apparentType) ? errorType : apparentType;
71629
71633
  }
71630
- if (!getContainingClass(right)) {
71634
+ if (getContainingClassExcludingClassDecorators(right) === void 0) {
71631
71635
  grammarErrorOnNode(right, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
71632
71636
  return anyType;
71633
71637
  }
71634
71638
  }
71635
- prop = lexicallyScopedSymbol ? getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedSymbol) : void 0;
71636
- if (!prop && checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) {
71637
- return errorType;
71639
+ prop = lexicallyScopedSymbol && getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedSymbol);
71640
+ if (prop === void 0) {
71641
+ if (checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) {
71642
+ return errorType;
71643
+ }
71644
+ const containingClass = getContainingClassExcludingClassDecorators(right);
71645
+ if (containingClass && isPlainJsFile(getSourceFileOfNode(containingClass), compilerOptions.checkJs)) {
71646
+ grammarErrorOnNode(right, Diagnostics.Private_field_0_must_be_declared_in_an_enclosing_class, idText(right));
71647
+ }
71638
71648
  } else {
71639
- const isSetonlyAccessor = prop && prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
71649
+ const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
71640
71650
  if (isSetonlyAccessor && assignmentKind !== 1 /* Definite */) {
71641
71651
  error2(node, Diagnostics.Private_accessor_was_defined_without_a_getter);
71642
71652
  }
@@ -92584,9 +92594,12 @@ ${lanes.join("\n")}
92584
92594
  return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis;
92585
92595
  }
92586
92596
  const classCheckFlags = resolver.getNodeCheckFlags(node);
92587
- const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */;
92588
92597
  const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
92589
- const temp2 = factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2);
92598
+ const temp2 = factory2.createTempVariable(
92599
+ requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration,
92600
+ /*reservedInNestedScopes*/
92601
+ true
92602
+ );
92590
92603
  getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp2);
92591
92604
  return temp2;
92592
92605
  }
@@ -110446,6 +110459,21 @@ ${lanes.join("\n")}
110446
110459
  const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (258047 /* All */ ^ 1 /* Export */));
110447
110460
  return factory2.updateModifiers(statement, modifiers);
110448
110461
  }
110462
+ function updateModuleDeclarationAndKeyword(node, modifiers, name, body) {
110463
+ const updated = factory2.updateModuleDeclaration(node, modifiers, name, body);
110464
+ if (isAmbientModule(updated) || updated.flags & 32 /* Namespace */) {
110465
+ return updated;
110466
+ }
110467
+ const fixed = factory2.createModuleDeclaration(
110468
+ updated.modifiers,
110469
+ updated.name,
110470
+ updated.body,
110471
+ updated.flags | 32 /* Namespace */
110472
+ );
110473
+ setOriginalNode(fixed, updated);
110474
+ setTextRange(fixed, updated);
110475
+ return fixed;
110476
+ }
110449
110477
  function transformTopLevelDeclaration(input) {
110450
110478
  if (lateMarkedStatements) {
110451
110479
  while (orderedRemoveItem(lateMarkedStatements, input))
@@ -110633,7 +110661,7 @@ ${lanes.join("\n")}
110633
110661
  needsScopeFixMarker = oldNeedsScopeFix;
110634
110662
  resultHasScopeMarker = oldHasScopeFix;
110635
110663
  const mods = ensureModifiers(input);
110636
- return cleanup(factory2.updateModuleDeclaration(
110664
+ return cleanup(updateModuleDeclarationAndKeyword(
110637
110665
  input,
110638
110666
  mods,
110639
110667
  isExternalModuleAugmentation(input) ? rewriteModuleSpecifier(input, input.name) : input.name,
@@ -110647,7 +110675,7 @@ ${lanes.join("\n")}
110647
110675
  const id = getOriginalNodeId(inner);
110648
110676
  const body = lateStatementReplacementMap.get(id);
110649
110677
  lateStatementReplacementMap.delete(id);
110650
- return cleanup(factory2.updateModuleDeclaration(
110678
+ return cleanup(updateModuleDeclarationAndKeyword(
110651
110679
  input,
110652
110680
  mods,
110653
110681
  input.name,
@@ -121475,6 +121503,7 @@ ${lanes.join("\n")}
121475
121503
  Diagnostics.Class_constructor_may_not_be_an_accessor.code,
121476
121504
  Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
121477
121505
  Diagnostics.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
121506
+ Diagnostics.Private_field_0_must_be_declared_in_an_enclosing_class.code,
121478
121507
  // Type errors
121479
121508
  Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value.code
121480
121509
  ]);
@@ -171969,6 +171998,7 @@ ${options.prefix}` : "\n" : options.prefix
171969
171998
  getContainerFlags: () => getContainerFlags,
171970
171999
  getContainerNode: () => getContainerNode,
171971
172000
  getContainingClass: () => getContainingClass,
172001
+ getContainingClassExcludingClassDecorators: () => getContainingClassExcludingClassDecorators,
171972
172002
  getContainingClassStaticBlock: () => getContainingClassStaticBlock,
171973
172003
  getContainingFunction: () => getContainingFunction,
171974
172004
  getContainingFunctionDeclaration: () => getContainingFunctionDeclaration,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.2";
57
- var version = `${versionMajorMinor}.0-insiders.20230622`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230626`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -5166,6 +5166,7 @@ var Diagnostics = {
5166
5166
  A_return_statement_can_only_be_used_within_a_function_body: diag(1108, 1 /* Error */, "A_return_statement_can_only_be_used_within_a_function_body_1108", "A 'return' statement can only be used within a function body."),
5167
5167
  Expression_expected: diag(1109, 1 /* Error */, "Expression_expected_1109", "Expression expected."),
5168
5168
  Type_expected: diag(1110, 1 /* Error */, "Type_expected_1110", "Type expected."),
5169
+ Private_field_0_must_be_declared_in_an_enclosing_class: diag(1111, 1 /* Error */, "Private_field_0_must_be_declared_in_an_enclosing_class_1111", "Private field '{0}' must be declared in an enclosing class."),
5169
5170
  A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: diag(1113, 1 /* Error */, "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", "A 'default' clause cannot appear more than once in a 'switch' statement."),
5170
5171
  Duplicate_label_0: diag(1114, 1 /* Error */, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
5171
5172
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, 1 /* 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."),
@@ -30821,6 +30822,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
30821
30822
  Diagnostics.Class_constructor_may_not_be_an_accessor.code,
30822
30823
  Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
30823
30824
  Diagnostics.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
30825
+ Diagnostics.Private_field_0_must_be_declared_in_an_enclosing_class.code,
30824
30826
  // Type errors
30825
30827
  Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value.code
30826
30828
  ]);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.2.0-pr-54657-9",
5
+ "version": "5.2.0-pr-54781-9",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -115,5 +115,5 @@
115
115
  "node": "20.1.0",
116
116
  "npm": "8.19.4"
117
117
  },
118
- "gitHead": "79916f02bd30047b93472aff7c02deee805e9fc4"
118
+ "gitHead": "b62f8859ac8428b17034dbf3a821fb772d84955b"
119
119
  }