@typescript-deploys/pr-build 5.2.0-pr-54377-7 → 5.2.0-pr-54281-11
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 +23 -15
- package/lib/tsserver.js +276 -121
- package/lib/tsserverlibrary.js +294 -130
- package/lib/typescript.js +294 -130
- package/lib/typingsInstaller.js +5 -1
- 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.2";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20230531`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7705,6 +7705,9 @@ var Diagnostics = {
|
|
|
7705
7705
|
Convert_all_typedef_to_TypeScript_types: diag(95177, 3 /* Message */, "Convert_all_typedef_to_TypeScript_types_95177", "Convert all typedef to TypeScript types."),
|
|
7706
7706
|
Move_to_file: diag(95178, 3 /* Message */, "Move_to_file_95178", "Move to file"),
|
|
7707
7707
|
Cannot_move_to_file_selected_file_is_invalid: diag(95179, 3 /* Message */, "Cannot_move_to_file_selected_file_is_invalid_95179", "Cannot move to file, selected file is invalid"),
|
|
7708
|
+
Inline_variable: diag(95180, 3 /* Message */, "Inline_variable_95180", "Inline variable"),
|
|
7709
|
+
Could_not_find_variable_to_inline: diag(95181, 3 /* Message */, "Could_not_find_variable_to_inline_95181", "Could not find variable to inline."),
|
|
7710
|
+
Variables_that_share_a_name_with_a_type_or_namespace_in_the_same_scope_cannot_be_inlined: diag(95182, 3 /* Message */, "Variables_that_share_a_name_with_a_type_or_namespace_in_the_same_scope_cannot_be_inlined_95182", "Variables that share a name with a type or namespace in the same scope cannot be inlined."),
|
|
7708
7711
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
7709
7712
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
7710
7713
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -42656,6 +42659,7 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
|
|
|
42656
42659
|
CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
|
|
42657
42660
|
CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions";
|
|
42658
42661
|
CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement";
|
|
42662
|
+
CheckMode3[CheckMode3["TypeOnly"] = 128] = "TypeOnly";
|
|
42659
42663
|
return CheckMode3;
|
|
42660
42664
|
})(CheckMode || {});
|
|
42661
42665
|
var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
@@ -58527,6 +58531,10 @@ function createTypeChecker(host) {
|
|
|
58527
58531
|
return true;
|
|
58528
58532
|
}
|
|
58529
58533
|
switch (node.kind) {
|
|
58534
|
+
case 233 /* AsExpression */:
|
|
58535
|
+
if (!isConstAssertion(node)) {
|
|
58536
|
+
break;
|
|
58537
|
+
}
|
|
58530
58538
|
case 293 /* JsxExpression */:
|
|
58531
58539
|
case 216 /* ParenthesizedExpression */:
|
|
58532
58540
|
return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
|
|
@@ -62753,8 +62761,6 @@ function createTypeChecker(host) {
|
|
|
62753
62761
|
return context && context.mapper;
|
|
62754
62762
|
}
|
|
62755
62763
|
function couldContainTypeVariables(type) {
|
|
62756
|
-
if (type.flags & 67359327 /* Intrinsic */)
|
|
62757
|
-
return false;
|
|
62758
62764
|
const objectFlags = getObjectFlags(type);
|
|
62759
62765
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
62760
62766
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
@@ -64807,7 +64813,7 @@ function createTypeChecker(host) {
|
|
|
64807
64813
|
target.antecedents = saveAntecedents;
|
|
64808
64814
|
} else if (flags & 2 /* Start */) {
|
|
64809
64815
|
const container = flow.node;
|
|
64810
|
-
if (container && container !== flowContainer && reference.kind !== 210 /* PropertyAccessExpression */ && reference.kind !== 211 /* ElementAccessExpression */ && reference.kind
|
|
64816
|
+
if (container && container !== flowContainer && reference.kind !== 210 /* PropertyAccessExpression */ && reference.kind !== 211 /* ElementAccessExpression */ && !(reference.kind === 110 /* ThisKeyword */ && container.kind !== 218 /* ArrowFunction */)) {
|
|
64811
64817
|
flow = container.flowNode;
|
|
64812
64818
|
continue;
|
|
64813
64819
|
}
|
|
@@ -73294,7 +73300,7 @@ function createTypeChecker(host) {
|
|
|
73294
73300
|
Debug.assertIsDefined(leftType);
|
|
73295
73301
|
const rightType = getLastResult(state);
|
|
73296
73302
|
Debug.assertIsDefined(rightType);
|
|
73297
|
-
result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, node);
|
|
73303
|
+
result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, state.checkMode, node);
|
|
73298
73304
|
}
|
|
73299
73305
|
state.skip = false;
|
|
73300
73306
|
setLeftType(
|
|
@@ -73356,9 +73362,9 @@ function createTypeChecker(host) {
|
|
|
73356
73362
|
leftType = checkExpression(left, checkMode);
|
|
73357
73363
|
}
|
|
73358
73364
|
const rightType = checkExpression(right, checkMode);
|
|
73359
|
-
return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode);
|
|
73365
|
+
return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode);
|
|
73360
73366
|
}
|
|
73361
|
-
function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode) {
|
|
73367
|
+
function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode) {
|
|
73362
73368
|
const operator = operatorToken.kind;
|
|
73363
73369
|
switch (operator) {
|
|
73364
73370
|
case 42 /* AsteriskToken */:
|
|
@@ -73515,12 +73521,14 @@ function createTypeChecker(host) {
|
|
|
73515
73521
|
case 36 /* ExclamationEqualsToken */:
|
|
73516
73522
|
case 37 /* EqualsEqualsEqualsToken */:
|
|
73517
73523
|
case 38 /* ExclamationEqualsEqualsToken */:
|
|
73518
|
-
if (
|
|
73519
|
-
|
|
73520
|
-
|
|
73524
|
+
if (!(checkMode && checkMode & 128 /* TypeOnly */)) {
|
|
73525
|
+
if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
|
|
73526
|
+
const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
|
|
73527
|
+
error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
|
|
73528
|
+
}
|
|
73529
|
+
checkNaNEquality(errorNode, operator, left, right);
|
|
73530
|
+
reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
|
|
73521
73531
|
}
|
|
73522
|
-
checkNaNEquality(errorNode, operator, left, right);
|
|
73523
|
-
reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
|
|
73524
73532
|
return booleanType;
|
|
73525
73533
|
case 104 /* InstanceOfKeyword */:
|
|
73526
73534
|
return checkInstanceOfExpression(left, right, leftType, rightType);
|
|
@@ -73831,7 +73839,7 @@ function createTypeChecker(host) {
|
|
|
73831
73839
|
}
|
|
73832
73840
|
}
|
|
73833
73841
|
function checkConditionalExpression(node, checkMode) {
|
|
73834
|
-
const type = checkTruthinessExpression(node.condition);
|
|
73842
|
+
const type = checkTruthinessExpression(node.condition, checkMode);
|
|
73835
73843
|
checkTestingKnownTruthyCallableOrAwaitableType(node.condition, type, node.whenTrue);
|
|
73836
73844
|
const type1 = checkExpression(node.whenTrue, checkMode);
|
|
73837
73845
|
const type2 = checkExpression(node.whenFalse, checkMode);
|
|
@@ -74172,7 +74180,7 @@ function createTypeChecker(host) {
|
|
|
74172
74180
|
}
|
|
74173
74181
|
}
|
|
74174
74182
|
const startInvocationCount = flowInvocationCount;
|
|
74175
|
-
const type = checkExpression(node);
|
|
74183
|
+
const type = checkExpression(node, 128 /* TypeOnly */);
|
|
74176
74184
|
if (flowInvocationCount !== startInvocationCount) {
|
|
74177
74185
|
const cache = flowTypeCache || (flowTypeCache = []);
|
|
74178
74186
|
cache[getNodeId(node)] = type;
|
|
@@ -81686,7 +81694,7 @@ function createTypeChecker(host) {
|
|
|
81686
81694
|
if (requestedExternalEmitHelperNames.has(name))
|
|
81687
81695
|
continue;
|
|
81688
81696
|
requestedExternalEmitHelperNames.add(name);
|
|
81689
|
-
const symbol = getSymbol(getExportsOfModule(helpersModule), escapeLeadingUnderscores(name), 111551 /* Value */);
|
|
81697
|
+
const symbol = resolveSymbol(getSymbol(getExportsOfModule(helpersModule), escapeLeadingUnderscores(name), 111551 /* Value */));
|
|
81690
81698
|
if (!symbol) {
|
|
81691
81699
|
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);
|
|
81692
81700
|
} else if (helper & 524288 /* ClassPrivateFieldGet */) {
|