@typescript-deploys/pr-build 5.0.0-pr-52213-4 → 5.0.0-pr-51753-19
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 +141 -68
- package/lib/tsserver.js +166 -78
- package/lib/tsserverlibrary.d.ts +17 -8
- package/lib/tsserverlibrary.js +161 -78
- package/lib/typescript.d.ts +17 -8
- package/lib/typescript.js +156 -78
- package/lib/typingsInstaller.js +54 -32
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -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";
|
|
@@ -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 */) {
|
|
@@ -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 */;
|
|
@@ -15261,7 +15265,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
|
|
|
15261
15265
|
case 209 /* ElementAccessExpression */:
|
|
15262
15266
|
case 208 /* PropertyAccessExpression */:
|
|
15263
15267
|
case 232 /* NonNullExpression */:
|
|
15264
|
-
case
|
|
15268
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
15265
15269
|
case 235 /* SatisfiesExpression */:
|
|
15266
15270
|
node = node.expression;
|
|
15267
15271
|
continue;
|
|
@@ -16496,7 +16500,7 @@ function getContainingNodeArray(node) {
|
|
|
16496
16500
|
return parent.types;
|
|
16497
16501
|
case 186 /* TupleType */:
|
|
16498
16502
|
case 206 /* ArrayLiteralExpression */:
|
|
16499
|
-
case
|
|
16503
|
+
case 357 /* CommaListExpression */:
|
|
16500
16504
|
case 272 /* NamedImports */:
|
|
16501
16505
|
case 276 /* NamedExports */:
|
|
16502
16506
|
return parent.elements;
|
|
@@ -16670,6 +16674,16 @@ function isNonNullAccess(node) {
|
|
|
16670
16674
|
const kind = node.kind;
|
|
16671
16675
|
return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
|
|
16672
16676
|
}
|
|
16677
|
+
function isJSDocSatisfiesExpression(node) {
|
|
16678
|
+
return isInJSFile(node) && isParenthesizedExpression(node) && hasJSDocNodes(node) && !!getJSDocSatisfiesTag(node);
|
|
16679
|
+
}
|
|
16680
|
+
function getJSDocSatisfiesExpressionType(node) {
|
|
16681
|
+
return Debug.checkDefined(tryGetJSDocSatisfiesTypeNode(node));
|
|
16682
|
+
}
|
|
16683
|
+
function tryGetJSDocSatisfiesTypeNode(node) {
|
|
16684
|
+
const tag = getJSDocSatisfiesTag(node);
|
|
16685
|
+
return tag && tag.typeExpression && tag.typeExpression.type;
|
|
16686
|
+
}
|
|
16673
16687
|
|
|
16674
16688
|
// src/compiler/factory/baseNodeFactory.ts
|
|
16675
16689
|
function createBaseNodeFactory() {
|
|
@@ -17683,6 +17697,12 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
17683
17697
|
get updateJSDocThrowsTag() {
|
|
17684
17698
|
return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocThrowsTag */);
|
|
17685
17699
|
},
|
|
17700
|
+
get createJSDocSatisfiesTag() {
|
|
17701
|
+
return getJSDocTypeLikeTagCreateFunction(353 /* JSDocSatisfiesTag */);
|
|
17702
|
+
},
|
|
17703
|
+
get updateJSDocSatisfiesTag() {
|
|
17704
|
+
return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocSatisfiesTag */);
|
|
17705
|
+
},
|
|
17686
17706
|
createJSDocEnumTag,
|
|
17687
17707
|
updateJSDocEnumTag,
|
|
17688
17708
|
createJSDocUnknownTag,
|
|
@@ -20842,18 +20862,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20842
20862
|
return node;
|
|
20843
20863
|
}
|
|
20844
20864
|
function createSyntaxList(children) {
|
|
20845
|
-
const node = createBaseNode(
|
|
20865
|
+
const node = createBaseNode(354 /* SyntaxList */);
|
|
20846
20866
|
node._children = children;
|
|
20847
20867
|
return node;
|
|
20848
20868
|
}
|
|
20849
20869
|
function createNotEmittedStatement(original) {
|
|
20850
|
-
const node = createBaseNode(
|
|
20870
|
+
const node = createBaseNode(355 /* NotEmittedStatement */);
|
|
20851
20871
|
node.original = original;
|
|
20852
20872
|
setTextRange(node, original);
|
|
20853
20873
|
return node;
|
|
20854
20874
|
}
|
|
20855
20875
|
function createPartiallyEmittedExpression(expression, original) {
|
|
20856
|
-
const node = createBaseNode(
|
|
20876
|
+
const node = createBaseNode(356 /* PartiallyEmittedExpression */);
|
|
20857
20877
|
node.expression = expression;
|
|
20858
20878
|
node.original = original;
|
|
20859
20879
|
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
|
|
@@ -20875,7 +20895,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20875
20895
|
return node;
|
|
20876
20896
|
}
|
|
20877
20897
|
function createCommaListExpression(elements) {
|
|
20878
|
-
const node = createBaseNode(
|
|
20898
|
+
const node = createBaseNode(357 /* CommaListExpression */);
|
|
20879
20899
|
node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
|
|
20880
20900
|
node.transformFlags |= propagateChildrenFlags(node.elements);
|
|
20881
20901
|
return node;
|
|
@@ -20884,19 +20904,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20884
20904
|
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
|
|
20885
20905
|
}
|
|
20886
20906
|
function createEndOfDeclarationMarker(original) {
|
|
20887
|
-
const node = createBaseNode(
|
|
20907
|
+
const node = createBaseNode(359 /* EndOfDeclarationMarker */);
|
|
20888
20908
|
node.emitNode = {};
|
|
20889
20909
|
node.original = original;
|
|
20890
20910
|
return node;
|
|
20891
20911
|
}
|
|
20892
20912
|
function createMergeDeclarationMarker(original) {
|
|
20893
|
-
const node = createBaseNode(
|
|
20913
|
+
const node = createBaseNode(358 /* MergeDeclarationMarker */);
|
|
20894
20914
|
node.emitNode = {};
|
|
20895
20915
|
node.original = original;
|
|
20896
20916
|
return node;
|
|
20897
20917
|
}
|
|
20898
20918
|
function createSyntheticReferenceExpression(expression, thisArg) {
|
|
20899
|
-
const node = createBaseNode(
|
|
20919
|
+
const node = createBaseNode(360 /* SyntheticReferenceExpression */);
|
|
20900
20920
|
node.expression = expression;
|
|
20901
20921
|
node.thisArg = thisArg;
|
|
20902
20922
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
|
|
@@ -21136,7 +21156,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21136
21156
|
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
|
|
21137
21157
|
case 232 /* NonNullExpression */:
|
|
21138
21158
|
return updateNonNullExpression(outerExpression, expression);
|
|
21139
|
-
case
|
|
21159
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
21140
21160
|
return updatePartiallyEmittedExpression(outerExpression, expression);
|
|
21141
21161
|
}
|
|
21142
21162
|
}
|
|
@@ -21672,7 +21692,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
|
|
|
21672
21692
|
case 213 /* TypeAssertionExpression */:
|
|
21673
21693
|
case 235 /* SatisfiesExpression */:
|
|
21674
21694
|
case 231 /* AsExpression */:
|
|
21675
|
-
case
|
|
21695
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
21676
21696
|
case 214 /* ParenthesizedExpression */:
|
|
21677
21697
|
case 106 /* SuperKeyword */:
|
|
21678
21698
|
return -2147483648 /* OuterExpressionExcludes */;
|
|
@@ -23219,10 +23239,10 @@ function isMetaProperty(node) {
|
|
|
23219
23239
|
return node.kind === 233 /* MetaProperty */;
|
|
23220
23240
|
}
|
|
23221
23241
|
function isPartiallyEmittedExpression(node) {
|
|
23222
|
-
return node.kind ===
|
|
23242
|
+
return node.kind === 356 /* PartiallyEmittedExpression */;
|
|
23223
23243
|
}
|
|
23224
23244
|
function isCommaListExpression(node) {
|
|
23225
|
-
return node.kind ===
|
|
23245
|
+
return node.kind === 357 /* CommaListExpression */;
|
|
23226
23246
|
}
|
|
23227
23247
|
function isTemplateSpan(node) {
|
|
23228
23248
|
return node.kind === 236 /* TemplateSpan */;
|
|
@@ -23345,10 +23365,10 @@ function isExportSpecifier(node) {
|
|
|
23345
23365
|
return node.kind === 278 /* ExportSpecifier */;
|
|
23346
23366
|
}
|
|
23347
23367
|
function isNotEmittedStatement(node) {
|
|
23348
|
-
return node.kind ===
|
|
23368
|
+
return node.kind === 355 /* NotEmittedStatement */;
|
|
23349
23369
|
}
|
|
23350
23370
|
function isSyntheticReference(node) {
|
|
23351
|
-
return node.kind ===
|
|
23371
|
+
return node.kind === 360 /* SyntheticReferenceExpression */;
|
|
23352
23372
|
}
|
|
23353
23373
|
function isExternalModuleReference(node) {
|
|
23354
23374
|
return node.kind === 280 /* ExternalModuleReference */;
|
|
@@ -23515,6 +23535,9 @@ function isJSDocPropertyTag(node) {
|
|
|
23515
23535
|
function isJSDocImplementsTag(node) {
|
|
23516
23536
|
return node.kind === 332 /* JSDocImplementsTag */;
|
|
23517
23537
|
}
|
|
23538
|
+
function isJSDocSatisfiesTag(node) {
|
|
23539
|
+
return node.kind === 353 /* JSDocSatisfiesTag */;
|
|
23540
|
+
}
|
|
23518
23541
|
|
|
23519
23542
|
// src/compiler/factory/utilities.ts
|
|
23520
23543
|
function createEmptyExports(factory2) {
|
|
@@ -23870,7 +23893,7 @@ function startsWithUseStrict(statements) {
|
|
|
23870
23893
|
return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement);
|
|
23871
23894
|
}
|
|
23872
23895
|
function isCommaSequence(node) {
|
|
23873
|
-
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind ===
|
|
23896
|
+
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 357 /* CommaListExpression */;
|
|
23874
23897
|
}
|
|
23875
23898
|
function isJSDocTypeAssertion(node) {
|
|
23876
23899
|
return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
|
|
@@ -23893,7 +23916,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
|
|
|
23893
23916
|
return (kinds & 2 /* TypeAssertions */) !== 0;
|
|
23894
23917
|
case 232 /* NonNullExpression */:
|
|
23895
23918
|
return (kinds & 4 /* NonNullAssertions */) !== 0;
|
|
23896
|
-
case
|
|
23919
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
23897
23920
|
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
|
|
23898
23921
|
}
|
|
23899
23922
|
return false;
|
|
@@ -24885,7 +24908,7 @@ var forEachChildTable = {
|
|
|
24885
24908
|
[279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
|
|
24886
24909
|
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
|
|
24887
24910
|
},
|
|
24888
|
-
[
|
|
24911
|
+
[357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
|
|
24889
24912
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
24890
24913
|
},
|
|
24891
24914
|
[281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
|
|
@@ -24957,6 +24980,7 @@ var forEachChildTable = {
|
|
|
24957
24980
|
[347 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24958
24981
|
[346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24959
24982
|
[343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24983
|
+
[353 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24960
24984
|
[352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24961
24985
|
[342 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24962
24986
|
[326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
|
|
@@ -24976,7 +25000,7 @@ var forEachChildTable = {
|
|
|
24976
25000
|
[339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
|
|
24977
25001
|
[334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
|
|
24978
25002
|
[340 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
|
|
24979
|
-
[
|
|
25003
|
+
[356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
24980
25004
|
};
|
|
24981
25005
|
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
|
|
24982
25006
|
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
|
|
@@ -31037,6 +31061,9 @@ var Parser;
|
|
|
31037
31061
|
case "overload":
|
|
31038
31062
|
tag = parseOverloadTag(start2, tagName, margin, indentText);
|
|
31039
31063
|
break;
|
|
31064
|
+
case "satisfies":
|
|
31065
|
+
tag = parseSatisfiesTag(start2, tagName, margin, indentText);
|
|
31066
|
+
break;
|
|
31040
31067
|
case "see":
|
|
31041
31068
|
tag = parseSeeTag(start2, tagName, margin, indentText);
|
|
31042
31069
|
break;
|
|
@@ -31345,6 +31372,14 @@ var Parser;
|
|
|
31345
31372
|
const className = parseExpressionWithTypeArgumentsForAugments();
|
|
31346
31373
|
return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2);
|
|
31347
31374
|
}
|
|
31375
|
+
function parseSatisfiesTag(start2, tagName, margin, indentText) {
|
|
31376
|
+
const typeExpression = parseJSDocTypeExpression(
|
|
31377
|
+
/*mayOmitBraces*/
|
|
31378
|
+
false
|
|
31379
|
+
);
|
|
31380
|
+
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
|
|
31381
|
+
return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2);
|
|
31382
|
+
}
|
|
31348
31383
|
function parseExpressionWithTypeArgumentsForAugments() {
|
|
31349
31384
|
const usedBrace = parseOptional(18 /* OpenBraceToken */);
|
|
31350
31385
|
const pos = getNodePos();
|
|
@@ -64961,7 +64996,7 @@ function createTypeChecker(host) {
|
|
|
64961
64996
|
}
|
|
64962
64997
|
}
|
|
64963
64998
|
function getContextualTypeForVariableLikeDeclaration(declaration, contextFlags) {
|
|
64964
|
-
const typeNode = getEffectiveTypeAnnotationNode(declaration);
|
|
64999
|
+
const typeNode = getEffectiveTypeAnnotationNode(declaration) || (isInJSFile(declaration) ? tryGetJSDocSatisfiesTypeNode(declaration) : void 0);
|
|
64965
65000
|
if (typeNode) {
|
|
64966
65001
|
return getTypeFromTypeNode(typeNode);
|
|
64967
65002
|
}
|
|
@@ -65570,8 +65605,16 @@ function createTypeChecker(host) {
|
|
|
65570
65605
|
Debug.assert(parent.parent.kind === 225 /* TemplateExpression */);
|
|
65571
65606
|
return getContextualTypeForSubstitutionExpression(parent.parent, node);
|
|
65572
65607
|
case 214 /* ParenthesizedExpression */: {
|
|
65573
|
-
|
|
65574
|
-
|
|
65608
|
+
if (isInJSFile(parent)) {
|
|
65609
|
+
if (isJSDocSatisfiesExpression(parent)) {
|
|
65610
|
+
return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent));
|
|
65611
|
+
}
|
|
65612
|
+
const typeTag = getJSDocTypeTag(parent);
|
|
65613
|
+
if (typeTag && !isConstTypeReference(typeTag.typeExpression.type)) {
|
|
65614
|
+
return getTypeFromTypeNode(typeTag.typeExpression.type);
|
|
65615
|
+
}
|
|
65616
|
+
}
|
|
65617
|
+
return getContextualType(parent, contextFlags);
|
|
65575
65618
|
}
|
|
65576
65619
|
case 232 /* NonNullExpression */:
|
|
65577
65620
|
return getContextualType(parent, contextFlags);
|
|
@@ -69775,12 +69818,15 @@ function createTypeChecker(host) {
|
|
|
69775
69818
|
}
|
|
69776
69819
|
function checkSatisfiesExpression(node) {
|
|
69777
69820
|
checkSourceElement(node.type);
|
|
69778
|
-
|
|
69779
|
-
|
|
69821
|
+
return checkSatisfiesExpressionWorker(node.expression, node.type);
|
|
69822
|
+
}
|
|
69823
|
+
function checkSatisfiesExpressionWorker(expression, target, checkMode) {
|
|
69824
|
+
const exprType = checkExpression(expression, checkMode);
|
|
69825
|
+
const targetType = getTypeFromTypeNode(target);
|
|
69780
69826
|
if (isErrorType(targetType)) {
|
|
69781
69827
|
return targetType;
|
|
69782
69828
|
}
|
|
69783
|
-
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType,
|
|
69829
|
+
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, target, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
69784
69830
|
return exprType;
|
|
69785
69831
|
}
|
|
69786
69832
|
function checkMetaProperty(node) {
|
|
@@ -71812,6 +71858,12 @@ function createTypeChecker(host) {
|
|
|
71812
71858
|
}
|
|
71813
71859
|
function checkDeclarationInitializer(declaration, checkMode, contextualType) {
|
|
71814
71860
|
const initializer = getEffectiveInitializer(declaration);
|
|
71861
|
+
if (isInJSFile(declaration)) {
|
|
71862
|
+
const typeNode = tryGetJSDocSatisfiesTypeNode(declaration);
|
|
71863
|
+
if (typeNode) {
|
|
71864
|
+
return checkSatisfiesExpressionWorker(initializer, typeNode, checkMode);
|
|
71865
|
+
}
|
|
71866
|
+
}
|
|
71815
71867
|
const type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(
|
|
71816
71868
|
initializer,
|
|
71817
71869
|
contextualType,
|
|
@@ -72139,9 +72191,14 @@ function createTypeChecker(host) {
|
|
|
72139
72191
|
}
|
|
72140
72192
|
}
|
|
72141
72193
|
function checkParenthesizedExpression(node, checkMode) {
|
|
72142
|
-
if (hasJSDocNodes(node)
|
|
72143
|
-
|
|
72144
|
-
|
|
72194
|
+
if (hasJSDocNodes(node)) {
|
|
72195
|
+
if (isJSDocSatisfiesExpression(node)) {
|
|
72196
|
+
return checkSatisfiesExpressionWorker(node.expression, getJSDocSatisfiesExpressionType(node), checkMode);
|
|
72197
|
+
}
|
|
72198
|
+
if (isJSDocTypeAssertion(node)) {
|
|
72199
|
+
const type = getJSDocTypeAssertionType(node);
|
|
72200
|
+
return checkAssertionWorker(type, type, node.expression, checkMode);
|
|
72201
|
+
}
|
|
72145
72202
|
}
|
|
72146
72203
|
return checkExpression(node.expression, checkMode);
|
|
72147
72204
|
}
|
|
@@ -73843,6 +73900,19 @@ function createTypeChecker(host) {
|
|
|
73843
73900
|
function checkJSDocTypeTag(node) {
|
|
73844
73901
|
checkSourceElement(node.typeExpression);
|
|
73845
73902
|
}
|
|
73903
|
+
function checkJSDocSatisfiesTag(node) {
|
|
73904
|
+
checkSourceElement(node.typeExpression);
|
|
73905
|
+
const host2 = getEffectiveJSDocHost(node);
|
|
73906
|
+
if (host2) {
|
|
73907
|
+
const tags = getAllJSDocTags(host2, isJSDocSatisfiesTag);
|
|
73908
|
+
if (length(tags) > 1) {
|
|
73909
|
+
for (let i = 1; i < length(tags); i++) {
|
|
73910
|
+
const tagName = tags[i].tagName;
|
|
73911
|
+
error(tagName, Diagnostics._0_tag_already_specified, idText(tagName));
|
|
73912
|
+
}
|
|
73913
|
+
}
|
|
73914
|
+
}
|
|
73915
|
+
}
|
|
73846
73916
|
function checkJSDocLinkLikeTag(node) {
|
|
73847
73917
|
if (node.name) {
|
|
73848
73918
|
resolveJSDocMemberName(
|
|
@@ -77447,6 +77517,8 @@ function createTypeChecker(host) {
|
|
|
77447
77517
|
case 338 /* JSDocProtectedTag */:
|
|
77448
77518
|
case 337 /* JSDocPrivateTag */:
|
|
77449
77519
|
return checkJSDocAccessibilityModifiers(node);
|
|
77520
|
+
case 353 /* JSDocSatisfiesTag */:
|
|
77521
|
+
return checkJSDocSatisfiesTag(node);
|
|
77450
77522
|
case 196 /* IndexedAccessType */:
|
|
77451
77523
|
return checkIndexedAccessType(node);
|
|
77452
77524
|
case 197 /* MappedType */:
|
|
@@ -82260,13 +82332,13 @@ var visitEachChildTable = {
|
|
|
82260
82332
|
);
|
|
82261
82333
|
},
|
|
82262
82334
|
// Transformation nodes
|
|
82263
|
-
[
|
|
82335
|
+
[356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
82264
82336
|
return context.factory.updatePartiallyEmittedExpression(
|
|
82265
82337
|
node,
|
|
82266
82338
|
nodeVisitor(node.expression, visitor, isExpression)
|
|
82267
82339
|
);
|
|
82268
82340
|
},
|
|
82269
|
-
[
|
|
82341
|
+
[357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
82270
82342
|
return context.factory.updateCommaListExpression(
|
|
82271
82343
|
node,
|
|
82272
82344
|
nodesVisitor(node.elements, visitor, isExpression)
|
|
@@ -88847,7 +88919,7 @@ function transformES2018(context) {
|
|
|
88847
88919
|
return visitObjectLiteralExpression(node);
|
|
88848
88920
|
case 223 /* BinaryExpression */:
|
|
88849
88921
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
88850
|
-
case
|
|
88922
|
+
case 357 /* CommaListExpression */:
|
|
88851
88923
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
88852
88924
|
case 295 /* CatchClause */:
|
|
88853
88925
|
return visitCatchClause(node);
|
|
@@ -91425,7 +91497,7 @@ function transformES2015(context) {
|
|
|
91425
91497
|
return visitParenthesizedExpression(node, expressionResultIsUnused2);
|
|
91426
91498
|
case 223 /* BinaryExpression */:
|
|
91427
91499
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
91428
|
-
case
|
|
91500
|
+
case 357 /* CommaListExpression */:
|
|
91429
91501
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
91430
91502
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
91431
91503
|
case 15 /* TemplateHead */:
|
|
@@ -94577,7 +94649,7 @@ function transformGenerators(context) {
|
|
|
94577
94649
|
switch (node.kind) {
|
|
94578
94650
|
case 223 /* BinaryExpression */:
|
|
94579
94651
|
return visitBinaryExpression(node);
|
|
94580
|
-
case
|
|
94652
|
+
case 357 /* CommaListExpression */:
|
|
94581
94653
|
return visitCommaListExpression(node);
|
|
94582
94654
|
case 224 /* ConditionalExpression */:
|
|
94583
94655
|
return visitConditionalExpression(node);
|
|
@@ -96916,9 +96988,9 @@ function transformModule(context) {
|
|
|
96916
96988
|
return visitFunctionDeclaration(node);
|
|
96917
96989
|
case 260 /* ClassDeclaration */:
|
|
96918
96990
|
return visitClassDeclaration(node);
|
|
96919
|
-
case
|
|
96991
|
+
case 358 /* MergeDeclarationMarker */:
|
|
96920
96992
|
return visitMergeDeclarationMarker(node);
|
|
96921
|
-
case
|
|
96993
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
96922
96994
|
return visitEndOfDeclarationMarker(node);
|
|
96923
96995
|
default:
|
|
96924
96996
|
return visitor(node);
|
|
@@ -96935,7 +97007,7 @@ function transformModule(context) {
|
|
|
96935
97007
|
return visitExpressionStatement(node);
|
|
96936
97008
|
case 214 /* ParenthesizedExpression */:
|
|
96937
97009
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
96938
|
-
case
|
|
97010
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
96939
97011
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
96940
97012
|
case 210 /* CallExpression */:
|
|
96941
97013
|
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
|
|
@@ -99051,9 +99123,9 @@ function transformSystemModule(context) {
|
|
|
99051
99123
|
return visitCatchClause(node);
|
|
99052
99124
|
case 238 /* Block */:
|
|
99053
99125
|
return visitBlock(node);
|
|
99054
|
-
case
|
|
99126
|
+
case 358 /* MergeDeclarationMarker */:
|
|
99055
99127
|
return visitMergeDeclarationMarker(node);
|
|
99056
|
-
case
|
|
99128
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
99057
99129
|
return visitEndOfDeclarationMarker(node);
|
|
99058
99130
|
default:
|
|
99059
99131
|
return visitor(node);
|
|
@@ -99209,7 +99281,7 @@ function transformSystemModule(context) {
|
|
|
99209
99281
|
return visitExpressionStatement(node);
|
|
99210
99282
|
case 214 /* ParenthesizedExpression */:
|
|
99211
99283
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
99212
|
-
case
|
|
99284
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
99213
99285
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
99214
99286
|
case 223 /* BinaryExpression */:
|
|
99215
99287
|
if (isDestructuringAssignment(node)) {
|
|
@@ -101896,7 +101968,7 @@ function noEmitNotification(hint, node, callback) {
|
|
|
101896
101968
|
}
|
|
101897
101969
|
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
|
|
101898
101970
|
var _a2, _b;
|
|
101899
|
-
const enabledSyntaxKindFeatures = new Array(
|
|
101971
|
+
const enabledSyntaxKindFeatures = new Array(361 /* Count */);
|
|
101900
101972
|
let lexicalEnvironmentVariableDeclarations;
|
|
101901
101973
|
let lexicalEnvironmentFunctionDeclarations;
|
|
101902
101974
|
let lexicalEnvironmentStatements;
|
|
@@ -103770,6 +103842,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
103770
103842
|
case 346 /* JSDocThisTag */:
|
|
103771
103843
|
case 347 /* JSDocTypeTag */:
|
|
103772
103844
|
case 352 /* JSDocThrowsTag */:
|
|
103845
|
+
case 353 /* JSDocSatisfiesTag */:
|
|
103773
103846
|
return emitJSDocSimpleTypedTag(node);
|
|
103774
103847
|
case 348 /* JSDocTemplateTag */:
|
|
103775
103848
|
return emitJSDocTemplateTag(node);
|
|
@@ -103777,9 +103850,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
103777
103850
|
return emitJSDocTypedefTag(node);
|
|
103778
103851
|
case 350 /* JSDocSeeTag */:
|
|
103779
103852
|
return emitJSDocSeeTag(node);
|
|
103780
|
-
case
|
|
103781
|
-
case
|
|
103782
|
-
case
|
|
103853
|
+
case 355 /* NotEmittedStatement */:
|
|
103854
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
103855
|
+
case 358 /* MergeDeclarationMarker */:
|
|
103783
103856
|
return;
|
|
103784
103857
|
}
|
|
103785
103858
|
if (isExpression(node)) {
|
|
@@ -103878,18 +103951,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
103878
103951
|
return emitJsxSelfClosingElement(node);
|
|
103879
103952
|
case 285 /* JsxFragment */:
|
|
103880
103953
|
return emitJsxFragment(node);
|
|
103881
|
-
case
|
|
103954
|
+
case 354 /* SyntaxList */:
|
|
103882
103955
|
return Debug.fail("SyntaxList should not be printed");
|
|
103883
|
-
case
|
|
103956
|
+
case 355 /* NotEmittedStatement */:
|
|
103884
103957
|
return;
|
|
103885
|
-
case
|
|
103958
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
103886
103959
|
return emitPartiallyEmittedExpression(node);
|
|
103887
|
-
case
|
|
103960
|
+
case 357 /* CommaListExpression */:
|
|
103888
103961
|
return emitCommaList(node);
|
|
103889
|
-
case
|
|
103890
|
-
case
|
|
103962
|
+
case 358 /* MergeDeclarationMarker */:
|
|
103963
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
103891
103964
|
return;
|
|
103892
|
-
case
|
|
103965
|
+
case 360 /* SyntheticReferenceExpression */:
|
|
103893
103966
|
return Debug.fail("SyntheticReferenceExpression should not be printed");
|
|
103894
103967
|
}
|
|
103895
103968
|
}
|
|
@@ -107137,7 +107210,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
107137
107210
|
emitLeadingComments(
|
|
107138
107211
|
pos,
|
|
107139
107212
|
/*isEmittedNode*/
|
|
107140
|
-
node.kind !==
|
|
107213
|
+
node.kind !== 355 /* NotEmittedStatement */
|
|
107141
107214
|
);
|
|
107142
107215
|
}
|
|
107143
107216
|
if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
|
|
@@ -107161,7 +107234,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
107161
107234
|
containerPos = savedContainerPos;
|
|
107162
107235
|
containerEnd = savedContainerEnd;
|
|
107163
107236
|
declarationListContainerEnd = savedDeclarationListContainerEnd;
|
|
107164
|
-
if (!skipTrailingComments && node.kind !==
|
|
107237
|
+
if (!skipTrailingComments && node.kind !== 355 /* NotEmittedStatement */) {
|
|
107165
107238
|
emitTrailingComments(end);
|
|
107166
107239
|
}
|
|
107167
107240
|
}
|
|
@@ -107433,7 +107506,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
107433
107506
|
}
|
|
107434
107507
|
} else {
|
|
107435
107508
|
const source = sourceMapRange.source || sourceMapSource;
|
|
107436
|
-
if (node.kind !==
|
|
107509
|
+
if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
|
|
107437
107510
|
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
|
|
107438
107511
|
}
|
|
107439
107512
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
@@ -107448,7 +107521,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
107448
107521
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
107449
107522
|
sourceMapsDisabled = false;
|
|
107450
107523
|
}
|
|
107451
|
-
if (node.kind !==
|
|
107524
|
+
if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
|
|
107452
107525
|
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
|
|
107453
107526
|
}
|
|
107454
107527
|
}
|