typescript 5.0.0-dev.20221220 → 5.0.0-dev.20221221
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 +5 -1
- package/lib/tsserver.js +28 -14
- package/lib/tsserverlibrary.js +28 -14
- package/lib/typescript.js +28 -14
- package/lib/typingsInstaller.js +1 -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.20221221`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -72544,6 +72544,8 @@ function createTypeChecker(host) {
|
|
|
72544
72544
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly");
|
|
72545
72545
|
} else if (node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 168 /* PropertySignature */ && node.kind !== 178 /* IndexSignature */ && node.kind !== 166 /* Parameter */) {
|
|
72546
72546
|
return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
|
|
72547
|
+
} else if (flags & 128 /* Accessor */) {
|
|
72548
|
+
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor");
|
|
72547
72549
|
}
|
|
72548
72550
|
flags |= 64 /* Readonly */;
|
|
72549
72551
|
break;
|
|
@@ -72587,6 +72589,8 @@ function createTypeChecker(host) {
|
|
|
72587
72589
|
return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
|
|
72588
72590
|
} else if (isPrivateIdentifierClassElementDeclaration(node)) {
|
|
72589
72591
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
|
|
72592
|
+
} else if (flags & 128 /* Accessor */) {
|
|
72593
|
+
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor");
|
|
72590
72594
|
}
|
|
72591
72595
|
flags |= 2 /* Ambient */;
|
|
72592
72596
|
lastDeclare = modifier;
|
package/lib/tsserver.js
CHANGED
|
@@ -2670,7 +2670,7 @@ __export(ts_server_exports3, {
|
|
|
2670
2670
|
|
|
2671
2671
|
// src/compiler/corePublic.ts
|
|
2672
2672
|
var versionMajorMinor = "5.0";
|
|
2673
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2673
|
+
var version = `${versionMajorMinor}.0-dev.20221221`;
|
|
2674
2674
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2675
2675
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2676
2676
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6737,13 +6737,13 @@ var UnionReduction = /* @__PURE__ */ ((UnionReduction2) => {
|
|
|
6737
6737
|
UnionReduction2[UnionReduction2["Subtype"] = 2] = "Subtype";
|
|
6738
6738
|
return UnionReduction2;
|
|
6739
6739
|
})(UnionReduction || {});
|
|
6740
|
-
var ContextFlags = /* @__PURE__ */ ((
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
return
|
|
6740
|
+
var ContextFlags = /* @__PURE__ */ ((ContextFlags3) => {
|
|
6741
|
+
ContextFlags3[ContextFlags3["None"] = 0] = "None";
|
|
6742
|
+
ContextFlags3[ContextFlags3["Signature"] = 1] = "Signature";
|
|
6743
|
+
ContextFlags3[ContextFlags3["NoConstraints"] = 2] = "NoConstraints";
|
|
6744
|
+
ContextFlags3[ContextFlags3["Completions"] = 4] = "Completions";
|
|
6745
|
+
ContextFlags3[ContextFlags3["SkipBindingPatterns"] = 8] = "SkipBindingPatterns";
|
|
6746
|
+
return ContextFlags3;
|
|
6747
6747
|
})(ContextFlags || {});
|
|
6748
6748
|
var NodeBuilderFlags = /* @__PURE__ */ ((NodeBuilderFlags2) => {
|
|
6749
6749
|
NodeBuilderFlags2[NodeBuilderFlags2["None"] = 0] = "None";
|
|
@@ -77520,6 +77520,8 @@ function createTypeChecker(host) {
|
|
|
77520
77520
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly");
|
|
77521
77521
|
} else if (node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 168 /* PropertySignature */ && node.kind !== 178 /* IndexSignature */ && node.kind !== 166 /* Parameter */) {
|
|
77522
77522
|
return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
|
|
77523
|
+
} else if (flags & 128 /* Accessor */) {
|
|
77524
|
+
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor");
|
|
77523
77525
|
}
|
|
77524
77526
|
flags |= 64 /* Readonly */;
|
|
77525
77527
|
break;
|
|
@@ -77563,6 +77565,8 @@ function createTypeChecker(host) {
|
|
|
77563
77565
|
return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
|
|
77564
77566
|
} else if (isPrivateIdentifierClassElementDeclaration(node)) {
|
|
77565
77567
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
|
|
77568
|
+
} else if (flags & 128 /* Accessor */) {
|
|
77569
|
+
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor");
|
|
77566
77570
|
}
|
|
77567
77571
|
flags |= 2 /* Ambient */;
|
|
77568
77572
|
lastDeclare = modifier;
|
|
@@ -117548,19 +117552,19 @@ function indexInTextChange(change, name) {
|
|
|
117548
117552
|
function needsParentheses(expression) {
|
|
117549
117553
|
return isBinaryExpression(expression) && expression.operatorToken.kind === 27 /* CommaToken */ || isObjectLiteralExpression(expression) || isAsExpression(expression) && isObjectLiteralExpression(expression.expression);
|
|
117550
117554
|
}
|
|
117551
|
-
function getContextualTypeFromParent(node, checker) {
|
|
117555
|
+
function getContextualTypeFromParent(node, checker, contextFlags) {
|
|
117552
117556
|
const { parent: parent2 } = node;
|
|
117553
117557
|
switch (parent2.kind) {
|
|
117554
117558
|
case 211 /* NewExpression */:
|
|
117555
|
-
return checker.getContextualType(parent2);
|
|
117559
|
+
return checker.getContextualType(parent2, contextFlags);
|
|
117556
117560
|
case 223 /* BinaryExpression */: {
|
|
117557
117561
|
const { left, operatorToken, right } = parent2;
|
|
117558
|
-
return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node);
|
|
117562
|
+
return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node, contextFlags);
|
|
117559
117563
|
}
|
|
117560
117564
|
case 292 /* CaseClause */:
|
|
117561
117565
|
return parent2.expression === node ? getSwitchedType(parent2, checker) : void 0;
|
|
117562
117566
|
default:
|
|
117563
|
-
return checker.getContextualType(node);
|
|
117567
|
+
return checker.getContextualType(node, contextFlags);
|
|
117564
117568
|
}
|
|
117565
117569
|
}
|
|
117566
117570
|
function quote(sourceFile, preferences, text) {
|
|
@@ -137979,7 +137983,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
|
|
|
137979
137983
|
return fromContextualType();
|
|
137980
137984
|
}
|
|
137981
137985
|
function fromContextualType() {
|
|
137982
|
-
return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker)), isNewIdentifier: false };
|
|
137986
|
+
return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, 4 /* Completions */)), isNewIdentifier: false };
|
|
137983
137987
|
}
|
|
137984
137988
|
}
|
|
137985
137989
|
function walkUpParentheses(node) {
|
|
@@ -138883,7 +138887,7 @@ function getImportOrExportSymbol(node, symbol, checker, comingFromExport) {
|
|
|
138883
138887
|
return getSpecialPropertyExport(parent2, true);
|
|
138884
138888
|
} else if (isBinaryExpression(grandparent)) {
|
|
138885
138889
|
return getSpecialPropertyExport(grandparent, true);
|
|
138886
|
-
} else if (isJSDocTypedefTag(parent2)) {
|
|
138890
|
+
} else if (isJSDocTypedefTag(parent2) || isJSDocCallbackTag(parent2)) {
|
|
138887
138891
|
return exportInfo(symbol, 0 /* Named */);
|
|
138888
138892
|
}
|
|
138889
138893
|
}
|
|
@@ -140750,6 +140754,16 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
|
|
|
140750
140754
|
const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
|
|
140751
140755
|
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
140752
140756
|
}
|
|
140757
|
+
if (node.kind === 133 /* AwaitKeyword */) {
|
|
140758
|
+
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
140759
|
+
const isAsyncFunction2 = functionDeclaration && some(functionDeclaration.modifiers, (node2) => node2.kind === 132 /* AsyncKeyword */);
|
|
140760
|
+
return isAsyncFunction2 ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
140761
|
+
}
|
|
140762
|
+
if (node.kind === 125 /* YieldKeyword */) {
|
|
140763
|
+
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
140764
|
+
const isGeneratorFunction = functionDeclaration && functionDeclaration.asteriskToken;
|
|
140765
|
+
return isGeneratorFunction ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
140766
|
+
}
|
|
140753
140767
|
if (isStaticModifier(node) && isClassStaticBlockDeclaration(node.parent)) {
|
|
140754
140768
|
const classDecl = node.parent.parent;
|
|
140755
140769
|
const { symbol: symbol2, failedAliasResolution: failedAliasResolution2 } = getSymbol(classDecl, typeChecker, stopAtAlias);
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -42,7 +42,7 @@ var ts = (() => {
|
|
|
42
42
|
"src/compiler/corePublic.ts"() {
|
|
43
43
|
"use strict";
|
|
44
44
|
versionMajorMinor = "5.0";
|
|
45
|
-
version = `${versionMajorMinor}.0-dev.
|
|
45
|
+
version = `${versionMajorMinor}.0-dev.20221221`;
|
|
46
46
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
47
47
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
48
48
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4167,13 +4167,13 @@ ${lanes.join("\n")}
|
|
|
4167
4167
|
UnionReduction2[UnionReduction2["Subtype"] = 2] = "Subtype";
|
|
4168
4168
|
return UnionReduction2;
|
|
4169
4169
|
})(UnionReduction || {});
|
|
4170
|
-
ContextFlags = /* @__PURE__ */ ((
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
return
|
|
4170
|
+
ContextFlags = /* @__PURE__ */ ((ContextFlags3) => {
|
|
4171
|
+
ContextFlags3[ContextFlags3["None"] = 0] = "None";
|
|
4172
|
+
ContextFlags3[ContextFlags3["Signature"] = 1] = "Signature";
|
|
4173
|
+
ContextFlags3[ContextFlags3["NoConstraints"] = 2] = "NoConstraints";
|
|
4174
|
+
ContextFlags3[ContextFlags3["Completions"] = 4] = "Completions";
|
|
4175
|
+
ContextFlags3[ContextFlags3["SkipBindingPatterns"] = 8] = "SkipBindingPatterns";
|
|
4176
|
+
return ContextFlags3;
|
|
4177
4177
|
})(ContextFlags || {});
|
|
4178
4178
|
NodeBuilderFlags = /* @__PURE__ */ ((NodeBuilderFlags2) => {
|
|
4179
4179
|
NodeBuilderFlags2[NodeBuilderFlags2["None"] = 0] = "None";
|
|
@@ -74954,6 +74954,8 @@ ${lanes.join("\n")}
|
|
|
74954
74954
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly");
|
|
74955
74955
|
} else if (node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 168 /* PropertySignature */ && node.kind !== 178 /* IndexSignature */ && node.kind !== 166 /* Parameter */) {
|
|
74956
74956
|
return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
|
|
74957
|
+
} else if (flags & 128 /* Accessor */) {
|
|
74958
|
+
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor");
|
|
74957
74959
|
}
|
|
74958
74960
|
flags |= 64 /* Readonly */;
|
|
74959
74961
|
break;
|
|
@@ -74997,6 +74999,8 @@ ${lanes.join("\n")}
|
|
|
74997
74999
|
return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
|
|
74998
75000
|
} else if (isPrivateIdentifierClassElementDeclaration(node)) {
|
|
74999
75001
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
|
|
75002
|
+
} else if (flags & 128 /* Accessor */) {
|
|
75003
|
+
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor");
|
|
75000
75004
|
}
|
|
75001
75005
|
flags |= 2 /* Ambient */;
|
|
75002
75006
|
lastDeclare = modifier;
|
|
@@ -112837,19 +112841,19 @@ ${lanes.join("\n")}
|
|
|
112837
112841
|
function needsParentheses(expression) {
|
|
112838
112842
|
return isBinaryExpression(expression) && expression.operatorToken.kind === 27 /* CommaToken */ || isObjectLiteralExpression(expression) || isAsExpression(expression) && isObjectLiteralExpression(expression.expression);
|
|
112839
112843
|
}
|
|
112840
|
-
function getContextualTypeFromParent(node, checker) {
|
|
112844
|
+
function getContextualTypeFromParent(node, checker, contextFlags) {
|
|
112841
112845
|
const { parent: parent2 } = node;
|
|
112842
112846
|
switch (parent2.kind) {
|
|
112843
112847
|
case 211 /* NewExpression */:
|
|
112844
|
-
return checker.getContextualType(parent2);
|
|
112848
|
+
return checker.getContextualType(parent2, contextFlags);
|
|
112845
112849
|
case 223 /* BinaryExpression */: {
|
|
112846
112850
|
const { left, operatorToken, right } = parent2;
|
|
112847
|
-
return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node);
|
|
112851
|
+
return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node, contextFlags);
|
|
112848
112852
|
}
|
|
112849
112853
|
case 292 /* CaseClause */:
|
|
112850
112854
|
return parent2.expression === node ? getSwitchedType(parent2, checker) : void 0;
|
|
112851
112855
|
default:
|
|
112852
|
-
return checker.getContextualType(node);
|
|
112856
|
+
return checker.getContextualType(node, contextFlags);
|
|
112853
112857
|
}
|
|
112854
112858
|
}
|
|
112855
112859
|
function quote(sourceFile, preferences, text) {
|
|
@@ -134065,7 +134069,7 @@ ${lanes.join("\n")}
|
|
|
134065
134069
|
return fromContextualType();
|
|
134066
134070
|
}
|
|
134067
134071
|
function fromContextualType() {
|
|
134068
|
-
return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker)), isNewIdentifier: false };
|
|
134072
|
+
return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, 4 /* Completions */)), isNewIdentifier: false };
|
|
134069
134073
|
}
|
|
134070
134074
|
}
|
|
134071
134075
|
function walkUpParentheses(node) {
|
|
@@ -134988,7 +134992,7 @@ ${lanes.join("\n")}
|
|
|
134988
134992
|
return getSpecialPropertyExport(parent2, true);
|
|
134989
134993
|
} else if (isBinaryExpression(grandparent)) {
|
|
134990
134994
|
return getSpecialPropertyExport(grandparent, true);
|
|
134991
|
-
} else if (isJSDocTypedefTag(parent2)) {
|
|
134995
|
+
} else if (isJSDocTypedefTag(parent2) || isJSDocCallbackTag(parent2)) {
|
|
134992
134996
|
return exportInfo(symbol, 0 /* Named */);
|
|
134993
134997
|
}
|
|
134994
134998
|
}
|
|
@@ -136904,6 +136908,16 @@ ${lanes.join("\n")}
|
|
|
136904
136908
|
const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
|
|
136905
136909
|
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
136906
136910
|
}
|
|
136911
|
+
if (node.kind === 133 /* AwaitKeyword */) {
|
|
136912
|
+
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
136913
|
+
const isAsyncFunction2 = functionDeclaration && some(functionDeclaration.modifiers, (node2) => node2.kind === 132 /* AsyncKeyword */);
|
|
136914
|
+
return isAsyncFunction2 ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
136915
|
+
}
|
|
136916
|
+
if (node.kind === 125 /* YieldKeyword */) {
|
|
136917
|
+
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
136918
|
+
const isGeneratorFunction = functionDeclaration && functionDeclaration.asteriskToken;
|
|
136919
|
+
return isGeneratorFunction ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
136920
|
+
}
|
|
136907
136921
|
if (isStaticModifier(node) && isClassStaticBlockDeclaration(node.parent)) {
|
|
136908
136922
|
const classDecl = node.parent.parent;
|
|
136909
136923
|
const { symbol: symbol2, failedAliasResolution: failedAliasResolution2 } = getSymbol(classDecl, typeChecker, stopAtAlias);
|
package/lib/typescript.js
CHANGED
|
@@ -42,7 +42,7 @@ var ts = (() => {
|
|
|
42
42
|
"src/compiler/corePublic.ts"() {
|
|
43
43
|
"use strict";
|
|
44
44
|
versionMajorMinor = "5.0";
|
|
45
|
-
version = `${versionMajorMinor}.0-dev.
|
|
45
|
+
version = `${versionMajorMinor}.0-dev.20221221`;
|
|
46
46
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
47
47
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
48
48
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4167,13 +4167,13 @@ ${lanes.join("\n")}
|
|
|
4167
4167
|
UnionReduction2[UnionReduction2["Subtype"] = 2] = "Subtype";
|
|
4168
4168
|
return UnionReduction2;
|
|
4169
4169
|
})(UnionReduction || {});
|
|
4170
|
-
ContextFlags = /* @__PURE__ */ ((
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
return
|
|
4170
|
+
ContextFlags = /* @__PURE__ */ ((ContextFlags3) => {
|
|
4171
|
+
ContextFlags3[ContextFlags3["None"] = 0] = "None";
|
|
4172
|
+
ContextFlags3[ContextFlags3["Signature"] = 1] = "Signature";
|
|
4173
|
+
ContextFlags3[ContextFlags3["NoConstraints"] = 2] = "NoConstraints";
|
|
4174
|
+
ContextFlags3[ContextFlags3["Completions"] = 4] = "Completions";
|
|
4175
|
+
ContextFlags3[ContextFlags3["SkipBindingPatterns"] = 8] = "SkipBindingPatterns";
|
|
4176
|
+
return ContextFlags3;
|
|
4177
4177
|
})(ContextFlags || {});
|
|
4178
4178
|
NodeBuilderFlags = /* @__PURE__ */ ((NodeBuilderFlags2) => {
|
|
4179
4179
|
NodeBuilderFlags2[NodeBuilderFlags2["None"] = 0] = "None";
|
|
@@ -74954,6 +74954,8 @@ ${lanes.join("\n")}
|
|
|
74954
74954
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly");
|
|
74955
74955
|
} else if (node.kind !== 169 /* PropertyDeclaration */ && node.kind !== 168 /* PropertySignature */ && node.kind !== 178 /* IndexSignature */ && node.kind !== 166 /* Parameter */) {
|
|
74956
74956
|
return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
|
|
74957
|
+
} else if (flags & 128 /* Accessor */) {
|
|
74958
|
+
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor");
|
|
74957
74959
|
}
|
|
74958
74960
|
flags |= 64 /* Readonly */;
|
|
74959
74961
|
break;
|
|
@@ -74997,6 +74999,8 @@ ${lanes.join("\n")}
|
|
|
74997
74999
|
return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
|
|
74998
75000
|
} else if (isPrivateIdentifierClassElementDeclaration(node)) {
|
|
74999
75001
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
|
|
75002
|
+
} else if (flags & 128 /* Accessor */) {
|
|
75003
|
+
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor");
|
|
75000
75004
|
}
|
|
75001
75005
|
flags |= 2 /* Ambient */;
|
|
75002
75006
|
lastDeclare = modifier;
|
|
@@ -112851,19 +112855,19 @@ ${lanes.join("\n")}
|
|
|
112851
112855
|
function needsParentheses(expression) {
|
|
112852
112856
|
return isBinaryExpression(expression) && expression.operatorToken.kind === 27 /* CommaToken */ || isObjectLiteralExpression(expression) || isAsExpression(expression) && isObjectLiteralExpression(expression.expression);
|
|
112853
112857
|
}
|
|
112854
|
-
function getContextualTypeFromParent(node, checker) {
|
|
112858
|
+
function getContextualTypeFromParent(node, checker, contextFlags) {
|
|
112855
112859
|
const { parent: parent2 } = node;
|
|
112856
112860
|
switch (parent2.kind) {
|
|
112857
112861
|
case 211 /* NewExpression */:
|
|
112858
|
-
return checker.getContextualType(parent2);
|
|
112862
|
+
return checker.getContextualType(parent2, contextFlags);
|
|
112859
112863
|
case 223 /* BinaryExpression */: {
|
|
112860
112864
|
const { left, operatorToken, right } = parent2;
|
|
112861
|
-
return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node);
|
|
112865
|
+
return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node, contextFlags);
|
|
112862
112866
|
}
|
|
112863
112867
|
case 292 /* CaseClause */:
|
|
112864
112868
|
return parent2.expression === node ? getSwitchedType(parent2, checker) : void 0;
|
|
112865
112869
|
default:
|
|
112866
|
-
return checker.getContextualType(node);
|
|
112870
|
+
return checker.getContextualType(node, contextFlags);
|
|
112867
112871
|
}
|
|
112868
112872
|
}
|
|
112869
112873
|
function quote(sourceFile, preferences, text) {
|
|
@@ -134079,7 +134083,7 @@ ${lanes.join("\n")}
|
|
|
134079
134083
|
return fromContextualType();
|
|
134080
134084
|
}
|
|
134081
134085
|
function fromContextualType() {
|
|
134082
|
-
return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker)), isNewIdentifier: false };
|
|
134086
|
+
return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, 4 /* Completions */)), isNewIdentifier: false };
|
|
134083
134087
|
}
|
|
134084
134088
|
}
|
|
134085
134089
|
function walkUpParentheses(node) {
|
|
@@ -135002,7 +135006,7 @@ ${lanes.join("\n")}
|
|
|
135002
135006
|
return getSpecialPropertyExport(parent2, true);
|
|
135003
135007
|
} else if (isBinaryExpression(grandparent)) {
|
|
135004
135008
|
return getSpecialPropertyExport(grandparent, true);
|
|
135005
|
-
} else if (isJSDocTypedefTag(parent2)) {
|
|
135009
|
+
} else if (isJSDocTypedefTag(parent2) || isJSDocCallbackTag(parent2)) {
|
|
135006
135010
|
return exportInfo(symbol, 0 /* Named */);
|
|
135007
135011
|
}
|
|
135008
135012
|
}
|
|
@@ -136918,6 +136922,16 @@ ${lanes.join("\n")}
|
|
|
136918
136922
|
const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
|
|
136919
136923
|
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
136920
136924
|
}
|
|
136925
|
+
if (node.kind === 133 /* AwaitKeyword */) {
|
|
136926
|
+
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
136927
|
+
const isAsyncFunction2 = functionDeclaration && some(functionDeclaration.modifiers, (node2) => node2.kind === 132 /* AsyncKeyword */);
|
|
136928
|
+
return isAsyncFunction2 ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
136929
|
+
}
|
|
136930
|
+
if (node.kind === 125 /* YieldKeyword */) {
|
|
136931
|
+
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
136932
|
+
const isGeneratorFunction = functionDeclaration && functionDeclaration.asteriskToken;
|
|
136933
|
+
return isGeneratorFunction ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
136934
|
+
}
|
|
136921
136935
|
if (isStaticModifier(node) && isClassStaticBlockDeclaration(node.parent)) {
|
|
136922
136936
|
const classDecl = node.parent.parent;
|
|
136923
136937
|
const { symbol: symbol2, failedAliasResolution: failedAliasResolution2 } = getSymbol(classDecl, typeChecker, stopAtAlias);
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -50,7 +50,7 @@ var path = __toESM(require("path"));
|
|
|
50
50
|
|
|
51
51
|
// src/compiler/corePublic.ts
|
|
52
52
|
var versionMajorMinor = "5.0";
|
|
53
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
53
|
+
var version = `${versionMajorMinor}.0-dev.20221221`;
|
|
54
54
|
|
|
55
55
|
// src/compiler/core.ts
|
|
56
56
|
var emptyArray = [];
|
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.20221221",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|