typescript 4.7.0-dev.20220228 → 4.7.0-dev.20220303
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/lib.es2020.bigint.d.ts +3 -1
- package/lib/lib.es2020.d.ts +2 -0
- package/lib/lib.es2020.date.d.ts +44 -0
- package/lib/lib.es2020.intl.d.ts +7 -0
- package/lib/lib.es2020.number.d.ts +30 -0
- package/lib/tsc.js +871 -674
- package/lib/tsserver.js +1201 -1004
- package/lib/tsserverlibrary.d.ts +84 -66
- package/lib/tsserverlibrary.js +1201 -1004
- package/lib/typescript.d.ts +84 -66
- package/lib/typescript.js +1189 -992
- package/lib/typescriptServices.d.ts +84 -66
- package/lib/typescriptServices.js +1189 -992
- package/lib/typingsInstaller.js +1003 -807
- package/package.json +1 -1
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220303";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -4123,74 +4123,75 @@ var ts;
|
|
|
4123
4123
|
SyntaxKind[SyntaxKind["CatchClause"] = 291] = "CatchClause";
|
|
4124
4124
|
SyntaxKind[SyntaxKind["AssertClause"] = 292] = "AssertClause";
|
|
4125
4125
|
SyntaxKind[SyntaxKind["AssertEntry"] = 293] = "AssertEntry";
|
|
4126
|
+
SyntaxKind[SyntaxKind["ImportTypeAssertionContainer"] = 294] = "ImportTypeAssertionContainer";
|
|
4126
4127
|
// Property assignments
|
|
4127
|
-
SyntaxKind[SyntaxKind["PropertyAssignment"] =
|
|
4128
|
-
SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] =
|
|
4129
|
-
SyntaxKind[SyntaxKind["SpreadAssignment"] =
|
|
4128
|
+
SyntaxKind[SyntaxKind["PropertyAssignment"] = 295] = "PropertyAssignment";
|
|
4129
|
+
SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 296] = "ShorthandPropertyAssignment";
|
|
4130
|
+
SyntaxKind[SyntaxKind["SpreadAssignment"] = 297] = "SpreadAssignment";
|
|
4130
4131
|
// Enum
|
|
4131
|
-
SyntaxKind[SyntaxKind["EnumMember"] =
|
|
4132
|
+
SyntaxKind[SyntaxKind["EnumMember"] = 298] = "EnumMember";
|
|
4132
4133
|
// Unparsed
|
|
4133
|
-
SyntaxKind[SyntaxKind["UnparsedPrologue"] =
|
|
4134
|
-
SyntaxKind[SyntaxKind["UnparsedPrepend"] =
|
|
4135
|
-
SyntaxKind[SyntaxKind["UnparsedText"] =
|
|
4136
|
-
SyntaxKind[SyntaxKind["UnparsedInternalText"] =
|
|
4137
|
-
SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] =
|
|
4134
|
+
SyntaxKind[SyntaxKind["UnparsedPrologue"] = 299] = "UnparsedPrologue";
|
|
4135
|
+
SyntaxKind[SyntaxKind["UnparsedPrepend"] = 300] = "UnparsedPrepend";
|
|
4136
|
+
SyntaxKind[SyntaxKind["UnparsedText"] = 301] = "UnparsedText";
|
|
4137
|
+
SyntaxKind[SyntaxKind["UnparsedInternalText"] = 302] = "UnparsedInternalText";
|
|
4138
|
+
SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 303] = "UnparsedSyntheticReference";
|
|
4138
4139
|
// Top-level nodes
|
|
4139
|
-
SyntaxKind[SyntaxKind["SourceFile"] =
|
|
4140
|
-
SyntaxKind[SyntaxKind["Bundle"] =
|
|
4141
|
-
SyntaxKind[SyntaxKind["UnparsedSource"] =
|
|
4142
|
-
SyntaxKind[SyntaxKind["InputFiles"] =
|
|
4140
|
+
SyntaxKind[SyntaxKind["SourceFile"] = 304] = "SourceFile";
|
|
4141
|
+
SyntaxKind[SyntaxKind["Bundle"] = 305] = "Bundle";
|
|
4142
|
+
SyntaxKind[SyntaxKind["UnparsedSource"] = 306] = "UnparsedSource";
|
|
4143
|
+
SyntaxKind[SyntaxKind["InputFiles"] = 307] = "InputFiles";
|
|
4143
4144
|
// JSDoc nodes
|
|
4144
|
-
SyntaxKind[SyntaxKind["JSDocTypeExpression"] =
|
|
4145
|
-
SyntaxKind[SyntaxKind["JSDocNameReference"] =
|
|
4146
|
-
SyntaxKind[SyntaxKind["JSDocMemberName"] =
|
|
4147
|
-
SyntaxKind[SyntaxKind["JSDocAllType"] =
|
|
4148
|
-
SyntaxKind[SyntaxKind["JSDocUnknownType"] =
|
|
4149
|
-
SyntaxKind[SyntaxKind["JSDocNullableType"] =
|
|
4150
|
-
SyntaxKind[SyntaxKind["JSDocNonNullableType"] =
|
|
4151
|
-
SyntaxKind[SyntaxKind["JSDocOptionalType"] =
|
|
4152
|
-
SyntaxKind[SyntaxKind["JSDocFunctionType"] =
|
|
4153
|
-
SyntaxKind[SyntaxKind["JSDocVariadicType"] =
|
|
4154
|
-
SyntaxKind[SyntaxKind["JSDocNamepathType"] =
|
|
4155
|
-
SyntaxKind[SyntaxKind["JSDocComment"] =
|
|
4156
|
-
SyntaxKind[SyntaxKind["JSDocText"] =
|
|
4157
|
-
SyntaxKind[SyntaxKind["JSDocTypeLiteral"] =
|
|
4158
|
-
SyntaxKind[SyntaxKind["JSDocSignature"] =
|
|
4159
|
-
SyntaxKind[SyntaxKind["JSDocLink"] =
|
|
4160
|
-
SyntaxKind[SyntaxKind["JSDocLinkCode"] =
|
|
4161
|
-
SyntaxKind[SyntaxKind["JSDocLinkPlain"] =
|
|
4162
|
-
SyntaxKind[SyntaxKind["JSDocTag"] =
|
|
4163
|
-
SyntaxKind[SyntaxKind["JSDocAugmentsTag"] =
|
|
4164
|
-
SyntaxKind[SyntaxKind["JSDocImplementsTag"] =
|
|
4165
|
-
SyntaxKind[SyntaxKind["JSDocAuthorTag"] =
|
|
4166
|
-
SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] =
|
|
4167
|
-
SyntaxKind[SyntaxKind["JSDocClassTag"] =
|
|
4168
|
-
SyntaxKind[SyntaxKind["JSDocPublicTag"] =
|
|
4169
|
-
SyntaxKind[SyntaxKind["JSDocPrivateTag"] =
|
|
4170
|
-
SyntaxKind[SyntaxKind["JSDocProtectedTag"] =
|
|
4171
|
-
SyntaxKind[SyntaxKind["JSDocReadonlyTag"] =
|
|
4172
|
-
SyntaxKind[SyntaxKind["JSDocOverrideTag"] =
|
|
4173
|
-
SyntaxKind[SyntaxKind["JSDocCallbackTag"] =
|
|
4174
|
-
SyntaxKind[SyntaxKind["JSDocEnumTag"] =
|
|
4175
|
-
SyntaxKind[SyntaxKind["JSDocParameterTag"] =
|
|
4176
|
-
SyntaxKind[SyntaxKind["JSDocReturnTag"] =
|
|
4177
|
-
SyntaxKind[SyntaxKind["JSDocThisTag"] =
|
|
4178
|
-
SyntaxKind[SyntaxKind["JSDocTypeTag"] =
|
|
4179
|
-
SyntaxKind[SyntaxKind["JSDocTemplateTag"] =
|
|
4180
|
-
SyntaxKind[SyntaxKind["JSDocTypedefTag"] =
|
|
4181
|
-
SyntaxKind[SyntaxKind["JSDocSeeTag"] =
|
|
4182
|
-
SyntaxKind[SyntaxKind["JSDocPropertyTag"] =
|
|
4145
|
+
SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 308] = "JSDocTypeExpression";
|
|
4146
|
+
SyntaxKind[SyntaxKind["JSDocNameReference"] = 309] = "JSDocNameReference";
|
|
4147
|
+
SyntaxKind[SyntaxKind["JSDocMemberName"] = 310] = "JSDocMemberName";
|
|
4148
|
+
SyntaxKind[SyntaxKind["JSDocAllType"] = 311] = "JSDocAllType";
|
|
4149
|
+
SyntaxKind[SyntaxKind["JSDocUnknownType"] = 312] = "JSDocUnknownType";
|
|
4150
|
+
SyntaxKind[SyntaxKind["JSDocNullableType"] = 313] = "JSDocNullableType";
|
|
4151
|
+
SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 314] = "JSDocNonNullableType";
|
|
4152
|
+
SyntaxKind[SyntaxKind["JSDocOptionalType"] = 315] = "JSDocOptionalType";
|
|
4153
|
+
SyntaxKind[SyntaxKind["JSDocFunctionType"] = 316] = "JSDocFunctionType";
|
|
4154
|
+
SyntaxKind[SyntaxKind["JSDocVariadicType"] = 317] = "JSDocVariadicType";
|
|
4155
|
+
SyntaxKind[SyntaxKind["JSDocNamepathType"] = 318] = "JSDocNamepathType";
|
|
4156
|
+
SyntaxKind[SyntaxKind["JSDocComment"] = 319] = "JSDocComment";
|
|
4157
|
+
SyntaxKind[SyntaxKind["JSDocText"] = 320] = "JSDocText";
|
|
4158
|
+
SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 321] = "JSDocTypeLiteral";
|
|
4159
|
+
SyntaxKind[SyntaxKind["JSDocSignature"] = 322] = "JSDocSignature";
|
|
4160
|
+
SyntaxKind[SyntaxKind["JSDocLink"] = 323] = "JSDocLink";
|
|
4161
|
+
SyntaxKind[SyntaxKind["JSDocLinkCode"] = 324] = "JSDocLinkCode";
|
|
4162
|
+
SyntaxKind[SyntaxKind["JSDocLinkPlain"] = 325] = "JSDocLinkPlain";
|
|
4163
|
+
SyntaxKind[SyntaxKind["JSDocTag"] = 326] = "JSDocTag";
|
|
4164
|
+
SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 327] = "JSDocAugmentsTag";
|
|
4165
|
+
SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 328] = "JSDocImplementsTag";
|
|
4166
|
+
SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 329] = "JSDocAuthorTag";
|
|
4167
|
+
SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 330] = "JSDocDeprecatedTag";
|
|
4168
|
+
SyntaxKind[SyntaxKind["JSDocClassTag"] = 331] = "JSDocClassTag";
|
|
4169
|
+
SyntaxKind[SyntaxKind["JSDocPublicTag"] = 332] = "JSDocPublicTag";
|
|
4170
|
+
SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 333] = "JSDocPrivateTag";
|
|
4171
|
+
SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 334] = "JSDocProtectedTag";
|
|
4172
|
+
SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 335] = "JSDocReadonlyTag";
|
|
4173
|
+
SyntaxKind[SyntaxKind["JSDocOverrideTag"] = 336] = "JSDocOverrideTag";
|
|
4174
|
+
SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 337] = "JSDocCallbackTag";
|
|
4175
|
+
SyntaxKind[SyntaxKind["JSDocEnumTag"] = 338] = "JSDocEnumTag";
|
|
4176
|
+
SyntaxKind[SyntaxKind["JSDocParameterTag"] = 339] = "JSDocParameterTag";
|
|
4177
|
+
SyntaxKind[SyntaxKind["JSDocReturnTag"] = 340] = "JSDocReturnTag";
|
|
4178
|
+
SyntaxKind[SyntaxKind["JSDocThisTag"] = 341] = "JSDocThisTag";
|
|
4179
|
+
SyntaxKind[SyntaxKind["JSDocTypeTag"] = 342] = "JSDocTypeTag";
|
|
4180
|
+
SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 343] = "JSDocTemplateTag";
|
|
4181
|
+
SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 344] = "JSDocTypedefTag";
|
|
4182
|
+
SyntaxKind[SyntaxKind["JSDocSeeTag"] = 345] = "JSDocSeeTag";
|
|
4183
|
+
SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 346] = "JSDocPropertyTag";
|
|
4183
4184
|
// Synthesized list
|
|
4184
|
-
SyntaxKind[SyntaxKind["SyntaxList"] =
|
|
4185
|
+
SyntaxKind[SyntaxKind["SyntaxList"] = 347] = "SyntaxList";
|
|
4185
4186
|
// Transformation nodes
|
|
4186
|
-
SyntaxKind[SyntaxKind["NotEmittedStatement"] =
|
|
4187
|
-
SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] =
|
|
4188
|
-
SyntaxKind[SyntaxKind["CommaListExpression"] =
|
|
4189
|
-
SyntaxKind[SyntaxKind["MergeDeclarationMarker"] =
|
|
4190
|
-
SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] =
|
|
4191
|
-
SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] =
|
|
4187
|
+
SyntaxKind[SyntaxKind["NotEmittedStatement"] = 348] = "NotEmittedStatement";
|
|
4188
|
+
SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 349] = "PartiallyEmittedExpression";
|
|
4189
|
+
SyntaxKind[SyntaxKind["CommaListExpression"] = 350] = "CommaListExpression";
|
|
4190
|
+
SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 351] = "MergeDeclarationMarker";
|
|
4191
|
+
SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 352] = "EndOfDeclarationMarker";
|
|
4192
|
+
SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 353] = "SyntheticReferenceExpression";
|
|
4192
4193
|
// Enum value count
|
|
4193
|
-
SyntaxKind[SyntaxKind["Count"] =
|
|
4194
|
+
SyntaxKind[SyntaxKind["Count"] = 354] = "Count";
|
|
4194
4195
|
// Markers
|
|
4195
4196
|
SyntaxKind[SyntaxKind["FirstAssignment"] = 63] = "FirstAssignment";
|
|
4196
4197
|
SyntaxKind[SyntaxKind["LastAssignment"] = 78] = "LastAssignment";
|
|
@@ -4219,10 +4220,10 @@ var ts;
|
|
|
4219
4220
|
SyntaxKind[SyntaxKind["FirstStatement"] = 236] = "FirstStatement";
|
|
4220
4221
|
SyntaxKind[SyntaxKind["LastStatement"] = 252] = "LastStatement";
|
|
4221
4222
|
SyntaxKind[SyntaxKind["FirstNode"] = 160] = "FirstNode";
|
|
4222
|
-
SyntaxKind[SyntaxKind["FirstJSDocNode"] =
|
|
4223
|
-
SyntaxKind[SyntaxKind["LastJSDocNode"] =
|
|
4224
|
-
SyntaxKind[SyntaxKind["FirstJSDocTagNode"] =
|
|
4225
|
-
SyntaxKind[SyntaxKind["LastJSDocTagNode"] =
|
|
4223
|
+
SyntaxKind[SyntaxKind["FirstJSDocNode"] = 308] = "FirstJSDocNode";
|
|
4224
|
+
SyntaxKind[SyntaxKind["LastJSDocNode"] = 346] = "LastJSDocNode";
|
|
4225
|
+
SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 326] = "FirstJSDocTagNode";
|
|
4226
|
+
SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 346] = "LastJSDocTagNode";
|
|
4226
4227
|
/* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 126] = "FirstContextualKeyword";
|
|
4227
4228
|
/* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 159] = "LastContextualKeyword";
|
|
4228
4229
|
})(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {}));
|
|
@@ -8200,6 +8201,9 @@ var ts;
|
|
|
8200
8201
|
Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
|
|
8201
8202
|
Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext: diag(1452, ts.DiagnosticCategory.Error, "Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext_1452", "Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`."),
|
|
8202
8203
|
resolution_mode_should_be_either_require_or_import: diag(1453, ts.DiagnosticCategory.Error, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
|
|
8204
|
+
resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, ts.DiagnosticCategory.Error, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."),
|
|
8205
|
+
resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, ts.DiagnosticCategory.Error, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."),
|
|
8206
|
+
Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1456, ts.DiagnosticCategory.Error, "Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456", "Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."),
|
|
8203
8207
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
8204
8208
|
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),
|
|
8205
8209
|
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -12475,8 +12479,8 @@ var ts;
|
|
|
12475
12479
|
switch (declaration.kind) {
|
|
12476
12480
|
case 79 /* Identifier */:
|
|
12477
12481
|
return declaration;
|
|
12478
|
-
case
|
|
12479
|
-
case
|
|
12482
|
+
case 346 /* JSDocPropertyTag */:
|
|
12483
|
+
case 339 /* JSDocParameterTag */: {
|
|
12480
12484
|
var name = declaration.name;
|
|
12481
12485
|
if (name.kind === 160 /* QualifiedName */) {
|
|
12482
12486
|
return name.right;
|
|
@@ -12500,9 +12504,9 @@ var ts;
|
|
|
12500
12504
|
return undefined;
|
|
12501
12505
|
}
|
|
12502
12506
|
}
|
|
12503
|
-
case
|
|
12507
|
+
case 344 /* JSDocTypedefTag */:
|
|
12504
12508
|
return getNameOfJSDocTypedef(declaration);
|
|
12505
|
-
case
|
|
12509
|
+
case 338 /* JSDocEnumTag */:
|
|
12506
12510
|
return nameForNamelessJSDocTypedef(declaration);
|
|
12507
12511
|
case 270 /* ExportAssignment */: {
|
|
12508
12512
|
var expression = declaration.expression;
|
|
@@ -12801,12 +12805,12 @@ var ts;
|
|
|
12801
12805
|
/** Gets the text of a jsdoc comment, flattening links to their text. */
|
|
12802
12806
|
function getTextOfJSDocComment(comment) {
|
|
12803
12807
|
return typeof comment === "string" ? comment
|
|
12804
|
-
: comment === null || comment === void 0 ? void 0 : comment.map(function (c) { return c.kind ===
|
|
12808
|
+
: comment === null || comment === void 0 ? void 0 : comment.map(function (c) { return c.kind === 320 /* JSDocText */ ? c.text : formatJSDocLink(c); }).join("");
|
|
12805
12809
|
}
|
|
12806
12810
|
ts.getTextOfJSDocComment = getTextOfJSDocComment;
|
|
12807
12811
|
function formatJSDocLink(link) {
|
|
12808
|
-
var kind = link.kind ===
|
|
12809
|
-
: link.kind ===
|
|
12812
|
+
var kind = link.kind === 323 /* JSDocLink */ ? "link"
|
|
12813
|
+
: link.kind === 324 /* JSDocLinkCode */ ? "linkcode"
|
|
12810
12814
|
: "linkplain";
|
|
12811
12815
|
var name = link.name ? ts.entityNameToString(link.name) : "";
|
|
12812
12816
|
var space = link.name && link.text.startsWith("://") ? "" : " ";
|
|
@@ -12821,7 +12825,7 @@ var ts;
|
|
|
12821
12825
|
return ts.emptyArray;
|
|
12822
12826
|
}
|
|
12823
12827
|
if (ts.isJSDocTypeAlias(node)) {
|
|
12824
|
-
ts.Debug.assert(node.parent.kind ===
|
|
12828
|
+
ts.Debug.assert(node.parent.kind === 319 /* JSDocComment */);
|
|
12825
12829
|
return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; });
|
|
12826
12830
|
}
|
|
12827
12831
|
if (node.typeParameters) {
|
|
@@ -12935,8 +12939,8 @@ var ts;
|
|
|
12935
12939
|
ts.isNamedExportBindings = isNamedExportBindings;
|
|
12936
12940
|
function isUnparsedTextLike(node) {
|
|
12937
12941
|
switch (node.kind) {
|
|
12938
|
-
case
|
|
12939
|
-
case
|
|
12942
|
+
case 301 /* UnparsedText */:
|
|
12943
|
+
case 302 /* UnparsedInternalText */:
|
|
12940
12944
|
return true;
|
|
12941
12945
|
default:
|
|
12942
12946
|
return false;
|
|
@@ -12945,12 +12949,12 @@ var ts;
|
|
|
12945
12949
|
ts.isUnparsedTextLike = isUnparsedTextLike;
|
|
12946
12950
|
function isUnparsedNode(node) {
|
|
12947
12951
|
return isUnparsedTextLike(node) ||
|
|
12948
|
-
node.kind ===
|
|
12949
|
-
node.kind ===
|
|
12952
|
+
node.kind === 299 /* UnparsedPrologue */ ||
|
|
12953
|
+
node.kind === 303 /* UnparsedSyntheticReference */;
|
|
12950
12954
|
}
|
|
12951
12955
|
ts.isUnparsedNode = isUnparsedNode;
|
|
12952
12956
|
function isJSDocPropertyLikeTag(node) {
|
|
12953
|
-
return node.kind ===
|
|
12957
|
+
return node.kind === 346 /* JSDocPropertyTag */ || node.kind === 339 /* JSDocParameterTag */;
|
|
12954
12958
|
}
|
|
12955
12959
|
ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag;
|
|
12956
12960
|
// #endregion
|
|
@@ -13159,11 +13163,11 @@ var ts;
|
|
|
13159
13163
|
switch (kind) {
|
|
13160
13164
|
case 167 /* MethodSignature */:
|
|
13161
13165
|
case 173 /* CallSignature */:
|
|
13162
|
-
case
|
|
13166
|
+
case 322 /* JSDocSignature */:
|
|
13163
13167
|
case 174 /* ConstructSignature */:
|
|
13164
13168
|
case 175 /* IndexSignature */:
|
|
13165
13169
|
case 178 /* FunctionType */:
|
|
13166
|
-
case
|
|
13170
|
+
case 316 /* JSDocFunctionType */:
|
|
13167
13171
|
case 179 /* ConstructorType */:
|
|
13168
13172
|
return true;
|
|
13169
13173
|
default:
|
|
@@ -13225,9 +13229,9 @@ var ts;
|
|
|
13225
13229
|
ts.isClassOrTypeElement = isClassOrTypeElement;
|
|
13226
13230
|
function isObjectLiteralElementLike(node) {
|
|
13227
13231
|
var kind = node.kind;
|
|
13228
|
-
return kind ===
|
|
13229
|
-
|| kind ===
|
|
13230
|
-
|| kind ===
|
|
13232
|
+
return kind === 295 /* PropertyAssignment */
|
|
13233
|
+
|| kind === 296 /* ShorthandPropertyAssignment */
|
|
13234
|
+
|| kind === 297 /* SpreadAssignment */
|
|
13231
13235
|
|| kind === 168 /* MethodDeclaration */
|
|
13232
13236
|
|| kind === 171 /* GetAccessor */
|
|
13233
13237
|
|| kind === 172 /* SetAccessor */;
|
|
@@ -13317,9 +13321,9 @@ var ts;
|
|
|
13317
13321
|
function isObjectBindingOrAssignmentElement(node) {
|
|
13318
13322
|
switch (node.kind) {
|
|
13319
13323
|
case 202 /* BindingElement */:
|
|
13320
|
-
case
|
|
13321
|
-
case
|
|
13322
|
-
case
|
|
13324
|
+
case 295 /* PropertyAssignment */: // AssignmentProperty
|
|
13325
|
+
case 296 /* ShorthandPropertyAssignment */: // AssignmentProperty
|
|
13326
|
+
case 297 /* SpreadAssignment */: // AssignmentRestProperty
|
|
13323
13327
|
return true;
|
|
13324
13328
|
}
|
|
13325
13329
|
return false;
|
|
@@ -13469,8 +13473,8 @@ var ts;
|
|
|
13469
13473
|
case 224 /* SpreadElement */:
|
|
13470
13474
|
case 228 /* AsExpression */:
|
|
13471
13475
|
case 226 /* OmittedExpression */:
|
|
13472
|
-
case
|
|
13473
|
-
case
|
|
13476
|
+
case 350 /* CommaListExpression */:
|
|
13477
|
+
case 349 /* PartiallyEmittedExpression */:
|
|
13474
13478
|
return true;
|
|
13475
13479
|
default:
|
|
13476
13480
|
return isUnaryExpressionKind(kind);
|
|
@@ -13588,7 +13592,7 @@ var ts;
|
|
|
13588
13592
|
|| kind === 169 /* ClassStaticBlockDeclaration */
|
|
13589
13593
|
|| kind === 170 /* Constructor */
|
|
13590
13594
|
|| kind === 259 /* EnumDeclaration */
|
|
13591
|
-
|| kind ===
|
|
13595
|
+
|| kind === 298 /* EnumMember */
|
|
13592
13596
|
|| kind === 274 /* ExportSpecifier */
|
|
13593
13597
|
|| kind === 255 /* FunctionDeclaration */
|
|
13594
13598
|
|| kind === 212 /* FunctionExpression */
|
|
@@ -13605,17 +13609,17 @@ var ts;
|
|
|
13605
13609
|
|| kind === 267 /* NamespaceImport */
|
|
13606
13610
|
|| kind === 273 /* NamespaceExport */
|
|
13607
13611
|
|| kind === 163 /* Parameter */
|
|
13608
|
-
|| kind ===
|
|
13612
|
+
|| kind === 295 /* PropertyAssignment */
|
|
13609
13613
|
|| kind === 166 /* PropertyDeclaration */
|
|
13610
13614
|
|| kind === 165 /* PropertySignature */
|
|
13611
13615
|
|| kind === 172 /* SetAccessor */
|
|
13612
|
-
|| kind ===
|
|
13616
|
+
|| kind === 296 /* ShorthandPropertyAssignment */
|
|
13613
13617
|
|| kind === 258 /* TypeAliasDeclaration */
|
|
13614
13618
|
|| kind === 162 /* TypeParameter */
|
|
13615
13619
|
|| kind === 253 /* VariableDeclaration */
|
|
13616
|
-
|| kind ===
|
|
13617
|
-
|| kind ===
|
|
13618
|
-
|| kind ===
|
|
13620
|
+
|| kind === 344 /* JSDocTypedefTag */
|
|
13621
|
+
|| kind === 337 /* JSDocCallbackTag */
|
|
13622
|
+
|| kind === 346 /* JSDocPropertyTag */;
|
|
13619
13623
|
}
|
|
13620
13624
|
function isDeclarationStatementKind(kind) {
|
|
13621
13625
|
return kind === 255 /* FunctionDeclaration */
|
|
@@ -13650,14 +13654,14 @@ var ts;
|
|
|
13650
13654
|
|| kind === 236 /* VariableStatement */
|
|
13651
13655
|
|| kind === 240 /* WhileStatement */
|
|
13652
13656
|
|| kind === 247 /* WithStatement */
|
|
13653
|
-
|| kind ===
|
|
13654
|
-
|| kind ===
|
|
13655
|
-
|| kind ===
|
|
13657
|
+
|| kind === 348 /* NotEmittedStatement */
|
|
13658
|
+
|| kind === 352 /* EndOfDeclarationMarker */
|
|
13659
|
+
|| kind === 351 /* MergeDeclarationMarker */;
|
|
13656
13660
|
}
|
|
13657
13661
|
/* @internal */
|
|
13658
13662
|
function isDeclaration(node) {
|
|
13659
13663
|
if (node.kind === 162 /* TypeParameter */) {
|
|
13660
|
-
return (node.parent && node.parent.kind !==
|
|
13664
|
+
return (node.parent && node.parent.kind !== 343 /* JSDocTemplateTag */) || ts.isInJSFile(node);
|
|
13661
13665
|
}
|
|
13662
13666
|
return isDeclarationKind(node.kind);
|
|
13663
13667
|
}
|
|
@@ -13763,14 +13767,14 @@ var ts;
|
|
|
13763
13767
|
/** True if node is of some JSDoc syntax kind. */
|
|
13764
13768
|
/* @internal */
|
|
13765
13769
|
function isJSDocNode(node) {
|
|
13766
|
-
return node.kind >=
|
|
13770
|
+
return node.kind >= 308 /* FirstJSDocNode */ && node.kind <= 346 /* LastJSDocNode */;
|
|
13767
13771
|
}
|
|
13768
13772
|
ts.isJSDocNode = isJSDocNode;
|
|
13769
13773
|
/** True if node is of a kind that may contain comment text. */
|
|
13770
13774
|
function isJSDocCommentContainingNode(node) {
|
|
13771
|
-
return node.kind ===
|
|
13772
|
-
|| node.kind ===
|
|
13773
|
-
|| node.kind ===
|
|
13775
|
+
return node.kind === 319 /* JSDocComment */
|
|
13776
|
+
|| node.kind === 318 /* JSDocNamepathType */
|
|
13777
|
+
|| node.kind === 320 /* JSDocText */
|
|
13774
13778
|
|| isJSDocLinkLike(node)
|
|
13775
13779
|
|| isJSDocTag(node)
|
|
13776
13780
|
|| ts.isJSDocTypeLiteral(node)
|
|
@@ -13780,7 +13784,7 @@ var ts;
|
|
|
13780
13784
|
// TODO: determine what this does before making it public.
|
|
13781
13785
|
/* @internal */
|
|
13782
13786
|
function isJSDocTag(node) {
|
|
13783
|
-
return node.kind >=
|
|
13787
|
+
return node.kind >= 326 /* FirstJSDocTagNode */ && node.kind <= 346 /* LastJSDocTagNode */;
|
|
13784
13788
|
}
|
|
13785
13789
|
ts.isJSDocTag = isJSDocTag;
|
|
13786
13790
|
function isSetAccessor(node) {
|
|
@@ -13819,8 +13823,8 @@ var ts;
|
|
|
13819
13823
|
case 202 /* BindingElement */:
|
|
13820
13824
|
case 165 /* PropertySignature */:
|
|
13821
13825
|
case 166 /* PropertyDeclaration */:
|
|
13822
|
-
case
|
|
13823
|
-
case
|
|
13826
|
+
case 295 /* PropertyAssignment */:
|
|
13827
|
+
case 298 /* EnumMember */:
|
|
13824
13828
|
return true;
|
|
13825
13829
|
default:
|
|
13826
13830
|
return false;
|
|
@@ -13866,7 +13870,7 @@ var ts;
|
|
|
13866
13870
|
}
|
|
13867
13871
|
ts.isStringLiteralLike = isStringLiteralLike;
|
|
13868
13872
|
function isJSDocLinkLike(node) {
|
|
13869
|
-
return node.kind ===
|
|
13873
|
+
return node.kind === 323 /* JSDocLink */ || node.kind === 324 /* JSDocLinkCode */ || node.kind === 325 /* JSDocLinkPlain */;
|
|
13870
13874
|
}
|
|
13871
13875
|
ts.isJSDocLinkLike = isJSDocLinkLike;
|
|
13872
13876
|
// #endregion
|
|
@@ -14124,7 +14128,7 @@ var ts;
|
|
|
14124
14128
|
}
|
|
14125
14129
|
}
|
|
14126
14130
|
function getSourceFileOfNode(node) {
|
|
14127
|
-
while (node && node.kind !==
|
|
14131
|
+
while (node && node.kind !== 304 /* SourceFile */) {
|
|
14128
14132
|
node = node.parent;
|
|
14129
14133
|
}
|
|
14130
14134
|
return node;
|
|
@@ -14340,7 +14344,7 @@ var ts;
|
|
|
14340
14344
|
// the syntax list itself considers them as normal trivia. Therefore if we simply skip
|
|
14341
14345
|
// trivia for the list, we may have skipped the JSDocComment as well. So we should process its
|
|
14342
14346
|
// first child to determine the actual position of its first token.
|
|
14343
|
-
if (node.kind ===
|
|
14347
|
+
if (node.kind === 347 /* SyntaxList */ && node._children.length > 0) {
|
|
14344
14348
|
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
|
|
14345
14349
|
}
|
|
14346
14350
|
return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos,
|
|
@@ -14612,7 +14616,7 @@ var ts;
|
|
|
14612
14616
|
return !!node && node.kind === 260 /* ModuleDeclaration */ && (!node.body);
|
|
14613
14617
|
}
|
|
14614
14618
|
function isBlockScopedContainerTopLevel(node) {
|
|
14615
|
-
return node.kind ===
|
|
14619
|
+
return node.kind === 304 /* SourceFile */ ||
|
|
14616
14620
|
node.kind === 260 /* ModuleDeclaration */ ||
|
|
14617
14621
|
ts.isFunctionLikeOrClassStaticBlockDeclaration(node);
|
|
14618
14622
|
}
|
|
@@ -14630,7 +14634,7 @@ var ts;
|
|
|
14630
14634
|
// - defined in the top level scope and source file is an external module
|
|
14631
14635
|
// - defined inside ambient module declaration located in the top level scope and source file not an external module
|
|
14632
14636
|
switch (node.parent.kind) {
|
|
14633
|
-
case
|
|
14637
|
+
case 304 /* SourceFile */:
|
|
14634
14638
|
return ts.isExternalModule(node.parent);
|
|
14635
14639
|
case 261 /* ModuleBlock */:
|
|
14636
14640
|
return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent);
|
|
@@ -14689,7 +14693,7 @@ var ts;
|
|
|
14689
14693
|
ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile;
|
|
14690
14694
|
function isBlockScope(node, parentNode) {
|
|
14691
14695
|
switch (node.kind) {
|
|
14692
|
-
case
|
|
14696
|
+
case 304 /* SourceFile */:
|
|
14693
14697
|
case 262 /* CaseBlock */:
|
|
14694
14698
|
case 291 /* CatchClause */:
|
|
14695
14699
|
case 260 /* ModuleDeclaration */:
|
|
@@ -14716,9 +14720,9 @@ var ts;
|
|
|
14716
14720
|
ts.isBlockScope = isBlockScope;
|
|
14717
14721
|
function isDeclarationWithTypeParameters(node) {
|
|
14718
14722
|
switch (node.kind) {
|
|
14719
|
-
case
|
|
14720
|
-
case
|
|
14721
|
-
case
|
|
14723
|
+
case 337 /* JSDocCallbackTag */:
|
|
14724
|
+
case 344 /* JSDocTypedefTag */:
|
|
14725
|
+
case 322 /* JSDocSignature */:
|
|
14722
14726
|
return true;
|
|
14723
14727
|
default:
|
|
14724
14728
|
ts.assertType(node);
|
|
@@ -14734,12 +14738,12 @@ var ts;
|
|
|
14734
14738
|
case 175 /* IndexSignature */:
|
|
14735
14739
|
case 178 /* FunctionType */:
|
|
14736
14740
|
case 179 /* ConstructorType */:
|
|
14737
|
-
case
|
|
14741
|
+
case 316 /* JSDocFunctionType */:
|
|
14738
14742
|
case 256 /* ClassDeclaration */:
|
|
14739
14743
|
case 225 /* ClassExpression */:
|
|
14740
14744
|
case 257 /* InterfaceDeclaration */:
|
|
14741
14745
|
case 258 /* TypeAliasDeclaration */:
|
|
14742
|
-
case
|
|
14746
|
+
case 343 /* JSDocTemplateTag */:
|
|
14743
14747
|
case 255 /* FunctionDeclaration */:
|
|
14744
14748
|
case 168 /* MethodDeclaration */:
|
|
14745
14749
|
case 170 /* Constructor */:
|
|
@@ -14852,7 +14856,7 @@ var ts;
|
|
|
14852
14856
|
else {
|
|
14853
14857
|
return ts.Debug.assertNever(name.name);
|
|
14854
14858
|
}
|
|
14855
|
-
case
|
|
14859
|
+
case 310 /* JSDocMemberName */:
|
|
14856
14860
|
return entityNameToString(name.left) + entityNameToString(name.right);
|
|
14857
14861
|
default:
|
|
14858
14862
|
return ts.Debug.assertNever(name);
|
|
@@ -14956,7 +14960,7 @@ var ts;
|
|
|
14956
14960
|
function getErrorSpanForNode(sourceFile, node) {
|
|
14957
14961
|
var errorNode = node;
|
|
14958
14962
|
switch (node.kind) {
|
|
14959
|
-
case
|
|
14963
|
+
case 304 /* SourceFile */:
|
|
14960
14964
|
var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false);
|
|
14961
14965
|
if (pos_1 === sourceFile.text.length) {
|
|
14962
14966
|
// file is empty - return span for the beginning of the file
|
|
@@ -14972,7 +14976,7 @@ var ts;
|
|
|
14972
14976
|
case 257 /* InterfaceDeclaration */:
|
|
14973
14977
|
case 260 /* ModuleDeclaration */:
|
|
14974
14978
|
case 259 /* EnumDeclaration */:
|
|
14975
|
-
case
|
|
14979
|
+
case 298 /* EnumMember */:
|
|
14976
14980
|
case 255 /* FunctionDeclaration */:
|
|
14977
14981
|
case 212 /* FunctionExpression */:
|
|
14978
14982
|
case 168 /* MethodDeclaration */:
|
|
@@ -15165,7 +15169,7 @@ var ts;
|
|
|
15165
15169
|
return ts.isHeritageClause(parent.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
15166
15170
|
case 162 /* TypeParameter */:
|
|
15167
15171
|
return node === parent.constraint;
|
|
15168
|
-
case
|
|
15172
|
+
case 343 /* JSDocTemplateTag */:
|
|
15169
15173
|
return node === parent.constraint;
|
|
15170
15174
|
case 166 /* PropertyDeclaration */:
|
|
15171
15175
|
case 165 /* PropertySignature */:
|
|
@@ -15307,12 +15311,12 @@ var ts;
|
|
|
15307
15311
|
if (node) {
|
|
15308
15312
|
switch (node.kind) {
|
|
15309
15313
|
case 202 /* BindingElement */:
|
|
15310
|
-
case
|
|
15314
|
+
case 298 /* EnumMember */:
|
|
15311
15315
|
case 163 /* Parameter */:
|
|
15312
|
-
case
|
|
15316
|
+
case 295 /* PropertyAssignment */:
|
|
15313
15317
|
case 166 /* PropertyDeclaration */:
|
|
15314
15318
|
case 165 /* PropertySignature */:
|
|
15315
|
-
case
|
|
15319
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
15316
15320
|
case 253 /* VariableDeclaration */:
|
|
15317
15321
|
return true;
|
|
15318
15322
|
}
|
|
@@ -15385,7 +15389,7 @@ var ts;
|
|
|
15385
15389
|
ts.isThisTypePredicate = isThisTypePredicate;
|
|
15386
15390
|
function getPropertyAssignment(objectLiteral, key, key2) {
|
|
15387
15391
|
return objectLiteral.properties.filter(function (property) {
|
|
15388
|
-
if (property.kind ===
|
|
15392
|
+
if (property.kind === 295 /* PropertyAssignment */) {
|
|
15389
15393
|
var propName = getTextOfPropertyName(property.name);
|
|
15390
15394
|
return key === propName || (!!key2 && key2 === propName);
|
|
15391
15395
|
}
|
|
@@ -15447,7 +15451,7 @@ var ts;
|
|
|
15447
15451
|
}
|
|
15448
15452
|
ts.getContainingFunctionOrClassStaticBlock = getContainingFunctionOrClassStaticBlock;
|
|
15449
15453
|
function getThisContainer(node, includeArrowFunctions) {
|
|
15450
|
-
ts.Debug.assert(node.kind !==
|
|
15454
|
+
ts.Debug.assert(node.kind !== 304 /* SourceFile */);
|
|
15451
15455
|
while (true) {
|
|
15452
15456
|
node = node.parent;
|
|
15453
15457
|
if (!node) {
|
|
@@ -15502,7 +15506,7 @@ var ts;
|
|
|
15502
15506
|
case 174 /* ConstructSignature */:
|
|
15503
15507
|
case 175 /* IndexSignature */:
|
|
15504
15508
|
case 259 /* EnumDeclaration */:
|
|
15505
|
-
case
|
|
15509
|
+
case 304 /* SourceFile */:
|
|
15506
15510
|
return node;
|
|
15507
15511
|
}
|
|
15508
15512
|
}
|
|
@@ -15798,7 +15802,7 @@ var ts;
|
|
|
15798
15802
|
node = node.parent;
|
|
15799
15803
|
}
|
|
15800
15804
|
return node.parent.kind === 180 /* TypeQuery */ || ts.isJSDocLinkLike(node.parent) || ts.isJSDocNameReference(node.parent) || ts.isJSDocMemberName(node.parent) || isJSXTagName(node);
|
|
15801
|
-
case
|
|
15805
|
+
case 310 /* JSDocMemberName */:
|
|
15802
15806
|
while (ts.isJSDocMemberName(node.parent)) {
|
|
15803
15807
|
node = node.parent;
|
|
15804
15808
|
}
|
|
@@ -15828,8 +15832,8 @@ var ts;
|
|
|
15828
15832
|
case 163 /* Parameter */:
|
|
15829
15833
|
case 166 /* PropertyDeclaration */:
|
|
15830
15834
|
case 165 /* PropertySignature */:
|
|
15831
|
-
case
|
|
15832
|
-
case
|
|
15835
|
+
case 298 /* EnumMember */:
|
|
15836
|
+
case 295 /* PropertyAssignment */:
|
|
15833
15837
|
case 202 /* BindingElement */:
|
|
15834
15838
|
return parent.initializer === node;
|
|
15835
15839
|
case 237 /* ExpressionStatement */:
|
|
@@ -15862,11 +15866,11 @@ var ts;
|
|
|
15862
15866
|
case 164 /* Decorator */:
|
|
15863
15867
|
case 287 /* JsxExpression */:
|
|
15864
15868
|
case 286 /* JsxSpreadAttribute */:
|
|
15865
|
-
case
|
|
15869
|
+
case 297 /* SpreadAssignment */:
|
|
15866
15870
|
return true;
|
|
15867
15871
|
case 227 /* ExpressionWithTypeArguments */:
|
|
15868
15872
|
return parent.expression === node && !isPartOfTypeNode(parent);
|
|
15869
|
-
case
|
|
15873
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
15870
15874
|
return parent.objectAssignmentInitializer === node;
|
|
15871
15875
|
default:
|
|
15872
15876
|
return isExpressionNode(parent);
|
|
@@ -16415,8 +16419,8 @@ var ts;
|
|
|
16415
16419
|
case 163 /* Parameter */:
|
|
16416
16420
|
case 168 /* MethodDeclaration */:
|
|
16417
16421
|
case 167 /* MethodSignature */:
|
|
16418
|
-
case
|
|
16419
|
-
case
|
|
16422
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
16423
|
+
case 295 /* PropertyAssignment */:
|
|
16420
16424
|
case 166 /* PropertyDeclaration */:
|
|
16421
16425
|
case 165 /* PropertySignature */:
|
|
16422
16426
|
return node.questionToken !== undefined;
|
|
@@ -16432,7 +16436,7 @@ var ts;
|
|
|
16432
16436
|
}
|
|
16433
16437
|
ts.isJSDocConstructSignature = isJSDocConstructSignature;
|
|
16434
16438
|
function isJSDocTypeAlias(node) {
|
|
16435
|
-
return node.kind ===
|
|
16439
|
+
return node.kind === 344 /* JSDocTypedefTag */ || node.kind === 337 /* JSDocCallbackTag */ || node.kind === 338 /* JSDocEnumTag */;
|
|
16436
16440
|
}
|
|
16437
16441
|
ts.isJSDocTypeAlias = isJSDocTypeAlias;
|
|
16438
16442
|
function isTypeAlias(node) {
|
|
@@ -16462,7 +16466,7 @@ var ts;
|
|
|
16462
16466
|
return v && v.initializer;
|
|
16463
16467
|
case 166 /* PropertyDeclaration */:
|
|
16464
16468
|
return node.initializer;
|
|
16465
|
-
case
|
|
16469
|
+
case 295 /* PropertyAssignment */:
|
|
16466
16470
|
return node.initializer;
|
|
16467
16471
|
}
|
|
16468
16472
|
}
|
|
@@ -16522,7 +16526,7 @@ var ts;
|
|
|
16522
16526
|
}
|
|
16523
16527
|
function getNextJSDocCommentLocation(node) {
|
|
16524
16528
|
var parent = node.parent;
|
|
16525
|
-
if (parent.kind ===
|
|
16529
|
+
if (parent.kind === 295 /* PropertyAssignment */ ||
|
|
16526
16530
|
parent.kind === 270 /* ExportAssignment */ ||
|
|
16527
16531
|
parent.kind === 166 /* PropertyDeclaration */ ||
|
|
16528
16532
|
parent.kind === 237 /* ExpressionStatement */ && node.kind === 205 /* PropertyAccessExpression */ ||
|
|
@@ -16625,7 +16629,7 @@ var ts;
|
|
|
16625
16629
|
ts.hasRestParameter = hasRestParameter;
|
|
16626
16630
|
function isRestParameter(node) {
|
|
16627
16631
|
var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type;
|
|
16628
|
-
return node.dotDotDotToken !== undefined || !!type && type.kind ===
|
|
16632
|
+
return node.dotDotDotToken !== undefined || !!type && type.kind === 317 /* JSDocVariadicType */;
|
|
16629
16633
|
}
|
|
16630
16634
|
ts.isRestParameter = isRestParameter;
|
|
16631
16635
|
function hasTypeArguments(node) {
|
|
@@ -16660,16 +16664,16 @@ var ts;
|
|
|
16660
16664
|
case 229 /* NonNullExpression */:
|
|
16661
16665
|
node = parent;
|
|
16662
16666
|
break;
|
|
16663
|
-
case
|
|
16667
|
+
case 297 /* SpreadAssignment */:
|
|
16664
16668
|
node = parent.parent;
|
|
16665
16669
|
break;
|
|
16666
|
-
case
|
|
16670
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
16667
16671
|
if (parent.name !== node) {
|
|
16668
16672
|
return 0 /* None */;
|
|
16669
16673
|
}
|
|
16670
16674
|
node = parent.parent;
|
|
16671
16675
|
break;
|
|
16672
|
-
case
|
|
16676
|
+
case 295 /* PropertyAssignment */:
|
|
16673
16677
|
if (parent.name === node) {
|
|
16674
16678
|
return 0 /* None */;
|
|
16675
16679
|
}
|
|
@@ -16829,8 +16833,8 @@ var ts;
|
|
|
16829
16833
|
case 167 /* MethodSignature */:
|
|
16830
16834
|
case 171 /* GetAccessor */:
|
|
16831
16835
|
case 172 /* SetAccessor */:
|
|
16832
|
-
case
|
|
16833
|
-
case
|
|
16836
|
+
case 298 /* EnumMember */:
|
|
16837
|
+
case 295 /* PropertyAssignment */:
|
|
16834
16838
|
case 205 /* PropertyAccessExpression */:
|
|
16835
16839
|
// Name in member declaration or property name in property access
|
|
16836
16840
|
return parent.name === node;
|
|
@@ -16872,8 +16876,8 @@ var ts;
|
|
|
16872
16876
|
node.kind === 270 /* ExportAssignment */ && exportAssignmentIsAlias(node) ||
|
|
16873
16877
|
ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) ||
|
|
16874
16878
|
ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableExpression(node.parent.right) ||
|
|
16875
|
-
node.kind ===
|
|
16876
|
-
node.kind ===
|
|
16879
|
+
node.kind === 296 /* ShorthandPropertyAssignment */ ||
|
|
16880
|
+
node.kind === 295 /* PropertyAssignment */ && isAliasableExpression(node.initializer);
|
|
16877
16881
|
}
|
|
16878
16882
|
ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;
|
|
16879
16883
|
function getAliasDeclarationFromName(node) {
|
|
@@ -16907,7 +16911,7 @@ var ts;
|
|
|
16907
16911
|
}
|
|
16908
16912
|
ts.getExportAssignmentExpression = getExportAssignmentExpression;
|
|
16909
16913
|
function getPropertyAssignmentAliasLikeExpression(node) {
|
|
16910
|
-
return node.kind ===
|
|
16914
|
+
return node.kind === 296 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 295 /* PropertyAssignment */ ? node.initializer :
|
|
16911
16915
|
node.parent.right;
|
|
16912
16916
|
}
|
|
16913
16917
|
ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression;
|
|
@@ -17177,7 +17181,7 @@ var ts;
|
|
|
17177
17181
|
|| kind === 171 /* GetAccessor */
|
|
17178
17182
|
|| kind === 172 /* SetAccessor */
|
|
17179
17183
|
|| kind === 260 /* ModuleDeclaration */
|
|
17180
|
-
|| kind ===
|
|
17184
|
+
|| kind === 304 /* SourceFile */;
|
|
17181
17185
|
}
|
|
17182
17186
|
ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment;
|
|
17183
17187
|
function nodeIsSynthesized(range) {
|
|
@@ -17426,7 +17430,7 @@ var ts;
|
|
|
17426
17430
|
})(OperatorPrecedence = ts.OperatorPrecedence || (ts.OperatorPrecedence = {}));
|
|
17427
17431
|
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
|
|
17428
17432
|
switch (nodeKind) {
|
|
17429
|
-
case
|
|
17433
|
+
case 350 /* CommaListExpression */:
|
|
17430
17434
|
return 0 /* Comma */;
|
|
17431
17435
|
case 224 /* SpreadElement */:
|
|
17432
17436
|
return 1 /* Spread */;
|
|
@@ -18226,7 +18230,7 @@ var ts;
|
|
|
18226
18230
|
ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations;
|
|
18227
18231
|
/** template tags are only available when a typedef isn't already using them */
|
|
18228
18232
|
function isNonTypeAliasTemplate(tag) {
|
|
18229
|
-
return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind ===
|
|
18233
|
+
return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 319 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias));
|
|
18230
18234
|
}
|
|
18231
18235
|
/**
|
|
18232
18236
|
* Gets the effective type annotation of the value parameter of a set accessor. If the node
|
|
@@ -19145,12 +19149,12 @@ var ts;
|
|
|
19145
19149
|
: 0 /* Read */;
|
|
19146
19150
|
case 205 /* PropertyAccessExpression */:
|
|
19147
19151
|
return parent.name !== node ? 0 /* Read */ : accessKind(parent);
|
|
19148
|
-
case
|
|
19152
|
+
case 295 /* PropertyAssignment */: {
|
|
19149
19153
|
var parentAccess = accessKind(parent.parent);
|
|
19150
19154
|
// In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write.
|
|
19151
19155
|
return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess;
|
|
19152
19156
|
}
|
|
19153
|
-
case
|
|
19157
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
19154
19158
|
// Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals.
|
|
19155
19159
|
return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent);
|
|
19156
19160
|
case 203 /* ArrayLiteralExpression */:
|
|
@@ -19317,13 +19321,13 @@ var ts;
|
|
|
19317
19321
|
|| kind === 152 /* UndefinedKeyword */
|
|
19318
19322
|
|| kind === 143 /* NeverKeyword */
|
|
19319
19323
|
|| kind === 227 /* ExpressionWithTypeArguments */
|
|
19320
|
-
|| kind ===
|
|
19321
|
-
|| kind ===
|
|
19322
|
-
|| kind ===
|
|
19323
|
-
|| kind ===
|
|
19324
|
-
|| kind ===
|
|
19325
|
-
|| kind ===
|
|
19326
|
-
|| kind ===
|
|
19324
|
+
|| kind === 311 /* JSDocAllType */
|
|
19325
|
+
|| kind === 312 /* JSDocUnknownType */
|
|
19326
|
+
|| kind === 313 /* JSDocNullableType */
|
|
19327
|
+
|| kind === 314 /* JSDocNonNullableType */
|
|
19328
|
+
|| kind === 315 /* JSDocOptionalType */
|
|
19329
|
+
|| kind === 316 /* JSDocFunctionType */
|
|
19330
|
+
|| kind === 317 /* JSDocVariadicType */;
|
|
19327
19331
|
}
|
|
19328
19332
|
ts.isTypeNodeKind = isTypeNodeKind;
|
|
19329
19333
|
function isAccessExpression(node) {
|
|
@@ -19383,7 +19387,7 @@ var ts;
|
|
|
19383
19387
|
case 206 /* ElementAccessExpression */:
|
|
19384
19388
|
case 205 /* PropertyAccessExpression */:
|
|
19385
19389
|
case 229 /* NonNullExpression */:
|
|
19386
|
-
case
|
|
19390
|
+
case 349 /* PartiallyEmittedExpression */:
|
|
19387
19391
|
node = node.expression;
|
|
19388
19392
|
continue;
|
|
19389
19393
|
}
|
|
@@ -20771,7 +20775,7 @@ var ts;
|
|
|
20771
20775
|
return parent.types;
|
|
20772
20776
|
case 183 /* TupleType */:
|
|
20773
20777
|
case 203 /* ArrayLiteralExpression */:
|
|
20774
|
-
case
|
|
20778
|
+
case 350 /* CommaListExpression */:
|
|
20775
20779
|
case 268 /* NamedImports */:
|
|
20776
20780
|
case 272 /* NamedExports */:
|
|
20777
20781
|
return parent.elements;
|
|
@@ -20801,7 +20805,7 @@ var ts;
|
|
|
20801
20805
|
return ts.isClassElement(node) ? parent.members : undefined;
|
|
20802
20806
|
case 259 /* EnumDeclaration */:
|
|
20803
20807
|
return ts.isEnumMember(node) ? parent.members : undefined;
|
|
20804
|
-
case
|
|
20808
|
+
case 304 /* SourceFile */:
|
|
20805
20809
|
return parent.statements;
|
|
20806
20810
|
}
|
|
20807
20811
|
}
|
|
@@ -21768,6 +21772,8 @@ var ts;
|
|
|
21768
21772
|
updateAssertClause: updateAssertClause,
|
|
21769
21773
|
createAssertEntry: createAssertEntry,
|
|
21770
21774
|
updateAssertEntry: updateAssertEntry,
|
|
21775
|
+
createImportTypeAssertionContainer: createImportTypeAssertionContainer,
|
|
21776
|
+
updateImportTypeAssertionContainer: updateImportTypeAssertionContainer,
|
|
21771
21777
|
createNamespaceImport: createNamespaceImport,
|
|
21772
21778
|
updateNamespaceImport: updateNamespaceImport,
|
|
21773
21779
|
createNamespaceExport: createNamespaceExport,
|
|
@@ -21788,18 +21794,18 @@ var ts;
|
|
|
21788
21794
|
createExternalModuleReference: createExternalModuleReference,
|
|
21789
21795
|
updateExternalModuleReference: updateExternalModuleReference,
|
|
21790
21796
|
// lazily load factory members for JSDoc types with similar structure
|
|
21791
|
-
get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(
|
|
21792
|
-
get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(
|
|
21793
|
-
get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(
|
|
21794
|
-
get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(
|
|
21795
|
-
get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(
|
|
21796
|
-
get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(
|
|
21797
|
-
get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(
|
|
21798
|
-
get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(
|
|
21799
|
-
get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(
|
|
21800
|
-
get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(
|
|
21801
|
-
get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(
|
|
21802
|
-
get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(
|
|
21797
|
+
get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(311 /* JSDocAllType */); },
|
|
21798
|
+
get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(312 /* JSDocUnknownType */); },
|
|
21799
|
+
get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(314 /* JSDocNonNullableType */); },
|
|
21800
|
+
get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(314 /* JSDocNonNullableType */); },
|
|
21801
|
+
get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(313 /* JSDocNullableType */); },
|
|
21802
|
+
get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(313 /* JSDocNullableType */); },
|
|
21803
|
+
get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(315 /* JSDocOptionalType */); },
|
|
21804
|
+
get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(315 /* JSDocOptionalType */); },
|
|
21805
|
+
get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(317 /* JSDocVariadicType */); },
|
|
21806
|
+
get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(317 /* JSDocVariadicType */); },
|
|
21807
|
+
get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(318 /* JSDocNamepathType */); },
|
|
21808
|
+
get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(318 /* JSDocNamepathType */); },
|
|
21803
21809
|
createJSDocFunctionType: createJSDocFunctionType,
|
|
21804
21810
|
updateJSDocFunctionType: updateJSDocFunctionType,
|
|
21805
21811
|
createJSDocTypeLiteral: createJSDocTypeLiteral,
|
|
@@ -21835,30 +21841,30 @@ var ts;
|
|
|
21835
21841
|
createJSDocLinkPlain: createJSDocLinkPlain,
|
|
21836
21842
|
updateJSDocLinkPlain: updateJSDocLinkPlain,
|
|
21837
21843
|
// lazily load factory members for JSDoc tags with similar structure
|
|
21838
|
-
get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(
|
|
21839
|
-
get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(
|
|
21840
|
-
get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(
|
|
21841
|
-
get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(
|
|
21842
|
-
get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(
|
|
21843
|
-
get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(
|
|
21844
|
-
get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(
|
|
21845
|
-
get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(
|
|
21846
|
-
get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(
|
|
21847
|
-
get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(
|
|
21848
|
-
get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(
|
|
21849
|
-
get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(
|
|
21850
|
-
get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(
|
|
21851
|
-
get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(
|
|
21852
|
-
get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(
|
|
21853
|
-
get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(
|
|
21854
|
-
get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(
|
|
21855
|
-
get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(
|
|
21856
|
-
get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(
|
|
21857
|
-
get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(
|
|
21858
|
-
get createJSDocOverrideTag() { return getJSDocSimpleTagCreateFunction(
|
|
21859
|
-
get updateJSDocOverrideTag() { return getJSDocSimpleTagUpdateFunction(
|
|
21860
|
-
get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(
|
|
21861
|
-
get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(
|
|
21844
|
+
get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(342 /* JSDocTypeTag */); },
|
|
21845
|
+
get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(342 /* JSDocTypeTag */); },
|
|
21846
|
+
get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(340 /* JSDocReturnTag */); },
|
|
21847
|
+
get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(340 /* JSDocReturnTag */); },
|
|
21848
|
+
get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(341 /* JSDocThisTag */); },
|
|
21849
|
+
get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(341 /* JSDocThisTag */); },
|
|
21850
|
+
get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(338 /* JSDocEnumTag */); },
|
|
21851
|
+
get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(338 /* JSDocEnumTag */); },
|
|
21852
|
+
get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(329 /* JSDocAuthorTag */); },
|
|
21853
|
+
get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(329 /* JSDocAuthorTag */); },
|
|
21854
|
+
get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(331 /* JSDocClassTag */); },
|
|
21855
|
+
get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(331 /* JSDocClassTag */); },
|
|
21856
|
+
get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(332 /* JSDocPublicTag */); },
|
|
21857
|
+
get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(332 /* JSDocPublicTag */); },
|
|
21858
|
+
get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(333 /* JSDocPrivateTag */); },
|
|
21859
|
+
get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(333 /* JSDocPrivateTag */); },
|
|
21860
|
+
get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(334 /* JSDocProtectedTag */); },
|
|
21861
|
+
get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(334 /* JSDocProtectedTag */); },
|
|
21862
|
+
get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(335 /* JSDocReadonlyTag */); },
|
|
21863
|
+
get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(335 /* JSDocReadonlyTag */); },
|
|
21864
|
+
get createJSDocOverrideTag() { return getJSDocSimpleTagCreateFunction(336 /* JSDocOverrideTag */); },
|
|
21865
|
+
get updateJSDocOverrideTag() { return getJSDocSimpleTagUpdateFunction(336 /* JSDocOverrideTag */); },
|
|
21866
|
+
get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(330 /* JSDocDeprecatedTag */); },
|
|
21867
|
+
get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(330 /* JSDocDeprecatedTag */); },
|
|
21862
21868
|
createJSDocUnknownTag: createJSDocUnknownTag,
|
|
21863
21869
|
updateJSDocUnknownTag: updateJSDocUnknownTag,
|
|
21864
21870
|
createJSDocText: createJSDocText,
|
|
@@ -22065,7 +22071,7 @@ var ts;
|
|
|
22065
22071
|
case 171 /* GetAccessor */:
|
|
22066
22072
|
case 172 /* SetAccessor */:
|
|
22067
22073
|
case 166 /* PropertyDeclaration */:
|
|
22068
|
-
case
|
|
22074
|
+
case 295 /* PropertyAssignment */:
|
|
22069
22075
|
if (ts.isIdentifier(name)) {
|
|
22070
22076
|
node.transformFlags |= propagateIdentifierNameFlags(name);
|
|
22071
22077
|
break;
|
|
@@ -23024,25 +23030,33 @@ var ts;
|
|
|
23024
23030
|
? update(createTemplateLiteralType(head, templateSpans), node)
|
|
23025
23031
|
: node;
|
|
23026
23032
|
}
|
|
23027
|
-
|
|
23028
|
-
|
|
23029
|
-
|
|
23033
|
+
function createImportTypeNode(argument, qualifierOrAssertions, typeArgumentsOrQualifier, isTypeOfOrTypeArguments, isTypeOf) {
|
|
23034
|
+
var assertion = qualifierOrAssertions && qualifierOrAssertions.kind === 294 /* ImportTypeAssertionContainer */ ? qualifierOrAssertions : undefined;
|
|
23035
|
+
var qualifier = qualifierOrAssertions && ts.isEntityName(qualifierOrAssertions) ? qualifierOrAssertions
|
|
23036
|
+
: typeArgumentsOrQualifier && !ts.isArray(typeArgumentsOrQualifier) ? typeArgumentsOrQualifier : undefined;
|
|
23037
|
+
var typeArguments = ts.isArray(typeArgumentsOrQualifier) ? typeArgumentsOrQualifier : ts.isArray(isTypeOfOrTypeArguments) ? isTypeOfOrTypeArguments : undefined;
|
|
23038
|
+
isTypeOf = typeof isTypeOfOrTypeArguments === "boolean" ? isTypeOfOrTypeArguments : typeof isTypeOf === "boolean" ? isTypeOf : false;
|
|
23030
23039
|
var node = createBaseNode(199 /* ImportType */);
|
|
23031
23040
|
node.argument = argument;
|
|
23041
|
+
node.assertions = assertion;
|
|
23032
23042
|
node.qualifier = qualifier;
|
|
23033
23043
|
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
23034
23044
|
node.isTypeOf = isTypeOf;
|
|
23035
23045
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
23036
23046
|
return node;
|
|
23037
23047
|
}
|
|
23038
|
-
|
|
23039
|
-
|
|
23040
|
-
|
|
23048
|
+
function updateImportTypeNode(node, argument, qualifierOrAssertions, typeArgumentsOrQualifier, isTypeOfOrTypeArguments, isTypeOf) {
|
|
23049
|
+
var assertion = qualifierOrAssertions && qualifierOrAssertions.kind === 294 /* ImportTypeAssertionContainer */ ? qualifierOrAssertions : undefined;
|
|
23050
|
+
var qualifier = qualifierOrAssertions && ts.isEntityName(qualifierOrAssertions) ? qualifierOrAssertions
|
|
23051
|
+
: typeArgumentsOrQualifier && !ts.isArray(typeArgumentsOrQualifier) ? typeArgumentsOrQualifier : undefined;
|
|
23052
|
+
var typeArguments = ts.isArray(typeArgumentsOrQualifier) ? typeArgumentsOrQualifier : ts.isArray(isTypeOfOrTypeArguments) ? isTypeOfOrTypeArguments : undefined;
|
|
23053
|
+
isTypeOf = typeof isTypeOfOrTypeArguments === "boolean" ? isTypeOfOrTypeArguments : typeof isTypeOf === "boolean" ? isTypeOf : node.isTypeOf;
|
|
23041
23054
|
return node.argument !== argument
|
|
23055
|
+
|| node.assertions !== assertion
|
|
23042
23056
|
|| node.qualifier !== qualifier
|
|
23043
23057
|
|| node.typeArguments !== typeArguments
|
|
23044
23058
|
|| node.isTypeOf !== isTypeOf
|
|
23045
|
-
? update(createImportTypeNode(argument, qualifier, typeArguments, isTypeOf), node)
|
|
23059
|
+
? update(createImportTypeNode(argument, assertion, qualifier, typeArguments, isTypeOf), node)
|
|
23046
23060
|
: node;
|
|
23047
23061
|
}
|
|
23048
23062
|
// @api
|
|
@@ -24629,6 +24643,20 @@ var ts;
|
|
|
24629
24643
|
: node;
|
|
24630
24644
|
}
|
|
24631
24645
|
// @api
|
|
24646
|
+
function createImportTypeAssertionContainer(clause, multiLine) {
|
|
24647
|
+
var node = createBaseNode(294 /* ImportTypeAssertionContainer */);
|
|
24648
|
+
node.assertClause = clause;
|
|
24649
|
+
node.multiLine = multiLine;
|
|
24650
|
+
return node;
|
|
24651
|
+
}
|
|
24652
|
+
// @api
|
|
24653
|
+
function updateImportTypeAssertionContainer(node, clause, multiLine) {
|
|
24654
|
+
return node.assertClause !== clause
|
|
24655
|
+
|| node.multiLine !== multiLine
|
|
24656
|
+
? update(createImportTypeAssertionContainer(clause, multiLine), node)
|
|
24657
|
+
: node;
|
|
24658
|
+
}
|
|
24659
|
+
// @api
|
|
24632
24660
|
function createNamespaceImport(name) {
|
|
24633
24661
|
var node = createBaseNode(267 /* NamespaceImport */);
|
|
24634
24662
|
node.name = name;
|
|
@@ -24826,7 +24854,7 @@ var ts;
|
|
|
24826
24854
|
}
|
|
24827
24855
|
// @api
|
|
24828
24856
|
function createJSDocFunctionType(parameters, type) {
|
|
24829
|
-
var node = createBaseSignatureDeclaration(
|
|
24857
|
+
var node = createBaseSignatureDeclaration(316 /* JSDocFunctionType */,
|
|
24830
24858
|
/*decorators*/ undefined,
|
|
24831
24859
|
/*modifiers*/ undefined,
|
|
24832
24860
|
/*name*/ undefined,
|
|
@@ -24843,7 +24871,7 @@ var ts;
|
|
|
24843
24871
|
// @api
|
|
24844
24872
|
function createJSDocTypeLiteral(propertyTags, isArrayType) {
|
|
24845
24873
|
if (isArrayType === void 0) { isArrayType = false; }
|
|
24846
|
-
var node = createBaseNode(
|
|
24874
|
+
var node = createBaseNode(321 /* JSDocTypeLiteral */);
|
|
24847
24875
|
node.jsDocPropertyTags = asNodeArray(propertyTags);
|
|
24848
24876
|
node.isArrayType = isArrayType;
|
|
24849
24877
|
return node;
|
|
@@ -24857,7 +24885,7 @@ var ts;
|
|
|
24857
24885
|
}
|
|
24858
24886
|
// @api
|
|
24859
24887
|
function createJSDocTypeExpression(type) {
|
|
24860
|
-
var node = createBaseNode(
|
|
24888
|
+
var node = createBaseNode(308 /* JSDocTypeExpression */);
|
|
24861
24889
|
node.type = type;
|
|
24862
24890
|
return node;
|
|
24863
24891
|
}
|
|
@@ -24869,7 +24897,7 @@ var ts;
|
|
|
24869
24897
|
}
|
|
24870
24898
|
// @api
|
|
24871
24899
|
function createJSDocSignature(typeParameters, parameters, type) {
|
|
24872
|
-
var node = createBaseNode(
|
|
24900
|
+
var node = createBaseNode(322 /* JSDocSignature */);
|
|
24873
24901
|
node.typeParameters = asNodeArray(typeParameters);
|
|
24874
24902
|
node.parameters = createNodeArray(parameters);
|
|
24875
24903
|
node.type = type;
|
|
@@ -24898,7 +24926,7 @@ var ts;
|
|
|
24898
24926
|
}
|
|
24899
24927
|
// @api
|
|
24900
24928
|
function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) {
|
|
24901
|
-
var node = createBaseJSDocTag(
|
|
24929
|
+
var node = createBaseJSDocTag(343 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment);
|
|
24902
24930
|
node.constraint = constraint;
|
|
24903
24931
|
node.typeParameters = createNodeArray(typeParameters);
|
|
24904
24932
|
return node;
|
|
@@ -24915,7 +24943,7 @@ var ts;
|
|
|
24915
24943
|
}
|
|
24916
24944
|
// @api
|
|
24917
24945
|
function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) {
|
|
24918
|
-
var node = createBaseJSDocTag(
|
|
24946
|
+
var node = createBaseJSDocTag(344 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment);
|
|
24919
24947
|
node.typeExpression = typeExpression;
|
|
24920
24948
|
node.fullName = fullName;
|
|
24921
24949
|
node.name = ts.getJSDocTypeAliasName(fullName);
|
|
@@ -24933,7 +24961,7 @@ var ts;
|
|
|
24933
24961
|
}
|
|
24934
24962
|
// @api
|
|
24935
24963
|
function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
|
|
24936
|
-
var node = createBaseJSDocTag(
|
|
24964
|
+
var node = createBaseJSDocTag(339 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment);
|
|
24937
24965
|
node.typeExpression = typeExpression;
|
|
24938
24966
|
node.name = name;
|
|
24939
24967
|
node.isNameFirst = !!isNameFirst;
|
|
@@ -24954,7 +24982,7 @@ var ts;
|
|
|
24954
24982
|
}
|
|
24955
24983
|
// @api
|
|
24956
24984
|
function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
|
|
24957
|
-
var node = createBaseJSDocTag(
|
|
24985
|
+
var node = createBaseJSDocTag(346 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment);
|
|
24958
24986
|
node.typeExpression = typeExpression;
|
|
24959
24987
|
node.name = name;
|
|
24960
24988
|
node.isNameFirst = !!isNameFirst;
|
|
@@ -24975,7 +25003,7 @@ var ts;
|
|
|
24975
25003
|
}
|
|
24976
25004
|
// @api
|
|
24977
25005
|
function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) {
|
|
24978
|
-
var node = createBaseJSDocTag(
|
|
25006
|
+
var node = createBaseJSDocTag(337 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment);
|
|
24979
25007
|
node.typeExpression = typeExpression;
|
|
24980
25008
|
node.fullName = fullName;
|
|
24981
25009
|
node.name = ts.getJSDocTypeAliasName(fullName);
|
|
@@ -24993,7 +25021,7 @@ var ts;
|
|
|
24993
25021
|
}
|
|
24994
25022
|
// @api
|
|
24995
25023
|
function createJSDocAugmentsTag(tagName, className, comment) {
|
|
24996
|
-
var node = createBaseJSDocTag(
|
|
25024
|
+
var node = createBaseJSDocTag(327 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment);
|
|
24997
25025
|
node.class = className;
|
|
24998
25026
|
return node;
|
|
24999
25027
|
}
|
|
@@ -25008,13 +25036,13 @@ var ts;
|
|
|
25008
25036
|
}
|
|
25009
25037
|
// @api
|
|
25010
25038
|
function createJSDocImplementsTag(tagName, className, comment) {
|
|
25011
|
-
var node = createBaseJSDocTag(
|
|
25039
|
+
var node = createBaseJSDocTag(328 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment);
|
|
25012
25040
|
node.class = className;
|
|
25013
25041
|
return node;
|
|
25014
25042
|
}
|
|
25015
25043
|
// @api
|
|
25016
25044
|
function createJSDocSeeTag(tagName, name, comment) {
|
|
25017
|
-
var node = createBaseJSDocTag(
|
|
25045
|
+
var node = createBaseJSDocTag(345 /* JSDocSeeTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("see"), comment);
|
|
25018
25046
|
node.name = name;
|
|
25019
25047
|
return node;
|
|
25020
25048
|
}
|
|
@@ -25028,7 +25056,7 @@ var ts;
|
|
|
25028
25056
|
}
|
|
25029
25057
|
// @api
|
|
25030
25058
|
function createJSDocNameReference(name) {
|
|
25031
|
-
var node = createBaseNode(
|
|
25059
|
+
var node = createBaseNode(309 /* JSDocNameReference */);
|
|
25032
25060
|
node.name = name;
|
|
25033
25061
|
return node;
|
|
25034
25062
|
}
|
|
@@ -25040,7 +25068,7 @@ var ts;
|
|
|
25040
25068
|
}
|
|
25041
25069
|
// @api
|
|
25042
25070
|
function createJSDocMemberName(left, right) {
|
|
25043
|
-
var node = createBaseNode(
|
|
25071
|
+
var node = createBaseNode(310 /* JSDocMemberName */);
|
|
25044
25072
|
node.left = left;
|
|
25045
25073
|
node.right = right;
|
|
25046
25074
|
node.transformFlags |=
|
|
@@ -25057,7 +25085,7 @@ var ts;
|
|
|
25057
25085
|
}
|
|
25058
25086
|
// @api
|
|
25059
25087
|
function createJSDocLink(name, text) {
|
|
25060
|
-
var node = createBaseNode(
|
|
25088
|
+
var node = createBaseNode(323 /* JSDocLink */);
|
|
25061
25089
|
node.name = name;
|
|
25062
25090
|
node.text = text;
|
|
25063
25091
|
return node;
|
|
@@ -25070,7 +25098,7 @@ var ts;
|
|
|
25070
25098
|
}
|
|
25071
25099
|
// @api
|
|
25072
25100
|
function createJSDocLinkCode(name, text) {
|
|
25073
|
-
var node = createBaseNode(
|
|
25101
|
+
var node = createBaseNode(324 /* JSDocLinkCode */);
|
|
25074
25102
|
node.name = name;
|
|
25075
25103
|
node.text = text;
|
|
25076
25104
|
return node;
|
|
@@ -25083,7 +25111,7 @@ var ts;
|
|
|
25083
25111
|
}
|
|
25084
25112
|
// @api
|
|
25085
25113
|
function createJSDocLinkPlain(name, text) {
|
|
25086
|
-
var node = createBaseNode(
|
|
25114
|
+
var node = createBaseNode(325 /* JSDocLinkPlain */);
|
|
25087
25115
|
node.name = name;
|
|
25088
25116
|
node.text = text;
|
|
25089
25117
|
return node;
|
|
@@ -25155,7 +25183,7 @@ var ts;
|
|
|
25155
25183
|
}
|
|
25156
25184
|
// @api
|
|
25157
25185
|
function createJSDocUnknownTag(tagName, comment) {
|
|
25158
|
-
var node = createBaseJSDocTag(
|
|
25186
|
+
var node = createBaseJSDocTag(326 /* JSDocTag */, tagName, comment);
|
|
25159
25187
|
return node;
|
|
25160
25188
|
}
|
|
25161
25189
|
// @api
|
|
@@ -25167,7 +25195,7 @@ var ts;
|
|
|
25167
25195
|
}
|
|
25168
25196
|
// @api
|
|
25169
25197
|
function createJSDocText(text) {
|
|
25170
|
-
var node = createBaseNode(
|
|
25198
|
+
var node = createBaseNode(320 /* JSDocText */);
|
|
25171
25199
|
node.text = text;
|
|
25172
25200
|
return node;
|
|
25173
25201
|
}
|
|
@@ -25179,7 +25207,7 @@ var ts;
|
|
|
25179
25207
|
}
|
|
25180
25208
|
// @api
|
|
25181
25209
|
function createJSDocComment(comment, tags) {
|
|
25182
|
-
var node = createBaseNode(
|
|
25210
|
+
var node = createBaseNode(319 /* JSDocComment */);
|
|
25183
25211
|
node.comment = comment;
|
|
25184
25212
|
node.tags = asNodeArray(tags);
|
|
25185
25213
|
return node;
|
|
@@ -25478,7 +25506,7 @@ var ts;
|
|
|
25478
25506
|
//
|
|
25479
25507
|
// @api
|
|
25480
25508
|
function createPropertyAssignment(name, initializer) {
|
|
25481
|
-
var node = createBaseNamedDeclaration(
|
|
25509
|
+
var node = createBaseNamedDeclaration(295 /* PropertyAssignment */,
|
|
25482
25510
|
/*decorators*/ undefined,
|
|
25483
25511
|
/*modifiers*/ undefined, name);
|
|
25484
25512
|
node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
|
|
@@ -25508,7 +25536,7 @@ var ts;
|
|
|
25508
25536
|
}
|
|
25509
25537
|
// @api
|
|
25510
25538
|
function createShorthandPropertyAssignment(name, objectAssignmentInitializer) {
|
|
25511
|
-
var node = createBaseNamedDeclaration(
|
|
25539
|
+
var node = createBaseNamedDeclaration(296 /* ShorthandPropertyAssignment */,
|
|
25512
25540
|
/*decorators*/ undefined,
|
|
25513
25541
|
/*modifiers*/ undefined, name);
|
|
25514
25542
|
node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer);
|
|
@@ -25540,7 +25568,7 @@ var ts;
|
|
|
25540
25568
|
}
|
|
25541
25569
|
// @api
|
|
25542
25570
|
function createSpreadAssignment(expression) {
|
|
25543
|
-
var node = createBaseNode(
|
|
25571
|
+
var node = createBaseNode(297 /* SpreadAssignment */);
|
|
25544
25572
|
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
|
|
25545
25573
|
node.transformFlags |=
|
|
25546
25574
|
propagateChildFlags(node.expression) |
|
|
@@ -25559,7 +25587,7 @@ var ts;
|
|
|
25559
25587
|
//
|
|
25560
25588
|
// @api
|
|
25561
25589
|
function createEnumMember(name, initializer) {
|
|
25562
|
-
var node = createBaseNode(
|
|
25590
|
+
var node = createBaseNode(298 /* EnumMember */);
|
|
25563
25591
|
node.name = asName(name);
|
|
25564
25592
|
node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
|
|
25565
25593
|
node.transformFlags |=
|
|
@@ -25580,7 +25608,7 @@ var ts;
|
|
|
25580
25608
|
//
|
|
25581
25609
|
// @api
|
|
25582
25610
|
function createSourceFile(statements, endOfFileToken, flags) {
|
|
25583
|
-
var node = baseFactory.createBaseSourceFileNode(
|
|
25611
|
+
var node = baseFactory.createBaseSourceFileNode(304 /* SourceFile */);
|
|
25584
25612
|
node.statements = createNodeArray(statements);
|
|
25585
25613
|
node.endOfFileToken = endOfFileToken;
|
|
25586
25614
|
node.flags |= flags;
|
|
@@ -25597,7 +25625,7 @@ var ts;
|
|
|
25597
25625
|
return node;
|
|
25598
25626
|
}
|
|
25599
25627
|
function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
|
|
25600
|
-
var node = baseFactory.createBaseSourceFileNode(
|
|
25628
|
+
var node = baseFactory.createBaseSourceFileNode(304 /* SourceFile */);
|
|
25601
25629
|
for (var p in source) {
|
|
25602
25630
|
if (p === "emitNode" || ts.hasProperty(node, p) || !ts.hasProperty(source, p))
|
|
25603
25631
|
continue;
|
|
@@ -25636,7 +25664,7 @@ var ts;
|
|
|
25636
25664
|
// @api
|
|
25637
25665
|
function createBundle(sourceFiles, prepends) {
|
|
25638
25666
|
if (prepends === void 0) { prepends = ts.emptyArray; }
|
|
25639
|
-
var node = createBaseNode(
|
|
25667
|
+
var node = createBaseNode(305 /* Bundle */);
|
|
25640
25668
|
node.prepends = prepends;
|
|
25641
25669
|
node.sourceFiles = sourceFiles;
|
|
25642
25670
|
return node;
|
|
@@ -25651,7 +25679,7 @@ var ts;
|
|
|
25651
25679
|
}
|
|
25652
25680
|
// @api
|
|
25653
25681
|
function createUnparsedSource(prologues, syntheticReferences, texts) {
|
|
25654
|
-
var node = createBaseNode(
|
|
25682
|
+
var node = createBaseNode(306 /* UnparsedSource */);
|
|
25655
25683
|
node.prologues = prologues;
|
|
25656
25684
|
node.syntheticReferences = syntheticReferences;
|
|
25657
25685
|
node.texts = texts;
|
|
@@ -25669,28 +25697,28 @@ var ts;
|
|
|
25669
25697
|
}
|
|
25670
25698
|
// @api
|
|
25671
25699
|
function createUnparsedPrologue(data) {
|
|
25672
|
-
return createBaseUnparsedNode(
|
|
25700
|
+
return createBaseUnparsedNode(299 /* UnparsedPrologue */, data);
|
|
25673
25701
|
}
|
|
25674
25702
|
// @api
|
|
25675
25703
|
function createUnparsedPrepend(data, texts) {
|
|
25676
|
-
var node = createBaseUnparsedNode(
|
|
25704
|
+
var node = createBaseUnparsedNode(300 /* UnparsedPrepend */, data);
|
|
25677
25705
|
node.texts = texts;
|
|
25678
25706
|
return node;
|
|
25679
25707
|
}
|
|
25680
25708
|
// @api
|
|
25681
25709
|
function createUnparsedTextLike(data, internal) {
|
|
25682
|
-
return createBaseUnparsedNode(internal ?
|
|
25710
|
+
return createBaseUnparsedNode(internal ? 302 /* UnparsedInternalText */ : 301 /* UnparsedText */, data);
|
|
25683
25711
|
}
|
|
25684
25712
|
// @api
|
|
25685
25713
|
function createUnparsedSyntheticReference(section) {
|
|
25686
|
-
var node = createBaseNode(
|
|
25714
|
+
var node = createBaseNode(303 /* UnparsedSyntheticReference */);
|
|
25687
25715
|
node.data = section.data;
|
|
25688
25716
|
node.section = section;
|
|
25689
25717
|
return node;
|
|
25690
25718
|
}
|
|
25691
25719
|
// @api
|
|
25692
25720
|
function createInputFiles() {
|
|
25693
|
-
var node = createBaseNode(
|
|
25721
|
+
var node = createBaseNode(307 /* InputFiles */);
|
|
25694
25722
|
node.javascriptText = "";
|
|
25695
25723
|
node.declarationText = "";
|
|
25696
25724
|
return node;
|
|
@@ -25709,7 +25737,7 @@ var ts;
|
|
|
25709
25737
|
}
|
|
25710
25738
|
// @api
|
|
25711
25739
|
function createSyntaxList(children) {
|
|
25712
|
-
var node = createBaseNode(
|
|
25740
|
+
var node = createBaseNode(347 /* SyntaxList */);
|
|
25713
25741
|
node._children = children;
|
|
25714
25742
|
return node;
|
|
25715
25743
|
}
|
|
@@ -25724,7 +25752,7 @@ var ts;
|
|
|
25724
25752
|
*/
|
|
25725
25753
|
// @api
|
|
25726
25754
|
function createNotEmittedStatement(original) {
|
|
25727
|
-
var node = createBaseNode(
|
|
25755
|
+
var node = createBaseNode(348 /* NotEmittedStatement */);
|
|
25728
25756
|
node.original = original;
|
|
25729
25757
|
ts.setTextRange(node, original);
|
|
25730
25758
|
return node;
|
|
@@ -25738,7 +25766,7 @@ var ts;
|
|
|
25738
25766
|
*/
|
|
25739
25767
|
// @api
|
|
25740
25768
|
function createPartiallyEmittedExpression(expression, original) {
|
|
25741
|
-
var node = createBaseNode(
|
|
25769
|
+
var node = createBaseNode(349 /* PartiallyEmittedExpression */);
|
|
25742
25770
|
node.expression = expression;
|
|
25743
25771
|
node.original = original;
|
|
25744
25772
|
node.transformFlags |=
|
|
@@ -25766,7 +25794,7 @@ var ts;
|
|
|
25766
25794
|
}
|
|
25767
25795
|
// @api
|
|
25768
25796
|
function createCommaListExpression(elements) {
|
|
25769
|
-
var node = createBaseNode(
|
|
25797
|
+
var node = createBaseNode(350 /* CommaListExpression */);
|
|
25770
25798
|
node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements));
|
|
25771
25799
|
node.transformFlags |= propagateChildrenFlags(node.elements);
|
|
25772
25800
|
return node;
|
|
@@ -25783,7 +25811,7 @@ var ts;
|
|
|
25783
25811
|
*/
|
|
25784
25812
|
// @api
|
|
25785
25813
|
function createEndOfDeclarationMarker(original) {
|
|
25786
|
-
var node = createBaseNode(
|
|
25814
|
+
var node = createBaseNode(352 /* EndOfDeclarationMarker */);
|
|
25787
25815
|
node.emitNode = {};
|
|
25788
25816
|
node.original = original;
|
|
25789
25817
|
return node;
|
|
@@ -25794,14 +25822,14 @@ var ts;
|
|
|
25794
25822
|
*/
|
|
25795
25823
|
// @api
|
|
25796
25824
|
function createMergeDeclarationMarker(original) {
|
|
25797
|
-
var node = createBaseNode(
|
|
25825
|
+
var node = createBaseNode(351 /* MergeDeclarationMarker */);
|
|
25798
25826
|
node.emitNode = {};
|
|
25799
25827
|
node.original = original;
|
|
25800
25828
|
return node;
|
|
25801
25829
|
}
|
|
25802
25830
|
// @api
|
|
25803
25831
|
function createSyntheticReferenceExpression(expression, thisArg) {
|
|
25804
|
-
var node = createBaseNode(
|
|
25832
|
+
var node = createBaseNode(353 /* SyntheticReferenceExpression */);
|
|
25805
25833
|
node.expression = expression;
|
|
25806
25834
|
node.thisArg = thisArg;
|
|
25807
25835
|
node.transformFlags |=
|
|
@@ -25823,7 +25851,7 @@ var ts;
|
|
|
25823
25851
|
if (node === undefined) {
|
|
25824
25852
|
return node;
|
|
25825
25853
|
}
|
|
25826
|
-
var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(
|
|
25854
|
+
var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(304 /* SourceFile */) :
|
|
25827
25855
|
ts.isIdentifier(node) ? baseFactory.createBaseIdentifierNode(79 /* Identifier */) :
|
|
25828
25856
|
ts.isPrivateIdentifier(node) ? baseFactory.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) :
|
|
25829
25857
|
!ts.isNodeKind(node.kind) ? baseFactory.createBaseTokenNode(node.kind) :
|
|
@@ -25946,7 +25974,7 @@ var ts;
|
|
|
25946
25974
|
case 210 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression);
|
|
25947
25975
|
case 228 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type);
|
|
25948
25976
|
case 229 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression);
|
|
25949
|
-
case
|
|
25977
|
+
case 349 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression);
|
|
25950
25978
|
}
|
|
25951
25979
|
}
|
|
25952
25980
|
/**
|
|
@@ -26432,24 +26460,24 @@ var ts;
|
|
|
26432
26460
|
}
|
|
26433
26461
|
function getDefaultTagNameForKind(kind) {
|
|
26434
26462
|
switch (kind) {
|
|
26435
|
-
case
|
|
26436
|
-
case
|
|
26437
|
-
case
|
|
26438
|
-
case
|
|
26439
|
-
case
|
|
26440
|
-
case
|
|
26441
|
-
case
|
|
26442
|
-
case
|
|
26443
|
-
case
|
|
26444
|
-
case
|
|
26445
|
-
case
|
|
26446
|
-
case
|
|
26447
|
-
case
|
|
26448
|
-
case
|
|
26449
|
-
case
|
|
26450
|
-
case
|
|
26451
|
-
case
|
|
26452
|
-
case
|
|
26463
|
+
case 342 /* JSDocTypeTag */: return "type";
|
|
26464
|
+
case 340 /* JSDocReturnTag */: return "returns";
|
|
26465
|
+
case 341 /* JSDocThisTag */: return "this";
|
|
26466
|
+
case 338 /* JSDocEnumTag */: return "enum";
|
|
26467
|
+
case 329 /* JSDocAuthorTag */: return "author";
|
|
26468
|
+
case 331 /* JSDocClassTag */: return "class";
|
|
26469
|
+
case 332 /* JSDocPublicTag */: return "public";
|
|
26470
|
+
case 333 /* JSDocPrivateTag */: return "private";
|
|
26471
|
+
case 334 /* JSDocProtectedTag */: return "protected";
|
|
26472
|
+
case 335 /* JSDocReadonlyTag */: return "readonly";
|
|
26473
|
+
case 336 /* JSDocOverrideTag */: return "override";
|
|
26474
|
+
case 343 /* JSDocTemplateTag */: return "template";
|
|
26475
|
+
case 344 /* JSDocTypedefTag */: return "typedef";
|
|
26476
|
+
case 339 /* JSDocParameterTag */: return "param";
|
|
26477
|
+
case 346 /* JSDocPropertyTag */: return "prop";
|
|
26478
|
+
case 337 /* JSDocCallbackTag */: return "callback";
|
|
26479
|
+
case 327 /* JSDocAugmentsTag */: return "augments";
|
|
26480
|
+
case 328 /* JSDocImplementsTag */: return "implements";
|
|
26453
26481
|
default:
|
|
26454
26482
|
return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind));
|
|
26455
26483
|
}
|
|
@@ -26586,7 +26614,7 @@ var ts;
|
|
|
26586
26614
|
return 536887296 /* BindingPatternExcludes */;
|
|
26587
26615
|
case 210 /* TypeAssertionExpression */:
|
|
26588
26616
|
case 228 /* AsExpression */:
|
|
26589
|
-
case
|
|
26617
|
+
case 349 /* PartiallyEmittedExpression */:
|
|
26590
26618
|
case 211 /* ParenthesizedExpression */:
|
|
26591
26619
|
case 106 /* SuperKeyword */:
|
|
26592
26620
|
return 536870912 /* OuterExpressionExcludes */;
|
|
@@ -26898,7 +26926,7 @@ var ts;
|
|
|
26898
26926
|
// To avoid holding onto transformation artifacts, we keep track of any
|
|
26899
26927
|
// parse tree node we are annotating. This allows us to clean them up after
|
|
26900
26928
|
// all transformations have completed.
|
|
26901
|
-
if (node.kind ===
|
|
26929
|
+
if (node.kind === 304 /* SourceFile */) {
|
|
26902
26930
|
return node.emitNode = { annotatedNodes: [node] };
|
|
26903
26931
|
}
|
|
26904
26932
|
var sourceFile = (_a = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node)))) !== null && _a !== void 0 ? _a : ts.Debug.fail("Could not determine parsed source file.");
|
|
@@ -28310,11 +28338,11 @@ var ts;
|
|
|
28310
28338
|
}
|
|
28311
28339
|
ts.isSyntheticExpression = isSyntheticExpression;
|
|
28312
28340
|
function isPartiallyEmittedExpression(node) {
|
|
28313
|
-
return node.kind ===
|
|
28341
|
+
return node.kind === 349 /* PartiallyEmittedExpression */;
|
|
28314
28342
|
}
|
|
28315
28343
|
ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression;
|
|
28316
28344
|
function isCommaListExpression(node) {
|
|
28317
|
-
return node.kind ===
|
|
28345
|
+
return node.kind === 350 /* CommaListExpression */;
|
|
28318
28346
|
}
|
|
28319
28347
|
ts.isCommaListExpression = isCommaListExpression;
|
|
28320
28348
|
// Misc
|
|
@@ -28504,22 +28532,22 @@ var ts;
|
|
|
28504
28532
|
}
|
|
28505
28533
|
ts.isMissingDeclaration = isMissingDeclaration;
|
|
28506
28534
|
function isNotEmittedStatement(node) {
|
|
28507
|
-
return node.kind ===
|
|
28535
|
+
return node.kind === 348 /* NotEmittedStatement */;
|
|
28508
28536
|
}
|
|
28509
28537
|
ts.isNotEmittedStatement = isNotEmittedStatement;
|
|
28510
28538
|
/* @internal */
|
|
28511
28539
|
function isSyntheticReference(node) {
|
|
28512
|
-
return node.kind ===
|
|
28540
|
+
return node.kind === 353 /* SyntheticReferenceExpression */;
|
|
28513
28541
|
}
|
|
28514
28542
|
ts.isSyntheticReference = isSyntheticReference;
|
|
28515
28543
|
/* @internal */
|
|
28516
28544
|
function isMergeDeclarationMarker(node) {
|
|
28517
|
-
return node.kind ===
|
|
28545
|
+
return node.kind === 351 /* MergeDeclarationMarker */;
|
|
28518
28546
|
}
|
|
28519
28547
|
ts.isMergeDeclarationMarker = isMergeDeclarationMarker;
|
|
28520
28548
|
/* @internal */
|
|
28521
28549
|
function isEndOfDeclarationMarker(node) {
|
|
28522
|
-
return node.kind ===
|
|
28550
|
+
return node.kind === 352 /* EndOfDeclarationMarker */;
|
|
28523
28551
|
}
|
|
28524
28552
|
ts.isEndOfDeclarationMarker = isEndOfDeclarationMarker;
|
|
28525
28553
|
// Module References
|
|
@@ -28591,26 +28619,26 @@ var ts;
|
|
|
28591
28619
|
ts.isCatchClause = isCatchClause;
|
|
28592
28620
|
// Property assignments
|
|
28593
28621
|
function isPropertyAssignment(node) {
|
|
28594
|
-
return node.kind ===
|
|
28622
|
+
return node.kind === 295 /* PropertyAssignment */;
|
|
28595
28623
|
}
|
|
28596
28624
|
ts.isPropertyAssignment = isPropertyAssignment;
|
|
28597
28625
|
function isShorthandPropertyAssignment(node) {
|
|
28598
|
-
return node.kind ===
|
|
28626
|
+
return node.kind === 296 /* ShorthandPropertyAssignment */;
|
|
28599
28627
|
}
|
|
28600
28628
|
ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment;
|
|
28601
28629
|
function isSpreadAssignment(node) {
|
|
28602
|
-
return node.kind ===
|
|
28630
|
+
return node.kind === 297 /* SpreadAssignment */;
|
|
28603
28631
|
}
|
|
28604
28632
|
ts.isSpreadAssignment = isSpreadAssignment;
|
|
28605
28633
|
// Enum
|
|
28606
28634
|
function isEnumMember(node) {
|
|
28607
|
-
return node.kind ===
|
|
28635
|
+
return node.kind === 298 /* EnumMember */;
|
|
28608
28636
|
}
|
|
28609
28637
|
ts.isEnumMember = isEnumMember;
|
|
28610
28638
|
// Unparsed
|
|
28611
28639
|
// TODO(rbuckton): isUnparsedPrologue
|
|
28612
28640
|
function isUnparsedPrepend(node) {
|
|
28613
|
-
return node.kind ===
|
|
28641
|
+
return node.kind === 300 /* UnparsedPrepend */;
|
|
28614
28642
|
}
|
|
28615
28643
|
ts.isUnparsedPrepend = isUnparsedPrepend;
|
|
28616
28644
|
// TODO(rbuckton): isUnparsedText
|
|
@@ -28618,176 +28646,176 @@ var ts;
|
|
|
28618
28646
|
// TODO(rbuckton): isUnparsedSyntheticReference
|
|
28619
28647
|
// Top-level nodes
|
|
28620
28648
|
function isSourceFile(node) {
|
|
28621
|
-
return node.kind ===
|
|
28649
|
+
return node.kind === 304 /* SourceFile */;
|
|
28622
28650
|
}
|
|
28623
28651
|
ts.isSourceFile = isSourceFile;
|
|
28624
28652
|
function isBundle(node) {
|
|
28625
|
-
return node.kind ===
|
|
28653
|
+
return node.kind === 305 /* Bundle */;
|
|
28626
28654
|
}
|
|
28627
28655
|
ts.isBundle = isBundle;
|
|
28628
28656
|
function isUnparsedSource(node) {
|
|
28629
|
-
return node.kind ===
|
|
28657
|
+
return node.kind === 306 /* UnparsedSource */;
|
|
28630
28658
|
}
|
|
28631
28659
|
ts.isUnparsedSource = isUnparsedSource;
|
|
28632
28660
|
// TODO(rbuckton): isInputFiles
|
|
28633
28661
|
// JSDoc Elements
|
|
28634
28662
|
function isJSDocTypeExpression(node) {
|
|
28635
|
-
return node.kind ===
|
|
28663
|
+
return node.kind === 308 /* JSDocTypeExpression */;
|
|
28636
28664
|
}
|
|
28637
28665
|
ts.isJSDocTypeExpression = isJSDocTypeExpression;
|
|
28638
28666
|
function isJSDocNameReference(node) {
|
|
28639
|
-
return node.kind ===
|
|
28667
|
+
return node.kind === 309 /* JSDocNameReference */;
|
|
28640
28668
|
}
|
|
28641
28669
|
ts.isJSDocNameReference = isJSDocNameReference;
|
|
28642
28670
|
function isJSDocMemberName(node) {
|
|
28643
|
-
return node.kind ===
|
|
28671
|
+
return node.kind === 310 /* JSDocMemberName */;
|
|
28644
28672
|
}
|
|
28645
28673
|
ts.isJSDocMemberName = isJSDocMemberName;
|
|
28646
28674
|
function isJSDocLink(node) {
|
|
28647
|
-
return node.kind ===
|
|
28675
|
+
return node.kind === 323 /* JSDocLink */;
|
|
28648
28676
|
}
|
|
28649
28677
|
ts.isJSDocLink = isJSDocLink;
|
|
28650
28678
|
function isJSDocLinkCode(node) {
|
|
28651
|
-
return node.kind ===
|
|
28679
|
+
return node.kind === 324 /* JSDocLinkCode */;
|
|
28652
28680
|
}
|
|
28653
28681
|
ts.isJSDocLinkCode = isJSDocLinkCode;
|
|
28654
28682
|
function isJSDocLinkPlain(node) {
|
|
28655
|
-
return node.kind ===
|
|
28683
|
+
return node.kind === 325 /* JSDocLinkPlain */;
|
|
28656
28684
|
}
|
|
28657
28685
|
ts.isJSDocLinkPlain = isJSDocLinkPlain;
|
|
28658
28686
|
function isJSDocAllType(node) {
|
|
28659
|
-
return node.kind ===
|
|
28687
|
+
return node.kind === 311 /* JSDocAllType */;
|
|
28660
28688
|
}
|
|
28661
28689
|
ts.isJSDocAllType = isJSDocAllType;
|
|
28662
28690
|
function isJSDocUnknownType(node) {
|
|
28663
|
-
return node.kind ===
|
|
28691
|
+
return node.kind === 312 /* JSDocUnknownType */;
|
|
28664
28692
|
}
|
|
28665
28693
|
ts.isJSDocUnknownType = isJSDocUnknownType;
|
|
28666
28694
|
function isJSDocNullableType(node) {
|
|
28667
|
-
return node.kind ===
|
|
28695
|
+
return node.kind === 313 /* JSDocNullableType */;
|
|
28668
28696
|
}
|
|
28669
28697
|
ts.isJSDocNullableType = isJSDocNullableType;
|
|
28670
28698
|
function isJSDocNonNullableType(node) {
|
|
28671
|
-
return node.kind ===
|
|
28699
|
+
return node.kind === 314 /* JSDocNonNullableType */;
|
|
28672
28700
|
}
|
|
28673
28701
|
ts.isJSDocNonNullableType = isJSDocNonNullableType;
|
|
28674
28702
|
function isJSDocOptionalType(node) {
|
|
28675
|
-
return node.kind ===
|
|
28703
|
+
return node.kind === 315 /* JSDocOptionalType */;
|
|
28676
28704
|
}
|
|
28677
28705
|
ts.isJSDocOptionalType = isJSDocOptionalType;
|
|
28678
28706
|
function isJSDocFunctionType(node) {
|
|
28679
|
-
return node.kind ===
|
|
28707
|
+
return node.kind === 316 /* JSDocFunctionType */;
|
|
28680
28708
|
}
|
|
28681
28709
|
ts.isJSDocFunctionType = isJSDocFunctionType;
|
|
28682
28710
|
function isJSDocVariadicType(node) {
|
|
28683
|
-
return node.kind ===
|
|
28711
|
+
return node.kind === 317 /* JSDocVariadicType */;
|
|
28684
28712
|
}
|
|
28685
28713
|
ts.isJSDocVariadicType = isJSDocVariadicType;
|
|
28686
28714
|
function isJSDocNamepathType(node) {
|
|
28687
|
-
return node.kind ===
|
|
28715
|
+
return node.kind === 318 /* JSDocNamepathType */;
|
|
28688
28716
|
}
|
|
28689
28717
|
ts.isJSDocNamepathType = isJSDocNamepathType;
|
|
28690
28718
|
function isJSDoc(node) {
|
|
28691
|
-
return node.kind ===
|
|
28719
|
+
return node.kind === 319 /* JSDocComment */;
|
|
28692
28720
|
}
|
|
28693
28721
|
ts.isJSDoc = isJSDoc;
|
|
28694
28722
|
function isJSDocTypeLiteral(node) {
|
|
28695
|
-
return node.kind ===
|
|
28723
|
+
return node.kind === 321 /* JSDocTypeLiteral */;
|
|
28696
28724
|
}
|
|
28697
28725
|
ts.isJSDocTypeLiteral = isJSDocTypeLiteral;
|
|
28698
28726
|
function isJSDocSignature(node) {
|
|
28699
|
-
return node.kind ===
|
|
28727
|
+
return node.kind === 322 /* JSDocSignature */;
|
|
28700
28728
|
}
|
|
28701
28729
|
ts.isJSDocSignature = isJSDocSignature;
|
|
28702
28730
|
// JSDoc Tags
|
|
28703
28731
|
function isJSDocAugmentsTag(node) {
|
|
28704
|
-
return node.kind ===
|
|
28732
|
+
return node.kind === 327 /* JSDocAugmentsTag */;
|
|
28705
28733
|
}
|
|
28706
28734
|
ts.isJSDocAugmentsTag = isJSDocAugmentsTag;
|
|
28707
28735
|
function isJSDocAuthorTag(node) {
|
|
28708
|
-
return node.kind ===
|
|
28736
|
+
return node.kind === 329 /* JSDocAuthorTag */;
|
|
28709
28737
|
}
|
|
28710
28738
|
ts.isJSDocAuthorTag = isJSDocAuthorTag;
|
|
28711
28739
|
function isJSDocClassTag(node) {
|
|
28712
|
-
return node.kind ===
|
|
28740
|
+
return node.kind === 331 /* JSDocClassTag */;
|
|
28713
28741
|
}
|
|
28714
28742
|
ts.isJSDocClassTag = isJSDocClassTag;
|
|
28715
28743
|
function isJSDocCallbackTag(node) {
|
|
28716
|
-
return node.kind ===
|
|
28744
|
+
return node.kind === 337 /* JSDocCallbackTag */;
|
|
28717
28745
|
}
|
|
28718
28746
|
ts.isJSDocCallbackTag = isJSDocCallbackTag;
|
|
28719
28747
|
function isJSDocPublicTag(node) {
|
|
28720
|
-
return node.kind ===
|
|
28748
|
+
return node.kind === 332 /* JSDocPublicTag */;
|
|
28721
28749
|
}
|
|
28722
28750
|
ts.isJSDocPublicTag = isJSDocPublicTag;
|
|
28723
28751
|
function isJSDocPrivateTag(node) {
|
|
28724
|
-
return node.kind ===
|
|
28752
|
+
return node.kind === 333 /* JSDocPrivateTag */;
|
|
28725
28753
|
}
|
|
28726
28754
|
ts.isJSDocPrivateTag = isJSDocPrivateTag;
|
|
28727
28755
|
function isJSDocProtectedTag(node) {
|
|
28728
|
-
return node.kind ===
|
|
28756
|
+
return node.kind === 334 /* JSDocProtectedTag */;
|
|
28729
28757
|
}
|
|
28730
28758
|
ts.isJSDocProtectedTag = isJSDocProtectedTag;
|
|
28731
28759
|
function isJSDocReadonlyTag(node) {
|
|
28732
|
-
return node.kind ===
|
|
28760
|
+
return node.kind === 335 /* JSDocReadonlyTag */;
|
|
28733
28761
|
}
|
|
28734
28762
|
ts.isJSDocReadonlyTag = isJSDocReadonlyTag;
|
|
28735
28763
|
function isJSDocOverrideTag(node) {
|
|
28736
|
-
return node.kind ===
|
|
28764
|
+
return node.kind === 336 /* JSDocOverrideTag */;
|
|
28737
28765
|
}
|
|
28738
28766
|
ts.isJSDocOverrideTag = isJSDocOverrideTag;
|
|
28739
28767
|
function isJSDocDeprecatedTag(node) {
|
|
28740
|
-
return node.kind ===
|
|
28768
|
+
return node.kind === 330 /* JSDocDeprecatedTag */;
|
|
28741
28769
|
}
|
|
28742
28770
|
ts.isJSDocDeprecatedTag = isJSDocDeprecatedTag;
|
|
28743
28771
|
function isJSDocSeeTag(node) {
|
|
28744
|
-
return node.kind ===
|
|
28772
|
+
return node.kind === 345 /* JSDocSeeTag */;
|
|
28745
28773
|
}
|
|
28746
28774
|
ts.isJSDocSeeTag = isJSDocSeeTag;
|
|
28747
28775
|
function isJSDocEnumTag(node) {
|
|
28748
|
-
return node.kind ===
|
|
28776
|
+
return node.kind === 338 /* JSDocEnumTag */;
|
|
28749
28777
|
}
|
|
28750
28778
|
ts.isJSDocEnumTag = isJSDocEnumTag;
|
|
28751
28779
|
function isJSDocParameterTag(node) {
|
|
28752
|
-
return node.kind ===
|
|
28780
|
+
return node.kind === 339 /* JSDocParameterTag */;
|
|
28753
28781
|
}
|
|
28754
28782
|
ts.isJSDocParameterTag = isJSDocParameterTag;
|
|
28755
28783
|
function isJSDocReturnTag(node) {
|
|
28756
|
-
return node.kind ===
|
|
28784
|
+
return node.kind === 340 /* JSDocReturnTag */;
|
|
28757
28785
|
}
|
|
28758
28786
|
ts.isJSDocReturnTag = isJSDocReturnTag;
|
|
28759
28787
|
function isJSDocThisTag(node) {
|
|
28760
|
-
return node.kind ===
|
|
28788
|
+
return node.kind === 341 /* JSDocThisTag */;
|
|
28761
28789
|
}
|
|
28762
28790
|
ts.isJSDocThisTag = isJSDocThisTag;
|
|
28763
28791
|
function isJSDocTypeTag(node) {
|
|
28764
|
-
return node.kind ===
|
|
28792
|
+
return node.kind === 342 /* JSDocTypeTag */;
|
|
28765
28793
|
}
|
|
28766
28794
|
ts.isJSDocTypeTag = isJSDocTypeTag;
|
|
28767
28795
|
function isJSDocTemplateTag(node) {
|
|
28768
|
-
return node.kind ===
|
|
28796
|
+
return node.kind === 343 /* JSDocTemplateTag */;
|
|
28769
28797
|
}
|
|
28770
28798
|
ts.isJSDocTemplateTag = isJSDocTemplateTag;
|
|
28771
28799
|
function isJSDocTypedefTag(node) {
|
|
28772
|
-
return node.kind ===
|
|
28800
|
+
return node.kind === 344 /* JSDocTypedefTag */;
|
|
28773
28801
|
}
|
|
28774
28802
|
ts.isJSDocTypedefTag = isJSDocTypedefTag;
|
|
28775
28803
|
function isJSDocUnknownTag(node) {
|
|
28776
|
-
return node.kind ===
|
|
28804
|
+
return node.kind === 326 /* JSDocTag */;
|
|
28777
28805
|
}
|
|
28778
28806
|
ts.isJSDocUnknownTag = isJSDocUnknownTag;
|
|
28779
28807
|
function isJSDocPropertyTag(node) {
|
|
28780
|
-
return node.kind ===
|
|
28808
|
+
return node.kind === 346 /* JSDocPropertyTag */;
|
|
28781
28809
|
}
|
|
28782
28810
|
ts.isJSDocPropertyTag = isJSDocPropertyTag;
|
|
28783
28811
|
function isJSDocImplementsTag(node) {
|
|
28784
|
-
return node.kind ===
|
|
28812
|
+
return node.kind === 328 /* JSDocImplementsTag */;
|
|
28785
28813
|
}
|
|
28786
28814
|
ts.isJSDocImplementsTag = isJSDocImplementsTag;
|
|
28787
28815
|
// Synthesized list
|
|
28788
28816
|
/* @internal */
|
|
28789
28817
|
function isSyntaxList(n) {
|
|
28790
|
-
return n.kind ===
|
|
28818
|
+
return n.kind === 347 /* SyntaxList */;
|
|
28791
28819
|
}
|
|
28792
28820
|
ts.isSyntaxList = isSyntaxList;
|
|
28793
28821
|
})(ts || (ts = {}));
|
|
@@ -28989,9 +29017,9 @@ var ts;
|
|
|
28989
29017
|
case 171 /* GetAccessor */:
|
|
28990
29018
|
case 172 /* SetAccessor */:
|
|
28991
29019
|
return createExpressionForAccessorDeclaration(factory, node.properties, property, receiver, !!node.multiLine);
|
|
28992
|
-
case
|
|
29020
|
+
case 295 /* PropertyAssignment */:
|
|
28993
29021
|
return createExpressionForPropertyAssignment(factory, property, receiver);
|
|
28994
|
-
case
|
|
29022
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
28995
29023
|
return createExpressionForShorthandPropertyAssignment(factory, property, receiver);
|
|
28996
29024
|
case 168 /* MethodDeclaration */:
|
|
28997
29025
|
return createExpressionForMethodDeclaration(factory, property, receiver);
|
|
@@ -29102,7 +29130,7 @@ var ts;
|
|
|
29102
29130
|
ts.startsWithUseStrict = startsWithUseStrict;
|
|
29103
29131
|
function isCommaSequence(node) {
|
|
29104
29132
|
return node.kind === 220 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ ||
|
|
29105
|
-
node.kind ===
|
|
29133
|
+
node.kind === 350 /* CommaListExpression */;
|
|
29106
29134
|
}
|
|
29107
29135
|
ts.isCommaSequence = isCommaSequence;
|
|
29108
29136
|
function isJSDocTypeAssertion(node) {
|
|
@@ -29130,7 +29158,7 @@ var ts;
|
|
|
29130
29158
|
return (kinds & 2 /* TypeAssertions */) !== 0;
|
|
29131
29159
|
case 229 /* NonNullExpression */:
|
|
29132
29160
|
return (kinds & 4 /* NonNullAssertions */) !== 0;
|
|
29133
|
-
case
|
|
29161
|
+
case 349 /* PartiallyEmittedExpression */:
|
|
29134
29162
|
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
|
|
29135
29163
|
}
|
|
29136
29164
|
return false;
|
|
@@ -29374,7 +29402,7 @@ var ts;
|
|
|
29374
29402
|
}
|
|
29375
29403
|
if (ts.isObjectLiteralElementLike(bindingElement)) {
|
|
29376
29404
|
switch (bindingElement.kind) {
|
|
29377
|
-
case
|
|
29405
|
+
case 295 /* PropertyAssignment */:
|
|
29378
29406
|
// `b` in `({ a: b } = ...)`
|
|
29379
29407
|
// `b` in `({ a: b = 1 } = ...)`
|
|
29380
29408
|
// `{b}` in `({ a: {b} } = ...)`
|
|
@@ -29386,11 +29414,11 @@ var ts;
|
|
|
29386
29414
|
// `b[0]` in `({ a: b[0] } = ...)`
|
|
29387
29415
|
// `b[0]` in `({ a: b[0] = 1 } = ...)`
|
|
29388
29416
|
return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);
|
|
29389
|
-
case
|
|
29417
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
29390
29418
|
// `a` in `({ a } = ...)`
|
|
29391
29419
|
// `a` in `({ a = 1 } = ...)`
|
|
29392
29420
|
return bindingElement.name;
|
|
29393
|
-
case
|
|
29421
|
+
case 297 /* SpreadAssignment */:
|
|
29394
29422
|
// `a` in `({ ...a } = ...)`
|
|
29395
29423
|
return getTargetOfBindingOrAssignmentElement(bindingElement.expression);
|
|
29396
29424
|
}
|
|
@@ -29427,7 +29455,7 @@ var ts;
|
|
|
29427
29455
|
// `...` in `let [...a] = ...`
|
|
29428
29456
|
return bindingElement.dotDotDotToken;
|
|
29429
29457
|
case 224 /* SpreadElement */:
|
|
29430
|
-
case
|
|
29458
|
+
case 297 /* SpreadAssignment */:
|
|
29431
29459
|
// `...` in `[...a] = ...`
|
|
29432
29460
|
return bindingElement;
|
|
29433
29461
|
}
|
|
@@ -29460,7 +29488,7 @@ var ts;
|
|
|
29460
29488
|
: propertyName;
|
|
29461
29489
|
}
|
|
29462
29490
|
break;
|
|
29463
|
-
case
|
|
29491
|
+
case 295 /* PropertyAssignment */:
|
|
29464
29492
|
// `a` in `({ a: b } = ...)`
|
|
29465
29493
|
// `[a]` in `({ [a]: b } = ...)`
|
|
29466
29494
|
// `"a"` in `({ "a": b } = ...)`
|
|
@@ -29475,7 +29503,7 @@ var ts;
|
|
|
29475
29503
|
: propertyName;
|
|
29476
29504
|
}
|
|
29477
29505
|
break;
|
|
29478
|
-
case
|
|
29506
|
+
case 297 /* SpreadAssignment */:
|
|
29479
29507
|
// `a` in `({ ...a } = ...)`
|
|
29480
29508
|
if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) {
|
|
29481
29509
|
return ts.Debug.failBadSyntaxKind(bindingElement.name);
|
|
@@ -29906,7 +29934,7 @@ var ts;
|
|
|
29906
29934
|
visitNode(cbNode, node.constraint) ||
|
|
29907
29935
|
visitNode(cbNode, node.default) ||
|
|
29908
29936
|
visitNode(cbNode, node.expression);
|
|
29909
|
-
case
|
|
29937
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
29910
29938
|
return visitNodes(cbNode, cbNodes, node.decorators) ||
|
|
29911
29939
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
29912
29940
|
visitNode(cbNode, node.name) ||
|
|
@@ -29914,7 +29942,7 @@ var ts;
|
|
|
29914
29942
|
visitNode(cbNode, node.exclamationToken) ||
|
|
29915
29943
|
visitNode(cbNode, node.equalsToken) ||
|
|
29916
29944
|
visitNode(cbNode, node.objectAssignmentInitializer);
|
|
29917
|
-
case
|
|
29945
|
+
case 297 /* SpreadAssignment */:
|
|
29918
29946
|
return visitNode(cbNode, node.expression);
|
|
29919
29947
|
case 163 /* Parameter */:
|
|
29920
29948
|
return visitNodes(cbNode, cbNodes, node.decorators) ||
|
|
@@ -29939,7 +29967,7 @@ var ts;
|
|
|
29939
29967
|
visitNode(cbNode, node.questionToken) ||
|
|
29940
29968
|
visitNode(cbNode, node.type) ||
|
|
29941
29969
|
visitNode(cbNode, node.initializer);
|
|
29942
|
-
case
|
|
29970
|
+
case 295 /* PropertyAssignment */:
|
|
29943
29971
|
return visitNodes(cbNode, cbNodes, node.decorators) ||
|
|
29944
29972
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
29945
29973
|
visitNode(cbNode, node.name) ||
|
|
@@ -30020,8 +30048,11 @@ var ts;
|
|
|
30020
30048
|
return visitNode(cbNode, node.typeParameter);
|
|
30021
30049
|
case 199 /* ImportType */:
|
|
30022
30050
|
return visitNode(cbNode, node.argument) ||
|
|
30051
|
+
visitNode(cbNode, node.assertions) ||
|
|
30023
30052
|
visitNode(cbNode, node.qualifier) ||
|
|
30024
30053
|
visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
30054
|
+
case 294 /* ImportTypeAssertionContainer */:
|
|
30055
|
+
return visitNode(cbNode, node.assertClause);
|
|
30025
30056
|
case 190 /* ParenthesizedType */:
|
|
30026
30057
|
case 192 /* TypeOperator */:
|
|
30027
30058
|
return visitNode(cbNode, node.type);
|
|
@@ -30110,7 +30141,7 @@ var ts;
|
|
|
30110
30141
|
case 234 /* Block */:
|
|
30111
30142
|
case 261 /* ModuleBlock */:
|
|
30112
30143
|
return visitNodes(cbNode, cbNodes, node.statements);
|
|
30113
|
-
case
|
|
30144
|
+
case 304 /* SourceFile */:
|
|
30114
30145
|
return visitNodes(cbNode, cbNodes, node.statements) ||
|
|
30115
30146
|
visitNode(cbNode, node.endOfFileToken);
|
|
30116
30147
|
case 236 /* VariableStatement */:
|
|
@@ -30203,7 +30234,7 @@ var ts;
|
|
|
30203
30234
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
30204
30235
|
visitNode(cbNode, node.name) ||
|
|
30205
30236
|
visitNodes(cbNode, cbNodes, node.members);
|
|
30206
|
-
case
|
|
30237
|
+
case 298 /* EnumMember */:
|
|
30207
30238
|
return visitNode(cbNode, node.name) ||
|
|
30208
30239
|
visitNode(cbNode, node.initializer);
|
|
30209
30240
|
case 260 /* ModuleDeclaration */:
|
|
@@ -30272,7 +30303,7 @@ var ts;
|
|
|
30272
30303
|
return visitNode(cbNode, node.expression);
|
|
30273
30304
|
case 275 /* MissingDeclaration */:
|
|
30274
30305
|
return visitNodes(cbNode, cbNodes, node.decorators);
|
|
30275
|
-
case
|
|
30306
|
+
case 350 /* CommaListExpression */:
|
|
30276
30307
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
30277
30308
|
case 277 /* JsxElement */:
|
|
30278
30309
|
return visitNode(cbNode, node.openingElement) ||
|
|
@@ -30301,29 +30332,29 @@ var ts;
|
|
|
30301
30332
|
return visitNode(cbNode, node.tagName);
|
|
30302
30333
|
case 184 /* OptionalType */:
|
|
30303
30334
|
case 185 /* RestType */:
|
|
30304
|
-
case
|
|
30305
|
-
case
|
|
30306
|
-
case
|
|
30307
|
-
case
|
|
30308
|
-
case
|
|
30335
|
+
case 308 /* JSDocTypeExpression */:
|
|
30336
|
+
case 314 /* JSDocNonNullableType */:
|
|
30337
|
+
case 313 /* JSDocNullableType */:
|
|
30338
|
+
case 315 /* JSDocOptionalType */:
|
|
30339
|
+
case 317 /* JSDocVariadicType */:
|
|
30309
30340
|
return visitNode(cbNode, node.type);
|
|
30310
|
-
case
|
|
30341
|
+
case 316 /* JSDocFunctionType */:
|
|
30311
30342
|
return visitNodes(cbNode, cbNodes, node.parameters) ||
|
|
30312
30343
|
visitNode(cbNode, node.type);
|
|
30313
|
-
case
|
|
30344
|
+
case 319 /* JSDocComment */:
|
|
30314
30345
|
return (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment))
|
|
30315
30346
|
|| visitNodes(cbNode, cbNodes, node.tags);
|
|
30316
|
-
case
|
|
30347
|
+
case 345 /* JSDocSeeTag */:
|
|
30317
30348
|
return visitNode(cbNode, node.tagName) ||
|
|
30318
30349
|
visitNode(cbNode, node.name) ||
|
|
30319
30350
|
(typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
|
|
30320
|
-
case
|
|
30351
|
+
case 309 /* JSDocNameReference */:
|
|
30321
30352
|
return visitNode(cbNode, node.name);
|
|
30322
|
-
case
|
|
30353
|
+
case 310 /* JSDocMemberName */:
|
|
30323
30354
|
return visitNode(cbNode, node.left) ||
|
|
30324
30355
|
visitNode(cbNode, node.right);
|
|
30325
|
-
case
|
|
30326
|
-
case
|
|
30356
|
+
case 339 /* JSDocParameterTag */:
|
|
30357
|
+
case 346 /* JSDocPropertyTag */:
|
|
30327
30358
|
return visitNode(cbNode, node.tagName) ||
|
|
30328
30359
|
(node.isNameFirst
|
|
30329
30360
|
? visitNode(cbNode, node.name) ||
|
|
@@ -30332,64 +30363,64 @@ var ts;
|
|
|
30332
30363
|
: visitNode(cbNode, node.typeExpression) ||
|
|
30333
30364
|
visitNode(cbNode, node.name) ||
|
|
30334
30365
|
(typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment)));
|
|
30335
|
-
case
|
|
30366
|
+
case 329 /* JSDocAuthorTag */:
|
|
30336
30367
|
return visitNode(cbNode, node.tagName) ||
|
|
30337
30368
|
(typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
|
|
30338
|
-
case
|
|
30369
|
+
case 328 /* JSDocImplementsTag */:
|
|
30339
30370
|
return visitNode(cbNode, node.tagName) ||
|
|
30340
30371
|
visitNode(cbNode, node.class) ||
|
|
30341
30372
|
(typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
|
|
30342
|
-
case
|
|
30373
|
+
case 327 /* JSDocAugmentsTag */:
|
|
30343
30374
|
return visitNode(cbNode, node.tagName) ||
|
|
30344
30375
|
visitNode(cbNode, node.class) ||
|
|
30345
30376
|
(typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
|
|
30346
|
-
case
|
|
30377
|
+
case 343 /* JSDocTemplateTag */:
|
|
30347
30378
|
return visitNode(cbNode, node.tagName) ||
|
|
30348
30379
|
visitNode(cbNode, node.constraint) ||
|
|
30349
30380
|
visitNodes(cbNode, cbNodes, node.typeParameters) ||
|
|
30350
30381
|
(typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
|
|
30351
|
-
case
|
|
30382
|
+
case 344 /* JSDocTypedefTag */:
|
|
30352
30383
|
return visitNode(cbNode, node.tagName) ||
|
|
30353
30384
|
(node.typeExpression &&
|
|
30354
|
-
node.typeExpression.kind ===
|
|
30385
|
+
node.typeExpression.kind === 308 /* JSDocTypeExpression */
|
|
30355
30386
|
? visitNode(cbNode, node.typeExpression) ||
|
|
30356
30387
|
visitNode(cbNode, node.fullName) ||
|
|
30357
30388
|
(typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment))
|
|
30358
30389
|
: visitNode(cbNode, node.fullName) ||
|
|
30359
30390
|
visitNode(cbNode, node.typeExpression) ||
|
|
30360
30391
|
(typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment)));
|
|
30361
|
-
case
|
|
30392
|
+
case 337 /* JSDocCallbackTag */:
|
|
30362
30393
|
return visitNode(cbNode, node.tagName) ||
|
|
30363
30394
|
visitNode(cbNode, node.fullName) ||
|
|
30364
30395
|
visitNode(cbNode, node.typeExpression) ||
|
|
30365
30396
|
(typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
|
|
30366
|
-
case
|
|
30367
|
-
case
|
|
30368
|
-
case
|
|
30369
|
-
case
|
|
30397
|
+
case 340 /* JSDocReturnTag */:
|
|
30398
|
+
case 342 /* JSDocTypeTag */:
|
|
30399
|
+
case 341 /* JSDocThisTag */:
|
|
30400
|
+
case 338 /* JSDocEnumTag */:
|
|
30370
30401
|
return visitNode(cbNode, node.tagName) ||
|
|
30371
30402
|
visitNode(cbNode, node.typeExpression) ||
|
|
30372
30403
|
(typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
|
|
30373
|
-
case
|
|
30404
|
+
case 322 /* JSDocSignature */:
|
|
30374
30405
|
return ts.forEach(node.typeParameters, cbNode) ||
|
|
30375
30406
|
ts.forEach(node.parameters, cbNode) ||
|
|
30376
30407
|
visitNode(cbNode, node.type);
|
|
30377
|
-
case
|
|
30378
|
-
case
|
|
30379
|
-
case
|
|
30408
|
+
case 323 /* JSDocLink */:
|
|
30409
|
+
case 324 /* JSDocLinkCode */:
|
|
30410
|
+
case 325 /* JSDocLinkPlain */:
|
|
30380
30411
|
return visitNode(cbNode, node.name);
|
|
30381
|
-
case
|
|
30412
|
+
case 321 /* JSDocTypeLiteral */:
|
|
30382
30413
|
return ts.forEach(node.jsDocPropertyTags, cbNode);
|
|
30383
|
-
case
|
|
30384
|
-
case
|
|
30385
|
-
case
|
|
30386
|
-
case
|
|
30387
|
-
case
|
|
30388
|
-
case
|
|
30389
|
-
case
|
|
30414
|
+
case 326 /* JSDocTag */:
|
|
30415
|
+
case 331 /* JSDocClassTag */:
|
|
30416
|
+
case 332 /* JSDocPublicTag */:
|
|
30417
|
+
case 333 /* JSDocPrivateTag */:
|
|
30418
|
+
case 334 /* JSDocProtectedTag */:
|
|
30419
|
+
case 335 /* JSDocReadonlyTag */:
|
|
30420
|
+
case 330 /* JSDocDeprecatedTag */:
|
|
30390
30421
|
return visitNode(cbNode, node.tagName)
|
|
30391
30422
|
|| (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
|
|
30392
|
-
case
|
|
30423
|
+
case 349 /* PartiallyEmittedExpression */:
|
|
30393
30424
|
return visitNode(cbNode, node.expression);
|
|
30394
30425
|
}
|
|
30395
30426
|
}
|
|
@@ -31366,18 +31397,8 @@ var ts;
|
|
|
31366
31397
|
if (tryParseSemicolon()) {
|
|
31367
31398
|
return;
|
|
31368
31399
|
}
|
|
31369
|
-
// If an initializer was parsed but there is still an error in finding the next semicolon,
|
|
31370
|
-
// we generally know there was an error already reported in the initializer...
|
|
31371
|
-
// class Example { a = new Map([), ) }
|
|
31372
|
-
// ~
|
|
31373
31400
|
if (initializer) {
|
|
31374
|
-
|
|
31375
|
-
// case we can know that regardless of the initializer we should complain on the block.
|
|
31376
|
-
// class Example { a = 0 {} }
|
|
31377
|
-
// ~
|
|
31378
|
-
if (token() === 18 /* OpenBraceToken */) {
|
|
31379
|
-
parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */));
|
|
31380
|
-
}
|
|
31401
|
+
parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */));
|
|
31381
31402
|
return;
|
|
31382
31403
|
}
|
|
31383
31404
|
parseErrorForMissingSemicolonAfter(name);
|
|
@@ -32091,7 +32112,7 @@ var ts;
|
|
|
32091
32112
|
return false;
|
|
32092
32113
|
}
|
|
32093
32114
|
function isReusableEnumMember(node) {
|
|
32094
|
-
return node.kind ===
|
|
32115
|
+
return node.kind === 298 /* EnumMember */;
|
|
32095
32116
|
}
|
|
32096
32117
|
function isReusableTypeMember(node) {
|
|
32097
32118
|
if (node) {
|
|
@@ -33027,6 +33048,22 @@ var ts;
|
|
|
33027
33048
|
nextToken();
|
|
33028
33049
|
return token() === 100 /* ImportKeyword */;
|
|
33029
33050
|
}
|
|
33051
|
+
function parseImportTypeAssertions() {
|
|
33052
|
+
var pos = getNodePos();
|
|
33053
|
+
var openBracePosition = scanner.getTokenPos();
|
|
33054
|
+
parseExpected(18 /* OpenBraceToken */);
|
|
33055
|
+
var multiLine = scanner.hasPrecedingLineBreak();
|
|
33056
|
+
parseExpected(129 /* AssertKeyword */);
|
|
33057
|
+
parseExpected(58 /* ColonToken */);
|
|
33058
|
+
var clause = parseAssertClause(/*skipAssertKeyword*/ true);
|
|
33059
|
+
if (!parseExpected(19 /* CloseBraceToken */)) {
|
|
33060
|
+
var lastError = ts.lastOrUndefined(parseDiagnostics);
|
|
33061
|
+
if (lastError && lastError.code === ts.Diagnostics._0_expected.code) {
|
|
33062
|
+
ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));
|
|
33063
|
+
}
|
|
33064
|
+
}
|
|
33065
|
+
return finishNode(factory.createImportTypeAssertionContainer(clause, multiLine), pos);
|
|
33066
|
+
}
|
|
33030
33067
|
function parseImportType() {
|
|
33031
33068
|
sourceFlags |= 1048576 /* PossiblyContainsDynamicImport */;
|
|
33032
33069
|
var pos = getNodePos();
|
|
@@ -33034,10 +33071,14 @@ var ts;
|
|
|
33034
33071
|
parseExpected(100 /* ImportKeyword */);
|
|
33035
33072
|
parseExpected(20 /* OpenParenToken */);
|
|
33036
33073
|
var type = parseType();
|
|
33074
|
+
var assertions;
|
|
33075
|
+
if (parseOptional(27 /* CommaToken */)) {
|
|
33076
|
+
assertions = parseImportTypeAssertions();
|
|
33077
|
+
}
|
|
33037
33078
|
parseExpected(21 /* CloseParenToken */);
|
|
33038
33079
|
var qualifier = parseOptional(24 /* DotToken */) ? parseEntityNameOfTypeReference() : undefined;
|
|
33039
33080
|
var typeArguments = parseTypeArgumentsOfTypeReference();
|
|
33040
|
-
return finishNode(factory.createImportTypeNode(type, qualifier, typeArguments, isTypeOf), pos);
|
|
33081
|
+
return finishNode(factory.createImportTypeNode(type, assertions, qualifier, typeArguments, isTypeOf), pos);
|
|
33041
33082
|
}
|
|
33042
33083
|
function nextTokenIsNumericOrBigIntLiteral() {
|
|
33043
33084
|
nextToken();
|
|
@@ -36225,9 +36266,11 @@ var ts;
|
|
|
36225
36266
|
var value = parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false);
|
|
36226
36267
|
return finishNode(factory.createAssertEntry(name, value), pos);
|
|
36227
36268
|
}
|
|
36228
|
-
function parseAssertClause() {
|
|
36269
|
+
function parseAssertClause(skipAssertKeyword) {
|
|
36229
36270
|
var pos = getNodePos();
|
|
36230
|
-
|
|
36271
|
+
if (!skipAssertKeyword) {
|
|
36272
|
+
parseExpected(129 /* AssertKeyword */);
|
|
36273
|
+
}
|
|
36231
36274
|
var openBracePosition = scanner.getTokenPos();
|
|
36232
36275
|
if (parseExpected(18 /* OpenBraceToken */)) {
|
|
36233
36276
|
var multiLine = scanner.hasPrecedingLineBreak();
|
|
@@ -37115,7 +37158,7 @@ var ts;
|
|
|
37115
37158
|
var child = void 0;
|
|
37116
37159
|
var children = void 0;
|
|
37117
37160
|
while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) {
|
|
37118
|
-
if (child.kind ===
|
|
37161
|
+
if (child.kind === 339 /* JSDocParameterTag */ || child.kind === 346 /* JSDocPropertyTag */) {
|
|
37119
37162
|
children = ts.append(children, child);
|
|
37120
37163
|
}
|
|
37121
37164
|
}
|
|
@@ -37238,7 +37281,7 @@ var ts;
|
|
|
37238
37281
|
var hasChildren = false;
|
|
37239
37282
|
while (child = tryParse(function () { return parseChildPropertyTag(indent); })) {
|
|
37240
37283
|
hasChildren = true;
|
|
37241
|
-
if (child.kind ===
|
|
37284
|
+
if (child.kind === 342 /* JSDocTypeTag */) {
|
|
37242
37285
|
if (childTypeTag) {
|
|
37243
37286
|
parseErrorAtCurrentToken(ts.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
|
|
37244
37287
|
var lastError = ts.lastOrUndefined(parseDiagnostics);
|
|
@@ -37309,7 +37352,7 @@ var ts;
|
|
|
37309
37352
|
var returnTag = tryParse(function () {
|
|
37310
37353
|
if (parseOptionalJsdoc(59 /* AtToken */)) {
|
|
37311
37354
|
var tag = parseTag(indent);
|
|
37312
|
-
if (tag && tag.kind ===
|
|
37355
|
+
if (tag && tag.kind === 340 /* JSDocReturnTag */) {
|
|
37313
37356
|
return tag;
|
|
37314
37357
|
}
|
|
37315
37358
|
}
|
|
@@ -37343,7 +37386,7 @@ var ts;
|
|
|
37343
37386
|
case 59 /* AtToken */:
|
|
37344
37387
|
if (canParseTag) {
|
|
37345
37388
|
var child = tryParseChildTag(target, indent);
|
|
37346
|
-
if (child && (child.kind ===
|
|
37389
|
+
if (child && (child.kind === 339 /* JSDocParameterTag */ || child.kind === 346 /* JSDocPropertyTag */) &&
|
|
37347
37390
|
target !== 4 /* CallbackParameter */ &&
|
|
37348
37391
|
name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
|
|
37349
37392
|
return false;
|
|
@@ -38314,11 +38357,13 @@ var ts;
|
|
|
38314
38357
|
["es2019.string", "lib.es2019.string.d.ts"],
|
|
38315
38358
|
["es2019.symbol", "lib.es2019.symbol.d.ts"],
|
|
38316
38359
|
["es2020.bigint", "lib.es2020.bigint.d.ts"],
|
|
38360
|
+
["es2020.date", "lib.es2020.date.d.ts"],
|
|
38317
38361
|
["es2020.promise", "lib.es2020.promise.d.ts"],
|
|
38318
38362
|
["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"],
|
|
38319
38363
|
["es2020.string", "lib.es2020.string.d.ts"],
|
|
38320
38364
|
["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"],
|
|
38321
38365
|
["es2020.intl", "lib.es2020.intl.d.ts"],
|
|
38366
|
+
["es2020.number", "lib.es2020.number.d.ts"],
|
|
38322
38367
|
["es2021.promise", "lib.es2021.promise.d.ts"],
|
|
38323
38368
|
["es2021.string", "lib.es2021.string.d.ts"],
|
|
38324
38369
|
["es2021.weakref", "lib.es2021.weakref.d.ts"],
|
|
@@ -40097,7 +40142,7 @@ var ts;
|
|
|
40097
40142
|
function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) {
|
|
40098
40143
|
var result = returnValue ? {} : undefined;
|
|
40099
40144
|
var _loop_4 = function (element) {
|
|
40100
|
-
if (element.kind !==
|
|
40145
|
+
if (element.kind !== 295 /* PropertyAssignment */) {
|
|
40101
40146
|
errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected));
|
|
40102
40147
|
return "continue";
|
|
40103
40148
|
}
|
|
@@ -41649,6 +41694,7 @@ var ts;
|
|
|
41649
41694
|
* is assumed to be the same as root directory of the project.
|
|
41650
41695
|
*/
|
|
41651
41696
|
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) {
|
|
41697
|
+
ts.Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
|
|
41652
41698
|
var traceEnabled = isTraceEnabled(options, host);
|
|
41653
41699
|
if (redirectedReference) {
|
|
41654
41700
|
options = redirectedReference.commandLine.options;
|
|
@@ -43767,7 +43813,7 @@ var ts;
|
|
|
43767
43813
|
return "__constructor" /* Constructor */;
|
|
43768
43814
|
case 178 /* FunctionType */:
|
|
43769
43815
|
case 173 /* CallSignature */:
|
|
43770
|
-
case
|
|
43816
|
+
case 322 /* JSDocSignature */:
|
|
43771
43817
|
return "__call" /* Call */;
|
|
43772
43818
|
case 179 /* ConstructorType */:
|
|
43773
43819
|
case 174 /* ConstructSignature */:
|
|
@@ -43776,7 +43822,7 @@ var ts;
|
|
|
43776
43822
|
return "__index" /* Index */;
|
|
43777
43823
|
case 271 /* ExportDeclaration */:
|
|
43778
43824
|
return "__export" /* ExportStar */;
|
|
43779
|
-
case
|
|
43825
|
+
case 304 /* SourceFile */:
|
|
43780
43826
|
// json file should behave as
|
|
43781
43827
|
// module.exports = ...
|
|
43782
43828
|
return "export=" /* ExportEquals */;
|
|
@@ -43787,12 +43833,12 @@ var ts;
|
|
|
43787
43833
|
}
|
|
43788
43834
|
ts.Debug.fail("Unknown binary declaration kind");
|
|
43789
43835
|
break;
|
|
43790
|
-
case
|
|
43836
|
+
case 316 /* JSDocFunctionType */:
|
|
43791
43837
|
return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */);
|
|
43792
43838
|
case 163 /* Parameter */:
|
|
43793
43839
|
// Parameters with names are handled at the top of this function. Parameters
|
|
43794
43840
|
// without names can only come from JSDocFunctionTypes.
|
|
43795
|
-
ts.Debug.assert(node.parent.kind ===
|
|
43841
|
+
ts.Debug.assert(node.parent.kind === 316 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
|
|
43796
43842
|
var functionType = node.parent;
|
|
43797
43843
|
var index = functionType.parameters.indexOf(node);
|
|
43798
43844
|
return "arg" + index;
|
|
@@ -44070,7 +44116,7 @@ var ts;
|
|
|
44070
44116
|
node.flags |= 512 /* HasExplicitReturn */;
|
|
44071
44117
|
node.endFlowNode = currentFlow;
|
|
44072
44118
|
}
|
|
44073
|
-
if (node.kind ===
|
|
44119
|
+
if (node.kind === 304 /* SourceFile */) {
|
|
44074
44120
|
node.flags |= emitFlags;
|
|
44075
44121
|
node.endFlowNode = currentFlow;
|
|
44076
44122
|
}
|
|
@@ -44209,13 +44255,13 @@ var ts;
|
|
|
44209
44255
|
case 229 /* NonNullExpression */:
|
|
44210
44256
|
bindNonNullExpressionFlow(node);
|
|
44211
44257
|
break;
|
|
44212
|
-
case
|
|
44213
|
-
case
|
|
44214
|
-
case
|
|
44258
|
+
case 344 /* JSDocTypedefTag */:
|
|
44259
|
+
case 337 /* JSDocCallbackTag */:
|
|
44260
|
+
case 338 /* JSDocEnumTag */:
|
|
44215
44261
|
bindJSDocTypeAlias(node);
|
|
44216
44262
|
break;
|
|
44217
44263
|
// In source files and blocks, bind functions first to match hoisting that occurs at runtime
|
|
44218
|
-
case
|
|
44264
|
+
case 304 /* SourceFile */: {
|
|
44219
44265
|
bindEachFunctionsFirst(node.statements);
|
|
44220
44266
|
bind(node.endOfFileToken);
|
|
44221
44267
|
break;
|
|
@@ -44229,7 +44275,7 @@ var ts;
|
|
|
44229
44275
|
break;
|
|
44230
44276
|
case 204 /* ObjectLiteralExpression */:
|
|
44231
44277
|
case 203 /* ArrayLiteralExpression */:
|
|
44232
|
-
case
|
|
44278
|
+
case 295 /* PropertyAssignment */:
|
|
44233
44279
|
case 224 /* SpreadElement */:
|
|
44234
44280
|
// Carry over whether we are in an assignment pattern of Object and Array literals
|
|
44235
44281
|
// as well as their children that are valid assignment targets.
|
|
@@ -44759,13 +44805,13 @@ var ts;
|
|
|
44759
44805
|
else if (node.kind === 204 /* ObjectLiteralExpression */) {
|
|
44760
44806
|
for (var _b = 0, _c = node.properties; _b < _c.length; _b++) {
|
|
44761
44807
|
var p = _c[_b];
|
|
44762
|
-
if (p.kind ===
|
|
44808
|
+
if (p.kind === 295 /* PropertyAssignment */) {
|
|
44763
44809
|
bindDestructuringTargetFlow(p.initializer);
|
|
44764
44810
|
}
|
|
44765
|
-
else if (p.kind ===
|
|
44811
|
+
else if (p.kind === 296 /* ShorthandPropertyAssignment */) {
|
|
44766
44812
|
bindAssignmentTargetFlow(p.name);
|
|
44767
44813
|
}
|
|
44768
|
-
else if (p.kind ===
|
|
44814
|
+
else if (p.kind === 297 /* SpreadAssignment */) {
|
|
44769
44815
|
bindAssignmentTargetFlow(p.expression);
|
|
44770
44816
|
}
|
|
44771
44817
|
}
|
|
@@ -44987,7 +45033,7 @@ var ts;
|
|
|
44987
45033
|
}
|
|
44988
45034
|
function bindJSDocTypeAlias(node) {
|
|
44989
45035
|
bind(node.tagName);
|
|
44990
|
-
if (node.kind !==
|
|
45036
|
+
if (node.kind !== 338 /* JSDocEnumTag */ && node.fullName) {
|
|
44991
45037
|
// don't bind the type name yet; that's delayed until delayedBindJSDocTypedefTag
|
|
44992
45038
|
ts.setParent(node.fullName, node);
|
|
44993
45039
|
ts.setParentRecursive(node.fullName, /*incremental*/ false);
|
|
@@ -45111,7 +45157,7 @@ var ts;
|
|
|
45111
45157
|
case 259 /* EnumDeclaration */:
|
|
45112
45158
|
case 204 /* ObjectLiteralExpression */:
|
|
45113
45159
|
case 181 /* TypeLiteral */:
|
|
45114
|
-
case
|
|
45160
|
+
case 321 /* JSDocTypeLiteral */:
|
|
45115
45161
|
case 285 /* JsxAttributes */:
|
|
45116
45162
|
return 1 /* IsContainer */;
|
|
45117
45163
|
case 257 /* InterfaceDeclaration */:
|
|
@@ -45120,7 +45166,7 @@ var ts;
|
|
|
45120
45166
|
case 258 /* TypeAliasDeclaration */:
|
|
45121
45167
|
case 194 /* MappedType */:
|
|
45122
45168
|
return 1 /* IsContainer */ | 32 /* HasLocals */;
|
|
45123
|
-
case
|
|
45169
|
+
case 304 /* SourceFile */:
|
|
45124
45170
|
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
|
|
45125
45171
|
case 171 /* GetAccessor */:
|
|
45126
45172
|
case 172 /* SetAccessor */:
|
|
@@ -45133,8 +45179,8 @@ var ts;
|
|
|
45133
45179
|
case 255 /* FunctionDeclaration */:
|
|
45134
45180
|
case 167 /* MethodSignature */:
|
|
45135
45181
|
case 173 /* CallSignature */:
|
|
45136
|
-
case
|
|
45137
|
-
case
|
|
45182
|
+
case 322 /* JSDocSignature */:
|
|
45183
|
+
case 316 /* JSDocFunctionType */:
|
|
45138
45184
|
case 178 /* FunctionType */:
|
|
45139
45185
|
case 174 /* ConstructSignature */:
|
|
45140
45186
|
case 175 /* IndexSignature */:
|
|
@@ -45189,7 +45235,7 @@ var ts;
|
|
|
45189
45235
|
// handlers to take care of declaring these child members.
|
|
45190
45236
|
case 260 /* ModuleDeclaration */:
|
|
45191
45237
|
return declareModuleMember(node, symbolFlags, symbolExcludes);
|
|
45192
|
-
case
|
|
45238
|
+
case 304 /* SourceFile */:
|
|
45193
45239
|
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
|
|
45194
45240
|
case 225 /* ClassExpression */:
|
|
45195
45241
|
case 256 /* ClassDeclaration */:
|
|
@@ -45197,7 +45243,7 @@ var ts;
|
|
|
45197
45243
|
case 259 /* EnumDeclaration */:
|
|
45198
45244
|
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
|
|
45199
45245
|
case 181 /* TypeLiteral */:
|
|
45200
|
-
case
|
|
45246
|
+
case 321 /* JSDocTypeLiteral */:
|
|
45201
45247
|
case 204 /* ObjectLiteralExpression */:
|
|
45202
45248
|
case 257 /* InterfaceDeclaration */:
|
|
45203
45249
|
case 285 /* JsxAttributes */:
|
|
@@ -45211,7 +45257,7 @@ var ts;
|
|
|
45211
45257
|
case 179 /* ConstructorType */:
|
|
45212
45258
|
case 173 /* CallSignature */:
|
|
45213
45259
|
case 174 /* ConstructSignature */:
|
|
45214
|
-
case
|
|
45260
|
+
case 322 /* JSDocSignature */:
|
|
45215
45261
|
case 175 /* IndexSignature */:
|
|
45216
45262
|
case 168 /* MethodDeclaration */:
|
|
45217
45263
|
case 167 /* MethodSignature */:
|
|
@@ -45221,9 +45267,9 @@ var ts;
|
|
|
45221
45267
|
case 255 /* FunctionDeclaration */:
|
|
45222
45268
|
case 212 /* FunctionExpression */:
|
|
45223
45269
|
case 213 /* ArrowFunction */:
|
|
45224
|
-
case
|
|
45225
|
-
case
|
|
45226
|
-
case
|
|
45270
|
+
case 316 /* JSDocFunctionType */:
|
|
45271
|
+
case 344 /* JSDocTypedefTag */:
|
|
45272
|
+
case 337 /* JSDocCallbackTag */:
|
|
45227
45273
|
case 169 /* ClassStaticBlockDeclaration */:
|
|
45228
45274
|
case 258 /* TypeAliasDeclaration */:
|
|
45229
45275
|
case 194 /* MappedType */:
|
|
@@ -45325,7 +45371,7 @@ var ts;
|
|
|
45325
45371
|
var seen = new ts.Map();
|
|
45326
45372
|
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
|
|
45327
45373
|
var prop = _a[_i];
|
|
45328
|
-
if (prop.kind ===
|
|
45374
|
+
if (prop.kind === 297 /* SpreadAssignment */ || prop.name.kind !== 79 /* Identifier */) {
|
|
45329
45375
|
continue;
|
|
45330
45376
|
}
|
|
45331
45377
|
var identifier = prop.name;
|
|
@@ -45337,7 +45383,7 @@ var ts;
|
|
|
45337
45383
|
// c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true.
|
|
45338
45384
|
// d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true
|
|
45339
45385
|
// and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields
|
|
45340
|
-
var currentKind = prop.kind ===
|
|
45386
|
+
var currentKind = prop.kind === 295 /* PropertyAssignment */ || prop.kind === 296 /* ShorthandPropertyAssignment */ || prop.kind === 168 /* MethodDeclaration */
|
|
45341
45387
|
? 1 /* Property */
|
|
45342
45388
|
: 2 /* Accessor */;
|
|
45343
45389
|
var existingKind = seen.get(identifier.escapedText);
|
|
@@ -45368,7 +45414,7 @@ var ts;
|
|
|
45368
45414
|
case 260 /* ModuleDeclaration */:
|
|
45369
45415
|
declareModuleMember(node, symbolFlags, symbolExcludes);
|
|
45370
45416
|
break;
|
|
45371
|
-
case
|
|
45417
|
+
case 304 /* SourceFile */:
|
|
45372
45418
|
if (ts.isExternalOrCommonJsModule(container)) {
|
|
45373
45419
|
declareModuleMember(node, symbolFlags, symbolExcludes);
|
|
45374
45420
|
break;
|
|
@@ -45567,7 +45613,7 @@ var ts;
|
|
|
45567
45613
|
function checkStrictModeFunctionDeclaration(node) {
|
|
45568
45614
|
if (languageVersion < 2 /* ES2015 */) {
|
|
45569
45615
|
// Report error if function is not top level function declaration
|
|
45570
|
-
if (blockScopeContainer.kind !==
|
|
45616
|
+
if (blockScopeContainer.kind !== 304 /* SourceFile */ &&
|
|
45571
45617
|
blockScopeContainer.kind !== 260 /* ModuleDeclaration */ &&
|
|
45572
45618
|
!ts.isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
|
|
45573
45619
|
// We check first if the name is inside class declaration or class expression; if so give explicit message
|
|
@@ -45741,7 +45787,7 @@ var ts;
|
|
|
45741
45787
|
}
|
|
45742
45788
|
// falls through
|
|
45743
45789
|
case 108 /* ThisKeyword */:
|
|
45744
|
-
if (currentFlow && (ts.isExpression(node) || parent.kind ===
|
|
45790
|
+
if (currentFlow && (ts.isExpression(node) || parent.kind === 296 /* ShorthandPropertyAssignment */)) {
|
|
45745
45791
|
node.flowNode = currentFlow;
|
|
45746
45792
|
}
|
|
45747
45793
|
return checkContextualIdentifier(node);
|
|
@@ -45839,10 +45885,10 @@ var ts;
|
|
|
45839
45885
|
case 166 /* PropertyDeclaration */:
|
|
45840
45886
|
case 165 /* PropertySignature */:
|
|
45841
45887
|
return bindPropertyWorker(node);
|
|
45842
|
-
case
|
|
45843
|
-
case
|
|
45888
|
+
case 295 /* PropertyAssignment */:
|
|
45889
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
45844
45890
|
return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */);
|
|
45845
|
-
case
|
|
45891
|
+
case 298 /* EnumMember */:
|
|
45846
45892
|
return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */);
|
|
45847
45893
|
case 173 /* CallSignature */:
|
|
45848
45894
|
case 174 /* ConstructSignature */:
|
|
@@ -45864,15 +45910,15 @@ var ts;
|
|
|
45864
45910
|
case 172 /* SetAccessor */:
|
|
45865
45911
|
return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */);
|
|
45866
45912
|
case 178 /* FunctionType */:
|
|
45867
|
-
case
|
|
45868
|
-
case
|
|
45913
|
+
case 316 /* JSDocFunctionType */:
|
|
45914
|
+
case 322 /* JSDocSignature */:
|
|
45869
45915
|
case 179 /* ConstructorType */:
|
|
45870
45916
|
return bindFunctionOrConstructorType(node);
|
|
45871
45917
|
case 181 /* TypeLiteral */:
|
|
45872
|
-
case
|
|
45918
|
+
case 321 /* JSDocTypeLiteral */:
|
|
45873
45919
|
case 194 /* MappedType */:
|
|
45874
45920
|
return bindAnonymousTypeWorker(node);
|
|
45875
|
-
case
|
|
45921
|
+
case 331 /* JSDocClassTag */:
|
|
45876
45922
|
return bindJSDocClassTag(node);
|
|
45877
45923
|
case 204 /* ObjectLiteralExpression */:
|
|
45878
45924
|
return bindObjectLiteralExpression(node);
|
|
@@ -45930,7 +45976,7 @@ var ts;
|
|
|
45930
45976
|
return bindExportDeclaration(node);
|
|
45931
45977
|
case 270 /* ExportAssignment */:
|
|
45932
45978
|
return bindExportAssignment(node);
|
|
45933
|
-
case
|
|
45979
|
+
case 304 /* SourceFile */:
|
|
45934
45980
|
updateStrictModeStatementList(node.statements);
|
|
45935
45981
|
return bindSourceFileIfExternalModule();
|
|
45936
45982
|
case 234 /* Block */:
|
|
@@ -45940,23 +45986,23 @@ var ts;
|
|
|
45940
45986
|
// falls through
|
|
45941
45987
|
case 261 /* ModuleBlock */:
|
|
45942
45988
|
return updateStrictModeStatementList(node.statements);
|
|
45943
|
-
case
|
|
45944
|
-
if (node.parent.kind ===
|
|
45989
|
+
case 339 /* JSDocParameterTag */:
|
|
45990
|
+
if (node.parent.kind === 322 /* JSDocSignature */) {
|
|
45945
45991
|
return bindParameter(node);
|
|
45946
45992
|
}
|
|
45947
|
-
if (node.parent.kind !==
|
|
45993
|
+
if (node.parent.kind !== 321 /* JSDocTypeLiteral */) {
|
|
45948
45994
|
break;
|
|
45949
45995
|
}
|
|
45950
45996
|
// falls through
|
|
45951
|
-
case
|
|
45997
|
+
case 346 /* JSDocPropertyTag */:
|
|
45952
45998
|
var propTag = node;
|
|
45953
|
-
var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind ===
|
|
45999
|
+
var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 315 /* JSDocOptionalType */ ?
|
|
45954
46000
|
4 /* Property */ | 16777216 /* Optional */ :
|
|
45955
46001
|
4 /* Property */;
|
|
45956
46002
|
return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */);
|
|
45957
|
-
case
|
|
45958
|
-
case
|
|
45959
|
-
case
|
|
46003
|
+
case 344 /* JSDocTypedefTag */:
|
|
46004
|
+
case 337 /* JSDocCallbackTag */:
|
|
46005
|
+
case 338 /* JSDocEnumTag */:
|
|
45960
46006
|
return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
|
|
45961
46007
|
}
|
|
45962
46008
|
}
|
|
@@ -46159,7 +46205,7 @@ var ts;
|
|
|
46159
46205
|
declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true);
|
|
46160
46206
|
}
|
|
46161
46207
|
break;
|
|
46162
|
-
case
|
|
46208
|
+
case 304 /* SourceFile */:
|
|
46163
46209
|
// this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script
|
|
46164
46210
|
if (ts.hasDynamicName(node)) {
|
|
46165
46211
|
break;
|
|
@@ -46188,7 +46234,7 @@ var ts;
|
|
|
46188
46234
|
if (node.expression.kind === 108 /* ThisKeyword */) {
|
|
46189
46235
|
bindThisPropertyAssignment(node);
|
|
46190
46236
|
}
|
|
46191
|
-
else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind ===
|
|
46237
|
+
else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 304 /* SourceFile */) {
|
|
46192
46238
|
if (ts.isPrototypeAccess(node.expression)) {
|
|
46193
46239
|
bindPrototypePropertyAssignment(node, node.parent);
|
|
46194
46240
|
}
|
|
@@ -46228,7 +46274,7 @@ var ts;
|
|
|
46228
46274
|
}
|
|
46229
46275
|
function bindObjectDefinePropertyAssignment(node) {
|
|
46230
46276
|
var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]);
|
|
46231
|
-
var isToplevel = node.parent.parent.kind ===
|
|
46277
|
+
var isToplevel = node.parent.parent.kind === 304 /* SourceFile */;
|
|
46232
46278
|
namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false);
|
|
46233
46279
|
bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false);
|
|
46234
46280
|
}
|
|
@@ -46337,8 +46383,8 @@ var ts;
|
|
|
46337
46383
|
}
|
|
46338
46384
|
function isTopLevelNamespaceAssignment(propertyAccess) {
|
|
46339
46385
|
return ts.isBinaryExpression(propertyAccess.parent)
|
|
46340
|
-
? getParentOfBinaryExpression(propertyAccess.parent).parent.kind ===
|
|
46341
|
-
: propertyAccess.parent.parent.kind ===
|
|
46386
|
+
? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 304 /* SourceFile */
|
|
46387
|
+
: propertyAccess.parent.parent.kind === 304 /* SourceFile */;
|
|
46342
46388
|
}
|
|
46343
46389
|
function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) {
|
|
46344
46390
|
var namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer);
|
|
@@ -46483,7 +46529,7 @@ var ts;
|
|
|
46483
46529
|
}
|
|
46484
46530
|
}
|
|
46485
46531
|
function bindParameter(node) {
|
|
46486
|
-
if (node.kind ===
|
|
46532
|
+
if (node.kind === 339 /* JSDocParameterTag */ && container.kind !== 322 /* JSDocSignature */) {
|
|
46487
46533
|
return;
|
|
46488
46534
|
}
|
|
46489
46535
|
if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) {
|
|
@@ -48233,7 +48279,7 @@ var ts;
|
|
|
48233
48279
|
return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks());
|
|
48234
48280
|
}
|
|
48235
48281
|
function isGlobalSourceFile(node) {
|
|
48236
|
-
return node.kind ===
|
|
48282
|
+
return node.kind === 304 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node);
|
|
48237
48283
|
}
|
|
48238
48284
|
function getSymbol(symbols, name, meaning) {
|
|
48239
48285
|
if (meaning) {
|
|
@@ -48488,7 +48534,7 @@ var ts;
|
|
|
48488
48534
|
case 168 /* MethodDeclaration */:
|
|
48489
48535
|
case 171 /* GetAccessor */:
|
|
48490
48536
|
case 172 /* SetAccessor */:
|
|
48491
|
-
case
|
|
48537
|
+
case 295 /* PropertyAssignment */:
|
|
48492
48538
|
return requiresScopeChangeWorker(node.name);
|
|
48493
48539
|
case 166 /* PropertyDeclaration */:
|
|
48494
48540
|
// static properties in classes introduce temporary variables
|
|
@@ -48546,13 +48592,13 @@ var ts;
|
|
|
48546
48592
|
// - parameters are only in the scope of function body
|
|
48547
48593
|
// This restriction does not apply to JSDoc comment types because they are parented
|
|
48548
48594
|
// at a higher level than type parameters would normally be
|
|
48549
|
-
if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !==
|
|
48595
|
+
if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 319 /* JSDocComment */) {
|
|
48550
48596
|
useResult = result.flags & 262144 /* TypeParameter */
|
|
48551
48597
|
// type parameters are visible in parameter list, return type and type parameter list
|
|
48552
48598
|
? lastLocation === location.type ||
|
|
48553
48599
|
lastLocation.kind === 163 /* Parameter */ ||
|
|
48554
|
-
lastLocation.kind ===
|
|
48555
|
-
lastLocation.kind ===
|
|
48600
|
+
lastLocation.kind === 339 /* JSDocParameterTag */ ||
|
|
48601
|
+
lastLocation.kind === 340 /* JSDocReturnTag */ ||
|
|
48556
48602
|
lastLocation.kind === 162 /* TypeParameter */
|
|
48557
48603
|
// local types not visible outside the function body
|
|
48558
48604
|
: false;
|
|
@@ -48589,14 +48635,14 @@ var ts;
|
|
|
48589
48635
|
}
|
|
48590
48636
|
withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation);
|
|
48591
48637
|
switch (location.kind) {
|
|
48592
|
-
case
|
|
48638
|
+
case 304 /* SourceFile */:
|
|
48593
48639
|
if (!ts.isExternalOrCommonJsModule(location))
|
|
48594
48640
|
break;
|
|
48595
48641
|
isInExternalModule = true;
|
|
48596
48642
|
// falls through
|
|
48597
48643
|
case 260 /* ModuleDeclaration */:
|
|
48598
48644
|
var moduleExports = ((_a = getSymbolOfNode(location)) === null || _a === void 0 ? void 0 : _a.exports) || emptySymbols;
|
|
48599
|
-
if (location.kind ===
|
|
48645
|
+
if (location.kind === 304 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) {
|
|
48600
48646
|
// It's an external module. First see if the module has an export default and if the local
|
|
48601
48647
|
// name of that export default matches.
|
|
48602
48648
|
if (result = moduleExports.get("default" /* Default */)) {
|
|
@@ -48773,9 +48819,9 @@ var ts;
|
|
|
48773
48819
|
location = location.parent;
|
|
48774
48820
|
}
|
|
48775
48821
|
break;
|
|
48776
|
-
case
|
|
48777
|
-
case
|
|
48778
|
-
case
|
|
48822
|
+
case 344 /* JSDocTypedefTag */:
|
|
48823
|
+
case 337 /* JSDocCallbackTag */:
|
|
48824
|
+
case 338 /* JSDocEnumTag */:
|
|
48779
48825
|
// js type aliases do not resolve names from their host, so skip past it
|
|
48780
48826
|
var root = ts.getJSDocRoot(location);
|
|
48781
48827
|
if (root) {
|
|
@@ -48824,7 +48870,7 @@ var ts;
|
|
|
48824
48870
|
}
|
|
48825
48871
|
if (!result) {
|
|
48826
48872
|
if (lastLocation) {
|
|
48827
|
-
ts.Debug.assert(lastLocation.kind ===
|
|
48873
|
+
ts.Debug.assert(lastLocation.kind === 304 /* SourceFile */);
|
|
48828
48874
|
if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) {
|
|
48829
48875
|
return lastLocation.symbol;
|
|
48830
48876
|
}
|
|
@@ -49249,8 +49295,8 @@ var ts;
|
|
|
49249
49295
|
&& node.parent.left === node
|
|
49250
49296
|
&& node.parent.operatorToken.kind === 63 /* EqualsToken */
|
|
49251
49297
|
&& isAliasableOrJsExpression(node.parent.right)
|
|
49252
|
-
|| node.kind ===
|
|
49253
|
-
|| node.kind ===
|
|
49298
|
+
|| node.kind === 296 /* ShorthandPropertyAssignment */
|
|
49299
|
+
|| node.kind === 295 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer)
|
|
49254
49300
|
|| ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node);
|
|
49255
49301
|
}
|
|
49256
49302
|
function isAliasableOrJsExpression(e) {
|
|
@@ -49654,9 +49700,9 @@ var ts;
|
|
|
49654
49700
|
return getTargetOfExportAssignment(node, dontRecursivelyResolve);
|
|
49655
49701
|
case 263 /* NamespaceExportDeclaration */:
|
|
49656
49702
|
return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve);
|
|
49657
|
-
case
|
|
49703
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
49658
49704
|
return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve);
|
|
49659
|
-
case
|
|
49705
|
+
case 295 /* PropertyAssignment */:
|
|
49660
49706
|
return getTargetOfPropertyAssignment(node, dontRecursivelyResolve);
|
|
49661
49707
|
case 206 /* ElementAccessExpression */:
|
|
49662
49708
|
case 205 /* PropertyAccessExpression */:
|
|
@@ -50020,7 +50066,7 @@ var ts;
|
|
|
50020
50066
|
: undefined;
|
|
50021
50067
|
}
|
|
50022
50068
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) {
|
|
50023
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
50069
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
50024
50070
|
if (isForAugmentation === void 0) { isForAugmentation = false; }
|
|
50025
50071
|
if (ts.startsWith(moduleReference, "@types/")) {
|
|
50026
50072
|
var diag = ts.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
@@ -50057,7 +50103,11 @@ var ts;
|
|
|
50057
50103
|
}
|
|
50058
50104
|
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
50059
50105
|
var isSyncImport = (currentSourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS && !ts.findAncestor(location, ts.isImportCall)) || !!ts.findAncestor(location, ts.isImportEqualsDeclaration);
|
|
50060
|
-
|
|
50106
|
+
var overrideClauseHost = ts.findAncestor(location, function (l) { return ts.isImportTypeNode(l) || ts.isExportDeclaration(l) || ts.isImportDeclaration(l); });
|
|
50107
|
+
var overrideClause = overrideClauseHost && ts.isImportTypeNode(overrideClauseHost) ? (_g = overrideClauseHost.assertions) === null || _g === void 0 ? void 0 : _g.assertClause : overrideClauseHost === null || overrideClauseHost === void 0 ? void 0 : overrideClauseHost.assertClause;
|
|
50108
|
+
// An override clause will take effect for type-only imports and import types, and allows importing the types across formats, regardless of
|
|
50109
|
+
// normal mode restrictions
|
|
50110
|
+
if (isSyncImport && sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext && !ts.getResolutionModeOverrideForClause(overrideClause)) {
|
|
50061
50111
|
error(errorNode, ts.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead, moduleReference);
|
|
50062
50112
|
}
|
|
50063
50113
|
if (mode === ts.ModuleKind.ESNext && compilerOptions.resolveJsonModule && resolvedModule.extension === ".json" /* Json */) {
|
|
@@ -50138,10 +50188,10 @@ var ts;
|
|
|
50138
50188
|
}
|
|
50139
50189
|
else if (mode === ts.ModuleKind.ESNext && resolutionIsNode12OrNext && isExtensionlessRelativePathImport) {
|
|
50140
50190
|
var absoluteRef_1 = ts.getNormalizedAbsolutePath(moduleReference, ts.getDirectoryPath(currentSourceFile.path));
|
|
50141
|
-
var suggestedExt = (
|
|
50191
|
+
var suggestedExt = (_h = suggestedExtensions.find(function (_a) {
|
|
50142
50192
|
var actualExt = _a[0], _importExt = _a[1];
|
|
50143
50193
|
return host.fileExists(absoluteRef_1 + actualExt);
|
|
50144
|
-
})) === null ||
|
|
50194
|
+
})) === null || _h === void 0 ? void 0 : _h[1];
|
|
50145
50195
|
if (suggestedExt) {
|
|
50146
50196
|
error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
|
50147
50197
|
}
|
|
@@ -50209,9 +50259,10 @@ var ts;
|
|
|
50209
50259
|
// references a symbol that is at least declared as a module or a variable. The target of the 'export =' may
|
|
50210
50260
|
// combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable).
|
|
50211
50261
|
function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) {
|
|
50262
|
+
var _a;
|
|
50212
50263
|
var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
|
|
50213
50264
|
if (!dontResolveAlias && symbol) {
|
|
50214
|
-
if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol,
|
|
50265
|
+
if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 304 /* SourceFile */)) {
|
|
50215
50266
|
var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015
|
|
50216
50267
|
? "allowSyntheticDefaultImports"
|
|
50217
50268
|
: "esModuleInterop";
|
|
@@ -50227,12 +50278,16 @@ var ts;
|
|
|
50227
50278
|
if (defaultOnlyType) {
|
|
50228
50279
|
return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent);
|
|
50229
50280
|
}
|
|
50230
|
-
|
|
50281
|
+
var targetFile = (_a = moduleSymbol === null || moduleSymbol === void 0 ? void 0 : moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
50282
|
+
var isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(getUsageModeForExpression(reference), targetFile.impliedNodeFormat);
|
|
50283
|
+
if (ts.getESModuleInterop(compilerOptions) || isEsmCjsRef) {
|
|
50231
50284
|
var sigs = getSignaturesOfStructuredType(type, 0 /* Call */);
|
|
50232
50285
|
if (!sigs || !sigs.length) {
|
|
50233
50286
|
sigs = getSignaturesOfStructuredType(type, 1 /* Construct */);
|
|
50234
50287
|
}
|
|
50235
|
-
if ((sigs && sigs.length) ||
|
|
50288
|
+
if ((sigs && sigs.length) ||
|
|
50289
|
+
getPropertyOfType(type, "default" /* Default */, /*skipObjectFunctionPropertyAugment*/ true) ||
|
|
50290
|
+
isEsmCjsRef) {
|
|
50236
50291
|
var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference);
|
|
50237
50292
|
return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
|
|
50238
50293
|
}
|
|
@@ -50682,7 +50737,7 @@ var ts;
|
|
|
50682
50737
|
}
|
|
50683
50738
|
}
|
|
50684
50739
|
switch (location.kind) {
|
|
50685
|
-
case
|
|
50740
|
+
case 304 /* SourceFile */:
|
|
50686
50741
|
if (!ts.isExternalOrCommonJsModule(location)) {
|
|
50687
50742
|
break;
|
|
50688
50743
|
}
|
|
@@ -50985,10 +51040,10 @@ var ts;
|
|
|
50985
51040
|
return node && getSymbolOfNode(node);
|
|
50986
51041
|
}
|
|
50987
51042
|
function hasExternalModuleSymbol(declaration) {
|
|
50988
|
-
return ts.isAmbientModule(declaration) || (declaration.kind ===
|
|
51043
|
+
return ts.isAmbientModule(declaration) || (declaration.kind === 304 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration));
|
|
50989
51044
|
}
|
|
50990
51045
|
function hasNonGlobalAugmentationExternalModuleSymbol(declaration) {
|
|
50991
|
-
return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind ===
|
|
51046
|
+
return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 304 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration));
|
|
50992
51047
|
}
|
|
50993
51048
|
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
|
|
50994
51049
|
var aliasesToMakeVisible;
|
|
@@ -51092,7 +51147,7 @@ var ts;
|
|
|
51092
51147
|
function symbolToStringWorker(writer) {
|
|
51093
51148
|
var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217
|
|
51094
51149
|
// add neverAsciiEscape for GH#39027
|
|
51095
|
-
var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) ===
|
|
51150
|
+
var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 304 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true });
|
|
51096
51151
|
var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
|
|
51097
51152
|
printer.writeNode(4 /* Unspecified */, entity, /*sourceFile*/ sourceFile, writer);
|
|
51098
51153
|
return writer;
|
|
@@ -51562,7 +51617,7 @@ var ts;
|
|
|
51562
51617
|
var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) &&
|
|
51563
51618
|
(symbol.parent || // is exported function symbol
|
|
51564
51619
|
ts.forEach(symbol.declarations, function (declaration) {
|
|
51565
|
-
return declaration.parent.kind ===
|
|
51620
|
+
return declaration.parent.kind === 304 /* SourceFile */ || declaration.parent.kind === 261 /* ModuleBlock */;
|
|
51566
51621
|
}));
|
|
51567
51622
|
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
|
|
51568
51623
|
// typeof is allowed only for static/non local functions
|
|
@@ -51949,8 +52004,8 @@ var ts;
|
|
|
51949
52004
|
}
|
|
51950
52005
|
function preserveCommentsOn(node) {
|
|
51951
52006
|
var _a;
|
|
51952
|
-
if (ts.some(propertySymbol.declarations, function (d) { return d.kind ===
|
|
51953
|
-
var d = (_a = propertySymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return d.kind ===
|
|
52007
|
+
if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 346 /* JSDocPropertyTag */; })) {
|
|
52008
|
+
var d = (_a = propertySymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return d.kind === 346 /* JSDocPropertyTag */; });
|
|
51954
52009
|
var commentText = ts.getTextOfJSDocComment(d.comment);
|
|
51955
52010
|
if (commentText) {
|
|
51956
52011
|
ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
|
|
@@ -52108,7 +52163,7 @@ var ts;
|
|
|
52108
52163
|
kind === 171 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) :
|
|
52109
52164
|
kind === 172 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, /*body*/ undefined) :
|
|
52110
52165
|
kind === 175 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, modifiers, parameters, returnTypeNode) :
|
|
52111
|
-
kind ===
|
|
52166
|
+
kind === 316 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) :
|
|
52112
52167
|
kind === 178 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) :
|
|
52113
52168
|
kind === 179 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) :
|
|
52114
52169
|
kind === 255 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) :
|
|
@@ -52152,7 +52207,7 @@ var ts;
|
|
|
52152
52207
|
function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) {
|
|
52153
52208
|
var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 163 /* Parameter */);
|
|
52154
52209
|
if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) {
|
|
52155
|
-
parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol,
|
|
52210
|
+
parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 339 /* JSDocParameterTag */);
|
|
52156
52211
|
}
|
|
52157
52212
|
var parameterType = getTypeOfSymbol(parameterSymbol);
|
|
52158
52213
|
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
|
|
@@ -52330,13 +52385,13 @@ var ts;
|
|
|
52330
52385
|
}
|
|
52331
52386
|
return top;
|
|
52332
52387
|
}
|
|
52333
|
-
function getSpecifierForModuleSymbol(symbol, context) {
|
|
52388
|
+
function getSpecifierForModuleSymbol(symbol, context, overrideImportMode) {
|
|
52334
52389
|
var _a;
|
|
52335
|
-
var file = ts.getDeclarationOfKind(symbol,
|
|
52390
|
+
var file = ts.getDeclarationOfKind(symbol, 304 /* SourceFile */);
|
|
52336
52391
|
if (!file) {
|
|
52337
52392
|
var equivalentFileSymbol = ts.firstDefined(symbol.declarations, function (d) { return getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol); });
|
|
52338
52393
|
if (equivalentFileSymbol) {
|
|
52339
|
-
file = ts.getDeclarationOfKind(equivalentFileSymbol,
|
|
52394
|
+
file = ts.getDeclarationOfKind(equivalentFileSymbol, 304 /* SourceFile */);
|
|
52340
52395
|
}
|
|
52341
52396
|
}
|
|
52342
52397
|
if (file && file.moduleName !== undefined) {
|
|
@@ -52365,8 +52420,10 @@ var ts;
|
|
|
52365
52420
|
return ts.getSourceFileOfNode(ts.getNonAugmentationDeclaration(symbol)).fileName; // A resolver may not be provided for baselines and errors - in those cases we use the fileName in full
|
|
52366
52421
|
}
|
|
52367
52422
|
var contextFile = ts.getSourceFileOfNode(ts.getOriginalNode(context.enclosingDeclaration));
|
|
52423
|
+
var resolutionMode = overrideImportMode || (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat);
|
|
52424
|
+
var cacheKey = getSpecifierCacheKey(contextFile.path, resolutionMode);
|
|
52368
52425
|
var links = getSymbolLinks(symbol);
|
|
52369
|
-
var specifier = links.specifierCache && links.specifierCache.get(
|
|
52426
|
+
var specifier = links.specifierCache && links.specifierCache.get(cacheKey);
|
|
52370
52427
|
if (!specifier) {
|
|
52371
52428
|
var isBundle_1 = !!ts.outFile(compilerOptions);
|
|
52372
52429
|
// For declaration bundles, we need to generate absolute paths relative to the common source dir for imports,
|
|
@@ -52375,11 +52432,19 @@ var ts;
|
|
|
52375
52432
|
// specifier preference
|
|
52376
52433
|
var moduleResolverHost = context.tracker.moduleResolverHost;
|
|
52377
52434
|
var specifierCompilerOptions = isBundle_1 ? __assign(__assign({}, compilerOptions), { baseUrl: moduleResolverHost.getCommonSourceDirectory() }) : compilerOptions;
|
|
52378
|
-
specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, checker, specifierCompilerOptions, contextFile, moduleResolverHost, {
|
|
52435
|
+
specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, checker, specifierCompilerOptions, contextFile, moduleResolverHost, {
|
|
52436
|
+
importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "project-relative",
|
|
52437
|
+
importModuleSpecifierEnding: isBundle_1 ? "minimal"
|
|
52438
|
+
: resolutionMode === ts.ModuleKind.ESNext ? "js"
|
|
52439
|
+
: undefined,
|
|
52440
|
+
}, { overrideImportMode: overrideImportMode }));
|
|
52379
52441
|
(_a = links.specifierCache) !== null && _a !== void 0 ? _a : (links.specifierCache = new ts.Map());
|
|
52380
|
-
links.specifierCache.set(
|
|
52442
|
+
links.specifierCache.set(cacheKey, specifier);
|
|
52381
52443
|
}
|
|
52382
52444
|
return specifier;
|
|
52445
|
+
function getSpecifierCacheKey(path, mode) {
|
|
52446
|
+
return mode === undefined ? path : mode + "|" + path;
|
|
52447
|
+
}
|
|
52383
52448
|
}
|
|
52384
52449
|
function symbolToEntityNameNode(symbol) {
|
|
52385
52450
|
var identifier = ts.factory.createIdentifier(ts.unescapeLeadingUnderscores(symbol.escapedName));
|
|
@@ -52392,13 +52457,45 @@ var ts;
|
|
|
52392
52457
|
// module is root, must use `ImportTypeNode`
|
|
52393
52458
|
var nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined;
|
|
52394
52459
|
var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context);
|
|
52395
|
-
var
|
|
52460
|
+
var contextFile = ts.getSourceFileOfNode(ts.getOriginalNode(context.enclosingDeclaration));
|
|
52461
|
+
var targetFile = ts.getSourceFileOfModule(chain[0]);
|
|
52462
|
+
var specifier = void 0;
|
|
52463
|
+
var assertion = void 0;
|
|
52464
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
52465
|
+
// An `import` type directed at an esm format file is only going to resolve in esm mode - set the esm mode assertion
|
|
52466
|
+
if ((targetFile === null || targetFile === void 0 ? void 0 : targetFile.impliedNodeFormat) === ts.ModuleKind.ESNext && targetFile.impliedNodeFormat !== (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat)) {
|
|
52467
|
+
specifier = getSpecifierForModuleSymbol(chain[0], context, ts.ModuleKind.ESNext);
|
|
52468
|
+
assertion = ts.factory.createImportTypeAssertionContainer(ts.factory.createAssertClause(ts.factory.createNodeArray([
|
|
52469
|
+
ts.factory.createAssertEntry(ts.factory.createStringLiteral("resolution-mode"), ts.factory.createStringLiteral("import"))
|
|
52470
|
+
])));
|
|
52471
|
+
}
|
|
52472
|
+
}
|
|
52473
|
+
if (!specifier) {
|
|
52474
|
+
specifier = getSpecifierForModuleSymbol(chain[0], context);
|
|
52475
|
+
}
|
|
52396
52476
|
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Classic && specifier.indexOf("/node_modules/") >= 0) {
|
|
52397
|
-
|
|
52398
|
-
|
|
52399
|
-
|
|
52400
|
-
|
|
52401
|
-
context
|
|
52477
|
+
var oldSpecifier = specifier;
|
|
52478
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
52479
|
+
// We might be able to write a portable import type using a mode override; try specifier generation again, but with a different mode set
|
|
52480
|
+
var swappedMode = (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat) === ts.ModuleKind.ESNext ? ts.ModuleKind.CommonJS : ts.ModuleKind.ESNext;
|
|
52481
|
+
specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
|
|
52482
|
+
if (specifier.indexOf("/node_modules/") >= 0) {
|
|
52483
|
+
// Still unreachable :(
|
|
52484
|
+
specifier = oldSpecifier;
|
|
52485
|
+
}
|
|
52486
|
+
else {
|
|
52487
|
+
assertion = ts.factory.createImportTypeAssertionContainer(ts.factory.createAssertClause(ts.factory.createNodeArray([
|
|
52488
|
+
ts.factory.createAssertEntry(ts.factory.createStringLiteral("resolution-mode"), ts.factory.createStringLiteral(swappedMode === ts.ModuleKind.ESNext ? "import" : "require"))
|
|
52489
|
+
])));
|
|
52490
|
+
}
|
|
52491
|
+
}
|
|
52492
|
+
if (!assertion) {
|
|
52493
|
+
// If ultimately we can only name the symbol with a reference that dives into a `node_modules` folder, we should error
|
|
52494
|
+
// since declaration files with these kinds of references are liable to fail when published :(
|
|
52495
|
+
context.encounteredError = true;
|
|
52496
|
+
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
52497
|
+
context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier);
|
|
52498
|
+
}
|
|
52402
52499
|
}
|
|
52403
52500
|
}
|
|
52404
52501
|
var lit = ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(specifier));
|
|
@@ -52410,12 +52507,12 @@ var ts;
|
|
|
52410
52507
|
var lastId = ts.isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right;
|
|
52411
52508
|
lastId.typeArguments = undefined;
|
|
52412
52509
|
}
|
|
52413
|
-
return ts.factory.createImportTypeNode(lit, nonRootParts, typeParameterNodes, isTypeOf);
|
|
52510
|
+
return ts.factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf);
|
|
52414
52511
|
}
|
|
52415
52512
|
else {
|
|
52416
52513
|
var splitNode = getTopmostIndexedAccessType(nonRootParts);
|
|
52417
52514
|
var qualifier = splitNode.objectType.typeName;
|
|
52418
|
-
return ts.factory.createIndexedAccessTypeNode(ts.factory.createImportTypeNode(lit, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
|
|
52515
|
+
return ts.factory.createIndexedAccessTypeNode(ts.factory.createImportTypeNode(lit, assertion, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
|
|
52419
52516
|
}
|
|
52420
52517
|
}
|
|
52421
52518
|
var entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);
|
|
@@ -52741,7 +52838,7 @@ var ts;
|
|
|
52741
52838
|
return transformed === existing ? ts.setTextRange(ts.factory.cloneNode(existing), existing) : transformed;
|
|
52742
52839
|
function visitExistingNodeTreeSymbols(node) {
|
|
52743
52840
|
// We don't _actually_ support jsdoc namepath types, emit `any` instead
|
|
52744
|
-
if (ts.isJSDocAllType(node) || node.kind ===
|
|
52841
|
+
if (ts.isJSDocAllType(node) || node.kind === 318 /* JSDocNamepathType */) {
|
|
52745
52842
|
return ts.factory.createKeywordTypeNode(130 /* AnyKeyword */);
|
|
52746
52843
|
}
|
|
52747
52844
|
if (ts.isJSDocUnknownType(node)) {
|
|
@@ -53616,7 +53713,7 @@ var ts;
|
|
|
53616
53713
|
// We don't know how to serialize this (nested?) binding element
|
|
53617
53714
|
ts.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization");
|
|
53618
53715
|
break;
|
|
53619
|
-
case
|
|
53716
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
53620
53717
|
if (((_e = (_d = node.parent) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.kind) === 220 /* BinaryExpression */) {
|
|
53621
53718
|
// module.exports = { SomeClass }
|
|
53622
53719
|
serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), targetName);
|
|
@@ -54136,7 +54233,7 @@ var ts;
|
|
|
54136
54233
|
ts.isExternalModuleAugmentation(node.parent.parent);
|
|
54137
54234
|
}
|
|
54138
54235
|
function isDefaultBindingContext(location) {
|
|
54139
|
-
return location.kind ===
|
|
54236
|
+
return location.kind === 304 /* SourceFile */ || ts.isAmbientModule(location);
|
|
54140
54237
|
}
|
|
54141
54238
|
function getNameOfSymbolFromNameType(symbol, context) {
|
|
54142
54239
|
var nameType = getSymbolLinks(symbol).nameType;
|
|
@@ -54222,9 +54319,9 @@ var ts;
|
|
|
54222
54319
|
return false;
|
|
54223
54320
|
function determineIfDeclarationIsVisible() {
|
|
54224
54321
|
switch (node.kind) {
|
|
54225
|
-
case
|
|
54226
|
-
case
|
|
54227
|
-
case
|
|
54322
|
+
case 337 /* JSDocCallbackTag */:
|
|
54323
|
+
case 344 /* JSDocTypedefTag */:
|
|
54324
|
+
case 338 /* JSDocEnumTag */:
|
|
54228
54325
|
// Top-level jsdoc type aliases are considered exported
|
|
54229
54326
|
// First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file
|
|
54230
54327
|
return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent));
|
|
@@ -54251,7 +54348,7 @@ var ts;
|
|
|
54251
54348
|
var parent = getDeclarationContainer(node);
|
|
54252
54349
|
// If the node is not exported or it is not ambient module element (except import declaration)
|
|
54253
54350
|
if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) &&
|
|
54254
|
-
!(node.kind !== 264 /* ImportEqualsDeclaration */ && parent.kind !==
|
|
54351
|
+
!(node.kind !== 264 /* ImportEqualsDeclaration */ && parent.kind !== 304 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) {
|
|
54255
54352
|
return isGlobalSourceFile(parent);
|
|
54256
54353
|
}
|
|
54257
54354
|
// Exported members/ambient module elements (exception import declaration) are visible if parent is visible
|
|
@@ -54295,7 +54392,7 @@ var ts;
|
|
|
54295
54392
|
case 162 /* TypeParameter */:
|
|
54296
54393
|
// Source file and namespace export are always visible
|
|
54297
54394
|
// falls through
|
|
54298
|
-
case
|
|
54395
|
+
case 304 /* SourceFile */:
|
|
54299
54396
|
case 263 /* NamespaceExportDeclaration */:
|
|
54300
54397
|
return true;
|
|
54301
54398
|
// Export assignments do not create name bindings outside the module
|
|
@@ -54552,7 +54649,7 @@ var ts;
|
|
|
54552
54649
|
var ancestor = node.parent.parent;
|
|
54553
54650
|
switch (ancestor.kind) {
|
|
54554
54651
|
case 202 /* BindingElement */:
|
|
54555
|
-
case
|
|
54652
|
+
case 295 /* PropertyAssignment */:
|
|
54556
54653
|
return getSyntheticElementAccess(ancestor);
|
|
54557
54654
|
case 203 /* ArrayLiteralExpression */:
|
|
54558
54655
|
return getSyntheticElementAccess(node.parent);
|
|
@@ -54567,7 +54664,7 @@ var ts;
|
|
|
54567
54664
|
if (node.kind === 202 /* BindingElement */ && parent.kind === 200 /* ObjectBindingPattern */) {
|
|
54568
54665
|
return getLiteralPropertyNameText(node.propertyName || node.name);
|
|
54569
54666
|
}
|
|
54570
|
-
if (node.kind ===
|
|
54667
|
+
if (node.kind === 295 /* PropertyAssignment */ || node.kind === 296 /* ShorthandPropertyAssignment */) {
|
|
54571
54668
|
return getLiteralPropertyNameText(node.name);
|
|
54572
54669
|
}
|
|
54573
54670
|
return "" + parent.elements.indexOf(node);
|
|
@@ -55252,8 +55349,8 @@ var ts;
|
|
|
55252
55349
|
var memberDeclaration = root.kind === 163 /* Parameter */ ? root.parent : root;
|
|
55253
55350
|
return isPrivateWithinAmbient(memberDeclaration);
|
|
55254
55351
|
}
|
|
55255
|
-
function tryGetTypeFromEffectiveTypeNode(
|
|
55256
|
-
var typeNode = ts.getEffectiveTypeAnnotationNode(
|
|
55352
|
+
function tryGetTypeFromEffectiveTypeNode(node) {
|
|
55353
|
+
var typeNode = ts.getEffectiveTypeAnnotationNode(node);
|
|
55257
55354
|
if (typeNode) {
|
|
55258
55355
|
return getTypeFromTypeNode(typeNode);
|
|
55259
55356
|
}
|
|
@@ -55748,16 +55845,16 @@ var ts;
|
|
|
55748
55845
|
case 167 /* MethodSignature */:
|
|
55749
55846
|
case 178 /* FunctionType */:
|
|
55750
55847
|
case 179 /* ConstructorType */:
|
|
55751
|
-
case
|
|
55848
|
+
case 316 /* JSDocFunctionType */:
|
|
55752
55849
|
case 255 /* FunctionDeclaration */:
|
|
55753
55850
|
case 168 /* MethodDeclaration */:
|
|
55754
55851
|
case 212 /* FunctionExpression */:
|
|
55755
55852
|
case 213 /* ArrowFunction */:
|
|
55756
55853
|
case 258 /* TypeAliasDeclaration */:
|
|
55757
|
-
case
|
|
55758
|
-
case
|
|
55759
|
-
case
|
|
55760
|
-
case
|
|
55854
|
+
case 343 /* JSDocTemplateTag */:
|
|
55855
|
+
case 344 /* JSDocTypedefTag */:
|
|
55856
|
+
case 338 /* JSDocEnumTag */:
|
|
55857
|
+
case 337 /* JSDocCallbackTag */:
|
|
55761
55858
|
case 194 /* MappedType */:
|
|
55762
55859
|
case 188 /* ConditionalType */: {
|
|
55763
55860
|
var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
|
|
@@ -55773,13 +55870,13 @@ var ts;
|
|
|
55773
55870
|
getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
|
|
55774
55871
|
return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters;
|
|
55775
55872
|
}
|
|
55776
|
-
case
|
|
55873
|
+
case 339 /* JSDocParameterTag */:
|
|
55777
55874
|
var paramSymbol = ts.getParameterSymbolFromJSDoc(node);
|
|
55778
55875
|
if (paramSymbol) {
|
|
55779
55876
|
node = paramSymbol.valueDeclaration;
|
|
55780
55877
|
}
|
|
55781
55878
|
break;
|
|
55782
|
-
case
|
|
55879
|
+
case 319 /* JSDocComment */: {
|
|
55783
55880
|
var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
|
|
55784
55881
|
return node.tags
|
|
55785
55882
|
? appendTypeParameters(outerTypeParameters, ts.flatMap(node.tags, function (t) { return ts.isJSDocTemplateTag(t) ? t.typeParameters : undefined; }))
|
|
@@ -56172,7 +56269,7 @@ var ts;
|
|
|
56172
56269
|
}
|
|
56173
56270
|
else {
|
|
56174
56271
|
type = errorType;
|
|
56175
|
-
if (declaration.kind ===
|
|
56272
|
+
if (declaration.kind === 338 /* JSDocEnumTag */) {
|
|
56176
56273
|
error(declaration.typeExpression.type, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
|
|
56177
56274
|
}
|
|
56178
56275
|
else {
|
|
@@ -58293,10 +58390,10 @@ var ts;
|
|
|
58293
58390
|
function isJSDocOptionalParameter(node) {
|
|
58294
58391
|
return ts.isInJSFile(node) && (
|
|
58295
58392
|
// node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType
|
|
58296
|
-
node.type && node.type.kind ===
|
|
58393
|
+
node.type && node.type.kind === 315 /* JSDocOptionalType */
|
|
58297
58394
|
|| ts.getJSDocParameterTags(node).some(function (_a) {
|
|
58298
58395
|
var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression;
|
|
58299
|
-
return isBracketed || !!typeExpression && typeExpression.type.kind ===
|
|
58396
|
+
return isBracketed || !!typeExpression && typeExpression.type.kind === 315 /* JSDocOptionalType */;
|
|
58300
58397
|
}));
|
|
58301
58398
|
}
|
|
58302
58399
|
function tryFindAmbientModule(moduleName, withAugmentations) {
|
|
@@ -58336,7 +58433,7 @@ var ts;
|
|
|
58336
58433
|
return false;
|
|
58337
58434
|
}
|
|
58338
58435
|
var isBracketed = node.isBracketed, typeExpression = node.typeExpression;
|
|
58339
|
-
return isBracketed || !!typeExpression && typeExpression.type.kind ===
|
|
58436
|
+
return isBracketed || !!typeExpression && typeExpression.type.kind === 315 /* JSDocOptionalType */;
|
|
58340
58437
|
}
|
|
58341
58438
|
function createTypePredicate(kind, parameterName, parameterIndex, type) {
|
|
58342
58439
|
return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type };
|
|
@@ -58524,7 +58621,7 @@ var ts;
|
|
|
58524
58621
|
case 205 /* PropertyAccessExpression */:
|
|
58525
58622
|
case 206 /* ElementAccessExpression */:
|
|
58526
58623
|
return traverse(node.expression);
|
|
58527
|
-
case
|
|
58624
|
+
case 295 /* PropertyAssignment */:
|
|
58528
58625
|
return traverse(node.initializer);
|
|
58529
58626
|
default:
|
|
58530
58627
|
return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse);
|
|
@@ -59228,7 +59325,7 @@ var ts;
|
|
|
59228
59325
|
function getConditionalFlowTypeOfType(type, node) {
|
|
59229
59326
|
var constraints;
|
|
59230
59327
|
var covariant = true;
|
|
59231
|
-
while (node && !ts.isStatement(node) && node.kind !==
|
|
59328
|
+
while (node && !ts.isStatement(node) && node.kind !== 319 /* JSDocComment */) {
|
|
59232
59329
|
var parent = node.parent;
|
|
59233
59330
|
// only consider variance flipped by parameter locations - `keyof` types would usually be considered variance inverting, but
|
|
59234
59331
|
// often get used in indexed accesses where they behave sortof invariantly, but our checking is lax
|
|
@@ -59600,10 +59697,10 @@ var ts;
|
|
|
59600
59697
|
case 190 /* ParenthesizedType */:
|
|
59601
59698
|
case 184 /* OptionalType */:
|
|
59602
59699
|
case 196 /* NamedTupleMember */:
|
|
59603
|
-
case
|
|
59604
|
-
case
|
|
59605
|
-
case
|
|
59606
|
-
case
|
|
59700
|
+
case 315 /* JSDocOptionalType */:
|
|
59701
|
+
case 313 /* JSDocNullableType */:
|
|
59702
|
+
case 314 /* JSDocNonNullableType */:
|
|
59703
|
+
case 308 /* JSDocTypeExpression */:
|
|
59607
59704
|
return mayResolveTypeAlias(node.type);
|
|
59608
59705
|
case 185 /* RestType */:
|
|
59609
59706
|
return node.type.kind !== 182 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType);
|
|
@@ -61807,8 +61904,8 @@ var ts;
|
|
|
61807
61904
|
function getTypeFromTypeNodeWorker(node) {
|
|
61808
61905
|
switch (node.kind) {
|
|
61809
61906
|
case 130 /* AnyKeyword */:
|
|
61810
|
-
case
|
|
61811
|
-
case
|
|
61907
|
+
case 311 /* JSDocAllType */:
|
|
61908
|
+
case 312 /* JSDocUnknownType */:
|
|
61812
61909
|
return anyType;
|
|
61813
61910
|
case 154 /* UnknownKeyword */:
|
|
61814
61911
|
return unknownType;
|
|
@@ -61858,26 +61955,26 @@ var ts;
|
|
|
61858
61955
|
return getTypeFromUnionTypeNode(node);
|
|
61859
61956
|
case 187 /* IntersectionType */:
|
|
61860
61957
|
return getTypeFromIntersectionTypeNode(node);
|
|
61861
|
-
case
|
|
61958
|
+
case 313 /* JSDocNullableType */:
|
|
61862
61959
|
return getTypeFromJSDocNullableTypeNode(node);
|
|
61863
|
-
case
|
|
61960
|
+
case 315 /* JSDocOptionalType */:
|
|
61864
61961
|
return addOptionality(getTypeFromTypeNode(node.type));
|
|
61865
61962
|
case 196 /* NamedTupleMember */:
|
|
61866
61963
|
return getTypeFromNamedTupleTypeNode(node);
|
|
61867
61964
|
case 190 /* ParenthesizedType */:
|
|
61868
|
-
case
|
|
61869
|
-
case
|
|
61965
|
+
case 314 /* JSDocNonNullableType */:
|
|
61966
|
+
case 308 /* JSDocTypeExpression */:
|
|
61870
61967
|
return getTypeFromTypeNode(node.type);
|
|
61871
61968
|
case 185 /* RestType */:
|
|
61872
61969
|
return getTypeFromRestTypeNode(node);
|
|
61873
|
-
case
|
|
61970
|
+
case 317 /* JSDocVariadicType */:
|
|
61874
61971
|
return getTypeFromJSDocVariadicType(node);
|
|
61875
61972
|
case 178 /* FunctionType */:
|
|
61876
61973
|
case 179 /* ConstructorType */:
|
|
61877
61974
|
case 181 /* TypeLiteral */:
|
|
61878
|
-
case
|
|
61879
|
-
case
|
|
61880
|
-
case
|
|
61975
|
+
case 321 /* JSDocTypeLiteral */:
|
|
61976
|
+
case 316 /* JSDocFunctionType */:
|
|
61977
|
+
case 322 /* JSDocSignature */:
|
|
61881
61978
|
return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
|
|
61882
61979
|
case 192 /* TypeOperator */:
|
|
61883
61980
|
return getTypeFromTypeOperatorNode(node);
|
|
@@ -62272,7 +62369,7 @@ var ts;
|
|
|
62272
62369
|
// distributive conditional type T extends U ? X : Y is instantiated with A | B for T, the
|
|
62273
62370
|
// result is (A extends U ? X : Y) | (B extends U ? X : Y).
|
|
62274
62371
|
result = distributionType && checkType_1 !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ?
|
|
62275
|
-
mapTypeWithAlias(distributionType, function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, newMapper_1)); }, aliasSymbol, aliasTypeArguments) :
|
|
62372
|
+
mapTypeWithAlias(getReducedType(distributionType), function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, newMapper_1)); }, aliasSymbol, aliasTypeArguments) :
|
|
62276
62373
|
getConditionalType(root, newMapper_1, aliasSymbol, aliasTypeArguments);
|
|
62277
62374
|
root.instantiations.set(id, result);
|
|
62278
62375
|
}
|
|
@@ -62425,7 +62522,7 @@ var ts;
|
|
|
62425
62522
|
case 220 /* BinaryExpression */:
|
|
62426
62523
|
return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) &&
|
|
62427
62524
|
(isContextSensitive(node.left) || isContextSensitive(node.right));
|
|
62428
|
-
case
|
|
62525
|
+
case 295 /* PropertyAssignment */:
|
|
62429
62526
|
return isContextSensitive(node.initializer);
|
|
62430
62527
|
case 211 /* ParenthesizedExpression */:
|
|
62431
62528
|
return isContextSensitive(node.expression);
|
|
@@ -62941,8 +63038,8 @@ var ts;
|
|
|
62941
63038
|
case 172 /* SetAccessor */: return [3 /*break*/, 2];
|
|
62942
63039
|
case 171 /* GetAccessor */: return [3 /*break*/, 2];
|
|
62943
63040
|
case 168 /* MethodDeclaration */: return [3 /*break*/, 2];
|
|
62944
|
-
case
|
|
62945
|
-
case
|
|
63041
|
+
case 296 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2];
|
|
63042
|
+
case 295 /* PropertyAssignment */: return [3 /*break*/, 4];
|
|
62946
63043
|
}
|
|
62947
63044
|
return [3 /*break*/, 6];
|
|
62948
63045
|
case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }];
|
|
@@ -65015,8 +65112,9 @@ var ts;
|
|
|
65015
65112
|
// This ensures the subtype relationship is ordered, and preventing declaration order
|
|
65016
65113
|
// from deciding which type "wins" in union subtype reduction.
|
|
65017
65114
|
// They're still assignable to one another, since `readonly` doesn't affect assignability.
|
|
65018
|
-
|
|
65019
|
-
|
|
65115
|
+
// This is only applied during the strictSubtypeRelation -- currently used in subtype reduction
|
|
65116
|
+
if (relation === strictSubtypeRelation &&
|
|
65117
|
+
isReadonlySymbol(sourceProp) && !isReadonlySymbol(targetProp)) {
|
|
65020
65118
|
return 0 /* False */;
|
|
65021
65119
|
}
|
|
65022
65120
|
// If the target comes from a partial union prop, allow `undefined` in the target type
|
|
@@ -66578,7 +66676,7 @@ var ts;
|
|
|
66578
66676
|
return;
|
|
66579
66677
|
}
|
|
66580
66678
|
break;
|
|
66581
|
-
case
|
|
66679
|
+
case 316 /* JSDocFunctionType */:
|
|
66582
66680
|
error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
|
|
66583
66681
|
return;
|
|
66584
66682
|
case 255 /* FunctionDeclaration */:
|
|
@@ -66744,7 +66842,7 @@ var ts;
|
|
|
66744
66842
|
function isNonGenericTopLevelType(type) {
|
|
66745
66843
|
if (type.aliasSymbol && !type.aliasTypeArguments) {
|
|
66746
66844
|
var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 258 /* TypeAliasDeclaration */);
|
|
66747
|
-
return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind ===
|
|
66845
|
+
return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 304 /* SourceFile */ ? true : n.kind === 260 /* ModuleDeclaration */ ? false : "quit"; }));
|
|
66748
66846
|
}
|
|
66749
66847
|
return false;
|
|
66750
66848
|
}
|
|
@@ -67840,7 +67938,7 @@ var ts;
|
|
|
67840
67938
|
}
|
|
67841
67939
|
// falls through
|
|
67842
67940
|
default:
|
|
67843
|
-
if (node.parent.kind ===
|
|
67941
|
+
if (node.parent.kind === 296 /* ShorthandPropertyAssignment */) {
|
|
67844
67942
|
return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer;
|
|
67845
67943
|
}
|
|
67846
67944
|
else {
|
|
@@ -68065,7 +68163,7 @@ var ts;
|
|
|
68065
68163
|
}
|
|
68066
68164
|
function getMatchingUnionConstituentForObjectLiteral(unionType, node) {
|
|
68067
68165
|
var keyPropertyName = getKeyPropertyName(unionType);
|
|
68068
|
-
var propNode = keyPropertyName && ts.find(node.properties, function (p) { return p.symbol && p.kind ===
|
|
68166
|
+
var propNode = keyPropertyName && ts.find(node.properties, function (p) { return p.symbol && p.kind === 295 /* PropertyAssignment */ &&
|
|
68069
68167
|
p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer); });
|
|
68070
68168
|
var propType = propNode && getContextFreeTypeOfExpression(propNode.initializer);
|
|
68071
68169
|
return propType && getConstituentTypeForKeyType(unionType, propType);
|
|
@@ -68260,7 +68358,7 @@ var ts;
|
|
|
68260
68358
|
}
|
|
68261
68359
|
function getAssignedTypeOfBinaryExpression(node) {
|
|
68262
68360
|
var isDestructuringDefaultAssignment = node.parent.kind === 203 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) ||
|
|
68263
|
-
node.parent.kind ===
|
|
68361
|
+
node.parent.kind === 295 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent);
|
|
68264
68362
|
return isDestructuringDefaultAssignment ?
|
|
68265
68363
|
getTypeWithDefault(getAssignedType(node), node.right) :
|
|
68266
68364
|
getTypeOfExpression(node.right);
|
|
@@ -68296,9 +68394,9 @@ var ts;
|
|
|
68296
68394
|
return getAssignedTypeOfArrayLiteralElement(parent, node);
|
|
68297
68395
|
case 224 /* SpreadElement */:
|
|
68298
68396
|
return getAssignedTypeOfSpreadExpression(parent);
|
|
68299
|
-
case
|
|
68397
|
+
case 295 /* PropertyAssignment */:
|
|
68300
68398
|
return getAssignedTypeOfPropertyAssignment(parent);
|
|
68301
|
-
case
|
|
68399
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
68302
68400
|
return getAssignedTypeOfShorthandPropertyAssignment(parent);
|
|
68303
68401
|
}
|
|
68304
68402
|
return errorType;
|
|
@@ -69976,7 +70074,7 @@ var ts;
|
|
|
69976
70074
|
return ts.findAncestor(node.parent, function (node) {
|
|
69977
70075
|
return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) ||
|
|
69978
70076
|
node.kind === 261 /* ModuleBlock */ ||
|
|
69979
|
-
node.kind ===
|
|
70077
|
+
node.kind === 304 /* SourceFile */ ||
|
|
69980
70078
|
node.kind === 166 /* PropertyDeclaration */;
|
|
69981
70079
|
});
|
|
69982
70080
|
}
|
|
@@ -70251,7 +70349,7 @@ var ts;
|
|
|
70251
70349
|
// to the constructor in the initializer, we will need to substitute that
|
|
70252
70350
|
// binding with an alias as the class name is not in scope.
|
|
70253
70351
|
var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false);
|
|
70254
|
-
while (container.kind !==
|
|
70352
|
+
while (container.kind !== 304 /* SourceFile */) {
|
|
70255
70353
|
if (container.parent === declaration) {
|
|
70256
70354
|
if (ts.isPropertyDeclaration(container) && ts.isStatic(container) || ts.isClassStaticBlockDeclaration(container)) {
|
|
70257
70355
|
getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */;
|
|
@@ -70622,7 +70720,7 @@ var ts;
|
|
|
70622
70720
|
}
|
|
70623
70721
|
// x.prototype = { method: function() { } }
|
|
70624
70722
|
else if (container.kind === 212 /* FunctionExpression */ &&
|
|
70625
|
-
container.parent.kind ===
|
|
70723
|
+
container.parent.kind === 295 /* PropertyAssignment */ &&
|
|
70626
70724
|
container.parent.parent.kind === 204 /* ObjectLiteralExpression */ &&
|
|
70627
70725
|
ts.isBinaryExpression(container.parent.parent.parent) &&
|
|
70628
70726
|
ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) {
|
|
@@ -70656,7 +70754,7 @@ var ts;
|
|
|
70656
70754
|
}
|
|
70657
70755
|
function getTypeForThisExpressionFromJSDoc(node) {
|
|
70658
70756
|
var jsdocType = ts.getJSDocType(node);
|
|
70659
|
-
if (jsdocType && jsdocType.kind ===
|
|
70757
|
+
if (jsdocType && jsdocType.kind === 316 /* JSDocFunctionType */) {
|
|
70660
70758
|
var jsDocFunctionType = jsdocType;
|
|
70661
70759
|
if (jsDocFunctionType.parameters.length > 0 &&
|
|
70662
70760
|
jsDocFunctionType.parameters[0].name &&
|
|
@@ -70873,7 +70971,7 @@ var ts;
|
|
|
70873
70971
|
return (func.kind === 168 /* MethodDeclaration */ ||
|
|
70874
70972
|
func.kind === 171 /* GetAccessor */ ||
|
|
70875
70973
|
func.kind === 172 /* SetAccessor */) && func.parent.kind === 204 /* ObjectLiteralExpression */ ? func.parent :
|
|
70876
|
-
func.kind === 212 /* FunctionExpression */ && func.parent.kind ===
|
|
70974
|
+
func.kind === 212 /* FunctionExpression */ && func.parent.kind === 295 /* PropertyAssignment */ ? func.parent.parent :
|
|
70877
70975
|
undefined;
|
|
70878
70976
|
}
|
|
70879
70977
|
function getThisTypeArgument(type) {
|
|
@@ -70912,7 +71010,7 @@ var ts;
|
|
|
70912
71010
|
if (thisType) {
|
|
70913
71011
|
return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral)));
|
|
70914
71012
|
}
|
|
70915
|
-
if (literal.parent.kind !==
|
|
71013
|
+
if (literal.parent.kind !== 295 /* PropertyAssignment */) {
|
|
70916
71014
|
break;
|
|
70917
71015
|
}
|
|
70918
71016
|
literal = literal.parent.parent;
|
|
@@ -71448,7 +71546,7 @@ var ts;
|
|
|
71448
71546
|
return false;
|
|
71449
71547
|
}
|
|
71450
71548
|
function discriminateContextualTypeByObjectMembers(node, contextualType) {
|
|
71451
|
-
return getMatchingUnionConstituentForObjectLiteral(contextualType, node) || discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind ===
|
|
71549
|
+
return getMatchingUnionConstituentForObjectLiteral(contextualType, node) || discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 295 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return getContextFreeTypeOfExpression(prop.initializer); }, prop.symbol.escapedName]; }), ts.map(ts.filter(getPropertiesOfType(contextualType), function (s) { var _a; return !!(s.flags & 16777216 /* Optional */) && !!((_a = node === null || node === void 0 ? void 0 : node.symbol) === null || _a === void 0 ? void 0 : _a.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName); }), function (s) { return [function () { return undefinedType; }, s.escapedName]; })), isTypeAssignableTo, contextualType);
|
|
71452
71550
|
}
|
|
71453
71551
|
function discriminateContextualTypeByJSXAttributes(node, contextualType) {
|
|
71454
71552
|
return discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 284 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return getContextFreeTypeOfExpression(prop.initializer); }), prop.symbol.escapedName]; }), ts.map(ts.filter(getPropertiesOfType(contextualType), function (s) { var _a; return !!(s.flags & 16777216 /* Optional */) && !!((_a = node === null || node === void 0 ? void 0 : node.symbol) === null || _a === void 0 ? void 0 : _a.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName); }), function (s) { return [function () { return undefinedType; }, s.escapedName]; })), isTypeAssignableTo, contextualType);
|
|
@@ -71552,10 +71650,10 @@ var ts;
|
|
|
71552
71650
|
return ts.isConstTypeReference(parent.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(parent.type);
|
|
71553
71651
|
case 220 /* BinaryExpression */:
|
|
71554
71652
|
return getContextualTypeForBinaryOperand(node, contextFlags);
|
|
71555
|
-
case
|
|
71556
|
-
case
|
|
71653
|
+
case 295 /* PropertyAssignment */:
|
|
71654
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
71557
71655
|
return getContextualTypeForObjectLiteralElement(parent, contextFlags);
|
|
71558
|
-
case
|
|
71656
|
+
case 297 /* SpreadAssignment */:
|
|
71559
71657
|
return getContextualType(parent.parent, contextFlags);
|
|
71560
71658
|
case 203 /* ArrayLiteralExpression */: {
|
|
71561
71659
|
var arrayLiteral = parent;
|
|
@@ -71576,6 +71674,8 @@ var ts;
|
|
|
71576
71674
|
}
|
|
71577
71675
|
case 229 /* NonNullExpression */:
|
|
71578
71676
|
return getContextualType(parent, contextFlags);
|
|
71677
|
+
case 270 /* ExportAssignment */:
|
|
71678
|
+
return tryGetTypeFromEffectiveTypeNode(parent);
|
|
71579
71679
|
case 287 /* JsxExpression */:
|
|
71580
71680
|
return getContextualTypeForJsxExpression(parent);
|
|
71581
71681
|
case 284 /* JsxAttribute */:
|
|
@@ -72083,14 +72183,14 @@ var ts;
|
|
|
72083
72183
|
var member = getSymbolOfNode(memberDecl);
|
|
72084
72184
|
var computedNameType = memberDecl.name && memberDecl.name.kind === 161 /* ComputedPropertyName */ ?
|
|
72085
72185
|
checkComputedPropertyName(memberDecl.name) : undefined;
|
|
72086
|
-
if (memberDecl.kind ===
|
|
72087
|
-
memberDecl.kind ===
|
|
72186
|
+
if (memberDecl.kind === 295 /* PropertyAssignment */ ||
|
|
72187
|
+
memberDecl.kind === 296 /* ShorthandPropertyAssignment */ ||
|
|
72088
72188
|
ts.isObjectLiteralMethod(memberDecl)) {
|
|
72089
|
-
var type = memberDecl.kind ===
|
|
72189
|
+
var type = memberDecl.kind === 295 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) :
|
|
72090
72190
|
// avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring
|
|
72091
72191
|
// for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`.
|
|
72092
72192
|
// we don't want to say "could not find 'a'".
|
|
72093
|
-
memberDecl.kind ===
|
|
72193
|
+
memberDecl.kind === 296 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) :
|
|
72094
72194
|
checkObjectLiteralMethod(memberDecl, checkMode);
|
|
72095
72195
|
if (isInJavascript) {
|
|
72096
72196
|
var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
|
|
@@ -72113,8 +72213,8 @@ var ts;
|
|
|
72113
72213
|
if (inDestructuringPattern) {
|
|
72114
72214
|
// If object literal is an assignment pattern and if the assignment pattern specifies a default value
|
|
72115
72215
|
// for the property, make the property optional.
|
|
72116
|
-
var isOptional = (memberDecl.kind ===
|
|
72117
|
-
(memberDecl.kind ===
|
|
72216
|
+
var isOptional = (memberDecl.kind === 295 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) ||
|
|
72217
|
+
(memberDecl.kind === 296 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer);
|
|
72118
72218
|
if (isOptional) {
|
|
72119
72219
|
prop.flags |= 16777216 /* Optional */;
|
|
72120
72220
|
}
|
|
@@ -72140,7 +72240,7 @@ var ts;
|
|
|
72140
72240
|
member = prop;
|
|
72141
72241
|
allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
|
|
72142
72242
|
}
|
|
72143
|
-
else if (memberDecl.kind ===
|
|
72243
|
+
else if (memberDecl.kind === 297 /* SpreadAssignment */) {
|
|
72144
72244
|
if (languageVersion < 2 /* ES2015 */) {
|
|
72145
72245
|
checkExternalEmitHelpers(memberDecl, 2 /* Assign */);
|
|
72146
72246
|
}
|
|
@@ -72204,7 +72304,7 @@ var ts;
|
|
|
72204
72304
|
// type with those properties for which the binding pattern specifies a default value.
|
|
72205
72305
|
// If the object literal is spread into another object literal, skip this step and let the top-level object
|
|
72206
72306
|
// literal handle it instead.
|
|
72207
|
-
if (contextualTypeHasPattern && node.parent.kind !==
|
|
72307
|
+
if (contextualTypeHasPattern && node.parent.kind !== 297 /* SpreadAssignment */) {
|
|
72208
72308
|
for (var _d = 0, _e = getPropertiesOfType(contextualType); _d < _e.length; _d++) {
|
|
72209
72309
|
var prop = _e[_d];
|
|
72210
72310
|
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
|
|
@@ -73338,11 +73438,11 @@ var ts;
|
|
|
73338
73438
|
switch (node.kind) {
|
|
73339
73439
|
case 166 /* PropertyDeclaration */:
|
|
73340
73440
|
return true;
|
|
73341
|
-
case
|
|
73441
|
+
case 295 /* PropertyAssignment */:
|
|
73342
73442
|
case 168 /* MethodDeclaration */:
|
|
73343
73443
|
case 171 /* GetAccessor */:
|
|
73344
73444
|
case 172 /* SetAccessor */:
|
|
73345
|
-
case
|
|
73445
|
+
case 297 /* SpreadAssignment */:
|
|
73346
73446
|
case 161 /* ComputedPropertyName */:
|
|
73347
73447
|
case 232 /* TemplateSpan */:
|
|
73348
73448
|
case 287 /* JsxExpression */:
|
|
@@ -75985,7 +76085,7 @@ var ts;
|
|
|
75985
76085
|
}
|
|
75986
76086
|
function getParameterIdentifierNameAtPosition(signature, pos) {
|
|
75987
76087
|
var _a;
|
|
75988
|
-
if (((_a = signature.declaration) === null || _a === void 0 ? void 0 : _a.kind) ===
|
|
76088
|
+
if (((_a = signature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 316 /* JSDocFunctionType */) {
|
|
75989
76089
|
return undefined;
|
|
75990
76090
|
}
|
|
75991
76091
|
var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
|
@@ -77137,7 +77237,7 @@ var ts;
|
|
|
77137
77237
|
if (rightIsThis === void 0) { rightIsThis = false; }
|
|
77138
77238
|
var properties = node.properties;
|
|
77139
77239
|
var property = properties[propertyIndex];
|
|
77140
|
-
if (property.kind ===
|
|
77240
|
+
if (property.kind === 295 /* PropertyAssignment */ || property.kind === 296 /* ShorthandPropertyAssignment */) {
|
|
77141
77241
|
var name = property.name;
|
|
77142
77242
|
var exprType = getLiteralTypeFromPropertyName(name);
|
|
77143
77243
|
if (isTypeUsableAsPropertyName(exprType)) {
|
|
@@ -77150,9 +77250,9 @@ var ts;
|
|
|
77150
77250
|
}
|
|
77151
77251
|
var elementType = getIndexedAccessType(objectLiteralType, exprType, 32 /* ExpressionPosition */, name);
|
|
77152
77252
|
var type = getFlowTypeOfDestructuring(property, elementType);
|
|
77153
|
-
return checkDestructuringAssignment(property.kind ===
|
|
77253
|
+
return checkDestructuringAssignment(property.kind === 296 /* ShorthandPropertyAssignment */ ? property : property.initializer, type);
|
|
77154
77254
|
}
|
|
77155
|
-
else if (property.kind ===
|
|
77255
|
+
else if (property.kind === 297 /* SpreadAssignment */) {
|
|
77156
77256
|
if (propertyIndex < properties.length - 1) {
|
|
77157
77257
|
error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
|
|
77158
77258
|
}
|
|
@@ -77235,7 +77335,7 @@ var ts;
|
|
|
77235
77335
|
}
|
|
77236
77336
|
function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) {
|
|
77237
77337
|
var target;
|
|
77238
|
-
if (exprOrAssignment.kind ===
|
|
77338
|
+
if (exprOrAssignment.kind === 296 /* ShorthandPropertyAssignment */) {
|
|
77239
77339
|
var prop = exprOrAssignment;
|
|
77240
77340
|
if (prop.objectAssignmentInitializer) {
|
|
77241
77341
|
// In strict null checking mode, if a default value of a non-undefined type is specified, remove
|
|
@@ -77265,10 +77365,10 @@ var ts;
|
|
|
77265
77365
|
}
|
|
77266
77366
|
function checkReferenceAssignment(target, sourceType, checkMode) {
|
|
77267
77367
|
var targetType = checkExpression(target, checkMode);
|
|
77268
|
-
var error = target.parent.kind ===
|
|
77368
|
+
var error = target.parent.kind === 297 /* SpreadAssignment */ ?
|
|
77269
77369
|
ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access :
|
|
77270
77370
|
ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;
|
|
77271
|
-
var optionalError = target.parent.kind ===
|
|
77371
|
+
var optionalError = target.parent.kind === 297 /* SpreadAssignment */ ?
|
|
77272
77372
|
ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access :
|
|
77273
77373
|
ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;
|
|
77274
77374
|
if (checkReferenceExpression(target, error, optionalError)) {
|
|
@@ -78676,7 +78776,7 @@ var ts;
|
|
|
78676
78776
|
checkAsyncFunctionReturnType(node, returnTypeNode);
|
|
78677
78777
|
}
|
|
78678
78778
|
}
|
|
78679
|
-
if (node.kind !== 175 /* IndexSignature */ && node.kind !==
|
|
78779
|
+
if (node.kind !== 175 /* IndexSignature */ && node.kind !== 316 /* JSDocFunctionType */) {
|
|
78680
78780
|
registerForUnusedIdentifiersCheck(node);
|
|
78681
78781
|
}
|
|
78682
78782
|
}
|
|
@@ -79278,6 +79378,14 @@ var ts;
|
|
|
79278
79378
|
}
|
|
79279
79379
|
function checkImportType(node) {
|
|
79280
79380
|
checkSourceElement(node.argument);
|
|
79381
|
+
if (node.assertions) {
|
|
79382
|
+
var override = ts.getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode);
|
|
79383
|
+
if (override) {
|
|
79384
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node12 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
79385
|
+
grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext);
|
|
79386
|
+
}
|
|
79387
|
+
}
|
|
79388
|
+
}
|
|
79281
79389
|
getTypeFromTypeNode(node);
|
|
79282
79390
|
}
|
|
79283
79391
|
function checkNamedTupleMember(node) {
|
|
@@ -79599,9 +79707,9 @@ var ts;
|
|
|
79599
79707
|
case 258 /* TypeAliasDeclaration */:
|
|
79600
79708
|
// A jsdoc typedef and callback are, by definition, type aliases.
|
|
79601
79709
|
// falls through
|
|
79602
|
-
case
|
|
79603
|
-
case
|
|
79604
|
-
case
|
|
79710
|
+
case 344 /* JSDocTypedefTag */:
|
|
79711
|
+
case 337 /* JSDocCallbackTag */:
|
|
79712
|
+
case 338 /* JSDocEnumTag */:
|
|
79605
79713
|
return 2 /* ExportType */;
|
|
79606
79714
|
case 260 /* ModuleDeclaration */:
|
|
79607
79715
|
return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */
|
|
@@ -79609,9 +79717,9 @@ var ts;
|
|
|
79609
79717
|
: 4 /* ExportNamespace */;
|
|
79610
79718
|
case 256 /* ClassDeclaration */:
|
|
79611
79719
|
case 259 /* EnumDeclaration */:
|
|
79612
|
-
case
|
|
79720
|
+
case 298 /* EnumMember */:
|
|
79613
79721
|
return 2 /* ExportType */ | 1 /* ExportValue */;
|
|
79614
|
-
case
|
|
79722
|
+
case 304 /* SourceFile */:
|
|
79615
79723
|
return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */;
|
|
79616
79724
|
case 270 /* ExportAssignment */:
|
|
79617
79725
|
case 220 /* BinaryExpression */:
|
|
@@ -80333,7 +80441,7 @@ var ts;
|
|
|
80333
80441
|
checkUnusedClassMembers(node, addDiagnostic);
|
|
80334
80442
|
checkUnusedTypeParameters(node, addDiagnostic);
|
|
80335
80443
|
break;
|
|
80336
|
-
case
|
|
80444
|
+
case 304 /* SourceFile */:
|
|
80337
80445
|
case 260 /* ModuleDeclaration */:
|
|
80338
80446
|
case 234 /* Block */:
|
|
80339
80447
|
case 262 /* CaseBlock */:
|
|
@@ -80651,7 +80759,7 @@ var ts;
|
|
|
80651
80759
|
node.kind === 167 /* MethodSignature */ ||
|
|
80652
80760
|
node.kind === 171 /* GetAccessor */ ||
|
|
80653
80761
|
node.kind === 172 /* SetAccessor */ ||
|
|
80654
|
-
node.kind ===
|
|
80762
|
+
node.kind === 295 /* PropertyAssignment */) {
|
|
80655
80763
|
// it is ok to have member named '_super', '_this', `Promise`, etc. - member access is always qualified
|
|
80656
80764
|
return false;
|
|
80657
80765
|
}
|
|
@@ -80717,7 +80825,7 @@ var ts;
|
|
|
80717
80825
|
}
|
|
80718
80826
|
// In case of variable declaration, node.parent is variable statement so look at the variable statement's parent
|
|
80719
80827
|
var parent = getDeclarationContainer(node);
|
|
80720
|
-
if (parent.kind ===
|
|
80828
|
+
if (parent.kind === 304 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) {
|
|
80721
80829
|
// If the declaration happens to be in external module, report error that require and exports are reserved keywords
|
|
80722
80830
|
errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name));
|
|
80723
80831
|
}
|
|
@@ -80732,7 +80840,7 @@ var ts;
|
|
|
80732
80840
|
}
|
|
80733
80841
|
// In case of variable declaration, node.parent is variable statement so look at the variable statement's parent
|
|
80734
80842
|
var parent = getDeclarationContainer(node);
|
|
80735
|
-
if (parent.kind ===
|
|
80843
|
+
if (parent.kind === 304 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) {
|
|
80736
80844
|
// If the declaration happens to be in external module, report error that Promise is a reserved identifier.
|
|
80737
80845
|
errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name));
|
|
80738
80846
|
}
|
|
@@ -80854,7 +80962,7 @@ var ts;
|
|
|
80854
80962
|
(container.kind === 234 /* Block */ && ts.isFunctionLike(container.parent) ||
|
|
80855
80963
|
container.kind === 261 /* ModuleBlock */ ||
|
|
80856
80964
|
container.kind === 260 /* ModuleDeclaration */ ||
|
|
80857
|
-
container.kind ===
|
|
80965
|
+
container.kind === 304 /* SourceFile */);
|
|
80858
80966
|
// here we know that function scoped variable is shadowed by block scoped one
|
|
80859
80967
|
// if they are defined in the same scope - binder has already reported redeclaration error
|
|
80860
80968
|
// otherwise if variable has an initializer - show error that initialization will fail
|
|
@@ -83461,7 +83569,7 @@ var ts;
|
|
|
83461
83569
|
return false;
|
|
83462
83570
|
}
|
|
83463
83571
|
var inAmbientExternalModule = node.parent.kind === 261 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent);
|
|
83464
|
-
if (node.parent.kind !==
|
|
83572
|
+
if (node.parent.kind !== 304 /* SourceFile */ && !inAmbientExternalModule) {
|
|
83465
83573
|
error(moduleName, node.kind === 271 /* ExportDeclaration */ ?
|
|
83466
83574
|
ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace :
|
|
83467
83575
|
ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
|
|
@@ -83604,6 +83712,14 @@ var ts;
|
|
|
83604
83712
|
function checkAssertClause(declaration) {
|
|
83605
83713
|
var _a;
|
|
83606
83714
|
if (declaration.assertClause) {
|
|
83715
|
+
var validForTypeAssertions = ts.isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
83716
|
+
var override = ts.getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : undefined);
|
|
83717
|
+
if (validForTypeAssertions && override) {
|
|
83718
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node12 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
83719
|
+
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext);
|
|
83720
|
+
}
|
|
83721
|
+
return; // Other grammar checks do not apply to type-only imports with resolution mode assertions
|
|
83722
|
+
}
|
|
83607
83723
|
var mode = (moduleKind === ts.ModuleKind.NodeNext) && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
83608
83724
|
if (mode !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.ESNext) {
|
|
83609
83725
|
return grammarErrorOnNode(declaration.assertClause, moduleKind === ts.ModuleKind.NodeNext
|
|
@@ -83613,6 +83729,9 @@ var ts;
|
|
|
83613
83729
|
if (ts.isImportDeclaration(declaration) ? (_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
|
|
83614
83730
|
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
|
|
83615
83731
|
}
|
|
83732
|
+
if (override) {
|
|
83733
|
+
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
|
|
83734
|
+
}
|
|
83616
83735
|
}
|
|
83617
83736
|
}
|
|
83618
83737
|
function checkImportDeclaration(node) {
|
|
@@ -83705,7 +83824,7 @@ var ts;
|
|
|
83705
83824
|
var inAmbientExternalModule = node.parent.kind === 261 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent);
|
|
83706
83825
|
var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 261 /* ModuleBlock */ &&
|
|
83707
83826
|
!node.moduleSpecifier && node.flags & 8388608 /* Ambient */;
|
|
83708
|
-
if (node.parent.kind !==
|
|
83827
|
+
if (node.parent.kind !== 304 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
|
|
83709
83828
|
error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
|
|
83710
83829
|
}
|
|
83711
83830
|
}
|
|
@@ -83750,7 +83869,7 @@ var ts;
|
|
|
83750
83869
|
return false;
|
|
83751
83870
|
}
|
|
83752
83871
|
function checkGrammarModuleElementContext(node, errorMessage) {
|
|
83753
|
-
var isInAppropriateContext = node.parent.kind ===
|
|
83872
|
+
var isInAppropriateContext = node.parent.kind === 304 /* SourceFile */ || node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 260 /* ModuleDeclaration */;
|
|
83754
83873
|
if (!isInAppropriateContext) {
|
|
83755
83874
|
grammarErrorOnFirstToken(node, errorMessage);
|
|
83756
83875
|
}
|
|
@@ -83828,7 +83947,7 @@ var ts;
|
|
|
83828
83947
|
// If we hit an export assignment in an illegal context, just bail out to avoid cascading errors.
|
|
83829
83948
|
return;
|
|
83830
83949
|
}
|
|
83831
|
-
var container = node.parent.kind ===
|
|
83950
|
+
var container = node.parent.kind === 304 /* SourceFile */ ? node.parent : node.parent.parent;
|
|
83832
83951
|
if (container.kind === 260 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) {
|
|
83833
83952
|
if (node.isExportEquals) {
|
|
83834
83953
|
error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
|
|
@@ -84025,41 +84144,41 @@ var ts;
|
|
|
84025
84144
|
return checkImportType(node);
|
|
84026
84145
|
case 196 /* NamedTupleMember */:
|
|
84027
84146
|
return checkNamedTupleMember(node);
|
|
84028
|
-
case
|
|
84147
|
+
case 327 /* JSDocAugmentsTag */:
|
|
84029
84148
|
return checkJSDocAugmentsTag(node);
|
|
84030
|
-
case
|
|
84149
|
+
case 328 /* JSDocImplementsTag */:
|
|
84031
84150
|
return checkJSDocImplementsTag(node);
|
|
84032
|
-
case
|
|
84033
|
-
case
|
|
84034
|
-
case
|
|
84151
|
+
case 344 /* JSDocTypedefTag */:
|
|
84152
|
+
case 337 /* JSDocCallbackTag */:
|
|
84153
|
+
case 338 /* JSDocEnumTag */:
|
|
84035
84154
|
return checkJSDocTypeAliasTag(node);
|
|
84036
|
-
case
|
|
84155
|
+
case 343 /* JSDocTemplateTag */:
|
|
84037
84156
|
return checkJSDocTemplateTag(node);
|
|
84038
|
-
case
|
|
84157
|
+
case 342 /* JSDocTypeTag */:
|
|
84039
84158
|
return checkJSDocTypeTag(node);
|
|
84040
|
-
case
|
|
84159
|
+
case 339 /* JSDocParameterTag */:
|
|
84041
84160
|
return checkJSDocParameterTag(node);
|
|
84042
|
-
case
|
|
84161
|
+
case 346 /* JSDocPropertyTag */:
|
|
84043
84162
|
return checkJSDocPropertyTag(node);
|
|
84044
|
-
case
|
|
84163
|
+
case 316 /* JSDocFunctionType */:
|
|
84045
84164
|
checkJSDocFunctionType(node);
|
|
84046
84165
|
// falls through
|
|
84047
|
-
case
|
|
84048
|
-
case
|
|
84049
|
-
case
|
|
84050
|
-
case
|
|
84051
|
-
case
|
|
84166
|
+
case 314 /* JSDocNonNullableType */:
|
|
84167
|
+
case 313 /* JSDocNullableType */:
|
|
84168
|
+
case 311 /* JSDocAllType */:
|
|
84169
|
+
case 312 /* JSDocUnknownType */:
|
|
84170
|
+
case 321 /* JSDocTypeLiteral */:
|
|
84052
84171
|
checkJSDocTypeIsInJsFile(node);
|
|
84053
84172
|
ts.forEachChild(node, checkSourceElement);
|
|
84054
84173
|
return;
|
|
84055
|
-
case
|
|
84174
|
+
case 317 /* JSDocVariadicType */:
|
|
84056
84175
|
checkJSDocVariadicType(node);
|
|
84057
84176
|
return;
|
|
84058
|
-
case
|
|
84177
|
+
case 308 /* JSDocTypeExpression */:
|
|
84059
84178
|
return checkSourceElement(node.type);
|
|
84060
|
-
case
|
|
84061
|
-
case
|
|
84062
|
-
case
|
|
84179
|
+
case 332 /* JSDocPublicTag */:
|
|
84180
|
+
case 334 /* JSDocProtectedTag */:
|
|
84181
|
+
case 333 /* JSDocPrivateTag */:
|
|
84063
84182
|
return checkJSDocAccessibilityModifiers(node);
|
|
84064
84183
|
case 193 /* IndexedAccessType */:
|
|
84065
84184
|
return checkIndexedAccessType(node);
|
|
@@ -84402,7 +84521,7 @@ var ts;
|
|
|
84402
84521
|
copySymbols(location.locals, meaning);
|
|
84403
84522
|
}
|
|
84404
84523
|
switch (location.kind) {
|
|
84405
|
-
case
|
|
84524
|
+
case 304 /* SourceFile */:
|
|
84406
84525
|
if (!ts.isExternalModule(location))
|
|
84407
84526
|
break;
|
|
84408
84527
|
// falls through
|
|
@@ -84493,9 +84612,9 @@ var ts;
|
|
|
84493
84612
|
case 257 /* InterfaceDeclaration */:
|
|
84494
84613
|
case 258 /* TypeAliasDeclaration */:
|
|
84495
84614
|
case 259 /* EnumDeclaration */:
|
|
84496
|
-
case
|
|
84497
|
-
case
|
|
84498
|
-
case
|
|
84615
|
+
case 344 /* JSDocTypedefTag */:
|
|
84616
|
+
case 337 /* JSDocCallbackTag */:
|
|
84617
|
+
case 338 /* JSDocEnumTag */:
|
|
84499
84618
|
return true;
|
|
84500
84619
|
case 266 /* ImportClause */:
|
|
84501
84620
|
return node.isTypeOnly;
|
|
@@ -84641,10 +84760,10 @@ var ts;
|
|
|
84641
84760
|
return entityNameSymbol;
|
|
84642
84761
|
}
|
|
84643
84762
|
}
|
|
84644
|
-
if (name.parent.kind ===
|
|
84763
|
+
if (name.parent.kind === 339 /* JSDocParameterTag */) {
|
|
84645
84764
|
return ts.getParameterSymbolFromJSDoc(name.parent);
|
|
84646
84765
|
}
|
|
84647
|
-
if (name.parent.kind === 162 /* TypeParameter */ && name.parent.parent.kind ===
|
|
84766
|
+
if (name.parent.kind === 162 /* TypeParameter */ && name.parent.parent.kind === 343 /* JSDocTemplateTag */) {
|
|
84648
84767
|
ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true.
|
|
84649
84768
|
var typeParameter = ts.getTypeParameterFromJsDoc(name.parent);
|
|
84650
84769
|
return typeParameter && typeParameter.symbol;
|
|
@@ -84732,7 +84851,7 @@ var ts;
|
|
|
84732
84851
|
}
|
|
84733
84852
|
}
|
|
84734
84853
|
function getSymbolAtLocation(node, ignoreErrors) {
|
|
84735
|
-
if (node.kind ===
|
|
84854
|
+
if (node.kind === 304 /* SourceFile */) {
|
|
84736
84855
|
return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined;
|
|
84737
84856
|
}
|
|
84738
84857
|
var parent = node.parent;
|
|
@@ -84859,7 +84978,7 @@ var ts;
|
|
|
84859
84978
|
return undefined;
|
|
84860
84979
|
}
|
|
84861
84980
|
function getShorthandAssignmentValueSymbol(location) {
|
|
84862
|
-
if (location && location.kind ===
|
|
84981
|
+
if (location && location.kind === 296 /* ShorthandPropertyAssignment */) {
|
|
84863
84982
|
return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */);
|
|
84864
84983
|
}
|
|
84865
84984
|
return undefined;
|
|
@@ -84957,7 +85076,7 @@ var ts;
|
|
|
84957
85076
|
}
|
|
84958
85077
|
// If this is from nested object binding pattern
|
|
84959
85078
|
// for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) {
|
|
84960
|
-
if (expr.parent.kind ===
|
|
85079
|
+
if (expr.parent.kind === 295 /* PropertyAssignment */) {
|
|
84961
85080
|
var node_3 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression);
|
|
84962
85081
|
var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_3) || errorType;
|
|
84963
85082
|
var propertyIndex = ts.indexOfNode(node_3.properties, expr.parent);
|
|
@@ -85123,7 +85242,7 @@ var ts;
|
|
|
85123
85242
|
}
|
|
85124
85243
|
var parentSymbol_1 = getParentOfSymbol(symbol);
|
|
85125
85244
|
if (parentSymbol_1) {
|
|
85126
|
-
if (parentSymbol_1.flags & 512 /* ValueModule */ && ((_a = parentSymbol_1.valueDeclaration) === null || _a === void 0 ? void 0 : _a.kind) ===
|
|
85245
|
+
if (parentSymbol_1.flags & 512 /* ValueModule */ && ((_a = parentSymbol_1.valueDeclaration) === null || _a === void 0 ? void 0 : _a.kind) === 304 /* SourceFile */) {
|
|
85127
85246
|
var symbolFile = parentSymbol_1.valueDeclaration;
|
|
85128
85247
|
var referenceFile = ts.getSourceFileOfNode(node);
|
|
85129
85248
|
// If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined.
|
|
@@ -85248,7 +85367,7 @@ var ts;
|
|
|
85248
85367
|
}
|
|
85249
85368
|
function isTopLevelValueImportEqualsWithEntityName(nodeIn) {
|
|
85250
85369
|
var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration);
|
|
85251
|
-
if (node === undefined || node.parent.kind !==
|
|
85370
|
+
if (node === undefined || node.parent.kind !== 304 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) {
|
|
85252
85371
|
// parent is not source file or it is not reference to internal module
|
|
85253
85372
|
return false;
|
|
85254
85373
|
}
|
|
@@ -85363,7 +85482,7 @@ var ts;
|
|
|
85363
85482
|
}
|
|
85364
85483
|
function canHaveConstantValue(node) {
|
|
85365
85484
|
switch (node.kind) {
|
|
85366
|
-
case
|
|
85485
|
+
case 298 /* EnumMember */:
|
|
85367
85486
|
case 205 /* PropertyAccessExpression */:
|
|
85368
85487
|
case 206 /* ElementAccessExpression */:
|
|
85369
85488
|
return true;
|
|
@@ -85371,7 +85490,7 @@ var ts;
|
|
|
85371
85490
|
return false;
|
|
85372
85491
|
}
|
|
85373
85492
|
function getConstantValue(node) {
|
|
85374
|
-
if (node.kind ===
|
|
85493
|
+
if (node.kind === 298 /* EnumMember */) {
|
|
85375
85494
|
return getEnumMemberValue(node);
|
|
85376
85495
|
}
|
|
85377
85496
|
var symbol = getNodeLinks(node).resolvedSymbol;
|
|
@@ -85669,7 +85788,7 @@ var ts;
|
|
|
85669
85788
|
},
|
|
85670
85789
|
getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) {
|
|
85671
85790
|
var n = ts.getParseTreeNode(node);
|
|
85672
|
-
ts.Debug.assert(n && n.kind ===
|
|
85791
|
+
ts.Debug.assert(n && n.kind === 304 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile");
|
|
85673
85792
|
var sym = getSymbolOfNode(node);
|
|
85674
85793
|
if (!sym) {
|
|
85675
85794
|
return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled);
|
|
@@ -85766,7 +85885,7 @@ var ts;
|
|
|
85766
85885
|
break;
|
|
85767
85886
|
}
|
|
85768
85887
|
}
|
|
85769
|
-
if (current.valueDeclaration && current.valueDeclaration.kind ===
|
|
85888
|
+
if (current.valueDeclaration && current.valueDeclaration.kind === 304 /* SourceFile */ && current.flags & 512 /* ValueModule */) {
|
|
85770
85889
|
return false;
|
|
85771
85890
|
}
|
|
85772
85891
|
// check that at least one declaration of top level symbol originates from type declaration file
|
|
@@ -85799,7 +85918,7 @@ var ts;
|
|
|
85799
85918
|
if (!moduleSymbol) {
|
|
85800
85919
|
return undefined;
|
|
85801
85920
|
}
|
|
85802
|
-
return ts.getDeclarationOfKind(moduleSymbol,
|
|
85921
|
+
return ts.getDeclarationOfKind(moduleSymbol, 304 /* SourceFile */);
|
|
85803
85922
|
}
|
|
85804
85923
|
function initializeTypeChecker() {
|
|
85805
85924
|
// Bind all source files and propagate errors
|
|
@@ -86082,7 +86201,7 @@ var ts;
|
|
|
86082
86201
|
else if (flags & 256 /* Async */) {
|
|
86083
86202
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
|
|
86084
86203
|
}
|
|
86085
|
-
else if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind ===
|
|
86204
|
+
else if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 304 /* SourceFile */) {
|
|
86086
86205
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
|
|
86087
86206
|
}
|
|
86088
86207
|
else if (flags & 128 /* Abstract */) {
|
|
@@ -86108,7 +86227,7 @@ var ts;
|
|
|
86108
86227
|
else if (flags & 256 /* Async */) {
|
|
86109
86228
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
|
|
86110
86229
|
}
|
|
86111
|
-
else if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind ===
|
|
86230
|
+
else if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 304 /* SourceFile */) {
|
|
86112
86231
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
|
|
86113
86232
|
}
|
|
86114
86233
|
else if (node.kind === 163 /* Parameter */) {
|
|
@@ -86155,7 +86274,7 @@ var ts;
|
|
|
86155
86274
|
flags |= 1 /* Export */;
|
|
86156
86275
|
break;
|
|
86157
86276
|
case 88 /* DefaultKeyword */:
|
|
86158
|
-
var container = node.parent.kind ===
|
|
86277
|
+
var container = node.parent.kind === 304 /* SourceFile */ ? node.parent : node.parent.parent;
|
|
86159
86278
|
if (container.kind === 260 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) {
|
|
86160
86279
|
return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);
|
|
86161
86280
|
}
|
|
@@ -86297,7 +86416,7 @@ var ts;
|
|
|
86297
86416
|
case 163 /* Parameter */:
|
|
86298
86417
|
return false;
|
|
86299
86418
|
default:
|
|
86300
|
-
if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind ===
|
|
86419
|
+
if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 304 /* SourceFile */) {
|
|
86301
86420
|
return false;
|
|
86302
86421
|
}
|
|
86303
86422
|
switch (node.kind) {
|
|
@@ -86584,7 +86703,7 @@ var ts;
|
|
|
86584
86703
|
var seen = new ts.Map();
|
|
86585
86704
|
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
|
|
86586
86705
|
var prop = _a[_i];
|
|
86587
|
-
if (prop.kind ===
|
|
86706
|
+
if (prop.kind === 297 /* SpreadAssignment */) {
|
|
86588
86707
|
if (inDestructuring) {
|
|
86589
86708
|
// a rest property cannot be destructured any further
|
|
86590
86709
|
var expression = ts.skipParentheses(prop.expression);
|
|
@@ -86599,7 +86718,7 @@ var ts;
|
|
|
86599
86718
|
// If the name is not a ComputedPropertyName, the grammar checking will skip it
|
|
86600
86719
|
checkGrammarComputedPropertyName(name);
|
|
86601
86720
|
}
|
|
86602
|
-
if (prop.kind ===
|
|
86721
|
+
if (prop.kind === 296 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {
|
|
86603
86722
|
// having objectAssignmentInitializer is only valid in ObjectAssignmentPattern
|
|
86604
86723
|
// outside of destructuring it is a syntax error
|
|
86605
86724
|
grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern);
|
|
@@ -86626,10 +86745,10 @@ var ts;
|
|
|
86626
86745
|
// and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields
|
|
86627
86746
|
var currentKind = void 0;
|
|
86628
86747
|
switch (prop.kind) {
|
|
86629
|
-
case
|
|
86748
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
86630
86749
|
checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);
|
|
86631
86750
|
// falls through
|
|
86632
|
-
case
|
|
86751
|
+
case 295 /* PropertyAssignment */:
|
|
86633
86752
|
// Grammar checking for computedPropertyName and shorthandPropertyAssignment
|
|
86634
86753
|
checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
|
|
86635
86754
|
if (name.kind === 8 /* NumericLiteral */) {
|
|
@@ -87323,7 +87442,7 @@ var ts;
|
|
|
87323
87442
|
// to prevent noisiness. So use a bit on the block to indicate if
|
|
87324
87443
|
// this has already been reported, and don't report if it has.
|
|
87325
87444
|
//
|
|
87326
|
-
if (node.parent.kind === 234 /* Block */ || node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind ===
|
|
87445
|
+
if (node.parent.kind === 234 /* Block */ || node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 304 /* SourceFile */) {
|
|
87327
87446
|
var links_2 = getNodeLinks(node.parent);
|
|
87328
87447
|
// Check if the containing block ever report this error
|
|
87329
87448
|
if (!links_2.hasReportedStatementInAmbientContext) {
|
|
@@ -87348,7 +87467,7 @@ var ts;
|
|
|
87348
87467
|
else if (ts.isChildOfNodeWithKind(node, 195 /* LiteralType */)) {
|
|
87349
87468
|
diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0;
|
|
87350
87469
|
}
|
|
87351
|
-
else if (ts.isChildOfNodeWithKind(node,
|
|
87470
|
+
else if (ts.isChildOfNodeWithKind(node, 298 /* EnumMember */)) {
|
|
87352
87471
|
diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0;
|
|
87353
87472
|
}
|
|
87354
87473
|
if (diagnosticMessage) {
|
|
@@ -87916,7 +88035,10 @@ var ts;
|
|
|
87916
88035
|
return factory.updateInferTypeNode(node, nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration));
|
|
87917
88036
|
case 199 /* ImportType */:
|
|
87918
88037
|
ts.Debug.type(node);
|
|
87919
|
-
return factory.updateImportTypeNode(node, nodeVisitor(node.argument, visitor, ts.isTypeNode), nodeVisitor(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf);
|
|
88038
|
+
return factory.updateImportTypeNode(node, nodeVisitor(node.argument, visitor, ts.isTypeNode), nodeVisitor(node.assertions, visitor, ts.isNode), nodeVisitor(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf);
|
|
88039
|
+
case 294 /* ImportTypeAssertionContainer */:
|
|
88040
|
+
ts.Debug.type(node);
|
|
88041
|
+
return factory.updateImportTypeAssertionContainer(node, nodeVisitor(node.assertClause, visitor, ts.isNode), node.multiLine);
|
|
87920
88042
|
case 196 /* NamedTupleMember */:
|
|
87921
88043
|
ts.Debug.type(node);
|
|
87922
88044
|
return factory.updateNamedTupleMember(node, visitNode(node.dotDotDotToken, visitor, ts.isDotDotDotToken), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.questionToken, visitor, ts.isQuestionToken), visitNode(node.type, visitor, ts.isTypeNode));
|
|
@@ -88223,28 +88345,28 @@ var ts;
|
|
|
88223
88345
|
ts.Debug.type(node);
|
|
88224
88346
|
return factory.updateCatchClause(node, nodeVisitor(node.variableDeclaration, visitor, ts.isVariableDeclaration), nodeVisitor(node.block, visitor, ts.isBlock));
|
|
88225
88347
|
// Property assignments
|
|
88226
|
-
case
|
|
88348
|
+
case 295 /* PropertyAssignment */:
|
|
88227
88349
|
ts.Debug.type(node);
|
|
88228
88350
|
return factory.updatePropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
88229
|
-
case
|
|
88351
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
88230
88352
|
ts.Debug.type(node);
|
|
88231
88353
|
return factory.updateShorthandPropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.objectAssignmentInitializer, visitor, ts.isExpression));
|
|
88232
|
-
case
|
|
88354
|
+
case 297 /* SpreadAssignment */:
|
|
88233
88355
|
ts.Debug.type(node);
|
|
88234
88356
|
return factory.updateSpreadAssignment(node, nodeVisitor(node.expression, visitor, ts.isExpression));
|
|
88235
88357
|
// Enum
|
|
88236
|
-
case
|
|
88358
|
+
case 298 /* EnumMember */:
|
|
88237
88359
|
ts.Debug.type(node);
|
|
88238
88360
|
return factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
88239
88361
|
// Top-level nodes
|
|
88240
|
-
case
|
|
88362
|
+
case 304 /* SourceFile */:
|
|
88241
88363
|
ts.Debug.type(node);
|
|
88242
88364
|
return factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
88243
88365
|
// Transformation nodes
|
|
88244
|
-
case
|
|
88366
|
+
case 349 /* PartiallyEmittedExpression */:
|
|
88245
88367
|
ts.Debug.type(node);
|
|
88246
88368
|
return factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));
|
|
88247
|
-
case
|
|
88369
|
+
case 350 /* CommaListExpression */:
|
|
88248
88370
|
ts.Debug.type(node);
|
|
88249
88371
|
return factory.updateCommaListExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression));
|
|
88250
88372
|
default:
|
|
@@ -88935,7 +89057,7 @@ var ts;
|
|
|
88935
89057
|
function chainBundle(context, transformSourceFile) {
|
|
88936
89058
|
return transformSourceFileOrBundle;
|
|
88937
89059
|
function transformSourceFileOrBundle(node) {
|
|
88938
|
-
return node.kind ===
|
|
89060
|
+
return node.kind === 304 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
|
|
88939
89061
|
}
|
|
88940
89062
|
function transformBundle(node) {
|
|
88941
89063
|
return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends);
|
|
@@ -89889,14 +90011,14 @@ var ts;
|
|
|
89889
90011
|
var applicableSubstitutions;
|
|
89890
90012
|
return transformSourceFileOrBundle;
|
|
89891
90013
|
function transformSourceFileOrBundle(node) {
|
|
89892
|
-
if (node.kind ===
|
|
90014
|
+
if (node.kind === 305 /* Bundle */) {
|
|
89893
90015
|
return transformBundle(node);
|
|
89894
90016
|
}
|
|
89895
90017
|
return transformSourceFile(node);
|
|
89896
90018
|
}
|
|
89897
90019
|
function transformBundle(node) {
|
|
89898
90020
|
return factory.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) {
|
|
89899
|
-
if (prepend.kind ===
|
|
90021
|
+
if (prepend.kind === 307 /* InputFiles */) {
|
|
89900
90022
|
return ts.createUnparsedSourceFile(prepend, "js");
|
|
89901
90023
|
}
|
|
89902
90024
|
return prepend;
|
|
@@ -89947,7 +90069,7 @@ var ts;
|
|
|
89947
90069
|
*/
|
|
89948
90070
|
function onBeforeVisitNode(node) {
|
|
89949
90071
|
switch (node.kind) {
|
|
89950
|
-
case
|
|
90072
|
+
case 304 /* SourceFile */:
|
|
89951
90073
|
case 262 /* CaseBlock */:
|
|
89952
90074
|
case 261 /* ModuleBlock */:
|
|
89953
90075
|
case 234 /* Block */:
|
|
@@ -91169,15 +91291,15 @@ var ts;
|
|
|
91169
91291
|
case 199 /* ImportType */:
|
|
91170
91292
|
break;
|
|
91171
91293
|
// handle JSDoc types from an invalid parse
|
|
91172
|
-
case
|
|
91173
|
-
case
|
|
91174
|
-
case
|
|
91175
|
-
case
|
|
91176
|
-
case
|
|
91294
|
+
case 311 /* JSDocAllType */:
|
|
91295
|
+
case 312 /* JSDocUnknownType */:
|
|
91296
|
+
case 316 /* JSDocFunctionType */:
|
|
91297
|
+
case 317 /* JSDocVariadicType */:
|
|
91298
|
+
case 318 /* JSDocNamepathType */:
|
|
91177
91299
|
break;
|
|
91178
|
-
case
|
|
91179
|
-
case
|
|
91180
|
-
case
|
|
91300
|
+
case 313 /* JSDocNullableType */:
|
|
91301
|
+
case 314 /* JSDocNonNullableType */:
|
|
91302
|
+
case 315 /* JSDocOptionalType */:
|
|
91181
91303
|
return serializeTypeNode(node.type);
|
|
91182
91304
|
default:
|
|
91183
91305
|
return ts.Debug.failBadSyntaxKind(node);
|
|
@@ -91895,7 +92017,7 @@ var ts;
|
|
|
91895
92017
|
// enums in any other scope are emitted as a `let` declaration.
|
|
91896
92018
|
var statement = factory.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), factory.createVariableDeclarationList([
|
|
91897
92019
|
factory.createVariableDeclaration(factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true))
|
|
91898
|
-
], currentLexicalScope.kind ===
|
|
92020
|
+
], currentLexicalScope.kind === 304 /* SourceFile */ ? 0 /* None */ : 1 /* Let */));
|
|
91899
92021
|
ts.setOriginalNode(statement, node);
|
|
91900
92022
|
recordEmittedDeclarationInScope(node);
|
|
91901
92023
|
if (isFirstEmittedDeclarationInScope(node)) {
|
|
@@ -92378,7 +92500,7 @@ var ts;
|
|
|
92378
92500
|
// We need to enable substitutions for identifiers and shorthand property assignments. This allows us to
|
|
92379
92501
|
// substitute the names of exported members of a namespace.
|
|
92380
92502
|
context.enableSubstitution(79 /* Identifier */);
|
|
92381
|
-
context.enableSubstitution(
|
|
92503
|
+
context.enableSubstitution(296 /* ShorthandPropertyAssignment */);
|
|
92382
92504
|
// We need to be notified when entering and exiting namespaces.
|
|
92383
92505
|
context.enableEmitNotification(260 /* ModuleDeclaration */);
|
|
92384
92506
|
}
|
|
@@ -92488,7 +92610,7 @@ var ts;
|
|
|
92488
92610
|
// If we are nested within a namespace declaration, we may need to qualifiy
|
|
92489
92611
|
// an identifier that is exported from a merged namespace.
|
|
92490
92612
|
var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false);
|
|
92491
|
-
if (container && container.kind !==
|
|
92613
|
+
if (container && container.kind !== 304 /* SourceFile */) {
|
|
92492
92614
|
var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 260 /* ModuleDeclaration */) ||
|
|
92493
92615
|
(applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 259 /* EnumDeclaration */);
|
|
92494
92616
|
if (substitute) {
|
|
@@ -94893,7 +95015,7 @@ var ts;
|
|
|
94893
95015
|
return visitObjectLiteralExpression(node);
|
|
94894
95016
|
case 220 /* BinaryExpression */:
|
|
94895
95017
|
return visitBinaryExpression(node, expressionResultIsUnused);
|
|
94896
|
-
case
|
|
95018
|
+
case 350 /* CommaListExpression */:
|
|
94897
95019
|
return visitCommaListExpression(node, expressionResultIsUnused);
|
|
94898
95020
|
case 291 /* CatchClause */:
|
|
94899
95021
|
return visitCatchClause(node);
|
|
@@ -94992,7 +95114,7 @@ var ts;
|
|
|
94992
95114
|
var objects = [];
|
|
94993
95115
|
for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) {
|
|
94994
95116
|
var e = elements_4[_i];
|
|
94995
|
-
if (e.kind ===
|
|
95117
|
+
if (e.kind === 297 /* SpreadAssignment */) {
|
|
94996
95118
|
if (chunkObject) {
|
|
94997
95119
|
objects.push(factory.createObjectLiteralExpression(chunkObject));
|
|
94998
95120
|
chunkObject = undefined;
|
|
@@ -95001,7 +95123,7 @@ var ts;
|
|
|
95001
95123
|
objects.push(ts.visitNode(target, visitor, ts.isExpression));
|
|
95002
95124
|
}
|
|
95003
95125
|
else {
|
|
95004
|
-
chunkObject = ts.append(chunkObject, e.kind ===
|
|
95126
|
+
chunkObject = ts.append(chunkObject, e.kind === 295 /* PropertyAssignment */
|
|
95005
95127
|
? factory.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression))
|
|
95006
95128
|
: ts.visitNode(e, visitor, ts.isObjectLiteralElementLike));
|
|
95007
95129
|
}
|
|
@@ -96989,7 +97111,7 @@ var ts;
|
|
|
96989
97111
|
return visitObjectLiteralExpression(node);
|
|
96990
97112
|
case 291 /* CatchClause */:
|
|
96991
97113
|
return visitCatchClause(node);
|
|
96992
|
-
case
|
|
97114
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
96993
97115
|
return visitShorthandPropertyAssignment(node);
|
|
96994
97116
|
case 161 /* ComputedPropertyName */:
|
|
96995
97117
|
return visitComputedPropertyName(node);
|
|
@@ -97003,7 +97125,7 @@ var ts;
|
|
|
97003
97125
|
return visitParenthesizedExpression(node, expressionResultIsUnused);
|
|
97004
97126
|
case 220 /* BinaryExpression */:
|
|
97005
97127
|
return visitBinaryExpression(node, expressionResultIsUnused);
|
|
97006
|
-
case
|
|
97128
|
+
case 350 /* CommaListExpression */:
|
|
97007
97129
|
return visitCommaListExpression(node, expressionResultIsUnused);
|
|
97008
97130
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
97009
97131
|
case 15 /* TemplateHead */:
|
|
@@ -99204,10 +99326,10 @@ var ts;
|
|
|
99204
99326
|
case 168 /* MethodDeclaration */:
|
|
99205
99327
|
expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine));
|
|
99206
99328
|
break;
|
|
99207
|
-
case
|
|
99329
|
+
case 295 /* PropertyAssignment */:
|
|
99208
99330
|
expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));
|
|
99209
99331
|
break;
|
|
99210
|
-
case
|
|
99332
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
99211
99333
|
expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));
|
|
99212
99334
|
break;
|
|
99213
99335
|
default:
|
|
@@ -99952,7 +100074,7 @@ var ts;
|
|
|
99952
100074
|
var previousOnSubstituteNode = context.onSubstituteNode;
|
|
99953
100075
|
context.onSubstituteNode = onSubstituteNode;
|
|
99954
100076
|
context.enableSubstitution(205 /* PropertyAccessExpression */);
|
|
99955
|
-
context.enableSubstitution(
|
|
100077
|
+
context.enableSubstitution(295 /* PropertyAssignment */);
|
|
99956
100078
|
return ts.chainBundle(context, transformSourceFile);
|
|
99957
100079
|
/**
|
|
99958
100080
|
* Transforms an ES5 source file to ES3.
|
|
@@ -100367,7 +100489,7 @@ var ts;
|
|
|
100367
100489
|
switch (node.kind) {
|
|
100368
100490
|
case 220 /* BinaryExpression */:
|
|
100369
100491
|
return visitBinaryExpression(node);
|
|
100370
|
-
case
|
|
100492
|
+
case 350 /* CommaListExpression */:
|
|
100371
100493
|
return visitCommaListExpression(node);
|
|
100372
100494
|
case 221 /* ConditionalExpression */:
|
|
100373
100495
|
return visitConditionalExpression(node);
|
|
@@ -102645,8 +102767,8 @@ var ts;
|
|
|
102645
102767
|
context.enableSubstitution(209 /* TaggedTemplateExpression */); // Substitute calls to imported/exported symbols to avoid incorrect `this`.
|
|
102646
102768
|
context.enableSubstitution(79 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols.
|
|
102647
102769
|
context.enableSubstitution(220 /* BinaryExpression */); // Substitutes assignments to exported symbols.
|
|
102648
|
-
context.enableSubstitution(
|
|
102649
|
-
context.enableEmitNotification(
|
|
102770
|
+
context.enableSubstitution(296 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols.
|
|
102771
|
+
context.enableEmitNotification(304 /* SourceFile */); // Restore state when substituting nodes in a file.
|
|
102650
102772
|
var moduleInfoMap = []; // The ExternalModuleInfo for each file.
|
|
102651
102773
|
var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found.
|
|
102652
102774
|
var currentSourceFile; // The current file.
|
|
@@ -102988,9 +103110,9 @@ var ts;
|
|
|
102988
103110
|
return visitFunctionDeclaration(node);
|
|
102989
103111
|
case 256 /* ClassDeclaration */:
|
|
102990
103112
|
return visitClassDeclaration(node);
|
|
102991
|
-
case
|
|
103113
|
+
case 351 /* MergeDeclarationMarker */:
|
|
102992
103114
|
return visitMergeDeclarationMarker(node);
|
|
102993
|
-
case
|
|
103115
|
+
case 352 /* EndOfDeclarationMarker */:
|
|
102994
103116
|
return visitEndOfDeclarationMarker(node);
|
|
102995
103117
|
default:
|
|
102996
103118
|
return visitor(node);
|
|
@@ -103009,7 +103131,7 @@ var ts;
|
|
|
103009
103131
|
return visitExpressionStatement(node);
|
|
103010
103132
|
case 211 /* ParenthesizedExpression */:
|
|
103011
103133
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
103012
|
-
case
|
|
103134
|
+
case 349 /* PartiallyEmittedExpression */:
|
|
103013
103135
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
103014
103136
|
case 207 /* CallExpression */:
|
|
103015
103137
|
if (ts.isImportCall(node) && currentSourceFile.impliedNodeFormat === undefined) {
|
|
@@ -103038,17 +103160,17 @@ var ts;
|
|
|
103038
103160
|
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
|
|
103039
103161
|
var elem = _a[_i];
|
|
103040
103162
|
switch (elem.kind) {
|
|
103041
|
-
case
|
|
103163
|
+
case 295 /* PropertyAssignment */:
|
|
103042
103164
|
if (destructuringNeedsFlattening(elem.initializer)) {
|
|
103043
103165
|
return true;
|
|
103044
103166
|
}
|
|
103045
103167
|
break;
|
|
103046
|
-
case
|
|
103168
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
103047
103169
|
if (destructuringNeedsFlattening(elem.name)) {
|
|
103048
103170
|
return true;
|
|
103049
103171
|
}
|
|
103050
103172
|
break;
|
|
103051
|
-
case
|
|
103173
|
+
case 297 /* SpreadAssignment */:
|
|
103052
103174
|
if (destructuringNeedsFlattening(elem.expression)) {
|
|
103053
103175
|
return true;
|
|
103054
103176
|
}
|
|
@@ -103914,7 +104036,7 @@ var ts;
|
|
|
103914
104036
|
* @param emit A callback used to emit the node in the printer.
|
|
103915
104037
|
*/
|
|
103916
104038
|
function onEmitNode(hint, node, emitCallback) {
|
|
103917
|
-
if (node.kind ===
|
|
104039
|
+
if (node.kind === 304 /* SourceFile */) {
|
|
103918
104040
|
currentSourceFile = node;
|
|
103919
104041
|
currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)];
|
|
103920
104042
|
previousOnEmitNode(hint, node, emitCallback);
|
|
@@ -104024,7 +104146,7 @@ var ts;
|
|
|
104024
104146
|
}
|
|
104025
104147
|
else if (!(ts.isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !ts.isLocalName(node)) {
|
|
104026
104148
|
var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node));
|
|
104027
|
-
if (exportContainer && exportContainer.kind ===
|
|
104149
|
+
if (exportContainer && exportContainer.kind === 304 /* SourceFile */) {
|
|
104028
104150
|
return ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.cloneNode(node)),
|
|
104029
104151
|
/*location*/ node);
|
|
104030
104152
|
}
|
|
@@ -104114,10 +104236,10 @@ var ts;
|
|
|
104114
104236
|
context.onSubstituteNode = onSubstituteNode;
|
|
104115
104237
|
context.onEmitNode = onEmitNode;
|
|
104116
104238
|
context.enableSubstitution(79 /* Identifier */); // Substitutes expression identifiers for imported symbols.
|
|
104117
|
-
context.enableSubstitution(
|
|
104239
|
+
context.enableSubstitution(296 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols
|
|
104118
104240
|
context.enableSubstitution(220 /* BinaryExpression */); // Substitutes assignments to exported symbols.
|
|
104119
104241
|
context.enableSubstitution(230 /* MetaProperty */); // Substitutes 'import.meta'
|
|
104120
|
-
context.enableEmitNotification(
|
|
104242
|
+
context.enableEmitNotification(304 /* SourceFile */); // Restore state when substituting nodes in a file.
|
|
104121
104243
|
var moduleInfoMap = []; // The ExternalModuleInfo for each file.
|
|
104122
104244
|
var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found.
|
|
104123
104245
|
var exportFunctionsMap = []; // The export function associated with a source file.
|
|
@@ -104688,7 +104810,7 @@ var ts;
|
|
|
104688
104810
|
function shouldHoistVariableDeclarationList(node) {
|
|
104689
104811
|
// hoist only non-block scoped declarations or block scoped declarations parented by source file
|
|
104690
104812
|
return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0
|
|
104691
|
-
&& (enclosingBlockScopedContainer.kind ===
|
|
104813
|
+
&& (enclosingBlockScopedContainer.kind === 304 /* SourceFile */
|
|
104692
104814
|
|| (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0);
|
|
104693
104815
|
}
|
|
104694
104816
|
/**
|
|
@@ -105031,9 +105153,9 @@ var ts;
|
|
|
105031
105153
|
return visitCatchClause(node);
|
|
105032
105154
|
case 234 /* Block */:
|
|
105033
105155
|
return visitBlock(node);
|
|
105034
|
-
case
|
|
105156
|
+
case 351 /* MergeDeclarationMarker */:
|
|
105035
105157
|
return visitMergeDeclarationMarker(node);
|
|
105036
|
-
case
|
|
105158
|
+
case 352 /* EndOfDeclarationMarker */:
|
|
105037
105159
|
return visitEndOfDeclarationMarker(node);
|
|
105038
105160
|
default:
|
|
105039
105161
|
return visitor(node);
|
|
@@ -105225,7 +105347,7 @@ var ts;
|
|
|
105225
105347
|
return visitExpressionStatement(node);
|
|
105226
105348
|
case 211 /* ParenthesizedExpression */:
|
|
105227
105349
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
105228
|
-
case
|
|
105350
|
+
case 349 /* PartiallyEmittedExpression */:
|
|
105229
105351
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
105230
105352
|
case 220 /* BinaryExpression */:
|
|
105231
105353
|
if (ts.isDestructuringAssignment(node)) {
|
|
@@ -105318,7 +105440,7 @@ var ts;
|
|
|
105318
105440
|
}
|
|
105319
105441
|
else if (ts.isIdentifier(node)) {
|
|
105320
105442
|
var container = resolver.getReferencedExportContainer(node);
|
|
105321
|
-
return container !== undefined && container.kind ===
|
|
105443
|
+
return container !== undefined && container.kind === 304 /* SourceFile */;
|
|
105322
105444
|
}
|
|
105323
105445
|
else {
|
|
105324
105446
|
return false;
|
|
@@ -105396,7 +105518,7 @@ var ts;
|
|
|
105396
105518
|
* @param emitCallback A callback used to emit the node in the printer.
|
|
105397
105519
|
*/
|
|
105398
105520
|
function onEmitNode(hint, node, emitCallback) {
|
|
105399
|
-
if (node.kind ===
|
|
105521
|
+
if (node.kind === 304 /* SourceFile */) {
|
|
105400
105522
|
var id = ts.getOriginalNodeId(node);
|
|
105401
105523
|
currentSourceFile = node;
|
|
105402
105524
|
moduleInfo = moduleInfoMap[id];
|
|
@@ -105446,7 +105568,7 @@ var ts;
|
|
|
105446
105568
|
*/
|
|
105447
105569
|
function substituteUnspecified(node) {
|
|
105448
105570
|
switch (node.kind) {
|
|
105449
|
-
case
|
|
105571
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
105450
105572
|
return substituteShorthandPropertyAssignment(node);
|
|
105451
105573
|
}
|
|
105452
105574
|
return node;
|
|
@@ -105575,7 +105697,7 @@ var ts;
|
|
|
105575
105697
|
|| resolver.getReferencedValueDeclaration(name);
|
|
105576
105698
|
if (valueDeclaration) {
|
|
105577
105699
|
var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false);
|
|
105578
|
-
if (exportContainer && exportContainer.kind ===
|
|
105700
|
+
if (exportContainer && exportContainer.kind === 304 /* SourceFile */) {
|
|
105579
105701
|
exportedNames = ts.append(exportedNames, factory.getDeclarationName(valueDeclaration));
|
|
105580
105702
|
}
|
|
105581
105703
|
exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]);
|
|
@@ -105618,7 +105740,7 @@ var ts;
|
|
|
105618
105740
|
var previousOnSubstituteNode = context.onSubstituteNode;
|
|
105619
105741
|
context.onEmitNode = onEmitNode;
|
|
105620
105742
|
context.onSubstituteNode = onSubstituteNode;
|
|
105621
|
-
context.enableEmitNotification(
|
|
105743
|
+
context.enableEmitNotification(304 /* SourceFile */);
|
|
105622
105744
|
context.enableSubstitution(79 /* Identifier */);
|
|
105623
105745
|
var helperNameSubstitutions;
|
|
105624
105746
|
var currentSourceFile;
|
|
@@ -105826,8 +105948,8 @@ var ts;
|
|
|
105826
105948
|
var cjsOnEmitNode = context.onEmitNode;
|
|
105827
105949
|
context.onSubstituteNode = onSubstituteNode;
|
|
105828
105950
|
context.onEmitNode = onEmitNode;
|
|
105829
|
-
context.enableSubstitution(
|
|
105830
|
-
context.enableEmitNotification(
|
|
105951
|
+
context.enableSubstitution(304 /* SourceFile */);
|
|
105952
|
+
context.enableEmitNotification(304 /* SourceFile */);
|
|
105831
105953
|
var currentSourceFile;
|
|
105832
105954
|
return transformSourceFileOrBundle;
|
|
105833
105955
|
function onSubstituteNode(hint, node) {
|
|
@@ -105874,7 +105996,7 @@ var ts;
|
|
|
105874
105996
|
return result;
|
|
105875
105997
|
}
|
|
105876
105998
|
function transformSourceFileOrBundle(node) {
|
|
105877
|
-
return node.kind ===
|
|
105999
|
+
return node.kind === 304 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
|
|
105878
106000
|
}
|
|
105879
106001
|
function transformBundle(node) {
|
|
105880
106002
|
return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends);
|
|
@@ -106523,10 +106645,10 @@ var ts;
|
|
|
106523
106645
|
return result;
|
|
106524
106646
|
}
|
|
106525
106647
|
function transformRoot(node) {
|
|
106526
|
-
if (node.kind ===
|
|
106648
|
+
if (node.kind === 304 /* SourceFile */ && node.isDeclarationFile) {
|
|
106527
106649
|
return node;
|
|
106528
106650
|
}
|
|
106529
|
-
if (node.kind ===
|
|
106651
|
+
if (node.kind === 305 /* Bundle */) {
|
|
106530
106652
|
isBundledEmit = true;
|
|
106531
106653
|
refs = new ts.Map();
|
|
106532
106654
|
libs = new ts.Map();
|
|
@@ -106556,7 +106678,7 @@ var ts;
|
|
|
106556
106678
|
var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
|
|
106557
106679
|
return factory.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []);
|
|
106558
106680
|
}), ts.mapDefined(node.prepends, function (prepend) {
|
|
106559
|
-
if (prepend.kind ===
|
|
106681
|
+
if (prepend.kind === 307 /* InputFiles */) {
|
|
106560
106682
|
var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal);
|
|
106561
106683
|
hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib;
|
|
106562
106684
|
collectReferences(sourceFile, refs);
|
|
@@ -106928,34 +107050,31 @@ var ts;
|
|
|
106928
107050
|
if (!decl.importClause) {
|
|
106929
107051
|
// import "mod" - possibly needed for side effects? (global interface patches, module augmentations, etc)
|
|
106930
107052
|
return factory.updateImportDeclaration(decl,
|
|
106931
|
-
/*decorators*/ undefined, decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
106932
|
-
/*assertClause*/ undefined);
|
|
107053
|
+
/*decorators*/ undefined, decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
|
|
106933
107054
|
}
|
|
106934
107055
|
// The `importClause` visibility corresponds to the default's visibility.
|
|
106935
107056
|
var visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : undefined;
|
|
106936
107057
|
if (!decl.importClause.namedBindings) {
|
|
106937
107058
|
// No named bindings (either namespace or list), meaning the import is just default or should be elided
|
|
106938
107059
|
return visibleDefaultBinding && factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding,
|
|
106939
|
-
/*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107060
|
+
/*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
|
|
106940
107061
|
}
|
|
106941
107062
|
if (decl.importClause.namedBindings.kind === 267 /* NamespaceImport */) {
|
|
106942
107063
|
// Namespace import (optionally with visible default)
|
|
106943
107064
|
var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined;
|
|
106944
|
-
return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107065
|
+
return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined) : undefined;
|
|
106945
107066
|
}
|
|
106946
107067
|
// Named imports (optionally with visible default)
|
|
106947
107068
|
var bindingList = ts.mapDefined(decl.importClause.namedBindings.elements, function (b) { return resolver.isDeclarationVisible(b) ? b : undefined; });
|
|
106948
107069
|
if ((bindingList && bindingList.length) || visibleDefaultBinding) {
|
|
106949
107070
|
return factory.updateImportDeclaration(decl,
|
|
106950
|
-
/*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, bindingList && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) : undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
106951
|
-
/*assertClause*/ undefined);
|
|
107071
|
+
/*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, bindingList && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) : undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
|
|
106952
107072
|
}
|
|
106953
107073
|
// Augmentation of export depends on import
|
|
106954
107074
|
if (resolver.isImportRequiredByAugmentation(decl)) {
|
|
106955
107075
|
return factory.updateImportDeclaration(decl,
|
|
106956
107076
|
/*decorators*/ undefined, decl.modifiers,
|
|
106957
|
-
/*importClause*/ undefined, rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
106958
|
-
/*assertClause*/ undefined);
|
|
107077
|
+
/*importClause*/ undefined, rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
|
|
106959
107078
|
}
|
|
106960
107079
|
// Nothing visible
|
|
106961
107080
|
}
|
|
@@ -107164,7 +107283,7 @@ var ts;
|
|
|
107164
107283
|
case 199 /* ImportType */: {
|
|
107165
107284
|
if (!ts.isLiteralImportTypeNode(input))
|
|
107166
107285
|
return cleanup(input);
|
|
107167
|
-
return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf));
|
|
107286
|
+
return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.assertions, input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf));
|
|
107168
107287
|
}
|
|
107169
107288
|
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: " + ts.SyntaxKind[input.kind]);
|
|
107170
107289
|
}
|
|
@@ -107211,8 +107330,7 @@ var ts;
|
|
|
107211
107330
|
// Always visible if the parent node isn't dropped for being not visible
|
|
107212
107331
|
// Rewrite external module names if necessary
|
|
107213
107332
|
return factory.updateExportDeclaration(input,
|
|
107214
|
-
/*decorators*/ undefined, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier),
|
|
107215
|
-
/*assertClause*/ undefined);
|
|
107333
|
+
/*decorators*/ undefined, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), ts.getResolutionModeOverrideForClause(input.assertClause) ? input.assertClause : undefined);
|
|
107216
107334
|
}
|
|
107217
107335
|
case 270 /* ExportAssignment */: {
|
|
107218
107336
|
// Always visible if the parent node isn't dropped for being not visible
|
|
@@ -107579,7 +107697,7 @@ var ts;
|
|
|
107579
107697
|
function ensureModifierFlags(node) {
|
|
107580
107698
|
var mask = 27647 /* All */ ^ (4 /* Public */ | 256 /* Async */ | 16384 /* Override */); // No async and override modifiers in declaration files
|
|
107581
107699
|
var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */;
|
|
107582
|
-
var parentIsFile = node.parent.kind ===
|
|
107700
|
+
var parentIsFile = node.parent.kind === 304 /* SourceFile */;
|
|
107583
107701
|
if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) {
|
|
107584
107702
|
mask ^= 2 /* Ambient */;
|
|
107585
107703
|
additions = 0 /* None */;
|
|
@@ -107826,7 +107944,7 @@ var ts;
|
|
|
107826
107944
|
* @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files.
|
|
107827
107945
|
*/
|
|
107828
107946
|
function transformNodes(resolver, host, factory, options, nodes, transformers, allowDtsFiles) {
|
|
107829
|
-
var enabledSyntaxKindFeatures = new Array(
|
|
107947
|
+
var enabledSyntaxKindFeatures = new Array(354 /* Count */);
|
|
107830
107948
|
var lexicalEnvironmentVariableDeclarations;
|
|
107831
107949
|
var lexicalEnvironmentFunctionDeclarations;
|
|
107832
107950
|
var lexicalEnvironmentStatements;
|
|
@@ -107908,7 +108026,7 @@ var ts;
|
|
|
107908
108026
|
var transformed = [];
|
|
107909
108027
|
for (var _a = 0, nodes_3 = nodes; _a < nodes_3.length; _a++) {
|
|
107910
108028
|
var node = nodes_3[_a];
|
|
107911
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("emit" /* Emit */, "transformNodes", node.kind ===
|
|
108029
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("emit" /* Emit */, "transformNodes", node.kind === 304 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });
|
|
107912
108030
|
transformed.push((allowDtsFiles ? transformation : transformRoot)(node));
|
|
107913
108031
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
107914
108032
|
}
|
|
@@ -108314,7 +108432,7 @@ var ts;
|
|
|
108314
108432
|
/*@internal*/
|
|
108315
108433
|
function getOutputPathsFor(sourceFile, host, forceDtsPaths) {
|
|
108316
108434
|
var options = host.getCompilerOptions();
|
|
108317
|
-
if (sourceFile.kind ===
|
|
108435
|
+
if (sourceFile.kind === 305 /* Bundle */) {
|
|
108318
108436
|
return getOutputPathsForBundle(options, forceDtsPaths);
|
|
108319
108437
|
}
|
|
108320
108438
|
else {
|
|
@@ -108663,7 +108781,7 @@ var ts;
|
|
|
108663
108781
|
extendedDiagnostics: compilerOptions.extendedDiagnostics,
|
|
108664
108782
|
// Explicitly do not passthru either `inline` option
|
|
108665
108783
|
});
|
|
108666
|
-
if (forceDtsEmit && declarationTransform.transformed[0].kind ===
|
|
108784
|
+
if (forceDtsEmit && declarationTransform.transformed[0].kind === 304 /* SourceFile */) {
|
|
108667
108785
|
var sourceFile = declarationTransform.transformed[0];
|
|
108668
108786
|
exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit;
|
|
108669
108787
|
}
|
|
@@ -108686,8 +108804,8 @@ var ts;
|
|
|
108686
108804
|
ts.forEachChild(node, collectLinkedAliases);
|
|
108687
108805
|
}
|
|
108688
108806
|
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) {
|
|
108689
|
-
var bundle = sourceFileOrBundle.kind ===
|
|
108690
|
-
var sourceFile = sourceFileOrBundle.kind ===
|
|
108807
|
+
var bundle = sourceFileOrBundle.kind === 305 /* Bundle */ ? sourceFileOrBundle : undefined;
|
|
108808
|
+
var sourceFile = sourceFileOrBundle.kind === 304 /* SourceFile */ ? sourceFileOrBundle : undefined;
|
|
108691
108809
|
var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile];
|
|
108692
108810
|
var sourceMapGenerator;
|
|
108693
108811
|
if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) {
|
|
@@ -108728,7 +108846,7 @@ var ts;
|
|
|
108728
108846
|
}
|
|
108729
108847
|
function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
|
|
108730
108848
|
return (mapOptions.sourceMap || mapOptions.inlineSourceMap)
|
|
108731
|
-
&& (sourceFileOrBundle.kind !==
|
|
108849
|
+
&& (sourceFileOrBundle.kind !== 304 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */));
|
|
108732
108850
|
}
|
|
108733
108851
|
function getSourceRoot(mapOptions) {
|
|
108734
108852
|
// Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the
|
|
@@ -109039,9 +109157,9 @@ var ts;
|
|
|
109039
109157
|
break;
|
|
109040
109158
|
}
|
|
109041
109159
|
switch (node.kind) {
|
|
109042
|
-
case
|
|
109043
|
-
case
|
|
109044
|
-
case
|
|
109160
|
+
case 304 /* SourceFile */: return printFile(node);
|
|
109161
|
+
case 305 /* Bundle */: return printBundle(node);
|
|
109162
|
+
case 306 /* UnparsedSource */: return printUnparsedSource(node);
|
|
109045
109163
|
}
|
|
109046
109164
|
writeNode(hint, node, sourceFile, beginPrint());
|
|
109047
109165
|
return endPrint();
|
|
@@ -109590,100 +109708,100 @@ var ts;
|
|
|
109590
109708
|
case 291 /* CatchClause */:
|
|
109591
109709
|
return emitCatchClause(node);
|
|
109592
109710
|
// Property assignments
|
|
109593
|
-
case
|
|
109711
|
+
case 295 /* PropertyAssignment */:
|
|
109594
109712
|
return emitPropertyAssignment(node);
|
|
109595
|
-
case
|
|
109713
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
109596
109714
|
return emitShorthandPropertyAssignment(node);
|
|
109597
|
-
case
|
|
109715
|
+
case 297 /* SpreadAssignment */:
|
|
109598
109716
|
return emitSpreadAssignment(node);
|
|
109599
109717
|
// Enum
|
|
109600
|
-
case
|
|
109718
|
+
case 298 /* EnumMember */:
|
|
109601
109719
|
return emitEnumMember(node);
|
|
109602
109720
|
// Unparsed
|
|
109603
|
-
case
|
|
109721
|
+
case 299 /* UnparsedPrologue */:
|
|
109604
109722
|
return writeUnparsedNode(node);
|
|
109605
|
-
case
|
|
109606
|
-
case
|
|
109723
|
+
case 306 /* UnparsedSource */:
|
|
109724
|
+
case 300 /* UnparsedPrepend */:
|
|
109607
109725
|
return emitUnparsedSourceOrPrepend(node);
|
|
109608
|
-
case
|
|
109609
|
-
case
|
|
109726
|
+
case 301 /* UnparsedText */:
|
|
109727
|
+
case 302 /* UnparsedInternalText */:
|
|
109610
109728
|
return emitUnparsedTextLike(node);
|
|
109611
|
-
case
|
|
109729
|
+
case 303 /* UnparsedSyntheticReference */:
|
|
109612
109730
|
return emitUnparsedSyntheticReference(node);
|
|
109613
109731
|
// Top-level nodes
|
|
109614
|
-
case
|
|
109732
|
+
case 304 /* SourceFile */:
|
|
109615
109733
|
return emitSourceFile(node);
|
|
109616
|
-
case
|
|
109734
|
+
case 305 /* Bundle */:
|
|
109617
109735
|
return ts.Debug.fail("Bundles should be printed using printBundle");
|
|
109618
109736
|
// SyntaxKind.UnparsedSource (handled above)
|
|
109619
|
-
case
|
|
109737
|
+
case 307 /* InputFiles */:
|
|
109620
109738
|
return ts.Debug.fail("InputFiles should not be printed");
|
|
109621
109739
|
// JSDoc nodes (only used in codefixes currently)
|
|
109622
|
-
case
|
|
109740
|
+
case 308 /* JSDocTypeExpression */:
|
|
109623
109741
|
return emitJSDocTypeExpression(node);
|
|
109624
|
-
case
|
|
109742
|
+
case 309 /* JSDocNameReference */:
|
|
109625
109743
|
return emitJSDocNameReference(node);
|
|
109626
|
-
case
|
|
109744
|
+
case 311 /* JSDocAllType */:
|
|
109627
109745
|
return writePunctuation("*");
|
|
109628
|
-
case
|
|
109746
|
+
case 312 /* JSDocUnknownType */:
|
|
109629
109747
|
return writePunctuation("?");
|
|
109630
|
-
case
|
|
109748
|
+
case 313 /* JSDocNullableType */:
|
|
109631
109749
|
return emitJSDocNullableType(node);
|
|
109632
|
-
case
|
|
109750
|
+
case 314 /* JSDocNonNullableType */:
|
|
109633
109751
|
return emitJSDocNonNullableType(node);
|
|
109634
|
-
case
|
|
109752
|
+
case 315 /* JSDocOptionalType */:
|
|
109635
109753
|
return emitJSDocOptionalType(node);
|
|
109636
|
-
case
|
|
109754
|
+
case 316 /* JSDocFunctionType */:
|
|
109637
109755
|
return emitJSDocFunctionType(node);
|
|
109638
109756
|
case 185 /* RestType */:
|
|
109639
|
-
case
|
|
109757
|
+
case 317 /* JSDocVariadicType */:
|
|
109640
109758
|
return emitRestOrJSDocVariadicType(node);
|
|
109641
|
-
case
|
|
109759
|
+
case 318 /* JSDocNamepathType */:
|
|
109642
109760
|
return;
|
|
109643
|
-
case
|
|
109761
|
+
case 319 /* JSDocComment */:
|
|
109644
109762
|
return emitJSDoc(node);
|
|
109645
|
-
case
|
|
109763
|
+
case 321 /* JSDocTypeLiteral */:
|
|
109646
109764
|
return emitJSDocTypeLiteral(node);
|
|
109647
|
-
case
|
|
109765
|
+
case 322 /* JSDocSignature */:
|
|
109648
109766
|
return emitJSDocSignature(node);
|
|
109649
|
-
case
|
|
109650
|
-
case
|
|
109651
|
-
case
|
|
109767
|
+
case 326 /* JSDocTag */:
|
|
109768
|
+
case 331 /* JSDocClassTag */:
|
|
109769
|
+
case 336 /* JSDocOverrideTag */:
|
|
109652
109770
|
return emitJSDocSimpleTag(node);
|
|
109653
|
-
case
|
|
109654
|
-
case
|
|
109771
|
+
case 327 /* JSDocAugmentsTag */:
|
|
109772
|
+
case 328 /* JSDocImplementsTag */:
|
|
109655
109773
|
return emitJSDocHeritageTag(node);
|
|
109656
|
-
case
|
|
109657
|
-
case
|
|
109774
|
+
case 329 /* JSDocAuthorTag */:
|
|
109775
|
+
case 330 /* JSDocDeprecatedTag */:
|
|
109658
109776
|
return;
|
|
109659
109777
|
// SyntaxKind.JSDocClassTag (see JSDocTag, above)
|
|
109660
|
-
case
|
|
109661
|
-
case
|
|
109662
|
-
case
|
|
109663
|
-
case
|
|
109778
|
+
case 332 /* JSDocPublicTag */:
|
|
109779
|
+
case 333 /* JSDocPrivateTag */:
|
|
109780
|
+
case 334 /* JSDocProtectedTag */:
|
|
109781
|
+
case 335 /* JSDocReadonlyTag */:
|
|
109664
109782
|
return;
|
|
109665
|
-
case
|
|
109783
|
+
case 337 /* JSDocCallbackTag */:
|
|
109666
109784
|
return emitJSDocCallbackTag(node);
|
|
109667
109785
|
// SyntaxKind.JSDocEnumTag (see below)
|
|
109668
|
-
case
|
|
109669
|
-
case
|
|
109786
|
+
case 339 /* JSDocParameterTag */:
|
|
109787
|
+
case 346 /* JSDocPropertyTag */:
|
|
109670
109788
|
return emitJSDocPropertyLikeTag(node);
|
|
109671
|
-
case
|
|
109672
|
-
case
|
|
109673
|
-
case
|
|
109674
|
-
case
|
|
109789
|
+
case 338 /* JSDocEnumTag */:
|
|
109790
|
+
case 340 /* JSDocReturnTag */:
|
|
109791
|
+
case 341 /* JSDocThisTag */:
|
|
109792
|
+
case 342 /* JSDocTypeTag */:
|
|
109675
109793
|
return emitJSDocSimpleTypedTag(node);
|
|
109676
|
-
case
|
|
109794
|
+
case 343 /* JSDocTemplateTag */:
|
|
109677
109795
|
return emitJSDocTemplateTag(node);
|
|
109678
|
-
case
|
|
109796
|
+
case 344 /* JSDocTypedefTag */:
|
|
109679
109797
|
return emitJSDocTypedefTag(node);
|
|
109680
|
-
case
|
|
109798
|
+
case 345 /* JSDocSeeTag */:
|
|
109681
109799
|
return emitJSDocSeeTag(node);
|
|
109682
109800
|
// SyntaxKind.JSDocPropertyTag (see JSDocParameterTag, above)
|
|
109683
109801
|
// Transformation nodes
|
|
109684
|
-
case
|
|
109685
|
-
case
|
|
109686
|
-
case
|
|
109802
|
+
case 348 /* NotEmittedStatement */:
|
|
109803
|
+
case 352 /* EndOfDeclarationMarker */:
|
|
109804
|
+
case 351 /* MergeDeclarationMarker */:
|
|
109687
109805
|
return;
|
|
109688
109806
|
}
|
|
109689
109807
|
if (ts.isExpression(node)) {
|
|
@@ -109781,19 +109899,19 @@ var ts;
|
|
|
109781
109899
|
case 281 /* JsxFragment */:
|
|
109782
109900
|
return emitJsxFragment(node);
|
|
109783
109901
|
// Synthesized list
|
|
109784
|
-
case
|
|
109902
|
+
case 347 /* SyntaxList */:
|
|
109785
109903
|
return ts.Debug.fail("SyntaxList should not be printed");
|
|
109786
109904
|
// Transformation nodes
|
|
109787
|
-
case
|
|
109905
|
+
case 348 /* NotEmittedStatement */:
|
|
109788
109906
|
return;
|
|
109789
|
-
case
|
|
109907
|
+
case 349 /* PartiallyEmittedExpression */:
|
|
109790
109908
|
return emitPartiallyEmittedExpression(node);
|
|
109791
|
-
case
|
|
109909
|
+
case 350 /* CommaListExpression */:
|
|
109792
109910
|
return emitCommaList(node);
|
|
109793
|
-
case
|
|
109794
|
-
case
|
|
109911
|
+
case 351 /* MergeDeclarationMarker */:
|
|
109912
|
+
case 352 /* EndOfDeclarationMarker */:
|
|
109795
109913
|
return;
|
|
109796
|
-
case
|
|
109914
|
+
case 353 /* SyntheticReferenceExpression */:
|
|
109797
109915
|
return ts.Debug.fail("SyntheticReferenceExpression should not be printed");
|
|
109798
109916
|
}
|
|
109799
109917
|
}
|
|
@@ -109841,7 +109959,7 @@ var ts;
|
|
|
109841
109959
|
}
|
|
109842
109960
|
function emitHelpers(node) {
|
|
109843
109961
|
var helpersEmitted = false;
|
|
109844
|
-
var bundle = node.kind ===
|
|
109962
|
+
var bundle = node.kind === 305 /* Bundle */ ? node : undefined;
|
|
109845
109963
|
if (bundle && moduleKind === ts.ModuleKind.None) {
|
|
109846
109964
|
return;
|
|
109847
109965
|
}
|
|
@@ -109941,7 +110059,7 @@ var ts;
|
|
|
109941
110059
|
var pos = getTextPosWithWriteLine();
|
|
109942
110060
|
writeUnparsedNode(unparsed);
|
|
109943
110061
|
if (bundleFileInfo) {
|
|
109944
|
-
updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind ===
|
|
110062
|
+
updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 301 /* UnparsedText */ ?
|
|
109945
110063
|
"text" /* Text */ :
|
|
109946
110064
|
"internal" /* Internal */);
|
|
109947
110065
|
}
|
|
@@ -110039,7 +110157,7 @@ var ts;
|
|
|
110039
110157
|
emit(node.dotDotDotToken);
|
|
110040
110158
|
emitNodeWithWriter(node.name, writeParameter);
|
|
110041
110159
|
emit(node.questionToken);
|
|
110042
|
-
if (node.parent && node.parent.kind ===
|
|
110160
|
+
if (node.parent && node.parent.kind === 316 /* JSDocFunctionType */ && !node.name) {
|
|
110043
110161
|
emit(node.type);
|
|
110044
110162
|
}
|
|
110045
110163
|
else {
|
|
@@ -110353,6 +110471,19 @@ var ts;
|
|
|
110353
110471
|
writeKeyword("import");
|
|
110354
110472
|
writePunctuation("(");
|
|
110355
110473
|
emit(node.argument);
|
|
110474
|
+
if (node.assertions) {
|
|
110475
|
+
writePunctuation(",");
|
|
110476
|
+
writeSpace();
|
|
110477
|
+
writePunctuation("{");
|
|
110478
|
+
writeSpace();
|
|
110479
|
+
writeKeyword("assert");
|
|
110480
|
+
writePunctuation(":");
|
|
110481
|
+
writeSpace();
|
|
110482
|
+
var elements = node.assertions.assertClause.elements;
|
|
110483
|
+
emitList(node.assertions.assertClause, elements, 526226 /* ImportClauseEntries */);
|
|
110484
|
+
writeSpace();
|
|
110485
|
+
writePunctuation("}");
|
|
110486
|
+
}
|
|
110356
110487
|
writePunctuation(")");
|
|
110357
110488
|
if (node.qualifier) {
|
|
110358
110489
|
writePunctuation(".");
|
|
@@ -111568,7 +111699,7 @@ var ts;
|
|
|
111568
111699
|
}
|
|
111569
111700
|
}
|
|
111570
111701
|
if (node.tags) {
|
|
111571
|
-
if (node.tags.length === 1 && node.tags[0].kind ===
|
|
111702
|
+
if (node.tags.length === 1 && node.tags[0].kind === 342 /* JSDocTypeTag */ && !node.comment) {
|
|
111572
111703
|
writeSpace();
|
|
111573
111704
|
emit(node.tags[0]);
|
|
111574
111705
|
}
|
|
@@ -111613,7 +111744,7 @@ var ts;
|
|
|
111613
111744
|
function emitJSDocTypedefTag(tag) {
|
|
111614
111745
|
emitJSDocTagName(tag.tagName);
|
|
111615
111746
|
if (tag.typeExpression) {
|
|
111616
|
-
if (tag.typeExpression.kind ===
|
|
111747
|
+
if (tag.typeExpression.kind === 308 /* JSDocTypeExpression */) {
|
|
111617
111748
|
emitJSDocTypeExpression(tag.typeExpression);
|
|
111618
111749
|
}
|
|
111619
111750
|
else {
|
|
@@ -111632,7 +111763,7 @@ var ts;
|
|
|
111632
111763
|
emit(tag.fullName);
|
|
111633
111764
|
}
|
|
111634
111765
|
emitJSDocComment(tag.comment);
|
|
111635
|
-
if (tag.typeExpression && tag.typeExpression.kind ===
|
|
111766
|
+
if (tag.typeExpression && tag.typeExpression.kind === 321 /* JSDocTypeLiteral */) {
|
|
111636
111767
|
emitJSDocTypeLiteral(tag.typeExpression);
|
|
111637
111768
|
}
|
|
111638
111769
|
}
|
|
@@ -112692,8 +112823,8 @@ var ts;
|
|
|
112692
112823
|
if (!node)
|
|
112693
112824
|
return;
|
|
112694
112825
|
switch (node.kind) {
|
|
112695
|
-
case
|
|
112696
|
-
case
|
|
112826
|
+
case 295 /* PropertyAssignment */:
|
|
112827
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
112697
112828
|
case 166 /* PropertyDeclaration */:
|
|
112698
112829
|
case 168 /* MethodDeclaration */:
|
|
112699
112830
|
case 171 /* GetAccessor */:
|
|
@@ -112980,7 +113111,7 @@ var ts;
|
|
|
112980
113111
|
// Emit leading comments if the position is not synthesized and the node
|
|
112981
113112
|
// has not opted out from emitting leading comments.
|
|
112982
113113
|
if (!skipLeadingComments) {
|
|
112983
|
-
emitLeadingComments(pos, /*isEmittedNode*/ node.kind !==
|
|
113114
|
+
emitLeadingComments(pos, /*isEmittedNode*/ node.kind !== 348 /* NotEmittedStatement */);
|
|
112984
113115
|
}
|
|
112985
113116
|
if (!skipLeadingComments || (pos >= 0 && (emitFlags & 512 /* NoLeadingComments */) !== 0)) {
|
|
112986
113117
|
// Advance the container position if comments get emitted or if they've been disabled explicitly using NoLeadingComments.
|
|
@@ -113010,7 +113141,7 @@ var ts;
|
|
|
113010
113141
|
declarationListContainerEnd = savedDeclarationListContainerEnd;
|
|
113011
113142
|
// Emit trailing comments if the position is not synthesized and the node
|
|
113012
113143
|
// has not opted out from emitting leading comments and is an emitted node.
|
|
113013
|
-
if (!skipTrailingComments && node.kind !==
|
|
113144
|
+
if (!skipTrailingComments && node.kind !== 348 /* NotEmittedStatement */) {
|
|
113014
113145
|
emitTrailingComments(end);
|
|
113015
113146
|
}
|
|
113016
113147
|
}
|
|
@@ -113285,7 +113416,7 @@ var ts;
|
|
|
113285
113416
|
}
|
|
113286
113417
|
else {
|
|
113287
113418
|
var source = sourceMapRange.source || sourceMapSource;
|
|
113288
|
-
if (node.kind !==
|
|
113419
|
+
if (node.kind !== 348 /* NotEmittedStatement */
|
|
113289
113420
|
&& (emitFlags & 16 /* NoLeadingSourceMap */) === 0
|
|
113290
113421
|
&& sourceMapRange.pos >= 0) {
|
|
113291
113422
|
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
|
|
@@ -113303,7 +113434,7 @@ var ts;
|
|
|
113303
113434
|
if (emitFlags & 64 /* NoNestedSourceMaps */) {
|
|
113304
113435
|
sourceMapsDisabled = false;
|
|
113305
113436
|
}
|
|
113306
|
-
if (node.kind !==
|
|
113437
|
+
if (node.kind !== 348 /* NotEmittedStatement */
|
|
113307
113438
|
&& (emitFlags & 32 /* NoTrailingSourceMap */) === 0
|
|
113308
113439
|
&& sourceMapRange.end >= 0) {
|
|
113309
113440
|
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
|
|
@@ -114426,21 +114557,72 @@ var ts;
|
|
|
114426
114557
|
}
|
|
114427
114558
|
ts.getModeForResolutionAtIndex = getModeForResolutionAtIndex;
|
|
114428
114559
|
/* @internal */
|
|
114429
|
-
function
|
|
114560
|
+
function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
114430
114561
|
var _a;
|
|
114562
|
+
if (ts.isExportDeclaration(decl)) {
|
|
114563
|
+
return decl.isTypeOnly;
|
|
114564
|
+
}
|
|
114565
|
+
if ((_a = decl.importClause) === null || _a === void 0 ? void 0 : _a.isTypeOnly) {
|
|
114566
|
+
return true;
|
|
114567
|
+
}
|
|
114568
|
+
return false;
|
|
114569
|
+
}
|
|
114570
|
+
ts.isExclusivelyTypeOnlyImportOrExport = isExclusivelyTypeOnlyImportOrExport;
|
|
114571
|
+
/* @internal */
|
|
114572
|
+
function getModeForUsageLocation(file, usage) {
|
|
114573
|
+
var _a, _b;
|
|
114431
114574
|
if (file.impliedNodeFormat === undefined)
|
|
114432
114575
|
return undefined;
|
|
114576
|
+
if ((ts.isImportDeclaration(usage.parent) || ts.isExportDeclaration(usage.parent))) {
|
|
114577
|
+
var isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
114578
|
+
if (isTypeOnly) {
|
|
114579
|
+
var override = getResolutionModeOverrideForClause(usage.parent.assertClause);
|
|
114580
|
+
if (override) {
|
|
114581
|
+
return override;
|
|
114582
|
+
}
|
|
114583
|
+
}
|
|
114584
|
+
}
|
|
114585
|
+
if (usage.parent.parent && ts.isImportTypeNode(usage.parent.parent)) {
|
|
114586
|
+
var override = getResolutionModeOverrideForClause((_a = usage.parent.parent.assertions) === null || _a === void 0 ? void 0 : _a.assertClause);
|
|
114587
|
+
if (override) {
|
|
114588
|
+
return override;
|
|
114589
|
+
}
|
|
114590
|
+
}
|
|
114433
114591
|
if (file.impliedNodeFormat !== ts.ModuleKind.ESNext) {
|
|
114434
114592
|
// in cjs files, import call expressions are esm format, otherwise everything is cjs
|
|
114435
114593
|
return ts.isImportCall(ts.walkUpParenthesizedExpressions(usage.parent)) ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS;
|
|
114436
114594
|
}
|
|
114437
114595
|
// in esm files, import=require statements are cjs format, otherwise everything is esm
|
|
114438
114596
|
// imports are only parent'd up to their containing declaration/expression, so access farther parents with care
|
|
114439
|
-
var exprParentParent = (
|
|
114597
|
+
var exprParentParent = (_b = ts.walkUpParenthesizedExpressions(usage.parent)) === null || _b === void 0 ? void 0 : _b.parent;
|
|
114440
114598
|
return exprParentParent && ts.isImportEqualsDeclaration(exprParentParent) ? ts.ModuleKind.CommonJS : ts.ModuleKind.ESNext;
|
|
114441
114599
|
}
|
|
114442
114600
|
ts.getModeForUsageLocation = getModeForUsageLocation;
|
|
114443
114601
|
/* @internal */
|
|
114602
|
+
function getResolutionModeOverrideForClause(clause, grammarErrorOnNode) {
|
|
114603
|
+
if (!clause)
|
|
114604
|
+
return undefined;
|
|
114605
|
+
if (ts.length(clause.elements) !== 1) {
|
|
114606
|
+
grammarErrorOnNode === null || grammarErrorOnNode === void 0 ? void 0 : grammarErrorOnNode(clause, ts.Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require);
|
|
114607
|
+
return undefined;
|
|
114608
|
+
}
|
|
114609
|
+
var elem = clause.elements[0];
|
|
114610
|
+
if (!ts.isStringLiteralLike(elem.name))
|
|
114611
|
+
return undefined;
|
|
114612
|
+
if (elem.name.text !== "resolution-mode") {
|
|
114613
|
+
grammarErrorOnNode === null || grammarErrorOnNode === void 0 ? void 0 : grammarErrorOnNode(elem.name, ts.Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions);
|
|
114614
|
+
return undefined;
|
|
114615
|
+
}
|
|
114616
|
+
if (!ts.isStringLiteralLike(elem.value))
|
|
114617
|
+
return undefined;
|
|
114618
|
+
if (elem.value.text !== "import" && elem.value.text !== "require") {
|
|
114619
|
+
grammarErrorOnNode === null || grammarErrorOnNode === void 0 ? void 0 : grammarErrorOnNode(elem.value, ts.Diagnostics.resolution_mode_should_be_either_require_or_import);
|
|
114620
|
+
return undefined;
|
|
114621
|
+
}
|
|
114622
|
+
return elem.value.text === "import" ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS;
|
|
114623
|
+
}
|
|
114624
|
+
ts.getResolutionModeOverrideForClause = getResolutionModeOverrideForClause;
|
|
114625
|
+
/* @internal */
|
|
114444
114626
|
function loadWithModeAwareCache(names, containingFile, containingFileName, redirectedReference, loader) {
|
|
114445
114627
|
if (names.length === 0) {
|
|
114446
114628
|
return [];
|
|
@@ -120087,8 +120269,9 @@ var ts;
|
|
|
120087
120269
|
// Because when this is called by the file renamer, `importingSourceFile` is the file being renamed,
|
|
120088
120270
|
// while `importingSourceFileName` its *new* name. We need a source file just to get its
|
|
120089
120271
|
// `impliedNodeFormat` and to detect certain preferences from existing import module specifiers.
|
|
120090
|
-
function updateModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, oldImportSpecifier) {
|
|
120091
|
-
|
|
120272
|
+
function updateModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, oldImportSpecifier, options) {
|
|
120273
|
+
if (options === void 0) { options = {}; }
|
|
120274
|
+
var res = getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, getPreferencesForUpdate(compilerOptions, oldImportSpecifier, importingSourceFileName, host), {}, options);
|
|
120092
120275
|
if (res === oldImportSpecifier)
|
|
120093
120276
|
return undefined;
|
|
120094
120277
|
return res;
|
|
@@ -120100,65 +120283,77 @@ var ts;
|
|
|
120100
120283
|
// one currently being produced; the latter to the one being imported). We need an implementation file
|
|
120101
120284
|
// just to get its `impliedNodeFormat` and to detect certain preferences from existing import module
|
|
120102
120285
|
// specifiers.
|
|
120103
|
-
function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host) {
|
|
120104
|
-
|
|
120286
|
+
function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, options) {
|
|
120287
|
+
if (options === void 0) { options = {}; }
|
|
120288
|
+
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, getPreferences(host, {}, compilerOptions, importingSourceFile), {}, options);
|
|
120105
120289
|
}
|
|
120106
120290
|
moduleSpecifiers_1.getModuleSpecifier = getModuleSpecifier;
|
|
120107
|
-
function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences) {
|
|
120291
|
+
function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences, options) {
|
|
120292
|
+
if (options === void 0) { options = {}; }
|
|
120108
120293
|
var info = getInfo(importingSourceFile.path, host);
|
|
120109
|
-
var modulePaths = getAllModulePaths(importingSourceFile.path, nodeModulesFileName, host, preferences);
|
|
120110
|
-
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ true); });
|
|
120294
|
+
var modulePaths = getAllModulePaths(importingSourceFile.path, nodeModulesFileName, host, preferences, options);
|
|
120295
|
+
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ true, options.overrideImportMode); });
|
|
120111
120296
|
}
|
|
120112
120297
|
moduleSpecifiers_1.getNodeModulesPackageName = getNodeModulesPackageName;
|
|
120113
|
-
function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, preferences, userPreferences) {
|
|
120298
|
+
function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, preferences, userPreferences, options) {
|
|
120299
|
+
if (options === void 0) { options = {}; }
|
|
120114
120300
|
var info = getInfo(importingSourceFileName, host);
|
|
120115
|
-
var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences);
|
|
120116
|
-
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions); }) ||
|
|
120301
|
+
var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences, options);
|
|
120302
|
+
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ undefined, options.overrideImportMode); }) ||
|
|
120117
120303
|
getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences);
|
|
120118
120304
|
}
|
|
120119
|
-
function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences) {
|
|
120120
|
-
|
|
120305
|
+
function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences, options) {
|
|
120306
|
+
if (options === void 0) { options = {}; }
|
|
120307
|
+
return tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences, options)[0];
|
|
120121
120308
|
}
|
|
120122
120309
|
moduleSpecifiers_1.tryGetModuleSpecifiersFromCache = tryGetModuleSpecifiersFromCache;
|
|
120123
|
-
function tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences) {
|
|
120310
|
+
function tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences, options) {
|
|
120124
120311
|
var _a;
|
|
120312
|
+
if (options === void 0) { options = {}; }
|
|
120125
120313
|
var moduleSourceFile = ts.getSourceFileOfModule(moduleSymbol);
|
|
120126
120314
|
if (!moduleSourceFile) {
|
|
120127
120315
|
return ts.emptyArray;
|
|
120128
120316
|
}
|
|
120129
120317
|
var cache = (_a = host.getModuleSpecifierCache) === null || _a === void 0 ? void 0 : _a.call(host);
|
|
120130
|
-
var cached = cache === null || cache === void 0 ? void 0 : cache.get(importingSourceFile.path, moduleSourceFile.path, userPreferences);
|
|
120318
|
+
var cached = cache === null || cache === void 0 ? void 0 : cache.get(importingSourceFile.path, moduleSourceFile.path, userPreferences, options);
|
|
120131
120319
|
return [cached === null || cached === void 0 ? void 0 : cached.moduleSpecifiers, moduleSourceFile, cached === null || cached === void 0 ? void 0 : cached.modulePaths, cache];
|
|
120132
120320
|
}
|
|
120133
120321
|
/** Returns an import for each symlink and for the realpath. */
|
|
120134
|
-
function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences) {
|
|
120135
|
-
|
|
120322
|
+
function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options) {
|
|
120323
|
+
if (options === void 0) { options = {}; }
|
|
120324
|
+
return getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options).moduleSpecifiers;
|
|
120136
120325
|
}
|
|
120137
120326
|
moduleSpecifiers_1.getModuleSpecifiers = getModuleSpecifiers;
|
|
120138
|
-
function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences) {
|
|
120327
|
+
function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options) {
|
|
120328
|
+
if (options === void 0) { options = {}; }
|
|
120139
120329
|
var computedWithoutCache = false;
|
|
120140
120330
|
var ambient = tryGetModuleNameFromAmbientModule(moduleSymbol, checker);
|
|
120141
120331
|
if (ambient)
|
|
120142
120332
|
return { moduleSpecifiers: [ambient], computedWithoutCache: computedWithoutCache };
|
|
120143
120333
|
// eslint-disable-next-line prefer-const
|
|
120144
|
-
var _a = tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences), specifiers = _a[0], moduleSourceFile = _a[1], modulePaths = _a[2], cache = _a[3];
|
|
120334
|
+
var _a = tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences, options), specifiers = _a[0], moduleSourceFile = _a[1], modulePaths = _a[2], cache = _a[3];
|
|
120145
120335
|
if (specifiers)
|
|
120146
120336
|
return { moduleSpecifiers: specifiers, computedWithoutCache: computedWithoutCache };
|
|
120147
120337
|
if (!moduleSourceFile)
|
|
120148
120338
|
return { moduleSpecifiers: ts.emptyArray, computedWithoutCache: computedWithoutCache };
|
|
120149
120339
|
computedWithoutCache = true;
|
|
120150
120340
|
modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.path, moduleSourceFile.originalFileName, host));
|
|
120151
|
-
var result = computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences);
|
|
120152
|
-
cache === null || cache === void 0 ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, modulePaths, result);
|
|
120341
|
+
var result = computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options);
|
|
120342
|
+
cache === null || cache === void 0 ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, options, modulePaths, result);
|
|
120153
120343
|
return { moduleSpecifiers: result, computedWithoutCache: computedWithoutCache };
|
|
120154
120344
|
}
|
|
120155
120345
|
moduleSpecifiers_1.getModuleSpecifiersWithCacheInfo = getModuleSpecifiersWithCacheInfo;
|
|
120156
|
-
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences) {
|
|
120346
|
+
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options) {
|
|
120347
|
+
if (options === void 0) { options = {}; }
|
|
120157
120348
|
var info = getInfo(importingSourceFile.path, host);
|
|
120158
120349
|
var preferences = getPreferences(host, userPreferences, compilerOptions, importingSourceFile);
|
|
120159
120350
|
var existingSpecifier = ts.forEach(modulePaths, function (modulePath) { return ts.forEach(host.getFileIncludeReasons().get(ts.toPath(modulePath.path, host.getCurrentDirectory(), info.getCanonicalFileName)), function (reason) {
|
|
120160
120351
|
if (reason.kind !== ts.FileIncludeKind.Import || reason.file !== importingSourceFile.path)
|
|
120161
120352
|
return undefined;
|
|
120353
|
+
// If the candidate import mode doesn't match the mode we're generating for, don't consider it
|
|
120354
|
+
// TODO: maybe useful to keep around as an alternative option for certain contexts where the mode is overridable
|
|
120355
|
+
if (importingSourceFile.impliedNodeFormat && importingSourceFile.impliedNodeFormat !== ts.getModeForResolutionAtIndex(importingSourceFile, reason.index))
|
|
120356
|
+
return undefined;
|
|
120162
120357
|
var specifier = ts.getModuleNameStringLiteralAt(importingSourceFile, reason.index).text;
|
|
120163
120358
|
// If the preference is for non relative and the module specifier is relative, ignore it
|
|
120164
120359
|
return preferences.relativePreference !== 1 /* NonRelative */ || !ts.pathIsRelative(specifier) ?
|
|
@@ -120180,7 +120375,7 @@ var ts;
|
|
|
120180
120375
|
var relativeSpecifiers;
|
|
120181
120376
|
for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) {
|
|
120182
120377
|
var modulePath = modulePaths_1[_i];
|
|
120183
|
-
var specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions);
|
|
120378
|
+
var specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ undefined, options.overrideImportMode);
|
|
120184
120379
|
nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier);
|
|
120185
120380
|
if (specifier && modulePath.isRedirect) {
|
|
120186
120381
|
// If we got a specifier for a redirect, it was a bare package specifier (e.g. "@foo/bar",
|
|
@@ -120356,18 +120551,19 @@ var ts;
|
|
|
120356
120551
|
* Looks for existing imports that use symlinks to this module.
|
|
120357
120552
|
* Symlinks will be returned first so they are preferred over the real path.
|
|
120358
120553
|
*/
|
|
120359
|
-
function getAllModulePaths(importingFilePath, importedFileName, host, preferences,
|
|
120554
|
+
function getAllModulePaths(importingFilePath, importedFileName, host, preferences, options) {
|
|
120360
120555
|
var _a;
|
|
120361
|
-
if (
|
|
120556
|
+
if (options === void 0) { options = {}; }
|
|
120557
|
+
var importedFilePath = ts.toPath(importedFileName, host.getCurrentDirectory(), ts.hostGetCanonicalFileName(host));
|
|
120362
120558
|
var cache = (_a = host.getModuleSpecifierCache) === null || _a === void 0 ? void 0 : _a.call(host);
|
|
120363
120559
|
if (cache) {
|
|
120364
|
-
var cached = cache.get(importingFilePath, importedFilePath, preferences);
|
|
120560
|
+
var cached = cache.get(importingFilePath, importedFilePath, preferences, options);
|
|
120365
120561
|
if (cached === null || cached === void 0 ? void 0 : cached.modulePaths)
|
|
120366
120562
|
return cached.modulePaths;
|
|
120367
120563
|
}
|
|
120368
120564
|
var modulePaths = getAllModulePathsWorker(importingFilePath, importedFileName, host);
|
|
120369
120565
|
if (cache) {
|
|
120370
|
-
cache.setModulePaths(importingFilePath, importedFilePath, preferences, modulePaths);
|
|
120566
|
+
cache.setModulePaths(importingFilePath, importedFilePath, preferences, options, modulePaths);
|
|
120371
120567
|
}
|
|
120372
120568
|
return modulePaths;
|
|
120373
120569
|
}
|
|
@@ -120572,7 +120768,7 @@ var ts;
|
|
|
120572
120768
|
? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions)
|
|
120573
120769
|
: ts.removeFileExtension(relativePath);
|
|
120574
120770
|
}
|
|
120575
|
-
function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, packageNameOnly) {
|
|
120771
|
+
function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, packageNameOnly, overrideMode) {
|
|
120576
120772
|
var path = _a.path, isRedirect = _a.isRedirect;
|
|
120577
120773
|
var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory;
|
|
120578
120774
|
if (!host.fileExists || !host.readFile) {
|
|
@@ -120642,7 +120838,7 @@ var ts;
|
|
|
120642
120838
|
// an ImportEqualsDeclaration in an ESM-implied file or an ImportCall in a CJS-implied file. But since this function is
|
|
120643
120839
|
// usually called to conjure an import out of thin air, we don't have an existing usage to call `getModeForUsageAtIndex`
|
|
120644
120840
|
// with, so for now we just stick with the mode of the file.
|
|
120645
|
-
var conditions = ["node", importingSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext ? "import" : "require", "types"];
|
|
120841
|
+
var conditions = ["node", overrideMode || importingSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext ? "import" : "require", "types"];
|
|
120646
120842
|
var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string"
|
|
120647
120843
|
? tryGetModuleNameFromExports(options, path, packageRootPath, ts.getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions)
|
|
120648
120844
|
: undefined;
|