@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/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.20230118`;
|
|
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."),
|
|
@@ -6857,7 +6857,7 @@ var Diagnostics = {
|
|
|
6857
6857
|
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'."),
|
|
6858
6858
|
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'."),
|
|
6859
6859
|
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."),
|
|
6860
|
-
|
|
6860
|
+
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."),
|
|
6861
6861
|
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."),
|
|
6862
6862
|
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'."),
|
|
6863
6863
|
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.`),
|
|
@@ -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) {
|
|
@@ -10912,8 +10916,8 @@ function isExpressionKind(kind) {
|
|
|
10912
10916
|
case 227 /* SpreadElement */:
|
|
10913
10917
|
case 231 /* AsExpression */:
|
|
10914
10918
|
case 229 /* OmittedExpression */:
|
|
10915
|
-
case
|
|
10916
|
-
case
|
|
10919
|
+
case 357 /* CommaListExpression */:
|
|
10920
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
10917
10921
|
case 235 /* SatisfiesExpression */:
|
|
10918
10922
|
return true;
|
|
10919
10923
|
default:
|
|
@@ -11084,7 +11088,7 @@ function isDeclarationStatementKind(kind) {
|
|
|
11084
11088
|
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 */;
|
|
11085
11089
|
}
|
|
11086
11090
|
function isStatementKindButNotDeclarationKind(kind) {
|
|
11087
|
-
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 ===
|
|
11091
|
+
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 */;
|
|
11088
11092
|
}
|
|
11089
11093
|
function isDeclaration(node) {
|
|
11090
11094
|
if (node.kind === 165 /* TypeParameter */) {
|
|
@@ -11145,10 +11149,10 @@ function isCaseOrDefaultClause(node) {
|
|
|
11145
11149
|
return kind === 292 /* CaseClause */ || kind === 293 /* DefaultClause */;
|
|
11146
11150
|
}
|
|
11147
11151
|
function isJSDocNode(node) {
|
|
11148
|
-
return node.kind >= 312 /* FirstJSDocNode */ && node.kind <=
|
|
11152
|
+
return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 353 /* LastJSDocNode */;
|
|
11149
11153
|
}
|
|
11150
11154
|
function isJSDocTag(node) {
|
|
11151
|
-
return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <=
|
|
11155
|
+
return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 353 /* LastJSDocTagNode */;
|
|
11152
11156
|
}
|
|
11153
11157
|
function isSetAccessor(node) {
|
|
11154
11158
|
return node.kind === 175 /* SetAccessor */;
|
|
@@ -11533,7 +11537,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
|
|
|
11533
11537
|
if (includeJsDoc && hasJSDocNodes(node)) {
|
|
11534
11538
|
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
|
|
11535
11539
|
}
|
|
11536
|
-
if (node.kind ===
|
|
11540
|
+
if (node.kind === 354 /* SyntaxList */ && node._children.length > 0) {
|
|
11537
11541
|
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
|
|
11538
11542
|
}
|
|
11539
11543
|
return skipTrivia(
|
|
@@ -13306,7 +13310,7 @@ function filterOwnedJSDocTags(hostNode, jsDoc) {
|
|
|
13306
13310
|
return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0;
|
|
13307
13311
|
}
|
|
13308
13312
|
function ownsJSDocTag(hostNode, tag) {
|
|
13309
|
-
return !isJSDocTypeTag(tag) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
|
|
13313
|
+
return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
|
|
13310
13314
|
}
|
|
13311
13315
|
function getNextJSDocCommentLocation(node) {
|
|
13312
13316
|
const parent = node.parent;
|
|
@@ -13784,7 +13788,7 @@ function getOperator(expression) {
|
|
|
13784
13788
|
}
|
|
13785
13789
|
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
|
|
13786
13790
|
switch (nodeKind) {
|
|
13787
|
-
case
|
|
13791
|
+
case 357 /* CommaListExpression */:
|
|
13788
13792
|
return 0 /* Comma */;
|
|
13789
13793
|
case 227 /* SpreadElement */:
|
|
13790
13794
|
return 1 /* Spread */;
|
|
@@ -14770,14 +14774,23 @@ function modifierToFlag(token) {
|
|
|
14770
14774
|
}
|
|
14771
14775
|
return 0 /* None */;
|
|
14772
14776
|
}
|
|
14777
|
+
function isBinaryLogicalOperator(token) {
|
|
14778
|
+
return token === 56 /* BarBarToken */ || token === 55 /* AmpersandAmpersandToken */;
|
|
14779
|
+
}
|
|
14773
14780
|
function isLogicalOperator(token) {
|
|
14774
|
-
return token
|
|
14781
|
+
return isBinaryLogicalOperator(token) || token === 53 /* ExclamationToken */;
|
|
14775
14782
|
}
|
|
14776
14783
|
function isLogicalOrCoalescingAssignmentOperator(token) {
|
|
14777
14784
|
return token === 75 /* BarBarEqualsToken */ || token === 76 /* AmpersandAmpersandEqualsToken */ || token === 77 /* QuestionQuestionEqualsToken */;
|
|
14778
14785
|
}
|
|
14779
14786
|
function isLogicalOrCoalescingAssignmentExpression(expr) {
|
|
14780
|
-
return isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind);
|
|
14787
|
+
return isBinaryExpression(expr) && isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind);
|
|
14788
|
+
}
|
|
14789
|
+
function isLogicalOrCoalescingBinaryOperator(token) {
|
|
14790
|
+
return isBinaryLogicalOperator(token) || token === 60 /* QuestionQuestionToken */;
|
|
14791
|
+
}
|
|
14792
|
+
function isLogicalOrCoalescingBinaryExpression(expr) {
|
|
14793
|
+
return isBinaryExpression(expr) && isLogicalOrCoalescingBinaryOperator(expr.operatorToken.kind);
|
|
14781
14794
|
}
|
|
14782
14795
|
function isAssignmentOperator(token) {
|
|
14783
14796
|
return token >= 63 /* FirstAssignment */ && token <= 78 /* LastAssignment */;
|
|
@@ -15288,7 +15301,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
|
|
|
15288
15301
|
case 209 /* ElementAccessExpression */:
|
|
15289
15302
|
case 208 /* PropertyAccessExpression */:
|
|
15290
15303
|
case 232 /* NonNullExpression */:
|
|
15291
|
-
case
|
|
15304
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
15292
15305
|
case 235 /* SatisfiesExpression */:
|
|
15293
15306
|
node = node.expression;
|
|
15294
15307
|
continue;
|
|
@@ -16523,7 +16536,7 @@ function getContainingNodeArray(node) {
|
|
|
16523
16536
|
return parent.types;
|
|
16524
16537
|
case 186 /* TupleType */:
|
|
16525
16538
|
case 206 /* ArrayLiteralExpression */:
|
|
16526
|
-
case
|
|
16539
|
+
case 357 /* CommaListExpression */:
|
|
16527
16540
|
case 272 /* NamedImports */:
|
|
16528
16541
|
case 276 /* NamedExports */:
|
|
16529
16542
|
return parent.elements;
|
|
@@ -16697,6 +16710,16 @@ function isNonNullAccess(node) {
|
|
|
16697
16710
|
const kind = node.kind;
|
|
16698
16711
|
return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
|
|
16699
16712
|
}
|
|
16713
|
+
function isJSDocSatisfiesExpression(node) {
|
|
16714
|
+
return isInJSFile(node) && isParenthesizedExpression(node) && hasJSDocNodes(node) && !!getJSDocSatisfiesTag(node);
|
|
16715
|
+
}
|
|
16716
|
+
function getJSDocSatisfiesExpressionType(node) {
|
|
16717
|
+
return Debug.checkDefined(tryGetJSDocSatisfiesTypeNode(node));
|
|
16718
|
+
}
|
|
16719
|
+
function tryGetJSDocSatisfiesTypeNode(node) {
|
|
16720
|
+
const tag = getJSDocSatisfiesTag(node);
|
|
16721
|
+
return tag && tag.typeExpression && tag.typeExpression.type;
|
|
16722
|
+
}
|
|
16700
16723
|
|
|
16701
16724
|
// src/compiler/factory/baseNodeFactory.ts
|
|
16702
16725
|
function createBaseNodeFactory() {
|
|
@@ -17710,6 +17733,12 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
17710
17733
|
get updateJSDocThrowsTag() {
|
|
17711
17734
|
return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocThrowsTag */);
|
|
17712
17735
|
},
|
|
17736
|
+
get createJSDocSatisfiesTag() {
|
|
17737
|
+
return getJSDocTypeLikeTagCreateFunction(353 /* JSDocSatisfiesTag */);
|
|
17738
|
+
},
|
|
17739
|
+
get updateJSDocSatisfiesTag() {
|
|
17740
|
+
return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocSatisfiesTag */);
|
|
17741
|
+
},
|
|
17713
17742
|
createJSDocEnumTag,
|
|
17714
17743
|
updateJSDocEnumTag,
|
|
17715
17744
|
createJSDocUnknownTag,
|
|
@@ -20869,18 +20898,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20869
20898
|
return node;
|
|
20870
20899
|
}
|
|
20871
20900
|
function createSyntaxList(children) {
|
|
20872
|
-
const node = createBaseNode(
|
|
20901
|
+
const node = createBaseNode(354 /* SyntaxList */);
|
|
20873
20902
|
node._children = children;
|
|
20874
20903
|
return node;
|
|
20875
20904
|
}
|
|
20876
20905
|
function createNotEmittedStatement(original) {
|
|
20877
|
-
const node = createBaseNode(
|
|
20906
|
+
const node = createBaseNode(355 /* NotEmittedStatement */);
|
|
20878
20907
|
node.original = original;
|
|
20879
20908
|
setTextRange(node, original);
|
|
20880
20909
|
return node;
|
|
20881
20910
|
}
|
|
20882
20911
|
function createPartiallyEmittedExpression(expression, original) {
|
|
20883
|
-
const node = createBaseNode(
|
|
20912
|
+
const node = createBaseNode(356 /* PartiallyEmittedExpression */);
|
|
20884
20913
|
node.expression = expression;
|
|
20885
20914
|
node.original = original;
|
|
20886
20915
|
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
|
|
@@ -20902,7 +20931,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20902
20931
|
return node;
|
|
20903
20932
|
}
|
|
20904
20933
|
function createCommaListExpression(elements) {
|
|
20905
|
-
const node = createBaseNode(
|
|
20934
|
+
const node = createBaseNode(357 /* CommaListExpression */);
|
|
20906
20935
|
node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
|
|
20907
20936
|
node.transformFlags |= propagateChildrenFlags(node.elements);
|
|
20908
20937
|
return node;
|
|
@@ -20911,19 +20940,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20911
20940
|
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
|
|
20912
20941
|
}
|
|
20913
20942
|
function createEndOfDeclarationMarker(original) {
|
|
20914
|
-
const node = createBaseNode(
|
|
20943
|
+
const node = createBaseNode(359 /* EndOfDeclarationMarker */);
|
|
20915
20944
|
node.emitNode = {};
|
|
20916
20945
|
node.original = original;
|
|
20917
20946
|
return node;
|
|
20918
20947
|
}
|
|
20919
20948
|
function createMergeDeclarationMarker(original) {
|
|
20920
|
-
const node = createBaseNode(
|
|
20949
|
+
const node = createBaseNode(358 /* MergeDeclarationMarker */);
|
|
20921
20950
|
node.emitNode = {};
|
|
20922
20951
|
node.original = original;
|
|
20923
20952
|
return node;
|
|
20924
20953
|
}
|
|
20925
20954
|
function createSyntheticReferenceExpression(expression, thisArg) {
|
|
20926
|
-
const node = createBaseNode(
|
|
20955
|
+
const node = createBaseNode(360 /* SyntheticReferenceExpression */);
|
|
20927
20956
|
node.expression = expression;
|
|
20928
20957
|
node.thisArg = thisArg;
|
|
20929
20958
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
|
|
@@ -21163,7 +21192,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21163
21192
|
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
|
|
21164
21193
|
case 232 /* NonNullExpression */:
|
|
21165
21194
|
return updateNonNullExpression(outerExpression, expression);
|
|
21166
|
-
case
|
|
21195
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
21167
21196
|
return updatePartiallyEmittedExpression(outerExpression, expression);
|
|
21168
21197
|
}
|
|
21169
21198
|
}
|
|
@@ -21699,7 +21728,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
|
|
|
21699
21728
|
case 213 /* TypeAssertionExpression */:
|
|
21700
21729
|
case 235 /* SatisfiesExpression */:
|
|
21701
21730
|
case 231 /* AsExpression */:
|
|
21702
|
-
case
|
|
21731
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
21703
21732
|
case 214 /* ParenthesizedExpression */:
|
|
21704
21733
|
case 106 /* SuperKeyword */:
|
|
21705
21734
|
return -2147483648 /* OuterExpressionExcludes */;
|
|
@@ -23246,10 +23275,10 @@ function isMetaProperty(node) {
|
|
|
23246
23275
|
return node.kind === 233 /* MetaProperty */;
|
|
23247
23276
|
}
|
|
23248
23277
|
function isPartiallyEmittedExpression(node) {
|
|
23249
|
-
return node.kind ===
|
|
23278
|
+
return node.kind === 356 /* PartiallyEmittedExpression */;
|
|
23250
23279
|
}
|
|
23251
23280
|
function isCommaListExpression(node) {
|
|
23252
|
-
return node.kind ===
|
|
23281
|
+
return node.kind === 357 /* CommaListExpression */;
|
|
23253
23282
|
}
|
|
23254
23283
|
function isTemplateSpan(node) {
|
|
23255
23284
|
return node.kind === 236 /* TemplateSpan */;
|
|
@@ -23372,10 +23401,10 @@ function isExportSpecifier(node) {
|
|
|
23372
23401
|
return node.kind === 278 /* ExportSpecifier */;
|
|
23373
23402
|
}
|
|
23374
23403
|
function isNotEmittedStatement(node) {
|
|
23375
|
-
return node.kind ===
|
|
23404
|
+
return node.kind === 355 /* NotEmittedStatement */;
|
|
23376
23405
|
}
|
|
23377
23406
|
function isSyntheticReference(node) {
|
|
23378
|
-
return node.kind ===
|
|
23407
|
+
return node.kind === 360 /* SyntheticReferenceExpression */;
|
|
23379
23408
|
}
|
|
23380
23409
|
function isExternalModuleReference(node) {
|
|
23381
23410
|
return node.kind === 280 /* ExternalModuleReference */;
|
|
@@ -23542,6 +23571,9 @@ function isJSDocPropertyTag(node) {
|
|
|
23542
23571
|
function isJSDocImplementsTag(node) {
|
|
23543
23572
|
return node.kind === 332 /* JSDocImplementsTag */;
|
|
23544
23573
|
}
|
|
23574
|
+
function isJSDocSatisfiesTag(node) {
|
|
23575
|
+
return node.kind === 353 /* JSDocSatisfiesTag */;
|
|
23576
|
+
}
|
|
23545
23577
|
|
|
23546
23578
|
// src/compiler/factory/utilities.ts
|
|
23547
23579
|
function createEmptyExports(factory2) {
|
|
@@ -23897,7 +23929,7 @@ function startsWithUseStrict(statements) {
|
|
|
23897
23929
|
return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement);
|
|
23898
23930
|
}
|
|
23899
23931
|
function isCommaSequence(node) {
|
|
23900
|
-
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind ===
|
|
23932
|
+
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 357 /* CommaListExpression */;
|
|
23901
23933
|
}
|
|
23902
23934
|
function isJSDocTypeAssertion(node) {
|
|
23903
23935
|
return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
|
|
@@ -23920,7 +23952,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
|
|
|
23920
23952
|
return (kinds & 2 /* TypeAssertions */) !== 0;
|
|
23921
23953
|
case 232 /* NonNullExpression */:
|
|
23922
23954
|
return (kinds & 4 /* NonNullAssertions */) !== 0;
|
|
23923
|
-
case
|
|
23955
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
23924
23956
|
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
|
|
23925
23957
|
}
|
|
23926
23958
|
return false;
|
|
@@ -24912,7 +24944,7 @@ var forEachChildTable = {
|
|
|
24912
24944
|
[279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
|
|
24913
24945
|
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
|
|
24914
24946
|
},
|
|
24915
|
-
[
|
|
24947
|
+
[357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
|
|
24916
24948
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
24917
24949
|
},
|
|
24918
24950
|
[281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
|
|
@@ -24984,6 +25016,7 @@ var forEachChildTable = {
|
|
|
24984
25016
|
[347 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24985
25017
|
[346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24986
25018
|
[343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag,
|
|
25019
|
+
[353 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24987
25020
|
[352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24988
25021
|
[342 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag,
|
|
24989
25022
|
[326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
|
|
@@ -25003,7 +25036,7 @@ var forEachChildTable = {
|
|
|
25003
25036
|
[339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
|
|
25004
25037
|
[334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
|
|
25005
25038
|
[340 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
|
|
25006
|
-
[
|
|
25039
|
+
[356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
25007
25040
|
};
|
|
25008
25041
|
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
|
|
25009
25042
|
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
|
|
@@ -31064,6 +31097,9 @@ var Parser;
|
|
|
31064
31097
|
case "overload":
|
|
31065
31098
|
tag = parseOverloadTag(start2, tagName, margin, indentText);
|
|
31066
31099
|
break;
|
|
31100
|
+
case "satisfies":
|
|
31101
|
+
tag = parseSatisfiesTag(start2, tagName, margin, indentText);
|
|
31102
|
+
break;
|
|
31067
31103
|
case "see":
|
|
31068
31104
|
tag = parseSeeTag(start2, tagName, margin, indentText);
|
|
31069
31105
|
break;
|
|
@@ -31372,6 +31408,14 @@ var Parser;
|
|
|
31372
31408
|
const className = parseExpressionWithTypeArgumentsForAugments();
|
|
31373
31409
|
return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2);
|
|
31374
31410
|
}
|
|
31411
|
+
function parseSatisfiesTag(start2, tagName, margin, indentText) {
|
|
31412
|
+
const typeExpression = parseJSDocTypeExpression(
|
|
31413
|
+
/*mayOmitBraces*/
|
|
31414
|
+
false
|
|
31415
|
+
);
|
|
31416
|
+
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
|
|
31417
|
+
return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2);
|
|
31418
|
+
}
|
|
31375
31419
|
function parseExpressionWithTypeArgumentsForAugments() {
|
|
31376
31420
|
const usedBrace = parseOptional(18 /* OpenBraceToken */);
|
|
31377
31421
|
const pos = getNodePos();
|
|
@@ -33208,7 +33252,7 @@ var commandOptionsWithoutBuild = [
|
|
|
33208
33252
|
{
|
|
33209
33253
|
name: "allowImportingTsExtensions",
|
|
33210
33254
|
type: "boolean",
|
|
33211
|
-
|
|
33255
|
+
affectsSemanticDiagnostics: true,
|
|
33212
33256
|
category: Diagnostics.Modules,
|
|
33213
33257
|
description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
|
|
33214
33258
|
defaultValueDescription: false
|
|
@@ -34973,7 +35017,7 @@ function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
|
|
|
34973
35017
|
const watchOptions = convertWatchOptionsFromJsonWorker(json.watchOptions, basePath, errors);
|
|
34974
35018
|
json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
|
|
34975
35019
|
let extendedConfigPath;
|
|
34976
|
-
if (json.extends) {
|
|
35020
|
+
if (json.extends || json.extends === "") {
|
|
34977
35021
|
if (!isCompilerOptionsValue(extendsOptionDeclaration, json.extends)) {
|
|
34978
35022
|
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", getCompilerOptionValueTypeString(extendsOptionDeclaration)));
|
|
34979
35023
|
} else {
|
|
@@ -35100,7 +35144,11 @@ function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiag
|
|
|
35100
35144
|
if (resolved.resolvedModule) {
|
|
35101
35145
|
return resolved.resolvedModule.resolvedFileName;
|
|
35102
35146
|
}
|
|
35103
|
-
|
|
35147
|
+
if (extendedConfig === "") {
|
|
35148
|
+
errors.push(createDiagnostic(Diagnostics.Compiler_option_0_cannot_be_given_an_empty_string, "extends"));
|
|
35149
|
+
} else {
|
|
35150
|
+
errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig));
|
|
35151
|
+
}
|
|
35104
35152
|
return void 0;
|
|
35105
35153
|
}
|
|
35106
35154
|
function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result) {
|
|
@@ -37793,7 +37841,7 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
37793
37841
|
}
|
|
37794
37842
|
}
|
|
37795
37843
|
function shouldAllowImportingTsExtension(compilerOptions, fromFileName) {
|
|
37796
|
-
return
|
|
37844
|
+
return !!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName);
|
|
37797
37845
|
}
|
|
37798
37846
|
function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) {
|
|
37799
37847
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
@@ -38662,13 +38710,12 @@ function createBinder() {
|
|
|
38662
38710
|
} else if (node.kind === 221 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
|
|
38663
38711
|
node = node.operand;
|
|
38664
38712
|
} else {
|
|
38665
|
-
return
|
|
38713
|
+
return isLogicalOrCoalescingBinaryExpression(node);
|
|
38666
38714
|
}
|
|
38667
38715
|
}
|
|
38668
38716
|
}
|
|
38669
38717
|
function isLogicalAssignmentExpression(node) {
|
|
38670
|
-
|
|
38671
|
-
return isBinaryExpression(node) && isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind);
|
|
38718
|
+
return isLogicalOrCoalescingAssignmentExpression(skipParentheses(node));
|
|
38672
38719
|
}
|
|
38673
38720
|
function isTopLevelLogicalExpression(node) {
|
|
38674
38721
|
while (isParenthesizedExpression(node.parent) || isPrefixUnaryExpression(node.parent) && node.parent.operator === 53 /* ExclamationToken */) {
|
|
@@ -39051,7 +39098,7 @@ function createBinder() {
|
|
|
39051
39098
|
};
|
|
39052
39099
|
}
|
|
39053
39100
|
const operator = node.operatorToken.kind;
|
|
39054
|
-
if (operator
|
|
39101
|
+
if (isLogicalOrCoalescingBinaryOperator(operator) || isLogicalOrCoalescingAssignmentOperator(operator)) {
|
|
39055
39102
|
if (isTopLevelLogicalExpression(node)) {
|
|
39056
39103
|
const postExpressionLabel = createBranchLabel();
|
|
39057
39104
|
bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel);
|
|
@@ -49818,6 +49865,9 @@ function createTypeChecker(host) {
|
|
|
49818
49865
|
const isProperty = isPropertyDeclaration(declaration) && !hasAccessorModifier(declaration) || isPropertySignature(declaration) || isJSDocPropertyTag(declaration);
|
|
49819
49866
|
const isOptional = includeOptionality && isOptionalDeclaration(declaration);
|
|
49820
49867
|
const declaredType = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
49868
|
+
if (!declaredType && isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
|
|
49869
|
+
return useUnknownInCatchVariables ? unknownType : anyType;
|
|
49870
|
+
}
|
|
49821
49871
|
if (declaredType) {
|
|
49822
49872
|
return addOptionality(declaredType, isProperty, isOptional);
|
|
49823
49873
|
}
|
|
@@ -50396,14 +50446,6 @@ function createTypeChecker(host) {
|
|
|
50396
50446
|
}
|
|
50397
50447
|
Debug.assertIsDefined(symbol.valueDeclaration);
|
|
50398
50448
|
const declaration = symbol.valueDeclaration;
|
|
50399
|
-
if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
|
|
50400
|
-
const typeNode = getEffectiveTypeAnnotationNode(declaration);
|
|
50401
|
-
if (typeNode === void 0) {
|
|
50402
|
-
return useUnknownInCatchVariables ? unknownType : anyType;
|
|
50403
|
-
}
|
|
50404
|
-
const type2 = getTypeOfNode(typeNode);
|
|
50405
|
-
return isTypeAny(type2) || type2 === unknownType ? type2 : errorType;
|
|
50406
|
-
}
|
|
50407
50449
|
if (isSourceFile(declaration) && isJsonSourceFile(declaration)) {
|
|
50408
50450
|
if (!declaration.statements.length) {
|
|
50409
50451
|
return emptyObjectType;
|
|
@@ -64203,7 +64245,7 @@ function createTypeChecker(host) {
|
|
|
64203
64245
|
return getNonMissingTypeOfSymbol(symbol);
|
|
64204
64246
|
}
|
|
64205
64247
|
function getControlFlowContainer(node) {
|
|
64206
|
-
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */);
|
|
64248
|
+
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 */);
|
|
64207
64249
|
}
|
|
64208
64250
|
function isSymbolAssigned(symbol) {
|
|
64209
64251
|
if (!symbol.valueDeclaration) {
|
|
@@ -64461,13 +64503,14 @@ function createTypeChecker(host) {
|
|
|
64461
64503
|
const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */;
|
|
64462
64504
|
const declarationContainer = getControlFlowContainer(declaration);
|
|
64463
64505
|
let flowContainer = getControlFlowContainer(node);
|
|
64506
|
+
const isCatch = flowContainer.kind === 295 /* CatchClause */;
|
|
64464
64507
|
const isOuterVariable = flowContainer !== declarationContainer;
|
|
64465
64508
|
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
|
|
64466
64509
|
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
|
|
64467
64510
|
while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
|
|
64468
64511
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
64469
64512
|
}
|
|
64470
|
-
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 */;
|
|
64513
|
+
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 */;
|
|
64471
64514
|
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
|
|
64472
64515
|
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
|
|
64473
64516
|
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
|
|
@@ -64992,7 +65035,7 @@ function createTypeChecker(host) {
|
|
|
64992
65035
|
}
|
|
64993
65036
|
}
|
|
64994
65037
|
function getContextualTypeForVariableLikeDeclaration(declaration, contextFlags) {
|
|
64995
|
-
const typeNode = getEffectiveTypeAnnotationNode(declaration);
|
|
65038
|
+
const typeNode = getEffectiveTypeAnnotationNode(declaration) || (isInJSFile(declaration) ? tryGetJSDocSatisfiesTypeNode(declaration) : void 0);
|
|
64996
65039
|
if (typeNode) {
|
|
64997
65040
|
return getTypeFromTypeNode(typeNode);
|
|
64998
65041
|
}
|
|
@@ -65601,8 +65644,16 @@ function createTypeChecker(host) {
|
|
|
65601
65644
|
Debug.assert(parent.parent.kind === 225 /* TemplateExpression */);
|
|
65602
65645
|
return getContextualTypeForSubstitutionExpression(parent.parent, node);
|
|
65603
65646
|
case 214 /* ParenthesizedExpression */: {
|
|
65604
|
-
|
|
65605
|
-
|
|
65647
|
+
if (isInJSFile(parent)) {
|
|
65648
|
+
if (isJSDocSatisfiesExpression(parent)) {
|
|
65649
|
+
return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent));
|
|
65650
|
+
}
|
|
65651
|
+
const typeTag = getJSDocTypeTag(parent);
|
|
65652
|
+
if (typeTag && !isConstTypeReference(typeTag.typeExpression.type)) {
|
|
65653
|
+
return getTypeFromTypeNode(typeTag.typeExpression.type);
|
|
65654
|
+
}
|
|
65655
|
+
}
|
|
65656
|
+
return getContextualType(parent, contextFlags);
|
|
65606
65657
|
}
|
|
65607
65658
|
case 232 /* NonNullExpression */:
|
|
65608
65659
|
return getContextualType(parent, contextFlags);
|
|
@@ -69806,12 +69857,15 @@ function createTypeChecker(host) {
|
|
|
69806
69857
|
}
|
|
69807
69858
|
function checkSatisfiesExpression(node) {
|
|
69808
69859
|
checkSourceElement(node.type);
|
|
69809
|
-
|
|
69810
|
-
|
|
69860
|
+
return checkSatisfiesExpressionWorker(node.expression, node.type);
|
|
69861
|
+
}
|
|
69862
|
+
function checkSatisfiesExpressionWorker(expression, target, checkMode) {
|
|
69863
|
+
const exprType = checkExpression(expression, checkMode);
|
|
69864
|
+
const targetType = getTypeFromTypeNode(target);
|
|
69811
69865
|
if (isErrorType(targetType)) {
|
|
69812
69866
|
return targetType;
|
|
69813
69867
|
}
|
|
69814
|
-
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType,
|
|
69868
|
+
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, target, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
69815
69869
|
return exprType;
|
|
69816
69870
|
}
|
|
69817
69871
|
function checkMetaProperty(node) {
|
|
@@ -71218,12 +71272,12 @@ function createTypeChecker(host) {
|
|
|
71218
71272
|
void 0
|
|
71219
71273
|
);
|
|
71220
71274
|
const operator = operatorToken.kind;
|
|
71221
|
-
if (operator
|
|
71222
|
-
|
|
71223
|
-
|
|
71224
|
-
|
|
71225
|
-
|
|
71226
|
-
|
|
71275
|
+
if (isLogicalOrCoalescingBinaryOperator(operator)) {
|
|
71276
|
+
let parent = node.parent;
|
|
71277
|
+
while (parent.kind === 214 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent)) {
|
|
71278
|
+
parent = parent.parent;
|
|
71279
|
+
}
|
|
71280
|
+
if (operator === 55 /* AmpersandAmpersandToken */ || isIfStatement(parent)) {
|
|
71227
71281
|
checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, isIfStatement(parent) ? parent.thenStatement : void 0);
|
|
71228
71282
|
}
|
|
71229
71283
|
checkTruthinessOfType(leftType, node.left);
|
|
@@ -71300,7 +71354,7 @@ function createTypeChecker(host) {
|
|
|
71300
71354
|
return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 108 /* ThisKeyword */);
|
|
71301
71355
|
}
|
|
71302
71356
|
let leftType;
|
|
71303
|
-
if (operator
|
|
71357
|
+
if (isLogicalOrCoalescingBinaryOperator(operator)) {
|
|
71304
71358
|
leftType = checkTruthinessExpression(left, checkMode);
|
|
71305
71359
|
} else {
|
|
71306
71360
|
leftType = checkExpression(left, checkMode);
|
|
@@ -71843,6 +71897,12 @@ function createTypeChecker(host) {
|
|
|
71843
71897
|
}
|
|
71844
71898
|
function checkDeclarationInitializer(declaration, checkMode, contextualType) {
|
|
71845
71899
|
const initializer = getEffectiveInitializer(declaration);
|
|
71900
|
+
if (isInJSFile(declaration)) {
|
|
71901
|
+
const typeNode = tryGetJSDocSatisfiesTypeNode(declaration);
|
|
71902
|
+
if (typeNode) {
|
|
71903
|
+
return checkSatisfiesExpressionWorker(initializer, typeNode, checkMode);
|
|
71904
|
+
}
|
|
71905
|
+
}
|
|
71846
71906
|
const type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(
|
|
71847
71907
|
initializer,
|
|
71848
71908
|
contextualType,
|
|
@@ -72170,9 +72230,14 @@ function createTypeChecker(host) {
|
|
|
72170
72230
|
}
|
|
72171
72231
|
}
|
|
72172
72232
|
function checkParenthesizedExpression(node, checkMode) {
|
|
72173
|
-
if (hasJSDocNodes(node)
|
|
72174
|
-
|
|
72175
|
-
|
|
72233
|
+
if (hasJSDocNodes(node)) {
|
|
72234
|
+
if (isJSDocSatisfiesExpression(node)) {
|
|
72235
|
+
return checkSatisfiesExpressionWorker(node.expression, getJSDocSatisfiesExpressionType(node), checkMode);
|
|
72236
|
+
}
|
|
72237
|
+
if (isJSDocTypeAssertion(node)) {
|
|
72238
|
+
const type = getJSDocTypeAssertionType(node);
|
|
72239
|
+
return checkAssertionWorker(type, type, node.expression, checkMode);
|
|
72240
|
+
}
|
|
72176
72241
|
}
|
|
72177
72242
|
return checkExpression(node.expression, checkMode);
|
|
72178
72243
|
}
|
|
@@ -73874,6 +73939,19 @@ function createTypeChecker(host) {
|
|
|
73874
73939
|
function checkJSDocTypeTag(node) {
|
|
73875
73940
|
checkSourceElement(node.typeExpression);
|
|
73876
73941
|
}
|
|
73942
|
+
function checkJSDocSatisfiesTag(node) {
|
|
73943
|
+
checkSourceElement(node.typeExpression);
|
|
73944
|
+
const host2 = getEffectiveJSDocHost(node);
|
|
73945
|
+
if (host2) {
|
|
73946
|
+
const tags = getAllJSDocTags(host2, isJSDocSatisfiesTag);
|
|
73947
|
+
if (length(tags) > 1) {
|
|
73948
|
+
for (let i = 1; i < length(tags); i++) {
|
|
73949
|
+
const tagName = tags[i].tagName;
|
|
73950
|
+
error(tagName, Diagnostics._0_tag_already_specified, idText(tagName));
|
|
73951
|
+
}
|
|
73952
|
+
}
|
|
73953
|
+
}
|
|
73954
|
+
}
|
|
73877
73955
|
function checkJSDocLinkLikeTag(node) {
|
|
73878
73956
|
if (node.name) {
|
|
73879
73957
|
resolveJSDocMemberName(
|
|
@@ -74659,15 +74737,24 @@ function createTypeChecker(host) {
|
|
|
74659
74737
|
function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, condType, body) {
|
|
74660
74738
|
if (!strictNullChecks)
|
|
74661
74739
|
return;
|
|
74662
|
-
|
|
74663
|
-
|
|
74664
|
-
|
|
74665
|
-
helper(
|
|
74740
|
+
bothHelper(condExpr, body);
|
|
74741
|
+
function bothHelper(condExpr2, body2) {
|
|
74742
|
+
condExpr2 = skipParentheses(condExpr2);
|
|
74743
|
+
helper(condExpr2, body2);
|
|
74744
|
+
while (isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 56 /* BarBarToken */ || condExpr2.operatorToken.kind === 60 /* QuestionQuestionToken */)) {
|
|
74745
|
+
condExpr2 = skipParentheses(condExpr2.left);
|
|
74746
|
+
helper(condExpr2, body2);
|
|
74747
|
+
}
|
|
74666
74748
|
}
|
|
74667
74749
|
function helper(condExpr2, body2) {
|
|
74668
|
-
const location =
|
|
74669
|
-
if (isModuleExportsAccessExpression(location))
|
|
74750
|
+
const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) : condExpr2;
|
|
74751
|
+
if (isModuleExportsAccessExpression(location)) {
|
|
74670
74752
|
return;
|
|
74753
|
+
}
|
|
74754
|
+
if (isLogicalOrCoalescingBinaryExpression(location)) {
|
|
74755
|
+
bothHelper(location, body2);
|
|
74756
|
+
return;
|
|
74757
|
+
}
|
|
74671
74758
|
const type = location === condExpr2 ? condType : checkTruthinessExpression(location);
|
|
74672
74759
|
const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
|
|
74673
74760
|
if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast)
|
|
@@ -74677,7 +74764,7 @@ function createTypeChecker(host) {
|
|
|
74677
74764
|
if (callSignatures.length === 0 && !isPromise) {
|
|
74678
74765
|
return;
|
|
74679
74766
|
}
|
|
74680
|
-
const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name :
|
|
74767
|
+
const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : void 0;
|
|
74681
74768
|
const testedSymbol = testedNode && getSymbolAtLocation(testedNode);
|
|
74682
74769
|
if (!testedSymbol && !isPromise) {
|
|
74683
74770
|
return;
|
|
@@ -75635,18 +75722,8 @@ function createTypeChecker(host) {
|
|
|
75635
75722
|
if (catchClause) {
|
|
75636
75723
|
if (catchClause.variableDeclaration) {
|
|
75637
75724
|
const declaration = catchClause.variableDeclaration;
|
|
75638
|
-
|
|
75639
|
-
if (
|
|
75640
|
-
const type = getTypeForVariableLikeDeclaration(
|
|
75641
|
-
declaration,
|
|
75642
|
-
/*includeOptionality*/
|
|
75643
|
-
false,
|
|
75644
|
-
0 /* Normal */
|
|
75645
|
-
);
|
|
75646
|
-
if (type && !(type.flags & 3 /* AnyOrUnknown */)) {
|
|
75647
|
-
grammarErrorOnFirstToken(typeNode, Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);
|
|
75648
|
-
}
|
|
75649
|
-
} else if (declaration.initializer) {
|
|
75725
|
+
checkVariableLikeDeclaration(declaration);
|
|
75726
|
+
if (declaration.initializer) {
|
|
75650
75727
|
grammarErrorOnFirstToken(declaration.initializer, Diagnostics.Catch_clause_variable_cannot_have_an_initializer);
|
|
75651
75728
|
} else {
|
|
75652
75729
|
const blockLocals = catchClause.block.locals;
|
|
@@ -77478,6 +77555,8 @@ function createTypeChecker(host) {
|
|
|
77478
77555
|
case 338 /* JSDocProtectedTag */:
|
|
77479
77556
|
case 337 /* JSDocPrivateTag */:
|
|
77480
77557
|
return checkJSDocAccessibilityModifiers(node);
|
|
77558
|
+
case 353 /* JSDocSatisfiesTag */:
|
|
77559
|
+
return checkJSDocSatisfiesTag(node);
|
|
77481
77560
|
case 196 /* IndexedAccessType */:
|
|
77482
77561
|
return checkIndexedAccessType(node);
|
|
77483
77562
|
case 197 /* MappedType */:
|
|
@@ -82294,13 +82373,13 @@ var visitEachChildTable = {
|
|
|
82294
82373
|
);
|
|
82295
82374
|
},
|
|
82296
82375
|
// Transformation nodes
|
|
82297
|
-
[
|
|
82376
|
+
[356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
82298
82377
|
return context.factory.updatePartiallyEmittedExpression(
|
|
82299
82378
|
node,
|
|
82300
82379
|
Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
|
|
82301
82380
|
);
|
|
82302
82381
|
},
|
|
82303
|
-
[
|
|
82382
|
+
[357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
82304
82383
|
return context.factory.updateCommaListExpression(
|
|
82305
82384
|
node,
|
|
82306
82385
|
nodesVisitor(node.elements, visitor, isExpression)
|
|
@@ -88900,7 +88979,7 @@ function transformES2018(context) {
|
|
|
88900
88979
|
return visitObjectLiteralExpression(node);
|
|
88901
88980
|
case 223 /* BinaryExpression */:
|
|
88902
88981
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
88903
|
-
case
|
|
88982
|
+
case 357 /* CommaListExpression */:
|
|
88904
88983
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
88905
88984
|
case 295 /* CatchClause */:
|
|
88906
88985
|
return visitCatchClause(node);
|
|
@@ -90332,15 +90411,10 @@ function transformES2021(context) {
|
|
|
90332
90411
|
if ((node.transformFlags & 16 /* ContainsES2021 */) === 0) {
|
|
90333
90412
|
return node;
|
|
90334
90413
|
}
|
|
90335
|
-
|
|
90336
|
-
|
|
90337
|
-
const binaryExpression = node;
|
|
90338
|
-
if (isLogicalOrCoalescingAssignmentExpression(binaryExpression)) {
|
|
90339
|
-
return transformLogicalAssignment(binaryExpression);
|
|
90340
|
-
}
|
|
90341
|
-
default:
|
|
90342
|
-
return visitEachChild(node, visitor, context);
|
|
90414
|
+
if (isLogicalOrCoalescingAssignmentExpression(node)) {
|
|
90415
|
+
return transformLogicalAssignment(node);
|
|
90343
90416
|
}
|
|
90417
|
+
return visitEachChild(node, visitor, context);
|
|
90344
90418
|
}
|
|
90345
90419
|
function transformLogicalAssignment(binaryExpression) {
|
|
90346
90420
|
const operator = binaryExpression.operatorToken;
|
|
@@ -91478,7 +91552,7 @@ function transformES2015(context) {
|
|
|
91478
91552
|
return visitParenthesizedExpression(node, expressionResultIsUnused2);
|
|
91479
91553
|
case 223 /* BinaryExpression */:
|
|
91480
91554
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
91481
|
-
case
|
|
91555
|
+
case 357 /* CommaListExpression */:
|
|
91482
91556
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
91483
91557
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
91484
91558
|
case 15 /* TemplateHead */:
|
|
@@ -94639,7 +94713,7 @@ function transformGenerators(context) {
|
|
|
94639
94713
|
switch (node.kind) {
|
|
94640
94714
|
case 223 /* BinaryExpression */:
|
|
94641
94715
|
return visitBinaryExpression(node);
|
|
94642
|
-
case
|
|
94716
|
+
case 357 /* CommaListExpression */:
|
|
94643
94717
|
return visitCommaListExpression(node);
|
|
94644
94718
|
case 224 /* ConditionalExpression */:
|
|
94645
94719
|
return visitConditionalExpression(node);
|
|
@@ -96978,9 +97052,9 @@ function transformModule(context) {
|
|
|
96978
97052
|
return visitFunctionDeclaration(node);
|
|
96979
97053
|
case 260 /* ClassDeclaration */:
|
|
96980
97054
|
return visitClassDeclaration(node);
|
|
96981
|
-
case
|
|
97055
|
+
case 358 /* MergeDeclarationMarker */:
|
|
96982
97056
|
return visitMergeDeclarationMarker(node);
|
|
96983
|
-
case
|
|
97057
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
96984
97058
|
return visitEndOfDeclarationMarker(node);
|
|
96985
97059
|
default:
|
|
96986
97060
|
return visitor(node);
|
|
@@ -96997,7 +97071,7 @@ function transformModule(context) {
|
|
|
96997
97071
|
return visitExpressionStatement(node);
|
|
96998
97072
|
case 214 /* ParenthesizedExpression */:
|
|
96999
97073
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
97000
|
-
case
|
|
97074
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
97001
97075
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
97002
97076
|
case 210 /* CallExpression */:
|
|
97003
97077
|
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
|
|
@@ -99112,9 +99186,9 @@ function transformSystemModule(context) {
|
|
|
99112
99186
|
return visitCatchClause(node);
|
|
99113
99187
|
case 238 /* Block */:
|
|
99114
99188
|
return visitBlock(node);
|
|
99115
|
-
case
|
|
99189
|
+
case 358 /* MergeDeclarationMarker */:
|
|
99116
99190
|
return visitMergeDeclarationMarker(node);
|
|
99117
|
-
case
|
|
99191
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
99118
99192
|
return visitEndOfDeclarationMarker(node);
|
|
99119
99193
|
default:
|
|
99120
99194
|
return visitor(node);
|
|
@@ -99270,7 +99344,7 @@ function transformSystemModule(context) {
|
|
|
99270
99344
|
return visitExpressionStatement(node);
|
|
99271
99345
|
case 214 /* ParenthesizedExpression */:
|
|
99272
99346
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
99273
|
-
case
|
|
99347
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
99274
99348
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
99275
99349
|
case 223 /* BinaryExpression */:
|
|
99276
99350
|
if (isDestructuringAssignment(node)) {
|
|
@@ -101961,7 +102035,7 @@ function noEmitNotification(hint, node, callback) {
|
|
|
101961
102035
|
}
|
|
101962
102036
|
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
|
|
101963
102037
|
var _a2, _b;
|
|
101964
|
-
const enabledSyntaxKindFeatures = new Array(
|
|
102038
|
+
const enabledSyntaxKindFeatures = new Array(361 /* Count */);
|
|
101965
102039
|
let lexicalEnvironmentVariableDeclarations;
|
|
101966
102040
|
let lexicalEnvironmentFunctionDeclarations;
|
|
101967
102041
|
let lexicalEnvironmentStatements;
|
|
@@ -103835,6 +103909,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
103835
103909
|
case 346 /* JSDocThisTag */:
|
|
103836
103910
|
case 347 /* JSDocTypeTag */:
|
|
103837
103911
|
case 352 /* JSDocThrowsTag */:
|
|
103912
|
+
case 353 /* JSDocSatisfiesTag */:
|
|
103838
103913
|
return emitJSDocSimpleTypedTag(node);
|
|
103839
103914
|
case 348 /* JSDocTemplateTag */:
|
|
103840
103915
|
return emitJSDocTemplateTag(node);
|
|
@@ -103842,9 +103917,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
103842
103917
|
return emitJSDocTypedefTag(node);
|
|
103843
103918
|
case 350 /* JSDocSeeTag */:
|
|
103844
103919
|
return emitJSDocSeeTag(node);
|
|
103845
|
-
case
|
|
103846
|
-
case
|
|
103847
|
-
case
|
|
103920
|
+
case 355 /* NotEmittedStatement */:
|
|
103921
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
103922
|
+
case 358 /* MergeDeclarationMarker */:
|
|
103848
103923
|
return;
|
|
103849
103924
|
}
|
|
103850
103925
|
if (isExpression(node)) {
|
|
@@ -103943,18 +104018,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
103943
104018
|
return emitJsxSelfClosingElement(node);
|
|
103944
104019
|
case 285 /* JsxFragment */:
|
|
103945
104020
|
return emitJsxFragment(node);
|
|
103946
|
-
case
|
|
104021
|
+
case 354 /* SyntaxList */:
|
|
103947
104022
|
return Debug.fail("SyntaxList should not be printed");
|
|
103948
|
-
case
|
|
104023
|
+
case 355 /* NotEmittedStatement */:
|
|
103949
104024
|
return;
|
|
103950
|
-
case
|
|
104025
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
103951
104026
|
return emitPartiallyEmittedExpression(node);
|
|
103952
|
-
case
|
|
104027
|
+
case 357 /* CommaListExpression */:
|
|
103953
104028
|
return emitCommaList(node);
|
|
103954
|
-
case
|
|
103955
|
-
case
|
|
104029
|
+
case 358 /* MergeDeclarationMarker */:
|
|
104030
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
103956
104031
|
return;
|
|
103957
|
-
case
|
|
104032
|
+
case 360 /* SyntheticReferenceExpression */:
|
|
103958
104033
|
return Debug.fail("SyntheticReferenceExpression should not be printed");
|
|
103959
104034
|
}
|
|
103960
104035
|
}
|
|
@@ -107202,7 +107277,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
107202
107277
|
emitLeadingComments(
|
|
107203
107278
|
pos,
|
|
107204
107279
|
/*isEmittedNode*/
|
|
107205
|
-
node.kind !==
|
|
107280
|
+
node.kind !== 355 /* NotEmittedStatement */
|
|
107206
107281
|
);
|
|
107207
107282
|
}
|
|
107208
107283
|
if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
|
|
@@ -107226,7 +107301,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
107226
107301
|
containerPos = savedContainerPos;
|
|
107227
107302
|
containerEnd = savedContainerEnd;
|
|
107228
107303
|
declarationListContainerEnd = savedDeclarationListContainerEnd;
|
|
107229
|
-
if (!skipTrailingComments && node.kind !==
|
|
107304
|
+
if (!skipTrailingComments && node.kind !== 355 /* NotEmittedStatement */) {
|
|
107230
107305
|
emitTrailingComments(end);
|
|
107231
107306
|
}
|
|
107232
107307
|
}
|
|
@@ -107498,7 +107573,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
107498
107573
|
}
|
|
107499
107574
|
} else {
|
|
107500
107575
|
const source = sourceMapRange.source || sourceMapSource;
|
|
107501
|
-
if (node.kind !==
|
|
107576
|
+
if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
|
|
107502
107577
|
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
|
|
107503
107578
|
}
|
|
107504
107579
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
@@ -107513,7 +107588,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
107513
107588
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
107514
107589
|
sourceMapsDisabled = false;
|
|
107515
107590
|
}
|
|
107516
|
-
if (node.kind !==
|
|
107591
|
+
if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
|
|
107517
107592
|
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
|
|
107518
107593
|
}
|
|
107519
107594
|
}
|
|
@@ -111200,7 +111275,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
111200
111275
|
createOptionValueDiagnostic("importsNotUsedAsValues", Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later);
|
|
111201
111276
|
}
|
|
111202
111277
|
if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly)) {
|
|
111203
|
-
createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.
|
|
111278
|
+
createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set);
|
|
111204
111279
|
}
|
|
111205
111280
|
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
111206
111281
|
if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|