@typescript-deploys/pr-build 5.6.0-pr-59217-14 → 5.6.0-pr-59285-2
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 +8 -102
- package/lib/typescript.d.ts +0 -1
- package/lib/typescript.js +8 -115
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -6686,9 +6686,6 @@ var Diagnostics = {
|
|
|
6686
6686
|
Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2866, 1 /* Error */, "Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866", "Import '{0}' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled."),
|
|
6687
6687
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun: diag(2867, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`."),
|
|
6688
6688
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig: diag(2868, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig."),
|
|
6689
|
-
This_expression_is_always_truthy_Did_you_mean_to_test_something_else: diag(2869, 1 /* Error */, "This_expression_is_always_truthy_Did_you_mean_to_test_something_else_2869", "This expression is always truthy. Did you mean to test something else?"),
|
|
6690
|
-
This_expression_is_always_falsy_Did_you_mean_to_test_something_else: diag(2870, 1 /* Error */, "This_expression_is_always_falsy_Did_you_mean_to_test_something_else_2870", "This expression is always falsy. Did you mean to test something else?"),
|
|
6691
|
-
Using_on_this_expression_appears_unintentional_because_it_always_evaluates_to_the_same_nullishness: diag(2871, 1 /* Error */, "Using_on_this_expression_appears_unintentional_because_it_always_evaluates_to_the_same_nullishness_2871", "Using ?? on this expression appears unintentional because it always evaluates to the same nullishness."),
|
|
6692
6689
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
6693
6690
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
6694
6691
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -14463,7 +14460,7 @@ function isInExpressionContext(node) {
|
|
|
14463
14460
|
case 233 /* ExpressionWithTypeArguments */:
|
|
14464
14461
|
return parent.expression === node && !isPartOfTypeNode(parent);
|
|
14465
14462
|
case 304 /* ShorthandPropertyAssignment */:
|
|
14466
|
-
return parent.objectAssignmentInitializer === node;
|
|
14463
|
+
return (parent.objectAssignmentInitializer ?? parent.name) === node;
|
|
14467
14464
|
case 238 /* SatisfiesExpression */:
|
|
14468
14465
|
return node === parent.expression;
|
|
14469
14466
|
default:
|
|
@@ -58303,14 +58300,14 @@ function createTypeChecker(host) {
|
|
|
58303
58300
|
var _a, _b;
|
|
58304
58301
|
if (!type.resolvedTypeArguments) {
|
|
58305
58302
|
if (!pushTypeResolution(type, 5 /* ResolvedTypeArguments */)) {
|
|
58306
|
-
return ((_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray;
|
|
58303
|
+
return concatenate(type.target.outerTypeParameters, (_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray;
|
|
58307
58304
|
}
|
|
58308
58305
|
const node = type.node;
|
|
58309
58306
|
const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
|
|
58310
58307
|
if (popTypeResolution()) {
|
|
58311
58308
|
type.resolvedTypeArguments ?? (type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments);
|
|
58312
58309
|
} else {
|
|
58313
|
-
type.resolvedTypeArguments ?? (type.resolvedTypeArguments = ((_b = type.target.localTypeParameters) == null ? void 0 : _b.map(() => errorType)) || emptyArray);
|
|
58310
|
+
type.resolvedTypeArguments ?? (type.resolvedTypeArguments = concatenate(type.target.outerTypeParameters, ((_b = type.target.localTypeParameters) == null ? void 0 : _b.map(() => errorType)) || emptyArray));
|
|
58314
58311
|
error(
|
|
58315
58312
|
type.node || currentNode,
|
|
58316
58313
|
type.target.symbol ? Diagnostics.Type_arguments_for_0_circularly_reference_themselves : Diagnostics.Tuple_type_arguments_circularly_reference_themselves,
|
|
@@ -77531,7 +77528,7 @@ function createTypeChecker(host) {
|
|
|
77531
77528
|
setLastResult(state, checkExpression(node.right, checkMode));
|
|
77532
77529
|
return state;
|
|
77533
77530
|
}
|
|
77534
|
-
|
|
77531
|
+
checkGrammarNullishCoalesceWithLogicalExpression(node);
|
|
77535
77532
|
const operator = node.operatorToken.kind;
|
|
77536
77533
|
if (operator === 64 /* EqualsToken */ && (node.left.kind === 210 /* ObjectLiteralExpression */ || node.left.kind === 209 /* ArrayLiteralExpression */)) {
|
|
77537
77534
|
state.skip = true;
|
|
@@ -77564,9 +77561,7 @@ function createTypeChecker(host) {
|
|
|
77564
77561
|
if (operator === 56 /* AmpersandAmpersandToken */ || isIfStatement(parent)) {
|
|
77565
77562
|
checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(node.left, leftType, isIfStatement(parent) ? parent.thenStatement : void 0);
|
|
77566
77563
|
}
|
|
77567
|
-
|
|
77568
|
-
checkTruthinessOfType(leftType, node.left);
|
|
77569
|
-
}
|
|
77564
|
+
checkTruthinessOfType(leftType, node.left);
|
|
77570
77565
|
}
|
|
77571
77566
|
}
|
|
77572
77567
|
}
|
|
@@ -77623,7 +77618,7 @@ function createTypeChecker(host) {
|
|
|
77623
77618
|
state.typeStack[state.stackIndex + 1] = type;
|
|
77624
77619
|
}
|
|
77625
77620
|
}
|
|
77626
|
-
function
|
|
77621
|
+
function checkGrammarNullishCoalesceWithLogicalExpression(node) {
|
|
77627
77622
|
const { left, operatorToken, right } = node;
|
|
77628
77623
|
if (operatorToken.kind === 61 /* QuestionQuestionToken */) {
|
|
77629
77624
|
if (isBinaryExpression(left) && (left.operatorToken.kind === 57 /* BarBarToken */ || left.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
|
|
@@ -77632,56 +77627,15 @@ function createTypeChecker(host) {
|
|
|
77632
77627
|
if (isBinaryExpression(right) && (right.operatorToken.kind === 57 /* BarBarToken */ || right.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
|
|
77633
77628
|
grammarErrorOnNode(right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(right.operatorToken.kind), tokenToString(operatorToken.kind));
|
|
77634
77629
|
}
|
|
77635
|
-
const leftTarget = skipOuterExpressions(left, 15 /* All */);
|
|
77636
|
-
if (getSyntacticNullishnessSemantics(leftTarget) !== 3 /* Sometimes */) {
|
|
77637
|
-
error(leftTarget, Diagnostics.Using_on_this_expression_appears_unintentional_because_it_always_evaluates_to_the_same_nullishness);
|
|
77638
|
-
}
|
|
77639
77630
|
}
|
|
77640
77631
|
}
|
|
77641
|
-
function getSyntacticNullishnessSemantics(node) {
|
|
77642
|
-
switch (node.kind) {
|
|
77643
|
-
case 223 /* AwaitExpression */:
|
|
77644
|
-
case 213 /* CallExpression */:
|
|
77645
|
-
case 212 /* ElementAccessExpression */:
|
|
77646
|
-
case 214 /* NewExpression */:
|
|
77647
|
-
case 211 /* PropertyAccessExpression */:
|
|
77648
|
-
case 229 /* YieldExpression */:
|
|
77649
|
-
return 3 /* Sometimes */;
|
|
77650
|
-
case 226 /* BinaryExpression */:
|
|
77651
|
-
switch (node.operatorToken.kind) {
|
|
77652
|
-
case 64 /* EqualsToken */:
|
|
77653
|
-
case 61 /* QuestionQuestionToken */:
|
|
77654
|
-
case 78 /* QuestionQuestionEqualsToken */:
|
|
77655
|
-
case 57 /* BarBarToken */:
|
|
77656
|
-
case 76 /* BarBarEqualsToken */:
|
|
77657
|
-
case 56 /* AmpersandAmpersandToken */:
|
|
77658
|
-
case 77 /* AmpersandAmpersandEqualsToken */:
|
|
77659
|
-
return 3 /* Sometimes */;
|
|
77660
|
-
}
|
|
77661
|
-
return 2 /* Never */;
|
|
77662
|
-
case 106 /* NullKeyword */:
|
|
77663
|
-
return 1 /* Always */;
|
|
77664
|
-
case 216 /* TypeAssertionExpression */:
|
|
77665
|
-
case 234 /* AsExpression */:
|
|
77666
|
-
case 217 /* ParenthesizedExpression */:
|
|
77667
|
-
return getSyntacticNullishnessSemantics(node.expression);
|
|
77668
|
-
case 227 /* ConditionalExpression */:
|
|
77669
|
-
return getSyntacticNullishnessSemantics(node.whenTrue) | getSyntacticNullishnessSemantics(node.whenFalse);
|
|
77670
|
-
case 80 /* Identifier */:
|
|
77671
|
-
if (node.escapedText === "undefined") {
|
|
77672
|
-
return 1 /* Always */;
|
|
77673
|
-
}
|
|
77674
|
-
return 3 /* Sometimes */;
|
|
77675
|
-
}
|
|
77676
|
-
return 2 /* Never */;
|
|
77677
|
-
}
|
|
77678
77632
|
function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) {
|
|
77679
77633
|
const operator = operatorToken.kind;
|
|
77680
77634
|
if (operator === 64 /* EqualsToken */ && (left.kind === 210 /* ObjectLiteralExpression */ || left.kind === 209 /* ArrayLiteralExpression */)) {
|
|
77681
77635
|
return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 110 /* ThisKeyword */);
|
|
77682
77636
|
}
|
|
77683
77637
|
let leftType;
|
|
77684
|
-
if (
|
|
77638
|
+
if (isLogicalOrCoalescingBinaryOperator(operator)) {
|
|
77685
77639
|
leftType = checkTruthinessExpression(left, checkMode);
|
|
77686
77640
|
} else {
|
|
77687
77641
|
leftType = checkExpression(left, checkMode);
|
|
@@ -81284,53 +81238,9 @@ function createTypeChecker(host) {
|
|
|
81284
81238
|
function checkTruthinessOfType(type, node) {
|
|
81285
81239
|
if (type.flags & 16384 /* Void */) {
|
|
81286
81240
|
error(node, Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness);
|
|
81287
|
-
} else {
|
|
81288
|
-
const semantics = getSyntacticTruthySemantics(node);
|
|
81289
|
-
if (semantics !== 3 /* Sometimes */) {
|
|
81290
|
-
error(
|
|
81291
|
-
node,
|
|
81292
|
-
semantics === 1 /* Always */ ? Diagnostics.This_expression_is_always_truthy_Did_you_mean_to_test_something_else : Diagnostics.This_expression_is_always_falsy_Did_you_mean_to_test_something_else
|
|
81293
|
-
);
|
|
81294
|
-
}
|
|
81295
81241
|
}
|
|
81296
81242
|
return type;
|
|
81297
81243
|
}
|
|
81298
|
-
function getSyntacticTruthySemantics(node) {
|
|
81299
|
-
switch (node.kind) {
|
|
81300
|
-
case 9 /* NumericLiteral */:
|
|
81301
|
-
if (node.text === "0" || node.text === "1") {
|
|
81302
|
-
return 3 /* Sometimes */;
|
|
81303
|
-
}
|
|
81304
|
-
return 1 /* Always */;
|
|
81305
|
-
case 209 /* ArrayLiteralExpression */:
|
|
81306
|
-
case 219 /* ArrowFunction */:
|
|
81307
|
-
case 10 /* BigIntLiteral */:
|
|
81308
|
-
case 231 /* ClassExpression */:
|
|
81309
|
-
case 218 /* FunctionExpression */:
|
|
81310
|
-
case 284 /* JsxElement */:
|
|
81311
|
-
case 285 /* JsxSelfClosingElement */:
|
|
81312
|
-
case 210 /* ObjectLiteralExpression */:
|
|
81313
|
-
case 14 /* RegularExpressionLiteral */:
|
|
81314
|
-
return 1 /* Always */;
|
|
81315
|
-
case 222 /* VoidExpression */:
|
|
81316
|
-
return 2 /* Never */;
|
|
81317
|
-
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
81318
|
-
case 11 /* StringLiteral */:
|
|
81319
|
-
return !!node.text ? 1 /* Always */ : 2 /* Never */;
|
|
81320
|
-
case 216 /* TypeAssertionExpression */:
|
|
81321
|
-
case 234 /* AsExpression */:
|
|
81322
|
-
case 217 /* ParenthesizedExpression */:
|
|
81323
|
-
return getSyntacticTruthySemantics(node.expression);
|
|
81324
|
-
case 227 /* ConditionalExpression */:
|
|
81325
|
-
return getSyntacticTruthySemantics(node.whenTrue) | getSyntacticTruthySemantics(node.whenFalse);
|
|
81326
|
-
case 80 /* Identifier */:
|
|
81327
|
-
if (node.escapedText === "undefined") {
|
|
81328
|
-
return 2 /* Never */;
|
|
81329
|
-
}
|
|
81330
|
-
return 3 /* Sometimes */;
|
|
81331
|
-
}
|
|
81332
|
-
return 3 /* Sometimes */;
|
|
81333
|
-
}
|
|
81334
81244
|
function checkTruthinessExpression(node, checkMode) {
|
|
81335
81245
|
return checkTruthinessOfType(checkExpression(node, checkMode), node);
|
|
81336
81246
|
}
|
|
@@ -85517,11 +85427,7 @@ function createTypeChecker(host) {
|
|
|
85517
85427
|
const nodeLinks2 = getNodeLinks(node2);
|
|
85518
85428
|
nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference */ | 16384 /* CapturedBlockScopedBinding */ | 32768 /* BlockScopedBindingInLoop */;
|
|
85519
85429
|
if (isIdentifier(node2) && isExpressionNode(node2) && !(isPropertyAccessExpression(node2.parent) && node2.parent.name === node2)) {
|
|
85520
|
-
const s =
|
|
85521
|
-
node2,
|
|
85522
|
-
/*ignoreErrors*/
|
|
85523
|
-
true
|
|
85524
|
-
);
|
|
85430
|
+
const s = getResolvedSymbol(node2);
|
|
85525
85431
|
if (s && s !== unknownSymbol) {
|
|
85526
85432
|
checkIdentifierCalculateNodeCheckFlags(node2, s);
|
|
85527
85433
|
}
|
package/lib/typescript.d.ts
CHANGED
|
@@ -8705,7 +8705,6 @@ declare namespace ts {
|
|
|
8705
8705
|
* ```
|
|
8706
8706
|
*/
|
|
8707
8707
|
function getJSDocCommentsAndTags(hostNode: Node): readonly (JSDoc | JSDocTag)[];
|
|
8708
|
-
function isBinaryLogicalOperator(token: SyntaxKind): boolean;
|
|
8709
8708
|
/**
|
|
8710
8709
|
* Create an external source map source file reference
|
|
8711
8710
|
*/
|
package/lib/typescript.js
CHANGED
|
@@ -142,7 +142,6 @@ __export(typescript_exports, {
|
|
|
142
142
|
PollingInterval: () => PollingInterval,
|
|
143
143
|
PollingWatchKind: () => PollingWatchKind,
|
|
144
144
|
PragmaKindFlags: () => PragmaKindFlags,
|
|
145
|
-
PredicateSemantics: () => PredicateSemantics,
|
|
146
145
|
PrivateIdentifierKind: () => PrivateIdentifierKind,
|
|
147
146
|
ProcessLevel: () => ProcessLevel,
|
|
148
147
|
ProgramUpdateLevel: () => ProgramUpdateLevel,
|
|
@@ -1174,7 +1173,6 @@ __export(typescript_exports, {
|
|
|
1174
1173
|
isAwaitKeyword: () => isAwaitKeyword,
|
|
1175
1174
|
isBigIntLiteral: () => isBigIntLiteral,
|
|
1176
1175
|
isBinaryExpression: () => isBinaryExpression,
|
|
1177
|
-
isBinaryLogicalOperator: () => isBinaryLogicalOperator,
|
|
1178
1176
|
isBinaryOperatorToken: () => isBinaryOperatorToken,
|
|
1179
1177
|
isBindableObjectDefinePropertyCall: () => isBindableObjectDefinePropertyCall,
|
|
1180
1178
|
isBindableStaticAccessExpression: () => isBindableStaticAccessExpression,
|
|
@@ -5988,13 +5986,6 @@ var RelationComparisonResult = /* @__PURE__ */ ((RelationComparisonResult3) => {
|
|
|
5988
5986
|
RelationComparisonResult3[RelationComparisonResult3["Overflow"] = 96] = "Overflow";
|
|
5989
5987
|
return RelationComparisonResult3;
|
|
5990
5988
|
})(RelationComparisonResult || {});
|
|
5991
|
-
var PredicateSemantics = /* @__PURE__ */ ((PredicateSemantics2) => {
|
|
5992
|
-
PredicateSemantics2[PredicateSemantics2["None"] = 0] = "None";
|
|
5993
|
-
PredicateSemantics2[PredicateSemantics2["Always"] = 1] = "Always";
|
|
5994
|
-
PredicateSemantics2[PredicateSemantics2["Never"] = 2] = "Never";
|
|
5995
|
-
PredicateSemantics2[PredicateSemantics2["Sometimes"] = 3] = "Sometimes";
|
|
5996
|
-
return PredicateSemantics2;
|
|
5997
|
-
})(PredicateSemantics || {});
|
|
5998
5989
|
var GeneratedIdentifierFlags = /* @__PURE__ */ ((GeneratedIdentifierFlags2) => {
|
|
5999
5990
|
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["None"] = 0] = "None";
|
|
6000
5991
|
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Auto"] = 1] = "Auto";
|
|
@@ -10075,9 +10066,6 @@ var Diagnostics = {
|
|
|
10075
10066
|
Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2866, 1 /* Error */, "Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866", "Import '{0}' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled."),
|
|
10076
10067
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun: diag(2867, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`."),
|
|
10077
10068
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig: diag(2868, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig."),
|
|
10078
|
-
This_expression_is_always_truthy_Did_you_mean_to_test_something_else: diag(2869, 1 /* Error */, "This_expression_is_always_truthy_Did_you_mean_to_test_something_else_2869", "This expression is always truthy. Did you mean to test something else?"),
|
|
10079
|
-
This_expression_is_always_falsy_Did_you_mean_to_test_something_else: diag(2870, 1 /* Error */, "This_expression_is_always_falsy_Did_you_mean_to_test_something_else_2870", "This expression is always falsy. Did you mean to test something else?"),
|
|
10080
|
-
Using_on_this_expression_appears_unintentional_because_it_always_evaluates_to_the_same_nullishness: diag(2871, 1 /* Error */, "Using_on_this_expression_appears_unintentional_because_it_always_evaluates_to_the_same_nullishness_2871", "Using ?? on this expression appears unintentional because it always evaluates to the same nullishness."),
|
|
10081
10069
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
10082
10070
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
10083
10071
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -18153,7 +18141,7 @@ function isInExpressionContext(node) {
|
|
|
18153
18141
|
case 233 /* ExpressionWithTypeArguments */:
|
|
18154
18142
|
return parent2.expression === node && !isPartOfTypeNode(parent2);
|
|
18155
18143
|
case 304 /* ShorthandPropertyAssignment */:
|
|
18156
|
-
return parent2.objectAssignmentInitializer === node;
|
|
18144
|
+
return (parent2.objectAssignmentInitializer ?? parent2.name) === node;
|
|
18157
18145
|
case 238 /* SatisfiesExpression */:
|
|
18158
18146
|
return node === parent2.expression;
|
|
18159
18147
|
default:
|
|
@@ -62914,14 +62902,14 @@ function createTypeChecker(host) {
|
|
|
62914
62902
|
var _a, _b;
|
|
62915
62903
|
if (!type.resolvedTypeArguments) {
|
|
62916
62904
|
if (!pushTypeResolution(type, 5 /* ResolvedTypeArguments */)) {
|
|
62917
|
-
return ((_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray;
|
|
62905
|
+
return concatenate(type.target.outerTypeParameters, (_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray;
|
|
62918
62906
|
}
|
|
62919
62907
|
const node = type.node;
|
|
62920
62908
|
const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
|
|
62921
62909
|
if (popTypeResolution()) {
|
|
62922
62910
|
type.resolvedTypeArguments ?? (type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments);
|
|
62923
62911
|
} else {
|
|
62924
|
-
type.resolvedTypeArguments ?? (type.resolvedTypeArguments = ((_b = type.target.localTypeParameters) == null ? void 0 : _b.map(() => errorType)) || emptyArray);
|
|
62912
|
+
type.resolvedTypeArguments ?? (type.resolvedTypeArguments = concatenate(type.target.outerTypeParameters, ((_b = type.target.localTypeParameters) == null ? void 0 : _b.map(() => errorType)) || emptyArray));
|
|
62925
62913
|
error2(
|
|
62926
62914
|
type.node || currentNode,
|
|
62927
62915
|
type.target.symbol ? Diagnostics.Type_arguments_for_0_circularly_reference_themselves : Diagnostics.Tuple_type_arguments_circularly_reference_themselves,
|
|
@@ -82142,7 +82130,7 @@ function createTypeChecker(host) {
|
|
|
82142
82130
|
setLastResult(state, checkExpression(node.right, checkMode));
|
|
82143
82131
|
return state;
|
|
82144
82132
|
}
|
|
82145
|
-
|
|
82133
|
+
checkGrammarNullishCoalesceWithLogicalExpression(node);
|
|
82146
82134
|
const operator = node.operatorToken.kind;
|
|
82147
82135
|
if (operator === 64 /* EqualsToken */ && (node.left.kind === 210 /* ObjectLiteralExpression */ || node.left.kind === 209 /* ArrayLiteralExpression */)) {
|
|
82148
82136
|
state.skip = true;
|
|
@@ -82175,9 +82163,7 @@ function createTypeChecker(host) {
|
|
|
82175
82163
|
if (operator === 56 /* AmpersandAmpersandToken */ || isIfStatement(parent2)) {
|
|
82176
82164
|
checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(node.left, leftType, isIfStatement(parent2) ? parent2.thenStatement : void 0);
|
|
82177
82165
|
}
|
|
82178
|
-
|
|
82179
|
-
checkTruthinessOfType(leftType, node.left);
|
|
82180
|
-
}
|
|
82166
|
+
checkTruthinessOfType(leftType, node.left);
|
|
82181
82167
|
}
|
|
82182
82168
|
}
|
|
82183
82169
|
}
|
|
@@ -82234,7 +82220,7 @@ function createTypeChecker(host) {
|
|
|
82234
82220
|
state.typeStack[state.stackIndex + 1] = type;
|
|
82235
82221
|
}
|
|
82236
82222
|
}
|
|
82237
|
-
function
|
|
82223
|
+
function checkGrammarNullishCoalesceWithLogicalExpression(node) {
|
|
82238
82224
|
const { left, operatorToken, right } = node;
|
|
82239
82225
|
if (operatorToken.kind === 61 /* QuestionQuestionToken */) {
|
|
82240
82226
|
if (isBinaryExpression(left) && (left.operatorToken.kind === 57 /* BarBarToken */ || left.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
|
|
@@ -82243,56 +82229,15 @@ function createTypeChecker(host) {
|
|
|
82243
82229
|
if (isBinaryExpression(right) && (right.operatorToken.kind === 57 /* BarBarToken */ || right.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
|
|
82244
82230
|
grammarErrorOnNode(right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(right.operatorToken.kind), tokenToString(operatorToken.kind));
|
|
82245
82231
|
}
|
|
82246
|
-
const leftTarget = skipOuterExpressions(left, 15 /* All */);
|
|
82247
|
-
if (getSyntacticNullishnessSemantics(leftTarget) !== 3 /* Sometimes */) {
|
|
82248
|
-
error2(leftTarget, Diagnostics.Using_on_this_expression_appears_unintentional_because_it_always_evaluates_to_the_same_nullishness);
|
|
82249
|
-
}
|
|
82250
82232
|
}
|
|
82251
82233
|
}
|
|
82252
|
-
function getSyntacticNullishnessSemantics(node) {
|
|
82253
|
-
switch (node.kind) {
|
|
82254
|
-
case 223 /* AwaitExpression */:
|
|
82255
|
-
case 213 /* CallExpression */:
|
|
82256
|
-
case 212 /* ElementAccessExpression */:
|
|
82257
|
-
case 214 /* NewExpression */:
|
|
82258
|
-
case 211 /* PropertyAccessExpression */:
|
|
82259
|
-
case 229 /* YieldExpression */:
|
|
82260
|
-
return 3 /* Sometimes */;
|
|
82261
|
-
case 226 /* BinaryExpression */:
|
|
82262
|
-
switch (node.operatorToken.kind) {
|
|
82263
|
-
case 64 /* EqualsToken */:
|
|
82264
|
-
case 61 /* QuestionQuestionToken */:
|
|
82265
|
-
case 78 /* QuestionQuestionEqualsToken */:
|
|
82266
|
-
case 57 /* BarBarToken */:
|
|
82267
|
-
case 76 /* BarBarEqualsToken */:
|
|
82268
|
-
case 56 /* AmpersandAmpersandToken */:
|
|
82269
|
-
case 77 /* AmpersandAmpersandEqualsToken */:
|
|
82270
|
-
return 3 /* Sometimes */;
|
|
82271
|
-
}
|
|
82272
|
-
return 2 /* Never */;
|
|
82273
|
-
case 106 /* NullKeyword */:
|
|
82274
|
-
return 1 /* Always */;
|
|
82275
|
-
case 216 /* TypeAssertionExpression */:
|
|
82276
|
-
case 234 /* AsExpression */:
|
|
82277
|
-
case 217 /* ParenthesizedExpression */:
|
|
82278
|
-
return getSyntacticNullishnessSemantics(node.expression);
|
|
82279
|
-
case 227 /* ConditionalExpression */:
|
|
82280
|
-
return getSyntacticNullishnessSemantics(node.whenTrue) | getSyntacticNullishnessSemantics(node.whenFalse);
|
|
82281
|
-
case 80 /* Identifier */:
|
|
82282
|
-
if (node.escapedText === "undefined") {
|
|
82283
|
-
return 1 /* Always */;
|
|
82284
|
-
}
|
|
82285
|
-
return 3 /* Sometimes */;
|
|
82286
|
-
}
|
|
82287
|
-
return 2 /* Never */;
|
|
82288
|
-
}
|
|
82289
82234
|
function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) {
|
|
82290
82235
|
const operator = operatorToken.kind;
|
|
82291
82236
|
if (operator === 64 /* EqualsToken */ && (left.kind === 210 /* ObjectLiteralExpression */ || left.kind === 209 /* ArrayLiteralExpression */)) {
|
|
82292
82237
|
return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 110 /* ThisKeyword */);
|
|
82293
82238
|
}
|
|
82294
82239
|
let leftType;
|
|
82295
|
-
if (
|
|
82240
|
+
if (isLogicalOrCoalescingBinaryOperator(operator)) {
|
|
82296
82241
|
leftType = checkTruthinessExpression(left, checkMode);
|
|
82297
82242
|
} else {
|
|
82298
82243
|
leftType = checkExpression(left, checkMode);
|
|
@@ -85895,53 +85840,9 @@ function createTypeChecker(host) {
|
|
|
85895
85840
|
function checkTruthinessOfType(type, node) {
|
|
85896
85841
|
if (type.flags & 16384 /* Void */) {
|
|
85897
85842
|
error2(node, Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness);
|
|
85898
|
-
} else {
|
|
85899
|
-
const semantics = getSyntacticTruthySemantics(node);
|
|
85900
|
-
if (semantics !== 3 /* Sometimes */) {
|
|
85901
|
-
error2(
|
|
85902
|
-
node,
|
|
85903
|
-
semantics === 1 /* Always */ ? Diagnostics.This_expression_is_always_truthy_Did_you_mean_to_test_something_else : Diagnostics.This_expression_is_always_falsy_Did_you_mean_to_test_something_else
|
|
85904
|
-
);
|
|
85905
|
-
}
|
|
85906
85843
|
}
|
|
85907
85844
|
return type;
|
|
85908
85845
|
}
|
|
85909
|
-
function getSyntacticTruthySemantics(node) {
|
|
85910
|
-
switch (node.kind) {
|
|
85911
|
-
case 9 /* NumericLiteral */:
|
|
85912
|
-
if (node.text === "0" || node.text === "1") {
|
|
85913
|
-
return 3 /* Sometimes */;
|
|
85914
|
-
}
|
|
85915
|
-
return 1 /* Always */;
|
|
85916
|
-
case 209 /* ArrayLiteralExpression */:
|
|
85917
|
-
case 219 /* ArrowFunction */:
|
|
85918
|
-
case 10 /* BigIntLiteral */:
|
|
85919
|
-
case 231 /* ClassExpression */:
|
|
85920
|
-
case 218 /* FunctionExpression */:
|
|
85921
|
-
case 284 /* JsxElement */:
|
|
85922
|
-
case 285 /* JsxSelfClosingElement */:
|
|
85923
|
-
case 210 /* ObjectLiteralExpression */:
|
|
85924
|
-
case 14 /* RegularExpressionLiteral */:
|
|
85925
|
-
return 1 /* Always */;
|
|
85926
|
-
case 222 /* VoidExpression */:
|
|
85927
|
-
return 2 /* Never */;
|
|
85928
|
-
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
85929
|
-
case 11 /* StringLiteral */:
|
|
85930
|
-
return !!node.text ? 1 /* Always */ : 2 /* Never */;
|
|
85931
|
-
case 216 /* TypeAssertionExpression */:
|
|
85932
|
-
case 234 /* AsExpression */:
|
|
85933
|
-
case 217 /* ParenthesizedExpression */:
|
|
85934
|
-
return getSyntacticTruthySemantics(node.expression);
|
|
85935
|
-
case 227 /* ConditionalExpression */:
|
|
85936
|
-
return getSyntacticTruthySemantics(node.whenTrue) | getSyntacticTruthySemantics(node.whenFalse);
|
|
85937
|
-
case 80 /* Identifier */:
|
|
85938
|
-
if (node.escapedText === "undefined") {
|
|
85939
|
-
return 2 /* Never */;
|
|
85940
|
-
}
|
|
85941
|
-
return 3 /* Sometimes */;
|
|
85942
|
-
}
|
|
85943
|
-
return 3 /* Sometimes */;
|
|
85944
|
-
}
|
|
85945
85846
|
function checkTruthinessExpression(node, checkMode) {
|
|
85946
85847
|
return checkTruthinessOfType(checkExpression(node, checkMode), node);
|
|
85947
85848
|
}
|
|
@@ -90128,11 +90029,7 @@ function createTypeChecker(host) {
|
|
|
90128
90029
|
const nodeLinks2 = getNodeLinks(node2);
|
|
90129
90030
|
nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference */ | 16384 /* CapturedBlockScopedBinding */ | 32768 /* BlockScopedBindingInLoop */;
|
|
90130
90031
|
if (isIdentifier(node2) && isExpressionNode(node2) && !(isPropertyAccessExpression(node2.parent) && node2.parent.name === node2)) {
|
|
90131
|
-
const s =
|
|
90132
|
-
node2,
|
|
90133
|
-
/*ignoreErrors*/
|
|
90134
|
-
true
|
|
90135
|
-
);
|
|
90032
|
+
const s = getResolvedSymbol(node2);
|
|
90136
90033
|
if (s && s !== unknownSymbol) {
|
|
90137
90034
|
checkIdentifierCalculateNodeCheckFlags(node2, s);
|
|
90138
90035
|
}
|
|
@@ -178729,7 +178626,6 @@ __export(ts_exports2, {
|
|
|
178729
178626
|
PollingInterval: () => PollingInterval,
|
|
178730
178627
|
PollingWatchKind: () => PollingWatchKind,
|
|
178731
178628
|
PragmaKindFlags: () => PragmaKindFlags,
|
|
178732
|
-
PredicateSemantics: () => PredicateSemantics,
|
|
178733
178629
|
PrivateIdentifierKind: () => PrivateIdentifierKind,
|
|
178734
178630
|
ProcessLevel: () => ProcessLevel,
|
|
178735
178631
|
ProgramUpdateLevel: () => ProgramUpdateLevel,
|
|
@@ -179761,7 +179657,6 @@ __export(ts_exports2, {
|
|
|
179761
179657
|
isAwaitKeyword: () => isAwaitKeyword,
|
|
179762
179658
|
isBigIntLiteral: () => isBigIntLiteral,
|
|
179763
179659
|
isBinaryExpression: () => isBinaryExpression,
|
|
179764
|
-
isBinaryLogicalOperator: () => isBinaryLogicalOperator,
|
|
179765
179660
|
isBinaryOperatorToken: () => isBinaryOperatorToken,
|
|
179766
179661
|
isBindableObjectDefinePropertyCall: () => isBindableObjectDefinePropertyCall,
|
|
179767
179662
|
isBindableStaticAccessExpression: () => isBindableStaticAccessExpression,
|
|
@@ -193089,7 +192984,6 @@ if (typeof console !== "undefined") {
|
|
|
193089
192984
|
PollingInterval,
|
|
193090
192985
|
PollingWatchKind,
|
|
193091
192986
|
PragmaKindFlags,
|
|
193092
|
-
PredicateSemantics,
|
|
193093
192987
|
PrivateIdentifierKind,
|
|
193094
192988
|
ProcessLevel,
|
|
193095
192989
|
ProgramUpdateLevel,
|
|
@@ -194121,7 +194015,6 @@ if (typeof console !== "undefined") {
|
|
|
194121
194015
|
isAwaitKeyword,
|
|
194122
194016
|
isBigIntLiteral,
|
|
194123
194017
|
isBinaryExpression,
|
|
194124
|
-
isBinaryLogicalOperator,
|
|
194125
194018
|
isBinaryOperatorToken,
|
|
194126
194019
|
isBindableObjectDefinePropertyCall,
|
|
194127
194020
|
isBindableStaticAccessExpression,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.6.0-pr-
|
|
5
|
+
"version": "5.6.0-pr-59285-2",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|