typescript 5.1.0-dev.20230410 → 5.1.0-dev.20230411

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
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.1";
21
- var version = `${versionMajorMinor}.0-dev.20230410`;
21
+ var version = `${versionMajorMinor}.0-dev.20230411`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -11570,7 +11570,7 @@ function insertStatementAfterCustomPrologue(to, statement) {
11570
11570
  function isRecognizedTripleSlashComment(text, commentPos, commentEnd) {
11571
11571
  if (text.charCodeAt(commentPos + 1) === 47 /* slash */ && commentPos + 2 < commentEnd && text.charCodeAt(commentPos + 2) === 47 /* slash */) {
11572
11572
  const textSubStr = text.substring(commentPos, commentEnd);
11573
- return fullTripleSlashReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false;
11573
+ return fullTripleSlashReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDModuleRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || fullTripleSlashLibReferenceRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false;
11574
11574
  }
11575
11575
  return false;
11576
11576
  }
@@ -12544,7 +12544,9 @@ function getJSDocCommentRanges(node, text) {
12544
12544
  }
12545
12545
  var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
12546
12546
  var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*<reference\s+types\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
12547
+ var fullTripleSlashLibReferenceRegEx = /^(\/\/\/\s*<reference\s+lib\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
12547
12548
  var fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*<amd-dependency\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
12549
+ var fullTripleSlashAMDModuleRegEx = /^\/\/\/\s*<amd-module\s+.*?\/>/;
12548
12550
  var defaultLibReferenceRegEx = /^(\/\/\/\s*<reference\s+no-default-lib\s*=\s*)(('[^']*')|("[^"]*"))\s*\/>/;
12549
12551
  function isPartOfTypeNode(node) {
12550
12552
  if (181 /* FirstTypeNode */ <= node.kind && node.kind <= 204 /* LastTypeNode */) {
@@ -65820,12 +65822,14 @@ function createTypeChecker(host) {
65820
65822
  const isOuterVariable = flowContainer !== declarationContainer;
65821
65823
  const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
65822
65824
  const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
65825
+ const typeIsAutomatic = type === autoType || type === autoArrayType;
65826
+ const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 234 /* NonNullExpression */;
65823
65827
  while (flowContainer !== declarationContainer && (flowContainer.kind === 217 /* FunctionExpression */ || flowContainer.kind === 218 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
65824
65828
  flowContainer = getControlFlowContainer(flowContainer);
65825
65829
  }
65826
65830
  const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 280 /* ExportSpecifier */) || node.parent.kind === 234 /* NonNullExpression */ || declaration.kind === 259 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
65827
- const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
65828
- const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
65831
+ const initialType = isAutomaticTypeInNonNull ? undefinedType : assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : typeIsAutomatic ? undefinedType : getOptionalType(type);
65832
+ const flowType = isAutomaticTypeInNonNull ? getNonNullableType(getFlowTypeOfReference(node, type, initialType, flowContainer)) : getFlowTypeOfReference(node, type, initialType, flowContainer);
65829
65833
  if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
65830
65834
  if (flowType === autoType || flowType === autoArrayType) {
65831
65835
  if (noImplicitAny) {
@@ -90603,6 +90607,8 @@ function transformESDecorators(context) {
90603
90607
  endLexicalEnvironment,
90604
90608
  hoistVariableDeclaration
90605
90609
  } = context;
90610
+ const compilerOptions = context.getCompilerOptions();
90611
+ const languageVersion = getEmitScriptTarget(compilerOptions);
90606
90612
  let top;
90607
90613
  let classInfo;
90608
90614
  let classThis;
@@ -91276,8 +91282,21 @@ function transformESDecorators(context) {
91276
91282
  Debug.assertIsDefined(node.name, "A class declaration that is not a default export must have a name.");
91277
91283
  const iife = transformClassLike(node, factory2.createStringLiteralFromNode(node.name));
91278
91284
  const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
91285
+ const declName = languageVersion <= 2 /* ES2015 */ ? factory2.getInternalName(
91286
+ node,
91287
+ /*allowComments*/
91288
+ false,
91289
+ /*allowSourceMaps*/
91290
+ true
91291
+ ) : factory2.getLocalName(
91292
+ node,
91293
+ /*allowComments*/
91294
+ false,
91295
+ /*allowSourceMaps*/
91296
+ true
91297
+ );
91279
91298
  const varDecl = factory2.createVariableDeclaration(
91280
- node.name,
91299
+ declName,
91281
91300
  /*exclamationToken*/
91282
91301
  void 0,
91283
91302
  /*type*/
package/lib/tsserver.js CHANGED
@@ -2293,7 +2293,7 @@ module.exports = __toCommonJS(server_exports);
2293
2293
 
2294
2294
  // src/compiler/corePublic.ts
2295
2295
  var versionMajorMinor = "5.1";
2296
- var version = `${versionMajorMinor}.0-dev.20230410`;
2296
+ var version = `${versionMajorMinor}.0-dev.20230411`;
2297
2297
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2298
2298
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2299
2299
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -15309,7 +15309,7 @@ function insertStatementAfterCustomPrologue(to, statement) {
15309
15309
  function isRecognizedTripleSlashComment(text, commentPos, commentEnd) {
15310
15310
  if (text.charCodeAt(commentPos + 1) === 47 /* slash */ && commentPos + 2 < commentEnd && text.charCodeAt(commentPos + 2) === 47 /* slash */) {
15311
15311
  const textSubStr = text.substring(commentPos, commentEnd);
15312
- return fullTripleSlashReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false;
15312
+ return fullTripleSlashReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDModuleRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || fullTripleSlashLibReferenceRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false;
15313
15313
  }
15314
15314
  return false;
15315
15315
  }
@@ -16344,7 +16344,9 @@ function getJSDocCommentRanges(node, text) {
16344
16344
  }
16345
16345
  var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
16346
16346
  var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*<reference\s+types\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
16347
+ var fullTripleSlashLibReferenceRegEx = /^(\/\/\/\s*<reference\s+lib\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
16347
16348
  var fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*<amd-dependency\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
16349
+ var fullTripleSlashAMDModuleRegEx = /^\/\/\/\s*<amd-module\s+.*?\/>/;
16348
16350
  var defaultLibReferenceRegEx = /^(\/\/\/\s*<reference\s+no-default-lib\s*=\s*)(('[^']*')|("[^"]*"))\s*\/>/;
16349
16351
  function isPartOfTypeNode(node) {
16350
16352
  if (181 /* FirstTypeNode */ <= node.kind && node.kind <= 204 /* LastTypeNode */) {
@@ -70470,12 +70472,14 @@ function createTypeChecker(host) {
70470
70472
  const isOuterVariable = flowContainer !== declarationContainer;
70471
70473
  const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
70472
70474
  const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
70475
+ const typeIsAutomatic = type === autoType || type === autoArrayType;
70476
+ const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 234 /* NonNullExpression */;
70473
70477
  while (flowContainer !== declarationContainer && (flowContainer.kind === 217 /* FunctionExpression */ || flowContainer.kind === 218 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
70474
70478
  flowContainer = getControlFlowContainer(flowContainer);
70475
70479
  }
70476
70480
  const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 280 /* ExportSpecifier */) || node.parent.kind === 234 /* NonNullExpression */ || declaration.kind === 259 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
70477
- const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
70478
- const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
70481
+ const initialType = isAutomaticTypeInNonNull ? undefinedType : assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : typeIsAutomatic ? undefinedType : getOptionalType(type);
70482
+ const flowType = isAutomaticTypeInNonNull ? getNonNullableType(getFlowTypeOfReference(node, type, initialType, flowContainer)) : getFlowTypeOfReference(node, type, initialType, flowContainer);
70479
70483
  if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
70480
70484
  if (flowType === autoType || flowType === autoArrayType) {
70481
70485
  if (noImplicitAny) {
@@ -95424,6 +95428,8 @@ function transformESDecorators(context) {
95424
95428
  endLexicalEnvironment,
95425
95429
  hoistVariableDeclaration
95426
95430
  } = context;
95431
+ const compilerOptions = context.getCompilerOptions();
95432
+ const languageVersion = getEmitScriptTarget(compilerOptions);
95427
95433
  let top;
95428
95434
  let classInfo;
95429
95435
  let classThis;
@@ -96097,8 +96103,21 @@ function transformESDecorators(context) {
96097
96103
  Debug.assertIsDefined(node.name, "A class declaration that is not a default export must have a name.");
96098
96104
  const iife = transformClassLike(node, factory2.createStringLiteralFromNode(node.name));
96099
96105
  const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
96106
+ const declName = languageVersion <= 2 /* ES2015 */ ? factory2.getInternalName(
96107
+ node,
96108
+ /*allowComments*/
96109
+ false,
96110
+ /*allowSourceMaps*/
96111
+ true
96112
+ ) : factory2.getLocalName(
96113
+ node,
96114
+ /*allowComments*/
96115
+ false,
96116
+ /*allowSourceMaps*/
96117
+ true
96118
+ );
96100
96119
  const varDecl = factory2.createVariableDeclaration(
96101
- node.name,
96120
+ declName,
96102
96121
  /*exclamationToken*/
96103
96122
  void 0,
96104
96123
  /*type*/
@@ -146821,6 +146840,9 @@ function inferTypeFromReferences(program, references, cancellationToken) {
146821
146840
  case 37 /* EqualsEqualsEqualsToken */:
146822
146841
  case 38 /* ExclamationEqualsEqualsToken */:
146823
146842
  case 36 /* ExclamationEqualsToken */:
146843
+ case 77 /* AmpersandAmpersandEqualsToken */:
146844
+ case 78 /* QuestionQuestionEqualsToken */:
146845
+ case 76 /* BarBarEqualsToken */:
146824
146846
  addCandidateType(usage, checker.getTypeAtLocation(parent2.left === node ? parent2.right : parent2.left));
146825
146847
  break;
146826
146848
  case 103 /* InKeyword */:
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.1";
38
- version = `${versionMajorMinor}.0-dev.20230410`;
38
+ version = `${versionMajorMinor}.0-dev.20230411`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -13136,7 +13136,7 @@ ${lanes.join("\n")}
13136
13136
  function isRecognizedTripleSlashComment(text, commentPos, commentEnd) {
13137
13137
  if (text.charCodeAt(commentPos + 1) === 47 /* slash */ && commentPos + 2 < commentEnd && text.charCodeAt(commentPos + 2) === 47 /* slash */) {
13138
13138
  const textSubStr = text.substring(commentPos, commentEnd);
13139
- return fullTripleSlashReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false;
13139
+ return fullTripleSlashReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDModuleRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || fullTripleSlashLibReferenceRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false;
13140
13140
  }
13141
13141
  return false;
13142
13142
  }
@@ -19111,7 +19111,7 @@ ${lanes.join("\n")}
19111
19111
  const tag = getJSDocSatisfiesTag(node);
19112
19112
  return tag && tag.typeExpression && tag.typeExpression.type;
19113
19113
  }
19114
- var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
19114
+ var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashLibReferenceRegEx, fullTripleSlashAMDReferencePathRegEx, fullTripleSlashAMDModuleRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
19115
19115
  var init_utilities = __esm({
19116
19116
  "src/compiler/utilities.ts"() {
19117
19117
  "use strict";
@@ -19131,7 +19131,9 @@ ${lanes.join("\n")}
19131
19131
  })(GetLiteralTextFlags || {});
19132
19132
  fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
19133
19133
  fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*<reference\s+types\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
19134
+ fullTripleSlashLibReferenceRegEx = /^(\/\/\/\s*<reference\s+lib\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
19134
19135
  fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*<amd-dependency\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
19136
+ fullTripleSlashAMDModuleRegEx = /^\/\/\/\s*<amd-module\s+.*?\/>/;
19135
19137
  defaultLibReferenceRegEx = /^(\/\/\/\s*<reference\s+no-default-lib\s*=\s*)(('[^']*')|("[^"]*"))\s*\/>/;
19136
19138
  AssignmentKind = /* @__PURE__ */ ((AssignmentKind2) => {
19137
19139
  AssignmentKind2[AssignmentKind2["None"] = 0] = "None";
@@ -68271,12 +68273,14 @@ ${lanes.join("\n")}
68271
68273
  const isOuterVariable = flowContainer !== declarationContainer;
68272
68274
  const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
68273
68275
  const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
68276
+ const typeIsAutomatic = type === autoType || type === autoArrayType;
68277
+ const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 234 /* NonNullExpression */;
68274
68278
  while (flowContainer !== declarationContainer && (flowContainer.kind === 217 /* FunctionExpression */ || flowContainer.kind === 218 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
68275
68279
  flowContainer = getControlFlowContainer(flowContainer);
68276
68280
  }
68277
68281
  const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 280 /* ExportSpecifier */) || node.parent.kind === 234 /* NonNullExpression */ || declaration.kind === 259 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
68278
- const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
68279
- const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
68282
+ const initialType = isAutomaticTypeInNonNull ? undefinedType : assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : typeIsAutomatic ? undefinedType : getOptionalType(type);
68283
+ const flowType = isAutomaticTypeInNonNull ? getNonNullableType(getFlowTypeOfReference(node, type, initialType, flowContainer)) : getFlowTypeOfReference(node, type, initialType, flowContainer);
68280
68284
  if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
68281
68285
  if (flowType === autoType || flowType === autoArrayType) {
68282
68286
  if (noImplicitAny) {
@@ -93418,6 +93422,8 @@ ${lanes.join("\n")}
93418
93422
  endLexicalEnvironment,
93419
93423
  hoistVariableDeclaration
93420
93424
  } = context;
93425
+ const compilerOptions = context.getCompilerOptions();
93426
+ const languageVersion = getEmitScriptTarget(compilerOptions);
93421
93427
  let top;
93422
93428
  let classInfo;
93423
93429
  let classThis;
@@ -94091,8 +94097,21 @@ ${lanes.join("\n")}
94091
94097
  Debug.assertIsDefined(node.name, "A class declaration that is not a default export must have a name.");
94092
94098
  const iife = transformClassLike(node, factory2.createStringLiteralFromNode(node.name));
94093
94099
  const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
94100
+ const declName = languageVersion <= 2 /* ES2015 */ ? factory2.getInternalName(
94101
+ node,
94102
+ /*allowComments*/
94103
+ false,
94104
+ /*allowSourceMaps*/
94105
+ true
94106
+ ) : factory2.getLocalName(
94107
+ node,
94108
+ /*allowComments*/
94109
+ false,
94110
+ /*allowSourceMaps*/
94111
+ true
94112
+ );
94094
94113
  const varDecl = factory2.createVariableDeclaration(
94095
- node.name,
94114
+ declName,
94096
94115
  /*exclamationToken*/
94097
94116
  void 0,
94098
94117
  /*type*/
@@ -145599,6 +145618,9 @@ ${lanes.join("\n")}
145599
145618
  case 37 /* EqualsEqualsEqualsToken */:
145600
145619
  case 38 /* ExclamationEqualsEqualsToken */:
145601
145620
  case 36 /* ExclamationEqualsToken */:
145621
+ case 77 /* AmpersandAmpersandEqualsToken */:
145622
+ case 78 /* QuestionQuestionEqualsToken */:
145623
+ case 76 /* BarBarEqualsToken */:
145602
145624
  addCandidateType(usage, checker.getTypeAtLocation(parent2.left === node ? parent2.right : parent2.left));
145603
145625
  break;
145604
145626
  case 103 /* InKeyword */:
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.1";
38
- version = `${versionMajorMinor}.0-dev.20230410`;
38
+ version = `${versionMajorMinor}.0-dev.20230411`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -13136,7 +13136,7 @@ ${lanes.join("\n")}
13136
13136
  function isRecognizedTripleSlashComment(text, commentPos, commentEnd) {
13137
13137
  if (text.charCodeAt(commentPos + 1) === 47 /* slash */ && commentPos + 2 < commentEnd && text.charCodeAt(commentPos + 2) === 47 /* slash */) {
13138
13138
  const textSubStr = text.substring(commentPos, commentEnd);
13139
- return fullTripleSlashReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false;
13139
+ return fullTripleSlashReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDModuleRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || fullTripleSlashLibReferenceRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false;
13140
13140
  }
13141
13141
  return false;
13142
13142
  }
@@ -19111,7 +19111,7 @@ ${lanes.join("\n")}
19111
19111
  const tag = getJSDocSatisfiesTag(node);
19112
19112
  return tag && tag.typeExpression && tag.typeExpression.type;
19113
19113
  }
19114
- var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
19114
+ var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashLibReferenceRegEx, fullTripleSlashAMDReferencePathRegEx, fullTripleSlashAMDModuleRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
19115
19115
  var init_utilities = __esm({
19116
19116
  "src/compiler/utilities.ts"() {
19117
19117
  "use strict";
@@ -19131,7 +19131,9 @@ ${lanes.join("\n")}
19131
19131
  })(GetLiteralTextFlags || {});
19132
19132
  fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
19133
19133
  fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*<reference\s+types\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
19134
+ fullTripleSlashLibReferenceRegEx = /^(\/\/\/\s*<reference\s+lib\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
19134
19135
  fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*<amd-dependency\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
19136
+ fullTripleSlashAMDModuleRegEx = /^\/\/\/\s*<amd-module\s+.*?\/>/;
19135
19137
  defaultLibReferenceRegEx = /^(\/\/\/\s*<reference\s+no-default-lib\s*=\s*)(('[^']*')|("[^"]*"))\s*\/>/;
19136
19138
  AssignmentKind = /* @__PURE__ */ ((AssignmentKind2) => {
19137
19139
  AssignmentKind2[AssignmentKind2["None"] = 0] = "None";
@@ -68271,12 +68273,14 @@ ${lanes.join("\n")}
68271
68273
  const isOuterVariable = flowContainer !== declarationContainer;
68272
68274
  const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
68273
68275
  const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
68276
+ const typeIsAutomatic = type === autoType || type === autoArrayType;
68277
+ const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 234 /* NonNullExpression */;
68274
68278
  while (flowContainer !== declarationContainer && (flowContainer.kind === 217 /* FunctionExpression */ || flowContainer.kind === 218 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
68275
68279
  flowContainer = getControlFlowContainer(flowContainer);
68276
68280
  }
68277
68281
  const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 280 /* ExportSpecifier */) || node.parent.kind === 234 /* NonNullExpression */ || declaration.kind === 259 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
68278
- const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
68279
- const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
68282
+ const initialType = isAutomaticTypeInNonNull ? undefinedType : assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : typeIsAutomatic ? undefinedType : getOptionalType(type);
68283
+ const flowType = isAutomaticTypeInNonNull ? getNonNullableType(getFlowTypeOfReference(node, type, initialType, flowContainer)) : getFlowTypeOfReference(node, type, initialType, flowContainer);
68280
68284
  if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
68281
68285
  if (flowType === autoType || flowType === autoArrayType) {
68282
68286
  if (noImplicitAny) {
@@ -93418,6 +93422,8 @@ ${lanes.join("\n")}
93418
93422
  endLexicalEnvironment,
93419
93423
  hoistVariableDeclaration
93420
93424
  } = context;
93425
+ const compilerOptions = context.getCompilerOptions();
93426
+ const languageVersion = getEmitScriptTarget(compilerOptions);
93421
93427
  let top;
93422
93428
  let classInfo;
93423
93429
  let classThis;
@@ -94091,8 +94097,21 @@ ${lanes.join("\n")}
94091
94097
  Debug.assertIsDefined(node.name, "A class declaration that is not a default export must have a name.");
94092
94098
  const iife = transformClassLike(node, factory2.createStringLiteralFromNode(node.name));
94093
94099
  const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
94100
+ const declName = languageVersion <= 2 /* ES2015 */ ? factory2.getInternalName(
94101
+ node,
94102
+ /*allowComments*/
94103
+ false,
94104
+ /*allowSourceMaps*/
94105
+ true
94106
+ ) : factory2.getLocalName(
94107
+ node,
94108
+ /*allowComments*/
94109
+ false,
94110
+ /*allowSourceMaps*/
94111
+ true
94112
+ );
94094
94113
  const varDecl = factory2.createVariableDeclaration(
94095
- node.name,
94114
+ declName,
94096
94115
  /*exclamationToken*/
94097
94116
  void 0,
94098
94117
  /*type*/
@@ -145613,6 +145632,9 @@ ${lanes.join("\n")}
145613
145632
  case 37 /* EqualsEqualsEqualsToken */:
145614
145633
  case 38 /* ExclamationEqualsEqualsToken */:
145615
145634
  case 36 /* ExclamationEqualsToken */:
145635
+ case 77 /* AmpersandAmpersandEqualsToken */:
145636
+ case 78 /* QuestionQuestionEqualsToken */:
145637
+ case 76 /* BarBarEqualsToken */:
145616
145638
  addCandidateType(usage, checker.getTypeAtLocation(parent2.left === node ? parent2.right : parent2.left));
145617
145639
  break;
145618
145640
  case 103 /* InKeyword */:
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.1";
57
- var version = `${versionMajorMinor}.0-dev.20230410`;
57
+ var version = `${versionMajorMinor}.0-dev.20230411`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
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": "5.1.0-dev.20230410",
5
+ "version": "5.1.0-dev.20230411",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "14.21.1",
114
114
  "npm": "8.19.3"
115
115
  },
116
- "gitHead": "0f724c04308e20d93d397e82b11f82ad6f810c44"
116
+ "gitHead": "89a6482d60ed3d59b2b697ca29a6cf662ebbe20c"
117
117
  }