typescript 5.5.0-dev.20240528 → 5.5.0-dev.20240529
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 +80 -69
- package/lib/typescript.js +80 -69
- 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.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20240529`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -45032,9 +45032,6 @@ function createTypeChecker(host) {
|
|
|
45032
45032
|
deferredDiagnosticsCallbacks.push(arg);
|
|
45033
45033
|
};
|
|
45034
45034
|
var cancellationToken;
|
|
45035
|
-
var requestedExternalEmitHelperNames = /* @__PURE__ */ new Set();
|
|
45036
|
-
var requestedExternalEmitHelpers;
|
|
45037
|
-
var externalHelpersModule;
|
|
45038
45035
|
var scanner;
|
|
45039
45036
|
var Symbol12 = objectAllocator.getSymbolConstructor();
|
|
45040
45037
|
var Type7 = objectAllocator.getTypeConstructor();
|
|
@@ -65747,12 +65744,17 @@ function createTypeChecker(host) {
|
|
|
65747
65744
|
}
|
|
65748
65745
|
}
|
|
65749
65746
|
function applyToReturnTypes(source, target, callback) {
|
|
65750
|
-
const sourceTypePredicate = getTypePredicateOfSignature(source);
|
|
65751
65747
|
const targetTypePredicate = getTypePredicateOfSignature(target);
|
|
65752
|
-
if (
|
|
65753
|
-
|
|
65754
|
-
|
|
65755
|
-
|
|
65748
|
+
if (targetTypePredicate) {
|
|
65749
|
+
const sourceTypePredicate = getTypePredicateOfSignature(source);
|
|
65750
|
+
if (sourceTypePredicate && typePredicateKindsMatch(sourceTypePredicate, targetTypePredicate) && sourceTypePredicate.type && targetTypePredicate.type) {
|
|
65751
|
+
callback(sourceTypePredicate.type, targetTypePredicate.type);
|
|
65752
|
+
return;
|
|
65753
|
+
}
|
|
65754
|
+
}
|
|
65755
|
+
const targetReturnType = getReturnTypeOfSignature(target);
|
|
65756
|
+
if (couldContainTypeVariables(targetReturnType)) {
|
|
65757
|
+
callback(getReturnTypeOfSignature(source), targetReturnType);
|
|
65756
65758
|
}
|
|
65757
65759
|
}
|
|
65758
65760
|
function createInferenceContext(typeParameters, signature, flags, compareTypes) {
|
|
@@ -85413,38 +85415,40 @@ function createTypeChecker(host) {
|
|
|
85413
85415
|
amalgamatedDuplicates = void 0;
|
|
85414
85416
|
}
|
|
85415
85417
|
function checkExternalEmitHelpers(location, helpers) {
|
|
85416
|
-
if (
|
|
85418
|
+
if (compilerOptions.importHelpers) {
|
|
85417
85419
|
const sourceFile = getSourceFileOfNode(location);
|
|
85418
85420
|
if (isEffectiveExternalModule(sourceFile, compilerOptions) && !(location.flags & 33554432 /* Ambient */)) {
|
|
85419
85421
|
const helpersModule = resolveHelpersModule(sourceFile, location);
|
|
85420
85422
|
if (helpersModule !== unknownSymbol) {
|
|
85421
|
-
const
|
|
85422
|
-
|
|
85423
|
-
|
|
85424
|
-
|
|
85425
|
-
|
|
85426
|
-
|
|
85427
|
-
const
|
|
85428
|
-
|
|
85429
|
-
|
|
85430
|
-
|
|
85431
|
-
if (
|
|
85432
|
-
|
|
85433
|
-
|
|
85434
|
-
|
|
85435
|
-
if (
|
|
85436
|
-
|
|
85437
|
-
|
|
85438
|
-
|
|
85439
|
-
if (
|
|
85440
|
-
|
|
85423
|
+
const links = getSymbolLinks(helpersModule);
|
|
85424
|
+
links.requestedExternalEmitHelpers ?? (links.requestedExternalEmitHelpers = 0);
|
|
85425
|
+
if ((links.requestedExternalEmitHelpers & helpers) !== helpers) {
|
|
85426
|
+
const uncheckedHelpers = helpers & ~links.requestedExternalEmitHelpers;
|
|
85427
|
+
for (let helper = 1 /* FirstEmitHelper */; helper <= 16777216 /* LastEmitHelper */; helper <<= 1) {
|
|
85428
|
+
if (uncheckedHelpers & helper) {
|
|
85429
|
+
for (const name of getHelperNames(helper)) {
|
|
85430
|
+
const symbol = resolveSymbol(getSymbol(getExportsOfModule(helpersModule), escapeLeadingUnderscores(name), 111551 /* Value */));
|
|
85431
|
+
if (!symbol) {
|
|
85432
|
+
error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name);
|
|
85433
|
+
} else if (helper & 524288 /* ClassPrivateFieldGet */) {
|
|
85434
|
+
if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 3)) {
|
|
85435
|
+
error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 4);
|
|
85436
|
+
}
|
|
85437
|
+
} else if (helper & 1048576 /* ClassPrivateFieldSet */) {
|
|
85438
|
+
if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 4)) {
|
|
85439
|
+
error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 5);
|
|
85440
|
+
}
|
|
85441
|
+
} else if (helper & 1024 /* SpreadArray */) {
|
|
85442
|
+
if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 2)) {
|
|
85443
|
+
error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 3);
|
|
85444
|
+
}
|
|
85441
85445
|
}
|
|
85442
85446
|
}
|
|
85443
85447
|
}
|
|
85444
85448
|
}
|
|
85445
85449
|
}
|
|
85450
|
+
links.requestedExternalEmitHelpers |= helpers;
|
|
85446
85451
|
}
|
|
85447
|
-
requestedExternalEmitHelpers |= helpers;
|
|
85448
85452
|
}
|
|
85449
85453
|
}
|
|
85450
85454
|
}
|
|
@@ -85505,10 +85509,11 @@ function createTypeChecker(host) {
|
|
|
85505
85509
|
}
|
|
85506
85510
|
}
|
|
85507
85511
|
function resolveHelpersModule(file, errorNode) {
|
|
85508
|
-
|
|
85509
|
-
|
|
85512
|
+
const links = getNodeLinks(file);
|
|
85513
|
+
if (!links.externalHelpersModule) {
|
|
85514
|
+
links.externalHelpersModule = resolveExternalModule(getImportHelpersImportSpecifier(file), externalHelpersModuleNameText, Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found, errorNode) || unknownSymbol;
|
|
85510
85515
|
}
|
|
85511
|
-
return externalHelpersModule;
|
|
85516
|
+
return links.externalHelpersModule;
|
|
85512
85517
|
}
|
|
85513
85518
|
function checkGrammarModifiers(node) {
|
|
85514
85519
|
var _a;
|
|
@@ -88898,8 +88903,8 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
88898
88903
|
const exportSpecifiers = new IdentifierNameMultiMap();
|
|
88899
88904
|
const exportedBindings = [];
|
|
88900
88905
|
const uniqueExports = /* @__PURE__ */ new Map();
|
|
88906
|
+
const exportedFunctions = /* @__PURE__ */ new Set();
|
|
88901
88907
|
let exportedNames;
|
|
88902
|
-
let exportedFunctions;
|
|
88903
88908
|
let hasExportDefault = false;
|
|
88904
88909
|
let exportEquals;
|
|
88905
88910
|
let hasExportStarsToExportValues = false;
|
|
@@ -88959,19 +88964,12 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
88959
88964
|
break;
|
|
88960
88965
|
case 262 /* FunctionDeclaration */:
|
|
88961
88966
|
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
88962
|
-
|
|
88963
|
-
|
|
88964
|
-
|
|
88965
|
-
|
|
88966
|
-
|
|
88967
|
-
|
|
88968
|
-
} else {
|
|
88969
|
-
const name = node.name;
|
|
88970
|
-
if (!uniqueExports.get(idText(name))) {
|
|
88971
|
-
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
88972
|
-
uniqueExports.set(idText(name), true);
|
|
88973
|
-
}
|
|
88974
|
-
}
|
|
88967
|
+
addExportedFunctionDeclaration(
|
|
88968
|
+
node,
|
|
88969
|
+
/*name*/
|
|
88970
|
+
void 0,
|
|
88971
|
+
hasSyntacticModifier(node, 2048 /* Default */)
|
|
88972
|
+
);
|
|
88975
88973
|
}
|
|
88976
88974
|
break;
|
|
88977
88975
|
case 263 /* ClassDeclaration */:
|
|
@@ -89007,6 +89005,10 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89007
89005
|
}
|
|
89008
89006
|
const decl = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name);
|
|
89009
89007
|
if (decl) {
|
|
89008
|
+
if (decl.kind === 262 /* FunctionDeclaration */) {
|
|
89009
|
+
addExportedFunctionDeclaration(decl, specifier.name, specifier.name.escapedText === "default" /* Default */);
|
|
89010
|
+
continue;
|
|
89011
|
+
}
|
|
89010
89012
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), specifier.name);
|
|
89011
89013
|
}
|
|
89012
89014
|
uniqueExports.set(idText(specifier.name), true);
|
|
@@ -89014,6 +89016,21 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89014
89016
|
}
|
|
89015
89017
|
}
|
|
89016
89018
|
}
|
|
89019
|
+
function addExportedFunctionDeclaration(node, name, isDefault) {
|
|
89020
|
+
exportedFunctions.add(node);
|
|
89021
|
+
if (isDefault) {
|
|
89022
|
+
if (!hasExportDefault) {
|
|
89023
|
+
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name ?? context.factory.getDeclarationName(node));
|
|
89024
|
+
hasExportDefault = true;
|
|
89025
|
+
}
|
|
89026
|
+
} else {
|
|
89027
|
+
name ?? (name = node.name);
|
|
89028
|
+
if (!uniqueExports.get(idText(name))) {
|
|
89029
|
+
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
89030
|
+
uniqueExports.set(idText(name), true);
|
|
89031
|
+
}
|
|
89032
|
+
}
|
|
89033
|
+
}
|
|
89017
89034
|
}
|
|
89018
89035
|
function collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings) {
|
|
89019
89036
|
if (isBindingPattern(decl.name)) {
|
|
@@ -106296,10 +106313,8 @@ function transformModule(context) {
|
|
|
106296
106313
|
);
|
|
106297
106314
|
}
|
|
106298
106315
|
}
|
|
106299
|
-
|
|
106300
|
-
|
|
106301
|
-
appendExportsOfHoistedDeclaration(statements, f);
|
|
106302
|
-
}
|
|
106316
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
106317
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
106303
106318
|
}
|
|
106304
106319
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
106305
106320
|
addRange(statements, visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset));
|
|
@@ -106616,10 +106631,8 @@ function transformModule(context) {
|
|
|
106616
106631
|
if (some(currentModuleInfo.exportedNames)) {
|
|
106617
106632
|
append(statements, factory2.createExpressionStatement(reduceLeft(currentModuleInfo.exportedNames, (prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), factory2.createVoidZero())));
|
|
106618
106633
|
}
|
|
106619
|
-
|
|
106620
|
-
|
|
106621
|
-
appendExportsOfHoistedDeclaration(statements, f);
|
|
106622
|
-
}
|
|
106634
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
106635
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
106623
106636
|
}
|
|
106624
106637
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
106625
106638
|
if (moduleKind === 2 /* AMD */) {
|
|
@@ -108333,7 +108346,7 @@ function transformSystemModule(context) {
|
|
|
108333
108346
|
if (!moduleInfo.hasExportStarsToExportValues) {
|
|
108334
108347
|
return;
|
|
108335
108348
|
}
|
|
108336
|
-
if (!some(moduleInfo.exportedNames) &&
|
|
108349
|
+
if (!some(moduleInfo.exportedNames) && moduleInfo.exportedFunctions.size === 0 && moduleInfo.exportSpecifiers.size === 0) {
|
|
108337
108350
|
let hasExportDeclarationWithExportClause = false;
|
|
108338
108351
|
for (const externalImport of moduleInfo.externalImports) {
|
|
108339
108352
|
if (externalImport.kind === 278 /* ExportDeclaration */ && externalImport.exportClause) {
|
|
@@ -108364,19 +108377,17 @@ function transformSystemModule(context) {
|
|
|
108364
108377
|
);
|
|
108365
108378
|
}
|
|
108366
108379
|
}
|
|
108367
|
-
|
|
108368
|
-
|
|
108369
|
-
|
|
108370
|
-
continue;
|
|
108371
|
-
}
|
|
108372
|
-
Debug.assert(!!f.name);
|
|
108373
|
-
exportedNames.push(
|
|
108374
|
-
factory2.createPropertyAssignment(
|
|
108375
|
-
factory2.createStringLiteralFromNode(f.name),
|
|
108376
|
-
factory2.createTrue()
|
|
108377
|
-
)
|
|
108378
|
-
);
|
|
108380
|
+
for (const f of moduleInfo.exportedFunctions) {
|
|
108381
|
+
if (hasSyntacticModifier(f, 2048 /* Default */)) {
|
|
108382
|
+
continue;
|
|
108379
108383
|
}
|
|
108384
|
+
Debug.assert(!!f.name);
|
|
108385
|
+
exportedNames.push(
|
|
108386
|
+
factory2.createPropertyAssignment(
|
|
108387
|
+
factory2.createStringLiteralFromNode(f.name),
|
|
108388
|
+
factory2.createTrue()
|
|
108389
|
+
)
|
|
108390
|
+
);
|
|
108380
108391
|
}
|
|
108381
108392
|
const exportedNamesStorageRef = factory2.createUniqueName("exportedNames");
|
|
108382
108393
|
statements.push(
|
package/lib/typescript.js
CHANGED
|
@@ -2370,7 +2370,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2370
2370
|
|
|
2371
2371
|
// src/compiler/corePublic.ts
|
|
2372
2372
|
var versionMajorMinor = "5.5";
|
|
2373
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2373
|
+
var version = `${versionMajorMinor}.0-dev.20240529`;
|
|
2374
2374
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2375
2375
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2376
2376
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -49827,9 +49827,6 @@ function createTypeChecker(host) {
|
|
|
49827
49827
|
deferredDiagnosticsCallbacks.push(arg);
|
|
49828
49828
|
};
|
|
49829
49829
|
var cancellationToken;
|
|
49830
|
-
var requestedExternalEmitHelperNames = /* @__PURE__ */ new Set();
|
|
49831
|
-
var requestedExternalEmitHelpers;
|
|
49832
|
-
var externalHelpersModule;
|
|
49833
49830
|
var scanner2;
|
|
49834
49831
|
var Symbol47 = objectAllocator.getSymbolConstructor();
|
|
49835
49832
|
var Type29 = objectAllocator.getTypeConstructor();
|
|
@@ -70542,12 +70539,17 @@ function createTypeChecker(host) {
|
|
|
70542
70539
|
}
|
|
70543
70540
|
}
|
|
70544
70541
|
function applyToReturnTypes(source, target, callback) {
|
|
70545
|
-
const sourceTypePredicate = getTypePredicateOfSignature(source);
|
|
70546
70542
|
const targetTypePredicate = getTypePredicateOfSignature(target);
|
|
70547
|
-
if (
|
|
70548
|
-
|
|
70549
|
-
|
|
70550
|
-
|
|
70543
|
+
if (targetTypePredicate) {
|
|
70544
|
+
const sourceTypePredicate = getTypePredicateOfSignature(source);
|
|
70545
|
+
if (sourceTypePredicate && typePredicateKindsMatch(sourceTypePredicate, targetTypePredicate) && sourceTypePredicate.type && targetTypePredicate.type) {
|
|
70546
|
+
callback(sourceTypePredicate.type, targetTypePredicate.type);
|
|
70547
|
+
return;
|
|
70548
|
+
}
|
|
70549
|
+
}
|
|
70550
|
+
const targetReturnType = getReturnTypeOfSignature(target);
|
|
70551
|
+
if (couldContainTypeVariables(targetReturnType)) {
|
|
70552
|
+
callback(getReturnTypeOfSignature(source), targetReturnType);
|
|
70551
70553
|
}
|
|
70552
70554
|
}
|
|
70553
70555
|
function createInferenceContext(typeParameters, signature, flags, compareTypes) {
|
|
@@ -90208,38 +90210,40 @@ function createTypeChecker(host) {
|
|
|
90208
90210
|
amalgamatedDuplicates = void 0;
|
|
90209
90211
|
}
|
|
90210
90212
|
function checkExternalEmitHelpers(location, helpers) {
|
|
90211
|
-
if (
|
|
90213
|
+
if (compilerOptions.importHelpers) {
|
|
90212
90214
|
const sourceFile = getSourceFileOfNode(location);
|
|
90213
90215
|
if (isEffectiveExternalModule(sourceFile, compilerOptions) && !(location.flags & 33554432 /* Ambient */)) {
|
|
90214
90216
|
const helpersModule = resolveHelpersModule(sourceFile, location);
|
|
90215
90217
|
if (helpersModule !== unknownSymbol) {
|
|
90216
|
-
const
|
|
90217
|
-
|
|
90218
|
-
|
|
90219
|
-
|
|
90220
|
-
|
|
90221
|
-
|
|
90222
|
-
const
|
|
90223
|
-
|
|
90224
|
-
|
|
90225
|
-
|
|
90226
|
-
if (
|
|
90227
|
-
|
|
90228
|
-
|
|
90229
|
-
|
|
90230
|
-
if (
|
|
90231
|
-
|
|
90232
|
-
|
|
90233
|
-
|
|
90234
|
-
if (
|
|
90235
|
-
|
|
90218
|
+
const links = getSymbolLinks(helpersModule);
|
|
90219
|
+
links.requestedExternalEmitHelpers ?? (links.requestedExternalEmitHelpers = 0);
|
|
90220
|
+
if ((links.requestedExternalEmitHelpers & helpers) !== helpers) {
|
|
90221
|
+
const uncheckedHelpers = helpers & ~links.requestedExternalEmitHelpers;
|
|
90222
|
+
for (let helper = 1 /* FirstEmitHelper */; helper <= 16777216 /* LastEmitHelper */; helper <<= 1) {
|
|
90223
|
+
if (uncheckedHelpers & helper) {
|
|
90224
|
+
for (const name of getHelperNames(helper)) {
|
|
90225
|
+
const symbol = resolveSymbol(getSymbol2(getExportsOfModule(helpersModule), escapeLeadingUnderscores(name), 111551 /* Value */));
|
|
90226
|
+
if (!symbol) {
|
|
90227
|
+
error2(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name);
|
|
90228
|
+
} else if (helper & 524288 /* ClassPrivateFieldGet */) {
|
|
90229
|
+
if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 3)) {
|
|
90230
|
+
error2(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 4);
|
|
90231
|
+
}
|
|
90232
|
+
} else if (helper & 1048576 /* ClassPrivateFieldSet */) {
|
|
90233
|
+
if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 4)) {
|
|
90234
|
+
error2(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 5);
|
|
90235
|
+
}
|
|
90236
|
+
} else if (helper & 1024 /* SpreadArray */) {
|
|
90237
|
+
if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 2)) {
|
|
90238
|
+
error2(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 3);
|
|
90239
|
+
}
|
|
90236
90240
|
}
|
|
90237
90241
|
}
|
|
90238
90242
|
}
|
|
90239
90243
|
}
|
|
90240
90244
|
}
|
|
90245
|
+
links.requestedExternalEmitHelpers |= helpers;
|
|
90241
90246
|
}
|
|
90242
|
-
requestedExternalEmitHelpers |= helpers;
|
|
90243
90247
|
}
|
|
90244
90248
|
}
|
|
90245
90249
|
}
|
|
@@ -90300,10 +90304,11 @@ function createTypeChecker(host) {
|
|
|
90300
90304
|
}
|
|
90301
90305
|
}
|
|
90302
90306
|
function resolveHelpersModule(file, errorNode) {
|
|
90303
|
-
|
|
90304
|
-
|
|
90307
|
+
const links = getNodeLinks(file);
|
|
90308
|
+
if (!links.externalHelpersModule) {
|
|
90309
|
+
links.externalHelpersModule = resolveExternalModule(getImportHelpersImportSpecifier(file), externalHelpersModuleNameText, Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found, errorNode) || unknownSymbol;
|
|
90305
90310
|
}
|
|
90306
|
-
return externalHelpersModule;
|
|
90311
|
+
return links.externalHelpersModule;
|
|
90307
90312
|
}
|
|
90308
90313
|
function checkGrammarModifiers(node) {
|
|
90309
90314
|
var _a;
|
|
@@ -93865,8 +93870,8 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
93865
93870
|
const exportSpecifiers = new IdentifierNameMultiMap();
|
|
93866
93871
|
const exportedBindings = [];
|
|
93867
93872
|
const uniqueExports = /* @__PURE__ */ new Map();
|
|
93873
|
+
const exportedFunctions = /* @__PURE__ */ new Set();
|
|
93868
93874
|
let exportedNames;
|
|
93869
|
-
let exportedFunctions;
|
|
93870
93875
|
let hasExportDefault = false;
|
|
93871
93876
|
let exportEquals;
|
|
93872
93877
|
let hasExportStarsToExportValues = false;
|
|
@@ -93926,19 +93931,12 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
93926
93931
|
break;
|
|
93927
93932
|
case 262 /* FunctionDeclaration */:
|
|
93928
93933
|
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
93929
|
-
|
|
93930
|
-
|
|
93931
|
-
|
|
93932
|
-
|
|
93933
|
-
|
|
93934
|
-
|
|
93935
|
-
} else {
|
|
93936
|
-
const name = node.name;
|
|
93937
|
-
if (!uniqueExports.get(idText(name))) {
|
|
93938
|
-
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
93939
|
-
uniqueExports.set(idText(name), true);
|
|
93940
|
-
}
|
|
93941
|
-
}
|
|
93934
|
+
addExportedFunctionDeclaration(
|
|
93935
|
+
node,
|
|
93936
|
+
/*name*/
|
|
93937
|
+
void 0,
|
|
93938
|
+
hasSyntacticModifier(node, 2048 /* Default */)
|
|
93939
|
+
);
|
|
93942
93940
|
}
|
|
93943
93941
|
break;
|
|
93944
93942
|
case 263 /* ClassDeclaration */:
|
|
@@ -93974,6 +93972,10 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
93974
93972
|
}
|
|
93975
93973
|
const decl = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name);
|
|
93976
93974
|
if (decl) {
|
|
93975
|
+
if (decl.kind === 262 /* FunctionDeclaration */) {
|
|
93976
|
+
addExportedFunctionDeclaration(decl, specifier.name, specifier.name.escapedText === "default" /* Default */);
|
|
93977
|
+
continue;
|
|
93978
|
+
}
|
|
93977
93979
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), specifier.name);
|
|
93978
93980
|
}
|
|
93979
93981
|
uniqueExports.set(idText(specifier.name), true);
|
|
@@ -93981,6 +93983,21 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
93981
93983
|
}
|
|
93982
93984
|
}
|
|
93983
93985
|
}
|
|
93986
|
+
function addExportedFunctionDeclaration(node, name, isDefault) {
|
|
93987
|
+
exportedFunctions.add(node);
|
|
93988
|
+
if (isDefault) {
|
|
93989
|
+
if (!hasExportDefault) {
|
|
93990
|
+
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name ?? context.factory.getDeclarationName(node));
|
|
93991
|
+
hasExportDefault = true;
|
|
93992
|
+
}
|
|
93993
|
+
} else {
|
|
93994
|
+
name ?? (name = node.name);
|
|
93995
|
+
if (!uniqueExports.get(idText(name))) {
|
|
93996
|
+
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
93997
|
+
uniqueExports.set(idText(name), true);
|
|
93998
|
+
}
|
|
93999
|
+
}
|
|
94000
|
+
}
|
|
93984
94001
|
}
|
|
93985
94002
|
function collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings) {
|
|
93986
94003
|
if (isBindingPattern(decl.name)) {
|
|
@@ -111273,10 +111290,8 @@ function transformModule(context) {
|
|
|
111273
111290
|
);
|
|
111274
111291
|
}
|
|
111275
111292
|
}
|
|
111276
|
-
|
|
111277
|
-
|
|
111278
|
-
appendExportsOfHoistedDeclaration(statements, f);
|
|
111279
|
-
}
|
|
111293
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
111294
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
111280
111295
|
}
|
|
111281
111296
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
111282
111297
|
addRange(statements, visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset));
|
|
@@ -111593,10 +111608,8 @@ function transformModule(context) {
|
|
|
111593
111608
|
if (some(currentModuleInfo.exportedNames)) {
|
|
111594
111609
|
append(statements, factory2.createExpressionStatement(reduceLeft(currentModuleInfo.exportedNames, (prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), factory2.createVoidZero())));
|
|
111595
111610
|
}
|
|
111596
|
-
|
|
111597
|
-
|
|
111598
|
-
appendExportsOfHoistedDeclaration(statements, f);
|
|
111599
|
-
}
|
|
111611
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
111612
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
111600
111613
|
}
|
|
111601
111614
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
111602
111615
|
if (moduleKind === 2 /* AMD */) {
|
|
@@ -113310,7 +113323,7 @@ function transformSystemModule(context) {
|
|
|
113310
113323
|
if (!moduleInfo.hasExportStarsToExportValues) {
|
|
113311
113324
|
return;
|
|
113312
113325
|
}
|
|
113313
|
-
if (!some(moduleInfo.exportedNames) &&
|
|
113326
|
+
if (!some(moduleInfo.exportedNames) && moduleInfo.exportedFunctions.size === 0 && moduleInfo.exportSpecifiers.size === 0) {
|
|
113314
113327
|
let hasExportDeclarationWithExportClause = false;
|
|
113315
113328
|
for (const externalImport of moduleInfo.externalImports) {
|
|
113316
113329
|
if (externalImport.kind === 278 /* ExportDeclaration */ && externalImport.exportClause) {
|
|
@@ -113341,19 +113354,17 @@ function transformSystemModule(context) {
|
|
|
113341
113354
|
);
|
|
113342
113355
|
}
|
|
113343
113356
|
}
|
|
113344
|
-
|
|
113345
|
-
|
|
113346
|
-
|
|
113347
|
-
continue;
|
|
113348
|
-
}
|
|
113349
|
-
Debug.assert(!!f.name);
|
|
113350
|
-
exportedNames.push(
|
|
113351
|
-
factory2.createPropertyAssignment(
|
|
113352
|
-
factory2.createStringLiteralFromNode(f.name),
|
|
113353
|
-
factory2.createTrue()
|
|
113354
|
-
)
|
|
113355
|
-
);
|
|
113357
|
+
for (const f of moduleInfo.exportedFunctions) {
|
|
113358
|
+
if (hasSyntacticModifier(f, 2048 /* Default */)) {
|
|
113359
|
+
continue;
|
|
113356
113360
|
}
|
|
113361
|
+
Debug.assert(!!f.name);
|
|
113362
|
+
exportedNames.push(
|
|
113363
|
+
factory2.createPropertyAssignment(
|
|
113364
|
+
factory2.createStringLiteralFromNode(f.name),
|
|
113365
|
+
factory2.createTrue()
|
|
113366
|
+
)
|
|
113367
|
+
);
|
|
113357
113368
|
}
|
|
113358
113369
|
const exportedNamesStorageRef = factory2.createUniqueName("exportedNames");
|
|
113359
113370
|
statements.push(
|
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.5.0-dev.
|
|
5
|
+
"version": "5.5.0-dev.20240529",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"node": "20.1.0",
|
|
113
113
|
"npm": "8.19.4"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "fa58c615a43d0c2c9ed60ef4ff4783da91c0ce32"
|
|
116
116
|
}
|