typescript 5.0.0-dev.20230130 → 5.0.0-dev.20230201
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 +28 -8
- package/lib/tsserver.js +29 -9
- package/lib/tsserverlibrary.js +30 -17
- package/lib/typescript.js +30 -17
- package/lib/typingsInstaller.js +6 -1
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
26
|
+
var version = `${versionMajorMinor}.0-dev.20230201`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -2769,6 +2769,9 @@ function mark(markName) {
|
|
|
2769
2769
|
counts.set(markName, count + 1);
|
|
2770
2770
|
marks.set(markName, timestamp());
|
|
2771
2771
|
performanceImpl == null ? void 0 : performanceImpl.mark(markName);
|
|
2772
|
+
if (typeof onProfilerEvent === "function") {
|
|
2773
|
+
onProfilerEvent(markName);
|
|
2774
|
+
}
|
|
2772
2775
|
}
|
|
2773
2776
|
}
|
|
2774
2777
|
function measure(measureName, startMarkName, endMarkName) {
|
|
@@ -7432,6 +7435,7 @@ var Diagnostics = {
|
|
|
7432
7435
|
new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),
|
|
7433
7436
|
_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),
|
|
7434
7437
|
Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),
|
|
7438
|
+
This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."),
|
|
7435
7439
|
Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),
|
|
7436
7440
|
Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),
|
|
7437
7441
|
Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."),
|
|
@@ -16496,7 +16500,7 @@ function rangeOfNode(node) {
|
|
|
16496
16500
|
}
|
|
16497
16501
|
function rangeOfTypeParameters(sourceFile, typeParameters) {
|
|
16498
16502
|
const pos = typeParameters.pos - 1;
|
|
16499
|
-
const end = skipTrivia(sourceFile.text, typeParameters.end) + 1;
|
|
16503
|
+
const end = Math.min(sourceFile.text.length, skipTrivia(sourceFile.text, typeParameters.end) + 1);
|
|
16500
16504
|
return { pos, end };
|
|
16501
16505
|
}
|
|
16502
16506
|
function skipTypeChecking(sourceFile, options, host) {
|
|
@@ -28564,6 +28568,7 @@ var Parser;
|
|
|
28564
28568
|
switch (fourth) {
|
|
28565
28569
|
case 63 /* EqualsToken */:
|
|
28566
28570
|
case 31 /* GreaterThanToken */:
|
|
28571
|
+
case 43 /* SlashToken */:
|
|
28567
28572
|
return false;
|
|
28568
28573
|
default:
|
|
28569
28574
|
return true;
|
|
@@ -53590,6 +53595,12 @@ function createTypeChecker(host) {
|
|
|
53590
53595
|
thisParameter = getAnnotatedAccessorThisParameter(other);
|
|
53591
53596
|
}
|
|
53592
53597
|
}
|
|
53598
|
+
if (isInJSFile(declaration)) {
|
|
53599
|
+
const thisTag = getJSDocThisTag(declaration);
|
|
53600
|
+
if (thisTag && thisTag.typeExpression) {
|
|
53601
|
+
thisParameter = createSymbolWithType(createSymbol(1 /* FunctionScopedVariable */, "this" /* This */), getTypeFromTypeNode(thisTag.typeExpression));
|
|
53602
|
+
}
|
|
53603
|
+
}
|
|
53593
53604
|
const classType = declaration.kind === 173 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
|
|
53594
53605
|
const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
|
|
53595
53606
|
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
|
|
@@ -53703,7 +53714,11 @@ function createTypeChecker(host) {
|
|
|
53703
53714
|
if (node.tags) {
|
|
53704
53715
|
for (const tag of node.tags) {
|
|
53705
53716
|
if (isJSDocOverloadTag(tag)) {
|
|
53706
|
-
|
|
53717
|
+
const jsDocSignature = tag.typeExpression;
|
|
53718
|
+
if (jsDocSignature.type === void 0) {
|
|
53719
|
+
reportImplicitAny(jsDocSignature, anyType);
|
|
53720
|
+
}
|
|
53721
|
+
result.push(getSignatureFromDeclaration(jsDocSignature));
|
|
53707
53722
|
hasJSDocOverloads = true;
|
|
53708
53723
|
}
|
|
53709
53724
|
}
|
|
@@ -61652,6 +61667,11 @@ function createTypeChecker(host) {
|
|
|
61652
61667
|
case 320 /* JSDocFunctionType */:
|
|
61653
61668
|
error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
|
|
61654
61669
|
return;
|
|
61670
|
+
case 326 /* JSDocSignature */:
|
|
61671
|
+
if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) {
|
|
61672
|
+
error(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString);
|
|
61673
|
+
}
|
|
61674
|
+
return;
|
|
61655
61675
|
case 259 /* FunctionDeclaration */:
|
|
61656
61676
|
case 171 /* MethodDeclaration */:
|
|
61657
61677
|
case 170 /* MethodSignature */:
|
|
@@ -64454,7 +64474,7 @@ function createTypeChecker(host) {
|
|
|
64454
64474
|
return narrowTypeByLiteralExpression(type, literal, assumeTrue);
|
|
64455
64475
|
}
|
|
64456
64476
|
function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
|
|
64457
|
-
return assumeTrue ? narrowTypeByTypeName(type, literal.text) :
|
|
64477
|
+
return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
|
|
64458
64478
|
}
|
|
64459
64479
|
function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
|
|
64460
64480
|
const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
|
|
@@ -64739,7 +64759,7 @@ function createTypeChecker(host) {
|
|
|
64739
64759
|
}
|
|
64740
64760
|
}
|
|
64741
64761
|
function getTypeOfSymbolAtLocation(symbol, location) {
|
|
64742
|
-
symbol = symbol
|
|
64762
|
+
symbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
64743
64763
|
if (location.kind === 79 /* Identifier */ || location.kind === 80 /* PrivateIdentifier */) {
|
|
64744
64764
|
if (isRightSideOfQualifiedNameOrPropertyAccess(location)) {
|
|
64745
64765
|
location = location.parent;
|
|
@@ -78930,7 +78950,7 @@ function createTypeChecker(host) {
|
|
|
78930
78950
|
}
|
|
78931
78951
|
return node.parent.kind === 180 /* TypeReference */;
|
|
78932
78952
|
}
|
|
78933
|
-
function
|
|
78953
|
+
function isInNameOfExpressionWithTypeArguments(node) {
|
|
78934
78954
|
while (node.parent.kind === 208 /* PropertyAccessExpression */) {
|
|
78935
78955
|
node = node.parent;
|
|
78936
78956
|
}
|
|
@@ -79040,10 +79060,10 @@ function createTypeChecker(host) {
|
|
|
79040
79060
|
while (isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name)) {
|
|
79041
79061
|
name = name.parent;
|
|
79042
79062
|
}
|
|
79043
|
-
if (
|
|
79063
|
+
if (isInNameOfExpressionWithTypeArguments(name)) {
|
|
79044
79064
|
let meaning = 0 /* None */;
|
|
79045
79065
|
if (name.parent.kind === 230 /* ExpressionWithTypeArguments */) {
|
|
79046
|
-
meaning = 788968 /* Type */;
|
|
79066
|
+
meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */;
|
|
79047
79067
|
if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) {
|
|
79048
79068
|
meaning |= 111551 /* Value */;
|
|
79049
79069
|
}
|
package/lib/tsserver.js
CHANGED
|
@@ -2378,7 +2378,7 @@ __export(ts_server_exports3, {
|
|
|
2378
2378
|
|
|
2379
2379
|
// src/compiler/corePublic.ts
|
|
2380
2380
|
var versionMajorMinor = "5.0";
|
|
2381
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2381
|
+
var version = `${versionMajorMinor}.0-dev.20230201`;
|
|
2382
2382
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2383
2383
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2384
2384
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -5526,6 +5526,9 @@ function mark(markName) {
|
|
|
5526
5526
|
counts.set(markName, count + 1);
|
|
5527
5527
|
marks.set(markName, timestamp());
|
|
5528
5528
|
performanceImpl == null ? void 0 : performanceImpl.mark(markName);
|
|
5529
|
+
if (typeof onProfilerEvent === "function") {
|
|
5530
|
+
onProfilerEvent(markName);
|
|
5531
|
+
}
|
|
5529
5532
|
}
|
|
5530
5533
|
}
|
|
5531
5534
|
function measure(measureName, startMarkName, endMarkName) {
|
|
@@ -10987,6 +10990,7 @@ var Diagnostics = {
|
|
|
10987
10990
|
new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),
|
|
10988
10991
|
_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),
|
|
10989
10992
|
Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),
|
|
10993
|
+
This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."),
|
|
10990
10994
|
Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),
|
|
10991
10995
|
Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),
|
|
10992
10996
|
Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."),
|
|
@@ -20678,7 +20682,7 @@ function rangeOfNode(node) {
|
|
|
20678
20682
|
}
|
|
20679
20683
|
function rangeOfTypeParameters(sourceFile, typeParameters) {
|
|
20680
20684
|
const pos = typeParameters.pos - 1;
|
|
20681
|
-
const end = skipTrivia(sourceFile.text, typeParameters.end) + 1;
|
|
20685
|
+
const end = Math.min(sourceFile.text.length, skipTrivia(sourceFile.text, typeParameters.end) + 1);
|
|
20682
20686
|
return { pos, end };
|
|
20683
20687
|
}
|
|
20684
20688
|
function skipTypeChecking(sourceFile, options, host) {
|
|
@@ -32974,6 +32978,7 @@ var Parser;
|
|
|
32974
32978
|
switch (fourth) {
|
|
32975
32979
|
case 63 /* EqualsToken */:
|
|
32976
32980
|
case 31 /* GreaterThanToken */:
|
|
32981
|
+
case 43 /* SlashToken */:
|
|
32977
32982
|
return false;
|
|
32978
32983
|
default:
|
|
32979
32984
|
return true;
|
|
@@ -58248,6 +58253,12 @@ function createTypeChecker(host) {
|
|
|
58248
58253
|
thisParameter = getAnnotatedAccessorThisParameter(other);
|
|
58249
58254
|
}
|
|
58250
58255
|
}
|
|
58256
|
+
if (isInJSFile(declaration)) {
|
|
58257
|
+
const thisTag = getJSDocThisTag(declaration);
|
|
58258
|
+
if (thisTag && thisTag.typeExpression) {
|
|
58259
|
+
thisParameter = createSymbolWithType(createSymbol(1 /* FunctionScopedVariable */, "this" /* This */), getTypeFromTypeNode(thisTag.typeExpression));
|
|
58260
|
+
}
|
|
58261
|
+
}
|
|
58251
58262
|
const classType = declaration.kind === 173 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
|
|
58252
58263
|
const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
|
|
58253
58264
|
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
|
|
@@ -58361,7 +58372,11 @@ function createTypeChecker(host) {
|
|
|
58361
58372
|
if (node.tags) {
|
|
58362
58373
|
for (const tag of node.tags) {
|
|
58363
58374
|
if (isJSDocOverloadTag(tag)) {
|
|
58364
|
-
|
|
58375
|
+
const jsDocSignature = tag.typeExpression;
|
|
58376
|
+
if (jsDocSignature.type === void 0) {
|
|
58377
|
+
reportImplicitAny(jsDocSignature, anyType);
|
|
58378
|
+
}
|
|
58379
|
+
result.push(getSignatureFromDeclaration(jsDocSignature));
|
|
58365
58380
|
hasJSDocOverloads = true;
|
|
58366
58381
|
}
|
|
58367
58382
|
}
|
|
@@ -66310,6 +66325,11 @@ function createTypeChecker(host) {
|
|
|
66310
66325
|
case 320 /* JSDocFunctionType */:
|
|
66311
66326
|
error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
|
|
66312
66327
|
return;
|
|
66328
|
+
case 326 /* JSDocSignature */:
|
|
66329
|
+
if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) {
|
|
66330
|
+
error(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString);
|
|
66331
|
+
}
|
|
66332
|
+
return;
|
|
66313
66333
|
case 259 /* FunctionDeclaration */:
|
|
66314
66334
|
case 171 /* MethodDeclaration */:
|
|
66315
66335
|
case 170 /* MethodSignature */:
|
|
@@ -69112,7 +69132,7 @@ function createTypeChecker(host) {
|
|
|
69112
69132
|
return narrowTypeByLiteralExpression(type, literal, assumeTrue);
|
|
69113
69133
|
}
|
|
69114
69134
|
function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
|
|
69115
|
-
return assumeTrue ? narrowTypeByTypeName(type, literal.text) :
|
|
69135
|
+
return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
|
|
69116
69136
|
}
|
|
69117
69137
|
function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
|
|
69118
69138
|
const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
|
|
@@ -69397,7 +69417,7 @@ function createTypeChecker(host) {
|
|
|
69397
69417
|
}
|
|
69398
69418
|
}
|
|
69399
69419
|
function getTypeOfSymbolAtLocation(symbol, location) {
|
|
69400
|
-
symbol = symbol
|
|
69420
|
+
symbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
69401
69421
|
if (location.kind === 79 /* Identifier */ || location.kind === 80 /* PrivateIdentifier */) {
|
|
69402
69422
|
if (isRightSideOfQualifiedNameOrPropertyAccess(location)) {
|
|
69403
69423
|
location = location.parent;
|
|
@@ -83588,7 +83608,7 @@ function createTypeChecker(host) {
|
|
|
83588
83608
|
}
|
|
83589
83609
|
return node.parent.kind === 180 /* TypeReference */;
|
|
83590
83610
|
}
|
|
83591
|
-
function
|
|
83611
|
+
function isInNameOfExpressionWithTypeArguments(node) {
|
|
83592
83612
|
while (node.parent.kind === 208 /* PropertyAccessExpression */) {
|
|
83593
83613
|
node = node.parent;
|
|
83594
83614
|
}
|
|
@@ -83698,10 +83718,10 @@ function createTypeChecker(host) {
|
|
|
83698
83718
|
while (isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name)) {
|
|
83699
83719
|
name = name.parent;
|
|
83700
83720
|
}
|
|
83701
|
-
if (
|
|
83721
|
+
if (isInNameOfExpressionWithTypeArguments(name)) {
|
|
83702
83722
|
let meaning = 0 /* None */;
|
|
83703
83723
|
if (name.parent.kind === 230 /* ExpressionWithTypeArguments */) {
|
|
83704
|
-
meaning = 788968 /* Type */;
|
|
83724
|
+
meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */;
|
|
83705
83725
|
if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) {
|
|
83706
83726
|
meaning |= 111551 /* Value */;
|
|
83707
83727
|
}
|
|
@@ -130624,7 +130644,7 @@ function getModuleSpecifierResolverHost(program, host) {
|
|
|
130624
130644
|
};
|
|
130625
130645
|
}
|
|
130626
130646
|
function moduleResolutionUsesNodeModules(moduleResolution) {
|
|
130627
|
-
return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */;
|
|
130647
|
+
return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
|
|
130628
130648
|
}
|
|
130629
130649
|
function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) {
|
|
130630
130650
|
return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : void 0;
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -18,17 +18,10 @@ and limitations under the License.
|
|
|
18
18
|
var ts = (() => {
|
|
19
19
|
var __defProp = Object.defineProperty;
|
|
20
20
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
21
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
22
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
23
|
-
}) : x)(function(x) {
|
|
24
|
-
if (typeof require !== "undefined")
|
|
25
|
-
return require.apply(this, arguments);
|
|
26
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
27
|
-
});
|
|
28
21
|
var __esm = (fn, res) => function __init() {
|
|
29
22
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
30
23
|
};
|
|
31
|
-
var __commonJS = (cb, mod) => function
|
|
24
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
32
25
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
33
26
|
};
|
|
34
27
|
var __export = (target, all) => {
|
|
@@ -42,7 +35,7 @@ var ts = (() => {
|
|
|
42
35
|
"src/compiler/corePublic.ts"() {
|
|
43
36
|
"use strict";
|
|
44
37
|
versionMajorMinor = "5.0";
|
|
45
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230201`;
|
|
46
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
47
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
48
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3196,6 +3189,9 @@ ${lanes.join("\n")}
|
|
|
3196
3189
|
counts.set(markName, count + 1);
|
|
3197
3190
|
marks.set(markName, timestamp());
|
|
3198
3191
|
performanceImpl == null ? void 0 : performanceImpl.mark(markName);
|
|
3192
|
+
if (typeof onProfilerEvent === "function") {
|
|
3193
|
+
onProfilerEvent(markName);
|
|
3194
|
+
}
|
|
3199
3195
|
}
|
|
3200
3196
|
}
|
|
3201
3197
|
function measure(measureName, startMarkName, endMarkName) {
|
|
@@ -8726,6 +8722,7 @@ ${lanes.join("\n")}
|
|
|
8726
8722
|
new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),
|
|
8727
8723
|
_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),
|
|
8728
8724
|
Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),
|
|
8725
|
+
This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."),
|
|
8729
8726
|
Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),
|
|
8730
8727
|
Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),
|
|
8731
8728
|
Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."),
|
|
@@ -18255,7 +18252,7 @@ ${lanes.join("\n")}
|
|
|
18255
18252
|
}
|
|
18256
18253
|
function rangeOfTypeParameters(sourceFile, typeParameters) {
|
|
18257
18254
|
const pos = typeParameters.pos - 1;
|
|
18258
|
-
const end = skipTrivia(sourceFile.text, typeParameters.end) + 1;
|
|
18255
|
+
const end = Math.min(sourceFile.text.length, skipTrivia(sourceFile.text, typeParameters.end) + 1);
|
|
18259
18256
|
return { pos, end };
|
|
18260
18257
|
}
|
|
18261
18258
|
function skipTypeChecking(sourceFile, options, host) {
|
|
@@ -31001,6 +30998,7 @@ ${lanes.join("\n")}
|
|
|
31001
30998
|
switch (fourth) {
|
|
31002
30999
|
case 63 /* EqualsToken */:
|
|
31003
31000
|
case 31 /* GreaterThanToken */:
|
|
31001
|
+
case 43 /* SlashToken */:
|
|
31004
31002
|
return false;
|
|
31005
31003
|
default:
|
|
31006
31004
|
return true;
|
|
@@ -55974,6 +55972,12 @@ ${lanes.join("\n")}
|
|
|
55974
55972
|
thisParameter = getAnnotatedAccessorThisParameter(other);
|
|
55975
55973
|
}
|
|
55976
55974
|
}
|
|
55975
|
+
if (isInJSFile(declaration)) {
|
|
55976
|
+
const thisTag = getJSDocThisTag(declaration);
|
|
55977
|
+
if (thisTag && thisTag.typeExpression) {
|
|
55978
|
+
thisParameter = createSymbolWithType(createSymbol(1 /* FunctionScopedVariable */, "this" /* This */), getTypeFromTypeNode(thisTag.typeExpression));
|
|
55979
|
+
}
|
|
55980
|
+
}
|
|
55977
55981
|
const classType = declaration.kind === 173 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
|
|
55978
55982
|
const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
|
|
55979
55983
|
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
|
|
@@ -56087,7 +56091,11 @@ ${lanes.join("\n")}
|
|
|
56087
56091
|
if (node.tags) {
|
|
56088
56092
|
for (const tag of node.tags) {
|
|
56089
56093
|
if (isJSDocOverloadTag(tag)) {
|
|
56090
|
-
|
|
56094
|
+
const jsDocSignature = tag.typeExpression;
|
|
56095
|
+
if (jsDocSignature.type === void 0) {
|
|
56096
|
+
reportImplicitAny(jsDocSignature, anyType);
|
|
56097
|
+
}
|
|
56098
|
+
result.push(getSignatureFromDeclaration(jsDocSignature));
|
|
56091
56099
|
hasJSDocOverloads = true;
|
|
56092
56100
|
}
|
|
56093
56101
|
}
|
|
@@ -64036,6 +64044,11 @@ ${lanes.join("\n")}
|
|
|
64036
64044
|
case 320 /* JSDocFunctionType */:
|
|
64037
64045
|
error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
|
|
64038
64046
|
return;
|
|
64047
|
+
case 326 /* JSDocSignature */:
|
|
64048
|
+
if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) {
|
|
64049
|
+
error(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString);
|
|
64050
|
+
}
|
|
64051
|
+
return;
|
|
64039
64052
|
case 259 /* FunctionDeclaration */:
|
|
64040
64053
|
case 171 /* MethodDeclaration */:
|
|
64041
64054
|
case 170 /* MethodSignature */:
|
|
@@ -66838,7 +66851,7 @@ ${lanes.join("\n")}
|
|
|
66838
66851
|
return narrowTypeByLiteralExpression(type, literal, assumeTrue);
|
|
66839
66852
|
}
|
|
66840
66853
|
function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
|
|
66841
|
-
return assumeTrue ? narrowTypeByTypeName(type, literal.text) :
|
|
66854
|
+
return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
|
|
66842
66855
|
}
|
|
66843
66856
|
function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
|
|
66844
66857
|
const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
|
|
@@ -67123,7 +67136,7 @@ ${lanes.join("\n")}
|
|
|
67123
67136
|
}
|
|
67124
67137
|
}
|
|
67125
67138
|
function getTypeOfSymbolAtLocation(symbol, location) {
|
|
67126
|
-
symbol = symbol
|
|
67139
|
+
symbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
67127
67140
|
if (location.kind === 79 /* Identifier */ || location.kind === 80 /* PrivateIdentifier */) {
|
|
67128
67141
|
if (isRightSideOfQualifiedNameOrPropertyAccess(location)) {
|
|
67129
67142
|
location = location.parent;
|
|
@@ -81314,7 +81327,7 @@ ${lanes.join("\n")}
|
|
|
81314
81327
|
}
|
|
81315
81328
|
return node.parent.kind === 180 /* TypeReference */;
|
|
81316
81329
|
}
|
|
81317
|
-
function
|
|
81330
|
+
function isInNameOfExpressionWithTypeArguments(node) {
|
|
81318
81331
|
while (node.parent.kind === 208 /* PropertyAccessExpression */) {
|
|
81319
81332
|
node = node.parent;
|
|
81320
81333
|
}
|
|
@@ -81424,10 +81437,10 @@ ${lanes.join("\n")}
|
|
|
81424
81437
|
while (isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name)) {
|
|
81425
81438
|
name = name.parent;
|
|
81426
81439
|
}
|
|
81427
|
-
if (
|
|
81440
|
+
if (isInNameOfExpressionWithTypeArguments(name)) {
|
|
81428
81441
|
let meaning = 0 /* None */;
|
|
81429
81442
|
if (name.parent.kind === 230 /* ExpressionWithTypeArguments */) {
|
|
81430
|
-
meaning = 788968 /* Type */;
|
|
81443
|
+
meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */;
|
|
81431
81444
|
if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) {
|
|
81432
81445
|
meaning |= 111551 /* Value */;
|
|
81433
81446
|
}
|
|
@@ -126506,7 +126519,7 @@ ${lanes.join("\n")}
|
|
|
126506
126519
|
};
|
|
126507
126520
|
}
|
|
126508
126521
|
function moduleResolutionUsesNodeModules(moduleResolution) {
|
|
126509
|
-
return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */;
|
|
126522
|
+
return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
|
|
126510
126523
|
}
|
|
126511
126524
|
function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) {
|
|
126512
126525
|
return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : void 0;
|
package/lib/typescript.js
CHANGED
|
@@ -18,17 +18,10 @@ and limitations under the License.
|
|
|
18
18
|
var ts = (() => {
|
|
19
19
|
var __defProp = Object.defineProperty;
|
|
20
20
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
21
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
22
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
23
|
-
}) : x)(function(x) {
|
|
24
|
-
if (typeof require !== "undefined")
|
|
25
|
-
return require.apply(this, arguments);
|
|
26
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
27
|
-
});
|
|
28
21
|
var __esm = (fn, res) => function __init() {
|
|
29
22
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
30
23
|
};
|
|
31
|
-
var __commonJS = (cb, mod) => function
|
|
24
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
32
25
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
33
26
|
};
|
|
34
27
|
var __export = (target, all) => {
|
|
@@ -42,7 +35,7 @@ var ts = (() => {
|
|
|
42
35
|
"src/compiler/corePublic.ts"() {
|
|
43
36
|
"use strict";
|
|
44
37
|
versionMajorMinor = "5.0";
|
|
45
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230201`;
|
|
46
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
47
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
48
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3196,6 +3189,9 @@ ${lanes.join("\n")}
|
|
|
3196
3189
|
counts.set(markName, count + 1);
|
|
3197
3190
|
marks.set(markName, timestamp());
|
|
3198
3191
|
performanceImpl == null ? void 0 : performanceImpl.mark(markName);
|
|
3192
|
+
if (typeof onProfilerEvent === "function") {
|
|
3193
|
+
onProfilerEvent(markName);
|
|
3194
|
+
}
|
|
3199
3195
|
}
|
|
3200
3196
|
}
|
|
3201
3197
|
function measure(measureName, startMarkName, endMarkName) {
|
|
@@ -8726,6 +8722,7 @@ ${lanes.join("\n")}
|
|
|
8726
8722
|
new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),
|
|
8727
8723
|
_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),
|
|
8728
8724
|
Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),
|
|
8725
|
+
This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."),
|
|
8729
8726
|
Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),
|
|
8730
8727
|
Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),
|
|
8731
8728
|
Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."),
|
|
@@ -18255,7 +18252,7 @@ ${lanes.join("\n")}
|
|
|
18255
18252
|
}
|
|
18256
18253
|
function rangeOfTypeParameters(sourceFile, typeParameters) {
|
|
18257
18254
|
const pos = typeParameters.pos - 1;
|
|
18258
|
-
const end = skipTrivia(sourceFile.text, typeParameters.end) + 1;
|
|
18255
|
+
const end = Math.min(sourceFile.text.length, skipTrivia(sourceFile.text, typeParameters.end) + 1);
|
|
18259
18256
|
return { pos, end };
|
|
18260
18257
|
}
|
|
18261
18258
|
function skipTypeChecking(sourceFile, options, host) {
|
|
@@ -31001,6 +30998,7 @@ ${lanes.join("\n")}
|
|
|
31001
30998
|
switch (fourth) {
|
|
31002
30999
|
case 63 /* EqualsToken */:
|
|
31003
31000
|
case 31 /* GreaterThanToken */:
|
|
31001
|
+
case 43 /* SlashToken */:
|
|
31004
31002
|
return false;
|
|
31005
31003
|
default:
|
|
31006
31004
|
return true;
|
|
@@ -55974,6 +55972,12 @@ ${lanes.join("\n")}
|
|
|
55974
55972
|
thisParameter = getAnnotatedAccessorThisParameter(other);
|
|
55975
55973
|
}
|
|
55976
55974
|
}
|
|
55975
|
+
if (isInJSFile(declaration)) {
|
|
55976
|
+
const thisTag = getJSDocThisTag(declaration);
|
|
55977
|
+
if (thisTag && thisTag.typeExpression) {
|
|
55978
|
+
thisParameter = createSymbolWithType(createSymbol(1 /* FunctionScopedVariable */, "this" /* This */), getTypeFromTypeNode(thisTag.typeExpression));
|
|
55979
|
+
}
|
|
55980
|
+
}
|
|
55977
55981
|
const classType = declaration.kind === 173 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
|
|
55978
55982
|
const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
|
|
55979
55983
|
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
|
|
@@ -56087,7 +56091,11 @@ ${lanes.join("\n")}
|
|
|
56087
56091
|
if (node.tags) {
|
|
56088
56092
|
for (const tag of node.tags) {
|
|
56089
56093
|
if (isJSDocOverloadTag(tag)) {
|
|
56090
|
-
|
|
56094
|
+
const jsDocSignature = tag.typeExpression;
|
|
56095
|
+
if (jsDocSignature.type === void 0) {
|
|
56096
|
+
reportImplicitAny(jsDocSignature, anyType);
|
|
56097
|
+
}
|
|
56098
|
+
result.push(getSignatureFromDeclaration(jsDocSignature));
|
|
56091
56099
|
hasJSDocOverloads = true;
|
|
56092
56100
|
}
|
|
56093
56101
|
}
|
|
@@ -64036,6 +64044,11 @@ ${lanes.join("\n")}
|
|
|
64036
64044
|
case 320 /* JSDocFunctionType */:
|
|
64037
64045
|
error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
|
|
64038
64046
|
return;
|
|
64047
|
+
case 326 /* JSDocSignature */:
|
|
64048
|
+
if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) {
|
|
64049
|
+
error(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString);
|
|
64050
|
+
}
|
|
64051
|
+
return;
|
|
64039
64052
|
case 259 /* FunctionDeclaration */:
|
|
64040
64053
|
case 171 /* MethodDeclaration */:
|
|
64041
64054
|
case 170 /* MethodSignature */:
|
|
@@ -66838,7 +66851,7 @@ ${lanes.join("\n")}
|
|
|
66838
66851
|
return narrowTypeByLiteralExpression(type, literal, assumeTrue);
|
|
66839
66852
|
}
|
|
66840
66853
|
function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
|
|
66841
|
-
return assumeTrue ? narrowTypeByTypeName(type, literal.text) :
|
|
66854
|
+
return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
|
|
66842
66855
|
}
|
|
66843
66856
|
function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
|
|
66844
66857
|
const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
|
|
@@ -67123,7 +67136,7 @@ ${lanes.join("\n")}
|
|
|
67123
67136
|
}
|
|
67124
67137
|
}
|
|
67125
67138
|
function getTypeOfSymbolAtLocation(symbol, location) {
|
|
67126
|
-
symbol = symbol
|
|
67139
|
+
symbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
67127
67140
|
if (location.kind === 79 /* Identifier */ || location.kind === 80 /* PrivateIdentifier */) {
|
|
67128
67141
|
if (isRightSideOfQualifiedNameOrPropertyAccess(location)) {
|
|
67129
67142
|
location = location.parent;
|
|
@@ -81314,7 +81327,7 @@ ${lanes.join("\n")}
|
|
|
81314
81327
|
}
|
|
81315
81328
|
return node.parent.kind === 180 /* TypeReference */;
|
|
81316
81329
|
}
|
|
81317
|
-
function
|
|
81330
|
+
function isInNameOfExpressionWithTypeArguments(node) {
|
|
81318
81331
|
while (node.parent.kind === 208 /* PropertyAccessExpression */) {
|
|
81319
81332
|
node = node.parent;
|
|
81320
81333
|
}
|
|
@@ -81424,10 +81437,10 @@ ${lanes.join("\n")}
|
|
|
81424
81437
|
while (isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name)) {
|
|
81425
81438
|
name = name.parent;
|
|
81426
81439
|
}
|
|
81427
|
-
if (
|
|
81440
|
+
if (isInNameOfExpressionWithTypeArguments(name)) {
|
|
81428
81441
|
let meaning = 0 /* None */;
|
|
81429
81442
|
if (name.parent.kind === 230 /* ExpressionWithTypeArguments */) {
|
|
81430
|
-
meaning = 788968 /* Type */;
|
|
81443
|
+
meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */;
|
|
81431
81444
|
if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) {
|
|
81432
81445
|
meaning |= 111551 /* Value */;
|
|
81433
81446
|
}
|
|
@@ -126520,7 +126533,7 @@ ${lanes.join("\n")}
|
|
|
126520
126533
|
};
|
|
126521
126534
|
}
|
|
126522
126535
|
function moduleResolutionUsesNodeModules(moduleResolution) {
|
|
126523
|
-
return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */;
|
|
126536
|
+
return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
|
|
126524
126537
|
}
|
|
126525
126538
|
function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) {
|
|
126526
126539
|
return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : void 0;
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.0";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20230201`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -2309,6 +2309,9 @@ function mark(markName) {
|
|
|
2309
2309
|
counts.set(markName, count + 1);
|
|
2310
2310
|
marks.set(markName, timestamp());
|
|
2311
2311
|
performanceImpl == null ? void 0 : performanceImpl.mark(markName);
|
|
2312
|
+
if (typeof onProfilerEvent === "function") {
|
|
2313
|
+
onProfilerEvent(markName);
|
|
2314
|
+
}
|
|
2312
2315
|
}
|
|
2313
2316
|
}
|
|
2314
2317
|
function measure(measureName, startMarkName, endMarkName) {
|
|
@@ -6840,6 +6843,7 @@ var Diagnostics = {
|
|
|
6840
6843
|
new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),
|
|
6841
6844
|
_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),
|
|
6842
6845
|
Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),
|
|
6846
|
+
This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."),
|
|
6843
6847
|
Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),
|
|
6844
6848
|
Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),
|
|
6845
6849
|
Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."),
|
|
@@ -21807,6 +21811,7 @@ var Parser;
|
|
|
21807
21811
|
switch (fourth) {
|
|
21808
21812
|
case 63 /* EqualsToken */:
|
|
21809
21813
|
case 31 /* GreaterThanToken */:
|
|
21814
|
+
case 43 /* SlashToken */:
|
|
21810
21815
|
return false;
|
|
21811
21816
|
default:
|
|
21812
21817
|
return true;
|
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.0.0-dev.
|
|
5
|
+
"version": "5.0.0-dev.20230201",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|