typescript 4.9.0-dev.20220921 → 4.9.0-dev.20220922

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.
@@ -108,7 +108,7 @@ var ts;
108
108
  // The following is baselined as a literal template type without intervention
109
109
  /** The version of the TypeScript compiler release */
110
110
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
111
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220921");
111
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220922");
112
112
  /* @internal */
113
113
  var Comparison;
114
114
  (function (Comparison) {
@@ -45252,6 +45252,7 @@ var ts;
45252
45252
  }
45253
45253
  }
45254
45254
  function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
45255
+ var _a;
45255
45256
  var candidate = ts.normalizePath(ts.combinePaths(nodeModulesDirectory, moduleName));
45256
45257
  // First look for a nested package.json, as in `node_modules/foo/bar/package.json`.
45257
45258
  var packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state);
@@ -45266,13 +45267,7 @@ var ts;
45266
45267
  return withPackageId(packageInfo, fromDirectory);
45267
45268
  }
45268
45269
  }
45269
- var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest;
45270
45270
  var loader = function (extensions, candidate, onlyRecordFailures, state) {
45271
- var _a;
45272
- // package exports are higher priority than file/directory lookups (and, if there's exports present, blocks them)
45273
- if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
45274
- return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
45275
- }
45276
45271
  var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
45277
45272
  loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.contents.packageJsonContent, packageInfo && packageInfo.contents.versionPaths);
45278
45273
  if (!pathAndExtension && packageInfo
@@ -45285,19 +45280,24 @@ var ts;
45285
45280
  }
45286
45281
  return withPackageId(packageInfo, pathAndExtension);
45287
45282
  };
45288
- if (rest !== "") { // If "rest" is empty, we just did this search above.
45289
- var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
45290
- // Don't use a "types" or "main" from here because we're not loading the root, but a subdirectory -- just here for the packageId and path mappings.
45283
+ var _b = parsePackageName(moduleName), packageName = _b.packageName, rest = _b.rest;
45284
+ var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
45285
+ if (rest !== "") {
45286
+ // Previous `packageInfo` may have been from a nested package.json; ensure we have the one from the package root now.
45291
45287
  packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
45292
- if (packageInfo && packageInfo.contents.versionPaths) {
45293
- if (state.traceEnabled) {
45294
- trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, ts.version, rest);
45295
- }
45296
- var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
45297
- var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
45298
- if (fromPaths) {
45299
- return fromPaths.value;
45300
- }
45288
+ }
45289
+ // package exports are higher priority than file/directory/typesVersions lookups and (and, if there's exports present, blocks them)
45290
+ if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
45291
+ return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
45292
+ }
45293
+ if (rest !== "" && packageInfo && packageInfo.contents.versionPaths) {
45294
+ if (state.traceEnabled) {
45295
+ trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, ts.version, rest);
45296
+ }
45297
+ var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
45298
+ var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
45299
+ if (fromPaths) {
45300
+ return fromPaths.value;
45301
45301
  }
45302
45302
  }
45303
45303
  return loader(extensions, candidate, !nodeModulesDirectoryExists, state);
@@ -55478,6 +55478,7 @@ var ts;
55478
55478
  && symbol.escapedName !== "export=" /* InternalSymbolName.ExportEquals */
55479
55479
  && !(symbol.flags & 4194304 /* SymbolFlags.Prototype */)
55480
55480
  && !(symbol.flags & 32 /* SymbolFlags.Class */)
55481
+ && !(symbol.flags & 8192 /* SymbolFlags.Method */)
55481
55482
  && !isConstMergedWithNSPrintableAsSignatureMerge) {
55482
55483
  if (propertyAsAlias) {
55483
55484
  var createdExport = serializeMaybeAliasAssignment(symbol);
@@ -115412,6 +115413,7 @@ var ts;
115412
115413
  writeTrailingSemicolon();
115413
115414
  }
115414
115415
  function emitExportDeclaration(node) {
115416
+ emitModifiers(node, node.modifiers);
115415
115417
  var nextPos = emitTokenWithComment(93 /* SyntaxKind.ExportKeyword */, node.pos, writeKeyword, node);
115416
115418
  writeSpace();
115417
115419
  if (node.isTypeOnly) {
@@ -146759,6 +146761,10 @@ var ts;
146759
146761
  pushSelectionCommentRange(comment.pos, comment.end);
146760
146762
  }
146761
146763
  if (positionShouldSnapToNode(sourceFile, pos, node)) {
146764
+ if (ts.isFunctionBody(node)
146765
+ && ts.isFunctionLikeDeclaration(parentNode) && !ts.positionsAreOnSameLine(node.getStart(sourceFile), node.getEnd(), sourceFile)) {
146766
+ pushSelectionRange(node.getStart(sourceFile), node.getEnd());
146767
+ }
146762
146768
  // 1. Blocks are effectively redundant with SyntaxLists.
146763
146769
  // 2. TemplateSpans, along with the SyntaxLists containing them, are a somewhat unintuitive grouping
146764
146770
  // of things that should be considered independently.
@@ -158371,7 +158377,7 @@ var ts;
158371
158377
  return { kind: InfoKind.TypeLikeDeclaration, token: token, call: call, modifierFlags: modifierFlags, parentDeclaration: declaration, declSourceFile: declSourceFile, isJSFile: isJSFile };
158372
158378
  }
158373
158379
  var enumDeclaration = ts.find(symbol.declarations, ts.isEnumDeclaration);
158374
- if (enumDeclaration && !ts.isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) {
158380
+ if (enumDeclaration && !(leftExpressionType.flags & 1056 /* TypeFlags.EnumLike */) && !ts.isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) {
158375
158381
  return { kind: InfoKind.Enum, token: token, parentDeclaration: enumDeclaration };
158376
158382
  }
158377
158383
  return undefined;
package/lib/typescript.js CHANGED
@@ -99,7 +99,7 @@ var ts;
99
99
  // The following is baselined as a literal template type without intervention
100
100
  /** The version of the TypeScript compiler release */
101
101
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
102
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220921");
102
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220922");
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -45243,6 +45243,7 @@ var ts;
45243
45243
  }
45244
45244
  }
45245
45245
  function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
45246
+ var _a;
45246
45247
  var candidate = ts.normalizePath(ts.combinePaths(nodeModulesDirectory, moduleName));
45247
45248
  // First look for a nested package.json, as in `node_modules/foo/bar/package.json`.
45248
45249
  var packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state);
@@ -45257,13 +45258,7 @@ var ts;
45257
45258
  return withPackageId(packageInfo, fromDirectory);
45258
45259
  }
45259
45260
  }
45260
- var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest;
45261
45261
  var loader = function (extensions, candidate, onlyRecordFailures, state) {
45262
- var _a;
45263
- // package exports are higher priority than file/directory lookups (and, if there's exports present, blocks them)
45264
- if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
45265
- return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
45266
- }
45267
45262
  var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
45268
45263
  loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.contents.packageJsonContent, packageInfo && packageInfo.contents.versionPaths);
45269
45264
  if (!pathAndExtension && packageInfo
@@ -45276,19 +45271,24 @@ var ts;
45276
45271
  }
45277
45272
  return withPackageId(packageInfo, pathAndExtension);
45278
45273
  };
45279
- if (rest !== "") { // If "rest" is empty, we just did this search above.
45280
- var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
45281
- // Don't use a "types" or "main" from here because we're not loading the root, but a subdirectory -- just here for the packageId and path mappings.
45274
+ var _b = parsePackageName(moduleName), packageName = _b.packageName, rest = _b.rest;
45275
+ var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
45276
+ if (rest !== "") {
45277
+ // Previous `packageInfo` may have been from a nested package.json; ensure we have the one from the package root now.
45282
45278
  packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
45283
- if (packageInfo && packageInfo.contents.versionPaths) {
45284
- if (state.traceEnabled) {
45285
- trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, ts.version, rest);
45286
- }
45287
- var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
45288
- var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
45289
- if (fromPaths) {
45290
- return fromPaths.value;
45291
- }
45279
+ }
45280
+ // package exports are higher priority than file/directory/typesVersions lookups and (and, if there's exports present, blocks them)
45281
+ if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
45282
+ return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
45283
+ }
45284
+ if (rest !== "" && packageInfo && packageInfo.contents.versionPaths) {
45285
+ if (state.traceEnabled) {
45286
+ trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, ts.version, rest);
45287
+ }
45288
+ var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
45289
+ var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
45290
+ if (fromPaths) {
45291
+ return fromPaths.value;
45292
45292
  }
45293
45293
  }
45294
45294
  return loader(extensions, candidate, !nodeModulesDirectoryExists, state);
@@ -55469,6 +55469,7 @@ var ts;
55469
55469
  && symbol.escapedName !== "export=" /* InternalSymbolName.ExportEquals */
55470
55470
  && !(symbol.flags & 4194304 /* SymbolFlags.Prototype */)
55471
55471
  && !(symbol.flags & 32 /* SymbolFlags.Class */)
55472
+ && !(symbol.flags & 8192 /* SymbolFlags.Method */)
55472
55473
  && !isConstMergedWithNSPrintableAsSignatureMerge) {
55473
55474
  if (propertyAsAlias) {
55474
55475
  var createdExport = serializeMaybeAliasAssignment(symbol);
@@ -115403,6 +115404,7 @@ var ts;
115403
115404
  writeTrailingSemicolon();
115404
115405
  }
115405
115406
  function emitExportDeclaration(node) {
115407
+ emitModifiers(node, node.modifiers);
115406
115408
  var nextPos = emitTokenWithComment(93 /* SyntaxKind.ExportKeyword */, node.pos, writeKeyword, node);
115407
115409
  writeSpace();
115408
115410
  if (node.isTypeOnly) {
@@ -146750,6 +146752,10 @@ var ts;
146750
146752
  pushSelectionCommentRange(comment.pos, comment.end);
146751
146753
  }
146752
146754
  if (positionShouldSnapToNode(sourceFile, pos, node)) {
146755
+ if (ts.isFunctionBody(node)
146756
+ && ts.isFunctionLikeDeclaration(parentNode) && !ts.positionsAreOnSameLine(node.getStart(sourceFile), node.getEnd(), sourceFile)) {
146757
+ pushSelectionRange(node.getStart(sourceFile), node.getEnd());
146758
+ }
146753
146759
  // 1. Blocks are effectively redundant with SyntaxLists.
146754
146760
  // 2. TemplateSpans, along with the SyntaxLists containing them, are a somewhat unintuitive grouping
146755
146761
  // of things that should be considered independently.
@@ -158362,7 +158368,7 @@ var ts;
158362
158368
  return { kind: InfoKind.TypeLikeDeclaration, token: token, call: call, modifierFlags: modifierFlags, parentDeclaration: declaration, declSourceFile: declSourceFile, isJSFile: isJSFile };
158363
158369
  }
158364
158370
  var enumDeclaration = ts.find(symbol.declarations, ts.isEnumDeclaration);
158365
- if (enumDeclaration && !ts.isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) {
158371
+ if (enumDeclaration && !(leftExpressionType.flags & 1056 /* TypeFlags.EnumLike */) && !ts.isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) {
158366
158372
  return { kind: InfoKind.Enum, token: token, parentDeclaration: enumDeclaration };
158367
158373
  }
158368
158374
  return undefined;
@@ -99,7 +99,7 @@ var ts;
99
99
  // The following is baselined as a literal template type without intervention
100
100
  /** The version of the TypeScript compiler release */
101
101
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
102
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220921");
102
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220922");
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -45243,6 +45243,7 @@ var ts;
45243
45243
  }
45244
45244
  }
45245
45245
  function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
45246
+ var _a;
45246
45247
  var candidate = ts.normalizePath(ts.combinePaths(nodeModulesDirectory, moduleName));
45247
45248
  // First look for a nested package.json, as in `node_modules/foo/bar/package.json`.
45248
45249
  var packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state);
@@ -45257,13 +45258,7 @@ var ts;
45257
45258
  return withPackageId(packageInfo, fromDirectory);
45258
45259
  }
45259
45260
  }
45260
- var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest;
45261
45261
  var loader = function (extensions, candidate, onlyRecordFailures, state) {
45262
- var _a;
45263
- // package exports are higher priority than file/directory lookups (and, if there's exports present, blocks them)
45264
- if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
45265
- return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
45266
- }
45267
45262
  var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
45268
45263
  loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.contents.packageJsonContent, packageInfo && packageInfo.contents.versionPaths);
45269
45264
  if (!pathAndExtension && packageInfo
@@ -45276,19 +45271,24 @@ var ts;
45276
45271
  }
45277
45272
  return withPackageId(packageInfo, pathAndExtension);
45278
45273
  };
45279
- if (rest !== "") { // If "rest" is empty, we just did this search above.
45280
- var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
45281
- // Don't use a "types" or "main" from here because we're not loading the root, but a subdirectory -- just here for the packageId and path mappings.
45274
+ var _b = parsePackageName(moduleName), packageName = _b.packageName, rest = _b.rest;
45275
+ var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
45276
+ if (rest !== "") {
45277
+ // Previous `packageInfo` may have been from a nested package.json; ensure we have the one from the package root now.
45282
45278
  packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
45283
- if (packageInfo && packageInfo.contents.versionPaths) {
45284
- if (state.traceEnabled) {
45285
- trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, ts.version, rest);
45286
- }
45287
- var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
45288
- var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
45289
- if (fromPaths) {
45290
- return fromPaths.value;
45291
- }
45279
+ }
45280
+ // package exports are higher priority than file/directory/typesVersions lookups and (and, if there's exports present, blocks them)
45281
+ if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
45282
+ return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
45283
+ }
45284
+ if (rest !== "" && packageInfo && packageInfo.contents.versionPaths) {
45285
+ if (state.traceEnabled) {
45286
+ trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, ts.version, rest);
45287
+ }
45288
+ var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
45289
+ var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
45290
+ if (fromPaths) {
45291
+ return fromPaths.value;
45292
45292
  }
45293
45293
  }
45294
45294
  return loader(extensions, candidate, !nodeModulesDirectoryExists, state);
@@ -55469,6 +55469,7 @@ var ts;
55469
55469
  && symbol.escapedName !== "export=" /* InternalSymbolName.ExportEquals */
55470
55470
  && !(symbol.flags & 4194304 /* SymbolFlags.Prototype */)
55471
55471
  && !(symbol.flags & 32 /* SymbolFlags.Class */)
55472
+ && !(symbol.flags & 8192 /* SymbolFlags.Method */)
55472
55473
  && !isConstMergedWithNSPrintableAsSignatureMerge) {
55473
55474
  if (propertyAsAlias) {
55474
55475
  var createdExport = serializeMaybeAliasAssignment(symbol);
@@ -115403,6 +115404,7 @@ var ts;
115403
115404
  writeTrailingSemicolon();
115404
115405
  }
115405
115406
  function emitExportDeclaration(node) {
115407
+ emitModifiers(node, node.modifiers);
115406
115408
  var nextPos = emitTokenWithComment(93 /* SyntaxKind.ExportKeyword */, node.pos, writeKeyword, node);
115407
115409
  writeSpace();
115408
115410
  if (node.isTypeOnly) {
@@ -146750,6 +146752,10 @@ var ts;
146750
146752
  pushSelectionCommentRange(comment.pos, comment.end);
146751
146753
  }
146752
146754
  if (positionShouldSnapToNode(sourceFile, pos, node)) {
146755
+ if (ts.isFunctionBody(node)
146756
+ && ts.isFunctionLikeDeclaration(parentNode) && !ts.positionsAreOnSameLine(node.getStart(sourceFile), node.getEnd(), sourceFile)) {
146757
+ pushSelectionRange(node.getStart(sourceFile), node.getEnd());
146758
+ }
146753
146759
  // 1. Blocks are effectively redundant with SyntaxLists.
146754
146760
  // 2. TemplateSpans, along with the SyntaxLists containing them, are a somewhat unintuitive grouping
146755
146761
  // of things that should be considered independently.
@@ -158362,7 +158368,7 @@ var ts;
158362
158368
  return { kind: InfoKind.TypeLikeDeclaration, token: token, call: call, modifierFlags: modifierFlags, parentDeclaration: declaration, declSourceFile: declSourceFile, isJSFile: isJSFile };
158363
158369
  }
158364
158370
  var enumDeclaration = ts.find(symbol.declarations, ts.isEnumDeclaration);
158365
- if (enumDeclaration && !ts.isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) {
158371
+ if (enumDeclaration && !(leftExpressionType.flags & 1056 /* TypeFlags.EnumLike */) && !ts.isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) {
158366
158372
  return { kind: InfoKind.Enum, token: token, parentDeclaration: enumDeclaration };
158367
158373
  }
158368
158374
  return undefined;
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220921");
92
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220922");
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -45233,6 +45233,7 @@ var ts;
45233
45233
  }
45234
45234
  }
45235
45235
  function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
45236
+ var _a;
45236
45237
  var candidate = ts.normalizePath(ts.combinePaths(nodeModulesDirectory, moduleName));
45237
45238
  // First look for a nested package.json, as in `node_modules/foo/bar/package.json`.
45238
45239
  var packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state);
@@ -45247,13 +45248,7 @@ var ts;
45247
45248
  return withPackageId(packageInfo, fromDirectory);
45248
45249
  }
45249
45250
  }
45250
- var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest;
45251
45251
  var loader = function (extensions, candidate, onlyRecordFailures, state) {
45252
- var _a;
45253
- // package exports are higher priority than file/directory lookups (and, if there's exports present, blocks them)
45254
- if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
45255
- return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
45256
- }
45257
45252
  var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
45258
45253
  loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.contents.packageJsonContent, packageInfo && packageInfo.contents.versionPaths);
45259
45254
  if (!pathAndExtension && packageInfo
@@ -45266,19 +45261,24 @@ var ts;
45266
45261
  }
45267
45262
  return withPackageId(packageInfo, pathAndExtension);
45268
45263
  };
45269
- if (rest !== "") { // If "rest" is empty, we just did this search above.
45270
- var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
45271
- // Don't use a "types" or "main" from here because we're not loading the root, but a subdirectory -- just here for the packageId and path mappings.
45264
+ var _b = parsePackageName(moduleName), packageName = _b.packageName, rest = _b.rest;
45265
+ var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
45266
+ if (rest !== "") {
45267
+ // Previous `packageInfo` may have been from a nested package.json; ensure we have the one from the package root now.
45272
45268
  packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
45273
- if (packageInfo && packageInfo.contents.versionPaths) {
45274
- if (state.traceEnabled) {
45275
- trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, ts.version, rest);
45276
- }
45277
- var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
45278
- var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
45279
- if (fromPaths) {
45280
- return fromPaths.value;
45281
- }
45269
+ }
45270
+ // package exports are higher priority than file/directory/typesVersions lookups and (and, if there's exports present, blocks them)
45271
+ if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
45272
+ return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
45273
+ }
45274
+ if (rest !== "" && packageInfo && packageInfo.contents.versionPaths) {
45275
+ if (state.traceEnabled) {
45276
+ trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, ts.version, rest);
45277
+ }
45278
+ var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
45279
+ var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
45280
+ if (fromPaths) {
45281
+ return fromPaths.value;
45282
45282
  }
45283
45283
  }
45284
45284
  return loader(extensions, candidate, !nodeModulesDirectoryExists, state);
@@ -55459,6 +55459,7 @@ var ts;
55459
55459
  && symbol.escapedName !== "export=" /* InternalSymbolName.ExportEquals */
55460
55460
  && !(symbol.flags & 4194304 /* SymbolFlags.Prototype */)
55461
55461
  && !(symbol.flags & 32 /* SymbolFlags.Class */)
55462
+ && !(symbol.flags & 8192 /* SymbolFlags.Method */)
55462
55463
  && !isConstMergedWithNSPrintableAsSignatureMerge) {
55463
55464
  if (propertyAsAlias) {
55464
55465
  var createdExport = serializeMaybeAliasAssignment(symbol);
@@ -115393,6 +115394,7 @@ var ts;
115393
115394
  writeTrailingSemicolon();
115394
115395
  }
115395
115396
  function emitExportDeclaration(node) {
115397
+ emitModifiers(node, node.modifiers);
115396
115398
  var nextPos = emitTokenWithComment(93 /* SyntaxKind.ExportKeyword */, node.pos, writeKeyword, node);
115397
115399
  writeSpace();
115398
115400
  if (node.isTypeOnly) {
@@ -1427,7 +1427,6 @@
1427
1427
  "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362": "算術運算的左側內容必須屬於 'any'、'number'、'bigint' 或列舉類型。",
1428
1428
  "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779": "指派運算式的左側不可為選擇性屬性存取。",
1429
1429
  "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364": "指派運算式的左邊必須是變數或屬性存取。",
1430
- "The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360": "'in' 運算式的左側必須是私人識別碼或 'any'、'string'、'number' 或 'symbol' 類型。",
1431
1430
  "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358": "'instanceof' 運算式左側必須是類型 'any'、物件類型或型別參數。",
1432
1431
  "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156": "對使用者顯示訊息時所使用的地區設定 (例如 'zh-tw')",
1433
1432
  "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136": "在 node_modules 及載入 JavaScript 檔案下搜尋時的最大相依性深度。",
@@ -1448,7 +1447,6 @@
1448
1447
  "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064": "非同步函式或方法的傳回型別,必須為全域 Promise<T> 類型。是否要寫入 'Promise<{0}>'?",
1449
1448
  "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407": "'for...in' 陳述式的右方必須是類型 'any'、物件類型或型別參數,但此處為類型 '{0}'。",
1450
1449
  "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363": "算術運算的右側內容必須屬於 'any'、'number'、'bigint' 或列舉類型。",
1451
- "The_right_hand_side_of_an_in_expression_must_not_be_a_primitive_2361": "'In' 運算式的右側不得為基元。",
1452
1450
  "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359": "'instanceof' 運算式的右側必須是 'any' 類型,或是可指派給 'Function' 介面類型的類型。",
1453
1451
  "The_root_value_of_a_0_file_must_be_an_object_5092": "'{0}' 檔案的根值必須是物件。",
1454
1452
  "The_shadowing_declaration_of_0_is_defined_here_18017": "'{0}' 的隱蔽宣告定義於此處",
@@ -1551,6 +1549,7 @@
1551
1549
  "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412": "類型 '{0}' 無法指派給類型為具有 'exactOptionalPropertyTypes: true' 的類型 '{1}'。請考慮將 'undefined' 新增到目標的類型。",
1552
1550
  "Type_0_is_not_comparable_to_type_1_2678": "類型 '{0}' 無法和類型 '{1}' 比較。",
1553
1551
  "Type_0_is_not_generic_2315": "'{0}' 不是泛型類型。",
1552
+ "Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638": "類型 '{0}' 可能代表基本值,但不允許做為 'in' 運算子的右運算元。",
1554
1553
  "Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504": "類型 '{0}' 必須具備會傳回非同步迭代器的 '[Symbol.asyncIterator]()' 方法。",
1555
1554
  "Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488": "類型 '{0}' 必須具備會傳回迭代器的 '[Symbol.iterator]()' 方法。",
1556
1555
  "Type_0_provides_no_match_for_the_signature_1_2658": "類型 '{0}' 沒有符合特徵標記 '{1}' 的項目。",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.9.0-dev.20220921",
5
+ "version": "4.9.0-dev.20220922",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [