@typescript-deploys/pr-build 5.0.0-pr-52240-9 → 5.0.0-pr-52280-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +198 -118
- package/lib/tsserver.js +244 -136
- package/lib/tsserverlibrary.d.ts +19 -10
- package/lib/tsserverlibrary.js +237 -136
- package/lib/typescript.d.ts +19 -10
- package/lib/typescript.js +230 -136
- package/lib/typingsInstaller.js +75 -42
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20230117`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -3445,14 +3445,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
|
|
|
3445
3445
|
SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 350] = "JSDocSeeTag";
|
|
3446
3446
|
SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 351] = "JSDocPropertyTag";
|
|
3447
3447
|
SyntaxKind4[SyntaxKind4["JSDocThrowsTag"] = 352] = "JSDocThrowsTag";
|
|
3448
|
-
SyntaxKind4[SyntaxKind4["
|
|
3449
|
-
SyntaxKind4[SyntaxKind4["
|
|
3450
|
-
SyntaxKind4[SyntaxKind4["
|
|
3451
|
-
SyntaxKind4[SyntaxKind4["
|
|
3452
|
-
SyntaxKind4[SyntaxKind4["
|
|
3453
|
-
SyntaxKind4[SyntaxKind4["
|
|
3454
|
-
SyntaxKind4[SyntaxKind4["
|
|
3455
|
-
SyntaxKind4[SyntaxKind4["
|
|
3448
|
+
SyntaxKind4[SyntaxKind4["JSDocSatisfiesTag"] = 353] = "JSDocSatisfiesTag";
|
|
3449
|
+
SyntaxKind4[SyntaxKind4["SyntaxList"] = 354] = "SyntaxList";
|
|
3450
|
+
SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 355] = "NotEmittedStatement";
|
|
3451
|
+
SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 356] = "PartiallyEmittedExpression";
|
|
3452
|
+
SyntaxKind4[SyntaxKind4["CommaListExpression"] = 357] = "CommaListExpression";
|
|
3453
|
+
SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 358] = "MergeDeclarationMarker";
|
|
3454
|
+
SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 359] = "EndOfDeclarationMarker";
|
|
3455
|
+
SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 360] = "SyntheticReferenceExpression";
|
|
3456
|
+
SyntaxKind4[SyntaxKind4["Count"] = 361] = "Count";
|
|
3456
3457
|
SyntaxKind4[SyntaxKind4["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment";
|
|
3457
3458
|
SyntaxKind4[SyntaxKind4["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment";
|
|
3458
3459
|
SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment";
|
|
@@ -3481,9 +3482,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
|
|
|
3481
3482
|
SyntaxKind4[SyntaxKind4["LastStatement"] = 256 /* DebuggerStatement */] = "LastStatement";
|
|
3482
3483
|
SyntaxKind4[SyntaxKind4["FirstNode"] = 163 /* QualifiedName */] = "FirstNode";
|
|
3483
3484
|
SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 312 /* JSDocTypeExpression */] = "FirstJSDocNode";
|
|
3484
|
-
SyntaxKind4[SyntaxKind4["LastJSDocNode"] =
|
|
3485
|
+
SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocNode";
|
|
3485
3486
|
SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 330 /* JSDocTag */] = "FirstJSDocTagNode";
|
|
3486
|
-
SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] =
|
|
3487
|
+
SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 353 /* JSDocSatisfiesTag */] = "LastJSDocTagNode";
|
|
3487
3488
|
SyntaxKind4[SyntaxKind4["FirstContextualKeyword"] = 126 /* AbstractKeyword */] = "FirstContextualKeyword";
|
|
3488
3489
|
SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 162 /* OfKeyword */] = "LastContextualKeyword";
|
|
3489
3490
|
return SyntaxKind4;
|
|
@@ -5911,7 +5912,6 @@ var Diagnostics = {
|
|
|
5911
5912
|
An_export_declaration_cannot_have_modifiers: diag(1193, 1 /* Error */, "An_export_declaration_cannot_have_modifiers_1193", "An export declaration cannot have modifiers."),
|
|
5912
5913
|
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."),
|
|
5913
5914
|
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."),
|
|
5914
|
-
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."),
|
|
5915
5915
|
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."),
|
|
5916
5916
|
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."),
|
|
5917
5917
|
Unterminated_Unicode_escape_sequence: diag(1199, 1 /* Error */, "Unterminated_Unicode_escape_sequence_1199", "Unterminated Unicode escape sequence."),
|
|
@@ -7779,7 +7779,8 @@ var Diagnostics = {
|
|
|
7779
7779
|
_0_is_possibly_null: diag(18047, 1 /* Error */, "_0_is_possibly_null_18047", "'{0}' is possibly 'null'."),
|
|
7780
7780
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
7781
7781
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
7782
|
-
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.")
|
|
7782
|
+
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."),
|
|
7783
|
+
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.")
|
|
7783
7784
|
};
|
|
7784
7785
|
|
|
7785
7786
|
// src/compiler/scanner.ts
|
|
@@ -10376,6 +10377,9 @@ function getJSDocThisTag(node) {
|
|
|
10376
10377
|
function getJSDocReturnTag(node) {
|
|
10377
10378
|
return getFirstJSDocTag(node, isJSDocReturnTag);
|
|
10378
10379
|
}
|
|
10380
|
+
function getJSDocSatisfiesTag(node) {
|
|
10381
|
+
return getFirstJSDocTag(node, isJSDocSatisfiesTag);
|
|
10382
|
+
}
|
|
10379
10383
|
function getJSDocTypeTag(node) {
|
|
10380
10384
|
const tag = getFirstJSDocTag(node, isJSDocTypeTag);
|
|
10381
10385
|
if (tag && tag.typeExpression && tag.typeExpression.type) {
|
|
@@ -10882,8 +10886,8 @@ function isExpressionKind(kind) {
|
|
|
10882
10886
|
case 227 /* SpreadElement */:
|
|
10883
10887
|
case 231 /* AsExpression */:
|
|
10884
10888
|
case 229 /* OmittedExpression */:
|
|
10885
|
-
case
|
|
10886
|
-
case
|
|
10889
|
+
case 357 /* CommaListExpression */:
|
|
10890
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
10887
10891
|
case 235 /* SatisfiesExpression */:
|
|
10888
10892
|
return true;
|
|
10889
10893
|
default:
|
|
@@ -11054,7 +11058,7 @@ function isDeclarationStatementKind(kind) {
|
|
|
11054
11058
|
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 */;
|
|
11055
11059
|
}
|
|
11056
11060
|
function isStatementKindButNotDeclarationKind(kind) {
|
|
11057
|
-
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 ===
|
|
11061
|
+
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 */;
|
|
11058
11062
|
}
|
|
11059
11063
|
function isDeclaration(node) {
|
|
11060
11064
|
if (node.kind === 165 /* TypeParameter */) {
|
|
@@ -11115,10 +11119,10 @@ function isCaseOrDefaultClause(node) {
|
|
|
11115
11119
|
return kind === 292 /* CaseClause */ || kind === 293 /* DefaultClause */;
|
|
11116
11120
|
}
|
|
11117
11121
|
function isJSDocNode(node) {
|
|
11118
|
-
return node.kind >= 312 /* FirstJSDocNode */ && node.kind <=
|
|
11122
|
+
return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 353 /* LastJSDocNode */;
|
|
11119
11123
|
}
|
|
11120
11124
|
function isJSDocTag(node) {
|
|
11121
|
-
return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <=
|
|
11125
|
+
return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 353 /* LastJSDocTagNode */;
|
|
11122
11126
|
}
|
|
11123
11127
|
function isSetAccessor(node) {
|
|
11124
11128
|
return node.kind === 175 /* SetAccessor */;
|
|
@@ -11506,7 +11510,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
|
|
|
11506
11510
|
if (includeJsDoc && hasJSDocNodes(node)) {
|
|
11507
11511
|
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
|
|
11508
11512
|
}
|
|
11509
|
-
if (node.kind ===
|
|
11513
|
+
if (node.kind === 354 /* SyntaxList */ && node._children.length > 0) {
|
|
11510
11514
|
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
|
|
11511
11515
|
}
|
|
11512
11516
|
return skipTrivia(
|
|
@@ -13279,7 +13283,7 @@ function filterOwnedJSDocTags(hostNode, jsDoc) {
|
|
|
13279
13283
|
return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0;
|
|
13280
13284
|
}
|
|
13281
13285
|
function ownsJSDocTag(hostNode, tag) {
|
|
13282
|
-
return !isJSDocTypeTag(tag) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
|
|
13286
|
+
return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
|
|
13283
13287
|
}
|
|
13284
13288
|
function getNextJSDocCommentLocation(node) {
|
|
13285
13289
|
const parent = node.parent;
|
|
@@ -13757,7 +13761,7 @@ function getOperator(expression) {
|
|
|
13757
13761
|
}
|
|
13758
13762
|
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
|
|
13759
13763
|
switch (nodeKind) {
|
|
13760
|
-
case
|
|
13764
|
+
case 357 /* CommaListExpression */:
|
|
13761
13765
|
return 0 /* Comma */;
|
|
13762
13766
|
case 227 /* SpreadElement */:
|
|
13763
13767
|
return 1 /* Spread */;
|
|
@@ -14743,14 +14747,23 @@ function modifierToFlag(token) {
|
|
|
14743
14747
|
}
|
|
14744
14748
|
return 0 /* None */;
|
|
14745
14749
|
}
|
|
14750
|
+
function isBinaryLogicalOperator(token) {
|
|
14751
|
+
return token === 56 /* BarBarToken */ || token === 55 /* AmpersandAmpersandToken */;
|
|
14752
|
+
}
|
|
14746
14753
|
function isLogicalOperator(token) {
|
|
14747
|
-
return token
|
|
14754
|
+
return isBinaryLogicalOperator(token) || token === 53 /* ExclamationToken */;
|
|
14748
14755
|
}
|
|
14749
14756
|
function isLogicalOrCoalescingAssignmentOperator(token) {
|
|
14750
14757
|
return token === 75 /* BarBarEqualsToken */ || token === 76 /* AmpersandAmpersandEqualsToken */ || token === 77 /* QuestionQuestionEqualsToken */;
|
|
14751
14758
|
}
|
|
14752
14759
|
function isLogicalOrCoalescingAssignmentExpression(expr) {
|
|
14753
|
-
return isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind);
|
|
14760
|
+
return isBinaryExpression(expr) && isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind);
|
|
14761
|
+
}
|
|
14762
|
+
function isLogicalOrCoalescingBinaryOperator(token) {
|
|
14763
|
+
return isBinaryLogicalOperator(token) || token === 60 /* QuestionQuestionToken */;
|
|
14764
|
+
}
|
|
14765
|
+
function isLogicalOrCoalescingBinaryExpression(expr) {
|
|
14766
|
+
return isBinaryExpression(expr) && isLogicalOrCoalescingBinaryOperator(expr.operatorToken.kind);
|
|
14754
14767
|
}
|
|
14755
14768
|
function isAssignmentOperator(token) {
|
|
14756
14769
|
return token >= 63 /* FirstAssignment */ && token <= 78 /* LastAssignment */;
|
|
@@ -15261,7 +15274,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
|
|
|
15261
15274
|
case 209 /* ElementAccessExpression */:
|
|
15262
15275
|
case 208 /* PropertyAccessExpression */:
|
|
15263
15276
|
case 232 /* NonNullExpression */:
|
|
15264
|
-
case
|
|
15277
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
15265
15278
|
case 235 /* SatisfiesExpression */:
|
|
15266
15279
|
node = node.expression;
|
|
15267
15280
|
continue;
|
|
@@ -16496,7 +16509,7 @@ function getContainingNodeArray(node) {
|
|
|
16496
16509
|
return parent.types;
|
|
16497
16510
|
case 186 /* TupleType */:
|
|
16498
16511
|
case 206 /* ArrayLiteralExpression */:
|
|
16499
|
-
case
|
|
16512
|
+
case 357 /* CommaListExpression */:
|
|
16500
16513
|
case 272 /* NamedImports */:
|
|
16501
16514
|
case 276 /* NamedExports */:
|
|
16502
16515
|
return parent.elements;
|
|
@@ -16670,6 +16683,16 @@ function isNonNullAccess(node) {
|
|
|
16670
16683
|
const kind = node.kind;
|
|
16671
16684
|
return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
|
|
16672
16685
|
}
|
|
16686
|
+
function isJSDocSatisfiesExpression(node) {
|
|
16687
|
+
return isInJSFile(node) && isParenthesizedExpression(node) && hasJSDocNodes(node) && !!getJSDocSatisfiesTag(node);
|
|
16688
|
+
}
|
|
16689
|
+
function getJSDocSatisfiesExpressionType(node) {
|
|
16690
|
+
return Debug.checkDefined(tryGetJSDocSatisfiesTypeNode(node));
|
|
16691
|
+
}
|
|
16692
|
+
function tryGetJSDocSatisfiesTypeNode(node) {
|
|
16693
|
+
const tag = getJSDocSatisfiesTag(node);
|
|
16694
|
+
return tag && tag.typeExpression && tag.typeExpression.type;
|
|
16695
|
+
}
|
|
16673
16696
|
|
|
16674
16697
|
// src/compiler/factory/baseNodeFactory.ts
|
|
16675
16698
|
function createBaseNodeFactory() {
|
|
@@ -17683,6 +17706,12 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
17683
17706
|
get updateJSDocThrowsTag() {
|
|
17684
17707
|
return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocThrowsTag */);
|
|
17685
17708
|
},
|
|
17709
|
+
get createJSDocSatisfiesTag() {
|
|
17710
|
+
return getJSDocTypeLikeTagCreateFunction(353 /* JSDocSatisfiesTag */);
|
|
17711
|
+
},
|
|
17712
|
+
get updateJSDocSatisfiesTag() {
|
|
17713
|
+
return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocSatisfiesTag */);
|
|
17714
|
+
},
|
|
17686
17715
|
createJSDocEnumTag,
|
|
17687
17716
|
updateJSDocEnumTag,
|
|
17688
17717
|
createJSDocUnknownTag,
|
|
@@ -20842,18 +20871,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20842
20871
|
return node;
|
|
20843
20872
|
}
|
|
20844
20873
|
function createSyntaxList(children) {
|
|
20845
|
-
const node = createBaseNode(
|
|
20874
|
+
const node = createBaseNode(354 /* SyntaxList */);
|
|
20846
20875
|
node._children = children;
|
|
20847
20876
|
return node;
|
|
20848
20877
|
}
|
|
20849
20878
|
function createNotEmittedStatement(original) {
|
|
20850
|
-
const node = createBaseNode(
|
|
20879
|
+
const node = createBaseNode(355 /* NotEmittedStatement */);
|
|
20851
20880
|
node.original = original;
|
|
20852
20881
|
setTextRange(node, original);
|
|
20853
20882
|
return node;
|
|
20854
20883
|
}
|
|
20855
20884
|
function createPartiallyEmittedExpression(expression, original) {
|
|
20856
|
-
const node = createBaseNode(
|
|
20885
|
+
const node = createBaseNode(356 /* PartiallyEmittedExpression */);
|
|
20857
20886
|
node.expression = expression;
|
|
20858
20887
|
node.original = original;
|
|
20859
20888
|
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
|
|
@@ -20875,7 +20904,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20875
20904
|
return node;
|
|
20876
20905
|
}
|
|
20877
20906
|
function createCommaListExpression(elements) {
|
|
20878
|
-
const node = createBaseNode(
|
|
20907
|
+
const node = createBaseNode(357 /* CommaListExpression */);
|
|
20879
20908
|
node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
|
|
20880
20909
|
node.transformFlags |= propagateChildrenFlags(node.elements);
|
|
20881
20910
|
return node;
|
|
@@ -20884,19 +20913,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20884
20913
|
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
|
|
20885
20914
|
}
|
|
20886
20915
|
function createEndOfDeclarationMarker(original) {
|
|
20887
|
-
const node = createBaseNode(
|
|
20916
|
+
const node = createBaseNode(359 /* EndOfDeclarationMarker */);
|
|
20888
20917
|
node.emitNode = {};
|
|
20889
20918
|
node.original = original;
|
|
20890
20919
|
return node;
|
|
20891
20920
|
}
|
|
20892
20921
|
function createMergeDeclarationMarker(original) {
|
|
20893
|
-
const node = createBaseNode(
|
|
20922
|
+
const node = createBaseNode(358 /* MergeDeclarationMarker */);
|
|
20894
20923
|
node.emitNode = {};
|
|
20895
20924
|
node.original = original;
|
|
20896
20925
|
return node;
|
|
20897
20926
|
}
|
|
20898
20927
|
function createSyntheticReferenceExpression(expression, thisArg) {
|
|
20899
|
-
const node = createBaseNode(
|
|
20928
|
+
const node = createBaseNode(360 /* SyntheticReferenceExpression */);
|
|
20900
20929
|
node.expression = expression;
|
|
20901
20930
|
node.thisArg = thisArg;
|
|
20902
20931
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
|
|
@@ -21136,7 +21165,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21136
21165
|
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
|
|
21137
21166
|
case 232 /* NonNullExpression */:
|
|
21138
21167
|
return updateNonNullExpression(outerExpression, expression);
|
|
21139
|
-
case
|
|
21168
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
21140
21169
|
return updatePartiallyEmittedExpression(outerExpression, expression);
|
|
21141
21170
|
}
|
|
21142
21171
|
}
|
|
@@ -21672,7 +21701,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
|
|
|
21672
21701
|
case 213 /* TypeAssertionExpression */:
|
|
21673
21702
|
case 235 /* SatisfiesExpression */:
|
|
21674
21703
|
case 231 /* AsExpression */:
|
|
21675
|
-
case
|
|
21704
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
21676
21705
|
case 214 /* ParenthesizedExpression */:
|
|
21677
21706
|
case 106 /* SuperKeyword */:
|
|
21678
21707
|
return -2147483648 /* OuterExpressionExcludes */;
|
|
@@ -23219,10 +23248,10 @@ function isMetaProperty(node) {
|
|
|
23219
23248
|
return node.kind === 233 /* MetaProperty */;
|
|
23220
23249
|
}
|
|
23221
23250
|
function isPartiallyEmittedExpression(node) {
|
|
23222
|
-
return node.kind ===
|
|
23251
|
+
return node.kind === 356 /* PartiallyEmittedExpression */;
|
|
23223
23252
|
}
|
|
23224
23253
|
function isCommaListExpression(node) {
|
|
23225
|
-
return node.kind ===
|
|
23254
|
+
return node.kind === 357 /* CommaListExpression */;
|
|
23226
23255
|
}
|
|
23227
23256
|
function isTemplateSpan(node) {
|
|
23228
23257
|
return node.kind === 236 /* TemplateSpan */;
|
|
@@ -23345,10 +23374,10 @@ function isExportSpecifier(node) {
|
|
|
23345
23374
|
return node.kind === 278 /* ExportSpecifier */;
|
|
23346
23375
|
}
|
|
23347
23376
|
function isNotEmittedStatement(node) {
|
|
23348
|
-
return node.kind ===
|
|
23377
|
+
return node.kind === 355 /* NotEmittedStatement */;
|
|
23349
23378
|
}
|
|
23350
23379
|
function isSyntheticReference(node) {
|
|
23351
|
-
return node.kind ===
|
|
23380
|
+
return node.kind === 360 /* SyntheticReferenceExpression */;
|
|
23352
23381
|
}
|
|
23353
23382
|
function isExternalModuleReference(node) {
|
|
23354
23383
|
return node.kind === 280 /* ExternalModuleReference */;
|
|
@@ -23515,6 +23544,9 @@ function isJSDocPropertyTag(node) {
|
|
|
23515
23544
|
function isJSDocImplementsTag(node) {
|
|
23516
23545
|
return node.kind === 332 /* JSDocImplementsTag */;
|
|
23517
23546
|
}
|
|
23547
|
+
function isJSDocSatisfiesTag(node) {
|
|
23548
|
+
return node.kind === 353 /* JSDocSatisfiesTag */;
|
|
23549
|
+
}
|
|
23518
23550
|
|
|
23519
23551
|
// src/compiler/factory/utilities.ts
|
|
23520
23552
|
function createEmptyExports(factory2) {
|
|
@@ -23870,7 +23902,7 @@ function startsWithUseStrict(statements) {
|
|
|
23870
23902
|
return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement);
|
|
23871
23903
|
}
|
|
23872
23904
|
function isCommaSequence(node) {
|
|
23873
|
-
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind ===
|
|
23905
|
+
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 357 /* CommaListExpression */;
|
|
23874
23906
|
}
|
|
23875
23907
|
function isJSDocTypeAssertion(node) {
|
|
23876
23908
|
return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
|
|
@@ -23893,7 +23925,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
|
|
|
23893
23925
|
return (kinds & 2 /* TypeAssertions */) !== 0;
|
|
23894
23926
|
case 232 /* NonNullExpression */:
|
|
23895
23927
|
return (kinds & 4 /* NonNullAssertions */) !== 0;
|
|
23896
|
-
case
|
|
23928
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
23897
23929
|
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
|
|
23898
23930
|
}
|
|
23899
23931
|
return false;
|
|
@@ -24885,7 +24917,7 @@ var forEachChildTable = {
|
|
|
24885
24917
|
[279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
|
|
24886
24918
|
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
|
|
24887
24919
|
},
|
|
24888
|
-
[
|
|
24920
|
+
[357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
|
|
24889
24921
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
24890
24922
|
},
|
|
24891
24923
|
[281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
|
|
@@ -24957,6 +24989,7 @@ var forEachChildTable = {
|
|
|
24957
24989
|
[347 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24958
24990
|
[346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24959
24991
|
[343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24992
|
+
[353 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24960
24993
|
[352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24961
24994
|
[342 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24962
24995
|
[326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
|
|
@@ -24976,7 +25009,7 @@ var forEachChildTable = {
|
|
|
24976
25009
|
[339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
|
|
24977
25010
|
[334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
|
|
24978
25011
|
[340 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
|
|
24979
|
-
[
|
|
25012
|
+
[356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
24980
25013
|
};
|
|
24981
25014
|
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
|
|
24982
25015
|
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
|
|
@@ -31037,6 +31070,9 @@ var Parser;
|
|
|
31037
31070
|
case "overload":
|
|
31038
31071
|
tag = parseOverloadTag(start2, tagName, margin, indentText);
|
|
31039
31072
|
break;
|
|
31073
|
+
case "satisfies":
|
|
31074
|
+
tag = parseSatisfiesTag(start2, tagName, margin, indentText);
|
|
31075
|
+
break;
|
|
31040
31076
|
case "see":
|
|
31041
31077
|
tag = parseSeeTag(start2, tagName, margin, indentText);
|
|
31042
31078
|
break;
|
|
@@ -31345,6 +31381,14 @@ var Parser;
|
|
|
31345
31381
|
const className = parseExpressionWithTypeArgumentsForAugments();
|
|
31346
31382
|
return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2);
|
|
31347
31383
|
}
|
|
31384
|
+
function parseSatisfiesTag(start2, tagName, margin, indentText) {
|
|
31385
|
+
const typeExpression = parseJSDocTypeExpression(
|
|
31386
|
+
/*mayOmitBraces*/
|
|
31387
|
+
false
|
|
31388
|
+
);
|
|
31389
|
+
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
|
|
31390
|
+
return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2);
|
|
31391
|
+
}
|
|
31348
31392
|
function parseExpressionWithTypeArgumentsForAugments() {
|
|
31349
31393
|
const usedBrace = parseOptional(18 /* OpenBraceToken */);
|
|
31350
31394
|
const pos = getNodePos();
|
|
@@ -34946,7 +34990,7 @@ function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
|
|
|
34946
34990
|
const watchOptions = convertWatchOptionsFromJsonWorker(json.watchOptions, basePath, errors);
|
|
34947
34991
|
json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
|
|
34948
34992
|
let extendedConfigPath;
|
|
34949
|
-
if (json.extends) {
|
|
34993
|
+
if (json.extends || json.extends === "") {
|
|
34950
34994
|
if (!isCompilerOptionsValue(extendsOptionDeclaration, json.extends)) {
|
|
34951
34995
|
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", getCompilerOptionValueTypeString(extendsOptionDeclaration)));
|
|
34952
34996
|
} else {
|
|
@@ -35073,7 +35117,11 @@ function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiag
|
|
|
35073
35117
|
if (resolved.resolvedModule) {
|
|
35074
35118
|
return resolved.resolvedModule.resolvedFileName;
|
|
35075
35119
|
}
|
|
35076
|
-
|
|
35120
|
+
if (extendedConfig === "") {
|
|
35121
|
+
errors.push(createDiagnostic(Diagnostics.Compiler_option_0_cannot_be_given_an_empty_string, "extends"));
|
|
35122
|
+
} else {
|
|
35123
|
+
errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig));
|
|
35124
|
+
}
|
|
35077
35125
|
return void 0;
|
|
35078
35126
|
}
|
|
35079
35127
|
function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result) {
|
|
@@ -38634,13 +38682,12 @@ function createBinder() {
|
|
|
38634
38682
|
} else if (node.kind === 221 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
|
|
38635
38683
|
node = node.operand;
|
|
38636
38684
|
} else {
|
|
38637
|
-
return
|
|
38685
|
+
return isLogicalOrCoalescingBinaryExpression(node);
|
|
38638
38686
|
}
|
|
38639
38687
|
}
|
|
38640
38688
|
}
|
|
38641
38689
|
function isLogicalAssignmentExpression(node) {
|
|
38642
|
-
|
|
38643
|
-
return isBinaryExpression(node) && isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind);
|
|
38690
|
+
return isLogicalOrCoalescingAssignmentExpression(skipParentheses(node));
|
|
38644
38691
|
}
|
|
38645
38692
|
function isTopLevelLogicalExpression(node) {
|
|
38646
38693
|
while (isParenthesizedExpression(node.parent) || isPrefixUnaryExpression(node.parent) && node.parent.operator === 53 /* ExclamationToken */) {
|
|
@@ -39023,7 +39070,7 @@ function createBinder() {
|
|
|
39023
39070
|
};
|
|
39024
39071
|
}
|
|
39025
39072
|
const operator = node.operatorToken.kind;
|
|
39026
|
-
if (operator
|
|
39073
|
+
if (isLogicalOrCoalescingBinaryOperator(operator) || isLogicalOrCoalescingAssignmentOperator(operator)) {
|
|
39027
39074
|
if (isTopLevelLogicalExpression(node)) {
|
|
39028
39075
|
const postExpressionLabel = createBranchLabel();
|
|
39029
39076
|
bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel);
|
|
@@ -49788,12 +49835,9 @@ function createTypeChecker(host) {
|
|
|
49788
49835
|
}
|
|
49789
49836
|
const isProperty = isPropertyDeclaration(declaration) && !hasAccessorModifier(declaration) || isPropertySignature(declaration) || isJSDocPropertyTag(declaration);
|
|
49790
49837
|
const isOptional = includeOptionality && isOptionalDeclaration(declaration);
|
|
49791
|
-
|
|
49792
|
-
if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
|
|
49793
|
-
|
|
49794
|
-
return isTypeAny(declaredType) || declaredType === unknownType ? declaredType : errorType;
|
|
49795
|
-
}
|
|
49796
|
-
declaredType = useUnknownInCatchVariables ? unknownType : anyType;
|
|
49838
|
+
const declaredType = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
49839
|
+
if (!declaredType && isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
|
|
49840
|
+
return useUnknownInCatchVariables ? unknownType : anyType;
|
|
49797
49841
|
}
|
|
49798
49842
|
if (declaredType) {
|
|
49799
49843
|
return addOptionality(declaredType, isProperty, isOptional);
|
|
@@ -64961,7 +65005,7 @@ function createTypeChecker(host) {
|
|
|
64961
65005
|
}
|
|
64962
65006
|
}
|
|
64963
65007
|
function getContextualTypeForVariableLikeDeclaration(declaration, contextFlags) {
|
|
64964
|
-
const typeNode = getEffectiveTypeAnnotationNode(declaration);
|
|
65008
|
+
const typeNode = getEffectiveTypeAnnotationNode(declaration) || (isInJSFile(declaration) ? tryGetJSDocSatisfiesTypeNode(declaration) : void 0);
|
|
64965
65009
|
if (typeNode) {
|
|
64966
65010
|
return getTypeFromTypeNode(typeNode);
|
|
64967
65011
|
}
|
|
@@ -65570,8 +65614,16 @@ function createTypeChecker(host) {
|
|
|
65570
65614
|
Debug.assert(parent.parent.kind === 225 /* TemplateExpression */);
|
|
65571
65615
|
return getContextualTypeForSubstitutionExpression(parent.parent, node);
|
|
65572
65616
|
case 214 /* ParenthesizedExpression */: {
|
|
65573
|
-
|
|
65574
|
-
|
|
65617
|
+
if (isInJSFile(parent)) {
|
|
65618
|
+
if (isJSDocSatisfiesExpression(parent)) {
|
|
65619
|
+
return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent));
|
|
65620
|
+
}
|
|
65621
|
+
const typeTag = getJSDocTypeTag(parent);
|
|
65622
|
+
if (typeTag && !isConstTypeReference(typeTag.typeExpression.type)) {
|
|
65623
|
+
return getTypeFromTypeNode(typeTag.typeExpression.type);
|
|
65624
|
+
}
|
|
65625
|
+
}
|
|
65626
|
+
return getContextualType(parent, contextFlags);
|
|
65575
65627
|
}
|
|
65576
65628
|
case 232 /* NonNullExpression */:
|
|
65577
65629
|
return getContextualType(parent, contextFlags);
|
|
@@ -69775,12 +69827,15 @@ function createTypeChecker(host) {
|
|
|
69775
69827
|
}
|
|
69776
69828
|
function checkSatisfiesExpression(node) {
|
|
69777
69829
|
checkSourceElement(node.type);
|
|
69778
|
-
|
|
69779
|
-
|
|
69830
|
+
return checkSatisfiesExpressionWorker(node.expression, node.type);
|
|
69831
|
+
}
|
|
69832
|
+
function checkSatisfiesExpressionWorker(expression, target, checkMode) {
|
|
69833
|
+
const exprType = checkExpression(expression, checkMode);
|
|
69834
|
+
const targetType = getTypeFromTypeNode(target);
|
|
69780
69835
|
if (isErrorType(targetType)) {
|
|
69781
69836
|
return targetType;
|
|
69782
69837
|
}
|
|
69783
|
-
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType,
|
|
69838
|
+
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, target, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
69784
69839
|
return exprType;
|
|
69785
69840
|
}
|
|
69786
69841
|
function checkMetaProperty(node) {
|
|
@@ -71187,12 +71242,12 @@ function createTypeChecker(host) {
|
|
|
71187
71242
|
void 0
|
|
71188
71243
|
);
|
|
71189
71244
|
const operator = operatorToken.kind;
|
|
71190
|
-
if (operator
|
|
71191
|
-
|
|
71192
|
-
|
|
71193
|
-
|
|
71194
|
-
|
|
71195
|
-
|
|
71245
|
+
if (isLogicalOrCoalescingBinaryOperator(operator)) {
|
|
71246
|
+
let parent = node.parent;
|
|
71247
|
+
while (parent.kind === 214 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent)) {
|
|
71248
|
+
parent = parent.parent;
|
|
71249
|
+
}
|
|
71250
|
+
if (operator === 55 /* AmpersandAmpersandToken */ || isIfStatement(parent)) {
|
|
71196
71251
|
checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, isIfStatement(parent) ? parent.thenStatement : void 0);
|
|
71197
71252
|
}
|
|
71198
71253
|
checkTruthinessOfType(leftType, node.left);
|
|
@@ -71269,7 +71324,7 @@ function createTypeChecker(host) {
|
|
|
71269
71324
|
return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 108 /* ThisKeyword */);
|
|
71270
71325
|
}
|
|
71271
71326
|
let leftType;
|
|
71272
|
-
if (operator
|
|
71327
|
+
if (isLogicalOrCoalescingBinaryOperator(operator)) {
|
|
71273
71328
|
leftType = checkTruthinessExpression(left, checkMode);
|
|
71274
71329
|
} else {
|
|
71275
71330
|
leftType = checkExpression(left, checkMode);
|
|
@@ -71812,6 +71867,12 @@ function createTypeChecker(host) {
|
|
|
71812
71867
|
}
|
|
71813
71868
|
function checkDeclarationInitializer(declaration, checkMode, contextualType) {
|
|
71814
71869
|
const initializer = getEffectiveInitializer(declaration);
|
|
71870
|
+
if (isInJSFile(declaration)) {
|
|
71871
|
+
const typeNode = tryGetJSDocSatisfiesTypeNode(declaration);
|
|
71872
|
+
if (typeNode) {
|
|
71873
|
+
return checkSatisfiesExpressionWorker(initializer, typeNode, checkMode);
|
|
71874
|
+
}
|
|
71875
|
+
}
|
|
71815
71876
|
const type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(
|
|
71816
71877
|
initializer,
|
|
71817
71878
|
contextualType,
|
|
@@ -72139,9 +72200,14 @@ function createTypeChecker(host) {
|
|
|
72139
72200
|
}
|
|
72140
72201
|
}
|
|
72141
72202
|
function checkParenthesizedExpression(node, checkMode) {
|
|
72142
|
-
if (hasJSDocNodes(node)
|
|
72143
|
-
|
|
72144
|
-
|
|
72203
|
+
if (hasJSDocNodes(node)) {
|
|
72204
|
+
if (isJSDocSatisfiesExpression(node)) {
|
|
72205
|
+
return checkSatisfiesExpressionWorker(node.expression, getJSDocSatisfiesExpressionType(node), checkMode);
|
|
72206
|
+
}
|
|
72207
|
+
if (isJSDocTypeAssertion(node)) {
|
|
72208
|
+
const type = getJSDocTypeAssertionType(node);
|
|
72209
|
+
return checkAssertionWorker(type, type, node.expression, checkMode);
|
|
72210
|
+
}
|
|
72145
72211
|
}
|
|
72146
72212
|
return checkExpression(node.expression, checkMode);
|
|
72147
72213
|
}
|
|
@@ -73843,6 +73909,19 @@ function createTypeChecker(host) {
|
|
|
73843
73909
|
function checkJSDocTypeTag(node) {
|
|
73844
73910
|
checkSourceElement(node.typeExpression);
|
|
73845
73911
|
}
|
|
73912
|
+
function checkJSDocSatisfiesTag(node) {
|
|
73913
|
+
checkSourceElement(node.typeExpression);
|
|
73914
|
+
const host2 = getEffectiveJSDocHost(node);
|
|
73915
|
+
if (host2) {
|
|
73916
|
+
const tags = getAllJSDocTags(host2, isJSDocSatisfiesTag);
|
|
73917
|
+
if (length(tags) > 1) {
|
|
73918
|
+
for (let i = 1; i < length(tags); i++) {
|
|
73919
|
+
const tagName = tags[i].tagName;
|
|
73920
|
+
error(tagName, Diagnostics._0_tag_already_specified, idText(tagName));
|
|
73921
|
+
}
|
|
73922
|
+
}
|
|
73923
|
+
}
|
|
73924
|
+
}
|
|
73846
73925
|
function checkJSDocLinkLikeTag(node) {
|
|
73847
73926
|
if (node.name) {
|
|
73848
73927
|
resolveJSDocMemberName(
|
|
@@ -74628,15 +74707,24 @@ function createTypeChecker(host) {
|
|
|
74628
74707
|
function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, condType, body) {
|
|
74629
74708
|
if (!strictNullChecks)
|
|
74630
74709
|
return;
|
|
74631
|
-
|
|
74632
|
-
|
|
74633
|
-
|
|
74634
|
-
helper(
|
|
74710
|
+
bothHelper(condExpr, body);
|
|
74711
|
+
function bothHelper(condExpr2, body2) {
|
|
74712
|
+
condExpr2 = skipParentheses(condExpr2);
|
|
74713
|
+
helper(condExpr2, body2);
|
|
74714
|
+
while (isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 56 /* BarBarToken */ || condExpr2.operatorToken.kind === 60 /* QuestionQuestionToken */)) {
|
|
74715
|
+
condExpr2 = skipParentheses(condExpr2.left);
|
|
74716
|
+
helper(condExpr2, body2);
|
|
74717
|
+
}
|
|
74635
74718
|
}
|
|
74636
74719
|
function helper(condExpr2, body2) {
|
|
74637
|
-
const location =
|
|
74638
|
-
if (isModuleExportsAccessExpression(location))
|
|
74720
|
+
const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) : condExpr2;
|
|
74721
|
+
if (isModuleExportsAccessExpression(location)) {
|
|
74722
|
+
return;
|
|
74723
|
+
}
|
|
74724
|
+
if (isLogicalOrCoalescingBinaryExpression(location)) {
|
|
74725
|
+
bothHelper(location, body2);
|
|
74639
74726
|
return;
|
|
74727
|
+
}
|
|
74640
74728
|
const type = location === condExpr2 ? condType : checkTruthinessExpression(location);
|
|
74641
74729
|
const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
|
|
74642
74730
|
if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast)
|
|
@@ -74646,7 +74734,7 @@ function createTypeChecker(host) {
|
|
|
74646
74734
|
if (callSignatures.length === 0 && !isPromise) {
|
|
74647
74735
|
return;
|
|
74648
74736
|
}
|
|
74649
|
-
const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name :
|
|
74737
|
+
const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : void 0;
|
|
74650
74738
|
const testedSymbol = testedNode && getSymbolAtLocation(testedNode);
|
|
74651
74739
|
if (!testedSymbol && !isPromise) {
|
|
74652
74740
|
return;
|
|
@@ -75605,13 +75693,7 @@ function createTypeChecker(host) {
|
|
|
75605
75693
|
if (catchClause.variableDeclaration) {
|
|
75606
75694
|
const declaration = catchClause.variableDeclaration;
|
|
75607
75695
|
checkVariableLikeDeclaration(declaration);
|
|
75608
|
-
|
|
75609
|
-
if (typeNode) {
|
|
75610
|
-
const type = getTypeFromTypeNode(typeNode);
|
|
75611
|
-
if (type && !(type.flags & 3 /* AnyOrUnknown */)) {
|
|
75612
|
-
grammarErrorOnFirstToken(typeNode, Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);
|
|
75613
|
-
}
|
|
75614
|
-
} else if (declaration.initializer) {
|
|
75696
|
+
if (declaration.initializer) {
|
|
75615
75697
|
grammarErrorOnFirstToken(declaration.initializer, Diagnostics.Catch_clause_variable_cannot_have_an_initializer);
|
|
75616
75698
|
} else {
|
|
75617
75699
|
const blockLocals = catchClause.block.locals;
|
|
@@ -77443,6 +77525,8 @@ function createTypeChecker(host) {
|
|
|
77443
77525
|
case 338 /* JSDocProtectedTag */:
|
|
77444
77526
|
case 337 /* JSDocPrivateTag */:
|
|
77445
77527
|
return checkJSDocAccessibilityModifiers(node);
|
|
77528
|
+
case 353 /* JSDocSatisfiesTag */:
|
|
77529
|
+
return checkJSDocSatisfiesTag(node);
|
|
77446
77530
|
case 196 /* IndexedAccessType */:
|
|
77447
77531
|
return checkIndexedAccessType(node);
|
|
77448
77532
|
case 197 /* MappedType */:
|
|
@@ -82256,13 +82340,13 @@ var visitEachChildTable = {
|
|
|
82256
82340
|
);
|
|
82257
82341
|
},
|
|
82258
82342
|
// Transformation nodes
|
|
82259
|
-
[
|
|
82343
|
+
[356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
82260
82344
|
return context.factory.updatePartiallyEmittedExpression(
|
|
82261
82345
|
node,
|
|
82262
82346
|
nodeVisitor(node.expression, visitor, isExpression)
|
|
82263
82347
|
);
|
|
82264
82348
|
},
|
|
82265
|
-
[
|
|
82349
|
+
[357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
82266
82350
|
return context.factory.updateCommaListExpression(
|
|
82267
82351
|
node,
|
|
82268
82352
|
nodesVisitor(node.elements, visitor, isExpression)
|
|
@@ -88843,7 +88927,7 @@ function transformES2018(context) {
|
|
|
88843
88927
|
return visitObjectLiteralExpression(node);
|
|
88844
88928
|
case 223 /* BinaryExpression */:
|
|
88845
88929
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
88846
|
-
case
|
|
88930
|
+
case 357 /* CommaListExpression */:
|
|
88847
88931
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
88848
88932
|
case 295 /* CatchClause */:
|
|
88849
88933
|
return visitCatchClause(node);
|
|
@@ -90275,15 +90359,10 @@ function transformES2021(context) {
|
|
|
90275
90359
|
if ((node.transformFlags & 16 /* ContainsES2021 */) === 0) {
|
|
90276
90360
|
return node;
|
|
90277
90361
|
}
|
|
90278
|
-
|
|
90279
|
-
|
|
90280
|
-
const binaryExpression = node;
|
|
90281
|
-
if (isLogicalOrCoalescingAssignmentExpression(binaryExpression)) {
|
|
90282
|
-
return transformLogicalAssignment(binaryExpression);
|
|
90283
|
-
}
|
|
90284
|
-
default:
|
|
90285
|
-
return visitEachChild(node, visitor, context);
|
|
90362
|
+
if (isLogicalOrCoalescingAssignmentExpression(node)) {
|
|
90363
|
+
return transformLogicalAssignment(node);
|
|
90286
90364
|
}
|
|
90365
|
+
return visitEachChild(node, visitor, context);
|
|
90287
90366
|
}
|
|
90288
90367
|
function transformLogicalAssignment(binaryExpression) {
|
|
90289
90368
|
const operator = binaryExpression.operatorToken;
|
|
@@ -91421,7 +91500,7 @@ function transformES2015(context) {
|
|
|
91421
91500
|
return visitParenthesizedExpression(node, expressionResultIsUnused2);
|
|
91422
91501
|
case 223 /* BinaryExpression */:
|
|
91423
91502
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
91424
|
-
case
|
|
91503
|
+
case 357 /* CommaListExpression */:
|
|
91425
91504
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
91426
91505
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
91427
91506
|
case 15 /* TemplateHead */:
|
|
@@ -94573,7 +94652,7 @@ function transformGenerators(context) {
|
|
|
94573
94652
|
switch (node.kind) {
|
|
94574
94653
|
case 223 /* BinaryExpression */:
|
|
94575
94654
|
return visitBinaryExpression(node);
|
|
94576
|
-
case
|
|
94655
|
+
case 357 /* CommaListExpression */:
|
|
94577
94656
|
return visitCommaListExpression(node);
|
|
94578
94657
|
case 224 /* ConditionalExpression */:
|
|
94579
94658
|
return visitConditionalExpression(node);
|
|
@@ -96912,9 +96991,9 @@ function transformModule(context) {
|
|
|
96912
96991
|
return visitFunctionDeclaration(node);
|
|
96913
96992
|
case 260 /* ClassDeclaration */:
|
|
96914
96993
|
return visitClassDeclaration(node);
|
|
96915
|
-
case
|
|
96994
|
+
case 358 /* MergeDeclarationMarker */:
|
|
96916
96995
|
return visitMergeDeclarationMarker(node);
|
|
96917
|
-
case
|
|
96996
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
96918
96997
|
return visitEndOfDeclarationMarker(node);
|
|
96919
96998
|
default:
|
|
96920
96999
|
return visitor(node);
|
|
@@ -96931,7 +97010,7 @@ function transformModule(context) {
|
|
|
96931
97010
|
return visitExpressionStatement(node);
|
|
96932
97011
|
case 214 /* ParenthesizedExpression */:
|
|
96933
97012
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
96934
|
-
case
|
|
97013
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
96935
97014
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
96936
97015
|
case 210 /* CallExpression */:
|
|
96937
97016
|
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
|
|
@@ -99047,9 +99126,9 @@ function transformSystemModule(context) {
|
|
|
99047
99126
|
return visitCatchClause(node);
|
|
99048
99127
|
case 238 /* Block */:
|
|
99049
99128
|
return visitBlock(node);
|
|
99050
|
-
case
|
|
99129
|
+
case 358 /* MergeDeclarationMarker */:
|
|
99051
99130
|
return visitMergeDeclarationMarker(node);
|
|
99052
|
-
case
|
|
99131
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
99053
99132
|
return visitEndOfDeclarationMarker(node);
|
|
99054
99133
|
default:
|
|
99055
99134
|
return visitor(node);
|
|
@@ -99205,7 +99284,7 @@ function transformSystemModule(context) {
|
|
|
99205
99284
|
return visitExpressionStatement(node);
|
|
99206
99285
|
case 214 /* ParenthesizedExpression */:
|
|
99207
99286
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
99208
|
-
case
|
|
99287
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
99209
99288
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
99210
99289
|
case 223 /* BinaryExpression */:
|
|
99211
99290
|
if (isDestructuringAssignment(node)) {
|
|
@@ -101892,7 +101971,7 @@ function noEmitNotification(hint, node, callback) {
|
|
|
101892
101971
|
}
|
|
101893
101972
|
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
|
|
101894
101973
|
var _a2, _b;
|
|
101895
|
-
const enabledSyntaxKindFeatures = new Array(
|
|
101974
|
+
const enabledSyntaxKindFeatures = new Array(361 /* Count */);
|
|
101896
101975
|
let lexicalEnvironmentVariableDeclarations;
|
|
101897
101976
|
let lexicalEnvironmentFunctionDeclarations;
|
|
101898
101977
|
let lexicalEnvironmentStatements;
|
|
@@ -103766,6 +103845,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
103766
103845
|
case 346 /* JSDocThisTag */:
|
|
103767
103846
|
case 347 /* JSDocTypeTag */:
|
|
103768
103847
|
case 352 /* JSDocThrowsTag */:
|
|
103848
|
+
case 353 /* JSDocSatisfiesTag */:
|
|
103769
103849
|
return emitJSDocSimpleTypedTag(node);
|
|
103770
103850
|
case 348 /* JSDocTemplateTag */:
|
|
103771
103851
|
return emitJSDocTemplateTag(node);
|
|
@@ -103773,9 +103853,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
103773
103853
|
return emitJSDocTypedefTag(node);
|
|
103774
103854
|
case 350 /* JSDocSeeTag */:
|
|
103775
103855
|
return emitJSDocSeeTag(node);
|
|
103776
|
-
case
|
|
103777
|
-
case
|
|
103778
|
-
case
|
|
103856
|
+
case 355 /* NotEmittedStatement */:
|
|
103857
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
103858
|
+
case 358 /* MergeDeclarationMarker */:
|
|
103779
103859
|
return;
|
|
103780
103860
|
}
|
|
103781
103861
|
if (isExpression(node)) {
|
|
@@ -103874,18 +103954,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
103874
103954
|
return emitJsxSelfClosingElement(node);
|
|
103875
103955
|
case 285 /* JsxFragment */:
|
|
103876
103956
|
return emitJsxFragment(node);
|
|
103877
|
-
case
|
|
103957
|
+
case 354 /* SyntaxList */:
|
|
103878
103958
|
return Debug.fail("SyntaxList should not be printed");
|
|
103879
|
-
case
|
|
103959
|
+
case 355 /* NotEmittedStatement */:
|
|
103880
103960
|
return;
|
|
103881
|
-
case
|
|
103961
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
103882
103962
|
return emitPartiallyEmittedExpression(node);
|
|
103883
|
-
case
|
|
103963
|
+
case 357 /* CommaListExpression */:
|
|
103884
103964
|
return emitCommaList(node);
|
|
103885
|
-
case
|
|
103886
|
-
case
|
|
103965
|
+
case 358 /* MergeDeclarationMarker */:
|
|
103966
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
103887
103967
|
return;
|
|
103888
|
-
case
|
|
103968
|
+
case 360 /* SyntheticReferenceExpression */:
|
|
103889
103969
|
return Debug.fail("SyntheticReferenceExpression should not be printed");
|
|
103890
103970
|
}
|
|
103891
103971
|
}
|
|
@@ -107133,7 +107213,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
107133
107213
|
emitLeadingComments(
|
|
107134
107214
|
pos,
|
|
107135
107215
|
/*isEmittedNode*/
|
|
107136
|
-
node.kind !==
|
|
107216
|
+
node.kind !== 355 /* NotEmittedStatement */
|
|
107137
107217
|
);
|
|
107138
107218
|
}
|
|
107139
107219
|
if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
|
|
@@ -107157,7 +107237,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
107157
107237
|
containerPos = savedContainerPos;
|
|
107158
107238
|
containerEnd = savedContainerEnd;
|
|
107159
107239
|
declarationListContainerEnd = savedDeclarationListContainerEnd;
|
|
107160
|
-
if (!skipTrailingComments && node.kind !==
|
|
107240
|
+
if (!skipTrailingComments && node.kind !== 355 /* NotEmittedStatement */) {
|
|
107161
107241
|
emitTrailingComments(end);
|
|
107162
107242
|
}
|
|
107163
107243
|
}
|
|
@@ -107429,7 +107509,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
107429
107509
|
}
|
|
107430
107510
|
} else {
|
|
107431
107511
|
const source = sourceMapRange.source || sourceMapSource;
|
|
107432
|
-
if (node.kind !==
|
|
107512
|
+
if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
|
|
107433
107513
|
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
|
|
107434
107514
|
}
|
|
107435
107515
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
@@ -107444,7 +107524,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
107444
107524
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
107445
107525
|
sourceMapsDisabled = false;
|
|
107446
107526
|
}
|
|
107447
|
-
if (node.kind !==
|
|
107527
|
+
if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
|
|
107448
107528
|
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
|
|
107449
107529
|
}
|
|
107450
107530
|
}
|