@typescript-deploys/pr-build 5.2.0-pr-55152-6 → 5.2.0-pr-55222-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.
package/lib/tsserver.js CHANGED
@@ -751,6 +751,7 @@ __export(server_exports, {
751
751
  getEmitModuleKind: () => getEmitModuleKind,
752
752
  getEmitModuleResolutionKind: () => getEmitModuleResolutionKind,
753
753
  getEmitScriptTarget: () => getEmitScriptTarget,
754
+ getEmitStandardClassFields: () => getEmitStandardClassFields,
754
755
  getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer,
755
756
  getEnclosingContainer: () => getEnclosingContainer,
756
757
  getEncodedSemanticClassifications: () => getEncodedSemanticClassifications,
@@ -1426,6 +1427,7 @@ __export(server_exports, {
1426
1427
  isInString: () => isInString,
1427
1428
  isInTemplateString: () => isInTemplateString,
1428
1429
  isInTopLevelContext: () => isInTopLevelContext,
1430
+ isInTypeQuery: () => isInTypeQuery,
1429
1431
  isIncrementalCompilation: () => isIncrementalCompilation,
1430
1432
  isIndexSignatureDeclaration: () => isIndexSignatureDeclaration,
1431
1433
  isIndexedAccessTypeNode: () => isIndexedAccessTypeNode,
@@ -2329,7 +2331,7 @@ module.exports = __toCommonJS(server_exports);
2329
2331
 
2330
2332
  // src/compiler/corePublic.ts
2331
2333
  var versionMajorMinor = "5.2";
2332
- var version = `${versionMajorMinor}.0-insiders.20230726`;
2334
+ var version = `${versionMajorMinor}.0-insiders.20230731`;
2333
2335
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2334
2336
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2335
2337
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -3498,7 +3500,7 @@ function identity(x) {
3498
3500
  function toLowerCase(x) {
3499
3501
  return x.toLowerCase();
3500
3502
  }
3501
- var fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_\. ]+/g;
3503
+ var fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;
3502
3504
  function toFileNameLowerCase(x) {
3503
3505
  return fileNameLowerCaseRegExp.test(x) ? x.replace(fileNameLowerCaseRegExp, toLowerCase) : x;
3504
3506
  }
@@ -4233,7 +4235,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
4233
4235
  return func.name;
4234
4236
  } else {
4235
4237
  const text = Function.prototype.toString.call(func);
4236
- const match = /^function\s+([\w\$]+)\s*\(/.exec(text);
4238
+ const match = /^function\s+([\w$]+)\s*\(/.exec(text);
4237
4239
  return match ? match[1] : "";
4238
4240
  }
4239
4241
  }
@@ -5016,7 +5018,7 @@ ${lanes.join("\n")}
5016
5018
  })(Debug || (Debug = {}));
5017
5019
 
5018
5020
  // src/compiler/semver.ts
5019
- var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i;
5021
+ var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i;
5020
5022
  var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
5021
5023
  var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
5022
5024
  var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
@@ -13734,7 +13736,7 @@ function getNodeFlags(node) {
13734
13736
  var supportedLocaleDirectories = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"];
13735
13737
  function validateLocaleAndSetLanguage(locale, sys2, errors) {
13736
13738
  const lowerCaseLocale = locale.toLowerCase();
13737
- const matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(lowerCaseLocale);
13739
+ const matchResult = /^([a-z]+)([_-]([a-z]+))?$/.exec(lowerCaseLocale);
13738
13740
  if (!matchResult) {
13739
13741
  if (errors) {
13740
13742
  errors.push(createCompilerDiagnostic(Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, "en", "ja-jp"));
@@ -18615,9 +18617,9 @@ function escapeTemplateSubstitution(str) {
18615
18617
  function hasInvalidEscape(template) {
18616
18618
  return template && !!(isNoSubstitutionTemplateLiteral(template) ? template.templateFlags : template.head.templateFlags || some(template.templateSpans, (span) => !!span.literal.templateFlags));
18617
18619
  }
18618
- var doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
18619
- var singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
18620
- var backtickQuoteEscapedCharsRegExp = /\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g;
18620
+ var doubleQuoteEscapedCharsRegExp = /[\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
18621
+ var singleQuoteEscapedCharsRegExp = /[\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
18622
+ var backtickQuoteEscapedCharsRegExp = /\r\n|[\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g;
18621
18623
  var escapedCharsMap = new Map(Object.entries({
18622
18624
  " ": "\\t",
18623
18625
  "\v": "\\v",
@@ -18662,8 +18664,8 @@ function escapeNonAsciiString(s, quoteChar) {
18662
18664
  s = escapeString(s, quoteChar);
18663
18665
  return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, (c) => encodeUtf16EscapeSequence(c.charCodeAt(0))) : s;
18664
18666
  }
18665
- var jsxDoubleQuoteEscapedCharsRegExp = /[\"\u0000-\u001f\u2028\u2029\u0085]/g;
18666
- var jsxSingleQuoteEscapedCharsRegExp = /[\'\u0000-\u001f\u2028\u2029\u0085]/g;
18667
+ var jsxDoubleQuoteEscapedCharsRegExp = /["\u0000-\u001f\u2028\u2029\u0085]/g;
18668
+ var jsxSingleQuoteEscapedCharsRegExp = /['\u0000-\u001f\u2028\u2029\u0085]/g;
18667
18669
  var jsxEscapedCharsMap = new Map(Object.entries({
18668
18670
  '"': """,
18669
18671
  "'": "'"
@@ -19039,6 +19041,12 @@ function parameterIsThisKeyword(parameter) {
19039
19041
  function isThisIdentifier(node) {
19040
19042
  return !!node && node.kind === 80 /* Identifier */ && identifierIsThisKeyword(node);
19041
19043
  }
19044
+ function isInTypeQuery(node) {
19045
+ return !!findAncestor(
19046
+ node,
19047
+ (n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
19048
+ );
19049
+ }
19042
19050
  function isThisInTypeQuery(node) {
19043
19051
  if (!isThisIdentifier(node)) {
19044
19052
  return false;
@@ -20536,6 +20544,9 @@ function getAllowJSCompilerOption(compilerOptions) {
20536
20544
  function getUseDefineForClassFields(compilerOptions) {
20537
20545
  return compilerOptions.useDefineForClassFields === void 0 ? getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
20538
20546
  }
20547
+ function getEmitStandardClassFields(compilerOptions) {
20548
+ return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
20549
+ }
20539
20550
  function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) {
20540
20551
  return optionsHaveChanges(oldOptions, newOptions, semanticDiagnosticsOptionDeclarations);
20541
20552
  }
@@ -20640,7 +20651,7 @@ function tryRemoveDirectoryPrefix(path, dirPath, getCanonicalFileName) {
20640
20651
  const withoutPrefix = tryRemovePrefix(path, dirPath, getCanonicalFileName);
20641
20652
  return withoutPrefix === void 0 ? void 0 : stripLeadingDirectorySeparator(withoutPrefix);
20642
20653
  }
20643
- var reservedCharacterPattern = /[^\w\s\/]/g;
20654
+ var reservedCharacterPattern = /[^\w\s/]/g;
20644
20655
  function regExpEscape(text) {
20645
20656
  return text.replace(reservedCharacterPattern, escapeRegExpCharacter);
20646
20657
  }
@@ -47753,6 +47764,7 @@ function createTypeChecker(host) {
47753
47764
  var moduleKind = getEmitModuleKind(compilerOptions);
47754
47765
  var legacyDecorators = !!compilerOptions.experimentalDecorators;
47755
47766
  var useDefineForClassFields = getUseDefineForClassFields(compilerOptions);
47767
+ var emitStandardClassFields = getEmitStandardClassFields(compilerOptions);
47756
47768
  var allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions);
47757
47769
  var strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks");
47758
47770
  var strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes");
@@ -49107,7 +49119,7 @@ function createTypeChecker(host) {
49107
49119
  false
49108
49120
  );
49109
49121
  } else if (isParameterPropertyDeclaration(declaration, declaration.parent)) {
49110
- return !(getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && useDefineForClassFields && getContainingClass(declaration) === getContainingClass(usage) && isUsedInFunctionOrInstanceProperty(usage, declaration));
49122
+ return !(emitStandardClassFields && getContainingClass(declaration) === getContainingClass(usage) && isUsedInFunctionOrInstanceProperty(usage, declaration));
49111
49123
  }
49112
49124
  return true;
49113
49125
  }
@@ -49121,7 +49133,7 @@ function createTypeChecker(host) {
49121
49133
  return true;
49122
49134
  }
49123
49135
  if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {
49124
- if (getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */ && useDefineForClassFields && getContainingClass(declaration) && (isPropertyDeclaration(declaration) || isParameterPropertyDeclaration(declaration, declaration.parent))) {
49136
+ if (emitStandardClassFields && getContainingClass(declaration) && (isPropertyDeclaration(declaration) || isParameterPropertyDeclaration(declaration, declaration.parent))) {
49125
49137
  return !isPropertyImmediatelyReferencedWithinDeclaration(
49126
49138
  declaration,
49127
49139
  usage,
@@ -49245,7 +49257,7 @@ function createTypeChecker(host) {
49245
49257
  return requiresScopeChangeWorker(node.name);
49246
49258
  case 172 /* PropertyDeclaration */:
49247
49259
  if (hasStaticModifier(node)) {
49248
- return target < 99 /* ESNext */ || !useDefineForClassFields;
49260
+ return !emitStandardClassFields;
49249
49261
  }
49250
49262
  return requiresScopeChangeWorker(node.name);
49251
49263
  default:
@@ -49516,7 +49528,7 @@ function createTypeChecker(host) {
49516
49528
  }
49517
49529
  }
49518
49530
  function checkAndReportErrorForInvalidInitializer() {
49519
- if (propertyWithInvalidInitializer && !(useDefineForClassFields && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */)) {
49531
+ if (propertyWithInvalidInitializer && !emitStandardClassFields) {
49520
49532
  error2(
49521
49533
  errorLocation,
49522
49534
  errorLocation && propertyWithInvalidInitializer.type && textRangeContainsPositionInclusive(propertyWithInvalidInitializer.type, errorLocation.pos) ? Diagnostics.Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor : Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,
@@ -59724,7 +59736,7 @@ function createTypeChecker(host) {
59724
59736
  return getReturnTypeOfTypeTag(declaration);
59725
59737
  }
59726
59738
  function isResolvingReturnTypeOfSignature(signature) {
59727
- return !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0;
59739
+ return signature.compositeSignatures && some(signature.compositeSignatures, isResolvingReturnTypeOfSignature) || !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0;
59728
59740
  }
59729
59741
  function getRestTypeOfSignature(signature) {
59730
59742
  return tryGetRestTypeOfSignature(signature) || anyType;
@@ -61072,6 +61084,9 @@ function createTypeChecker(host) {
61072
61084
  function getEndElementCount(type, flags) {
61073
61085
  return type.elementFlags.length - findLastIndex(type.elementFlags, (f) => !(f & flags)) - 1;
61074
61086
  }
61087
+ function getTotalFixedElementCount(type) {
61088
+ return type.fixedLength + getEndElementCount(type, 3 /* Fixed */);
61089
+ }
61075
61090
  function getElementTypes(type) {
61076
61091
  const typeArguments = getTypeArguments(type);
61077
61092
  const arity = getTypeReferenceArity(type);
@@ -61977,10 +61992,7 @@ function createTypeChecker(host) {
61977
61992
  }
61978
61993
  if (index >= 0) {
61979
61994
  errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, numberType));
61980
- return mapType(objectType, (t) => {
61981
- const restType = getRestTypeOfTupleType(t) || undefinedType;
61982
- return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType, missingType]) : restType;
61983
- });
61995
+ return getTupleElementTypeOutOfStartCount(objectType, index, accessFlags & 1 /* IncludeUndefined */ ? missingType : void 0);
61984
61996
  }
61985
61997
  }
61986
61998
  }
@@ -62265,7 +62277,7 @@ function createTypeChecker(host) {
62265
62277
  }
62266
62278
  if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
62267
62279
  accessFlags |= 1 /* IncludeUndefined */;
62268
- if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)) || isGenericReducibleType(objectType))) {
62280
+ if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target)) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target))) || isGenericReducibleType(objectType))) {
62269
62281
  if (objectType.flags & 3 /* AnyOrUnknown */) {
62270
62282
  return objectType;
62271
62283
  }
@@ -64512,7 +64524,6 @@ function createTypeChecker(host) {
64512
64524
  let overrideNextErrorInfo = 0;
64513
64525
  let lastSkippedInfo;
64514
64526
  let incompatibleStack;
64515
- let skipParentCounter = 0;
64516
64527
  Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
64517
64528
  const result = isRelatedTo(
64518
64529
  source,
@@ -64688,15 +64699,7 @@ function createTypeChecker(host) {
64688
64699
  reportIncompatibleStack();
64689
64700
  if (message.elidedInCompatabilityPyramid)
64690
64701
  return;
64691
- if (skipParentCounter === 0) {
64692
- errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
64693
- } else {
64694
- skipParentCounter--;
64695
- }
64696
- }
64697
- function reportParentSkippedError(message, ...args) {
64698
- reportError(message, ...args);
64699
- skipParentCounter++;
64702
+ errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
64700
64703
  }
64701
64704
  function associateRelatedInfo(info) {
64702
64705
  Debug.assert(!!errorInfo);
@@ -65033,14 +65036,14 @@ function createTypeChecker(host) {
65033
65036
  }
65034
65037
  }
65035
65038
  if (suggestion !== void 0) {
65036
- reportParentSkippedError(
65039
+ reportError(
65037
65040
  Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,
65038
65041
  symbolToString(prop),
65039
65042
  typeToString(errorTarget),
65040
65043
  suggestion
65041
65044
  );
65042
65045
  } else {
65043
- reportParentSkippedError(
65046
+ reportError(
65044
65047
  Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
65045
65048
  symbolToString(prop),
65046
65049
  typeToString(errorTarget)
@@ -66053,7 +66056,7 @@ function createTypeChecker(host) {
66053
66056
  const allowStructuralFallback = targetTypeArguments && hasCovariantVoidArgument(targetTypeArguments, variances);
66054
66057
  varianceCheckFailed = !allowStructuralFallback;
66055
66058
  if (variances !== emptyArray && !allowStructuralFallback) {
66056
- if (varianceCheckFailed && !(reportErrors2 && some(variances, (v) => (v & 7 /* VarianceMask */) === 0 /* Invariant */))) {
66059
+ if (varianceCheckFailed && !some(variances, (v) => (v & 7 /* VarianceMask */) === 0 /* Invariant */)) {
66057
66060
  return 0 /* False */;
66058
66061
  }
66059
66062
  originalErrorInfo = errorInfo;
@@ -67285,17 +67288,7 @@ function createTypeChecker(host) {
67285
67288
  return propType;
67286
67289
  }
67287
67290
  if (everyType(type, isTupleType)) {
67288
- return mapType(type, (t) => {
67289
- const tupleType = t;
67290
- const restType = getRestTypeOfTupleType(tupleType);
67291
- if (!restType) {
67292
- return undefinedType;
67293
- }
67294
- if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) {
67295
- return getUnionType([restType, undefinedType]);
67296
- }
67297
- return restType;
67298
- });
67291
+ return getTupleElementTypeOutOfStartCount(type, index, compilerOptions.noUncheckedIndexedAccess ? undefinedType : void 0);
67299
67292
  }
67300
67293
  return void 0;
67301
67294
  }
@@ -67363,6 +67356,19 @@ function createTypeChecker(host) {
67363
67356
  function getRestTypeOfTupleType(type) {
67364
67357
  return getElementTypeOfSliceOfTupleType(type, type.target.fixedLength);
67365
67358
  }
67359
+ function getTupleElementTypeOutOfStartCount(type, index, undefinedOrMissingType2) {
67360
+ return mapType(type, (t) => {
67361
+ const tupleType = t;
67362
+ const restType = getRestTypeOfTupleType(tupleType);
67363
+ if (!restType) {
67364
+ return undefinedType;
67365
+ }
67366
+ if (undefinedOrMissingType2 && index >= getTotalFixedElementCount(tupleType.target)) {
67367
+ return getUnionType([restType, undefinedOrMissingType2]);
67368
+ }
67369
+ return restType;
67370
+ });
67371
+ }
67366
67372
  function getRestArrayTypeOfTupleType(type) {
67367
67373
  const restType = getRestTypeOfTupleType(type);
67368
67374
  return restType && createArrayType(restType);
@@ -68862,12 +68868,6 @@ function createTypeChecker(host) {
68862
68868
  }
68863
68869
  return links.resolvedSymbol;
68864
68870
  }
68865
- function isInTypeQuery(node) {
68866
- return !!findAncestor(
68867
- node,
68868
- (n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
68869
- );
68870
- }
68871
68871
  function isInAmbientOrTypeNode(node) {
68872
68872
  return !!(node.flags & 33554432 /* Ambient */ || findAncestor(node, (n) => isInterfaceDeclaration(n) || isTypeAliasDeclaration(n) || isTypeLiteralNode(n)));
68873
68873
  }
@@ -74090,7 +74090,7 @@ function createTypeChecker(host) {
74090
74090
  }
74091
74091
  let diagnosticMessage;
74092
74092
  const declarationName = idText(right);
74093
- if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 32 /* Static */) && (compilerOptions.useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) {
74093
+ if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 32 /* Static */) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) {
74094
74094
  diagnosticMessage = error2(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
74095
74095
  } else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
74096
74096
  diagnosticMessage = error2(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
@@ -79802,7 +79802,7 @@ function createTypeChecker(host) {
79802
79802
  case "length":
79803
79803
  case "caller":
79804
79804
  case "arguments":
79805
- if (compilerOptions.useDefineForClassFields) {
79805
+ if (useDefineForClassFields) {
79806
79806
  break;
79807
79807
  }
79808
79808
  case "prototype":
@@ -79950,7 +79950,7 @@ function createTypeChecker(host) {
79950
79950
  if (classExtendsNull) {
79951
79951
  error2(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
79952
79952
  }
79953
- const superCallShouldBeRootLevel = (getEmitScriptTarget(compilerOptions) !== 99 /* ESNext */ || !useDefineForClassFields) && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 16476 /* ParameterPropertyModifier */)));
79953
+ const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 16476 /* ParameterPropertyModifier */)));
79954
79954
  if (superCallShouldBeRootLevel) {
79955
79955
  if (!superCallIsRootLevelInConstructor(superCall, node.body)) {
79956
79956
  error2(superCall, Diagnostics.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers);
@@ -83229,7 +83229,7 @@ function createTypeChecker(host) {
83229
83229
  node
83230
83230
  );
83231
83231
  const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9 /* ES2022 */;
83232
- const willTransformInitializers = !useDefineForClassFields || languageVersion < 9 /* ES2022 */;
83232
+ const willTransformInitializers = !emitStandardClassFields;
83233
83233
  if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) {
83234
83234
  for (const member of node.members) {
83235
83235
  if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated(
@@ -93529,7 +93529,7 @@ function transformTypeScript(context) {
93529
93529
  const constantValue = tryGetConstEnumValue(node);
93530
93530
  if (constantValue !== void 0) {
93531
93531
  setConstantValue(node, constantValue);
93532
- const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : factory2.createNumericLiteral(constantValue);
93532
+ const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constantValue))) : factory2.createNumericLiteral(constantValue);
93533
93533
  if (!compilerOptions.removeComments) {
93534
93534
  const originalNode = getOriginalNode(node, isAccessExpression);
93535
93535
  addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
@@ -115815,7 +115815,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115815
115815
  return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !stringContains(text, tokenToString(25 /* DotToken */)) && !stringContains(text, String.fromCharCode(69 /* E */)) && !stringContains(text, String.fromCharCode(101 /* e */));
115816
115816
  } else if (isAccessExpression(expression)) {
115817
115817
  const constantValue = getConstantValue(expression);
115818
- return typeof constantValue === "number" && isFinite(constantValue) && Math.floor(constantValue) === constantValue;
115818
+ return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue;
115819
115819
  }
115820
115820
  }
115821
115821
  function emitElementAccessExpression(node) {
@@ -135896,7 +135896,7 @@ function preProcessFile(sourceText, readImportFiles = true, detectJavaScriptImpo
135896
135896
  }
135897
135897
 
135898
135898
  // src/services/sourcemaps.ts
135899
- var base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+\/=]+)$)?/;
135899
+ var base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+/=]+)$)?/;
135900
135900
  function getSourceMapper(host) {
135901
135901
  const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
135902
135902
  const currentDirectory = host.getCurrentDirectory();
@@ -144678,7 +144678,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
144678
144678
  }
144679
144679
  return result;
144680
144680
  function escapeRegExp(str) {
144681
- return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
144681
+ return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
144682
144682
  }
144683
144683
  function getTodoCommentsRegExp() {
144684
144684
  const singleLineCommentStart = /(?:\/\/+\s*)/.source;
@@ -149704,7 +149704,7 @@ function getLeftAndRightSiblings(typedefNode) {
149704
149704
  function findEndOfTextBetween(jsDocComment, from, to) {
149705
149705
  const comment = jsDocComment.getText().substring(from - jsDocComment.getStart(), to - jsDocComment.getStart());
149706
149706
  for (let i = comment.length; i > 0; i--) {
149707
- if (!/[*\/\s]/g.test(comment.substring(i - 1, i))) {
149707
+ if (!/[*/\s]/g.test(comment.substring(i - 1, i))) {
149708
149708
  return from + i;
149709
149709
  }
149710
149710
  }
@@ -153052,7 +153052,7 @@ function doChange22(changes, sourceFile, arg, expression) {
153052
153052
  );
153053
153053
  }
153054
153054
  function getSuggestion(messageText) {
153055
- const [_, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/\'(.*)\'/) || [];
153055
+ const [_, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/'(.*)'/) || [];
153056
153056
  return suggestion;
153057
153057
  }
153058
153058
 
@@ -158884,7 +158884,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
158884
158884
  return { kind: 1 /* JsDocTagName */ };
158885
158885
  } else {
158886
158886
  const lineStart = getLineStartPositionForPosition(position, sourceFile);
158887
- if (!/[^\*|\s(/)]/.test(sourceFile.text.substring(lineStart, position))) {
158887
+ if (!/[^*|\s(/)]/.test(sourceFile.text.substring(lineStart, position))) {
158888
158888
  return { kind: 2 /* JsDocTag */ };
158889
158889
  }
158890
158890
  }
@@ -159183,24 +159183,34 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
159183
159183
  }
159184
159184
  }
159185
159185
  }
159186
- if (!isTypeLocation) {
159186
+ if (!isTypeLocation || isInTypeQuery(node)) {
159187
159187
  typeChecker.tryGetThisTypeAt(
159188
159188
  node,
159189
159189
  /*includeGlobalThis*/
159190
159190
  false
159191
159191
  );
159192
159192
  let type = typeChecker.getTypeAtLocation(node).getNonOptionalType();
159193
- let insertQuestionDot = false;
159194
- if (type.isNullableType()) {
159195
- const canCorrectToQuestionDot = isRightOfDot && !isRightOfQuestionDot && preferences.includeAutomaticOptionalChainCompletions !== false;
159196
- if (canCorrectToQuestionDot || isRightOfQuestionDot) {
159197
- type = type.getNonNullableType();
159198
- if (canCorrectToQuestionDot) {
159199
- insertQuestionDot = true;
159193
+ if (!isTypeLocation) {
159194
+ let insertQuestionDot = false;
159195
+ if (type.isNullableType()) {
159196
+ const canCorrectToQuestionDot = isRightOfDot && !isRightOfQuestionDot && preferences.includeAutomaticOptionalChainCompletions !== false;
159197
+ if (canCorrectToQuestionDot || isRightOfQuestionDot) {
159198
+ type = type.getNonNullableType();
159199
+ if (canCorrectToQuestionDot) {
159200
+ insertQuestionDot = true;
159201
+ }
159200
159202
  }
159201
159203
  }
159204
+ addTypeProperties(type, !!(node.flags & 65536 /* AwaitContext */), insertQuestionDot);
159205
+ } else {
159206
+ addTypeProperties(
159207
+ type.getNonNullableType(),
159208
+ /*insertAwait*/
159209
+ false,
159210
+ /*insertQuestionDot*/
159211
+ false
159212
+ );
159202
159213
  }
159203
- addTypeProperties(type, !!(node.flags & 65536 /* AwaitContext */), insertQuestionDot);
159204
159214
  }
159205
159215
  }
159206
159216
  function addTypeProperties(type, insertAwait, insertQuestionDot) {
@@ -172652,6 +172662,7 @@ __export(ts_exports2, {
172652
172662
  getEmitModuleKind: () => getEmitModuleKind,
172653
172663
  getEmitModuleResolutionKind: () => getEmitModuleResolutionKind,
172654
172664
  getEmitScriptTarget: () => getEmitScriptTarget,
172665
+ getEmitStandardClassFields: () => getEmitStandardClassFields,
172655
172666
  getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer,
172656
172667
  getEnclosingContainer: () => getEnclosingContainer,
172657
172668
  getEncodedSemanticClassifications: () => getEncodedSemanticClassifications,
@@ -173327,6 +173338,7 @@ __export(ts_exports2, {
173327
173338
  isInString: () => isInString,
173328
173339
  isInTemplateString: () => isInTemplateString,
173329
173340
  isInTopLevelContext: () => isInTopLevelContext,
173341
+ isInTypeQuery: () => isInTypeQuery,
173330
173342
  isIncrementalCompilation: () => isIncrementalCompilation,
173331
173343
  isIndexSignatureDeclaration: () => isIndexSignatureDeclaration,
173332
173344
  isIndexedAccessTypeNode: () => isIndexedAccessTypeNode,
@@ -178196,7 +178208,7 @@ var indentStyle = new Map(Object.entries({
178196
178208
  var defaultTypeSafeList = {
178197
178209
  "jquery": {
178198
178210
  // jquery files can have names like "jquery-1.10.2.min.js" (or "jquery.intellisense.js")
178199
- match: /jquery(-[\d\.]+)?(\.intellisense)?(\.min)?\.js$/i,
178211
+ match: /jquery(-[\d.]+)?(\.intellisense)?(\.min)?\.js$/i,
178200
178212
  types: ["jquery"]
178201
178213
  },
178202
178214
  "WinJS": {
@@ -181098,7 +181110,7 @@ Dynamic files must always be opened with service's current directory or service
181098
181110
  }
181099
181111
  }
181100
181112
  if (!exclude) {
181101
- if (/^.+[\.-]min\.js$/.test(normalizedNames[i])) {
181113
+ if (/^.+[.-]min\.js$/.test(normalizedNames[i])) {
181102
181114
  excludedFiles.push(normalizedNames[i]);
181103
181115
  } else {
181104
181116
  filesToKeep.push(proj.rootFiles[i]);
@@ -181419,7 +181431,7 @@ Dynamic files must always be opened with service's current directory or service
181419
181431
  }
181420
181432
  };
181421
181433
  /** Makes a filename safe to insert in a RegExp */
181422
- _ProjectService.filenameEscapeRegexp = /[-\/\\^$*+?.()|[\]{}]/g;
181434
+ _ProjectService.filenameEscapeRegexp = /[-/\\^$*+?.()|[\]{}]/g;
181423
181435
  var ProjectService3 = _ProjectService;
181424
181436
  function createIncompleteCompletionsCache() {
181425
181437
  let info;
@@ -187180,6 +187192,7 @@ start(initializeNodeSystem(), require("os").platform());
187180
187192
  getEmitModuleKind,
187181
187193
  getEmitModuleResolutionKind,
187182
187194
  getEmitScriptTarget,
187195
+ getEmitStandardClassFields,
187183
187196
  getEnclosingBlockScopeContainer,
187184
187197
  getEnclosingContainer,
187185
187198
  getEncodedSemanticClassifications,
@@ -187855,6 +187868,7 @@ start(initializeNodeSystem(), require("os").platform());
187855
187868
  isInString,
187856
187869
  isInTemplateString,
187857
187870
  isInTopLevelContext,
187871
+ isInTypeQuery,
187858
187872
  isIncrementalCompilation,
187859
187873
  isIndexSignatureDeclaration,
187860
187874
  isIndexedAccessTypeNode,