typescript 5.7.0-dev.20241015 → 5.7.0-dev.20241016
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 +30 -19
- package/lib/typescript.js +35 -20
- package/package.json +2 -2
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.7";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20241016`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -29531,10 +29531,12 @@ var Parser;
|
|
|
29531
29531
|
case 90 /* DefaultKeyword */:
|
|
29532
29532
|
return nextTokenCanFollowDefaultKeyword();
|
|
29533
29533
|
case 126 /* StaticKeyword */:
|
|
29534
|
+
nextToken();
|
|
29535
|
+
return canFollowModifier();
|
|
29534
29536
|
case 139 /* GetKeyword */:
|
|
29535
29537
|
case 153 /* SetKeyword */:
|
|
29536
29538
|
nextToken();
|
|
29537
|
-
return
|
|
29539
|
+
return canFollowGetOrSetKeyword();
|
|
29538
29540
|
default:
|
|
29539
29541
|
return nextTokenIsOnSameLineAndCanFollowModifier();
|
|
29540
29542
|
}
|
|
@@ -29552,6 +29554,9 @@ var Parser;
|
|
|
29552
29554
|
function canFollowModifier() {
|
|
29553
29555
|
return token() === 23 /* OpenBracketToken */ || token() === 19 /* OpenBraceToken */ || token() === 42 /* AsteriskToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
|
|
29554
29556
|
}
|
|
29557
|
+
function canFollowGetOrSetKeyword() {
|
|
29558
|
+
return token() === 23 /* OpenBracketToken */ || isLiteralPropertyName();
|
|
29559
|
+
}
|
|
29555
29560
|
function nextTokenCanFollowDefaultKeyword() {
|
|
29556
29561
|
nextToken();
|
|
29557
29562
|
return token() === 86 /* ClassKeyword */ || token() === 100 /* FunctionKeyword */ || token() === 120 /* InterfaceKeyword */ || token() === 60 /* AtToken */ || token() === 128 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 134 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine);
|
|
@@ -40473,25 +40478,28 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
40473
40478
|
return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) });
|
|
40474
40479
|
}
|
|
40475
40480
|
if (!isExternalModuleNameRelative(moduleName)) {
|
|
40476
|
-
let resolved2;
|
|
40477
40481
|
if (features & 2 /* Imports */ && startsWith(moduleName, "#")) {
|
|
40478
|
-
|
|
40479
|
-
|
|
40480
|
-
|
|
40481
|
-
|
|
40482
|
+
const resolved3 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
40483
|
+
if (resolved3) {
|
|
40484
|
+
return resolved3.value && { value: { resolved: resolved3.value, isExternalLibraryImport: false } };
|
|
40485
|
+
}
|
|
40482
40486
|
}
|
|
40483
|
-
if (
|
|
40484
|
-
|
|
40485
|
-
|
|
40486
|
-
|
|
40487
|
-
}
|
|
40488
|
-
return void 0;
|
|
40487
|
+
if (features & 4 /* SelfName */) {
|
|
40488
|
+
const resolved3 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
40489
|
+
if (resolved3) {
|
|
40490
|
+
return resolved3.value && { value: { resolved: resolved3.value, isExternalLibraryImport: false } };
|
|
40489
40491
|
}
|
|
40492
|
+
}
|
|
40493
|
+
if (moduleName.includes(":")) {
|
|
40490
40494
|
if (traceEnabled) {
|
|
40491
|
-
trace(host, Diagnostics.
|
|
40495
|
+
trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
40492
40496
|
}
|
|
40493
|
-
|
|
40497
|
+
return void 0;
|
|
40494
40498
|
}
|
|
40499
|
+
if (traceEnabled) {
|
|
40500
|
+
trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
40501
|
+
}
|
|
40502
|
+
let resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
40495
40503
|
if (extensions2 & 4 /* Declaration */) {
|
|
40496
40504
|
resolved2 ?? (resolved2 = resolveFromTypeRoot(moduleName, state2));
|
|
40497
40505
|
}
|
|
@@ -45075,7 +45083,7 @@ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, im
|
|
|
45075
45083
|
importMode,
|
|
45076
45084
|
prefersTsExtension(allowedEndings)
|
|
45077
45085
|
);
|
|
45078
|
-
const fromPaths = pathsOnly || fromPackageJsonImports === void 0 ? paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) : void 0;
|
|
45086
|
+
const fromPaths = pathsOnly || fromPackageJsonImports === void 0 ? paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, baseDirectory, getCanonicalFileName, host, compilerOptions) : void 0;
|
|
45079
45087
|
if (pathsOnly) {
|
|
45080
45088
|
return fromPaths;
|
|
45081
45089
|
}
|
|
@@ -45289,10 +45297,11 @@ function tryGetModuleNameFromAmbientModule(moduleSymbol, checker) {
|
|
|
45289
45297
|
return ambientModuleDeclare.name.text;
|
|
45290
45298
|
}
|
|
45291
45299
|
}
|
|
45292
|
-
function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
|
|
45300
|
+
function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, baseDirectory, getCanonicalFileName, host, compilerOptions) {
|
|
45293
45301
|
for (const key in paths) {
|
|
45294
45302
|
for (const patternText2 of paths[key]) {
|
|
45295
|
-
const
|
|
45303
|
+
const normalized = normalizePath(patternText2);
|
|
45304
|
+
const pattern = getRelativePathIfInSameVolume(normalized, baseDirectory, getCanonicalFileName) ?? normalized;
|
|
45296
45305
|
const indexOfStar = pattern.indexOf("*");
|
|
45297
45306
|
const candidates = allowedEndings.map((ending) => ({
|
|
45298
45307
|
ending,
|
|
@@ -45621,6 +45630,8 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
|
|
|
45621
45630
|
subModuleName,
|
|
45622
45631
|
versionPaths.paths,
|
|
45623
45632
|
allowedEndings,
|
|
45633
|
+
packageRootPath,
|
|
45634
|
+
getCanonicalFileName,
|
|
45624
45635
|
host,
|
|
45625
45636
|
options
|
|
45626
45637
|
);
|
|
@@ -55464,7 +55475,7 @@ function createTypeChecker(host) {
|
|
|
55464
55475
|
const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */);
|
|
55465
55476
|
const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */);
|
|
55466
55477
|
const accessor = tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
|
|
55467
|
-
let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor &&
|
|
55478
|
+
let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && getWidenedTypeForVariableLikeDeclaration(
|
|
55468
55479
|
accessor,
|
|
55469
55480
|
/*reportErrors*/
|
|
55470
55481
|
true
|
package/lib/typescript.js
CHANGED
|
@@ -2277,7 +2277,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2277
2277
|
|
|
2278
2278
|
// src/compiler/corePublic.ts
|
|
2279
2279
|
var versionMajorMinor = "5.7";
|
|
2280
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2280
|
+
var version = `${versionMajorMinor}.0-dev.20241016`;
|
|
2281
2281
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2282
2282
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2283
2283
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -33783,10 +33783,12 @@ var Parser;
|
|
|
33783
33783
|
case 90 /* DefaultKeyword */:
|
|
33784
33784
|
return nextTokenCanFollowDefaultKeyword();
|
|
33785
33785
|
case 126 /* StaticKeyword */:
|
|
33786
|
+
nextToken();
|
|
33787
|
+
return canFollowModifier();
|
|
33786
33788
|
case 139 /* GetKeyword */:
|
|
33787
33789
|
case 153 /* SetKeyword */:
|
|
33788
33790
|
nextToken();
|
|
33789
|
-
return
|
|
33791
|
+
return canFollowGetOrSetKeyword();
|
|
33790
33792
|
default:
|
|
33791
33793
|
return nextTokenIsOnSameLineAndCanFollowModifier();
|
|
33792
33794
|
}
|
|
@@ -33804,6 +33806,9 @@ var Parser;
|
|
|
33804
33806
|
function canFollowModifier() {
|
|
33805
33807
|
return token() === 23 /* OpenBracketToken */ || token() === 19 /* OpenBraceToken */ || token() === 42 /* AsteriskToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
|
|
33806
33808
|
}
|
|
33809
|
+
function canFollowGetOrSetKeyword() {
|
|
33810
|
+
return token() === 23 /* OpenBracketToken */ || isLiteralPropertyName();
|
|
33811
|
+
}
|
|
33807
33812
|
function nextTokenCanFollowDefaultKeyword() {
|
|
33808
33813
|
nextToken();
|
|
33809
33814
|
return token() === 86 /* ClassKeyword */ || token() === 100 /* FunctionKeyword */ || token() === 120 /* InterfaceKeyword */ || token() === 60 /* AtToken */ || token() === 128 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 134 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine);
|
|
@@ -44843,25 +44848,28 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
44843
44848
|
return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) });
|
|
44844
44849
|
}
|
|
44845
44850
|
if (!isExternalModuleNameRelative(moduleName)) {
|
|
44846
|
-
let resolved2;
|
|
44847
44851
|
if (features & 2 /* Imports */ && startsWith(moduleName, "#")) {
|
|
44848
|
-
|
|
44849
|
-
|
|
44850
|
-
|
|
44851
|
-
|
|
44852
|
+
const resolved3 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
44853
|
+
if (resolved3) {
|
|
44854
|
+
return resolved3.value && { value: { resolved: resolved3.value, isExternalLibraryImport: false } };
|
|
44855
|
+
}
|
|
44852
44856
|
}
|
|
44853
|
-
if (
|
|
44854
|
-
|
|
44855
|
-
|
|
44856
|
-
|
|
44857
|
-
}
|
|
44858
|
-
return void 0;
|
|
44857
|
+
if (features & 4 /* SelfName */) {
|
|
44858
|
+
const resolved3 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
44859
|
+
if (resolved3) {
|
|
44860
|
+
return resolved3.value && { value: { resolved: resolved3.value, isExternalLibraryImport: false } };
|
|
44859
44861
|
}
|
|
44862
|
+
}
|
|
44863
|
+
if (moduleName.includes(":")) {
|
|
44860
44864
|
if (traceEnabled) {
|
|
44861
|
-
trace(host, Diagnostics.
|
|
44865
|
+
trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
44862
44866
|
}
|
|
44863
|
-
|
|
44867
|
+
return void 0;
|
|
44864
44868
|
}
|
|
44869
|
+
if (traceEnabled) {
|
|
44870
|
+
trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
44871
|
+
}
|
|
44872
|
+
let resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
44865
44873
|
if (extensions2 & 4 /* Declaration */) {
|
|
44866
44874
|
resolved2 ?? (resolved2 = resolveFromTypeRoot(moduleName, state2));
|
|
44867
44875
|
}
|
|
@@ -49663,7 +49671,7 @@ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, im
|
|
|
49663
49671
|
importMode,
|
|
49664
49672
|
prefersTsExtension(allowedEndings)
|
|
49665
49673
|
);
|
|
49666
|
-
const fromPaths = pathsOnly || fromPackageJsonImports === void 0 ? paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) : void 0;
|
|
49674
|
+
const fromPaths = pathsOnly || fromPackageJsonImports === void 0 ? paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, baseDirectory, getCanonicalFileName, host, compilerOptions) : void 0;
|
|
49667
49675
|
if (pathsOnly) {
|
|
49668
49676
|
return fromPaths;
|
|
49669
49677
|
}
|
|
@@ -49892,10 +49900,11 @@ function tryGetModuleNameFromAmbientModule(moduleSymbol, checker) {
|
|
|
49892
49900
|
return ambientModuleDeclare.name.text;
|
|
49893
49901
|
}
|
|
49894
49902
|
}
|
|
49895
|
-
function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
|
|
49903
|
+
function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, baseDirectory, getCanonicalFileName, host, compilerOptions) {
|
|
49896
49904
|
for (const key in paths) {
|
|
49897
49905
|
for (const patternText2 of paths[key]) {
|
|
49898
|
-
const
|
|
49906
|
+
const normalized = normalizePath(patternText2);
|
|
49907
|
+
const pattern = getRelativePathIfInSameVolume(normalized, baseDirectory, getCanonicalFileName) ?? normalized;
|
|
49899
49908
|
const indexOfStar = pattern.indexOf("*");
|
|
49900
49909
|
const candidates = allowedEndings.map((ending) => ({
|
|
49901
49910
|
ending,
|
|
@@ -50224,6 +50233,8 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
|
|
|
50224
50233
|
subModuleName,
|
|
50225
50234
|
versionPaths.paths,
|
|
50226
50235
|
allowedEndings,
|
|
50236
|
+
packageRootPath,
|
|
50237
|
+
getCanonicalFileName,
|
|
50227
50238
|
host,
|
|
50228
50239
|
options
|
|
50229
50240
|
);
|
|
@@ -60067,7 +60078,7 @@ function createTypeChecker(host) {
|
|
|
60067
60078
|
const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */);
|
|
60068
60079
|
const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */);
|
|
60069
60080
|
const accessor = tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
|
|
60070
|
-
let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor &&
|
|
60081
|
+
let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && getWidenedTypeForVariableLikeDeclaration(
|
|
60071
60082
|
accessor,
|
|
60072
60083
|
/*reportErrors*/
|
|
60073
60084
|
true
|
|
@@ -141000,7 +141011,11 @@ function getExportInfoMap(importingFile, host, program, preferences, cancellatio
|
|
|
141000
141011
|
}
|
|
141001
141012
|
function getDefaultLikeExportInfo(moduleSymbol, checker) {
|
|
141002
141013
|
const exportEquals = checker.resolveExternalModuleSymbol(moduleSymbol);
|
|
141003
|
-
if (exportEquals !== moduleSymbol)
|
|
141014
|
+
if (exportEquals !== moduleSymbol) {
|
|
141015
|
+
const defaultExport2 = checker.tryGetMemberInModuleExports("default" /* Default */, exportEquals);
|
|
141016
|
+
if (defaultExport2) return { symbol: defaultExport2, exportKind: 1 /* Default */ };
|
|
141017
|
+
return { symbol: exportEquals, exportKind: 2 /* ExportEquals */ };
|
|
141018
|
+
}
|
|
141004
141019
|
const defaultExport = checker.tryGetMemberInModuleExports("default" /* Default */, moduleSymbol);
|
|
141005
141020
|
if (defaultExport) return { symbol: defaultExport, exportKind: 1 /* Default */ };
|
|
141006
141021
|
}
|
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.7.0-dev.
|
|
5
|
+
"version": "5.7.0-dev.20241016",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"node": "20.1.0",
|
|
117
117
|
"npm": "8.19.4"
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "bd1641f7691909450147cc38cc6f5e55b79e0545"
|
|
120
120
|
}
|