@typescript-deploys/pr-build 5.0.0-pr-49929-73 → 5.0.0-pr-52280-7
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 +206 -131
- package/lib/tsserver.js +239 -140
- package/lib/tsserverlibrary.d.ts +19 -10
- package/lib/tsserverlibrary.js +232 -140
- package/lib/typescript.d.ts +19 -10
- package/lib/typescript.js +225 -140
- package/lib/typingsInstaller.js +77 -44
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -1001,6 +1001,8 @@ __export(server_exports, {
|
|
|
1001
1001
|
getJSDocReturnTag: () => getJSDocReturnTag,
|
|
1002
1002
|
getJSDocReturnType: () => getJSDocReturnType,
|
|
1003
1003
|
getJSDocRoot: () => getJSDocRoot,
|
|
1004
|
+
getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType,
|
|
1005
|
+
getJSDocSatisfiesTag: () => getJSDocSatisfiesTag,
|
|
1004
1006
|
getJSDocTags: () => getJSDocTags,
|
|
1005
1007
|
getJSDocTagsNoCache: () => getJSDocTagsNoCache,
|
|
1006
1008
|
getJSDocTemplateTag: () => getJSDocTemplateTag,
|
|
@@ -1630,6 +1632,8 @@ __export(server_exports, {
|
|
|
1630
1632
|
isJSDocPublicTag: () => isJSDocPublicTag,
|
|
1631
1633
|
isJSDocReadonlyTag: () => isJSDocReadonlyTag,
|
|
1632
1634
|
isJSDocReturnTag: () => isJSDocReturnTag,
|
|
1635
|
+
isJSDocSatisfiesExpression: () => isJSDocSatisfiesExpression,
|
|
1636
|
+
isJSDocSatisfiesTag: () => isJSDocSatisfiesTag,
|
|
1633
1637
|
isJSDocSeeTag: () => isJSDocSeeTag,
|
|
1634
1638
|
isJSDocSignature: () => isJSDocSignature,
|
|
1635
1639
|
isJSDocTag: () => isJSDocTag,
|
|
@@ -1691,6 +1695,8 @@ __export(server_exports, {
|
|
|
1691
1695
|
isLogicalOperator: () => isLogicalOperator,
|
|
1692
1696
|
isLogicalOrCoalescingAssignmentExpression: () => isLogicalOrCoalescingAssignmentExpression,
|
|
1693
1697
|
isLogicalOrCoalescingAssignmentOperator: () => isLogicalOrCoalescingAssignmentOperator,
|
|
1698
|
+
isLogicalOrCoalescingBinaryExpression: () => isLogicalOrCoalescingBinaryExpression,
|
|
1699
|
+
isLogicalOrCoalescingBinaryOperator: () => isLogicalOrCoalescingBinaryOperator,
|
|
1694
1700
|
isMappedTypeNode: () => isMappedTypeNode,
|
|
1695
1701
|
isMemberName: () => isMemberName,
|
|
1696
1702
|
isMergeDeclarationMarker: () => isMergeDeclarationMarker,
|
|
@@ -2376,6 +2382,7 @@ __export(server_exports, {
|
|
|
2376
2382
|
tryGetDirectories: () => tryGetDirectories,
|
|
2377
2383
|
tryGetExtensionFromPath: () => tryGetExtensionFromPath2,
|
|
2378
2384
|
tryGetImportFromModuleSpecifier: () => tryGetImportFromModuleSpecifier,
|
|
2385
|
+
tryGetJSDocSatisfiesTypeNode: () => tryGetJSDocSatisfiesTypeNode,
|
|
2379
2386
|
tryGetModuleNameFromFile: () => tryGetModuleNameFromFile,
|
|
2380
2387
|
tryGetModuleSpecifierFromDeclaration: () => tryGetModuleSpecifierFromDeclaration,
|
|
2381
2388
|
tryGetNativePerformanceHooks: () => tryGetNativePerformanceHooks,
|
|
@@ -2675,7 +2682,7 @@ __export(ts_server_exports3, {
|
|
|
2675
2682
|
|
|
2676
2683
|
// src/compiler/corePublic.ts
|
|
2677
2684
|
var versionMajorMinor = "5.0";
|
|
2678
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2685
|
+
var version = `${versionMajorMinor}.0-insiders.20230118`;
|
|
2679
2686
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2680
2687
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2681
2688
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6475,14 +6482,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
|
|
|
6475
6482
|
SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 350] = "JSDocSeeTag";
|
|
6476
6483
|
SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 351] = "JSDocPropertyTag";
|
|
6477
6484
|
SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 352] = "JSDocThrowsTag";
|
|
6478
|
-
SyntaxKind5[SyntaxKind5["
|
|
6479
|
-
SyntaxKind5[SyntaxKind5["
|
|
6480
|
-
SyntaxKind5[SyntaxKind5["
|
|
6481
|
-
SyntaxKind5[SyntaxKind5["
|
|
6482
|
-
SyntaxKind5[SyntaxKind5["
|
|
6483
|
-
SyntaxKind5[SyntaxKind5["
|
|
6484
|
-
SyntaxKind5[SyntaxKind5["
|
|
6485
|
-
SyntaxKind5[SyntaxKind5["
|
|
6485
|
+
SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 353] = "JSDocSatisfiesTag";
|
|
6486
|
+
SyntaxKind5[SyntaxKind5["SyntaxList"] = 354] = "SyntaxList";
|
|
6487
|
+
SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 355] = "NotEmittedStatement";
|
|
6488
|
+
SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 356] = "PartiallyEmittedExpression";
|
|
6489
|
+
SyntaxKind5[SyntaxKind5["CommaListExpression"] = 357] = "CommaListExpression";
|
|
6490
|
+
SyntaxKind5[SyntaxKind5["MergeDeclarationMarker"] = 358] = "MergeDeclarationMarker";
|
|
6491
|
+
SyntaxKind5[SyntaxKind5["EndOfDeclarationMarker"] = 359] = "EndOfDeclarationMarker";
|
|
6492
|
+
SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 360] = "SyntheticReferenceExpression";
|
|
6493
|
+
SyntaxKind5[SyntaxKind5["Count"] = 361] = "Count";
|
|
6486
6494
|
SyntaxKind5[SyntaxKind5["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment";
|
|
6487
6495
|
SyntaxKind5[SyntaxKind5["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment";
|
|
6488
6496
|
SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment";
|
|
@@ -6511,9 +6519,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
|
|
|
6511
6519
|
SyntaxKind5[SyntaxKind5["LastStatement"] = 256 /* DebuggerStatement */] = "LastStatement";
|
|
6512
6520
|
SyntaxKind5[SyntaxKind5["FirstNode"] = 163 /* QualifiedName */] = "FirstNode";
|
|
6513
6521
|
SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 312 /* JSDocTypeExpression */] = "FirstJSDocNode";
|
|
6514
|
-
SyntaxKind5[SyntaxKind5["LastJSDocNode"] =
|
|
6522
|
+
SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocNode";
|
|
6515
6523
|
SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 330 /* JSDocTag */] = "FirstJSDocTagNode";
|
|
6516
|
-
SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] =
|
|
6524
|
+
SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocTagNode";
|
|
6517
6525
|
SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 126 /* AbstractKeyword */] = "FirstContextualKeyword";
|
|
6518
6526
|
SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 162 /* OfKeyword */] = "LastContextualKeyword";
|
|
6519
6527
|
return SyntaxKind5;
|
|
@@ -9729,7 +9737,6 @@ var Diagnostics = {
|
|
|
9729
9737
|
An_export_declaration_cannot_have_modifiers: diag(1193, 1 /* Error */, "An_export_declaration_cannot_have_modifiers_1193", "An export declaration cannot have modifiers."),
|
|
9730
9738
|
Export_declarations_are_not_permitted_in_a_namespace: diag(1194, 1 /* Error */, "Export_declarations_are_not_permitted_in_a_namespace_1194", "Export declarations are not permitted in a namespace."),
|
|
9731
9739
|
export_Asterisk_does_not_re_export_a_default: diag(1195, 1 /* Error */, "export_Asterisk_does_not_re_export_a_default_1195", "'export *' does not re-export a default."),
|
|
9732
|
-
Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified: diag(1196, 1 /* Error */, "Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196", "Catch clause variable type annotation must be 'any' or 'unknown' if specified."),
|
|
9733
9740
|
Catch_clause_variable_cannot_have_an_initializer: diag(1197, 1 /* Error */, "Catch_clause_variable_cannot_have_an_initializer_1197", "Catch clause variable cannot have an initializer."),
|
|
9734
9741
|
An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: diag(1198, 1 /* Error */, "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198", "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."),
|
|
9735
9742
|
Unterminated_Unicode_escape_sequence: diag(1199, 1 /* Error */, "Unterminated_Unicode_escape_sequence_1199", "Unterminated Unicode escape sequence."),
|
|
@@ -10675,7 +10682,7 @@ var Diagnostics = {
|
|
|
10675
10682
|
Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."),
|
|
10676
10683
|
Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."),
|
|
10677
10684
|
Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."),
|
|
10678
|
-
|
|
10685
|
+
Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),
|
|
10679
10686
|
An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),
|
|
10680
10687
|
Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),
|
|
10681
10688
|
Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`),
|
|
@@ -11597,7 +11604,8 @@ var Diagnostics = {
|
|
|
11597
11604
|
_0_is_possibly_null: diag(18047, 1 /* Error */, "_0_is_possibly_null_18047", "'{0}' is possibly 'null'."),
|
|
11598
11605
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
11599
11606
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
11600
|
-
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here.")
|
|
11607
|
+
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
11608
|
+
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
11601
11609
|
};
|
|
11602
11610
|
|
|
11603
11611
|
// src/compiler/scanner.ts
|
|
@@ -14312,6 +14320,9 @@ function getJSDocReturnTag(node) {
|
|
|
14312
14320
|
function getJSDocTemplateTag(node) {
|
|
14313
14321
|
return getFirstJSDocTag(node, isJSDocTemplateTag);
|
|
14314
14322
|
}
|
|
14323
|
+
function getJSDocSatisfiesTag(node) {
|
|
14324
|
+
return getFirstJSDocTag(node, isJSDocSatisfiesTag);
|
|
14325
|
+
}
|
|
14315
14326
|
function getJSDocTypeTag(node) {
|
|
14316
14327
|
const tag = getFirstJSDocTag(node, isJSDocTypeTag);
|
|
14317
14328
|
if (tag && tag.typeExpression && tag.typeExpression.type) {
|
|
@@ -14904,8 +14915,8 @@ function isExpressionKind(kind) {
|
|
|
14904
14915
|
case 227 /* SpreadElement */:
|
|
14905
14916
|
case 231 /* AsExpression */:
|
|
14906
14917
|
case 229 /* OmittedExpression */:
|
|
14907
|
-
case
|
|
14908
|
-
case
|
|
14918
|
+
case 357 /* CommaListExpression */:
|
|
14919
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
14909
14920
|
case 235 /* SatisfiesExpression */:
|
|
14910
14921
|
return true;
|
|
14911
14922
|
default:
|
|
@@ -15090,7 +15101,7 @@ function isDeclarationStatementKind(kind) {
|
|
|
15090
15101
|
return kind === 259 /* FunctionDeclaration */ || kind === 279 /* MissingDeclaration */ || kind === 260 /* ClassDeclaration */ || kind === 261 /* InterfaceDeclaration */ || kind === 262 /* TypeAliasDeclaration */ || kind === 263 /* EnumDeclaration */ || kind === 264 /* ModuleDeclaration */ || kind === 269 /* ImportDeclaration */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 275 /* ExportDeclaration */ || kind === 274 /* ExportAssignment */ || kind === 267 /* NamespaceExportDeclaration */;
|
|
15091
15102
|
}
|
|
15092
15103
|
function isStatementKindButNotDeclarationKind(kind) {
|
|
15093
|
-
return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind ===
|
|
15104
|
+
return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 355 /* NotEmittedStatement */ || kind === 359 /* EndOfDeclarationMarker */ || kind === 358 /* MergeDeclarationMarker */;
|
|
15094
15105
|
}
|
|
15095
15106
|
function isDeclaration(node) {
|
|
15096
15107
|
if (node.kind === 165 /* TypeParameter */) {
|
|
@@ -15151,13 +15162,13 @@ function isCaseOrDefaultClause(node) {
|
|
|
15151
15162
|
return kind === 292 /* CaseClause */ || kind === 293 /* DefaultClause */;
|
|
15152
15163
|
}
|
|
15153
15164
|
function isJSDocNode(node) {
|
|
15154
|
-
return node.kind >= 312 /* FirstJSDocNode */ && node.kind <=
|
|
15165
|
+
return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 353 /* LastJSDocNode */;
|
|
15155
15166
|
}
|
|
15156
15167
|
function isJSDocCommentContainingNode(node) {
|
|
15157
15168
|
return node.kind === 323 /* JSDoc */ || node.kind === 322 /* JSDocNamepathType */ || node.kind === 324 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node);
|
|
15158
15169
|
}
|
|
15159
15170
|
function isJSDocTag(node) {
|
|
15160
|
-
return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <=
|
|
15171
|
+
return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 353 /* LastJSDocTagNode */;
|
|
15161
15172
|
}
|
|
15162
15173
|
function isSetAccessor(node) {
|
|
15163
15174
|
return node.kind === 175 /* SetAccessor */;
|
|
@@ -15573,7 +15584,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
|
|
|
15573
15584
|
if (includeJsDoc && hasJSDocNodes(node)) {
|
|
15574
15585
|
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
|
|
15575
15586
|
}
|
|
15576
|
-
if (node.kind ===
|
|
15587
|
+
if (node.kind === 354 /* SyntaxList */ && node._children.length > 0) {
|
|
15577
15588
|
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
|
|
15578
15589
|
}
|
|
15579
15590
|
return skipTrivia(
|
|
@@ -17453,7 +17464,7 @@ function filterOwnedJSDocTags(hostNode, jsDoc) {
|
|
|
17453
17464
|
return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0;
|
|
17454
17465
|
}
|
|
17455
17466
|
function ownsJSDocTag(hostNode, tag) {
|
|
17456
|
-
return !isJSDocTypeTag(tag) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
|
|
17467
|
+
return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
|
|
17457
17468
|
}
|
|
17458
17469
|
function getNextJSDocCommentLocation(node) {
|
|
17459
17470
|
const parent2 = node.parent;
|
|
@@ -18036,7 +18047,7 @@ var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => {
|
|
|
18036
18047
|
})(OperatorPrecedence || {});
|
|
18037
18048
|
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
|
|
18038
18049
|
switch (nodeKind) {
|
|
18039
|
-
case
|
|
18050
|
+
case 357 /* CommaListExpression */:
|
|
18040
18051
|
return 0 /* Comma */;
|
|
18041
18052
|
case 227 /* SpreadElement */:
|
|
18042
18053
|
return 1 /* Spread */;
|
|
@@ -19038,14 +19049,23 @@ function modifierToFlag(token) {
|
|
|
19038
19049
|
}
|
|
19039
19050
|
return 0 /* None */;
|
|
19040
19051
|
}
|
|
19052
|
+
function isBinaryLogicalOperator(token) {
|
|
19053
|
+
return token === 56 /* BarBarToken */ || token === 55 /* AmpersandAmpersandToken */;
|
|
19054
|
+
}
|
|
19041
19055
|
function isLogicalOperator(token) {
|
|
19042
|
-
return token
|
|
19056
|
+
return isBinaryLogicalOperator(token) || token === 53 /* ExclamationToken */;
|
|
19043
19057
|
}
|
|
19044
19058
|
function isLogicalOrCoalescingAssignmentOperator(token) {
|
|
19045
19059
|
return token === 75 /* BarBarEqualsToken */ || token === 76 /* AmpersandAmpersandEqualsToken */ || token === 77 /* QuestionQuestionEqualsToken */;
|
|
19046
19060
|
}
|
|
19047
19061
|
function isLogicalOrCoalescingAssignmentExpression(expr) {
|
|
19048
|
-
return isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind);
|
|
19062
|
+
return isBinaryExpression(expr) && isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind);
|
|
19063
|
+
}
|
|
19064
|
+
function isLogicalOrCoalescingBinaryOperator(token) {
|
|
19065
|
+
return isBinaryLogicalOperator(token) || token === 60 /* QuestionQuestionToken */;
|
|
19066
|
+
}
|
|
19067
|
+
function isLogicalOrCoalescingBinaryExpression(expr) {
|
|
19068
|
+
return isBinaryExpression(expr) && isLogicalOrCoalescingBinaryOperator(expr.operatorToken.kind);
|
|
19049
19069
|
}
|
|
19050
19070
|
function isAssignmentOperator(token) {
|
|
19051
19071
|
return token >= 63 /* FirstAssignment */ && token <= 78 /* LastAssignment */;
|
|
@@ -19691,7 +19711,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
|
|
|
19691
19711
|
case 209 /* ElementAccessExpression */:
|
|
19692
19712
|
case 208 /* PropertyAccessExpression */:
|
|
19693
19713
|
case 232 /* NonNullExpression */:
|
|
19694
|
-
case
|
|
19714
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
19695
19715
|
case 235 /* SatisfiesExpression */:
|
|
19696
19716
|
node = node.expression;
|
|
19697
19717
|
continue;
|
|
@@ -21005,7 +21025,7 @@ function getContainingNodeArray(node) {
|
|
|
21005
21025
|
return parent2.types;
|
|
21006
21026
|
case 186 /* TupleType */:
|
|
21007
21027
|
case 206 /* ArrayLiteralExpression */:
|
|
21008
|
-
case
|
|
21028
|
+
case 357 /* CommaListExpression */:
|
|
21009
21029
|
case 272 /* NamedImports */:
|
|
21010
21030
|
case 276 /* NamedExports */:
|
|
21011
21031
|
return parent2.elements;
|
|
@@ -21190,6 +21210,16 @@ function isNonNullAccess(node) {
|
|
|
21190
21210
|
const kind = node.kind;
|
|
21191
21211
|
return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
|
|
21192
21212
|
}
|
|
21213
|
+
function isJSDocSatisfiesExpression(node) {
|
|
21214
|
+
return isInJSFile(node) && isParenthesizedExpression(node) && hasJSDocNodes(node) && !!getJSDocSatisfiesTag(node);
|
|
21215
|
+
}
|
|
21216
|
+
function getJSDocSatisfiesExpressionType(node) {
|
|
21217
|
+
return Debug.checkDefined(tryGetJSDocSatisfiesTypeNode(node));
|
|
21218
|
+
}
|
|
21219
|
+
function tryGetJSDocSatisfiesTypeNode(node) {
|
|
21220
|
+
const tag = getJSDocSatisfiesTag(node);
|
|
21221
|
+
return tag && tag.typeExpression && tag.typeExpression.type;
|
|
21222
|
+
}
|
|
21193
21223
|
|
|
21194
21224
|
// src/compiler/factory/baseNodeFactory.ts
|
|
21195
21225
|
function createBaseNodeFactory() {
|
|
@@ -22214,6 +22244,12 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22214
22244
|
get updateJSDocThrowsTag() {
|
|
22215
22245
|
return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocThrowsTag */);
|
|
22216
22246
|
},
|
|
22247
|
+
get createJSDocSatisfiesTag() {
|
|
22248
|
+
return getJSDocTypeLikeTagCreateFunction(353 /* JSDocSatisfiesTag */);
|
|
22249
|
+
},
|
|
22250
|
+
get updateJSDocSatisfiesTag() {
|
|
22251
|
+
return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocSatisfiesTag */);
|
|
22252
|
+
},
|
|
22217
22253
|
createJSDocEnumTag: createJSDocEnumTag2,
|
|
22218
22254
|
updateJSDocEnumTag,
|
|
22219
22255
|
createJSDocUnknownTag,
|
|
@@ -25373,18 +25409,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25373
25409
|
return node;
|
|
25374
25410
|
}
|
|
25375
25411
|
function createSyntaxList3(children) {
|
|
25376
|
-
const node = createBaseNode(
|
|
25412
|
+
const node = createBaseNode(354 /* SyntaxList */);
|
|
25377
25413
|
node._children = children;
|
|
25378
25414
|
return node;
|
|
25379
25415
|
}
|
|
25380
25416
|
function createNotEmittedStatement2(original) {
|
|
25381
|
-
const node = createBaseNode(
|
|
25417
|
+
const node = createBaseNode(355 /* NotEmittedStatement */);
|
|
25382
25418
|
node.original = original;
|
|
25383
25419
|
setTextRange(node, original);
|
|
25384
25420
|
return node;
|
|
25385
25421
|
}
|
|
25386
25422
|
function createPartiallyEmittedExpression2(expression, original) {
|
|
25387
|
-
const node = createBaseNode(
|
|
25423
|
+
const node = createBaseNode(356 /* PartiallyEmittedExpression */);
|
|
25388
25424
|
node.expression = expression;
|
|
25389
25425
|
node.original = original;
|
|
25390
25426
|
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
|
|
@@ -25406,7 +25442,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25406
25442
|
return node;
|
|
25407
25443
|
}
|
|
25408
25444
|
function createCommaListExpression(elements) {
|
|
25409
|
-
const node = createBaseNode(
|
|
25445
|
+
const node = createBaseNode(357 /* CommaListExpression */);
|
|
25410
25446
|
node.elements = createNodeArray2(sameFlatMap(elements, flattenCommaElements));
|
|
25411
25447
|
node.transformFlags |= propagateChildrenFlags(node.elements);
|
|
25412
25448
|
return node;
|
|
@@ -25415,19 +25451,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25415
25451
|
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
|
|
25416
25452
|
}
|
|
25417
25453
|
function createEndOfDeclarationMarker(original) {
|
|
25418
|
-
const node = createBaseNode(
|
|
25454
|
+
const node = createBaseNode(359 /* EndOfDeclarationMarker */);
|
|
25419
25455
|
node.emitNode = {};
|
|
25420
25456
|
node.original = original;
|
|
25421
25457
|
return node;
|
|
25422
25458
|
}
|
|
25423
25459
|
function createMergeDeclarationMarker(original) {
|
|
25424
|
-
const node = createBaseNode(
|
|
25460
|
+
const node = createBaseNode(358 /* MergeDeclarationMarker */);
|
|
25425
25461
|
node.emitNode = {};
|
|
25426
25462
|
node.original = original;
|
|
25427
25463
|
return node;
|
|
25428
25464
|
}
|
|
25429
25465
|
function createSyntheticReferenceExpression(expression, thisArg) {
|
|
25430
|
-
const node = createBaseNode(
|
|
25466
|
+
const node = createBaseNode(360 /* SyntheticReferenceExpression */);
|
|
25431
25467
|
node.expression = expression;
|
|
25432
25468
|
node.thisArg = thisArg;
|
|
25433
25469
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
|
|
@@ -25667,7 +25703,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25667
25703
|
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
|
|
25668
25704
|
case 232 /* NonNullExpression */:
|
|
25669
25705
|
return updateNonNullExpression2(outerExpression, expression);
|
|
25670
|
-
case
|
|
25706
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
25671
25707
|
return updatePartiallyEmittedExpression2(outerExpression, expression);
|
|
25672
25708
|
}
|
|
25673
25709
|
}
|
|
@@ -26203,7 +26239,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
|
|
|
26203
26239
|
case 213 /* TypeAssertionExpression */:
|
|
26204
26240
|
case 235 /* SatisfiesExpression */:
|
|
26205
26241
|
case 231 /* AsExpression */:
|
|
26206
|
-
case
|
|
26242
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
26207
26243
|
case 214 /* ParenthesizedExpression */:
|
|
26208
26244
|
case 106 /* SuperKeyword */:
|
|
26209
26245
|
return -2147483648 /* OuterExpressionExcludes */;
|
|
@@ -27842,10 +27878,10 @@ function isSyntheticExpression(node) {
|
|
|
27842
27878
|
return node.kind === 234 /* SyntheticExpression */;
|
|
27843
27879
|
}
|
|
27844
27880
|
function isPartiallyEmittedExpression(node) {
|
|
27845
|
-
return node.kind ===
|
|
27881
|
+
return node.kind === 356 /* PartiallyEmittedExpression */;
|
|
27846
27882
|
}
|
|
27847
27883
|
function isCommaListExpression(node) {
|
|
27848
|
-
return node.kind ===
|
|
27884
|
+
return node.kind === 357 /* CommaListExpression */;
|
|
27849
27885
|
}
|
|
27850
27886
|
function isTemplateSpan(node) {
|
|
27851
27887
|
return node.kind === 236 /* TemplateSpan */;
|
|
@@ -27989,16 +28025,16 @@ function isMissingDeclaration(node) {
|
|
|
27989
28025
|
return node.kind === 279 /* MissingDeclaration */;
|
|
27990
28026
|
}
|
|
27991
28027
|
function isNotEmittedStatement(node) {
|
|
27992
|
-
return node.kind ===
|
|
28028
|
+
return node.kind === 355 /* NotEmittedStatement */;
|
|
27993
28029
|
}
|
|
27994
28030
|
function isSyntheticReference(node) {
|
|
27995
|
-
return node.kind ===
|
|
28031
|
+
return node.kind === 360 /* SyntheticReferenceExpression */;
|
|
27996
28032
|
}
|
|
27997
28033
|
function isMergeDeclarationMarker(node) {
|
|
27998
|
-
return node.kind ===
|
|
28034
|
+
return node.kind === 358 /* MergeDeclarationMarker */;
|
|
27999
28035
|
}
|
|
28000
28036
|
function isEndOfDeclarationMarker(node) {
|
|
28001
|
-
return node.kind ===
|
|
28037
|
+
return node.kind === 359 /* EndOfDeclarationMarker */;
|
|
28002
28038
|
}
|
|
28003
28039
|
function isExternalModuleReference(node) {
|
|
28004
28040
|
return node.kind === 280 /* ExternalModuleReference */;
|
|
@@ -28189,11 +28225,14 @@ function isJSDocPropertyTag(node) {
|
|
|
28189
28225
|
function isJSDocImplementsTag(node) {
|
|
28190
28226
|
return node.kind === 332 /* JSDocImplementsTag */;
|
|
28191
28227
|
}
|
|
28228
|
+
function isJSDocSatisfiesTag(node) {
|
|
28229
|
+
return node.kind === 353 /* JSDocSatisfiesTag */;
|
|
28230
|
+
}
|
|
28192
28231
|
function isJSDocThrowsTag(node) {
|
|
28193
28232
|
return node.kind === 352 /* JSDocThrowsTag */;
|
|
28194
28233
|
}
|
|
28195
28234
|
function isSyntaxList(n) {
|
|
28196
|
-
return n.kind ===
|
|
28235
|
+
return n.kind === 354 /* SyntaxList */;
|
|
28197
28236
|
}
|
|
28198
28237
|
|
|
28199
28238
|
// src/compiler/factory/utilities.ts
|
|
@@ -28561,7 +28600,7 @@ function startsWithUseStrict(statements) {
|
|
|
28561
28600
|
return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement);
|
|
28562
28601
|
}
|
|
28563
28602
|
function isCommaSequence(node) {
|
|
28564
|
-
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind ===
|
|
28603
|
+
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 357 /* CommaListExpression */;
|
|
28565
28604
|
}
|
|
28566
28605
|
function isJSDocTypeAssertion(node) {
|
|
28567
28606
|
return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
|
|
@@ -28584,7 +28623,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
|
|
|
28584
28623
|
return (kinds & 2 /* TypeAssertions */) !== 0;
|
|
28585
28624
|
case 232 /* NonNullExpression */:
|
|
28586
28625
|
return (kinds & 4 /* NonNullAssertions */) !== 0;
|
|
28587
|
-
case
|
|
28626
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
28588
28627
|
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
|
|
28589
28628
|
}
|
|
28590
28629
|
return false;
|
|
@@ -29587,7 +29626,7 @@ var forEachChildTable = {
|
|
|
29587
29626
|
[279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
|
|
29588
29627
|
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
|
|
29589
29628
|
},
|
|
29590
|
-
[
|
|
29629
|
+
[357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
|
|
29591
29630
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
29592
29631
|
},
|
|
29593
29632
|
[281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
|
|
@@ -29659,6 +29698,7 @@ var forEachChildTable = {
|
|
|
29659
29698
|
[347 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag,
|
|
29660
29699
|
[346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag,
|
|
29661
29700
|
[343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag,
|
|
29701
|
+
[353 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag,
|
|
29662
29702
|
[352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag,
|
|
29663
29703
|
[342 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag,
|
|
29664
29704
|
[326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
|
|
@@ -29678,7 +29718,7 @@ var forEachChildTable = {
|
|
|
29678
29718
|
[339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
|
|
29679
29719
|
[334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
|
|
29680
29720
|
[340 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
|
|
29681
|
-
[
|
|
29721
|
+
[356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
29682
29722
|
};
|
|
29683
29723
|
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
|
|
29684
29724
|
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
|
|
@@ -35754,6 +35794,9 @@ var Parser;
|
|
|
35754
35794
|
case "overload":
|
|
35755
35795
|
tag = parseOverloadTag(start3, tagName, margin, indentText);
|
|
35756
35796
|
break;
|
|
35797
|
+
case "satisfies":
|
|
35798
|
+
tag = parseSatisfiesTag(start3, tagName, margin, indentText);
|
|
35799
|
+
break;
|
|
35757
35800
|
case "see":
|
|
35758
35801
|
tag = parseSeeTag(start3, tagName, margin, indentText);
|
|
35759
35802
|
break;
|
|
@@ -36062,6 +36105,14 @@ var Parser;
|
|
|
36062
36105
|
const className = parseExpressionWithTypeArgumentsForAugments();
|
|
36063
36106
|
return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start3, getNodePos(), margin, indentText)), start3);
|
|
36064
36107
|
}
|
|
36108
|
+
function parseSatisfiesTag(start3, tagName, margin, indentText) {
|
|
36109
|
+
const typeExpression = parseJSDocTypeExpression(
|
|
36110
|
+
/*mayOmitBraces*/
|
|
36111
|
+
false
|
|
36112
|
+
);
|
|
36113
|
+
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start3, getNodePos(), margin, indentText) : void 0;
|
|
36114
|
+
return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start3);
|
|
36115
|
+
}
|
|
36065
36116
|
function parseExpressionWithTypeArgumentsForAugments() {
|
|
36066
36117
|
const usedBrace = parseOptional(18 /* OpenBraceToken */);
|
|
36067
36118
|
const pos = getNodePos();
|
|
@@ -37898,7 +37949,7 @@ var commandOptionsWithoutBuild = [
|
|
|
37898
37949
|
{
|
|
37899
37950
|
name: "allowImportingTsExtensions",
|
|
37900
37951
|
type: "boolean",
|
|
37901
|
-
|
|
37952
|
+
affectsSemanticDiagnostics: true,
|
|
37902
37953
|
category: Diagnostics.Modules,
|
|
37903
37954
|
description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
|
|
37904
37955
|
defaultValueDescription: false
|
|
@@ -39685,7 +39736,7 @@ function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
|
|
|
39685
39736
|
const watchOptions = convertWatchOptionsFromJsonWorker(json.watchOptions, basePath, errors);
|
|
39686
39737
|
json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
|
|
39687
39738
|
let extendedConfigPath;
|
|
39688
|
-
if (json.extends) {
|
|
39739
|
+
if (json.extends || json.extends === "") {
|
|
39689
39740
|
if (!isCompilerOptionsValue(extendsOptionDeclaration, json.extends)) {
|
|
39690
39741
|
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", getCompilerOptionValueTypeString(extendsOptionDeclaration)));
|
|
39691
39742
|
} else {
|
|
@@ -39812,7 +39863,11 @@ function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiag
|
|
|
39812
39863
|
if (resolved.resolvedModule) {
|
|
39813
39864
|
return resolved.resolvedModule.resolvedFileName;
|
|
39814
39865
|
}
|
|
39815
|
-
|
|
39866
|
+
if (extendedConfig === "") {
|
|
39867
|
+
errors.push(createDiagnostic(Diagnostics.Compiler_option_0_cannot_be_given_an_empty_string, "extends"));
|
|
39868
|
+
} else {
|
|
39869
|
+
errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig));
|
|
39870
|
+
}
|
|
39816
39871
|
return void 0;
|
|
39817
39872
|
}
|
|
39818
39873
|
function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result) {
|
|
@@ -42677,7 +42732,7 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
42677
42732
|
}
|
|
42678
42733
|
}
|
|
42679
42734
|
function shouldAllowImportingTsExtension(compilerOptions, fromFileName) {
|
|
42680
|
-
return
|
|
42735
|
+
return !!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName);
|
|
42681
42736
|
}
|
|
42682
42737
|
function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) {
|
|
42683
42738
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
@@ -43552,13 +43607,12 @@ function createBinder() {
|
|
|
43552
43607
|
} else if (node.kind === 221 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
|
|
43553
43608
|
node = node.operand;
|
|
43554
43609
|
} else {
|
|
43555
|
-
return
|
|
43610
|
+
return isLogicalOrCoalescingBinaryExpression(node);
|
|
43556
43611
|
}
|
|
43557
43612
|
}
|
|
43558
43613
|
}
|
|
43559
43614
|
function isLogicalAssignmentExpression(node) {
|
|
43560
|
-
|
|
43561
|
-
return isBinaryExpression(node) && isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind);
|
|
43615
|
+
return isLogicalOrCoalescingAssignmentExpression(skipParentheses(node));
|
|
43562
43616
|
}
|
|
43563
43617
|
function isTopLevelLogicalExpression(node) {
|
|
43564
43618
|
while (isParenthesizedExpression(node.parent) || isPrefixUnaryExpression(node.parent) && node.parent.operator === 53 /* ExclamationToken */) {
|
|
@@ -43941,7 +43995,7 @@ function createBinder() {
|
|
|
43941
43995
|
};
|
|
43942
43996
|
}
|
|
43943
43997
|
const operator = node.operatorToken.kind;
|
|
43944
|
-
if (operator
|
|
43998
|
+
if (isLogicalOrCoalescingBinaryOperator(operator) || isLogicalOrCoalescingAssignmentOperator(operator)) {
|
|
43945
43999
|
if (isTopLevelLogicalExpression(node)) {
|
|
43946
44000
|
const postExpressionLabel = createBranchLabel();
|
|
43947
44001
|
bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel);
|
|
@@ -54756,6 +54810,9 @@ function createTypeChecker(host) {
|
|
|
54756
54810
|
const isProperty = isPropertyDeclaration(declaration) && !hasAccessorModifier(declaration) || isPropertySignature(declaration) || isJSDocPropertyTag(declaration);
|
|
54757
54811
|
const isOptional = includeOptionality && isOptionalDeclaration(declaration);
|
|
54758
54812
|
const declaredType = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
54813
|
+
if (!declaredType && isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
|
|
54814
|
+
return useUnknownInCatchVariables ? unknownType : anyType;
|
|
54815
|
+
}
|
|
54759
54816
|
if (declaredType) {
|
|
54760
54817
|
return addOptionality(declaredType, isProperty, isOptional);
|
|
54761
54818
|
}
|
|
@@ -55334,14 +55391,6 @@ function createTypeChecker(host) {
|
|
|
55334
55391
|
}
|
|
55335
55392
|
Debug.assertIsDefined(symbol.valueDeclaration);
|
|
55336
55393
|
const declaration = symbol.valueDeclaration;
|
|
55337
|
-
if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
|
|
55338
|
-
const typeNode = getEffectiveTypeAnnotationNode(declaration);
|
|
55339
|
-
if (typeNode === void 0) {
|
|
55340
|
-
return useUnknownInCatchVariables ? unknownType : anyType;
|
|
55341
|
-
}
|
|
55342
|
-
const type2 = getTypeOfNode(typeNode);
|
|
55343
|
-
return isTypeAny(type2) || type2 === unknownType ? type2 : errorType;
|
|
55344
|
-
}
|
|
55345
55394
|
if (isSourceFile(declaration) && isJsonSourceFile(declaration)) {
|
|
55346
55395
|
if (!declaration.statements.length) {
|
|
55347
55396
|
return emptyObjectType;
|
|
@@ -69141,7 +69190,7 @@ function createTypeChecker(host) {
|
|
|
69141
69190
|
return getNonMissingTypeOfSymbol(symbol);
|
|
69142
69191
|
}
|
|
69143
69192
|
function getControlFlowContainer(node) {
|
|
69144
|
-
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */);
|
|
69193
|
+
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 295 /* CatchClause */ || node2.kind === 169 /* PropertyDeclaration */);
|
|
69145
69194
|
}
|
|
69146
69195
|
function isSymbolAssigned(symbol) {
|
|
69147
69196
|
if (!symbol.valueDeclaration) {
|
|
@@ -69399,13 +69448,14 @@ function createTypeChecker(host) {
|
|
|
69399
69448
|
const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */;
|
|
69400
69449
|
const declarationContainer = getControlFlowContainer(declaration);
|
|
69401
69450
|
let flowContainer = getControlFlowContainer(node);
|
|
69451
|
+
const isCatch = flowContainer.kind === 295 /* CatchClause */;
|
|
69402
69452
|
const isOuterVariable = flowContainer !== declarationContainer;
|
|
69403
69453
|
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
|
|
69404
69454
|
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
|
|
69405
69455
|
while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
|
|
69406
69456
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
69407
69457
|
}
|
|
69408
|
-
const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
|
|
69458
|
+
const assumeInitialized = isParameter2 || isCatch || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
|
|
69409
69459
|
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
|
|
69410
69460
|
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
|
|
69411
69461
|
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
|
|
@@ -69930,7 +69980,7 @@ function createTypeChecker(host) {
|
|
|
69930
69980
|
}
|
|
69931
69981
|
}
|
|
69932
69982
|
function getContextualTypeForVariableLikeDeclaration(declaration, contextFlags) {
|
|
69933
|
-
const typeNode = getEffectiveTypeAnnotationNode(declaration);
|
|
69983
|
+
const typeNode = getEffectiveTypeAnnotationNode(declaration) || (isInJSFile(declaration) ? tryGetJSDocSatisfiesTypeNode(declaration) : void 0);
|
|
69934
69984
|
if (typeNode) {
|
|
69935
69985
|
return getTypeFromTypeNode(typeNode);
|
|
69936
69986
|
}
|
|
@@ -70539,8 +70589,16 @@ function createTypeChecker(host) {
|
|
|
70539
70589
|
Debug.assert(parent2.parent.kind === 225 /* TemplateExpression */);
|
|
70540
70590
|
return getContextualTypeForSubstitutionExpression(parent2.parent, node);
|
|
70541
70591
|
case 214 /* ParenthesizedExpression */: {
|
|
70542
|
-
|
|
70543
|
-
|
|
70592
|
+
if (isInJSFile(parent2)) {
|
|
70593
|
+
if (isJSDocSatisfiesExpression(parent2)) {
|
|
70594
|
+
return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent2));
|
|
70595
|
+
}
|
|
70596
|
+
const typeTag = getJSDocTypeTag(parent2);
|
|
70597
|
+
if (typeTag && !isConstTypeReference(typeTag.typeExpression.type)) {
|
|
70598
|
+
return getTypeFromTypeNode(typeTag.typeExpression.type);
|
|
70599
|
+
}
|
|
70600
|
+
}
|
|
70601
|
+
return getContextualType2(parent2, contextFlags);
|
|
70544
70602
|
}
|
|
70545
70603
|
case 232 /* NonNullExpression */:
|
|
70546
70604
|
return getContextualType2(parent2, contextFlags);
|
|
@@ -74744,12 +74802,15 @@ function createTypeChecker(host) {
|
|
|
74744
74802
|
}
|
|
74745
74803
|
function checkSatisfiesExpression(node) {
|
|
74746
74804
|
checkSourceElement(node.type);
|
|
74747
|
-
|
|
74748
|
-
|
|
74805
|
+
return checkSatisfiesExpressionWorker(node.expression, node.type);
|
|
74806
|
+
}
|
|
74807
|
+
function checkSatisfiesExpressionWorker(expression, target, checkMode) {
|
|
74808
|
+
const exprType = checkExpression(expression, checkMode);
|
|
74809
|
+
const targetType = getTypeFromTypeNode(target);
|
|
74749
74810
|
if (isErrorType(targetType)) {
|
|
74750
74811
|
return targetType;
|
|
74751
74812
|
}
|
|
74752
|
-
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType,
|
|
74813
|
+
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, target, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
74753
74814
|
return exprType;
|
|
74754
74815
|
}
|
|
74755
74816
|
function checkMetaProperty(node) {
|
|
@@ -76156,12 +76217,12 @@ function createTypeChecker(host) {
|
|
|
76156
76217
|
void 0
|
|
76157
76218
|
);
|
|
76158
76219
|
const operator = operatorToken.kind;
|
|
76159
|
-
if (operator
|
|
76160
|
-
|
|
76161
|
-
|
|
76162
|
-
|
|
76163
|
-
|
|
76164
|
-
|
|
76220
|
+
if (isLogicalOrCoalescingBinaryOperator(operator)) {
|
|
76221
|
+
let parent2 = node.parent;
|
|
76222
|
+
while (parent2.kind === 214 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent2)) {
|
|
76223
|
+
parent2 = parent2.parent;
|
|
76224
|
+
}
|
|
76225
|
+
if (operator === 55 /* AmpersandAmpersandToken */ || isIfStatement(parent2)) {
|
|
76165
76226
|
checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, isIfStatement(parent2) ? parent2.thenStatement : void 0);
|
|
76166
76227
|
}
|
|
76167
76228
|
checkTruthinessOfType(leftType, node.left);
|
|
@@ -76238,7 +76299,7 @@ function createTypeChecker(host) {
|
|
|
76238
76299
|
return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 108 /* ThisKeyword */);
|
|
76239
76300
|
}
|
|
76240
76301
|
let leftType;
|
|
76241
|
-
if (operator
|
|
76302
|
+
if (isLogicalOrCoalescingBinaryOperator(operator)) {
|
|
76242
76303
|
leftType = checkTruthinessExpression(left, checkMode);
|
|
76243
76304
|
} else {
|
|
76244
76305
|
leftType = checkExpression(left, checkMode);
|
|
@@ -76781,6 +76842,12 @@ function createTypeChecker(host) {
|
|
|
76781
76842
|
}
|
|
76782
76843
|
function checkDeclarationInitializer(declaration, checkMode, contextualType) {
|
|
76783
76844
|
const initializer = getEffectiveInitializer(declaration);
|
|
76845
|
+
if (isInJSFile(declaration)) {
|
|
76846
|
+
const typeNode = tryGetJSDocSatisfiesTypeNode(declaration);
|
|
76847
|
+
if (typeNode) {
|
|
76848
|
+
return checkSatisfiesExpressionWorker(initializer, typeNode, checkMode);
|
|
76849
|
+
}
|
|
76850
|
+
}
|
|
76784
76851
|
const type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(
|
|
76785
76852
|
initializer,
|
|
76786
76853
|
contextualType,
|
|
@@ -77108,9 +77175,14 @@ function createTypeChecker(host) {
|
|
|
77108
77175
|
}
|
|
77109
77176
|
}
|
|
77110
77177
|
function checkParenthesizedExpression(node, checkMode) {
|
|
77111
|
-
if (hasJSDocNodes(node)
|
|
77112
|
-
|
|
77113
|
-
|
|
77178
|
+
if (hasJSDocNodes(node)) {
|
|
77179
|
+
if (isJSDocSatisfiesExpression(node)) {
|
|
77180
|
+
return checkSatisfiesExpressionWorker(node.expression, getJSDocSatisfiesExpressionType(node), checkMode);
|
|
77181
|
+
}
|
|
77182
|
+
if (isJSDocTypeAssertion(node)) {
|
|
77183
|
+
const type = getJSDocTypeAssertionType(node);
|
|
77184
|
+
return checkAssertionWorker(type, type, node.expression, checkMode);
|
|
77185
|
+
}
|
|
77114
77186
|
}
|
|
77115
77187
|
return checkExpression(node.expression, checkMode);
|
|
77116
77188
|
}
|
|
@@ -78812,6 +78884,19 @@ function createTypeChecker(host) {
|
|
|
78812
78884
|
function checkJSDocTypeTag(node) {
|
|
78813
78885
|
checkSourceElement(node.typeExpression);
|
|
78814
78886
|
}
|
|
78887
|
+
function checkJSDocSatisfiesTag(node) {
|
|
78888
|
+
checkSourceElement(node.typeExpression);
|
|
78889
|
+
const host2 = getEffectiveJSDocHost(node);
|
|
78890
|
+
if (host2) {
|
|
78891
|
+
const tags = getAllJSDocTags(host2, isJSDocSatisfiesTag);
|
|
78892
|
+
if (length(tags) > 1) {
|
|
78893
|
+
for (let i = 1; i < length(tags); i++) {
|
|
78894
|
+
const tagName = tags[i].tagName;
|
|
78895
|
+
error(tagName, Diagnostics._0_tag_already_specified, idText(tagName));
|
|
78896
|
+
}
|
|
78897
|
+
}
|
|
78898
|
+
}
|
|
78899
|
+
}
|
|
78815
78900
|
function checkJSDocLinkLikeTag(node) {
|
|
78816
78901
|
if (node.name) {
|
|
78817
78902
|
resolveJSDocMemberName(
|
|
@@ -79597,15 +79682,24 @@ function createTypeChecker(host) {
|
|
|
79597
79682
|
function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, condType, body) {
|
|
79598
79683
|
if (!strictNullChecks)
|
|
79599
79684
|
return;
|
|
79600
|
-
|
|
79601
|
-
|
|
79602
|
-
|
|
79603
|
-
helper(
|
|
79685
|
+
bothHelper(condExpr, body);
|
|
79686
|
+
function bothHelper(condExpr2, body2) {
|
|
79687
|
+
condExpr2 = skipParentheses(condExpr2);
|
|
79688
|
+
helper(condExpr2, body2);
|
|
79689
|
+
while (isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 56 /* BarBarToken */ || condExpr2.operatorToken.kind === 60 /* QuestionQuestionToken */)) {
|
|
79690
|
+
condExpr2 = skipParentheses(condExpr2.left);
|
|
79691
|
+
helper(condExpr2, body2);
|
|
79692
|
+
}
|
|
79604
79693
|
}
|
|
79605
79694
|
function helper(condExpr2, body2) {
|
|
79606
|
-
const location =
|
|
79607
|
-
if (isModuleExportsAccessExpression(location))
|
|
79695
|
+
const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) : condExpr2;
|
|
79696
|
+
if (isModuleExportsAccessExpression(location)) {
|
|
79608
79697
|
return;
|
|
79698
|
+
}
|
|
79699
|
+
if (isLogicalOrCoalescingBinaryExpression(location)) {
|
|
79700
|
+
bothHelper(location, body2);
|
|
79701
|
+
return;
|
|
79702
|
+
}
|
|
79609
79703
|
const type = location === condExpr2 ? condType : checkTruthinessExpression(location);
|
|
79610
79704
|
const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion3(location.expression);
|
|
79611
79705
|
if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast)
|
|
@@ -79615,7 +79709,7 @@ function createTypeChecker(host) {
|
|
|
79615
79709
|
if (callSignatures.length === 0 && !isPromise) {
|
|
79616
79710
|
return;
|
|
79617
79711
|
}
|
|
79618
|
-
const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name :
|
|
79712
|
+
const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : void 0;
|
|
79619
79713
|
const testedSymbol = testedNode && getSymbolAtLocation(testedNode);
|
|
79620
79714
|
if (!testedSymbol && !isPromise) {
|
|
79621
79715
|
return;
|
|
@@ -80573,18 +80667,8 @@ function createTypeChecker(host) {
|
|
|
80573
80667
|
if (catchClause) {
|
|
80574
80668
|
if (catchClause.variableDeclaration) {
|
|
80575
80669
|
const declaration = catchClause.variableDeclaration;
|
|
80576
|
-
|
|
80577
|
-
if (
|
|
80578
|
-
const type = getTypeForVariableLikeDeclaration(
|
|
80579
|
-
declaration,
|
|
80580
|
-
/*includeOptionality*/
|
|
80581
|
-
false,
|
|
80582
|
-
0 /* Normal */
|
|
80583
|
-
);
|
|
80584
|
-
if (type && !(type.flags & 3 /* AnyOrUnknown */)) {
|
|
80585
|
-
grammarErrorOnFirstToken(typeNode, Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);
|
|
80586
|
-
}
|
|
80587
|
-
} else if (declaration.initializer) {
|
|
80670
|
+
checkVariableLikeDeclaration(declaration);
|
|
80671
|
+
if (declaration.initializer) {
|
|
80588
80672
|
grammarErrorOnFirstToken(declaration.initializer, Diagnostics.Catch_clause_variable_cannot_have_an_initializer);
|
|
80589
80673
|
} else {
|
|
80590
80674
|
const blockLocals = catchClause.block.locals;
|
|
@@ -82416,6 +82500,8 @@ function createTypeChecker(host) {
|
|
|
82416
82500
|
case 338 /* JSDocProtectedTag */:
|
|
82417
82501
|
case 337 /* JSDocPrivateTag */:
|
|
82418
82502
|
return checkJSDocAccessibilityModifiers(node);
|
|
82503
|
+
case 353 /* JSDocSatisfiesTag */:
|
|
82504
|
+
return checkJSDocSatisfiesTag(node);
|
|
82419
82505
|
case 196 /* IndexedAccessType */:
|
|
82420
82506
|
return checkIndexedAccessType(node);
|
|
82421
82507
|
case 197 /* MappedType */:
|
|
@@ -87232,13 +87318,13 @@ var visitEachChildTable = {
|
|
|
87232
87318
|
);
|
|
87233
87319
|
},
|
|
87234
87320
|
// Transformation nodes
|
|
87235
|
-
[
|
|
87321
|
+
[356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
87236
87322
|
return context.factory.updatePartiallyEmittedExpression(
|
|
87237
87323
|
node,
|
|
87238
87324
|
Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
|
|
87239
87325
|
);
|
|
87240
87326
|
},
|
|
87241
|
-
[
|
|
87327
|
+
[357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
87242
87328
|
return context.factory.updateCommaListExpression(
|
|
87243
87329
|
node,
|
|
87244
87330
|
nodesVisitor(node.elements, visitor, isExpression)
|
|
@@ -94015,7 +94101,7 @@ function transformES2018(context) {
|
|
|
94015
94101
|
return visitObjectLiteralExpression(node);
|
|
94016
94102
|
case 223 /* BinaryExpression */:
|
|
94017
94103
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
94018
|
-
case
|
|
94104
|
+
case 357 /* CommaListExpression */:
|
|
94019
94105
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
94020
94106
|
case 295 /* CatchClause */:
|
|
94021
94107
|
return visitCatchClause(node);
|
|
@@ -95447,15 +95533,10 @@ function transformES2021(context) {
|
|
|
95447
95533
|
if ((node.transformFlags & 16 /* ContainsES2021 */) === 0) {
|
|
95448
95534
|
return node;
|
|
95449
95535
|
}
|
|
95450
|
-
|
|
95451
|
-
|
|
95452
|
-
const binaryExpression = node;
|
|
95453
|
-
if (isLogicalOrCoalescingAssignmentExpression(binaryExpression)) {
|
|
95454
|
-
return transformLogicalAssignment(binaryExpression);
|
|
95455
|
-
}
|
|
95456
|
-
default:
|
|
95457
|
-
return visitEachChild(node, visitor, context);
|
|
95536
|
+
if (isLogicalOrCoalescingAssignmentExpression(node)) {
|
|
95537
|
+
return transformLogicalAssignment(node);
|
|
95458
95538
|
}
|
|
95539
|
+
return visitEachChild(node, visitor, context);
|
|
95459
95540
|
}
|
|
95460
95541
|
function transformLogicalAssignment(binaryExpression) {
|
|
95461
95542
|
const operator = binaryExpression.operatorToken;
|
|
@@ -96593,7 +96674,7 @@ function transformES2015(context) {
|
|
|
96593
96674
|
return visitParenthesizedExpression(node, expressionResultIsUnused2);
|
|
96594
96675
|
case 223 /* BinaryExpression */:
|
|
96595
96676
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
96596
|
-
case
|
|
96677
|
+
case 357 /* CommaListExpression */:
|
|
96597
96678
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
96598
96679
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
96599
96680
|
case 15 /* TemplateHead */:
|
|
@@ -99754,7 +99835,7 @@ function transformGenerators(context) {
|
|
|
99754
99835
|
switch (node.kind) {
|
|
99755
99836
|
case 223 /* BinaryExpression */:
|
|
99756
99837
|
return visitBinaryExpression(node);
|
|
99757
|
-
case
|
|
99838
|
+
case 357 /* CommaListExpression */:
|
|
99758
99839
|
return visitCommaListExpression(node);
|
|
99759
99840
|
case 224 /* ConditionalExpression */:
|
|
99760
99841
|
return visitConditionalExpression(node);
|
|
@@ -102093,9 +102174,9 @@ function transformModule(context) {
|
|
|
102093
102174
|
return visitFunctionDeclaration(node);
|
|
102094
102175
|
case 260 /* ClassDeclaration */:
|
|
102095
102176
|
return visitClassDeclaration(node);
|
|
102096
|
-
case
|
|
102177
|
+
case 358 /* MergeDeclarationMarker */:
|
|
102097
102178
|
return visitMergeDeclarationMarker(node);
|
|
102098
|
-
case
|
|
102179
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
102099
102180
|
return visitEndOfDeclarationMarker(node);
|
|
102100
102181
|
default:
|
|
102101
102182
|
return visitor(node);
|
|
@@ -102112,7 +102193,7 @@ function transformModule(context) {
|
|
|
102112
102193
|
return visitExpressionStatement(node);
|
|
102113
102194
|
case 214 /* ParenthesizedExpression */:
|
|
102114
102195
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
102115
|
-
case
|
|
102196
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
102116
102197
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
102117
102198
|
case 210 /* CallExpression */:
|
|
102118
102199
|
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
|
|
@@ -104227,9 +104308,9 @@ function transformSystemModule(context) {
|
|
|
104227
104308
|
return visitCatchClause(node);
|
|
104228
104309
|
case 238 /* Block */:
|
|
104229
104310
|
return visitBlock(node);
|
|
104230
|
-
case
|
|
104311
|
+
case 358 /* MergeDeclarationMarker */:
|
|
104231
104312
|
return visitMergeDeclarationMarker(node);
|
|
104232
|
-
case
|
|
104313
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
104233
104314
|
return visitEndOfDeclarationMarker(node);
|
|
104234
104315
|
default:
|
|
104235
104316
|
return visitor(node);
|
|
@@ -104385,7 +104466,7 @@ function transformSystemModule(context) {
|
|
|
104385
104466
|
return visitExpressionStatement(node);
|
|
104386
104467
|
case 214 /* ParenthesizedExpression */:
|
|
104387
104468
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
104388
|
-
case
|
|
104469
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
104389
104470
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
104390
104471
|
case 223 /* BinaryExpression */:
|
|
104391
104472
|
if (isDestructuringAssignment(node)) {
|
|
@@ -107076,7 +107157,7 @@ function noEmitNotification(hint, node, callback) {
|
|
|
107076
107157
|
}
|
|
107077
107158
|
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
|
|
107078
107159
|
var _a2, _b;
|
|
107079
|
-
const enabledSyntaxKindFeatures = new Array(
|
|
107160
|
+
const enabledSyntaxKindFeatures = new Array(361 /* Count */);
|
|
107080
107161
|
let lexicalEnvironmentVariableDeclarations;
|
|
107081
107162
|
let lexicalEnvironmentFunctionDeclarations;
|
|
107082
107163
|
let lexicalEnvironmentStatements;
|
|
@@ -108961,6 +109042,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
108961
109042
|
case 346 /* JSDocThisTag */:
|
|
108962
109043
|
case 347 /* JSDocTypeTag */:
|
|
108963
109044
|
case 352 /* JSDocThrowsTag */:
|
|
109045
|
+
case 353 /* JSDocSatisfiesTag */:
|
|
108964
109046
|
return emitJSDocSimpleTypedTag(node);
|
|
108965
109047
|
case 348 /* JSDocTemplateTag */:
|
|
108966
109048
|
return emitJSDocTemplateTag(node);
|
|
@@ -108968,9 +109050,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
108968
109050
|
return emitJSDocTypedefTag(node);
|
|
108969
109051
|
case 350 /* JSDocSeeTag */:
|
|
108970
109052
|
return emitJSDocSeeTag(node);
|
|
108971
|
-
case
|
|
108972
|
-
case
|
|
108973
|
-
case
|
|
109053
|
+
case 355 /* NotEmittedStatement */:
|
|
109054
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
109055
|
+
case 358 /* MergeDeclarationMarker */:
|
|
108974
109056
|
return;
|
|
108975
109057
|
}
|
|
108976
109058
|
if (isExpression(node)) {
|
|
@@ -109069,18 +109151,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
109069
109151
|
return emitJsxSelfClosingElement(node);
|
|
109070
109152
|
case 285 /* JsxFragment */:
|
|
109071
109153
|
return emitJsxFragment(node);
|
|
109072
|
-
case
|
|
109154
|
+
case 354 /* SyntaxList */:
|
|
109073
109155
|
return Debug.fail("SyntaxList should not be printed");
|
|
109074
|
-
case
|
|
109156
|
+
case 355 /* NotEmittedStatement */:
|
|
109075
109157
|
return;
|
|
109076
|
-
case
|
|
109158
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
109077
109159
|
return emitPartiallyEmittedExpression(node);
|
|
109078
|
-
case
|
|
109160
|
+
case 357 /* CommaListExpression */:
|
|
109079
109161
|
return emitCommaList(node);
|
|
109080
|
-
case
|
|
109081
|
-
case
|
|
109162
|
+
case 358 /* MergeDeclarationMarker */:
|
|
109163
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
109082
109164
|
return;
|
|
109083
|
-
case
|
|
109165
|
+
case 360 /* SyntheticReferenceExpression */:
|
|
109084
109166
|
return Debug.fail("SyntheticReferenceExpression should not be printed");
|
|
109085
109167
|
}
|
|
109086
109168
|
}
|
|
@@ -112328,7 +112410,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112328
112410
|
emitLeadingComments(
|
|
112329
112411
|
pos,
|
|
112330
112412
|
/*isEmittedNode*/
|
|
112331
|
-
node.kind !==
|
|
112413
|
+
node.kind !== 355 /* NotEmittedStatement */
|
|
112332
112414
|
);
|
|
112333
112415
|
}
|
|
112334
112416
|
if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
|
|
@@ -112352,7 +112434,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112352
112434
|
containerPos = savedContainerPos;
|
|
112353
112435
|
containerEnd = savedContainerEnd;
|
|
112354
112436
|
declarationListContainerEnd = savedDeclarationListContainerEnd;
|
|
112355
|
-
if (!skipTrailingComments && node.kind !==
|
|
112437
|
+
if (!skipTrailingComments && node.kind !== 355 /* NotEmittedStatement */) {
|
|
112356
112438
|
emitTrailingComments(end);
|
|
112357
112439
|
}
|
|
112358
112440
|
}
|
|
@@ -112624,7 +112706,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112624
112706
|
}
|
|
112625
112707
|
} else {
|
|
112626
112708
|
const source = sourceMapRange.source || sourceMapSource;
|
|
112627
|
-
if (node.kind !==
|
|
112709
|
+
if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
|
|
112628
112710
|
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
|
|
112629
112711
|
}
|
|
112630
112712
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
@@ -112639,7 +112721,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112639
112721
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
112640
112722
|
sourceMapsDisabled = false;
|
|
112641
112723
|
}
|
|
112642
|
-
if (node.kind !==
|
|
112724
|
+
if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
|
|
112643
112725
|
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
|
|
112644
112726
|
}
|
|
112645
112727
|
}
|
|
@@ -116380,7 +116462,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116380
116462
|
createOptionValueDiagnostic("importsNotUsedAsValues", Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later);
|
|
116381
116463
|
}
|
|
116382
116464
|
if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly)) {
|
|
116383
|
-
createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.
|
|
116465
|
+
createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set);
|
|
116384
116466
|
}
|
|
116385
116467
|
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
116386
116468
|
if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
@@ -124339,6 +124421,8 @@ __export(ts_exports3, {
|
|
|
124339
124421
|
getJSDocReturnTag: () => getJSDocReturnTag,
|
|
124340
124422
|
getJSDocReturnType: () => getJSDocReturnType,
|
|
124341
124423
|
getJSDocRoot: () => getJSDocRoot,
|
|
124424
|
+
getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType,
|
|
124425
|
+
getJSDocSatisfiesTag: () => getJSDocSatisfiesTag,
|
|
124342
124426
|
getJSDocTags: () => getJSDocTags,
|
|
124343
124427
|
getJSDocTagsNoCache: () => getJSDocTagsNoCache,
|
|
124344
124428
|
getJSDocTemplateTag: () => getJSDocTemplateTag,
|
|
@@ -124968,6 +125052,8 @@ __export(ts_exports3, {
|
|
|
124968
125052
|
isJSDocPublicTag: () => isJSDocPublicTag,
|
|
124969
125053
|
isJSDocReadonlyTag: () => isJSDocReadonlyTag,
|
|
124970
125054
|
isJSDocReturnTag: () => isJSDocReturnTag,
|
|
125055
|
+
isJSDocSatisfiesExpression: () => isJSDocSatisfiesExpression,
|
|
125056
|
+
isJSDocSatisfiesTag: () => isJSDocSatisfiesTag,
|
|
124971
125057
|
isJSDocSeeTag: () => isJSDocSeeTag,
|
|
124972
125058
|
isJSDocSignature: () => isJSDocSignature,
|
|
124973
125059
|
isJSDocTag: () => isJSDocTag,
|
|
@@ -125029,6 +125115,8 @@ __export(ts_exports3, {
|
|
|
125029
125115
|
isLogicalOperator: () => isLogicalOperator,
|
|
125030
125116
|
isLogicalOrCoalescingAssignmentExpression: () => isLogicalOrCoalescingAssignmentExpression,
|
|
125031
125117
|
isLogicalOrCoalescingAssignmentOperator: () => isLogicalOrCoalescingAssignmentOperator,
|
|
125118
|
+
isLogicalOrCoalescingBinaryExpression: () => isLogicalOrCoalescingBinaryExpression,
|
|
125119
|
+
isLogicalOrCoalescingBinaryOperator: () => isLogicalOrCoalescingBinaryOperator,
|
|
125032
125120
|
isMappedTypeNode: () => isMappedTypeNode,
|
|
125033
125121
|
isMemberName: () => isMemberName,
|
|
125034
125122
|
isMergeDeclarationMarker: () => isMergeDeclarationMarker,
|
|
@@ -125714,6 +125802,7 @@ __export(ts_exports3, {
|
|
|
125714
125802
|
tryGetDirectories: () => tryGetDirectories,
|
|
125715
125803
|
tryGetExtensionFromPath: () => tryGetExtensionFromPath2,
|
|
125716
125804
|
tryGetImportFromModuleSpecifier: () => tryGetImportFromModuleSpecifier,
|
|
125805
|
+
tryGetJSDocSatisfiesTypeNode: () => tryGetJSDocSatisfiesTypeNode,
|
|
125717
125806
|
tryGetModuleNameFromFile: () => tryGetModuleNameFromFile,
|
|
125718
125807
|
tryGetModuleSpecifierFromDeclaration: () => tryGetModuleSpecifierFromDeclaration,
|
|
125719
125808
|
tryGetNativePerformanceHooks: () => tryGetNativePerformanceHooks,
|
|
@@ -133064,7 +133153,7 @@ var NodeObject = class {
|
|
|
133064
133153
|
if (!children.length) {
|
|
133065
133154
|
return void 0;
|
|
133066
133155
|
}
|
|
133067
|
-
const child = find(children, (kid) => kid.kind < 312 /* FirstJSDocNode */ || kid.kind >
|
|
133156
|
+
const child = find(children, (kid) => kid.kind < 312 /* FirstJSDocNode */ || kid.kind > 353 /* LastJSDocNode */);
|
|
133068
133157
|
return child.kind < 163 /* FirstNode */ ? child : child.getFirstToken(sourceFile);
|
|
133069
133158
|
}
|
|
133070
133159
|
getLastToken(sourceFile) {
|
|
@@ -133131,7 +133220,7 @@ function addSyntheticNodes(nodes, pos, end, parent2) {
|
|
|
133131
133220
|
}
|
|
133132
133221
|
}
|
|
133133
133222
|
function createSyntaxList(nodes, parent2) {
|
|
133134
|
-
const list = createNode(
|
|
133223
|
+
const list = createNode(354 /* SyntaxList */, nodes.pos, nodes.end, parent2);
|
|
133135
133224
|
list._children = [];
|
|
133136
133225
|
let pos = nodes.pos;
|
|
133137
133226
|
for (const node of nodes) {
|
|
@@ -147387,10 +147476,10 @@ function getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, options,
|
|
|
147387
147476
|
} else if (!tracker.hasValue(type.value)) {
|
|
147388
147477
|
switch (typeof type.value) {
|
|
147389
147478
|
case "object":
|
|
147390
|
-
elements.push(factory.createBigIntLiteral(type.value));
|
|
147479
|
+
elements.push(type.value.negative ? factory.createPrefixUnaryExpression(40 /* MinusToken */, factory.createBigIntLiteral({ negative: false, base10Value: type.value.base10Value })) : factory.createBigIntLiteral(type.value));
|
|
147391
147480
|
break;
|
|
147392
147481
|
case "number":
|
|
147393
|
-
elements.push(factory.createNumericLiteral(type.value));
|
|
147482
|
+
elements.push(type.value < 0 ? factory.createPrefixUnaryExpression(40 /* MinusToken */, factory.createNumericLiteral(-type.value)) : factory.createNumericLiteral(type.value));
|
|
147394
147483
|
break;
|
|
147395
147484
|
case "string":
|
|
147396
147485
|
elements.push(factory.createStringLiteral(type.value, quotePreference === 0 /* Single */));
|
|
@@ -148827,6 +148916,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
148827
148916
|
case 347 /* JSDocTypeTag */:
|
|
148828
148917
|
case 349 /* JSDocTypedefTag */:
|
|
148829
148918
|
case 352 /* JSDocThrowsTag */:
|
|
148919
|
+
case 353 /* JSDocSatisfiesTag */:
|
|
148830
148920
|
return true;
|
|
148831
148921
|
case 348 /* JSDocTemplateTag */:
|
|
148832
148922
|
return !!tag.constraint;
|
|
@@ -150087,7 +150177,7 @@ function getPropertiesForCompletion(type, checker) {
|
|
|
150087
150177
|
function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) {
|
|
150088
150178
|
var _a2;
|
|
150089
150179
|
switch (location.kind) {
|
|
150090
|
-
case
|
|
150180
|
+
case 354 /* SyntaxList */:
|
|
150091
150181
|
return tryCast(location.parent, isObjectTypeDeclaration);
|
|
150092
150182
|
case 1 /* EndOfFileToken */:
|
|
150093
150183
|
const cls = tryCast(lastOrUndefined(cast(location.parent, isSourceFile).statements), isObjectTypeDeclaration);
|
|
@@ -151093,7 +151183,7 @@ function removeLeadingDirectorySeparator(path) {
|
|
|
151093
151183
|
}
|
|
151094
151184
|
function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) {
|
|
151095
151185
|
const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name));
|
|
151096
|
-
const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment));
|
|
151186
|
+
const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && moduleName.indexOf("*") < 0);
|
|
151097
151187
|
if (fragmentDirectory !== void 0) {
|
|
151098
151188
|
const moduleNameWithSeparator = ensureTrailingDirectorySeparator(fragmentDirectory);
|
|
151099
151189
|
return nonRelativeModuleNames.map((nonRelativeModuleName) => removePrefix(nonRelativeModuleName, moduleNameWithSeparator));
|
|
@@ -154506,6 +154596,7 @@ var jsDocTagNames = [
|
|
|
154506
154596
|
"readonly",
|
|
154507
154597
|
"requires",
|
|
154508
154598
|
"returns",
|
|
154599
|
+
"satisfies",
|
|
154509
154600
|
"see",
|
|
154510
154601
|
"since",
|
|
154511
154602
|
"static",
|
|
@@ -154615,6 +154706,7 @@ function getCommentDisplayParts(tag, checker) {
|
|
|
154615
154706
|
}
|
|
154616
154707
|
return displayParts;
|
|
154617
154708
|
case 347 /* JSDocTypeTag */:
|
|
154709
|
+
case 353 /* JSDocSatisfiesTag */:
|
|
154618
154710
|
return withNode(tag.typeExpression);
|
|
154619
154711
|
case 349 /* JSDocTypedefTag */:
|
|
154620
154712
|
case 341 /* JSDocCallbackTag */:
|
|
@@ -179991,6 +180083,8 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
179991
180083
|
getJSDocReturnTag,
|
|
179992
180084
|
getJSDocReturnType,
|
|
179993
180085
|
getJSDocRoot,
|
|
180086
|
+
getJSDocSatisfiesExpressionType,
|
|
180087
|
+
getJSDocSatisfiesTag,
|
|
179994
180088
|
getJSDocTags,
|
|
179995
180089
|
getJSDocTagsNoCache,
|
|
179996
180090
|
getJSDocTemplateTag,
|
|
@@ -180620,6 +180714,8 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
180620
180714
|
isJSDocPublicTag,
|
|
180621
180715
|
isJSDocReadonlyTag,
|
|
180622
180716
|
isJSDocReturnTag,
|
|
180717
|
+
isJSDocSatisfiesExpression,
|
|
180718
|
+
isJSDocSatisfiesTag,
|
|
180623
180719
|
isJSDocSeeTag,
|
|
180624
180720
|
isJSDocSignature,
|
|
180625
180721
|
isJSDocTag,
|
|
@@ -180681,6 +180777,8 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
180681
180777
|
isLogicalOperator,
|
|
180682
180778
|
isLogicalOrCoalescingAssignmentExpression,
|
|
180683
180779
|
isLogicalOrCoalescingAssignmentOperator,
|
|
180780
|
+
isLogicalOrCoalescingBinaryExpression,
|
|
180781
|
+
isLogicalOrCoalescingBinaryOperator,
|
|
180684
180782
|
isMappedTypeNode,
|
|
180685
180783
|
isMemberName,
|
|
180686
180784
|
isMergeDeclarationMarker,
|
|
@@ -181366,6 +181464,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
181366
181464
|
tryGetDirectories,
|
|
181367
181465
|
tryGetExtensionFromPath,
|
|
181368
181466
|
tryGetImportFromModuleSpecifier,
|
|
181467
|
+
tryGetJSDocSatisfiesTypeNode,
|
|
181369
181468
|
tryGetModuleNameFromFile,
|
|
181370
181469
|
tryGetModuleSpecifierFromDeclaration,
|
|
181371
181470
|
tryGetNativePerformanceHooks,
|