typescript 5.6.0-dev.20240722 → 5.6.0-dev.20240724
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 +156 -33
- package/lib/typescript.d.ts +8 -0
- package/lib/typescript.js +284 -72
- package/package.json +8 -8
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.6";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20240724`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -463,7 +463,7 @@ function insertSorted(array, insert, compare, equalityComparer, allowDuplicates)
|
|
|
463
463
|
return false;
|
|
464
464
|
}
|
|
465
465
|
function sortAndDeduplicate(array, comparer, equalityComparer) {
|
|
466
|
-
return deduplicateSorted(
|
|
466
|
+
return deduplicateSorted(toSorted(array, comparer), equalityComparer ?? comparer ?? compareStringsCaseSensitive);
|
|
467
467
|
}
|
|
468
468
|
function arrayIsEqualTo(array1, array2, equalityComparer = equateValues) {
|
|
469
469
|
if (array1 === void 0 || array2 === void 0) {
|
|
@@ -560,13 +560,8 @@ function appendIfUnique(array, toAdd, equalityComparer) {
|
|
|
560
560
|
function stableSortIndices(array, indices, comparer) {
|
|
561
561
|
indices.sort((x, y) => comparer(array[x], array[y]) || compareValues(x, y));
|
|
562
562
|
}
|
|
563
|
-
function
|
|
564
|
-
return array.length === 0 ?
|
|
565
|
-
}
|
|
566
|
-
function stableSort(array, comparer) {
|
|
567
|
-
const indices = indicesOf(array);
|
|
568
|
-
stableSortIndices(array, indices, comparer);
|
|
569
|
-
return indices.map((i) => array[i]);
|
|
563
|
+
function toSorted(array, comparer) {
|
|
564
|
+
return array.length === 0 ? emptyArray : array.slice().sort(comparer);
|
|
570
565
|
}
|
|
571
566
|
function rangeEquals(array1, array2, pos, end) {
|
|
572
567
|
while (pos < end) {
|
|
@@ -1484,7 +1479,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1484
1479
|
result.push([value, name]);
|
|
1485
1480
|
}
|
|
1486
1481
|
}
|
|
1487
|
-
const sorted =
|
|
1482
|
+
const sorted = toSorted(result, (x, y) => compareValues(x[0], y[0]));
|
|
1488
1483
|
enumMemberCache.set(enumObject, sorted);
|
|
1489
1484
|
return sorted;
|
|
1490
1485
|
}
|
|
@@ -4969,7 +4964,7 @@ var sys = (() => {
|
|
|
4969
4964
|
setTimeout,
|
|
4970
4965
|
clearTimeout,
|
|
4971
4966
|
clearScreen: () => {
|
|
4972
|
-
process.stdout.write("\
|
|
4967
|
+
process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
4973
4968
|
},
|
|
4974
4969
|
setBlocking: () => {
|
|
4975
4970
|
var _a;
|
|
@@ -6125,6 +6120,18 @@ var Diagnostics = {
|
|
|
6125
6120
|
Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class: diag(1537, 1 /* Error */, "Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_1537", "Decimal escape sequences and backreferences are not allowed in a character class."),
|
|
6126
6121
|
Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set: diag(1538, 1 /* Error */, "Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_se_1538", "Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),
|
|
6127
6122
|
A_bigint_literal_cannot_be_used_as_a_property_name: diag(1539, 1 /* Error */, "A_bigint_literal_cannot_be_used_as_a_property_name_1539", "A 'bigint' literal cannot be used as a property name."),
|
|
6123
|
+
A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead: diag(
|
|
6124
|
+
1540,
|
|
6125
|
+
2 /* Suggestion */,
|
|
6126
|
+
"A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540",
|
|
6127
|
+
"A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.",
|
|
6128
|
+
/*reportsUnnecessary*/
|
|
6129
|
+
void 0,
|
|
6130
|
+
/*elidedInCompatabilityPyramid*/
|
|
6131
|
+
void 0,
|
|
6132
|
+
/*reportsDeprecated*/
|
|
6133
|
+
true
|
|
6134
|
+
),
|
|
6128
6135
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
6129
6136
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
6130
6137
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -6691,6 +6698,11 @@ var Diagnostics = {
|
|
|
6691
6698
|
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."),
|
|
6692
6699
|
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`."),
|
|
6693
6700
|
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."),
|
|
6701
|
+
Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish: diag(2869, 1 /* Error */, "Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish_2869", "Right operand of ?? is unreachable because the left operand is never nullish."),
|
|
6702
|
+
This_binary_expression_is_never_nullish_Are_you_missing_parentheses: diag(2870, 1 /* Error */, "This_binary_expression_is_never_nullish_Are_you_missing_parentheses_2870", "This binary expression is never nullish. Are you missing parentheses?"),
|
|
6703
|
+
This_expression_is_always_nullish: diag(2871, 1 /* Error */, "This_expression_is_always_nullish_2871", "This expression is always nullish."),
|
|
6704
|
+
This_kind_of_expression_is_always_truthy: diag(2872, 1 /* Error */, "This_kind_of_expression_is_always_truthy_2872", "This kind of expression is always truthy."),
|
|
6705
|
+
This_kind_of_expression_is_always_falsy: diag(2873, 1 /* Error */, "This_kind_of_expression_is_always_falsy_2873", "This kind of expression is always falsy."),
|
|
6694
6706
|
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}'."),
|
|
6695
6707
|
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}'."),
|
|
6696
6708
|
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}'."),
|
|
@@ -12815,6 +12827,13 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
|
|
|
12815
12827
|
isInJSDoc(node)
|
|
12816
12828
|
);
|
|
12817
12829
|
}
|
|
12830
|
+
function getNonModifierTokenPosOfNode(node, sourceFile) {
|
|
12831
|
+
const lastModifier = !nodeIsMissing(node) && canHaveModifiers(node) && node.modifiers ? last(node.modifiers) : void 0;
|
|
12832
|
+
if (!lastModifier) {
|
|
12833
|
+
return getTokenPosOfNode(node, sourceFile);
|
|
12834
|
+
}
|
|
12835
|
+
return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastModifier.end);
|
|
12836
|
+
}
|
|
12818
12837
|
function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia = false) {
|
|
12819
12838
|
return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia);
|
|
12820
12839
|
}
|
|
@@ -18115,7 +18134,7 @@ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNa
|
|
|
18115
18134
|
if (visited.has(canonicalPath)) return;
|
|
18116
18135
|
visited.set(canonicalPath, true);
|
|
18117
18136
|
const { files, directories } = getFileSystemEntries(path2);
|
|
18118
|
-
for (const current of
|
|
18137
|
+
for (const current of toSorted(files, compareStringsCaseSensitive)) {
|
|
18119
18138
|
const name = combinePaths(path2, current);
|
|
18120
18139
|
const absoluteName = combinePaths(absolutePath, current);
|
|
18121
18140
|
if (extensions && !fileExtensionIsOneOf(name, extensions)) continue;
|
|
@@ -18135,7 +18154,7 @@ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNa
|
|
|
18135
18154
|
return;
|
|
18136
18155
|
}
|
|
18137
18156
|
}
|
|
18138
|
-
for (const current of
|
|
18157
|
+
for (const current of toSorted(directories, compareStringsCaseSensitive)) {
|
|
18139
18158
|
const name = combinePaths(path2, current);
|
|
18140
18159
|
const absoluteName = combinePaths(absolutePath, current);
|
|
18141
18160
|
if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) {
|
|
@@ -40562,7 +40581,7 @@ function loadModuleFromImportsOrExports(extensions, state, cache, redirectedRefe
|
|
|
40562
40581
|
moduleName
|
|
40563
40582
|
);
|
|
40564
40583
|
}
|
|
40565
|
-
const expandingKeys =
|
|
40584
|
+
const expandingKeys = toSorted(filter(getOwnKeys(lookupTable), (k) => hasOneAsterisk(k) || endsWith(k, "/")), comparePatternKeys);
|
|
40566
40585
|
for (const potentialTarget of expandingKeys) {
|
|
40567
40586
|
if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
40568
40587
|
const target = lookupTable[potentialTarget];
|
|
@@ -77686,7 +77705,7 @@ function createTypeChecker(host) {
|
|
|
77686
77705
|
setLastResult(state, checkExpression(node.right, checkMode));
|
|
77687
77706
|
return state;
|
|
77688
77707
|
}
|
|
77689
|
-
|
|
77708
|
+
checkNullishCoalesceOperands(node);
|
|
77690
77709
|
const operator = node.operatorToken.kind;
|
|
77691
77710
|
if (operator === 64 /* EqualsToken */ && (node.left.kind === 210 /* ObjectLiteralExpression */ || node.left.kind === 209 /* ArrayLiteralExpression */)) {
|
|
77692
77711
|
state.skip = true;
|
|
@@ -77719,7 +77738,9 @@ function createTypeChecker(host) {
|
|
|
77719
77738
|
if (operator === 56 /* AmpersandAmpersandToken */ || isIfStatement(parent)) {
|
|
77720
77739
|
checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(node.left, leftType, isIfStatement(parent) ? parent.thenStatement : void 0);
|
|
77721
77740
|
}
|
|
77722
|
-
|
|
77741
|
+
if (isBinaryLogicalOperator(operator)) {
|
|
77742
|
+
checkTruthinessOfType(leftType, node.left);
|
|
77743
|
+
}
|
|
77723
77744
|
}
|
|
77724
77745
|
}
|
|
77725
77746
|
}
|
|
@@ -77776,7 +77797,7 @@ function createTypeChecker(host) {
|
|
|
77776
77797
|
state.typeStack[state.stackIndex + 1] = type;
|
|
77777
77798
|
}
|
|
77778
77799
|
}
|
|
77779
|
-
function
|
|
77800
|
+
function checkNullishCoalesceOperands(node) {
|
|
77780
77801
|
const { left, operatorToken, right } = node;
|
|
77781
77802
|
if (operatorToken.kind === 61 /* QuestionQuestionToken */) {
|
|
77782
77803
|
if (isBinaryExpression(left) && (left.operatorToken.kind === 57 /* BarBarToken */ || left.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
|
|
@@ -77785,15 +77806,62 @@ function createTypeChecker(host) {
|
|
|
77785
77806
|
if (isBinaryExpression(right) && (right.operatorToken.kind === 57 /* BarBarToken */ || right.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
|
|
77786
77807
|
grammarErrorOnNode(right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(right.operatorToken.kind), tokenToString(operatorToken.kind));
|
|
77787
77808
|
}
|
|
77809
|
+
const leftTarget = skipOuterExpressions(left, 15 /* All */);
|
|
77810
|
+
const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget);
|
|
77811
|
+
if (nullishSemantics !== 3 /* Sometimes */) {
|
|
77812
|
+
if (node.parent.kind === 226 /* BinaryExpression */) {
|
|
77813
|
+
error(leftTarget, Diagnostics.This_binary_expression_is_never_nullish_Are_you_missing_parentheses);
|
|
77814
|
+
} else {
|
|
77815
|
+
if (nullishSemantics === 1 /* Always */) {
|
|
77816
|
+
error(leftTarget, Diagnostics.This_expression_is_always_nullish);
|
|
77817
|
+
} else {
|
|
77818
|
+
error(leftTarget, Diagnostics.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish);
|
|
77819
|
+
}
|
|
77820
|
+
}
|
|
77821
|
+
}
|
|
77788
77822
|
}
|
|
77789
77823
|
}
|
|
77824
|
+
function getSyntacticNullishnessSemantics(node) {
|
|
77825
|
+
node = skipOuterExpressions(node);
|
|
77826
|
+
switch (node.kind) {
|
|
77827
|
+
case 223 /* AwaitExpression */:
|
|
77828
|
+
case 213 /* CallExpression */:
|
|
77829
|
+
case 212 /* ElementAccessExpression */:
|
|
77830
|
+
case 214 /* NewExpression */:
|
|
77831
|
+
case 211 /* PropertyAccessExpression */:
|
|
77832
|
+
case 229 /* YieldExpression */:
|
|
77833
|
+
return 3 /* Sometimes */;
|
|
77834
|
+
case 226 /* BinaryExpression */:
|
|
77835
|
+
switch (node.operatorToken.kind) {
|
|
77836
|
+
case 64 /* EqualsToken */:
|
|
77837
|
+
case 61 /* QuestionQuestionToken */:
|
|
77838
|
+
case 78 /* QuestionQuestionEqualsToken */:
|
|
77839
|
+
case 57 /* BarBarToken */:
|
|
77840
|
+
case 76 /* BarBarEqualsToken */:
|
|
77841
|
+
case 56 /* AmpersandAmpersandToken */:
|
|
77842
|
+
case 77 /* AmpersandAmpersandEqualsToken */:
|
|
77843
|
+
return 3 /* Sometimes */;
|
|
77844
|
+
}
|
|
77845
|
+
return 2 /* Never */;
|
|
77846
|
+
case 227 /* ConditionalExpression */:
|
|
77847
|
+
return getSyntacticNullishnessSemantics(node.whenTrue) | getSyntacticNullishnessSemantics(node.whenFalse);
|
|
77848
|
+
case 106 /* NullKeyword */:
|
|
77849
|
+
return 1 /* Always */;
|
|
77850
|
+
case 80 /* Identifier */:
|
|
77851
|
+
if (getResolvedSymbol(node) === undefinedSymbol) {
|
|
77852
|
+
return 1 /* Always */;
|
|
77853
|
+
}
|
|
77854
|
+
return 3 /* Sometimes */;
|
|
77855
|
+
}
|
|
77856
|
+
return 2 /* Never */;
|
|
77857
|
+
}
|
|
77790
77858
|
function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) {
|
|
77791
77859
|
const operator = operatorToken.kind;
|
|
77792
77860
|
if (operator === 64 /* EqualsToken */ && (left.kind === 210 /* ObjectLiteralExpression */ || left.kind === 209 /* ArrayLiteralExpression */)) {
|
|
77793
77861
|
return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 110 /* ThisKeyword */);
|
|
77794
77862
|
}
|
|
77795
77863
|
let leftType;
|
|
77796
|
-
if (
|
|
77864
|
+
if (isBinaryLogicalOperator(operator)) {
|
|
77797
77865
|
leftType = checkTruthinessExpression(left, checkMode);
|
|
77798
77866
|
} else {
|
|
77799
77867
|
leftType = checkExpression(left, checkMode);
|
|
@@ -81399,9 +81467,51 @@ function createTypeChecker(host) {
|
|
|
81399
81467
|
function checkTruthinessOfType(type, node) {
|
|
81400
81468
|
if (type.flags & 16384 /* Void */) {
|
|
81401
81469
|
error(node, Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness);
|
|
81470
|
+
} else {
|
|
81471
|
+
const semantics = getSyntacticTruthySemantics(node);
|
|
81472
|
+
if (semantics !== 3 /* Sometimes */) {
|
|
81473
|
+
error(
|
|
81474
|
+
node,
|
|
81475
|
+
semantics === 1 /* Always */ ? Diagnostics.This_kind_of_expression_is_always_truthy : Diagnostics.This_kind_of_expression_is_always_falsy
|
|
81476
|
+
);
|
|
81477
|
+
}
|
|
81402
81478
|
}
|
|
81403
81479
|
return type;
|
|
81404
81480
|
}
|
|
81481
|
+
function getSyntacticTruthySemantics(node) {
|
|
81482
|
+
node = skipOuterExpressions(node);
|
|
81483
|
+
switch (node.kind) {
|
|
81484
|
+
case 9 /* NumericLiteral */:
|
|
81485
|
+
if (node.text === "0" || node.text === "1") {
|
|
81486
|
+
return 3 /* Sometimes */;
|
|
81487
|
+
}
|
|
81488
|
+
return 1 /* Always */;
|
|
81489
|
+
case 209 /* ArrayLiteralExpression */:
|
|
81490
|
+
case 219 /* ArrowFunction */:
|
|
81491
|
+
case 10 /* BigIntLiteral */:
|
|
81492
|
+
case 231 /* ClassExpression */:
|
|
81493
|
+
case 218 /* FunctionExpression */:
|
|
81494
|
+
case 284 /* JsxElement */:
|
|
81495
|
+
case 285 /* JsxSelfClosingElement */:
|
|
81496
|
+
case 210 /* ObjectLiteralExpression */:
|
|
81497
|
+
case 14 /* RegularExpressionLiteral */:
|
|
81498
|
+
return 1 /* Always */;
|
|
81499
|
+
case 222 /* VoidExpression */:
|
|
81500
|
+
case 106 /* NullKeyword */:
|
|
81501
|
+
return 2 /* Never */;
|
|
81502
|
+
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
81503
|
+
case 11 /* StringLiteral */:
|
|
81504
|
+
return !!node.text ? 1 /* Always */ : 2 /* Never */;
|
|
81505
|
+
case 227 /* ConditionalExpression */:
|
|
81506
|
+
return getSyntacticTruthySemantics(node.whenTrue) | getSyntacticTruthySemantics(node.whenFalse);
|
|
81507
|
+
case 80 /* Identifier */:
|
|
81508
|
+
if (getResolvedSymbol(node) === undefinedSymbol) {
|
|
81509
|
+
return 2 /* Never */;
|
|
81510
|
+
}
|
|
81511
|
+
return 3 /* Sometimes */;
|
|
81512
|
+
}
|
|
81513
|
+
return 3 /* Sometimes */;
|
|
81514
|
+
}
|
|
81405
81515
|
function checkTruthinessExpression(node, checkMode) {
|
|
81406
81516
|
return checkTruthinessOfType(checkExpression(node, checkMode), node);
|
|
81407
81517
|
}
|
|
@@ -83385,6 +83495,14 @@ function createTypeChecker(host) {
|
|
|
83385
83495
|
}
|
|
83386
83496
|
if (isIdentifier(node.name)) {
|
|
83387
83497
|
checkCollisionsForDeclarationName(node, node.name);
|
|
83498
|
+
if (!(node.flags & (32 /* Namespace */ | 2048 /* GlobalAugmentation */))) {
|
|
83499
|
+
const sourceFile = getSourceFileOfNode(node);
|
|
83500
|
+
const pos = getNonModifierTokenPosOfNode(node);
|
|
83501
|
+
const span = getSpanOfTokenAtPosition(sourceFile, pos);
|
|
83502
|
+
suggestionDiagnostics.add(
|
|
83503
|
+
createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead)
|
|
83504
|
+
);
|
|
83505
|
+
}
|
|
83388
83506
|
}
|
|
83389
83507
|
checkExportsOnMergedDeclarations(node);
|
|
83390
83508
|
const symbol = getSymbolOfDeclaration(node);
|
|
@@ -85558,11 +85676,14 @@ function createTypeChecker(host) {
|
|
|
85558
85676
|
}
|
|
85559
85677
|
function checkSingleIdentifier(node2) {
|
|
85560
85678
|
const nodeLinks2 = getNodeLinks(node2);
|
|
85561
|
-
nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference
|
|
85562
|
-
if (isIdentifier(node2)
|
|
85563
|
-
|
|
85564
|
-
if (
|
|
85565
|
-
|
|
85679
|
+
nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference */;
|
|
85680
|
+
if (isIdentifier(node2)) {
|
|
85681
|
+
nodeLinks2.calculatedFlags |= 32768 /* BlockScopedBindingInLoop */ | 16384 /* CapturedBlockScopedBinding */;
|
|
85682
|
+
if (isExpressionNodeOrShorthandPropertyAssignmentName(node2) && !(isPropertyAccessExpression(node2.parent) && node2.parent.name === node2)) {
|
|
85683
|
+
const s = getResolvedSymbol(node2);
|
|
85684
|
+
if (s && s !== unknownSymbol) {
|
|
85685
|
+
checkIdentifierCalculateNodeCheckFlags(node2, s);
|
|
85686
|
+
}
|
|
85566
85687
|
}
|
|
85567
85688
|
}
|
|
85568
85689
|
}
|
|
@@ -89856,7 +89977,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89856
89977
|
}
|
|
89857
89978
|
}
|
|
89858
89979
|
function addExportedFunctionDeclaration(node, name, isDefault) {
|
|
89859
|
-
exportedFunctions.add(node);
|
|
89980
|
+
exportedFunctions.add(getOriginalNode(node, isFunctionDeclaration));
|
|
89860
89981
|
if (isDefault) {
|
|
89861
89982
|
if (!hasExportDefault) {
|
|
89862
89983
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name ?? context.factory.getDeclarationName(node));
|
|
@@ -94259,6 +94380,7 @@ function transformClassFields(context) {
|
|
|
94259
94380
|
addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, statementOffset));
|
|
94260
94381
|
}
|
|
94261
94382
|
function transformConstructorBody(node, constructor, isDerivedClass) {
|
|
94383
|
+
var _a;
|
|
94262
94384
|
const instanceProperties = getProperties(
|
|
94263
94385
|
node,
|
|
94264
94386
|
/*requireInitializer*/
|
|
@@ -94352,12 +94474,12 @@ function transformClassFields(context) {
|
|
|
94352
94474
|
setTextRange(
|
|
94353
94475
|
factory2.createNodeArray(statements),
|
|
94354
94476
|
/*location*/
|
|
94355
|
-
constructor ? constructor.body.statements
|
|
94477
|
+
((_a = constructor == null ? void 0 : constructor.body) == null ? void 0 : _a.statements) ?? node.members
|
|
94356
94478
|
),
|
|
94357
94479
|
multiLine
|
|
94358
94480
|
),
|
|
94359
94481
|
/*location*/
|
|
94360
|
-
constructor
|
|
94482
|
+
constructor == null ? void 0 : constructor.body
|
|
94361
94483
|
);
|
|
94362
94484
|
}
|
|
94363
94485
|
function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) {
|
|
@@ -107791,7 +107913,7 @@ function transformModule(context) {
|
|
|
107791
107913
|
return factory2.updateLabeledStatement(
|
|
107792
107914
|
node,
|
|
107793
107915
|
node.label,
|
|
107794
|
-
|
|
107916
|
+
visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createExpressionStatement(factory2.createIdentifier(""))
|
|
107795
107917
|
);
|
|
107796
107918
|
}
|
|
107797
107919
|
function visitWithStatement(node) {
|
|
@@ -107805,7 +107927,7 @@ function transformModule(context) {
|
|
|
107805
107927
|
return factory2.updateIfStatement(
|
|
107806
107928
|
node,
|
|
107807
107929
|
visitNode(node.expression, visitor, isExpression),
|
|
107808
|
-
|
|
107930
|
+
visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createBlock([]),
|
|
107809
107931
|
visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)
|
|
107810
107932
|
);
|
|
107811
107933
|
}
|
|
@@ -109908,7 +110030,7 @@ function transformSystemModule(context) {
|
|
|
109908
110030
|
return factory2.updateLabeledStatement(
|
|
109909
110031
|
node,
|
|
109910
110032
|
node.label,
|
|
109911
|
-
|
|
110033
|
+
visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createExpressionStatement(factory2.createIdentifier(""))
|
|
109912
110034
|
);
|
|
109913
110035
|
}
|
|
109914
110036
|
function visitWithStatement(node) {
|
|
@@ -109922,7 +110044,7 @@ function transformSystemModule(context) {
|
|
|
109922
110044
|
return factory2.updateIfStatement(
|
|
109923
110045
|
node,
|
|
109924
110046
|
visitNode(node.expression, visitor, isExpression),
|
|
109925
|
-
|
|
110047
|
+
visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createBlock([]),
|
|
109926
110048
|
visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)
|
|
109927
110049
|
);
|
|
109928
110050
|
}
|
|
@@ -113615,6 +113737,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
113615
113737
|
forEachChild(node, collectLinkedAliases);
|
|
113616
113738
|
}
|
|
113617
113739
|
function markLinkedReferences(file) {
|
|
113740
|
+
if (isSourceFileJS(file)) return;
|
|
113618
113741
|
forEachChildRecursively(file, (n) => {
|
|
113619
113742
|
if (isImportEqualsDeclaration(n) && !(getSyntacticModifierFlags(n) & 32 /* Export */)) return "skip";
|
|
113620
113743
|
if (isImportDeclaration(n)) return "skip";
|
|
@@ -114598,7 +114721,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
114598
114721
|
}
|
|
114599
114722
|
function getSortedEmitHelpers(node) {
|
|
114600
114723
|
const helpers = getEmitHelpers(node);
|
|
114601
|
-
return helpers &&
|
|
114724
|
+
return helpers && toSorted(helpers, compareEmitHelpers);
|
|
114602
114725
|
}
|
|
114603
114726
|
function emitNumericOrBigIntLiteral(node) {
|
|
114604
114727
|
emitLiteral(
|
|
@@ -119681,7 +119804,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119681
119804
|
});
|
|
119682
119805
|
}
|
|
119683
119806
|
}
|
|
119684
|
-
files =
|
|
119807
|
+
files = toSorted(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles);
|
|
119685
119808
|
processingDefaultLibFiles = void 0;
|
|
119686
119809
|
processingOtherFiles = void 0;
|
|
119687
119810
|
filesWithReferencesProcessed = void 0;
|
|
@@ -128829,7 +128952,7 @@ function shouldBePretty(sys2, options) {
|
|
|
128829
128952
|
return options.pretty;
|
|
128830
128953
|
}
|
|
128831
128954
|
function getOptionsForHelp(commandLine) {
|
|
128832
|
-
return !!commandLine.options.all ?
|
|
128955
|
+
return !!commandLine.options.all ? toSorted(optionDeclarations, (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter(optionDeclarations.slice(), (v) => !!v.showInSimplifiedHelpView);
|
|
128833
128956
|
}
|
|
128834
128957
|
function printVersion(sys2) {
|
|
128835
128958
|
sys2.write(getDiagnosticText(Diagnostics.Version_0, version) + sys2.newLine);
|
package/lib/typescript.d.ts
CHANGED
|
@@ -10764,6 +10764,10 @@ declare namespace ts {
|
|
|
10764
10764
|
*/
|
|
10765
10765
|
isIncomplete?: true;
|
|
10766
10766
|
entries: CompletionEntry[];
|
|
10767
|
+
/**
|
|
10768
|
+
* Default commit characters for the completion entries.
|
|
10769
|
+
*/
|
|
10770
|
+
defaultCommitCharacters?: string[];
|
|
10767
10771
|
}
|
|
10768
10772
|
interface CompletionEntryDataAutoImport {
|
|
10769
10773
|
/**
|
|
@@ -10870,6 +10874,10 @@ declare namespace ts {
|
|
|
10870
10874
|
* is an auto-import.
|
|
10871
10875
|
*/
|
|
10872
10876
|
data?: CompletionEntryData;
|
|
10877
|
+
/**
|
|
10878
|
+
* If this completion entry is selected, typing a commit character will cause the entry to be accepted.
|
|
10879
|
+
*/
|
|
10880
|
+
commitCharacters?: string[];
|
|
10873
10881
|
}
|
|
10874
10882
|
interface CompletionEntryLabelDetails {
|
|
10875
10883
|
/**
|