typescript 5.7.0-dev.20241014 → 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 +58 -30
- package/lib/typescript.js +66 -33
- 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;
|
|
40498
|
+
}
|
|
40499
|
+
if (traceEnabled) {
|
|
40500
|
+
trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
40494
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
|
|
@@ -91014,9 +91025,9 @@ function getDecoratorsOfParameters(node) {
|
|
|
91014
91025
|
}
|
|
91015
91026
|
return decorators;
|
|
91016
91027
|
}
|
|
91017
|
-
function getAllDecoratorsOfClass(node) {
|
|
91028
|
+
function getAllDecoratorsOfClass(node, useLegacyDecorators) {
|
|
91018
91029
|
const decorators = getDecorators(node);
|
|
91019
|
-
const parameters = getDecoratorsOfParameters(getFirstConstructorWithBody(node));
|
|
91030
|
+
const parameters = useLegacyDecorators ? getDecoratorsOfParameters(getFirstConstructorWithBody(node)) : void 0;
|
|
91020
91031
|
if (!some(decorators) && !some(parameters)) {
|
|
91021
91032
|
return void 0;
|
|
91022
91033
|
}
|
|
@@ -91030,18 +91041,27 @@ function getAllDecoratorsOfClassElement(member, parent, useLegacyDecorators) {
|
|
|
91030
91041
|
case 177 /* GetAccessor */:
|
|
91031
91042
|
case 178 /* SetAccessor */:
|
|
91032
91043
|
if (!useLegacyDecorators) {
|
|
91033
|
-
return getAllDecoratorsOfMethod(
|
|
91044
|
+
return getAllDecoratorsOfMethod(
|
|
91045
|
+
member,
|
|
91046
|
+
/*useLegacyDecorators*/
|
|
91047
|
+
false
|
|
91048
|
+
);
|
|
91034
91049
|
}
|
|
91035
|
-
return getAllDecoratorsOfAccessors(
|
|
91050
|
+
return getAllDecoratorsOfAccessors(
|
|
91051
|
+
member,
|
|
91052
|
+
parent,
|
|
91053
|
+
/*useLegacyDecorators*/
|
|
91054
|
+
true
|
|
91055
|
+
);
|
|
91036
91056
|
case 174 /* MethodDeclaration */:
|
|
91037
|
-
return getAllDecoratorsOfMethod(member);
|
|
91057
|
+
return getAllDecoratorsOfMethod(member, useLegacyDecorators);
|
|
91038
91058
|
case 172 /* PropertyDeclaration */:
|
|
91039
91059
|
return getAllDecoratorsOfProperty(member);
|
|
91040
91060
|
default:
|
|
91041
91061
|
return void 0;
|
|
91042
91062
|
}
|
|
91043
91063
|
}
|
|
91044
|
-
function getAllDecoratorsOfAccessors(accessor, parent) {
|
|
91064
|
+
function getAllDecoratorsOfAccessors(accessor, parent, useLegacyDecorators) {
|
|
91045
91065
|
if (!accessor.body) {
|
|
91046
91066
|
return void 0;
|
|
91047
91067
|
}
|
|
@@ -91051,7 +91071,7 @@ function getAllDecoratorsOfAccessors(accessor, parent) {
|
|
|
91051
91071
|
return void 0;
|
|
91052
91072
|
}
|
|
91053
91073
|
const decorators = getDecorators(firstAccessorWithDecorators);
|
|
91054
|
-
const parameters = getDecoratorsOfParameters(setAccessor);
|
|
91074
|
+
const parameters = useLegacyDecorators ? getDecoratorsOfParameters(setAccessor) : void 0;
|
|
91055
91075
|
if (!some(decorators) && !some(parameters)) {
|
|
91056
91076
|
return void 0;
|
|
91057
91077
|
}
|
|
@@ -91062,12 +91082,12 @@ function getAllDecoratorsOfAccessors(accessor, parent) {
|
|
|
91062
91082
|
setDecorators: setAccessor && getDecorators(setAccessor)
|
|
91063
91083
|
};
|
|
91064
91084
|
}
|
|
91065
|
-
function getAllDecoratorsOfMethod(method) {
|
|
91085
|
+
function getAllDecoratorsOfMethod(method, useLegacyDecorators) {
|
|
91066
91086
|
if (!method.body) {
|
|
91067
91087
|
return void 0;
|
|
91068
91088
|
}
|
|
91069
91089
|
const decorators = getDecorators(method);
|
|
91070
|
-
const parameters = getDecoratorsOfParameters(method);
|
|
91090
|
+
const parameters = useLegacyDecorators ? getDecoratorsOfParameters(method) : void 0;
|
|
91071
91091
|
if (!some(decorators) && !some(parameters)) {
|
|
91072
91092
|
return void 0;
|
|
91073
91093
|
}
|
|
@@ -96701,7 +96721,11 @@ function transformLegacyDecorators(context) {
|
|
|
96701
96721
|
}
|
|
96702
96722
|
}
|
|
96703
96723
|
function generateConstructorDecorationExpression(node) {
|
|
96704
|
-
const allDecorators = getAllDecoratorsOfClass(
|
|
96724
|
+
const allDecorators = getAllDecoratorsOfClass(
|
|
96725
|
+
node,
|
|
96726
|
+
/*useLegacyDecorators*/
|
|
96727
|
+
true
|
|
96728
|
+
);
|
|
96705
96729
|
const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators);
|
|
96706
96730
|
if (!decoratorExpressions) {
|
|
96707
96731
|
return void 0;
|
|
@@ -97213,7 +97237,11 @@ function transformESDecorators(context) {
|
|
|
97213
97237
|
let syntheticConstructor;
|
|
97214
97238
|
let heritageClauses;
|
|
97215
97239
|
let shouldTransformPrivateStaticElementsInClass = false;
|
|
97216
|
-
const classDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass(
|
|
97240
|
+
const classDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass(
|
|
97241
|
+
node,
|
|
97242
|
+
/*useLegacyDecorators*/
|
|
97243
|
+
false
|
|
97244
|
+
));
|
|
97217
97245
|
if (classDecorators) {
|
|
97218
97246
|
classInfo2.classDecoratorsName = factory2.createUniqueName("_classDecorators", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
97219
97247
|
classInfo2.classDescriptorName = factory2.createUniqueName("_classDescriptor", 16 /* Optimistic */ | 32 /* FileLevel */);
|
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;
|
|
44868
|
+
}
|
|
44869
|
+
if (traceEnabled) {
|
|
44870
|
+
trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
44864
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
|
|
@@ -95789,9 +95800,9 @@ function getDecoratorsOfParameters(node) {
|
|
|
95789
95800
|
}
|
|
95790
95801
|
return decorators;
|
|
95791
95802
|
}
|
|
95792
|
-
function getAllDecoratorsOfClass(node) {
|
|
95803
|
+
function getAllDecoratorsOfClass(node, useLegacyDecorators) {
|
|
95793
95804
|
const decorators = getDecorators(node);
|
|
95794
|
-
const parameters = getDecoratorsOfParameters(getFirstConstructorWithBody(node));
|
|
95805
|
+
const parameters = useLegacyDecorators ? getDecoratorsOfParameters(getFirstConstructorWithBody(node)) : void 0;
|
|
95795
95806
|
if (!some(decorators) && !some(parameters)) {
|
|
95796
95807
|
return void 0;
|
|
95797
95808
|
}
|
|
@@ -95805,18 +95816,27 @@ function getAllDecoratorsOfClassElement(member, parent2, useLegacyDecorators) {
|
|
|
95805
95816
|
case 177 /* GetAccessor */:
|
|
95806
95817
|
case 178 /* SetAccessor */:
|
|
95807
95818
|
if (!useLegacyDecorators) {
|
|
95808
|
-
return getAllDecoratorsOfMethod(
|
|
95819
|
+
return getAllDecoratorsOfMethod(
|
|
95820
|
+
member,
|
|
95821
|
+
/*useLegacyDecorators*/
|
|
95822
|
+
false
|
|
95823
|
+
);
|
|
95809
95824
|
}
|
|
95810
|
-
return getAllDecoratorsOfAccessors(
|
|
95825
|
+
return getAllDecoratorsOfAccessors(
|
|
95826
|
+
member,
|
|
95827
|
+
parent2,
|
|
95828
|
+
/*useLegacyDecorators*/
|
|
95829
|
+
true
|
|
95830
|
+
);
|
|
95811
95831
|
case 174 /* MethodDeclaration */:
|
|
95812
|
-
return getAllDecoratorsOfMethod(member);
|
|
95832
|
+
return getAllDecoratorsOfMethod(member, useLegacyDecorators);
|
|
95813
95833
|
case 172 /* PropertyDeclaration */:
|
|
95814
95834
|
return getAllDecoratorsOfProperty(member);
|
|
95815
95835
|
default:
|
|
95816
95836
|
return void 0;
|
|
95817
95837
|
}
|
|
95818
95838
|
}
|
|
95819
|
-
function getAllDecoratorsOfAccessors(accessor, parent2) {
|
|
95839
|
+
function getAllDecoratorsOfAccessors(accessor, parent2, useLegacyDecorators) {
|
|
95820
95840
|
if (!accessor.body) {
|
|
95821
95841
|
return void 0;
|
|
95822
95842
|
}
|
|
@@ -95826,7 +95846,7 @@ function getAllDecoratorsOfAccessors(accessor, parent2) {
|
|
|
95826
95846
|
return void 0;
|
|
95827
95847
|
}
|
|
95828
95848
|
const decorators = getDecorators(firstAccessorWithDecorators);
|
|
95829
|
-
const parameters = getDecoratorsOfParameters(setAccessor);
|
|
95849
|
+
const parameters = useLegacyDecorators ? getDecoratorsOfParameters(setAccessor) : void 0;
|
|
95830
95850
|
if (!some(decorators) && !some(parameters)) {
|
|
95831
95851
|
return void 0;
|
|
95832
95852
|
}
|
|
@@ -95837,12 +95857,12 @@ function getAllDecoratorsOfAccessors(accessor, parent2) {
|
|
|
95837
95857
|
setDecorators: setAccessor && getDecorators(setAccessor)
|
|
95838
95858
|
};
|
|
95839
95859
|
}
|
|
95840
|
-
function getAllDecoratorsOfMethod(method) {
|
|
95860
|
+
function getAllDecoratorsOfMethod(method, useLegacyDecorators) {
|
|
95841
95861
|
if (!method.body) {
|
|
95842
95862
|
return void 0;
|
|
95843
95863
|
}
|
|
95844
95864
|
const decorators = getDecorators(method);
|
|
95845
|
-
const parameters = getDecoratorsOfParameters(method);
|
|
95865
|
+
const parameters = useLegacyDecorators ? getDecoratorsOfParameters(method) : void 0;
|
|
95846
95866
|
if (!some(decorators) && !some(parameters)) {
|
|
95847
95867
|
return void 0;
|
|
95848
95868
|
}
|
|
@@ -101486,7 +101506,11 @@ function transformLegacyDecorators(context) {
|
|
|
101486
101506
|
}
|
|
101487
101507
|
}
|
|
101488
101508
|
function generateConstructorDecorationExpression(node) {
|
|
101489
|
-
const allDecorators = getAllDecoratorsOfClass(
|
|
101509
|
+
const allDecorators = getAllDecoratorsOfClass(
|
|
101510
|
+
node,
|
|
101511
|
+
/*useLegacyDecorators*/
|
|
101512
|
+
true
|
|
101513
|
+
);
|
|
101490
101514
|
const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators);
|
|
101491
101515
|
if (!decoratorExpressions) {
|
|
101492
101516
|
return void 0;
|
|
@@ -101998,7 +102022,11 @@ function transformESDecorators(context) {
|
|
|
101998
102022
|
let syntheticConstructor;
|
|
101999
102023
|
let heritageClauses;
|
|
102000
102024
|
let shouldTransformPrivateStaticElementsInClass = false;
|
|
102001
|
-
const classDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass(
|
|
102025
|
+
const classDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass(
|
|
102026
|
+
node,
|
|
102027
|
+
/*useLegacyDecorators*/
|
|
102028
|
+
false
|
|
102029
|
+
));
|
|
102002
102030
|
if (classDecorators) {
|
|
102003
102031
|
classInfo2.classDecoratorsName = factory2.createUniqueName("_classDecorators", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
102004
102032
|
classInfo2.classDescriptorName = factory2.createUniqueName("_classDescriptor", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
@@ -140983,7 +141011,11 @@ function getExportInfoMap(importingFile, host, program, preferences, cancellatio
|
|
|
140983
141011
|
}
|
|
140984
141012
|
function getDefaultLikeExportInfo(moduleSymbol, checker) {
|
|
140985
141013
|
const exportEquals = checker.resolveExternalModuleSymbol(moduleSymbol);
|
|
140986
|
-
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
|
+
}
|
|
140987
141019
|
const defaultExport = checker.tryGetMemberInModuleExports("default" /* Default */, moduleSymbol);
|
|
140988
141020
|
if (defaultExport) return { symbol: defaultExport, exportKind: 1 /* Default */ };
|
|
140989
141021
|
}
|
|
@@ -156999,7 +157031,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
|
|
|
156999
157031
|
function writeFixes(changeTracker, oldFileQuotePreference) {
|
|
157000
157032
|
var _a, _b;
|
|
157001
157033
|
let quotePreference;
|
|
157002
|
-
if (
|
|
157034
|
+
if (sourceFile.imports !== void 0 && sourceFile.imports.length === 0 && oldFileQuotePreference !== void 0) {
|
|
157003
157035
|
quotePreference = oldFileQuotePreference;
|
|
157004
157036
|
} else {
|
|
157005
157037
|
quotePreference = getQuotePreference(sourceFile, preferences);
|
|
@@ -159608,8 +159640,9 @@ function tryGetValueFromType(context, checker, importAdder, quotePreference, typ
|
|
|
159608
159640
|
}
|
|
159609
159641
|
if (type.flags & 1056 /* EnumLike */) {
|
|
159610
159642
|
const enumMember = type.symbol.exports ? firstOrUndefinedIterator(type.symbol.exports.values()) : type.symbol;
|
|
159643
|
+
const symbol = type.symbol.parent && type.symbol.parent.flags & 256 /* RegularEnum */ ? type.symbol.parent : type.symbol;
|
|
159611
159644
|
const name = checker.symbolToExpression(
|
|
159612
|
-
|
|
159645
|
+
symbol,
|
|
159613
159646
|
111551 /* Value */,
|
|
159614
159647
|
/*enclosingDeclaration*/
|
|
159615
159648
|
void 0,
|
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
|
}
|