typescript 4.8.3 → 4.8.4
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 +55 -54
- package/lib/tsserver.js +67 -59
- package/lib/tsserverlibrary.js +67 -59
- package/lib/typescript.js +66 -58
- package/lib/typescriptServices.js +66 -58
- package/lib/typingsInstaller.js +65 -57
- package/package.json +1 -1
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = "4.8.
|
|
297
|
+
ts.version = "4.8.4";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -31701,6 +31701,7 @@ var ts;
|
|
|
31701
31701
|
case 335 /* SyntaxKind.JSDocProtectedTag */:
|
|
31702
31702
|
case 336 /* SyntaxKind.JSDocReadonlyTag */:
|
|
31703
31703
|
case 331 /* SyntaxKind.JSDocDeprecatedTag */:
|
|
31704
|
+
case 337 /* SyntaxKind.JSDocOverrideTag */:
|
|
31704
31705
|
return visitNode(cbNode, node.tagName)
|
|
31705
31706
|
|| (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
|
|
31706
31707
|
case 350 /* SyntaxKind.PartiallyEmittedExpression */:
|
|
@@ -42989,7 +42990,7 @@ var ts;
|
|
|
42989
42990
|
function withPackageId(packageInfo, r) {
|
|
42990
42991
|
var packageId;
|
|
42991
42992
|
if (r && packageInfo) {
|
|
42992
|
-
var packageJsonContent = packageInfo.packageJsonContent;
|
|
42993
|
+
var packageJsonContent = packageInfo.contents.packageJsonContent;
|
|
42993
42994
|
if (typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string") {
|
|
42994
42995
|
packageId = {
|
|
42995
42996
|
name: packageJsonContent.name,
|
|
@@ -44308,16 +44309,16 @@ var ts;
|
|
|
44308
44309
|
function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
|
|
44309
44310
|
if (considerPackageJson === void 0) { considerPackageJson = true; }
|
|
44310
44311
|
var packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : undefined;
|
|
44311
|
-
var packageJsonContent = packageInfo && packageInfo.packageJsonContent;
|
|
44312
|
-
var versionPaths = packageInfo && packageInfo.versionPaths;
|
|
44312
|
+
var packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
|
|
44313
|
+
var versionPaths = packageInfo && packageInfo.contents.versionPaths;
|
|
44313
44314
|
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
44314
44315
|
}
|
|
44315
44316
|
/* @internal */
|
|
44316
44317
|
function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) {
|
|
44317
|
-
if (!resolveJs && packageJsonInfo.resolvedEntrypoints !== undefined) {
|
|
44318
|
+
if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== undefined) {
|
|
44318
44319
|
// Cached value excludes resolutions to JS files - those could be
|
|
44319
44320
|
// cached separately, but they're used rarely.
|
|
44320
|
-
return packageJsonInfo.resolvedEntrypoints;
|
|
44321
|
+
return packageJsonInfo.contents.resolvedEntrypoints;
|
|
44321
44322
|
}
|
|
44322
44323
|
var entrypoints;
|
|
44323
44324
|
var extensions = resolveJs ? Extensions.JavaScript : Extensions.TypeScript;
|
|
@@ -44326,13 +44327,13 @@ var ts;
|
|
|
44326
44327
|
requireState.conditions = ["node", "require", "types"];
|
|
44327
44328
|
requireState.requestContainingDirectory = packageJsonInfo.packageDirectory;
|
|
44328
44329
|
var requireResolution = loadNodeModuleFromDirectoryWorker(extensions, packageJsonInfo.packageDirectory,
|
|
44329
|
-
/*onlyRecordFailures*/ false, requireState, packageJsonInfo.packageJsonContent, packageJsonInfo.versionPaths);
|
|
44330
|
+
/*onlyRecordFailures*/ false, requireState, packageJsonInfo.contents.packageJsonContent, packageJsonInfo.contents.versionPaths);
|
|
44330
44331
|
entrypoints = ts.append(entrypoints, requireResolution === null || requireResolution === void 0 ? void 0 : requireResolution.path);
|
|
44331
|
-
if (features & NodeResolutionFeatures.Exports && packageJsonInfo.packageJsonContent.exports) {
|
|
44332
|
+
if (features & NodeResolutionFeatures.Exports && packageJsonInfo.contents.packageJsonContent.exports) {
|
|
44332
44333
|
for (var _i = 0, _a = [["node", "import", "types"], ["node", "require", "types"]]; _i < _a.length; _i++) {
|
|
44333
44334
|
var conditions = _a[_i];
|
|
44334
44335
|
var exportState = __assign(__assign({}, requireState), { failedLookupLocations: [], conditions: conditions });
|
|
44335
|
-
var exportResolutions = loadEntrypointsFromExportMap(packageJsonInfo, packageJsonInfo.packageJsonContent.exports, exportState, extensions);
|
|
44336
|
+
var exportResolutions = loadEntrypointsFromExportMap(packageJsonInfo, packageJsonInfo.contents.packageJsonContent.exports, exportState, extensions);
|
|
44336
44337
|
if (exportResolutions) {
|
|
44337
44338
|
for (var _b = 0, exportResolutions_1 = exportResolutions; _b < exportResolutions_1.length; _b++) {
|
|
44338
44339
|
var resolution = exportResolutions_1[_b];
|
|
@@ -44341,7 +44342,7 @@ var ts;
|
|
|
44341
44342
|
}
|
|
44342
44343
|
}
|
|
44343
44344
|
}
|
|
44344
|
-
return packageJsonInfo.resolvedEntrypoints = entrypoints || false;
|
|
44345
|
+
return packageJsonInfo.contents.resolvedEntrypoints = entrypoints || false;
|
|
44345
44346
|
}
|
|
44346
44347
|
ts.getEntrypointsFromPackageJsonInfo = getEntrypointsFromPackageJsonInfo;
|
|
44347
44348
|
function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
|
|
@@ -44445,7 +44446,9 @@ var ts;
|
|
|
44445
44446
|
if (traceEnabled)
|
|
44446
44447
|
trace(host, ts.Diagnostics.File_0_exists_according_to_earlier_cached_lookups, packageJsonPath);
|
|
44447
44448
|
state.affectingLocations.push(packageJsonPath);
|
|
44448
|
-
return existing
|
|
44449
|
+
return existing.packageDirectory === packageDirectory ?
|
|
44450
|
+
existing :
|
|
44451
|
+
{ packageDirectory: packageDirectory, contents: existing.contents };
|
|
44449
44452
|
}
|
|
44450
44453
|
else {
|
|
44451
44454
|
if (existing && traceEnabled)
|
|
@@ -44461,7 +44464,7 @@ var ts;
|
|
|
44461
44464
|
trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
44462
44465
|
}
|
|
44463
44466
|
var versionPaths = readPackageJsonTypesVersionPaths(packageJsonContent, state);
|
|
44464
|
-
var result = { packageDirectory: packageDirectory, packageJsonContent: packageJsonContent, versionPaths: versionPaths, resolvedEntrypoints: undefined };
|
|
44467
|
+
var result = { packageDirectory: packageDirectory, contents: { packageJsonContent: packageJsonContent, versionPaths: versionPaths, resolvedEntrypoints: undefined } };
|
|
44465
44468
|
(_b = state.packageJsonInfoCache) === null || _b === void 0 ? void 0 : _b.setPackageJsonInfo(packageJsonPath, result);
|
|
44466
44469
|
state.affectingLocations.push(packageJsonPath);
|
|
44467
44470
|
return result;
|
|
@@ -44586,17 +44589,16 @@ var ts;
|
|
|
44586
44589
|
}
|
|
44587
44590
|
function loadModuleFromSelfNameReference(extensions, moduleName, directory, state, cache, redirectedReference) {
|
|
44588
44591
|
var _a, _b;
|
|
44589
|
-
var
|
|
44590
|
-
var directoryPath = ts.toPath(ts.combinePaths(directory, "dummy"), (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a), ts.createGetCanonicalFileName(useCaseSensitiveFileNames === undefined ? true : useCaseSensitiveFileNames));
|
|
44592
|
+
var directoryPath = ts.getNormalizedAbsolutePath(ts.combinePaths(directory, "dummy"), (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
44591
44593
|
var scope = getPackageScopeForPath(directoryPath, state);
|
|
44592
|
-
if (!scope || !scope.packageJsonContent.exports) {
|
|
44594
|
+
if (!scope || !scope.contents.packageJsonContent.exports) {
|
|
44593
44595
|
return undefined;
|
|
44594
44596
|
}
|
|
44595
|
-
if (typeof scope.packageJsonContent.name !== "string") {
|
|
44597
|
+
if (typeof scope.contents.packageJsonContent.name !== "string") {
|
|
44596
44598
|
return undefined;
|
|
44597
44599
|
}
|
|
44598
44600
|
var parts = ts.getPathComponents(moduleName); // unrooted paths should have `""` as their 0th entry
|
|
44599
|
-
var nameParts = ts.getPathComponents(scope.packageJsonContent.name);
|
|
44601
|
+
var nameParts = ts.getPathComponents(scope.contents.packageJsonContent.name);
|
|
44600
44602
|
if (!ts.every(nameParts, function (p, i) { return parts[i] === p; })) {
|
|
44601
44603
|
return undefined;
|
|
44602
44604
|
}
|
|
@@ -44604,30 +44606,30 @@ var ts;
|
|
|
44604
44606
|
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference);
|
|
44605
44607
|
}
|
|
44606
44608
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
44607
|
-
if (!scope.packageJsonContent.exports) {
|
|
44609
|
+
if (!scope.contents.packageJsonContent.exports) {
|
|
44608
44610
|
return undefined;
|
|
44609
44611
|
}
|
|
44610
44612
|
if (subpath === ".") {
|
|
44611
44613
|
var mainExport = void 0;
|
|
44612
|
-
if (typeof scope.packageJsonContent.exports === "string" || Array.isArray(scope.packageJsonContent.exports) || (typeof scope.packageJsonContent.exports === "object" && noKeyStartsWithDot(scope.packageJsonContent.exports))) {
|
|
44613
|
-
mainExport = scope.packageJsonContent.exports;
|
|
44614
|
+
if (typeof scope.contents.packageJsonContent.exports === "string" || Array.isArray(scope.contents.packageJsonContent.exports) || (typeof scope.contents.packageJsonContent.exports === "object" && noKeyStartsWithDot(scope.contents.packageJsonContent.exports))) {
|
|
44615
|
+
mainExport = scope.contents.packageJsonContent.exports;
|
|
44614
44616
|
}
|
|
44615
|
-
else if (ts.hasProperty(scope.packageJsonContent.exports, ".")) {
|
|
44616
|
-
mainExport = scope.packageJsonContent.exports["."];
|
|
44617
|
+
else if (ts.hasProperty(scope.contents.packageJsonContent.exports, ".")) {
|
|
44618
|
+
mainExport = scope.contents.packageJsonContent.exports["."];
|
|
44617
44619
|
}
|
|
44618
44620
|
if (mainExport) {
|
|
44619
44621
|
var loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, subpath, scope, /*isImports*/ false);
|
|
44620
44622
|
return loadModuleFromTargetImportOrExport(mainExport, "", /*pattern*/ false);
|
|
44621
44623
|
}
|
|
44622
44624
|
}
|
|
44623
|
-
else if (allKeysStartWithDot(scope.packageJsonContent.exports)) {
|
|
44624
|
-
if (typeof scope.packageJsonContent.exports !== "object") {
|
|
44625
|
+
else if (allKeysStartWithDot(scope.contents.packageJsonContent.exports)) {
|
|
44626
|
+
if (typeof scope.contents.packageJsonContent.exports !== "object") {
|
|
44625
44627
|
if (state.traceEnabled) {
|
|
44626
44628
|
trace(state.host, ts.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory);
|
|
44627
44629
|
}
|
|
44628
44630
|
return toSearchResult(/*value*/ undefined);
|
|
44629
44631
|
}
|
|
44630
|
-
var result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, subpath, scope.packageJsonContent.exports, scope, /*isImports*/ false);
|
|
44632
|
+
var result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, subpath, scope.contents.packageJsonContent.exports, scope, /*isImports*/ false);
|
|
44631
44633
|
if (result) {
|
|
44632
44634
|
return result;
|
|
44633
44635
|
}
|
|
@@ -44645,8 +44647,7 @@ var ts;
|
|
|
44645
44647
|
}
|
|
44646
44648
|
return toSearchResult(/*value*/ undefined);
|
|
44647
44649
|
}
|
|
44648
|
-
var
|
|
44649
|
-
var directoryPath = ts.toPath(ts.combinePaths(directory, "dummy"), (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a), ts.createGetCanonicalFileName(useCaseSensitiveFileNames === undefined ? true : useCaseSensitiveFileNames));
|
|
44650
|
+
var directoryPath = ts.getNormalizedAbsolutePath(ts.combinePaths(directory, "dummy"), (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
44650
44651
|
var scope = getPackageScopeForPath(directoryPath, state);
|
|
44651
44652
|
if (!scope) {
|
|
44652
44653
|
if (state.traceEnabled) {
|
|
@@ -44654,13 +44655,13 @@ var ts;
|
|
|
44654
44655
|
}
|
|
44655
44656
|
return toSearchResult(/*value*/ undefined);
|
|
44656
44657
|
}
|
|
44657
|
-
if (!scope.packageJsonContent.imports) {
|
|
44658
|
+
if (!scope.contents.packageJsonContent.imports) {
|
|
44658
44659
|
if (state.traceEnabled) {
|
|
44659
44660
|
trace(state.host, ts.Diagnostics.package_json_scope_0_has_no_imports_defined, scope.packageDirectory);
|
|
44660
44661
|
}
|
|
44661
44662
|
return toSearchResult(/*value*/ undefined);
|
|
44662
44663
|
}
|
|
44663
|
-
var result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, scope.packageJsonContent.imports, scope, /*isImports*/ true);
|
|
44664
|
+
var result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, scope.contents.packageJsonContent.imports, scope, /*isImports*/ true);
|
|
44664
44665
|
if (result) {
|
|
44665
44666
|
return result;
|
|
44666
44667
|
}
|
|
@@ -45005,7 +45006,7 @@ var ts;
|
|
|
45005
45006
|
if (fromFile) {
|
|
45006
45007
|
return noPackageId(fromFile);
|
|
45007
45008
|
}
|
|
45008
|
-
var fromDirectory = loadNodeModuleFromDirectoryWorker(extensions, candidate, !nodeModulesDirectoryExists, state, packageInfo.packageJsonContent, packageInfo.versionPaths);
|
|
45009
|
+
var fromDirectory = loadNodeModuleFromDirectoryWorker(extensions, candidate, !nodeModulesDirectoryExists, state, packageInfo.contents.packageJsonContent, packageInfo.contents.versionPaths);
|
|
45009
45010
|
return withPackageId(packageInfo, fromDirectory);
|
|
45010
45011
|
}
|
|
45011
45012
|
}
|
|
@@ -45013,14 +45014,14 @@ var ts;
|
|
|
45013
45014
|
var loader = function (extensions, candidate, onlyRecordFailures, state) {
|
|
45014
45015
|
var _a;
|
|
45015
45016
|
// package exports are higher priority than file/directory lookups (and, if there's exports present, blocks them)
|
|
45016
|
-
if (packageInfo && packageInfo.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
|
|
45017
|
+
if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
|
|
45017
45018
|
return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
|
|
45018
45019
|
}
|
|
45019
45020
|
var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
|
|
45020
|
-
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
|
|
45021
|
+
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.contents.packageJsonContent, packageInfo && packageInfo.contents.versionPaths);
|
|
45021
45022
|
if (!pathAndExtension && packageInfo
|
|
45022
45023
|
// eslint-disable-next-line no-null/no-null
|
|
45023
|
-
&& (packageInfo.packageJsonContent.exports === undefined || packageInfo.packageJsonContent.exports === null)
|
|
45024
|
+
&& (packageInfo.contents.packageJsonContent.exports === undefined || packageInfo.contents.packageJsonContent.exports === null)
|
|
45024
45025
|
&& state.features & NodeResolutionFeatures.EsmMode) {
|
|
45025
45026
|
// EsmMode disables index lookup in `loadNodeModuleFromDirectoryWorker` generally, however non-relative package resolutions still assume
|
|
45026
45027
|
// a default `index.js` entrypoint if no `main` or `exports` are present
|
|
@@ -45032,12 +45033,12 @@ var ts;
|
|
|
45032
45033
|
var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
|
|
45033
45034
|
// 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.
|
|
45034
45035
|
packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
45035
|
-
if (packageInfo && packageInfo.versionPaths) {
|
|
45036
|
+
if (packageInfo && packageInfo.contents.versionPaths) {
|
|
45036
45037
|
if (state.traceEnabled) {
|
|
45037
|
-
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.versionPaths.version, ts.version, rest);
|
|
45038
|
+
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);
|
|
45038
45039
|
}
|
|
45039
45040
|
var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
|
|
45040
|
-
var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
|
|
45041
|
+
var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
|
|
45041
45042
|
if (fromPaths) {
|
|
45042
45043
|
return fromPaths.value;
|
|
45043
45044
|
}
|
|
@@ -49338,6 +49339,7 @@ var ts;
|
|
|
49338
49339
|
var wildcardType = createIntrinsicType(1 /* TypeFlags.Any */, "any");
|
|
49339
49340
|
var errorType = createIntrinsicType(1 /* TypeFlags.Any */, "error");
|
|
49340
49341
|
var unresolvedType = createIntrinsicType(1 /* TypeFlags.Any */, "unresolved");
|
|
49342
|
+
var nonInferrableAnyType = createIntrinsicType(1 /* TypeFlags.Any */, "any", 65536 /* ObjectFlags.ContainsWideningType */);
|
|
49341
49343
|
var intrinsicMarkerType = createIntrinsicType(1 /* TypeFlags.Any */, "intrinsic");
|
|
49342
49344
|
var unknownType = createIntrinsicType(2 /* TypeFlags.Unknown */, "unknown");
|
|
49343
49345
|
var nonNullUnknownType = createIntrinsicType(2 /* TypeFlags.Unknown */, "unknown");
|
|
@@ -51939,7 +51941,7 @@ var ts;
|
|
|
51939
51941
|
if (ext === ".ts" /* Extension.Ts */ || ext === ".js" /* Extension.Js */ || ext === ".tsx" /* Extension.Tsx */ || ext === ".jsx" /* Extension.Jsx */) {
|
|
51940
51942
|
var scope = currentSourceFile.packageJsonScope;
|
|
51941
51943
|
var targetExt = ext === ".ts" /* Extension.Ts */ ? ".mts" /* Extension.Mts */ : ext === ".js" /* Extension.Js */ ? ".mjs" /* Extension.Mjs */ : undefined;
|
|
51942
|
-
if (scope && !scope.packageJsonContent.type) {
|
|
51944
|
+
if (scope && !scope.contents.packageJsonContent.type) {
|
|
51943
51945
|
if (targetExt) {
|
|
51944
51946
|
diagnosticDetails = ts.chainDiagnosticMessages(
|
|
51945
51947
|
/*details*/ undefined, ts.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1, targetExt, ts.combinePaths(scope.packageDirectory, "package.json"));
|
|
@@ -54167,22 +54169,15 @@ var ts;
|
|
|
54167
54169
|
context.approximateLength += ts.symbolName(parameterSymbol).length + 3;
|
|
54168
54170
|
return parameterNode;
|
|
54169
54171
|
function cloneBindingName(node) {
|
|
54170
|
-
return
|
|
54171
|
-
function
|
|
54172
|
+
return elideInitializerAndSetEmitFlags(node);
|
|
54173
|
+
function elideInitializerAndSetEmitFlags(node) {
|
|
54172
54174
|
if (context.tracker.trackSymbol && ts.isComputedPropertyName(node) && isLateBindableName(node)) {
|
|
54173
54175
|
trackComputedName(node.expression, context.enclosingDeclaration, context);
|
|
54174
54176
|
}
|
|
54175
|
-
var visited = ts.visitEachChild(node,
|
|
54177
|
+
var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags);
|
|
54176
54178
|
if (ts.isBindingElement(visited)) {
|
|
54177
|
-
|
|
54178
|
-
|
|
54179
|
-
/* propertyName*/ undefined, visited.propertyName,
|
|
54180
|
-
/*initializer*/ undefined);
|
|
54181
|
-
}
|
|
54182
|
-
else {
|
|
54183
|
-
visited = ts.factory.updateBindingElement(visited, visited.dotDotDotToken, visited.propertyName, visited.name,
|
|
54184
|
-
/*initializer*/ undefined);
|
|
54185
|
-
}
|
|
54179
|
+
visited = ts.factory.updateBindingElement(visited, visited.dotDotDotToken, visited.propertyName, visited.name,
|
|
54180
|
+
/*initializer*/ undefined);
|
|
54186
54181
|
}
|
|
54187
54182
|
if (!ts.nodeIsSynthesized(visited)) {
|
|
54188
54183
|
visited = ts.factory.cloneNode(visited);
|
|
@@ -57177,7 +57172,11 @@ var ts;
|
|
|
57177
57172
|
if (reportErrors && !declarationBelongsToPrivateAmbientMember(element)) {
|
|
57178
57173
|
reportImplicitAny(element, anyType);
|
|
57179
57174
|
}
|
|
57180
|
-
|
|
57175
|
+
// When we're including the pattern in the type (an indication we're obtaining a contextual type), we
|
|
57176
|
+
// use a non-inferrable any type. Inference will never directly infer this type, but it is possible
|
|
57177
|
+
// to infer a type that contains it, e.g. for a binding pattern like [foo] or { foo }. In such cases,
|
|
57178
|
+
// widening of the binding pattern type substitutes a regular any for the non-inferrable any.
|
|
57179
|
+
return includePatternInType ? nonInferrableAnyType : anyType;
|
|
57181
57180
|
}
|
|
57182
57181
|
// Return the type implied by an object binding pattern
|
|
57183
57182
|
function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) {
|
|
@@ -59278,6 +59277,12 @@ var ts;
|
|
|
59278
59277
|
return mapType(type, getLowerBoundOfKeyType);
|
|
59279
59278
|
}
|
|
59280
59279
|
if (type.flags & 2097152 /* TypeFlags.Intersection */) {
|
|
59280
|
+
// Similarly to getTypeFromIntersectionTypeNode, we preserve the special string & {}, number & {},
|
|
59281
|
+
// and bigint & {} intersections that are used to prevent subtype reduction in union types.
|
|
59282
|
+
var types = type.types;
|
|
59283
|
+
if (types.length === 2 && !!(types[0].flags & (4 /* TypeFlags.String */ | 8 /* TypeFlags.Number */ | 64 /* TypeFlags.BigInt */)) && types[1] === emptyTypeLiteralType) {
|
|
59284
|
+
return type;
|
|
59285
|
+
}
|
|
59281
59286
|
return getIntersectionType(ts.sameMap(type.types, getLowerBoundOfKeyType));
|
|
59282
59287
|
}
|
|
59283
59288
|
return type;
|
|
@@ -69465,7 +69470,10 @@ var ts;
|
|
|
69465
69470
|
//
|
|
69466
69471
|
// This flag is infectious; if we produce Box<never> (where never is silentNeverType), Box<never> is
|
|
69467
69472
|
// also non-inferrable.
|
|
69468
|
-
|
|
69473
|
+
//
|
|
69474
|
+
// As a special case, also ignore nonInferrableAnyType, which is a special form of the any type
|
|
69475
|
+
// used as a stand-in for binding elements when they are being inferred.
|
|
69476
|
+
if (ts.getObjectFlags(source) & 262144 /* ObjectFlags.NonInferrableType */ || source === nonInferrableAnyType) {
|
|
69469
69477
|
return;
|
|
69470
69478
|
}
|
|
69471
69479
|
if (!inference.isFixed) {
|
|
@@ -81631,7 +81639,7 @@ var ts;
|
|
|
81631
81639
|
checkDecorators(node);
|
|
81632
81640
|
}
|
|
81633
81641
|
function getEffectiveTypeArgumentAtIndex(node, typeParameters, index) {
|
|
81634
|
-
if (index <
|
|
81642
|
+
if (node.typeArguments && index < node.typeArguments.length) {
|
|
81635
81643
|
return getTypeFromTypeNode(node.typeArguments[index]);
|
|
81636
81644
|
}
|
|
81637
81645
|
return getEffectiveTypeArguments(node, typeParameters)[index];
|
|
@@ -90410,7 +90418,7 @@ var ts;
|
|
|
90410
90418
|
return grammarErrorOnNode(node, ts.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
|
|
90411
90419
|
}
|
|
90412
90420
|
var nodeArguments = node.arguments;
|
|
90413
|
-
if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext) {
|
|
90421
|
+
if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext && moduleKind !== ts.ModuleKind.Node16) {
|
|
90414
90422
|
// We are allowed trailing comma after proposal-import-assertions.
|
|
90415
90423
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
90416
90424
|
if (nodeArguments.length > 1) {
|
|
@@ -118057,7 +118065,7 @@ var ts;
|
|
|
118057
118065
|
state.failedLookupLocations = packageJsonLocations;
|
|
118058
118066
|
state.affectingLocations = packageJsonLocations;
|
|
118059
118067
|
var packageJsonScope = ts.getPackageScopeForPath(fileName, state);
|
|
118060
|
-
var impliedNodeFormat = (packageJsonScope === null || packageJsonScope === void 0 ? void 0 : packageJsonScope.packageJsonContent.type) === "module" ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS;
|
|
118068
|
+
var impliedNodeFormat = (packageJsonScope === null || packageJsonScope === void 0 ? void 0 : packageJsonScope.contents.packageJsonContent.type) === "module" ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS;
|
|
118061
118069
|
return { impliedNodeFormat: impliedNodeFormat, packageJsonLocations: packageJsonLocations, packageJsonScope: packageJsonScope };
|
|
118062
118070
|
}
|
|
118063
118071
|
}
|
|
@@ -119788,7 +119796,7 @@ var ts;
|
|
|
119788
119796
|
// It's a _little odd_ that we can't set `impliedNodeFormat` until the program step - but it's the first and only time we have a resolution cache
|
|
119789
119797
|
// and a freshly made source file node on hand at the same time, and we need both to set the field. Persisting the resolution cache all the way
|
|
119790
119798
|
// to the check and emit steps would be bad - so we much prefer detecting and storing the format information on the source file node upfront.
|
|
119791
|
-
var result = getImpliedNodeFormatForFileWorker(
|
|
119799
|
+
var result = getImpliedNodeFormatForFileWorker(ts.getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
|
|
119792
119800
|
var languageVersion = ts.getEmitScriptTarget(options);
|
|
119793
119801
|
var setExternalModuleIndicator = ts.getSetExternalModuleIndicator(options);
|
|
119794
119802
|
return typeof result === "object" ? __assign(__assign({}, result), { languageVersion: languageVersion, setExternalModuleIndicator: setExternalModuleIndicator }) :
|
|
@@ -124449,7 +124457,7 @@ var ts;
|
|
|
124449
124457
|
var maybeBlockedByTypesVersions = false;
|
|
124450
124458
|
var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
124451
124459
|
if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
|
|
124452
|
-
var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
124460
|
+
var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.contents.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
124453
124461
|
var importMode = overrideMode || importingSourceFile.impliedNodeFormat;
|
|
124454
124462
|
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
124455
124463
|
var conditions = ["node", importMode === ts.ModuleKind.ESNext ? "import" : "require", "types"];
|
|
@@ -124811,7 +124819,7 @@ var ts;
|
|
|
124811
124819
|
case ts.ModuleKind.CommonJS:
|
|
124812
124820
|
if (file.packageJsonScope) {
|
|
124813
124821
|
(result !== null && result !== void 0 ? result : (result = [])).push(ts.chainDiagnosticMessages(
|
|
124814
|
-
/*details*/ undefined, file.packageJsonScope.packageJsonContent.type ?
|
|
124822
|
+
/*details*/ undefined, file.packageJsonScope.contents.packageJsonContent.type ?
|
|
124815
124823
|
ts.Diagnostics.File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module :
|
|
124816
124824
|
ts.Diagnostics.File_is_CommonJS_module_because_0_does_not_have_field_type, toFileName(ts.last(file.packageJsonLocations), fileNameConvertor)));
|
|
124817
124825
|
}
|
|
@@ -141966,7 +141974,7 @@ var ts;
|
|
|
141966
141974
|
}
|
|
141967
141975
|
var parent = node.parent;
|
|
141968
141976
|
var typeChecker = program.getTypeChecker();
|
|
141969
|
-
if (node.kind === 159 /* SyntaxKind.OverrideKeyword */ || (ts.
|
|
141977
|
+
if (node.kind === 159 /* SyntaxKind.OverrideKeyword */ || (ts.isIdentifier(node) && ts.isJSDocOverrideTag(parent) && parent.tagName === node)) {
|
|
141970
141978
|
return getDefinitionFromOverriddenMember(typeChecker, node) || ts.emptyArray;
|
|
141971
141979
|
}
|
|
141972
141980
|
// Labels
|