typescript 4.7.0-dev.20220301 → 4.7.0-dev.20220304
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.es2015.reflect.d.ts +1 -1
- package/lib/lib.es5.d.ts +6 -0
- package/lib/tsc.js +869 -669
- package/lib/tsserver.js +1197 -990
- package/lib/tsserverlibrary.d.ts +84 -66
- package/lib/tsserverlibrary.js +1197 -990
- package/lib/typescript.d.ts +84 -66
- package/lib/typescript.js +1185 -978
- package/lib/typescriptServices.d.ts +84 -66
- package/lib/typescriptServices.js +1185 -978
- package/lib/typingsInstaller.js +1000 -794
- 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.20220304";
|
|
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
|
}
|
|
@@ -32081,7 +32112,7 @@ var ts;
|
|
|
32081
32112
|
return false;
|
|
32082
32113
|
}
|
|
32083
32114
|
function isReusableEnumMember(node) {
|
|
32084
|
-
return node.kind ===
|
|
32115
|
+
return node.kind === 298 /* EnumMember */;
|
|
32085
32116
|
}
|
|
32086
32117
|
function isReusableTypeMember(node) {
|
|
32087
32118
|
if (node) {
|
|
@@ -33017,6 +33048,22 @@ var ts;
|
|
|
33017
33048
|
nextToken();
|
|
33018
33049
|
return token() === 100 /* ImportKeyword */;
|
|
33019
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
|
+
}
|
|
33020
33067
|
function parseImportType() {
|
|
33021
33068
|
sourceFlags |= 1048576 /* PossiblyContainsDynamicImport */;
|
|
33022
33069
|
var pos = getNodePos();
|
|
@@ -33024,10 +33071,14 @@ var ts;
|
|
|
33024
33071
|
parseExpected(100 /* ImportKeyword */);
|
|
33025
33072
|
parseExpected(20 /* OpenParenToken */);
|
|
33026
33073
|
var type = parseType();
|
|
33074
|
+
var assertions;
|
|
33075
|
+
if (parseOptional(27 /* CommaToken */)) {
|
|
33076
|
+
assertions = parseImportTypeAssertions();
|
|
33077
|
+
}
|
|
33027
33078
|
parseExpected(21 /* CloseParenToken */);
|
|
33028
33079
|
var qualifier = parseOptional(24 /* DotToken */) ? parseEntityNameOfTypeReference() : undefined;
|
|
33029
33080
|
var typeArguments = parseTypeArgumentsOfTypeReference();
|
|
33030
|
-
return finishNode(factory.createImportTypeNode(type, qualifier, typeArguments, isTypeOf), pos);
|
|
33081
|
+
return finishNode(factory.createImportTypeNode(type, assertions, qualifier, typeArguments, isTypeOf), pos);
|
|
33031
33082
|
}
|
|
33032
33083
|
function nextTokenIsNumericOrBigIntLiteral() {
|
|
33033
33084
|
nextToken();
|
|
@@ -36215,9 +36266,11 @@ var ts;
|
|
|
36215
36266
|
var value = parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false);
|
|
36216
36267
|
return finishNode(factory.createAssertEntry(name, value), pos);
|
|
36217
36268
|
}
|
|
36218
|
-
function parseAssertClause() {
|
|
36269
|
+
function parseAssertClause(skipAssertKeyword) {
|
|
36219
36270
|
var pos = getNodePos();
|
|
36220
|
-
|
|
36271
|
+
if (!skipAssertKeyword) {
|
|
36272
|
+
parseExpected(129 /* AssertKeyword */);
|
|
36273
|
+
}
|
|
36221
36274
|
var openBracePosition = scanner.getTokenPos();
|
|
36222
36275
|
if (parseExpected(18 /* OpenBraceToken */)) {
|
|
36223
36276
|
var multiLine = scanner.hasPrecedingLineBreak();
|
|
@@ -37105,7 +37158,7 @@ var ts;
|
|
|
37105
37158
|
var child = void 0;
|
|
37106
37159
|
var children = void 0;
|
|
37107
37160
|
while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) {
|
|
37108
|
-
if (child.kind ===
|
|
37161
|
+
if (child.kind === 339 /* JSDocParameterTag */ || child.kind === 346 /* JSDocPropertyTag */) {
|
|
37109
37162
|
children = ts.append(children, child);
|
|
37110
37163
|
}
|
|
37111
37164
|
}
|
|
@@ -37228,7 +37281,7 @@ var ts;
|
|
|
37228
37281
|
var hasChildren = false;
|
|
37229
37282
|
while (child = tryParse(function () { return parseChildPropertyTag(indent); })) {
|
|
37230
37283
|
hasChildren = true;
|
|
37231
|
-
if (child.kind ===
|
|
37284
|
+
if (child.kind === 342 /* JSDocTypeTag */) {
|
|
37232
37285
|
if (childTypeTag) {
|
|
37233
37286
|
parseErrorAtCurrentToken(ts.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
|
|
37234
37287
|
var lastError = ts.lastOrUndefined(parseDiagnostics);
|
|
@@ -37299,7 +37352,7 @@ var ts;
|
|
|
37299
37352
|
var returnTag = tryParse(function () {
|
|
37300
37353
|
if (parseOptionalJsdoc(59 /* AtToken */)) {
|
|
37301
37354
|
var tag = parseTag(indent);
|
|
37302
|
-
if (tag && tag.kind ===
|
|
37355
|
+
if (tag && tag.kind === 340 /* JSDocReturnTag */) {
|
|
37303
37356
|
return tag;
|
|
37304
37357
|
}
|
|
37305
37358
|
}
|
|
@@ -37333,7 +37386,7 @@ var ts;
|
|
|
37333
37386
|
case 59 /* AtToken */:
|
|
37334
37387
|
if (canParseTag) {
|
|
37335
37388
|
var child = tryParseChildTag(target, indent);
|
|
37336
|
-
if (child && (child.kind ===
|
|
37389
|
+
if (child && (child.kind === 339 /* JSDocParameterTag */ || child.kind === 346 /* JSDocPropertyTag */) &&
|
|
37337
37390
|
target !== 4 /* CallbackParameter */ &&
|
|
37338
37391
|
name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
|
|
37339
37392
|
return false;
|
|
@@ -40089,7 +40142,7 @@ var ts;
|
|
|
40089
40142
|
function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) {
|
|
40090
40143
|
var result = returnValue ? {} : undefined;
|
|
40091
40144
|
var _loop_4 = function (element) {
|
|
40092
|
-
if (element.kind !==
|
|
40145
|
+
if (element.kind !== 295 /* PropertyAssignment */) {
|
|
40093
40146
|
errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected));
|
|
40094
40147
|
return "continue";
|
|
40095
40148
|
}
|
|
@@ -41641,6 +41694,7 @@ var ts;
|
|
|
41641
41694
|
* is assumed to be the same as root directory of the project.
|
|
41642
41695
|
*/
|
|
41643
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.");
|
|
41644
41698
|
var traceEnabled = isTraceEnabled(options, host);
|
|
41645
41699
|
if (redirectedReference) {
|
|
41646
41700
|
options = redirectedReference.commandLine.options;
|
|
@@ -43759,7 +43813,7 @@ var ts;
|
|
|
43759
43813
|
return "__constructor" /* Constructor */;
|
|
43760
43814
|
case 178 /* FunctionType */:
|
|
43761
43815
|
case 173 /* CallSignature */:
|
|
43762
|
-
case
|
|
43816
|
+
case 322 /* JSDocSignature */:
|
|
43763
43817
|
return "__call" /* Call */;
|
|
43764
43818
|
case 179 /* ConstructorType */:
|
|
43765
43819
|
case 174 /* ConstructSignature */:
|
|
@@ -43768,7 +43822,7 @@ var ts;
|
|
|
43768
43822
|
return "__index" /* Index */;
|
|
43769
43823
|
case 271 /* ExportDeclaration */:
|
|
43770
43824
|
return "__export" /* ExportStar */;
|
|
43771
|
-
case
|
|
43825
|
+
case 304 /* SourceFile */:
|
|
43772
43826
|
// json file should behave as
|
|
43773
43827
|
// module.exports = ...
|
|
43774
43828
|
return "export=" /* ExportEquals */;
|
|
@@ -43779,12 +43833,12 @@ var ts;
|
|
|
43779
43833
|
}
|
|
43780
43834
|
ts.Debug.fail("Unknown binary declaration kind");
|
|
43781
43835
|
break;
|
|
43782
|
-
case
|
|
43836
|
+
case 316 /* JSDocFunctionType */:
|
|
43783
43837
|
return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */);
|
|
43784
43838
|
case 163 /* Parameter */:
|
|
43785
43839
|
// Parameters with names are handled at the top of this function. Parameters
|
|
43786
43840
|
// without names can only come from JSDocFunctionTypes.
|
|
43787
|
-
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"; });
|
|
43788
43842
|
var functionType = node.parent;
|
|
43789
43843
|
var index = functionType.parameters.indexOf(node);
|
|
43790
43844
|
return "arg" + index;
|
|
@@ -44062,7 +44116,7 @@ var ts;
|
|
|
44062
44116
|
node.flags |= 512 /* HasExplicitReturn */;
|
|
44063
44117
|
node.endFlowNode = currentFlow;
|
|
44064
44118
|
}
|
|
44065
|
-
if (node.kind ===
|
|
44119
|
+
if (node.kind === 304 /* SourceFile */) {
|
|
44066
44120
|
node.flags |= emitFlags;
|
|
44067
44121
|
node.endFlowNode = currentFlow;
|
|
44068
44122
|
}
|
|
@@ -44201,13 +44255,13 @@ var ts;
|
|
|
44201
44255
|
case 229 /* NonNullExpression */:
|
|
44202
44256
|
bindNonNullExpressionFlow(node);
|
|
44203
44257
|
break;
|
|
44204
|
-
case
|
|
44205
|
-
case
|
|
44206
|
-
case
|
|
44258
|
+
case 344 /* JSDocTypedefTag */:
|
|
44259
|
+
case 337 /* JSDocCallbackTag */:
|
|
44260
|
+
case 338 /* JSDocEnumTag */:
|
|
44207
44261
|
bindJSDocTypeAlias(node);
|
|
44208
44262
|
break;
|
|
44209
44263
|
// In source files and blocks, bind functions first to match hoisting that occurs at runtime
|
|
44210
|
-
case
|
|
44264
|
+
case 304 /* SourceFile */: {
|
|
44211
44265
|
bindEachFunctionsFirst(node.statements);
|
|
44212
44266
|
bind(node.endOfFileToken);
|
|
44213
44267
|
break;
|
|
@@ -44221,7 +44275,7 @@ var ts;
|
|
|
44221
44275
|
break;
|
|
44222
44276
|
case 204 /* ObjectLiteralExpression */:
|
|
44223
44277
|
case 203 /* ArrayLiteralExpression */:
|
|
44224
|
-
case
|
|
44278
|
+
case 295 /* PropertyAssignment */:
|
|
44225
44279
|
case 224 /* SpreadElement */:
|
|
44226
44280
|
// Carry over whether we are in an assignment pattern of Object and Array literals
|
|
44227
44281
|
// as well as their children that are valid assignment targets.
|
|
@@ -44751,13 +44805,13 @@ var ts;
|
|
|
44751
44805
|
else if (node.kind === 204 /* ObjectLiteralExpression */) {
|
|
44752
44806
|
for (var _b = 0, _c = node.properties; _b < _c.length; _b++) {
|
|
44753
44807
|
var p = _c[_b];
|
|
44754
|
-
if (p.kind ===
|
|
44808
|
+
if (p.kind === 295 /* PropertyAssignment */) {
|
|
44755
44809
|
bindDestructuringTargetFlow(p.initializer);
|
|
44756
44810
|
}
|
|
44757
|
-
else if (p.kind ===
|
|
44811
|
+
else if (p.kind === 296 /* ShorthandPropertyAssignment */) {
|
|
44758
44812
|
bindAssignmentTargetFlow(p.name);
|
|
44759
44813
|
}
|
|
44760
|
-
else if (p.kind ===
|
|
44814
|
+
else if (p.kind === 297 /* SpreadAssignment */) {
|
|
44761
44815
|
bindAssignmentTargetFlow(p.expression);
|
|
44762
44816
|
}
|
|
44763
44817
|
}
|
|
@@ -44979,7 +45033,7 @@ var ts;
|
|
|
44979
45033
|
}
|
|
44980
45034
|
function bindJSDocTypeAlias(node) {
|
|
44981
45035
|
bind(node.tagName);
|
|
44982
|
-
if (node.kind !==
|
|
45036
|
+
if (node.kind !== 338 /* JSDocEnumTag */ && node.fullName) {
|
|
44983
45037
|
// don't bind the type name yet; that's delayed until delayedBindJSDocTypedefTag
|
|
44984
45038
|
ts.setParent(node.fullName, node);
|
|
44985
45039
|
ts.setParentRecursive(node.fullName, /*incremental*/ false);
|
|
@@ -45103,7 +45157,7 @@ var ts;
|
|
|
45103
45157
|
case 259 /* EnumDeclaration */:
|
|
45104
45158
|
case 204 /* ObjectLiteralExpression */:
|
|
45105
45159
|
case 181 /* TypeLiteral */:
|
|
45106
|
-
case
|
|
45160
|
+
case 321 /* JSDocTypeLiteral */:
|
|
45107
45161
|
case 285 /* JsxAttributes */:
|
|
45108
45162
|
return 1 /* IsContainer */;
|
|
45109
45163
|
case 257 /* InterfaceDeclaration */:
|
|
@@ -45112,7 +45166,7 @@ var ts;
|
|
|
45112
45166
|
case 258 /* TypeAliasDeclaration */:
|
|
45113
45167
|
case 194 /* MappedType */:
|
|
45114
45168
|
return 1 /* IsContainer */ | 32 /* HasLocals */;
|
|
45115
|
-
case
|
|
45169
|
+
case 304 /* SourceFile */:
|
|
45116
45170
|
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
|
|
45117
45171
|
case 171 /* GetAccessor */:
|
|
45118
45172
|
case 172 /* SetAccessor */:
|
|
@@ -45125,8 +45179,8 @@ var ts;
|
|
|
45125
45179
|
case 255 /* FunctionDeclaration */:
|
|
45126
45180
|
case 167 /* MethodSignature */:
|
|
45127
45181
|
case 173 /* CallSignature */:
|
|
45128
|
-
case
|
|
45129
|
-
case
|
|
45182
|
+
case 322 /* JSDocSignature */:
|
|
45183
|
+
case 316 /* JSDocFunctionType */:
|
|
45130
45184
|
case 178 /* FunctionType */:
|
|
45131
45185
|
case 174 /* ConstructSignature */:
|
|
45132
45186
|
case 175 /* IndexSignature */:
|
|
@@ -45181,7 +45235,7 @@ var ts;
|
|
|
45181
45235
|
// handlers to take care of declaring these child members.
|
|
45182
45236
|
case 260 /* ModuleDeclaration */:
|
|
45183
45237
|
return declareModuleMember(node, symbolFlags, symbolExcludes);
|
|
45184
|
-
case
|
|
45238
|
+
case 304 /* SourceFile */:
|
|
45185
45239
|
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
|
|
45186
45240
|
case 225 /* ClassExpression */:
|
|
45187
45241
|
case 256 /* ClassDeclaration */:
|
|
@@ -45189,7 +45243,7 @@ var ts;
|
|
|
45189
45243
|
case 259 /* EnumDeclaration */:
|
|
45190
45244
|
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
|
|
45191
45245
|
case 181 /* TypeLiteral */:
|
|
45192
|
-
case
|
|
45246
|
+
case 321 /* JSDocTypeLiteral */:
|
|
45193
45247
|
case 204 /* ObjectLiteralExpression */:
|
|
45194
45248
|
case 257 /* InterfaceDeclaration */:
|
|
45195
45249
|
case 285 /* JsxAttributes */:
|
|
@@ -45203,7 +45257,7 @@ var ts;
|
|
|
45203
45257
|
case 179 /* ConstructorType */:
|
|
45204
45258
|
case 173 /* CallSignature */:
|
|
45205
45259
|
case 174 /* ConstructSignature */:
|
|
45206
|
-
case
|
|
45260
|
+
case 322 /* JSDocSignature */:
|
|
45207
45261
|
case 175 /* IndexSignature */:
|
|
45208
45262
|
case 168 /* MethodDeclaration */:
|
|
45209
45263
|
case 167 /* MethodSignature */:
|
|
@@ -45213,9 +45267,9 @@ var ts;
|
|
|
45213
45267
|
case 255 /* FunctionDeclaration */:
|
|
45214
45268
|
case 212 /* FunctionExpression */:
|
|
45215
45269
|
case 213 /* ArrowFunction */:
|
|
45216
|
-
case
|
|
45217
|
-
case
|
|
45218
|
-
case
|
|
45270
|
+
case 316 /* JSDocFunctionType */:
|
|
45271
|
+
case 344 /* JSDocTypedefTag */:
|
|
45272
|
+
case 337 /* JSDocCallbackTag */:
|
|
45219
45273
|
case 169 /* ClassStaticBlockDeclaration */:
|
|
45220
45274
|
case 258 /* TypeAliasDeclaration */:
|
|
45221
45275
|
case 194 /* MappedType */:
|
|
@@ -45317,7 +45371,7 @@ var ts;
|
|
|
45317
45371
|
var seen = new ts.Map();
|
|
45318
45372
|
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
|
|
45319
45373
|
var prop = _a[_i];
|
|
45320
|
-
if (prop.kind ===
|
|
45374
|
+
if (prop.kind === 297 /* SpreadAssignment */ || prop.name.kind !== 79 /* Identifier */) {
|
|
45321
45375
|
continue;
|
|
45322
45376
|
}
|
|
45323
45377
|
var identifier = prop.name;
|
|
@@ -45329,7 +45383,7 @@ var ts;
|
|
|
45329
45383
|
// c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true.
|
|
45330
45384
|
// d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true
|
|
45331
45385
|
// and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields
|
|
45332
|
-
var currentKind = prop.kind ===
|
|
45386
|
+
var currentKind = prop.kind === 295 /* PropertyAssignment */ || prop.kind === 296 /* ShorthandPropertyAssignment */ || prop.kind === 168 /* MethodDeclaration */
|
|
45333
45387
|
? 1 /* Property */
|
|
45334
45388
|
: 2 /* Accessor */;
|
|
45335
45389
|
var existingKind = seen.get(identifier.escapedText);
|
|
@@ -45360,7 +45414,7 @@ var ts;
|
|
|
45360
45414
|
case 260 /* ModuleDeclaration */:
|
|
45361
45415
|
declareModuleMember(node, symbolFlags, symbolExcludes);
|
|
45362
45416
|
break;
|
|
45363
|
-
case
|
|
45417
|
+
case 304 /* SourceFile */:
|
|
45364
45418
|
if (ts.isExternalOrCommonJsModule(container)) {
|
|
45365
45419
|
declareModuleMember(node, symbolFlags, symbolExcludes);
|
|
45366
45420
|
break;
|
|
@@ -45559,7 +45613,7 @@ var ts;
|
|
|
45559
45613
|
function checkStrictModeFunctionDeclaration(node) {
|
|
45560
45614
|
if (languageVersion < 2 /* ES2015 */) {
|
|
45561
45615
|
// Report error if function is not top level function declaration
|
|
45562
|
-
if (blockScopeContainer.kind !==
|
|
45616
|
+
if (blockScopeContainer.kind !== 304 /* SourceFile */ &&
|
|
45563
45617
|
blockScopeContainer.kind !== 260 /* ModuleDeclaration */ &&
|
|
45564
45618
|
!ts.isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
|
|
45565
45619
|
// We check first if the name is inside class declaration or class expression; if so give explicit message
|
|
@@ -45733,7 +45787,7 @@ var ts;
|
|
|
45733
45787
|
}
|
|
45734
45788
|
// falls through
|
|
45735
45789
|
case 108 /* ThisKeyword */:
|
|
45736
|
-
if (currentFlow && (ts.isExpression(node) || parent.kind ===
|
|
45790
|
+
if (currentFlow && (ts.isExpression(node) || parent.kind === 296 /* ShorthandPropertyAssignment */)) {
|
|
45737
45791
|
node.flowNode = currentFlow;
|
|
45738
45792
|
}
|
|
45739
45793
|
return checkContextualIdentifier(node);
|
|
@@ -45831,10 +45885,10 @@ var ts;
|
|
|
45831
45885
|
case 166 /* PropertyDeclaration */:
|
|
45832
45886
|
case 165 /* PropertySignature */:
|
|
45833
45887
|
return bindPropertyWorker(node);
|
|
45834
|
-
case
|
|
45835
|
-
case
|
|
45888
|
+
case 295 /* PropertyAssignment */:
|
|
45889
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
45836
45890
|
return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */);
|
|
45837
|
-
case
|
|
45891
|
+
case 298 /* EnumMember */:
|
|
45838
45892
|
return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */);
|
|
45839
45893
|
case 173 /* CallSignature */:
|
|
45840
45894
|
case 174 /* ConstructSignature */:
|
|
@@ -45856,15 +45910,15 @@ var ts;
|
|
|
45856
45910
|
case 172 /* SetAccessor */:
|
|
45857
45911
|
return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */);
|
|
45858
45912
|
case 178 /* FunctionType */:
|
|
45859
|
-
case
|
|
45860
|
-
case
|
|
45913
|
+
case 316 /* JSDocFunctionType */:
|
|
45914
|
+
case 322 /* JSDocSignature */:
|
|
45861
45915
|
case 179 /* ConstructorType */:
|
|
45862
45916
|
return bindFunctionOrConstructorType(node);
|
|
45863
45917
|
case 181 /* TypeLiteral */:
|
|
45864
|
-
case
|
|
45918
|
+
case 321 /* JSDocTypeLiteral */:
|
|
45865
45919
|
case 194 /* MappedType */:
|
|
45866
45920
|
return bindAnonymousTypeWorker(node);
|
|
45867
|
-
case
|
|
45921
|
+
case 331 /* JSDocClassTag */:
|
|
45868
45922
|
return bindJSDocClassTag(node);
|
|
45869
45923
|
case 204 /* ObjectLiteralExpression */:
|
|
45870
45924
|
return bindObjectLiteralExpression(node);
|
|
@@ -45922,7 +45976,7 @@ var ts;
|
|
|
45922
45976
|
return bindExportDeclaration(node);
|
|
45923
45977
|
case 270 /* ExportAssignment */:
|
|
45924
45978
|
return bindExportAssignment(node);
|
|
45925
|
-
case
|
|
45979
|
+
case 304 /* SourceFile */:
|
|
45926
45980
|
updateStrictModeStatementList(node.statements);
|
|
45927
45981
|
return bindSourceFileIfExternalModule();
|
|
45928
45982
|
case 234 /* Block */:
|
|
@@ -45932,23 +45986,23 @@ var ts;
|
|
|
45932
45986
|
// falls through
|
|
45933
45987
|
case 261 /* ModuleBlock */:
|
|
45934
45988
|
return updateStrictModeStatementList(node.statements);
|
|
45935
|
-
case
|
|
45936
|
-
if (node.parent.kind ===
|
|
45989
|
+
case 339 /* JSDocParameterTag */:
|
|
45990
|
+
if (node.parent.kind === 322 /* JSDocSignature */) {
|
|
45937
45991
|
return bindParameter(node);
|
|
45938
45992
|
}
|
|
45939
|
-
if (node.parent.kind !==
|
|
45993
|
+
if (node.parent.kind !== 321 /* JSDocTypeLiteral */) {
|
|
45940
45994
|
break;
|
|
45941
45995
|
}
|
|
45942
45996
|
// falls through
|
|
45943
|
-
case
|
|
45997
|
+
case 346 /* JSDocPropertyTag */:
|
|
45944
45998
|
var propTag = node;
|
|
45945
|
-
var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind ===
|
|
45999
|
+
var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 315 /* JSDocOptionalType */ ?
|
|
45946
46000
|
4 /* Property */ | 16777216 /* Optional */ :
|
|
45947
46001
|
4 /* Property */;
|
|
45948
46002
|
return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */);
|
|
45949
|
-
case
|
|
45950
|
-
case
|
|
45951
|
-
case
|
|
46003
|
+
case 344 /* JSDocTypedefTag */:
|
|
46004
|
+
case 337 /* JSDocCallbackTag */:
|
|
46005
|
+
case 338 /* JSDocEnumTag */:
|
|
45952
46006
|
return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
|
|
45953
46007
|
}
|
|
45954
46008
|
}
|
|
@@ -46151,7 +46205,7 @@ var ts;
|
|
|
46151
46205
|
declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true);
|
|
46152
46206
|
}
|
|
46153
46207
|
break;
|
|
46154
|
-
case
|
|
46208
|
+
case 304 /* SourceFile */:
|
|
46155
46209
|
// this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script
|
|
46156
46210
|
if (ts.hasDynamicName(node)) {
|
|
46157
46211
|
break;
|
|
@@ -46180,7 +46234,7 @@ var ts;
|
|
|
46180
46234
|
if (node.expression.kind === 108 /* ThisKeyword */) {
|
|
46181
46235
|
bindThisPropertyAssignment(node);
|
|
46182
46236
|
}
|
|
46183
|
-
else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind ===
|
|
46237
|
+
else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 304 /* SourceFile */) {
|
|
46184
46238
|
if (ts.isPrototypeAccess(node.expression)) {
|
|
46185
46239
|
bindPrototypePropertyAssignment(node, node.parent);
|
|
46186
46240
|
}
|
|
@@ -46220,7 +46274,7 @@ var ts;
|
|
|
46220
46274
|
}
|
|
46221
46275
|
function bindObjectDefinePropertyAssignment(node) {
|
|
46222
46276
|
var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]);
|
|
46223
|
-
var isToplevel = node.parent.parent.kind ===
|
|
46277
|
+
var isToplevel = node.parent.parent.kind === 304 /* SourceFile */;
|
|
46224
46278
|
namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false);
|
|
46225
46279
|
bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false);
|
|
46226
46280
|
}
|
|
@@ -46329,8 +46383,8 @@ var ts;
|
|
|
46329
46383
|
}
|
|
46330
46384
|
function isTopLevelNamespaceAssignment(propertyAccess) {
|
|
46331
46385
|
return ts.isBinaryExpression(propertyAccess.parent)
|
|
46332
|
-
? getParentOfBinaryExpression(propertyAccess.parent).parent.kind ===
|
|
46333
|
-
: propertyAccess.parent.parent.kind ===
|
|
46386
|
+
? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 304 /* SourceFile */
|
|
46387
|
+
: propertyAccess.parent.parent.kind === 304 /* SourceFile */;
|
|
46334
46388
|
}
|
|
46335
46389
|
function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) {
|
|
46336
46390
|
var namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer);
|
|
@@ -46475,7 +46529,7 @@ var ts;
|
|
|
46475
46529
|
}
|
|
46476
46530
|
}
|
|
46477
46531
|
function bindParameter(node) {
|
|
46478
|
-
if (node.kind ===
|
|
46532
|
+
if (node.kind === 339 /* JSDocParameterTag */ && container.kind !== 322 /* JSDocSignature */) {
|
|
46479
46533
|
return;
|
|
46480
46534
|
}
|
|
46481
46535
|
if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) {
|
|
@@ -48225,7 +48279,7 @@ var ts;
|
|
|
48225
48279
|
return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks());
|
|
48226
48280
|
}
|
|
48227
48281
|
function isGlobalSourceFile(node) {
|
|
48228
|
-
return node.kind ===
|
|
48282
|
+
return node.kind === 304 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node);
|
|
48229
48283
|
}
|
|
48230
48284
|
function getSymbol(symbols, name, meaning) {
|
|
48231
48285
|
if (meaning) {
|
|
@@ -48480,7 +48534,7 @@ var ts;
|
|
|
48480
48534
|
case 168 /* MethodDeclaration */:
|
|
48481
48535
|
case 171 /* GetAccessor */:
|
|
48482
48536
|
case 172 /* SetAccessor */:
|
|
48483
|
-
case
|
|
48537
|
+
case 295 /* PropertyAssignment */:
|
|
48484
48538
|
return requiresScopeChangeWorker(node.name);
|
|
48485
48539
|
case 166 /* PropertyDeclaration */:
|
|
48486
48540
|
// static properties in classes introduce temporary variables
|
|
@@ -48538,13 +48592,13 @@ var ts;
|
|
|
48538
48592
|
// - parameters are only in the scope of function body
|
|
48539
48593
|
// This restriction does not apply to JSDoc comment types because they are parented
|
|
48540
48594
|
// at a higher level than type parameters would normally be
|
|
48541
|
-
if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !==
|
|
48595
|
+
if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 319 /* JSDocComment */) {
|
|
48542
48596
|
useResult = result.flags & 262144 /* TypeParameter */
|
|
48543
48597
|
// type parameters are visible in parameter list, return type and type parameter list
|
|
48544
48598
|
? lastLocation === location.type ||
|
|
48545
48599
|
lastLocation.kind === 163 /* Parameter */ ||
|
|
48546
|
-
lastLocation.kind ===
|
|
48547
|
-
lastLocation.kind ===
|
|
48600
|
+
lastLocation.kind === 339 /* JSDocParameterTag */ ||
|
|
48601
|
+
lastLocation.kind === 340 /* JSDocReturnTag */ ||
|
|
48548
48602
|
lastLocation.kind === 162 /* TypeParameter */
|
|
48549
48603
|
// local types not visible outside the function body
|
|
48550
48604
|
: false;
|
|
@@ -48581,14 +48635,14 @@ var ts;
|
|
|
48581
48635
|
}
|
|
48582
48636
|
withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation);
|
|
48583
48637
|
switch (location.kind) {
|
|
48584
|
-
case
|
|
48638
|
+
case 304 /* SourceFile */:
|
|
48585
48639
|
if (!ts.isExternalOrCommonJsModule(location))
|
|
48586
48640
|
break;
|
|
48587
48641
|
isInExternalModule = true;
|
|
48588
48642
|
// falls through
|
|
48589
48643
|
case 260 /* ModuleDeclaration */:
|
|
48590
48644
|
var moduleExports = ((_a = getSymbolOfNode(location)) === null || _a === void 0 ? void 0 : _a.exports) || emptySymbols;
|
|
48591
|
-
if (location.kind ===
|
|
48645
|
+
if (location.kind === 304 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) {
|
|
48592
48646
|
// It's an external module. First see if the module has an export default and if the local
|
|
48593
48647
|
// name of that export default matches.
|
|
48594
48648
|
if (result = moduleExports.get("default" /* Default */)) {
|
|
@@ -48765,9 +48819,9 @@ var ts;
|
|
|
48765
48819
|
location = location.parent;
|
|
48766
48820
|
}
|
|
48767
48821
|
break;
|
|
48768
|
-
case
|
|
48769
|
-
case
|
|
48770
|
-
case
|
|
48822
|
+
case 344 /* JSDocTypedefTag */:
|
|
48823
|
+
case 337 /* JSDocCallbackTag */:
|
|
48824
|
+
case 338 /* JSDocEnumTag */:
|
|
48771
48825
|
// js type aliases do not resolve names from their host, so skip past it
|
|
48772
48826
|
var root = ts.getJSDocRoot(location);
|
|
48773
48827
|
if (root) {
|
|
@@ -48816,7 +48870,7 @@ var ts;
|
|
|
48816
48870
|
}
|
|
48817
48871
|
if (!result) {
|
|
48818
48872
|
if (lastLocation) {
|
|
48819
|
-
ts.Debug.assert(lastLocation.kind ===
|
|
48873
|
+
ts.Debug.assert(lastLocation.kind === 304 /* SourceFile */);
|
|
48820
48874
|
if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) {
|
|
48821
48875
|
return lastLocation.symbol;
|
|
48822
48876
|
}
|
|
@@ -49241,8 +49295,8 @@ var ts;
|
|
|
49241
49295
|
&& node.parent.left === node
|
|
49242
49296
|
&& node.parent.operatorToken.kind === 63 /* EqualsToken */
|
|
49243
49297
|
&& isAliasableOrJsExpression(node.parent.right)
|
|
49244
|
-
|| node.kind ===
|
|
49245
|
-
|| node.kind ===
|
|
49298
|
+
|| node.kind === 296 /* ShorthandPropertyAssignment */
|
|
49299
|
+
|| node.kind === 295 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer)
|
|
49246
49300
|
|| ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node);
|
|
49247
49301
|
}
|
|
49248
49302
|
function isAliasableOrJsExpression(e) {
|
|
@@ -49646,9 +49700,9 @@ var ts;
|
|
|
49646
49700
|
return getTargetOfExportAssignment(node, dontRecursivelyResolve);
|
|
49647
49701
|
case 263 /* NamespaceExportDeclaration */:
|
|
49648
49702
|
return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve);
|
|
49649
|
-
case
|
|
49703
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
49650
49704
|
return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve);
|
|
49651
|
-
case
|
|
49705
|
+
case 295 /* PropertyAssignment */:
|
|
49652
49706
|
return getTargetOfPropertyAssignment(node, dontRecursivelyResolve);
|
|
49653
49707
|
case 206 /* ElementAccessExpression */:
|
|
49654
49708
|
case 205 /* PropertyAccessExpression */:
|
|
@@ -50012,7 +50066,7 @@ var ts;
|
|
|
50012
50066
|
: undefined;
|
|
50013
50067
|
}
|
|
50014
50068
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) {
|
|
50015
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
50069
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
50016
50070
|
if (isForAugmentation === void 0) { isForAugmentation = false; }
|
|
50017
50071
|
if (ts.startsWith(moduleReference, "@types/")) {
|
|
50018
50072
|
var diag = ts.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
@@ -50049,7 +50103,11 @@ var ts;
|
|
|
50049
50103
|
}
|
|
50050
50104
|
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
50051
50105
|
var isSyncImport = (currentSourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS && !ts.findAncestor(location, ts.isImportCall)) || !!ts.findAncestor(location, ts.isImportEqualsDeclaration);
|
|
50052
|
-
|
|
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)) {
|
|
50053
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);
|
|
50054
50112
|
}
|
|
50055
50113
|
if (mode === ts.ModuleKind.ESNext && compilerOptions.resolveJsonModule && resolvedModule.extension === ".json" /* Json */) {
|
|
@@ -50130,10 +50188,10 @@ var ts;
|
|
|
50130
50188
|
}
|
|
50131
50189
|
else if (mode === ts.ModuleKind.ESNext && resolutionIsNode12OrNext && isExtensionlessRelativePathImport) {
|
|
50132
50190
|
var absoluteRef_1 = ts.getNormalizedAbsolutePath(moduleReference, ts.getDirectoryPath(currentSourceFile.path));
|
|
50133
|
-
var suggestedExt = (
|
|
50191
|
+
var suggestedExt = (_h = suggestedExtensions.find(function (_a) {
|
|
50134
50192
|
var actualExt = _a[0], _importExt = _a[1];
|
|
50135
50193
|
return host.fileExists(absoluteRef_1 + actualExt);
|
|
50136
|
-
})) === null ||
|
|
50194
|
+
})) === null || _h === void 0 ? void 0 : _h[1];
|
|
50137
50195
|
if (suggestedExt) {
|
|
50138
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);
|
|
50139
50197
|
}
|
|
@@ -50201,9 +50259,10 @@ var ts;
|
|
|
50201
50259
|
// references a symbol that is at least declared as a module or a variable. The target of the 'export =' may
|
|
50202
50260
|
// combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable).
|
|
50203
50261
|
function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) {
|
|
50262
|
+
var _a;
|
|
50204
50263
|
var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
|
|
50205
50264
|
if (!dontResolveAlias && symbol) {
|
|
50206
|
-
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 */)) {
|
|
50207
50266
|
var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015
|
|
50208
50267
|
? "allowSyntheticDefaultImports"
|
|
50209
50268
|
: "esModuleInterop";
|
|
@@ -50219,12 +50278,16 @@ var ts;
|
|
|
50219
50278
|
if (defaultOnlyType) {
|
|
50220
50279
|
return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent);
|
|
50221
50280
|
}
|
|
50222
|
-
|
|
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) {
|
|
50223
50284
|
var sigs = getSignaturesOfStructuredType(type, 0 /* Call */);
|
|
50224
50285
|
if (!sigs || !sigs.length) {
|
|
50225
50286
|
sigs = getSignaturesOfStructuredType(type, 1 /* Construct */);
|
|
50226
50287
|
}
|
|
50227
|
-
if ((sigs && sigs.length) ||
|
|
50288
|
+
if ((sigs && sigs.length) ||
|
|
50289
|
+
getPropertyOfType(type, "default" /* Default */, /*skipObjectFunctionPropertyAugment*/ true) ||
|
|
50290
|
+
isEsmCjsRef) {
|
|
50228
50291
|
var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference);
|
|
50229
50292
|
return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
|
|
50230
50293
|
}
|
|
@@ -50674,7 +50737,7 @@ var ts;
|
|
|
50674
50737
|
}
|
|
50675
50738
|
}
|
|
50676
50739
|
switch (location.kind) {
|
|
50677
|
-
case
|
|
50740
|
+
case 304 /* SourceFile */:
|
|
50678
50741
|
if (!ts.isExternalOrCommonJsModule(location)) {
|
|
50679
50742
|
break;
|
|
50680
50743
|
}
|
|
@@ -50977,10 +51040,10 @@ var ts;
|
|
|
50977
51040
|
return node && getSymbolOfNode(node);
|
|
50978
51041
|
}
|
|
50979
51042
|
function hasExternalModuleSymbol(declaration) {
|
|
50980
|
-
return ts.isAmbientModule(declaration) || (declaration.kind ===
|
|
51043
|
+
return ts.isAmbientModule(declaration) || (declaration.kind === 304 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration));
|
|
50981
51044
|
}
|
|
50982
51045
|
function hasNonGlobalAugmentationExternalModuleSymbol(declaration) {
|
|
50983
|
-
return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind ===
|
|
51046
|
+
return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 304 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration));
|
|
50984
51047
|
}
|
|
50985
51048
|
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
|
|
50986
51049
|
var aliasesToMakeVisible;
|
|
@@ -51084,7 +51147,7 @@ var ts;
|
|
|
51084
51147
|
function symbolToStringWorker(writer) {
|
|
51085
51148
|
var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217
|
|
51086
51149
|
// add neverAsciiEscape for GH#39027
|
|
51087
|
-
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 });
|
|
51088
51151
|
var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
|
|
51089
51152
|
printer.writeNode(4 /* Unspecified */, entity, /*sourceFile*/ sourceFile, writer);
|
|
51090
51153
|
return writer;
|
|
@@ -51554,7 +51617,7 @@ var ts;
|
|
|
51554
51617
|
var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) &&
|
|
51555
51618
|
(symbol.parent || // is exported function symbol
|
|
51556
51619
|
ts.forEach(symbol.declarations, function (declaration) {
|
|
51557
|
-
return declaration.parent.kind ===
|
|
51620
|
+
return declaration.parent.kind === 304 /* SourceFile */ || declaration.parent.kind === 261 /* ModuleBlock */;
|
|
51558
51621
|
}));
|
|
51559
51622
|
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
|
|
51560
51623
|
// typeof is allowed only for static/non local functions
|
|
@@ -51941,8 +52004,8 @@ var ts;
|
|
|
51941
52004
|
}
|
|
51942
52005
|
function preserveCommentsOn(node) {
|
|
51943
52006
|
var _a;
|
|
51944
|
-
if (ts.some(propertySymbol.declarations, function (d) { return d.kind ===
|
|
51945
|
-
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 */; });
|
|
51946
52009
|
var commentText = ts.getTextOfJSDocComment(d.comment);
|
|
51947
52010
|
if (commentText) {
|
|
51948
52011
|
ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
|
|
@@ -52100,7 +52163,7 @@ var ts;
|
|
|
52100
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) :
|
|
52101
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) :
|
|
52102
52165
|
kind === 175 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, modifiers, parameters, returnTypeNode) :
|
|
52103
|
-
kind ===
|
|
52166
|
+
kind === 316 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) :
|
|
52104
52167
|
kind === 178 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) :
|
|
52105
52168
|
kind === 179 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) :
|
|
52106
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) :
|
|
@@ -52144,7 +52207,7 @@ var ts;
|
|
|
52144
52207
|
function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) {
|
|
52145
52208
|
var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 163 /* Parameter */);
|
|
52146
52209
|
if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) {
|
|
52147
|
-
parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol,
|
|
52210
|
+
parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 339 /* JSDocParameterTag */);
|
|
52148
52211
|
}
|
|
52149
52212
|
var parameterType = getTypeOfSymbol(parameterSymbol);
|
|
52150
52213
|
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
|
|
@@ -52322,13 +52385,13 @@ var ts;
|
|
|
52322
52385
|
}
|
|
52323
52386
|
return top;
|
|
52324
52387
|
}
|
|
52325
|
-
function getSpecifierForModuleSymbol(symbol, context) {
|
|
52388
|
+
function getSpecifierForModuleSymbol(symbol, context, overrideImportMode) {
|
|
52326
52389
|
var _a;
|
|
52327
|
-
var file = ts.getDeclarationOfKind(symbol,
|
|
52390
|
+
var file = ts.getDeclarationOfKind(symbol, 304 /* SourceFile */);
|
|
52328
52391
|
if (!file) {
|
|
52329
52392
|
var equivalentFileSymbol = ts.firstDefined(symbol.declarations, function (d) { return getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol); });
|
|
52330
52393
|
if (equivalentFileSymbol) {
|
|
52331
|
-
file = ts.getDeclarationOfKind(equivalentFileSymbol,
|
|
52394
|
+
file = ts.getDeclarationOfKind(equivalentFileSymbol, 304 /* SourceFile */);
|
|
52332
52395
|
}
|
|
52333
52396
|
}
|
|
52334
52397
|
if (file && file.moduleName !== undefined) {
|
|
@@ -52357,8 +52420,10 @@ var ts;
|
|
|
52357
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
|
|
52358
52421
|
}
|
|
52359
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);
|
|
52360
52425
|
var links = getSymbolLinks(symbol);
|
|
52361
|
-
var specifier = links.specifierCache && links.specifierCache.get(
|
|
52426
|
+
var specifier = links.specifierCache && links.specifierCache.get(cacheKey);
|
|
52362
52427
|
if (!specifier) {
|
|
52363
52428
|
var isBundle_1 = !!ts.outFile(compilerOptions);
|
|
52364
52429
|
// For declaration bundles, we need to generate absolute paths relative to the common source dir for imports,
|
|
@@ -52367,11 +52432,19 @@ var ts;
|
|
|
52367
52432
|
// specifier preference
|
|
52368
52433
|
var moduleResolverHost = context.tracker.moduleResolverHost;
|
|
52369
52434
|
var specifierCompilerOptions = isBundle_1 ? __assign(__assign({}, compilerOptions), { baseUrl: moduleResolverHost.getCommonSourceDirectory() }) : compilerOptions;
|
|
52370
|
-
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 }));
|
|
52371
52441
|
(_a = links.specifierCache) !== null && _a !== void 0 ? _a : (links.specifierCache = new ts.Map());
|
|
52372
|
-
links.specifierCache.set(
|
|
52442
|
+
links.specifierCache.set(cacheKey, specifier);
|
|
52373
52443
|
}
|
|
52374
52444
|
return specifier;
|
|
52445
|
+
function getSpecifierCacheKey(path, mode) {
|
|
52446
|
+
return mode === undefined ? path : mode + "|" + path;
|
|
52447
|
+
}
|
|
52375
52448
|
}
|
|
52376
52449
|
function symbolToEntityNameNode(symbol) {
|
|
52377
52450
|
var identifier = ts.factory.createIdentifier(ts.unescapeLeadingUnderscores(symbol.escapedName));
|
|
@@ -52384,13 +52457,45 @@ var ts;
|
|
|
52384
52457
|
// module is root, must use `ImportTypeNode`
|
|
52385
52458
|
var nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined;
|
|
52386
52459
|
var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context);
|
|
52387
|
-
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
|
+
}
|
|
52388
52476
|
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Classic && specifier.indexOf("/node_modules/") >= 0) {
|
|
52389
|
-
|
|
52390
|
-
|
|
52391
|
-
|
|
52392
|
-
|
|
52393
|
-
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
|
+
}
|
|
52394
52499
|
}
|
|
52395
52500
|
}
|
|
52396
52501
|
var lit = ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(specifier));
|
|
@@ -52402,12 +52507,12 @@ var ts;
|
|
|
52402
52507
|
var lastId = ts.isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right;
|
|
52403
52508
|
lastId.typeArguments = undefined;
|
|
52404
52509
|
}
|
|
52405
|
-
return ts.factory.createImportTypeNode(lit, nonRootParts, typeParameterNodes, isTypeOf);
|
|
52510
|
+
return ts.factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf);
|
|
52406
52511
|
}
|
|
52407
52512
|
else {
|
|
52408
52513
|
var splitNode = getTopmostIndexedAccessType(nonRootParts);
|
|
52409
52514
|
var qualifier = splitNode.objectType.typeName;
|
|
52410
|
-
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);
|
|
52411
52516
|
}
|
|
52412
52517
|
}
|
|
52413
52518
|
var entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);
|
|
@@ -52733,7 +52838,7 @@ var ts;
|
|
|
52733
52838
|
return transformed === existing ? ts.setTextRange(ts.factory.cloneNode(existing), existing) : transformed;
|
|
52734
52839
|
function visitExistingNodeTreeSymbols(node) {
|
|
52735
52840
|
// We don't _actually_ support jsdoc namepath types, emit `any` instead
|
|
52736
|
-
if (ts.isJSDocAllType(node) || node.kind ===
|
|
52841
|
+
if (ts.isJSDocAllType(node) || node.kind === 318 /* JSDocNamepathType */) {
|
|
52737
52842
|
return ts.factory.createKeywordTypeNode(130 /* AnyKeyword */);
|
|
52738
52843
|
}
|
|
52739
52844
|
if (ts.isJSDocUnknownType(node)) {
|
|
@@ -53608,7 +53713,7 @@ var ts;
|
|
|
53608
53713
|
// We don't know how to serialize this (nested?) binding element
|
|
53609
53714
|
ts.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization");
|
|
53610
53715
|
break;
|
|
53611
|
-
case
|
|
53716
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
53612
53717
|
if (((_e = (_d = node.parent) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.kind) === 220 /* BinaryExpression */) {
|
|
53613
53718
|
// module.exports = { SomeClass }
|
|
53614
53719
|
serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), targetName);
|
|
@@ -54128,7 +54233,7 @@ var ts;
|
|
|
54128
54233
|
ts.isExternalModuleAugmentation(node.parent.parent);
|
|
54129
54234
|
}
|
|
54130
54235
|
function isDefaultBindingContext(location) {
|
|
54131
|
-
return location.kind ===
|
|
54236
|
+
return location.kind === 304 /* SourceFile */ || ts.isAmbientModule(location);
|
|
54132
54237
|
}
|
|
54133
54238
|
function getNameOfSymbolFromNameType(symbol, context) {
|
|
54134
54239
|
var nameType = getSymbolLinks(symbol).nameType;
|
|
@@ -54214,9 +54319,9 @@ var ts;
|
|
|
54214
54319
|
return false;
|
|
54215
54320
|
function determineIfDeclarationIsVisible() {
|
|
54216
54321
|
switch (node.kind) {
|
|
54217
|
-
case
|
|
54218
|
-
case
|
|
54219
|
-
case
|
|
54322
|
+
case 337 /* JSDocCallbackTag */:
|
|
54323
|
+
case 344 /* JSDocTypedefTag */:
|
|
54324
|
+
case 338 /* JSDocEnumTag */:
|
|
54220
54325
|
// Top-level jsdoc type aliases are considered exported
|
|
54221
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
|
|
54222
54327
|
return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent));
|
|
@@ -54243,7 +54348,7 @@ var ts;
|
|
|
54243
54348
|
var parent = getDeclarationContainer(node);
|
|
54244
54349
|
// If the node is not exported or it is not ambient module element (except import declaration)
|
|
54245
54350
|
if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) &&
|
|
54246
|
-
!(node.kind !== 264 /* ImportEqualsDeclaration */ && parent.kind !==
|
|
54351
|
+
!(node.kind !== 264 /* ImportEqualsDeclaration */ && parent.kind !== 304 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) {
|
|
54247
54352
|
return isGlobalSourceFile(parent);
|
|
54248
54353
|
}
|
|
54249
54354
|
// Exported members/ambient module elements (exception import declaration) are visible if parent is visible
|
|
@@ -54287,7 +54392,7 @@ var ts;
|
|
|
54287
54392
|
case 162 /* TypeParameter */:
|
|
54288
54393
|
// Source file and namespace export are always visible
|
|
54289
54394
|
// falls through
|
|
54290
|
-
case
|
|
54395
|
+
case 304 /* SourceFile */:
|
|
54291
54396
|
case 263 /* NamespaceExportDeclaration */:
|
|
54292
54397
|
return true;
|
|
54293
54398
|
// Export assignments do not create name bindings outside the module
|
|
@@ -54544,7 +54649,7 @@ var ts;
|
|
|
54544
54649
|
var ancestor = node.parent.parent;
|
|
54545
54650
|
switch (ancestor.kind) {
|
|
54546
54651
|
case 202 /* BindingElement */:
|
|
54547
|
-
case
|
|
54652
|
+
case 295 /* PropertyAssignment */:
|
|
54548
54653
|
return getSyntheticElementAccess(ancestor);
|
|
54549
54654
|
case 203 /* ArrayLiteralExpression */:
|
|
54550
54655
|
return getSyntheticElementAccess(node.parent);
|
|
@@ -54559,7 +54664,7 @@ var ts;
|
|
|
54559
54664
|
if (node.kind === 202 /* BindingElement */ && parent.kind === 200 /* ObjectBindingPattern */) {
|
|
54560
54665
|
return getLiteralPropertyNameText(node.propertyName || node.name);
|
|
54561
54666
|
}
|
|
54562
|
-
if (node.kind ===
|
|
54667
|
+
if (node.kind === 295 /* PropertyAssignment */ || node.kind === 296 /* ShorthandPropertyAssignment */) {
|
|
54563
54668
|
return getLiteralPropertyNameText(node.name);
|
|
54564
54669
|
}
|
|
54565
54670
|
return "" + parent.elements.indexOf(node);
|
|
@@ -55244,8 +55349,8 @@ var ts;
|
|
|
55244
55349
|
var memberDeclaration = root.kind === 163 /* Parameter */ ? root.parent : root;
|
|
55245
55350
|
return isPrivateWithinAmbient(memberDeclaration);
|
|
55246
55351
|
}
|
|
55247
|
-
function tryGetTypeFromEffectiveTypeNode(
|
|
55248
|
-
var typeNode = ts.getEffectiveTypeAnnotationNode(
|
|
55352
|
+
function tryGetTypeFromEffectiveTypeNode(node) {
|
|
55353
|
+
var typeNode = ts.getEffectiveTypeAnnotationNode(node);
|
|
55249
55354
|
if (typeNode) {
|
|
55250
55355
|
return getTypeFromTypeNode(typeNode);
|
|
55251
55356
|
}
|
|
@@ -55740,16 +55845,16 @@ var ts;
|
|
|
55740
55845
|
case 167 /* MethodSignature */:
|
|
55741
55846
|
case 178 /* FunctionType */:
|
|
55742
55847
|
case 179 /* ConstructorType */:
|
|
55743
|
-
case
|
|
55848
|
+
case 316 /* JSDocFunctionType */:
|
|
55744
55849
|
case 255 /* FunctionDeclaration */:
|
|
55745
55850
|
case 168 /* MethodDeclaration */:
|
|
55746
55851
|
case 212 /* FunctionExpression */:
|
|
55747
55852
|
case 213 /* ArrowFunction */:
|
|
55748
55853
|
case 258 /* TypeAliasDeclaration */:
|
|
55749
|
-
case
|
|
55750
|
-
case
|
|
55751
|
-
case
|
|
55752
|
-
case
|
|
55854
|
+
case 343 /* JSDocTemplateTag */:
|
|
55855
|
+
case 344 /* JSDocTypedefTag */:
|
|
55856
|
+
case 338 /* JSDocEnumTag */:
|
|
55857
|
+
case 337 /* JSDocCallbackTag */:
|
|
55753
55858
|
case 194 /* MappedType */:
|
|
55754
55859
|
case 188 /* ConditionalType */: {
|
|
55755
55860
|
var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
|
|
@@ -55765,13 +55870,13 @@ var ts;
|
|
|
55765
55870
|
getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
|
|
55766
55871
|
return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters;
|
|
55767
55872
|
}
|
|
55768
|
-
case
|
|
55873
|
+
case 339 /* JSDocParameterTag */:
|
|
55769
55874
|
var paramSymbol = ts.getParameterSymbolFromJSDoc(node);
|
|
55770
55875
|
if (paramSymbol) {
|
|
55771
55876
|
node = paramSymbol.valueDeclaration;
|
|
55772
55877
|
}
|
|
55773
55878
|
break;
|
|
55774
|
-
case
|
|
55879
|
+
case 319 /* JSDocComment */: {
|
|
55775
55880
|
var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
|
|
55776
55881
|
return node.tags
|
|
55777
55882
|
? appendTypeParameters(outerTypeParameters, ts.flatMap(node.tags, function (t) { return ts.isJSDocTemplateTag(t) ? t.typeParameters : undefined; }))
|
|
@@ -56164,7 +56269,7 @@ var ts;
|
|
|
56164
56269
|
}
|
|
56165
56270
|
else {
|
|
56166
56271
|
type = errorType;
|
|
56167
|
-
if (declaration.kind ===
|
|
56272
|
+
if (declaration.kind === 338 /* JSDocEnumTag */) {
|
|
56168
56273
|
error(declaration.typeExpression.type, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
|
|
56169
56274
|
}
|
|
56170
56275
|
else {
|
|
@@ -58285,10 +58390,10 @@ var ts;
|
|
|
58285
58390
|
function isJSDocOptionalParameter(node) {
|
|
58286
58391
|
return ts.isInJSFile(node) && (
|
|
58287
58392
|
// node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType
|
|
58288
|
-
node.type && node.type.kind ===
|
|
58393
|
+
node.type && node.type.kind === 315 /* JSDocOptionalType */
|
|
58289
58394
|
|| ts.getJSDocParameterTags(node).some(function (_a) {
|
|
58290
58395
|
var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression;
|
|
58291
|
-
return isBracketed || !!typeExpression && typeExpression.type.kind ===
|
|
58396
|
+
return isBracketed || !!typeExpression && typeExpression.type.kind === 315 /* JSDocOptionalType */;
|
|
58292
58397
|
}));
|
|
58293
58398
|
}
|
|
58294
58399
|
function tryFindAmbientModule(moduleName, withAugmentations) {
|
|
@@ -58328,7 +58433,7 @@ var ts;
|
|
|
58328
58433
|
return false;
|
|
58329
58434
|
}
|
|
58330
58435
|
var isBracketed = node.isBracketed, typeExpression = node.typeExpression;
|
|
58331
|
-
return isBracketed || !!typeExpression && typeExpression.type.kind ===
|
|
58436
|
+
return isBracketed || !!typeExpression && typeExpression.type.kind === 315 /* JSDocOptionalType */;
|
|
58332
58437
|
}
|
|
58333
58438
|
function createTypePredicate(kind, parameterName, parameterIndex, type) {
|
|
58334
58439
|
return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type };
|
|
@@ -58516,7 +58621,7 @@ var ts;
|
|
|
58516
58621
|
case 205 /* PropertyAccessExpression */:
|
|
58517
58622
|
case 206 /* ElementAccessExpression */:
|
|
58518
58623
|
return traverse(node.expression);
|
|
58519
|
-
case
|
|
58624
|
+
case 295 /* PropertyAssignment */:
|
|
58520
58625
|
return traverse(node.initializer);
|
|
58521
58626
|
default:
|
|
58522
58627
|
return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse);
|
|
@@ -59220,7 +59325,7 @@ var ts;
|
|
|
59220
59325
|
function getConditionalFlowTypeOfType(type, node) {
|
|
59221
59326
|
var constraints;
|
|
59222
59327
|
var covariant = true;
|
|
59223
|
-
while (node && !ts.isStatement(node) && node.kind !==
|
|
59328
|
+
while (node && !ts.isStatement(node) && node.kind !== 319 /* JSDocComment */) {
|
|
59224
59329
|
var parent = node.parent;
|
|
59225
59330
|
// only consider variance flipped by parameter locations - `keyof` types would usually be considered variance inverting, but
|
|
59226
59331
|
// often get used in indexed accesses where they behave sortof invariantly, but our checking is lax
|
|
@@ -59592,10 +59697,10 @@ var ts;
|
|
|
59592
59697
|
case 190 /* ParenthesizedType */:
|
|
59593
59698
|
case 184 /* OptionalType */:
|
|
59594
59699
|
case 196 /* NamedTupleMember */:
|
|
59595
|
-
case
|
|
59596
|
-
case
|
|
59597
|
-
case
|
|
59598
|
-
case
|
|
59700
|
+
case 315 /* JSDocOptionalType */:
|
|
59701
|
+
case 313 /* JSDocNullableType */:
|
|
59702
|
+
case 314 /* JSDocNonNullableType */:
|
|
59703
|
+
case 308 /* JSDocTypeExpression */:
|
|
59599
59704
|
return mayResolveTypeAlias(node.type);
|
|
59600
59705
|
case 185 /* RestType */:
|
|
59601
59706
|
return node.type.kind !== 182 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType);
|
|
@@ -61799,8 +61904,8 @@ var ts;
|
|
|
61799
61904
|
function getTypeFromTypeNodeWorker(node) {
|
|
61800
61905
|
switch (node.kind) {
|
|
61801
61906
|
case 130 /* AnyKeyword */:
|
|
61802
|
-
case
|
|
61803
|
-
case
|
|
61907
|
+
case 311 /* JSDocAllType */:
|
|
61908
|
+
case 312 /* JSDocUnknownType */:
|
|
61804
61909
|
return anyType;
|
|
61805
61910
|
case 154 /* UnknownKeyword */:
|
|
61806
61911
|
return unknownType;
|
|
@@ -61850,26 +61955,26 @@ var ts;
|
|
|
61850
61955
|
return getTypeFromUnionTypeNode(node);
|
|
61851
61956
|
case 187 /* IntersectionType */:
|
|
61852
61957
|
return getTypeFromIntersectionTypeNode(node);
|
|
61853
|
-
case
|
|
61958
|
+
case 313 /* JSDocNullableType */:
|
|
61854
61959
|
return getTypeFromJSDocNullableTypeNode(node);
|
|
61855
|
-
case
|
|
61960
|
+
case 315 /* JSDocOptionalType */:
|
|
61856
61961
|
return addOptionality(getTypeFromTypeNode(node.type));
|
|
61857
61962
|
case 196 /* NamedTupleMember */:
|
|
61858
61963
|
return getTypeFromNamedTupleTypeNode(node);
|
|
61859
61964
|
case 190 /* ParenthesizedType */:
|
|
61860
|
-
case
|
|
61861
|
-
case
|
|
61965
|
+
case 314 /* JSDocNonNullableType */:
|
|
61966
|
+
case 308 /* JSDocTypeExpression */:
|
|
61862
61967
|
return getTypeFromTypeNode(node.type);
|
|
61863
61968
|
case 185 /* RestType */:
|
|
61864
61969
|
return getTypeFromRestTypeNode(node);
|
|
61865
|
-
case
|
|
61970
|
+
case 317 /* JSDocVariadicType */:
|
|
61866
61971
|
return getTypeFromJSDocVariadicType(node);
|
|
61867
61972
|
case 178 /* FunctionType */:
|
|
61868
61973
|
case 179 /* ConstructorType */:
|
|
61869
61974
|
case 181 /* TypeLiteral */:
|
|
61870
|
-
case
|
|
61871
|
-
case
|
|
61872
|
-
case
|
|
61975
|
+
case 321 /* JSDocTypeLiteral */:
|
|
61976
|
+
case 316 /* JSDocFunctionType */:
|
|
61977
|
+
case 322 /* JSDocSignature */:
|
|
61873
61978
|
return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
|
|
61874
61979
|
case 192 /* TypeOperator */:
|
|
61875
61980
|
return getTypeFromTypeOperatorNode(node);
|
|
@@ -62417,7 +62522,7 @@ var ts;
|
|
|
62417
62522
|
case 220 /* BinaryExpression */:
|
|
62418
62523
|
return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) &&
|
|
62419
62524
|
(isContextSensitive(node.left) || isContextSensitive(node.right));
|
|
62420
|
-
case
|
|
62525
|
+
case 295 /* PropertyAssignment */:
|
|
62421
62526
|
return isContextSensitive(node.initializer);
|
|
62422
62527
|
case 211 /* ParenthesizedExpression */:
|
|
62423
62528
|
return isContextSensitive(node.expression);
|
|
@@ -62933,8 +63038,8 @@ var ts;
|
|
|
62933
63038
|
case 172 /* SetAccessor */: return [3 /*break*/, 2];
|
|
62934
63039
|
case 171 /* GetAccessor */: return [3 /*break*/, 2];
|
|
62935
63040
|
case 168 /* MethodDeclaration */: return [3 /*break*/, 2];
|
|
62936
|
-
case
|
|
62937
|
-
case
|
|
63041
|
+
case 296 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2];
|
|
63042
|
+
case 295 /* PropertyAssignment */: return [3 /*break*/, 4];
|
|
62938
63043
|
}
|
|
62939
63044
|
return [3 /*break*/, 6];
|
|
62940
63045
|
case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }];
|
|
@@ -66571,7 +66676,7 @@ var ts;
|
|
|
66571
66676
|
return;
|
|
66572
66677
|
}
|
|
66573
66678
|
break;
|
|
66574
|
-
case
|
|
66679
|
+
case 316 /* JSDocFunctionType */:
|
|
66575
66680
|
error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
|
|
66576
66681
|
return;
|
|
66577
66682
|
case 255 /* FunctionDeclaration */:
|
|
@@ -66737,7 +66842,7 @@ var ts;
|
|
|
66737
66842
|
function isNonGenericTopLevelType(type) {
|
|
66738
66843
|
if (type.aliasSymbol && !type.aliasTypeArguments) {
|
|
66739
66844
|
var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 258 /* TypeAliasDeclaration */);
|
|
66740
|
-
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"; }));
|
|
66741
66846
|
}
|
|
66742
66847
|
return false;
|
|
66743
66848
|
}
|
|
@@ -67833,7 +67938,7 @@ var ts;
|
|
|
67833
67938
|
}
|
|
67834
67939
|
// falls through
|
|
67835
67940
|
default:
|
|
67836
|
-
if (node.parent.kind ===
|
|
67941
|
+
if (node.parent.kind === 296 /* ShorthandPropertyAssignment */) {
|
|
67837
67942
|
return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer;
|
|
67838
67943
|
}
|
|
67839
67944
|
else {
|
|
@@ -68058,7 +68163,7 @@ var ts;
|
|
|
68058
68163
|
}
|
|
68059
68164
|
function getMatchingUnionConstituentForObjectLiteral(unionType, node) {
|
|
68060
68165
|
var keyPropertyName = getKeyPropertyName(unionType);
|
|
68061
|
-
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 */ &&
|
|
68062
68167
|
p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer); });
|
|
68063
68168
|
var propType = propNode && getContextFreeTypeOfExpression(propNode.initializer);
|
|
68064
68169
|
return propType && getConstituentTypeForKeyType(unionType, propType);
|
|
@@ -68253,7 +68358,7 @@ var ts;
|
|
|
68253
68358
|
}
|
|
68254
68359
|
function getAssignedTypeOfBinaryExpression(node) {
|
|
68255
68360
|
var isDestructuringDefaultAssignment = node.parent.kind === 203 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) ||
|
|
68256
|
-
node.parent.kind ===
|
|
68361
|
+
node.parent.kind === 295 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent);
|
|
68257
68362
|
return isDestructuringDefaultAssignment ?
|
|
68258
68363
|
getTypeWithDefault(getAssignedType(node), node.right) :
|
|
68259
68364
|
getTypeOfExpression(node.right);
|
|
@@ -68289,9 +68394,9 @@ var ts;
|
|
|
68289
68394
|
return getAssignedTypeOfArrayLiteralElement(parent, node);
|
|
68290
68395
|
case 224 /* SpreadElement */:
|
|
68291
68396
|
return getAssignedTypeOfSpreadExpression(parent);
|
|
68292
|
-
case
|
|
68397
|
+
case 295 /* PropertyAssignment */:
|
|
68293
68398
|
return getAssignedTypeOfPropertyAssignment(parent);
|
|
68294
|
-
case
|
|
68399
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
68295
68400
|
return getAssignedTypeOfShorthandPropertyAssignment(parent);
|
|
68296
68401
|
}
|
|
68297
68402
|
return errorType;
|
|
@@ -69969,7 +70074,7 @@ var ts;
|
|
|
69969
70074
|
return ts.findAncestor(node.parent, function (node) {
|
|
69970
70075
|
return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) ||
|
|
69971
70076
|
node.kind === 261 /* ModuleBlock */ ||
|
|
69972
|
-
node.kind ===
|
|
70077
|
+
node.kind === 304 /* SourceFile */ ||
|
|
69973
70078
|
node.kind === 166 /* PropertyDeclaration */;
|
|
69974
70079
|
});
|
|
69975
70080
|
}
|
|
@@ -70244,7 +70349,7 @@ var ts;
|
|
|
70244
70349
|
// to the constructor in the initializer, we will need to substitute that
|
|
70245
70350
|
// binding with an alias as the class name is not in scope.
|
|
70246
70351
|
var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false);
|
|
70247
|
-
while (container.kind !==
|
|
70352
|
+
while (container.kind !== 304 /* SourceFile */) {
|
|
70248
70353
|
if (container.parent === declaration) {
|
|
70249
70354
|
if (ts.isPropertyDeclaration(container) && ts.isStatic(container) || ts.isClassStaticBlockDeclaration(container)) {
|
|
70250
70355
|
getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */;
|
|
@@ -70615,7 +70720,7 @@ var ts;
|
|
|
70615
70720
|
}
|
|
70616
70721
|
// x.prototype = { method: function() { } }
|
|
70617
70722
|
else if (container.kind === 212 /* FunctionExpression */ &&
|
|
70618
|
-
container.parent.kind ===
|
|
70723
|
+
container.parent.kind === 295 /* PropertyAssignment */ &&
|
|
70619
70724
|
container.parent.parent.kind === 204 /* ObjectLiteralExpression */ &&
|
|
70620
70725
|
ts.isBinaryExpression(container.parent.parent.parent) &&
|
|
70621
70726
|
ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) {
|
|
@@ -70649,7 +70754,7 @@ var ts;
|
|
|
70649
70754
|
}
|
|
70650
70755
|
function getTypeForThisExpressionFromJSDoc(node) {
|
|
70651
70756
|
var jsdocType = ts.getJSDocType(node);
|
|
70652
|
-
if (jsdocType && jsdocType.kind ===
|
|
70757
|
+
if (jsdocType && jsdocType.kind === 316 /* JSDocFunctionType */) {
|
|
70653
70758
|
var jsDocFunctionType = jsdocType;
|
|
70654
70759
|
if (jsDocFunctionType.parameters.length > 0 &&
|
|
70655
70760
|
jsDocFunctionType.parameters[0].name &&
|
|
@@ -70866,7 +70971,7 @@ var ts;
|
|
|
70866
70971
|
return (func.kind === 168 /* MethodDeclaration */ ||
|
|
70867
70972
|
func.kind === 171 /* GetAccessor */ ||
|
|
70868
70973
|
func.kind === 172 /* SetAccessor */) && func.parent.kind === 204 /* ObjectLiteralExpression */ ? func.parent :
|
|
70869
|
-
func.kind === 212 /* FunctionExpression */ && func.parent.kind ===
|
|
70974
|
+
func.kind === 212 /* FunctionExpression */ && func.parent.kind === 295 /* PropertyAssignment */ ? func.parent.parent :
|
|
70870
70975
|
undefined;
|
|
70871
70976
|
}
|
|
70872
70977
|
function getThisTypeArgument(type) {
|
|
@@ -70905,7 +71010,7 @@ var ts;
|
|
|
70905
71010
|
if (thisType) {
|
|
70906
71011
|
return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral)));
|
|
70907
71012
|
}
|
|
70908
|
-
if (literal.parent.kind !==
|
|
71013
|
+
if (literal.parent.kind !== 295 /* PropertyAssignment */) {
|
|
70909
71014
|
break;
|
|
70910
71015
|
}
|
|
70911
71016
|
literal = literal.parent.parent;
|
|
@@ -71441,7 +71546,7 @@ var ts;
|
|
|
71441
71546
|
return false;
|
|
71442
71547
|
}
|
|
71443
71548
|
function discriminateContextualTypeByObjectMembers(node, contextualType) {
|
|
71444
|
-
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);
|
|
71445
71550
|
}
|
|
71446
71551
|
function discriminateContextualTypeByJSXAttributes(node, contextualType) {
|
|
71447
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);
|
|
@@ -71545,10 +71650,10 @@ var ts;
|
|
|
71545
71650
|
return ts.isConstTypeReference(parent.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(parent.type);
|
|
71546
71651
|
case 220 /* BinaryExpression */:
|
|
71547
71652
|
return getContextualTypeForBinaryOperand(node, contextFlags);
|
|
71548
|
-
case
|
|
71549
|
-
case
|
|
71653
|
+
case 295 /* PropertyAssignment */:
|
|
71654
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
71550
71655
|
return getContextualTypeForObjectLiteralElement(parent, contextFlags);
|
|
71551
|
-
case
|
|
71656
|
+
case 297 /* SpreadAssignment */:
|
|
71552
71657
|
return getContextualType(parent.parent, contextFlags);
|
|
71553
71658
|
case 203 /* ArrayLiteralExpression */: {
|
|
71554
71659
|
var arrayLiteral = parent;
|
|
@@ -71569,6 +71674,8 @@ var ts;
|
|
|
71569
71674
|
}
|
|
71570
71675
|
case 229 /* NonNullExpression */:
|
|
71571
71676
|
return getContextualType(parent, contextFlags);
|
|
71677
|
+
case 270 /* ExportAssignment */:
|
|
71678
|
+
return tryGetTypeFromEffectiveTypeNode(parent);
|
|
71572
71679
|
case 287 /* JsxExpression */:
|
|
71573
71680
|
return getContextualTypeForJsxExpression(parent);
|
|
71574
71681
|
case 284 /* JsxAttribute */:
|
|
@@ -72076,14 +72183,14 @@ var ts;
|
|
|
72076
72183
|
var member = getSymbolOfNode(memberDecl);
|
|
72077
72184
|
var computedNameType = memberDecl.name && memberDecl.name.kind === 161 /* ComputedPropertyName */ ?
|
|
72078
72185
|
checkComputedPropertyName(memberDecl.name) : undefined;
|
|
72079
|
-
if (memberDecl.kind ===
|
|
72080
|
-
memberDecl.kind ===
|
|
72186
|
+
if (memberDecl.kind === 295 /* PropertyAssignment */ ||
|
|
72187
|
+
memberDecl.kind === 296 /* ShorthandPropertyAssignment */ ||
|
|
72081
72188
|
ts.isObjectLiteralMethod(memberDecl)) {
|
|
72082
|
-
var type = memberDecl.kind ===
|
|
72189
|
+
var type = memberDecl.kind === 295 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) :
|
|
72083
72190
|
// avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring
|
|
72084
72191
|
// for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`.
|
|
72085
72192
|
// we don't want to say "could not find 'a'".
|
|
72086
|
-
memberDecl.kind ===
|
|
72193
|
+
memberDecl.kind === 296 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) :
|
|
72087
72194
|
checkObjectLiteralMethod(memberDecl, checkMode);
|
|
72088
72195
|
if (isInJavascript) {
|
|
72089
72196
|
var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
|
|
@@ -72106,8 +72213,8 @@ var ts;
|
|
|
72106
72213
|
if (inDestructuringPattern) {
|
|
72107
72214
|
// If object literal is an assignment pattern and if the assignment pattern specifies a default value
|
|
72108
72215
|
// for the property, make the property optional.
|
|
72109
|
-
var isOptional = (memberDecl.kind ===
|
|
72110
|
-
(memberDecl.kind ===
|
|
72216
|
+
var isOptional = (memberDecl.kind === 295 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) ||
|
|
72217
|
+
(memberDecl.kind === 296 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer);
|
|
72111
72218
|
if (isOptional) {
|
|
72112
72219
|
prop.flags |= 16777216 /* Optional */;
|
|
72113
72220
|
}
|
|
@@ -72133,7 +72240,7 @@ var ts;
|
|
|
72133
72240
|
member = prop;
|
|
72134
72241
|
allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
|
|
72135
72242
|
}
|
|
72136
|
-
else if (memberDecl.kind ===
|
|
72243
|
+
else if (memberDecl.kind === 297 /* SpreadAssignment */) {
|
|
72137
72244
|
if (languageVersion < 2 /* ES2015 */) {
|
|
72138
72245
|
checkExternalEmitHelpers(memberDecl, 2 /* Assign */);
|
|
72139
72246
|
}
|
|
@@ -72197,7 +72304,7 @@ var ts;
|
|
|
72197
72304
|
// type with those properties for which the binding pattern specifies a default value.
|
|
72198
72305
|
// If the object literal is spread into another object literal, skip this step and let the top-level object
|
|
72199
72306
|
// literal handle it instead.
|
|
72200
|
-
if (contextualTypeHasPattern && node.parent.kind !==
|
|
72307
|
+
if (contextualTypeHasPattern && node.parent.kind !== 297 /* SpreadAssignment */) {
|
|
72201
72308
|
for (var _d = 0, _e = getPropertiesOfType(contextualType); _d < _e.length; _d++) {
|
|
72202
72309
|
var prop = _e[_d];
|
|
72203
72310
|
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
|
|
@@ -73331,11 +73438,11 @@ var ts;
|
|
|
73331
73438
|
switch (node.kind) {
|
|
73332
73439
|
case 166 /* PropertyDeclaration */:
|
|
73333
73440
|
return true;
|
|
73334
|
-
case
|
|
73441
|
+
case 295 /* PropertyAssignment */:
|
|
73335
73442
|
case 168 /* MethodDeclaration */:
|
|
73336
73443
|
case 171 /* GetAccessor */:
|
|
73337
73444
|
case 172 /* SetAccessor */:
|
|
73338
|
-
case
|
|
73445
|
+
case 297 /* SpreadAssignment */:
|
|
73339
73446
|
case 161 /* ComputedPropertyName */:
|
|
73340
73447
|
case 232 /* TemplateSpan */:
|
|
73341
73448
|
case 287 /* JsxExpression */:
|
|
@@ -75978,7 +76085,7 @@ var ts;
|
|
|
75978
76085
|
}
|
|
75979
76086
|
function getParameterIdentifierNameAtPosition(signature, pos) {
|
|
75980
76087
|
var _a;
|
|
75981
|
-
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 */) {
|
|
75982
76089
|
return undefined;
|
|
75983
76090
|
}
|
|
75984
76091
|
var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
|
@@ -77130,7 +77237,7 @@ var ts;
|
|
|
77130
77237
|
if (rightIsThis === void 0) { rightIsThis = false; }
|
|
77131
77238
|
var properties = node.properties;
|
|
77132
77239
|
var property = properties[propertyIndex];
|
|
77133
|
-
if (property.kind ===
|
|
77240
|
+
if (property.kind === 295 /* PropertyAssignment */ || property.kind === 296 /* ShorthandPropertyAssignment */) {
|
|
77134
77241
|
var name = property.name;
|
|
77135
77242
|
var exprType = getLiteralTypeFromPropertyName(name);
|
|
77136
77243
|
if (isTypeUsableAsPropertyName(exprType)) {
|
|
@@ -77143,9 +77250,9 @@ var ts;
|
|
|
77143
77250
|
}
|
|
77144
77251
|
var elementType = getIndexedAccessType(objectLiteralType, exprType, 32 /* ExpressionPosition */, name);
|
|
77145
77252
|
var type = getFlowTypeOfDestructuring(property, elementType);
|
|
77146
|
-
return checkDestructuringAssignment(property.kind ===
|
|
77253
|
+
return checkDestructuringAssignment(property.kind === 296 /* ShorthandPropertyAssignment */ ? property : property.initializer, type);
|
|
77147
77254
|
}
|
|
77148
|
-
else if (property.kind ===
|
|
77255
|
+
else if (property.kind === 297 /* SpreadAssignment */) {
|
|
77149
77256
|
if (propertyIndex < properties.length - 1) {
|
|
77150
77257
|
error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
|
|
77151
77258
|
}
|
|
@@ -77228,7 +77335,7 @@ var ts;
|
|
|
77228
77335
|
}
|
|
77229
77336
|
function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) {
|
|
77230
77337
|
var target;
|
|
77231
|
-
if (exprOrAssignment.kind ===
|
|
77338
|
+
if (exprOrAssignment.kind === 296 /* ShorthandPropertyAssignment */) {
|
|
77232
77339
|
var prop = exprOrAssignment;
|
|
77233
77340
|
if (prop.objectAssignmentInitializer) {
|
|
77234
77341
|
// In strict null checking mode, if a default value of a non-undefined type is specified, remove
|
|
@@ -77258,10 +77365,10 @@ var ts;
|
|
|
77258
77365
|
}
|
|
77259
77366
|
function checkReferenceAssignment(target, sourceType, checkMode) {
|
|
77260
77367
|
var targetType = checkExpression(target, checkMode);
|
|
77261
|
-
var error = target.parent.kind ===
|
|
77368
|
+
var error = target.parent.kind === 297 /* SpreadAssignment */ ?
|
|
77262
77369
|
ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access :
|
|
77263
77370
|
ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;
|
|
77264
|
-
var optionalError = target.parent.kind ===
|
|
77371
|
+
var optionalError = target.parent.kind === 297 /* SpreadAssignment */ ?
|
|
77265
77372
|
ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access :
|
|
77266
77373
|
ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;
|
|
77267
77374
|
if (checkReferenceExpression(target, error, optionalError)) {
|
|
@@ -78669,7 +78776,7 @@ var ts;
|
|
|
78669
78776
|
checkAsyncFunctionReturnType(node, returnTypeNode);
|
|
78670
78777
|
}
|
|
78671
78778
|
}
|
|
78672
|
-
if (node.kind !== 175 /* IndexSignature */ && node.kind !==
|
|
78779
|
+
if (node.kind !== 175 /* IndexSignature */ && node.kind !== 316 /* JSDocFunctionType */) {
|
|
78673
78780
|
registerForUnusedIdentifiersCheck(node);
|
|
78674
78781
|
}
|
|
78675
78782
|
}
|
|
@@ -79271,6 +79378,14 @@ var ts;
|
|
|
79271
79378
|
}
|
|
79272
79379
|
function checkImportType(node) {
|
|
79273
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
|
+
}
|
|
79274
79389
|
getTypeFromTypeNode(node);
|
|
79275
79390
|
}
|
|
79276
79391
|
function checkNamedTupleMember(node) {
|
|
@@ -79592,9 +79707,9 @@ var ts;
|
|
|
79592
79707
|
case 258 /* TypeAliasDeclaration */:
|
|
79593
79708
|
// A jsdoc typedef and callback are, by definition, type aliases.
|
|
79594
79709
|
// falls through
|
|
79595
|
-
case
|
|
79596
|
-
case
|
|
79597
|
-
case
|
|
79710
|
+
case 344 /* JSDocTypedefTag */:
|
|
79711
|
+
case 337 /* JSDocCallbackTag */:
|
|
79712
|
+
case 338 /* JSDocEnumTag */:
|
|
79598
79713
|
return 2 /* ExportType */;
|
|
79599
79714
|
case 260 /* ModuleDeclaration */:
|
|
79600
79715
|
return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */
|
|
@@ -79602,9 +79717,9 @@ var ts;
|
|
|
79602
79717
|
: 4 /* ExportNamespace */;
|
|
79603
79718
|
case 256 /* ClassDeclaration */:
|
|
79604
79719
|
case 259 /* EnumDeclaration */:
|
|
79605
|
-
case
|
|
79720
|
+
case 298 /* EnumMember */:
|
|
79606
79721
|
return 2 /* ExportType */ | 1 /* ExportValue */;
|
|
79607
|
-
case
|
|
79722
|
+
case 304 /* SourceFile */:
|
|
79608
79723
|
return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */;
|
|
79609
79724
|
case 270 /* ExportAssignment */:
|
|
79610
79725
|
case 220 /* BinaryExpression */:
|
|
@@ -80326,7 +80441,7 @@ var ts;
|
|
|
80326
80441
|
checkUnusedClassMembers(node, addDiagnostic);
|
|
80327
80442
|
checkUnusedTypeParameters(node, addDiagnostic);
|
|
80328
80443
|
break;
|
|
80329
|
-
case
|
|
80444
|
+
case 304 /* SourceFile */:
|
|
80330
80445
|
case 260 /* ModuleDeclaration */:
|
|
80331
80446
|
case 234 /* Block */:
|
|
80332
80447
|
case 262 /* CaseBlock */:
|
|
@@ -80644,7 +80759,7 @@ var ts;
|
|
|
80644
80759
|
node.kind === 167 /* MethodSignature */ ||
|
|
80645
80760
|
node.kind === 171 /* GetAccessor */ ||
|
|
80646
80761
|
node.kind === 172 /* SetAccessor */ ||
|
|
80647
|
-
node.kind ===
|
|
80762
|
+
node.kind === 295 /* PropertyAssignment */) {
|
|
80648
80763
|
// it is ok to have member named '_super', '_this', `Promise`, etc. - member access is always qualified
|
|
80649
80764
|
return false;
|
|
80650
80765
|
}
|
|
@@ -80710,7 +80825,7 @@ var ts;
|
|
|
80710
80825
|
}
|
|
80711
80826
|
// In case of variable declaration, node.parent is variable statement so look at the variable statement's parent
|
|
80712
80827
|
var parent = getDeclarationContainer(node);
|
|
80713
|
-
if (parent.kind ===
|
|
80828
|
+
if (parent.kind === 304 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) {
|
|
80714
80829
|
// If the declaration happens to be in external module, report error that require and exports are reserved keywords
|
|
80715
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));
|
|
80716
80831
|
}
|
|
@@ -80725,7 +80840,7 @@ var ts;
|
|
|
80725
80840
|
}
|
|
80726
80841
|
// In case of variable declaration, node.parent is variable statement so look at the variable statement's parent
|
|
80727
80842
|
var parent = getDeclarationContainer(node);
|
|
80728
|
-
if (parent.kind ===
|
|
80843
|
+
if (parent.kind === 304 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) {
|
|
80729
80844
|
// If the declaration happens to be in external module, report error that Promise is a reserved identifier.
|
|
80730
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));
|
|
80731
80846
|
}
|
|
@@ -80847,7 +80962,7 @@ var ts;
|
|
|
80847
80962
|
(container.kind === 234 /* Block */ && ts.isFunctionLike(container.parent) ||
|
|
80848
80963
|
container.kind === 261 /* ModuleBlock */ ||
|
|
80849
80964
|
container.kind === 260 /* ModuleDeclaration */ ||
|
|
80850
|
-
container.kind ===
|
|
80965
|
+
container.kind === 304 /* SourceFile */);
|
|
80851
80966
|
// here we know that function scoped variable is shadowed by block scoped one
|
|
80852
80967
|
// if they are defined in the same scope - binder has already reported redeclaration error
|
|
80853
80968
|
// otherwise if variable has an initializer - show error that initialization will fail
|
|
@@ -83454,7 +83569,7 @@ var ts;
|
|
|
83454
83569
|
return false;
|
|
83455
83570
|
}
|
|
83456
83571
|
var inAmbientExternalModule = node.parent.kind === 261 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent);
|
|
83457
|
-
if (node.parent.kind !==
|
|
83572
|
+
if (node.parent.kind !== 304 /* SourceFile */ && !inAmbientExternalModule) {
|
|
83458
83573
|
error(moduleName, node.kind === 271 /* ExportDeclaration */ ?
|
|
83459
83574
|
ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace :
|
|
83460
83575
|
ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
|
|
@@ -83597,6 +83712,14 @@ var ts;
|
|
|
83597
83712
|
function checkAssertClause(declaration) {
|
|
83598
83713
|
var _a;
|
|
83599
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
|
+
}
|
|
83600
83723
|
var mode = (moduleKind === ts.ModuleKind.NodeNext) && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
83601
83724
|
if (mode !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.ESNext) {
|
|
83602
83725
|
return grammarErrorOnNode(declaration.assertClause, moduleKind === ts.ModuleKind.NodeNext
|
|
@@ -83606,6 +83729,9 @@ var ts;
|
|
|
83606
83729
|
if (ts.isImportDeclaration(declaration) ? (_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
|
|
83607
83730
|
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
|
|
83608
83731
|
}
|
|
83732
|
+
if (override) {
|
|
83733
|
+
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
|
|
83734
|
+
}
|
|
83609
83735
|
}
|
|
83610
83736
|
}
|
|
83611
83737
|
function checkImportDeclaration(node) {
|
|
@@ -83698,7 +83824,7 @@ var ts;
|
|
|
83698
83824
|
var inAmbientExternalModule = node.parent.kind === 261 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent);
|
|
83699
83825
|
var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 261 /* ModuleBlock */ &&
|
|
83700
83826
|
!node.moduleSpecifier && node.flags & 8388608 /* Ambient */;
|
|
83701
|
-
if (node.parent.kind !==
|
|
83827
|
+
if (node.parent.kind !== 304 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
|
|
83702
83828
|
error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
|
|
83703
83829
|
}
|
|
83704
83830
|
}
|
|
@@ -83743,7 +83869,7 @@ var ts;
|
|
|
83743
83869
|
return false;
|
|
83744
83870
|
}
|
|
83745
83871
|
function checkGrammarModuleElementContext(node, errorMessage) {
|
|
83746
|
-
var isInAppropriateContext = node.parent.kind ===
|
|
83872
|
+
var isInAppropriateContext = node.parent.kind === 304 /* SourceFile */ || node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 260 /* ModuleDeclaration */;
|
|
83747
83873
|
if (!isInAppropriateContext) {
|
|
83748
83874
|
grammarErrorOnFirstToken(node, errorMessage);
|
|
83749
83875
|
}
|
|
@@ -83821,7 +83947,7 @@ var ts;
|
|
|
83821
83947
|
// If we hit an export assignment in an illegal context, just bail out to avoid cascading errors.
|
|
83822
83948
|
return;
|
|
83823
83949
|
}
|
|
83824
|
-
var container = node.parent.kind ===
|
|
83950
|
+
var container = node.parent.kind === 304 /* SourceFile */ ? node.parent : node.parent.parent;
|
|
83825
83951
|
if (container.kind === 260 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) {
|
|
83826
83952
|
if (node.isExportEquals) {
|
|
83827
83953
|
error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
|
|
@@ -84018,41 +84144,41 @@ var ts;
|
|
|
84018
84144
|
return checkImportType(node);
|
|
84019
84145
|
case 196 /* NamedTupleMember */:
|
|
84020
84146
|
return checkNamedTupleMember(node);
|
|
84021
|
-
case
|
|
84147
|
+
case 327 /* JSDocAugmentsTag */:
|
|
84022
84148
|
return checkJSDocAugmentsTag(node);
|
|
84023
|
-
case
|
|
84149
|
+
case 328 /* JSDocImplementsTag */:
|
|
84024
84150
|
return checkJSDocImplementsTag(node);
|
|
84025
|
-
case
|
|
84026
|
-
case
|
|
84027
|
-
case
|
|
84151
|
+
case 344 /* JSDocTypedefTag */:
|
|
84152
|
+
case 337 /* JSDocCallbackTag */:
|
|
84153
|
+
case 338 /* JSDocEnumTag */:
|
|
84028
84154
|
return checkJSDocTypeAliasTag(node);
|
|
84029
|
-
case
|
|
84155
|
+
case 343 /* JSDocTemplateTag */:
|
|
84030
84156
|
return checkJSDocTemplateTag(node);
|
|
84031
|
-
case
|
|
84157
|
+
case 342 /* JSDocTypeTag */:
|
|
84032
84158
|
return checkJSDocTypeTag(node);
|
|
84033
|
-
case
|
|
84159
|
+
case 339 /* JSDocParameterTag */:
|
|
84034
84160
|
return checkJSDocParameterTag(node);
|
|
84035
|
-
case
|
|
84161
|
+
case 346 /* JSDocPropertyTag */:
|
|
84036
84162
|
return checkJSDocPropertyTag(node);
|
|
84037
|
-
case
|
|
84163
|
+
case 316 /* JSDocFunctionType */:
|
|
84038
84164
|
checkJSDocFunctionType(node);
|
|
84039
84165
|
// falls through
|
|
84040
|
-
case
|
|
84041
|
-
case
|
|
84042
|
-
case
|
|
84043
|
-
case
|
|
84044
|
-
case
|
|
84166
|
+
case 314 /* JSDocNonNullableType */:
|
|
84167
|
+
case 313 /* JSDocNullableType */:
|
|
84168
|
+
case 311 /* JSDocAllType */:
|
|
84169
|
+
case 312 /* JSDocUnknownType */:
|
|
84170
|
+
case 321 /* JSDocTypeLiteral */:
|
|
84045
84171
|
checkJSDocTypeIsInJsFile(node);
|
|
84046
84172
|
ts.forEachChild(node, checkSourceElement);
|
|
84047
84173
|
return;
|
|
84048
|
-
case
|
|
84174
|
+
case 317 /* JSDocVariadicType */:
|
|
84049
84175
|
checkJSDocVariadicType(node);
|
|
84050
84176
|
return;
|
|
84051
|
-
case
|
|
84177
|
+
case 308 /* JSDocTypeExpression */:
|
|
84052
84178
|
return checkSourceElement(node.type);
|
|
84053
|
-
case
|
|
84054
|
-
case
|
|
84055
|
-
case
|
|
84179
|
+
case 332 /* JSDocPublicTag */:
|
|
84180
|
+
case 334 /* JSDocProtectedTag */:
|
|
84181
|
+
case 333 /* JSDocPrivateTag */:
|
|
84056
84182
|
return checkJSDocAccessibilityModifiers(node);
|
|
84057
84183
|
case 193 /* IndexedAccessType */:
|
|
84058
84184
|
return checkIndexedAccessType(node);
|
|
@@ -84395,7 +84521,7 @@ var ts;
|
|
|
84395
84521
|
copySymbols(location.locals, meaning);
|
|
84396
84522
|
}
|
|
84397
84523
|
switch (location.kind) {
|
|
84398
|
-
case
|
|
84524
|
+
case 304 /* SourceFile */:
|
|
84399
84525
|
if (!ts.isExternalModule(location))
|
|
84400
84526
|
break;
|
|
84401
84527
|
// falls through
|
|
@@ -84486,9 +84612,9 @@ var ts;
|
|
|
84486
84612
|
case 257 /* InterfaceDeclaration */:
|
|
84487
84613
|
case 258 /* TypeAliasDeclaration */:
|
|
84488
84614
|
case 259 /* EnumDeclaration */:
|
|
84489
|
-
case
|
|
84490
|
-
case
|
|
84491
|
-
case
|
|
84615
|
+
case 344 /* JSDocTypedefTag */:
|
|
84616
|
+
case 337 /* JSDocCallbackTag */:
|
|
84617
|
+
case 338 /* JSDocEnumTag */:
|
|
84492
84618
|
return true;
|
|
84493
84619
|
case 266 /* ImportClause */:
|
|
84494
84620
|
return node.isTypeOnly;
|
|
@@ -84634,10 +84760,10 @@ var ts;
|
|
|
84634
84760
|
return entityNameSymbol;
|
|
84635
84761
|
}
|
|
84636
84762
|
}
|
|
84637
|
-
if (name.parent.kind ===
|
|
84763
|
+
if (name.parent.kind === 339 /* JSDocParameterTag */) {
|
|
84638
84764
|
return ts.getParameterSymbolFromJSDoc(name.parent);
|
|
84639
84765
|
}
|
|
84640
|
-
if (name.parent.kind === 162 /* TypeParameter */ && name.parent.parent.kind ===
|
|
84766
|
+
if (name.parent.kind === 162 /* TypeParameter */ && name.parent.parent.kind === 343 /* JSDocTemplateTag */) {
|
|
84641
84767
|
ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true.
|
|
84642
84768
|
var typeParameter = ts.getTypeParameterFromJsDoc(name.parent);
|
|
84643
84769
|
return typeParameter && typeParameter.symbol;
|
|
@@ -84725,7 +84851,7 @@ var ts;
|
|
|
84725
84851
|
}
|
|
84726
84852
|
}
|
|
84727
84853
|
function getSymbolAtLocation(node, ignoreErrors) {
|
|
84728
|
-
if (node.kind ===
|
|
84854
|
+
if (node.kind === 304 /* SourceFile */) {
|
|
84729
84855
|
return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined;
|
|
84730
84856
|
}
|
|
84731
84857
|
var parent = node.parent;
|
|
@@ -84852,7 +84978,7 @@ var ts;
|
|
|
84852
84978
|
return undefined;
|
|
84853
84979
|
}
|
|
84854
84980
|
function getShorthandAssignmentValueSymbol(location) {
|
|
84855
|
-
if (location && location.kind ===
|
|
84981
|
+
if (location && location.kind === 296 /* ShorthandPropertyAssignment */) {
|
|
84856
84982
|
return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */);
|
|
84857
84983
|
}
|
|
84858
84984
|
return undefined;
|
|
@@ -84950,7 +85076,7 @@ var ts;
|
|
|
84950
85076
|
}
|
|
84951
85077
|
// If this is from nested object binding pattern
|
|
84952
85078
|
// for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) {
|
|
84953
|
-
if (expr.parent.kind ===
|
|
85079
|
+
if (expr.parent.kind === 295 /* PropertyAssignment */) {
|
|
84954
85080
|
var node_3 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression);
|
|
84955
85081
|
var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_3) || errorType;
|
|
84956
85082
|
var propertyIndex = ts.indexOfNode(node_3.properties, expr.parent);
|
|
@@ -85116,7 +85242,7 @@ var ts;
|
|
|
85116
85242
|
}
|
|
85117
85243
|
var parentSymbol_1 = getParentOfSymbol(symbol);
|
|
85118
85244
|
if (parentSymbol_1) {
|
|
85119
|
-
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 */) {
|
|
85120
85246
|
var symbolFile = parentSymbol_1.valueDeclaration;
|
|
85121
85247
|
var referenceFile = ts.getSourceFileOfNode(node);
|
|
85122
85248
|
// If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined.
|
|
@@ -85241,7 +85367,7 @@ var ts;
|
|
|
85241
85367
|
}
|
|
85242
85368
|
function isTopLevelValueImportEqualsWithEntityName(nodeIn) {
|
|
85243
85369
|
var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration);
|
|
85244
|
-
if (node === undefined || node.parent.kind !==
|
|
85370
|
+
if (node === undefined || node.parent.kind !== 304 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) {
|
|
85245
85371
|
// parent is not source file or it is not reference to internal module
|
|
85246
85372
|
return false;
|
|
85247
85373
|
}
|
|
@@ -85356,7 +85482,7 @@ var ts;
|
|
|
85356
85482
|
}
|
|
85357
85483
|
function canHaveConstantValue(node) {
|
|
85358
85484
|
switch (node.kind) {
|
|
85359
|
-
case
|
|
85485
|
+
case 298 /* EnumMember */:
|
|
85360
85486
|
case 205 /* PropertyAccessExpression */:
|
|
85361
85487
|
case 206 /* ElementAccessExpression */:
|
|
85362
85488
|
return true;
|
|
@@ -85364,7 +85490,7 @@ var ts;
|
|
|
85364
85490
|
return false;
|
|
85365
85491
|
}
|
|
85366
85492
|
function getConstantValue(node) {
|
|
85367
|
-
if (node.kind ===
|
|
85493
|
+
if (node.kind === 298 /* EnumMember */) {
|
|
85368
85494
|
return getEnumMemberValue(node);
|
|
85369
85495
|
}
|
|
85370
85496
|
var symbol = getNodeLinks(node).resolvedSymbol;
|
|
@@ -85662,7 +85788,7 @@ var ts;
|
|
|
85662
85788
|
},
|
|
85663
85789
|
getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) {
|
|
85664
85790
|
var n = ts.getParseTreeNode(node);
|
|
85665
|
-
ts.Debug.assert(n && n.kind ===
|
|
85791
|
+
ts.Debug.assert(n && n.kind === 304 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile");
|
|
85666
85792
|
var sym = getSymbolOfNode(node);
|
|
85667
85793
|
if (!sym) {
|
|
85668
85794
|
return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled);
|
|
@@ -85759,7 +85885,7 @@ var ts;
|
|
|
85759
85885
|
break;
|
|
85760
85886
|
}
|
|
85761
85887
|
}
|
|
85762
|
-
if (current.valueDeclaration && current.valueDeclaration.kind ===
|
|
85888
|
+
if (current.valueDeclaration && current.valueDeclaration.kind === 304 /* SourceFile */ && current.flags & 512 /* ValueModule */) {
|
|
85763
85889
|
return false;
|
|
85764
85890
|
}
|
|
85765
85891
|
// check that at least one declaration of top level symbol originates from type declaration file
|
|
@@ -85792,7 +85918,7 @@ var ts;
|
|
|
85792
85918
|
if (!moduleSymbol) {
|
|
85793
85919
|
return undefined;
|
|
85794
85920
|
}
|
|
85795
|
-
return ts.getDeclarationOfKind(moduleSymbol,
|
|
85921
|
+
return ts.getDeclarationOfKind(moduleSymbol, 304 /* SourceFile */);
|
|
85796
85922
|
}
|
|
85797
85923
|
function initializeTypeChecker() {
|
|
85798
85924
|
// Bind all source files and propagate errors
|
|
@@ -86075,7 +86201,7 @@ var ts;
|
|
|
86075
86201
|
else if (flags & 256 /* Async */) {
|
|
86076
86202
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
|
|
86077
86203
|
}
|
|
86078
|
-
else if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind ===
|
|
86204
|
+
else if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 304 /* SourceFile */) {
|
|
86079
86205
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
|
|
86080
86206
|
}
|
|
86081
86207
|
else if (flags & 128 /* Abstract */) {
|
|
@@ -86101,7 +86227,7 @@ var ts;
|
|
|
86101
86227
|
else if (flags & 256 /* Async */) {
|
|
86102
86228
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
|
|
86103
86229
|
}
|
|
86104
|
-
else if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind ===
|
|
86230
|
+
else if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 304 /* SourceFile */) {
|
|
86105
86231
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
|
|
86106
86232
|
}
|
|
86107
86233
|
else if (node.kind === 163 /* Parameter */) {
|
|
@@ -86148,7 +86274,7 @@ var ts;
|
|
|
86148
86274
|
flags |= 1 /* Export */;
|
|
86149
86275
|
break;
|
|
86150
86276
|
case 88 /* DefaultKeyword */:
|
|
86151
|
-
var container = node.parent.kind ===
|
|
86277
|
+
var container = node.parent.kind === 304 /* SourceFile */ ? node.parent : node.parent.parent;
|
|
86152
86278
|
if (container.kind === 260 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) {
|
|
86153
86279
|
return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);
|
|
86154
86280
|
}
|
|
@@ -86290,7 +86416,7 @@ var ts;
|
|
|
86290
86416
|
case 163 /* Parameter */:
|
|
86291
86417
|
return false;
|
|
86292
86418
|
default:
|
|
86293
|
-
if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind ===
|
|
86419
|
+
if (node.parent.kind === 261 /* ModuleBlock */ || node.parent.kind === 304 /* SourceFile */) {
|
|
86294
86420
|
return false;
|
|
86295
86421
|
}
|
|
86296
86422
|
switch (node.kind) {
|
|
@@ -86577,7 +86703,7 @@ var ts;
|
|
|
86577
86703
|
var seen = new ts.Map();
|
|
86578
86704
|
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
|
|
86579
86705
|
var prop = _a[_i];
|
|
86580
|
-
if (prop.kind ===
|
|
86706
|
+
if (prop.kind === 297 /* SpreadAssignment */) {
|
|
86581
86707
|
if (inDestructuring) {
|
|
86582
86708
|
// a rest property cannot be destructured any further
|
|
86583
86709
|
var expression = ts.skipParentheses(prop.expression);
|
|
@@ -86592,7 +86718,7 @@ var ts;
|
|
|
86592
86718
|
// If the name is not a ComputedPropertyName, the grammar checking will skip it
|
|
86593
86719
|
checkGrammarComputedPropertyName(name);
|
|
86594
86720
|
}
|
|
86595
|
-
if (prop.kind ===
|
|
86721
|
+
if (prop.kind === 296 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {
|
|
86596
86722
|
// having objectAssignmentInitializer is only valid in ObjectAssignmentPattern
|
|
86597
86723
|
// outside of destructuring it is a syntax error
|
|
86598
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);
|
|
@@ -86619,10 +86745,10 @@ var ts;
|
|
|
86619
86745
|
// and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields
|
|
86620
86746
|
var currentKind = void 0;
|
|
86621
86747
|
switch (prop.kind) {
|
|
86622
|
-
case
|
|
86748
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
86623
86749
|
checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);
|
|
86624
86750
|
// falls through
|
|
86625
|
-
case
|
|
86751
|
+
case 295 /* PropertyAssignment */:
|
|
86626
86752
|
// Grammar checking for computedPropertyName and shorthandPropertyAssignment
|
|
86627
86753
|
checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
|
|
86628
86754
|
if (name.kind === 8 /* NumericLiteral */) {
|
|
@@ -87316,7 +87442,7 @@ var ts;
|
|
|
87316
87442
|
// to prevent noisiness. So use a bit on the block to indicate if
|
|
87317
87443
|
// this has already been reported, and don't report if it has.
|
|
87318
87444
|
//
|
|
87319
|
-
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 */) {
|
|
87320
87446
|
var links_2 = getNodeLinks(node.parent);
|
|
87321
87447
|
// Check if the containing block ever report this error
|
|
87322
87448
|
if (!links_2.hasReportedStatementInAmbientContext) {
|
|
@@ -87341,7 +87467,7 @@ var ts;
|
|
|
87341
87467
|
else if (ts.isChildOfNodeWithKind(node, 195 /* LiteralType */)) {
|
|
87342
87468
|
diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0;
|
|
87343
87469
|
}
|
|
87344
|
-
else if (ts.isChildOfNodeWithKind(node,
|
|
87470
|
+
else if (ts.isChildOfNodeWithKind(node, 298 /* EnumMember */)) {
|
|
87345
87471
|
diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0;
|
|
87346
87472
|
}
|
|
87347
87473
|
if (diagnosticMessage) {
|
|
@@ -87909,7 +88035,10 @@ var ts;
|
|
|
87909
88035
|
return factory.updateInferTypeNode(node, nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration));
|
|
87910
88036
|
case 199 /* ImportType */:
|
|
87911
88037
|
ts.Debug.type(node);
|
|
87912
|
-
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);
|
|
87913
88042
|
case 196 /* NamedTupleMember */:
|
|
87914
88043
|
ts.Debug.type(node);
|
|
87915
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));
|
|
@@ -88216,28 +88345,28 @@ var ts;
|
|
|
88216
88345
|
ts.Debug.type(node);
|
|
88217
88346
|
return factory.updateCatchClause(node, nodeVisitor(node.variableDeclaration, visitor, ts.isVariableDeclaration), nodeVisitor(node.block, visitor, ts.isBlock));
|
|
88218
88347
|
// Property assignments
|
|
88219
|
-
case
|
|
88348
|
+
case 295 /* PropertyAssignment */:
|
|
88220
88349
|
ts.Debug.type(node);
|
|
88221
88350
|
return factory.updatePropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
88222
|
-
case
|
|
88351
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
88223
88352
|
ts.Debug.type(node);
|
|
88224
88353
|
return factory.updateShorthandPropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.objectAssignmentInitializer, visitor, ts.isExpression));
|
|
88225
|
-
case
|
|
88354
|
+
case 297 /* SpreadAssignment */:
|
|
88226
88355
|
ts.Debug.type(node);
|
|
88227
88356
|
return factory.updateSpreadAssignment(node, nodeVisitor(node.expression, visitor, ts.isExpression));
|
|
88228
88357
|
// Enum
|
|
88229
|
-
case
|
|
88358
|
+
case 298 /* EnumMember */:
|
|
88230
88359
|
ts.Debug.type(node);
|
|
88231
88360
|
return factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
88232
88361
|
// Top-level nodes
|
|
88233
|
-
case
|
|
88362
|
+
case 304 /* SourceFile */:
|
|
88234
88363
|
ts.Debug.type(node);
|
|
88235
88364
|
return factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
88236
88365
|
// Transformation nodes
|
|
88237
|
-
case
|
|
88366
|
+
case 349 /* PartiallyEmittedExpression */:
|
|
88238
88367
|
ts.Debug.type(node);
|
|
88239
88368
|
return factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));
|
|
88240
|
-
case
|
|
88369
|
+
case 350 /* CommaListExpression */:
|
|
88241
88370
|
ts.Debug.type(node);
|
|
88242
88371
|
return factory.updateCommaListExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression));
|
|
88243
88372
|
default:
|
|
@@ -88928,7 +89057,7 @@ var ts;
|
|
|
88928
89057
|
function chainBundle(context, transformSourceFile) {
|
|
88929
89058
|
return transformSourceFileOrBundle;
|
|
88930
89059
|
function transformSourceFileOrBundle(node) {
|
|
88931
|
-
return node.kind ===
|
|
89060
|
+
return node.kind === 304 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
|
|
88932
89061
|
}
|
|
88933
89062
|
function transformBundle(node) {
|
|
88934
89063
|
return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends);
|
|
@@ -89882,14 +90011,14 @@ var ts;
|
|
|
89882
90011
|
var applicableSubstitutions;
|
|
89883
90012
|
return transformSourceFileOrBundle;
|
|
89884
90013
|
function transformSourceFileOrBundle(node) {
|
|
89885
|
-
if (node.kind ===
|
|
90014
|
+
if (node.kind === 305 /* Bundle */) {
|
|
89886
90015
|
return transformBundle(node);
|
|
89887
90016
|
}
|
|
89888
90017
|
return transformSourceFile(node);
|
|
89889
90018
|
}
|
|
89890
90019
|
function transformBundle(node) {
|
|
89891
90020
|
return factory.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) {
|
|
89892
|
-
if (prepend.kind ===
|
|
90021
|
+
if (prepend.kind === 307 /* InputFiles */) {
|
|
89893
90022
|
return ts.createUnparsedSourceFile(prepend, "js");
|
|
89894
90023
|
}
|
|
89895
90024
|
return prepend;
|
|
@@ -89940,7 +90069,7 @@ var ts;
|
|
|
89940
90069
|
*/
|
|
89941
90070
|
function onBeforeVisitNode(node) {
|
|
89942
90071
|
switch (node.kind) {
|
|
89943
|
-
case
|
|
90072
|
+
case 304 /* SourceFile */:
|
|
89944
90073
|
case 262 /* CaseBlock */:
|
|
89945
90074
|
case 261 /* ModuleBlock */:
|
|
89946
90075
|
case 234 /* Block */:
|
|
@@ -91162,15 +91291,15 @@ var ts;
|
|
|
91162
91291
|
case 199 /* ImportType */:
|
|
91163
91292
|
break;
|
|
91164
91293
|
// handle JSDoc types from an invalid parse
|
|
91165
|
-
case
|
|
91166
|
-
case
|
|
91167
|
-
case
|
|
91168
|
-
case
|
|
91169
|
-
case
|
|
91294
|
+
case 311 /* JSDocAllType */:
|
|
91295
|
+
case 312 /* JSDocUnknownType */:
|
|
91296
|
+
case 316 /* JSDocFunctionType */:
|
|
91297
|
+
case 317 /* JSDocVariadicType */:
|
|
91298
|
+
case 318 /* JSDocNamepathType */:
|
|
91170
91299
|
break;
|
|
91171
|
-
case
|
|
91172
|
-
case
|
|
91173
|
-
case
|
|
91300
|
+
case 313 /* JSDocNullableType */:
|
|
91301
|
+
case 314 /* JSDocNonNullableType */:
|
|
91302
|
+
case 315 /* JSDocOptionalType */:
|
|
91174
91303
|
return serializeTypeNode(node.type);
|
|
91175
91304
|
default:
|
|
91176
91305
|
return ts.Debug.failBadSyntaxKind(node);
|
|
@@ -91888,7 +92017,7 @@ var ts;
|
|
|
91888
92017
|
// enums in any other scope are emitted as a `let` declaration.
|
|
91889
92018
|
var statement = factory.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), factory.createVariableDeclarationList([
|
|
91890
92019
|
factory.createVariableDeclaration(factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true))
|
|
91891
|
-
], currentLexicalScope.kind ===
|
|
92020
|
+
], currentLexicalScope.kind === 304 /* SourceFile */ ? 0 /* None */ : 1 /* Let */));
|
|
91892
92021
|
ts.setOriginalNode(statement, node);
|
|
91893
92022
|
recordEmittedDeclarationInScope(node);
|
|
91894
92023
|
if (isFirstEmittedDeclarationInScope(node)) {
|
|
@@ -92371,7 +92500,7 @@ var ts;
|
|
|
92371
92500
|
// We need to enable substitutions for identifiers and shorthand property assignments. This allows us to
|
|
92372
92501
|
// substitute the names of exported members of a namespace.
|
|
92373
92502
|
context.enableSubstitution(79 /* Identifier */);
|
|
92374
|
-
context.enableSubstitution(
|
|
92503
|
+
context.enableSubstitution(296 /* ShorthandPropertyAssignment */);
|
|
92375
92504
|
// We need to be notified when entering and exiting namespaces.
|
|
92376
92505
|
context.enableEmitNotification(260 /* ModuleDeclaration */);
|
|
92377
92506
|
}
|
|
@@ -92481,7 +92610,7 @@ var ts;
|
|
|
92481
92610
|
// If we are nested within a namespace declaration, we may need to qualifiy
|
|
92482
92611
|
// an identifier that is exported from a merged namespace.
|
|
92483
92612
|
var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false);
|
|
92484
|
-
if (container && container.kind !==
|
|
92613
|
+
if (container && container.kind !== 304 /* SourceFile */) {
|
|
92485
92614
|
var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 260 /* ModuleDeclaration */) ||
|
|
92486
92615
|
(applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 259 /* EnumDeclaration */);
|
|
92487
92616
|
if (substitute) {
|
|
@@ -92498,6 +92627,9 @@ var ts;
|
|
|
92498
92627
|
function substituteElementAccessExpression(node) {
|
|
92499
92628
|
return substituteConstantValue(node);
|
|
92500
92629
|
}
|
|
92630
|
+
function safeMultiLineComment(value) {
|
|
92631
|
+
return value.replace(/\*\//g, "*_/");
|
|
92632
|
+
}
|
|
92501
92633
|
function substituteConstantValue(node) {
|
|
92502
92634
|
var constantValue = tryGetConstEnumValue(node);
|
|
92503
92635
|
if (constantValue !== undefined) {
|
|
@@ -92508,7 +92640,7 @@ var ts;
|
|
|
92508
92640
|
var originalNode = ts.getOriginalNode(node, ts.isAccessExpression);
|
|
92509
92641
|
var propertyName = ts.isPropertyAccessExpression(originalNode)
|
|
92510
92642
|
? ts.declarationNameToString(originalNode.name)
|
|
92511
|
-
: ts.getTextOfNode(originalNode.argumentExpression);
|
|
92643
|
+
: safeMultiLineComment(ts.getTextOfNode(originalNode.argumentExpression));
|
|
92512
92644
|
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " ");
|
|
92513
92645
|
}
|
|
92514
92646
|
return substitute;
|
|
@@ -94886,7 +95018,7 @@ var ts;
|
|
|
94886
95018
|
return visitObjectLiteralExpression(node);
|
|
94887
95019
|
case 220 /* BinaryExpression */:
|
|
94888
95020
|
return visitBinaryExpression(node, expressionResultIsUnused);
|
|
94889
|
-
case
|
|
95021
|
+
case 350 /* CommaListExpression */:
|
|
94890
95022
|
return visitCommaListExpression(node, expressionResultIsUnused);
|
|
94891
95023
|
case 291 /* CatchClause */:
|
|
94892
95024
|
return visitCatchClause(node);
|
|
@@ -94985,7 +95117,7 @@ var ts;
|
|
|
94985
95117
|
var objects = [];
|
|
94986
95118
|
for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) {
|
|
94987
95119
|
var e = elements_4[_i];
|
|
94988
|
-
if (e.kind ===
|
|
95120
|
+
if (e.kind === 297 /* SpreadAssignment */) {
|
|
94989
95121
|
if (chunkObject) {
|
|
94990
95122
|
objects.push(factory.createObjectLiteralExpression(chunkObject));
|
|
94991
95123
|
chunkObject = undefined;
|
|
@@ -94994,7 +95126,7 @@ var ts;
|
|
|
94994
95126
|
objects.push(ts.visitNode(target, visitor, ts.isExpression));
|
|
94995
95127
|
}
|
|
94996
95128
|
else {
|
|
94997
|
-
chunkObject = ts.append(chunkObject, e.kind ===
|
|
95129
|
+
chunkObject = ts.append(chunkObject, e.kind === 295 /* PropertyAssignment */
|
|
94998
95130
|
? factory.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression))
|
|
94999
95131
|
: ts.visitNode(e, visitor, ts.isObjectLiteralElementLike));
|
|
95000
95132
|
}
|
|
@@ -96982,7 +97114,7 @@ var ts;
|
|
|
96982
97114
|
return visitObjectLiteralExpression(node);
|
|
96983
97115
|
case 291 /* CatchClause */:
|
|
96984
97116
|
return visitCatchClause(node);
|
|
96985
|
-
case
|
|
97117
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
96986
97118
|
return visitShorthandPropertyAssignment(node);
|
|
96987
97119
|
case 161 /* ComputedPropertyName */:
|
|
96988
97120
|
return visitComputedPropertyName(node);
|
|
@@ -96996,7 +97128,7 @@ var ts;
|
|
|
96996
97128
|
return visitParenthesizedExpression(node, expressionResultIsUnused);
|
|
96997
97129
|
case 220 /* BinaryExpression */:
|
|
96998
97130
|
return visitBinaryExpression(node, expressionResultIsUnused);
|
|
96999
|
-
case
|
|
97131
|
+
case 350 /* CommaListExpression */:
|
|
97000
97132
|
return visitCommaListExpression(node, expressionResultIsUnused);
|
|
97001
97133
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
97002
97134
|
case 15 /* TemplateHead */:
|
|
@@ -99197,10 +99329,10 @@ var ts;
|
|
|
99197
99329
|
case 168 /* MethodDeclaration */:
|
|
99198
99330
|
expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine));
|
|
99199
99331
|
break;
|
|
99200
|
-
case
|
|
99332
|
+
case 295 /* PropertyAssignment */:
|
|
99201
99333
|
expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));
|
|
99202
99334
|
break;
|
|
99203
|
-
case
|
|
99335
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
99204
99336
|
expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));
|
|
99205
99337
|
break;
|
|
99206
99338
|
default:
|
|
@@ -99945,7 +100077,7 @@ var ts;
|
|
|
99945
100077
|
var previousOnSubstituteNode = context.onSubstituteNode;
|
|
99946
100078
|
context.onSubstituteNode = onSubstituteNode;
|
|
99947
100079
|
context.enableSubstitution(205 /* PropertyAccessExpression */);
|
|
99948
|
-
context.enableSubstitution(
|
|
100080
|
+
context.enableSubstitution(295 /* PropertyAssignment */);
|
|
99949
100081
|
return ts.chainBundle(context, transformSourceFile);
|
|
99950
100082
|
/**
|
|
99951
100083
|
* Transforms an ES5 source file to ES3.
|
|
@@ -100360,7 +100492,7 @@ var ts;
|
|
|
100360
100492
|
switch (node.kind) {
|
|
100361
100493
|
case 220 /* BinaryExpression */:
|
|
100362
100494
|
return visitBinaryExpression(node);
|
|
100363
|
-
case
|
|
100495
|
+
case 350 /* CommaListExpression */:
|
|
100364
100496
|
return visitCommaListExpression(node);
|
|
100365
100497
|
case 221 /* ConditionalExpression */:
|
|
100366
100498
|
return visitConditionalExpression(node);
|
|
@@ -102638,8 +102770,8 @@ var ts;
|
|
|
102638
102770
|
context.enableSubstitution(209 /* TaggedTemplateExpression */); // Substitute calls to imported/exported symbols to avoid incorrect `this`.
|
|
102639
102771
|
context.enableSubstitution(79 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols.
|
|
102640
102772
|
context.enableSubstitution(220 /* BinaryExpression */); // Substitutes assignments to exported symbols.
|
|
102641
|
-
context.enableSubstitution(
|
|
102642
|
-
context.enableEmitNotification(
|
|
102773
|
+
context.enableSubstitution(296 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols.
|
|
102774
|
+
context.enableEmitNotification(304 /* SourceFile */); // Restore state when substituting nodes in a file.
|
|
102643
102775
|
var moduleInfoMap = []; // The ExternalModuleInfo for each file.
|
|
102644
102776
|
var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found.
|
|
102645
102777
|
var currentSourceFile; // The current file.
|
|
@@ -102981,9 +103113,9 @@ var ts;
|
|
|
102981
103113
|
return visitFunctionDeclaration(node);
|
|
102982
103114
|
case 256 /* ClassDeclaration */:
|
|
102983
103115
|
return visitClassDeclaration(node);
|
|
102984
|
-
case
|
|
103116
|
+
case 351 /* MergeDeclarationMarker */:
|
|
102985
103117
|
return visitMergeDeclarationMarker(node);
|
|
102986
|
-
case
|
|
103118
|
+
case 352 /* EndOfDeclarationMarker */:
|
|
102987
103119
|
return visitEndOfDeclarationMarker(node);
|
|
102988
103120
|
default:
|
|
102989
103121
|
return visitor(node);
|
|
@@ -103002,7 +103134,7 @@ var ts;
|
|
|
103002
103134
|
return visitExpressionStatement(node);
|
|
103003
103135
|
case 211 /* ParenthesizedExpression */:
|
|
103004
103136
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
103005
|
-
case
|
|
103137
|
+
case 349 /* PartiallyEmittedExpression */:
|
|
103006
103138
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
103007
103139
|
case 207 /* CallExpression */:
|
|
103008
103140
|
if (ts.isImportCall(node) && currentSourceFile.impliedNodeFormat === undefined) {
|
|
@@ -103031,17 +103163,17 @@ var ts;
|
|
|
103031
103163
|
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
|
|
103032
103164
|
var elem = _a[_i];
|
|
103033
103165
|
switch (elem.kind) {
|
|
103034
|
-
case
|
|
103166
|
+
case 295 /* PropertyAssignment */:
|
|
103035
103167
|
if (destructuringNeedsFlattening(elem.initializer)) {
|
|
103036
103168
|
return true;
|
|
103037
103169
|
}
|
|
103038
103170
|
break;
|
|
103039
|
-
case
|
|
103171
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
103040
103172
|
if (destructuringNeedsFlattening(elem.name)) {
|
|
103041
103173
|
return true;
|
|
103042
103174
|
}
|
|
103043
103175
|
break;
|
|
103044
|
-
case
|
|
103176
|
+
case 297 /* SpreadAssignment */:
|
|
103045
103177
|
if (destructuringNeedsFlattening(elem.expression)) {
|
|
103046
103178
|
return true;
|
|
103047
103179
|
}
|
|
@@ -103907,7 +104039,7 @@ var ts;
|
|
|
103907
104039
|
* @param emit A callback used to emit the node in the printer.
|
|
103908
104040
|
*/
|
|
103909
104041
|
function onEmitNode(hint, node, emitCallback) {
|
|
103910
|
-
if (node.kind ===
|
|
104042
|
+
if (node.kind === 304 /* SourceFile */) {
|
|
103911
104043
|
currentSourceFile = node;
|
|
103912
104044
|
currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)];
|
|
103913
104045
|
previousOnEmitNode(hint, node, emitCallback);
|
|
@@ -104017,7 +104149,7 @@ var ts;
|
|
|
104017
104149
|
}
|
|
104018
104150
|
else if (!(ts.isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !ts.isLocalName(node)) {
|
|
104019
104151
|
var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node));
|
|
104020
|
-
if (exportContainer && exportContainer.kind ===
|
|
104152
|
+
if (exportContainer && exportContainer.kind === 304 /* SourceFile */) {
|
|
104021
104153
|
return ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.cloneNode(node)),
|
|
104022
104154
|
/*location*/ node);
|
|
104023
104155
|
}
|
|
@@ -104107,10 +104239,10 @@ var ts;
|
|
|
104107
104239
|
context.onSubstituteNode = onSubstituteNode;
|
|
104108
104240
|
context.onEmitNode = onEmitNode;
|
|
104109
104241
|
context.enableSubstitution(79 /* Identifier */); // Substitutes expression identifiers for imported symbols.
|
|
104110
|
-
context.enableSubstitution(
|
|
104242
|
+
context.enableSubstitution(296 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols
|
|
104111
104243
|
context.enableSubstitution(220 /* BinaryExpression */); // Substitutes assignments to exported symbols.
|
|
104112
104244
|
context.enableSubstitution(230 /* MetaProperty */); // Substitutes 'import.meta'
|
|
104113
|
-
context.enableEmitNotification(
|
|
104245
|
+
context.enableEmitNotification(304 /* SourceFile */); // Restore state when substituting nodes in a file.
|
|
104114
104246
|
var moduleInfoMap = []; // The ExternalModuleInfo for each file.
|
|
104115
104247
|
var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found.
|
|
104116
104248
|
var exportFunctionsMap = []; // The export function associated with a source file.
|
|
@@ -104681,7 +104813,7 @@ var ts;
|
|
|
104681
104813
|
function shouldHoistVariableDeclarationList(node) {
|
|
104682
104814
|
// hoist only non-block scoped declarations or block scoped declarations parented by source file
|
|
104683
104815
|
return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0
|
|
104684
|
-
&& (enclosingBlockScopedContainer.kind ===
|
|
104816
|
+
&& (enclosingBlockScopedContainer.kind === 304 /* SourceFile */
|
|
104685
104817
|
|| (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0);
|
|
104686
104818
|
}
|
|
104687
104819
|
/**
|
|
@@ -105024,9 +105156,9 @@ var ts;
|
|
|
105024
105156
|
return visitCatchClause(node);
|
|
105025
105157
|
case 234 /* Block */:
|
|
105026
105158
|
return visitBlock(node);
|
|
105027
|
-
case
|
|
105159
|
+
case 351 /* MergeDeclarationMarker */:
|
|
105028
105160
|
return visitMergeDeclarationMarker(node);
|
|
105029
|
-
case
|
|
105161
|
+
case 352 /* EndOfDeclarationMarker */:
|
|
105030
105162
|
return visitEndOfDeclarationMarker(node);
|
|
105031
105163
|
default:
|
|
105032
105164
|
return visitor(node);
|
|
@@ -105218,7 +105350,7 @@ var ts;
|
|
|
105218
105350
|
return visitExpressionStatement(node);
|
|
105219
105351
|
case 211 /* ParenthesizedExpression */:
|
|
105220
105352
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
105221
|
-
case
|
|
105353
|
+
case 349 /* PartiallyEmittedExpression */:
|
|
105222
105354
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
105223
105355
|
case 220 /* BinaryExpression */:
|
|
105224
105356
|
if (ts.isDestructuringAssignment(node)) {
|
|
@@ -105311,7 +105443,7 @@ var ts;
|
|
|
105311
105443
|
}
|
|
105312
105444
|
else if (ts.isIdentifier(node)) {
|
|
105313
105445
|
var container = resolver.getReferencedExportContainer(node);
|
|
105314
|
-
return container !== undefined && container.kind ===
|
|
105446
|
+
return container !== undefined && container.kind === 304 /* SourceFile */;
|
|
105315
105447
|
}
|
|
105316
105448
|
else {
|
|
105317
105449
|
return false;
|
|
@@ -105389,7 +105521,7 @@ var ts;
|
|
|
105389
105521
|
* @param emitCallback A callback used to emit the node in the printer.
|
|
105390
105522
|
*/
|
|
105391
105523
|
function onEmitNode(hint, node, emitCallback) {
|
|
105392
|
-
if (node.kind ===
|
|
105524
|
+
if (node.kind === 304 /* SourceFile */) {
|
|
105393
105525
|
var id = ts.getOriginalNodeId(node);
|
|
105394
105526
|
currentSourceFile = node;
|
|
105395
105527
|
moduleInfo = moduleInfoMap[id];
|
|
@@ -105439,7 +105571,7 @@ var ts;
|
|
|
105439
105571
|
*/
|
|
105440
105572
|
function substituteUnspecified(node) {
|
|
105441
105573
|
switch (node.kind) {
|
|
105442
|
-
case
|
|
105574
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
105443
105575
|
return substituteShorthandPropertyAssignment(node);
|
|
105444
105576
|
}
|
|
105445
105577
|
return node;
|
|
@@ -105568,7 +105700,7 @@ var ts;
|
|
|
105568
105700
|
|| resolver.getReferencedValueDeclaration(name);
|
|
105569
105701
|
if (valueDeclaration) {
|
|
105570
105702
|
var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false);
|
|
105571
|
-
if (exportContainer && exportContainer.kind ===
|
|
105703
|
+
if (exportContainer && exportContainer.kind === 304 /* SourceFile */) {
|
|
105572
105704
|
exportedNames = ts.append(exportedNames, factory.getDeclarationName(valueDeclaration));
|
|
105573
105705
|
}
|
|
105574
105706
|
exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]);
|
|
@@ -105611,7 +105743,7 @@ var ts;
|
|
|
105611
105743
|
var previousOnSubstituteNode = context.onSubstituteNode;
|
|
105612
105744
|
context.onEmitNode = onEmitNode;
|
|
105613
105745
|
context.onSubstituteNode = onSubstituteNode;
|
|
105614
|
-
context.enableEmitNotification(
|
|
105746
|
+
context.enableEmitNotification(304 /* SourceFile */);
|
|
105615
105747
|
context.enableSubstitution(79 /* Identifier */);
|
|
105616
105748
|
var helperNameSubstitutions;
|
|
105617
105749
|
var currentSourceFile;
|
|
@@ -105819,8 +105951,8 @@ var ts;
|
|
|
105819
105951
|
var cjsOnEmitNode = context.onEmitNode;
|
|
105820
105952
|
context.onSubstituteNode = onSubstituteNode;
|
|
105821
105953
|
context.onEmitNode = onEmitNode;
|
|
105822
|
-
context.enableSubstitution(
|
|
105823
|
-
context.enableEmitNotification(
|
|
105954
|
+
context.enableSubstitution(304 /* SourceFile */);
|
|
105955
|
+
context.enableEmitNotification(304 /* SourceFile */);
|
|
105824
105956
|
var currentSourceFile;
|
|
105825
105957
|
return transformSourceFileOrBundle;
|
|
105826
105958
|
function onSubstituteNode(hint, node) {
|
|
@@ -105867,7 +105999,7 @@ var ts;
|
|
|
105867
105999
|
return result;
|
|
105868
106000
|
}
|
|
105869
106001
|
function transformSourceFileOrBundle(node) {
|
|
105870
|
-
return node.kind ===
|
|
106002
|
+
return node.kind === 304 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
|
|
105871
106003
|
}
|
|
105872
106004
|
function transformBundle(node) {
|
|
105873
106005
|
return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends);
|
|
@@ -106516,10 +106648,10 @@ var ts;
|
|
|
106516
106648
|
return result;
|
|
106517
106649
|
}
|
|
106518
106650
|
function transformRoot(node) {
|
|
106519
|
-
if (node.kind ===
|
|
106651
|
+
if (node.kind === 304 /* SourceFile */ && node.isDeclarationFile) {
|
|
106520
106652
|
return node;
|
|
106521
106653
|
}
|
|
106522
|
-
if (node.kind ===
|
|
106654
|
+
if (node.kind === 305 /* Bundle */) {
|
|
106523
106655
|
isBundledEmit = true;
|
|
106524
106656
|
refs = new ts.Map();
|
|
106525
106657
|
libs = new ts.Map();
|
|
@@ -106549,7 +106681,7 @@ var ts;
|
|
|
106549
106681
|
var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
|
|
106550
106682
|
return factory.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []);
|
|
106551
106683
|
}), ts.mapDefined(node.prepends, function (prepend) {
|
|
106552
|
-
if (prepend.kind ===
|
|
106684
|
+
if (prepend.kind === 307 /* InputFiles */) {
|
|
106553
106685
|
var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal);
|
|
106554
106686
|
hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib;
|
|
106555
106687
|
collectReferences(sourceFile, refs);
|
|
@@ -106921,34 +107053,31 @@ var ts;
|
|
|
106921
107053
|
if (!decl.importClause) {
|
|
106922
107054
|
// import "mod" - possibly needed for side effects? (global interface patches, module augmentations, etc)
|
|
106923
107055
|
return factory.updateImportDeclaration(decl,
|
|
106924
|
-
/*decorators*/ undefined, decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
106925
|
-
/*assertClause*/ undefined);
|
|
107056
|
+
/*decorators*/ undefined, decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
|
|
106926
107057
|
}
|
|
106927
107058
|
// The `importClause` visibility corresponds to the default's visibility.
|
|
106928
107059
|
var visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : undefined;
|
|
106929
107060
|
if (!decl.importClause.namedBindings) {
|
|
106930
107061
|
// No named bindings (either namespace or list), meaning the import is just default or should be elided
|
|
106931
107062
|
return visibleDefaultBinding && factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding,
|
|
106932
|
-
/*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107063
|
+
/*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
|
|
106933
107064
|
}
|
|
106934
107065
|
if (decl.importClause.namedBindings.kind === 267 /* NamespaceImport */) {
|
|
106935
107066
|
// Namespace import (optionally with visible default)
|
|
106936
107067
|
var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined;
|
|
106937
|
-
return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107068
|
+
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;
|
|
106938
107069
|
}
|
|
106939
107070
|
// Named imports (optionally with visible default)
|
|
106940
107071
|
var bindingList = ts.mapDefined(decl.importClause.namedBindings.elements, function (b) { return resolver.isDeclarationVisible(b) ? b : undefined; });
|
|
106941
107072
|
if ((bindingList && bindingList.length) || visibleDefaultBinding) {
|
|
106942
107073
|
return factory.updateImportDeclaration(decl,
|
|
106943
|
-
/*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),
|
|
106944
|
-
/*assertClause*/ undefined);
|
|
107074
|
+
/*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);
|
|
106945
107075
|
}
|
|
106946
107076
|
// Augmentation of export depends on import
|
|
106947
107077
|
if (resolver.isImportRequiredByAugmentation(decl)) {
|
|
106948
107078
|
return factory.updateImportDeclaration(decl,
|
|
106949
107079
|
/*decorators*/ undefined, decl.modifiers,
|
|
106950
|
-
/*importClause*/ undefined, rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
106951
|
-
/*assertClause*/ undefined);
|
|
107080
|
+
/*importClause*/ undefined, rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
|
|
106952
107081
|
}
|
|
106953
107082
|
// Nothing visible
|
|
106954
107083
|
}
|
|
@@ -107157,7 +107286,7 @@ var ts;
|
|
|
107157
107286
|
case 199 /* ImportType */: {
|
|
107158
107287
|
if (!ts.isLiteralImportTypeNode(input))
|
|
107159
107288
|
return cleanup(input);
|
|
107160
|
-
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));
|
|
107289
|
+
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));
|
|
107161
107290
|
}
|
|
107162
107291
|
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: " + ts.SyntaxKind[input.kind]);
|
|
107163
107292
|
}
|
|
@@ -107204,8 +107333,7 @@ var ts;
|
|
|
107204
107333
|
// Always visible if the parent node isn't dropped for being not visible
|
|
107205
107334
|
// Rewrite external module names if necessary
|
|
107206
107335
|
return factory.updateExportDeclaration(input,
|
|
107207
|
-
/*decorators*/ undefined, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier),
|
|
107208
|
-
/*assertClause*/ undefined);
|
|
107336
|
+
/*decorators*/ undefined, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), ts.getResolutionModeOverrideForClause(input.assertClause) ? input.assertClause : undefined);
|
|
107209
107337
|
}
|
|
107210
107338
|
case 270 /* ExportAssignment */: {
|
|
107211
107339
|
// Always visible if the parent node isn't dropped for being not visible
|
|
@@ -107572,7 +107700,7 @@ var ts;
|
|
|
107572
107700
|
function ensureModifierFlags(node) {
|
|
107573
107701
|
var mask = 27647 /* All */ ^ (4 /* Public */ | 256 /* Async */ | 16384 /* Override */); // No async and override modifiers in declaration files
|
|
107574
107702
|
var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */;
|
|
107575
|
-
var parentIsFile = node.parent.kind ===
|
|
107703
|
+
var parentIsFile = node.parent.kind === 304 /* SourceFile */;
|
|
107576
107704
|
if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) {
|
|
107577
107705
|
mask ^= 2 /* Ambient */;
|
|
107578
107706
|
additions = 0 /* None */;
|
|
@@ -107819,7 +107947,7 @@ var ts;
|
|
|
107819
107947
|
* @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files.
|
|
107820
107948
|
*/
|
|
107821
107949
|
function transformNodes(resolver, host, factory, options, nodes, transformers, allowDtsFiles) {
|
|
107822
|
-
var enabledSyntaxKindFeatures = new Array(
|
|
107950
|
+
var enabledSyntaxKindFeatures = new Array(354 /* Count */);
|
|
107823
107951
|
var lexicalEnvironmentVariableDeclarations;
|
|
107824
107952
|
var lexicalEnvironmentFunctionDeclarations;
|
|
107825
107953
|
var lexicalEnvironmentStatements;
|
|
@@ -107901,7 +108029,7 @@ var ts;
|
|
|
107901
108029
|
var transformed = [];
|
|
107902
108030
|
for (var _a = 0, nodes_3 = nodes; _a < nodes_3.length; _a++) {
|
|
107903
108031
|
var node = nodes_3[_a];
|
|
107904
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("emit" /* Emit */, "transformNodes", node.kind ===
|
|
108032
|
+
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 });
|
|
107905
108033
|
transformed.push((allowDtsFiles ? transformation : transformRoot)(node));
|
|
107906
108034
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
107907
108035
|
}
|
|
@@ -108307,7 +108435,7 @@ var ts;
|
|
|
108307
108435
|
/*@internal*/
|
|
108308
108436
|
function getOutputPathsFor(sourceFile, host, forceDtsPaths) {
|
|
108309
108437
|
var options = host.getCompilerOptions();
|
|
108310
|
-
if (sourceFile.kind ===
|
|
108438
|
+
if (sourceFile.kind === 305 /* Bundle */) {
|
|
108311
108439
|
return getOutputPathsForBundle(options, forceDtsPaths);
|
|
108312
108440
|
}
|
|
108313
108441
|
else {
|
|
@@ -108656,7 +108784,7 @@ var ts;
|
|
|
108656
108784
|
extendedDiagnostics: compilerOptions.extendedDiagnostics,
|
|
108657
108785
|
// Explicitly do not passthru either `inline` option
|
|
108658
108786
|
});
|
|
108659
|
-
if (forceDtsEmit && declarationTransform.transformed[0].kind ===
|
|
108787
|
+
if (forceDtsEmit && declarationTransform.transformed[0].kind === 304 /* SourceFile */) {
|
|
108660
108788
|
var sourceFile = declarationTransform.transformed[0];
|
|
108661
108789
|
exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit;
|
|
108662
108790
|
}
|
|
@@ -108679,8 +108807,8 @@ var ts;
|
|
|
108679
108807
|
ts.forEachChild(node, collectLinkedAliases);
|
|
108680
108808
|
}
|
|
108681
108809
|
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) {
|
|
108682
|
-
var bundle = sourceFileOrBundle.kind ===
|
|
108683
|
-
var sourceFile = sourceFileOrBundle.kind ===
|
|
108810
|
+
var bundle = sourceFileOrBundle.kind === 305 /* Bundle */ ? sourceFileOrBundle : undefined;
|
|
108811
|
+
var sourceFile = sourceFileOrBundle.kind === 304 /* SourceFile */ ? sourceFileOrBundle : undefined;
|
|
108684
108812
|
var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile];
|
|
108685
108813
|
var sourceMapGenerator;
|
|
108686
108814
|
if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) {
|
|
@@ -108721,7 +108849,7 @@ var ts;
|
|
|
108721
108849
|
}
|
|
108722
108850
|
function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
|
|
108723
108851
|
return (mapOptions.sourceMap || mapOptions.inlineSourceMap)
|
|
108724
|
-
&& (sourceFileOrBundle.kind !==
|
|
108852
|
+
&& (sourceFileOrBundle.kind !== 304 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */));
|
|
108725
108853
|
}
|
|
108726
108854
|
function getSourceRoot(mapOptions) {
|
|
108727
108855
|
// Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the
|
|
@@ -109032,9 +109160,9 @@ var ts;
|
|
|
109032
109160
|
break;
|
|
109033
109161
|
}
|
|
109034
109162
|
switch (node.kind) {
|
|
109035
|
-
case
|
|
109036
|
-
case
|
|
109037
|
-
case
|
|
109163
|
+
case 304 /* SourceFile */: return printFile(node);
|
|
109164
|
+
case 305 /* Bundle */: return printBundle(node);
|
|
109165
|
+
case 306 /* UnparsedSource */: return printUnparsedSource(node);
|
|
109038
109166
|
}
|
|
109039
109167
|
writeNode(hint, node, sourceFile, beginPrint());
|
|
109040
109168
|
return endPrint();
|
|
@@ -109583,100 +109711,100 @@ var ts;
|
|
|
109583
109711
|
case 291 /* CatchClause */:
|
|
109584
109712
|
return emitCatchClause(node);
|
|
109585
109713
|
// Property assignments
|
|
109586
|
-
case
|
|
109714
|
+
case 295 /* PropertyAssignment */:
|
|
109587
109715
|
return emitPropertyAssignment(node);
|
|
109588
|
-
case
|
|
109716
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
109589
109717
|
return emitShorthandPropertyAssignment(node);
|
|
109590
|
-
case
|
|
109718
|
+
case 297 /* SpreadAssignment */:
|
|
109591
109719
|
return emitSpreadAssignment(node);
|
|
109592
109720
|
// Enum
|
|
109593
|
-
case
|
|
109721
|
+
case 298 /* EnumMember */:
|
|
109594
109722
|
return emitEnumMember(node);
|
|
109595
109723
|
// Unparsed
|
|
109596
|
-
case
|
|
109724
|
+
case 299 /* UnparsedPrologue */:
|
|
109597
109725
|
return writeUnparsedNode(node);
|
|
109598
|
-
case
|
|
109599
|
-
case
|
|
109726
|
+
case 306 /* UnparsedSource */:
|
|
109727
|
+
case 300 /* UnparsedPrepend */:
|
|
109600
109728
|
return emitUnparsedSourceOrPrepend(node);
|
|
109601
|
-
case
|
|
109602
|
-
case
|
|
109729
|
+
case 301 /* UnparsedText */:
|
|
109730
|
+
case 302 /* UnparsedInternalText */:
|
|
109603
109731
|
return emitUnparsedTextLike(node);
|
|
109604
|
-
case
|
|
109732
|
+
case 303 /* UnparsedSyntheticReference */:
|
|
109605
109733
|
return emitUnparsedSyntheticReference(node);
|
|
109606
109734
|
// Top-level nodes
|
|
109607
|
-
case
|
|
109735
|
+
case 304 /* SourceFile */:
|
|
109608
109736
|
return emitSourceFile(node);
|
|
109609
|
-
case
|
|
109737
|
+
case 305 /* Bundle */:
|
|
109610
109738
|
return ts.Debug.fail("Bundles should be printed using printBundle");
|
|
109611
109739
|
// SyntaxKind.UnparsedSource (handled above)
|
|
109612
|
-
case
|
|
109740
|
+
case 307 /* InputFiles */:
|
|
109613
109741
|
return ts.Debug.fail("InputFiles should not be printed");
|
|
109614
109742
|
// JSDoc nodes (only used in codefixes currently)
|
|
109615
|
-
case
|
|
109743
|
+
case 308 /* JSDocTypeExpression */:
|
|
109616
109744
|
return emitJSDocTypeExpression(node);
|
|
109617
|
-
case
|
|
109745
|
+
case 309 /* JSDocNameReference */:
|
|
109618
109746
|
return emitJSDocNameReference(node);
|
|
109619
|
-
case
|
|
109747
|
+
case 311 /* JSDocAllType */:
|
|
109620
109748
|
return writePunctuation("*");
|
|
109621
|
-
case
|
|
109749
|
+
case 312 /* JSDocUnknownType */:
|
|
109622
109750
|
return writePunctuation("?");
|
|
109623
|
-
case
|
|
109751
|
+
case 313 /* JSDocNullableType */:
|
|
109624
109752
|
return emitJSDocNullableType(node);
|
|
109625
|
-
case
|
|
109753
|
+
case 314 /* JSDocNonNullableType */:
|
|
109626
109754
|
return emitJSDocNonNullableType(node);
|
|
109627
|
-
case
|
|
109755
|
+
case 315 /* JSDocOptionalType */:
|
|
109628
109756
|
return emitJSDocOptionalType(node);
|
|
109629
|
-
case
|
|
109757
|
+
case 316 /* JSDocFunctionType */:
|
|
109630
109758
|
return emitJSDocFunctionType(node);
|
|
109631
109759
|
case 185 /* RestType */:
|
|
109632
|
-
case
|
|
109760
|
+
case 317 /* JSDocVariadicType */:
|
|
109633
109761
|
return emitRestOrJSDocVariadicType(node);
|
|
109634
|
-
case
|
|
109762
|
+
case 318 /* JSDocNamepathType */:
|
|
109635
109763
|
return;
|
|
109636
|
-
case
|
|
109764
|
+
case 319 /* JSDocComment */:
|
|
109637
109765
|
return emitJSDoc(node);
|
|
109638
|
-
case
|
|
109766
|
+
case 321 /* JSDocTypeLiteral */:
|
|
109639
109767
|
return emitJSDocTypeLiteral(node);
|
|
109640
|
-
case
|
|
109768
|
+
case 322 /* JSDocSignature */:
|
|
109641
109769
|
return emitJSDocSignature(node);
|
|
109642
|
-
case
|
|
109643
|
-
case
|
|
109644
|
-
case
|
|
109770
|
+
case 326 /* JSDocTag */:
|
|
109771
|
+
case 331 /* JSDocClassTag */:
|
|
109772
|
+
case 336 /* JSDocOverrideTag */:
|
|
109645
109773
|
return emitJSDocSimpleTag(node);
|
|
109646
|
-
case
|
|
109647
|
-
case
|
|
109774
|
+
case 327 /* JSDocAugmentsTag */:
|
|
109775
|
+
case 328 /* JSDocImplementsTag */:
|
|
109648
109776
|
return emitJSDocHeritageTag(node);
|
|
109649
|
-
case
|
|
109650
|
-
case
|
|
109777
|
+
case 329 /* JSDocAuthorTag */:
|
|
109778
|
+
case 330 /* JSDocDeprecatedTag */:
|
|
109651
109779
|
return;
|
|
109652
109780
|
// SyntaxKind.JSDocClassTag (see JSDocTag, above)
|
|
109653
|
-
case
|
|
109654
|
-
case
|
|
109655
|
-
case
|
|
109656
|
-
case
|
|
109781
|
+
case 332 /* JSDocPublicTag */:
|
|
109782
|
+
case 333 /* JSDocPrivateTag */:
|
|
109783
|
+
case 334 /* JSDocProtectedTag */:
|
|
109784
|
+
case 335 /* JSDocReadonlyTag */:
|
|
109657
109785
|
return;
|
|
109658
|
-
case
|
|
109786
|
+
case 337 /* JSDocCallbackTag */:
|
|
109659
109787
|
return emitJSDocCallbackTag(node);
|
|
109660
109788
|
// SyntaxKind.JSDocEnumTag (see below)
|
|
109661
|
-
case
|
|
109662
|
-
case
|
|
109789
|
+
case 339 /* JSDocParameterTag */:
|
|
109790
|
+
case 346 /* JSDocPropertyTag */:
|
|
109663
109791
|
return emitJSDocPropertyLikeTag(node);
|
|
109664
|
-
case
|
|
109665
|
-
case
|
|
109666
|
-
case
|
|
109667
|
-
case
|
|
109792
|
+
case 338 /* JSDocEnumTag */:
|
|
109793
|
+
case 340 /* JSDocReturnTag */:
|
|
109794
|
+
case 341 /* JSDocThisTag */:
|
|
109795
|
+
case 342 /* JSDocTypeTag */:
|
|
109668
109796
|
return emitJSDocSimpleTypedTag(node);
|
|
109669
|
-
case
|
|
109797
|
+
case 343 /* JSDocTemplateTag */:
|
|
109670
109798
|
return emitJSDocTemplateTag(node);
|
|
109671
|
-
case
|
|
109799
|
+
case 344 /* JSDocTypedefTag */:
|
|
109672
109800
|
return emitJSDocTypedefTag(node);
|
|
109673
|
-
case
|
|
109801
|
+
case 345 /* JSDocSeeTag */:
|
|
109674
109802
|
return emitJSDocSeeTag(node);
|
|
109675
109803
|
// SyntaxKind.JSDocPropertyTag (see JSDocParameterTag, above)
|
|
109676
109804
|
// Transformation nodes
|
|
109677
|
-
case
|
|
109678
|
-
case
|
|
109679
|
-
case
|
|
109805
|
+
case 348 /* NotEmittedStatement */:
|
|
109806
|
+
case 352 /* EndOfDeclarationMarker */:
|
|
109807
|
+
case 351 /* MergeDeclarationMarker */:
|
|
109680
109808
|
return;
|
|
109681
109809
|
}
|
|
109682
109810
|
if (ts.isExpression(node)) {
|
|
@@ -109774,19 +109902,19 @@ var ts;
|
|
|
109774
109902
|
case 281 /* JsxFragment */:
|
|
109775
109903
|
return emitJsxFragment(node);
|
|
109776
109904
|
// Synthesized list
|
|
109777
|
-
case
|
|
109905
|
+
case 347 /* SyntaxList */:
|
|
109778
109906
|
return ts.Debug.fail("SyntaxList should not be printed");
|
|
109779
109907
|
// Transformation nodes
|
|
109780
|
-
case
|
|
109908
|
+
case 348 /* NotEmittedStatement */:
|
|
109781
109909
|
return;
|
|
109782
|
-
case
|
|
109910
|
+
case 349 /* PartiallyEmittedExpression */:
|
|
109783
109911
|
return emitPartiallyEmittedExpression(node);
|
|
109784
|
-
case
|
|
109912
|
+
case 350 /* CommaListExpression */:
|
|
109785
109913
|
return emitCommaList(node);
|
|
109786
|
-
case
|
|
109787
|
-
case
|
|
109914
|
+
case 351 /* MergeDeclarationMarker */:
|
|
109915
|
+
case 352 /* EndOfDeclarationMarker */:
|
|
109788
109916
|
return;
|
|
109789
|
-
case
|
|
109917
|
+
case 353 /* SyntheticReferenceExpression */:
|
|
109790
109918
|
return ts.Debug.fail("SyntheticReferenceExpression should not be printed");
|
|
109791
109919
|
}
|
|
109792
109920
|
}
|
|
@@ -109834,7 +109962,7 @@ var ts;
|
|
|
109834
109962
|
}
|
|
109835
109963
|
function emitHelpers(node) {
|
|
109836
109964
|
var helpersEmitted = false;
|
|
109837
|
-
var bundle = node.kind ===
|
|
109965
|
+
var bundle = node.kind === 305 /* Bundle */ ? node : undefined;
|
|
109838
109966
|
if (bundle && moduleKind === ts.ModuleKind.None) {
|
|
109839
109967
|
return;
|
|
109840
109968
|
}
|
|
@@ -109934,7 +110062,7 @@ var ts;
|
|
|
109934
110062
|
var pos = getTextPosWithWriteLine();
|
|
109935
110063
|
writeUnparsedNode(unparsed);
|
|
109936
110064
|
if (bundleFileInfo) {
|
|
109937
|
-
updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind ===
|
|
110065
|
+
updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 301 /* UnparsedText */ ?
|
|
109938
110066
|
"text" /* Text */ :
|
|
109939
110067
|
"internal" /* Internal */);
|
|
109940
110068
|
}
|
|
@@ -110032,7 +110160,7 @@ var ts;
|
|
|
110032
110160
|
emit(node.dotDotDotToken);
|
|
110033
110161
|
emitNodeWithWriter(node.name, writeParameter);
|
|
110034
110162
|
emit(node.questionToken);
|
|
110035
|
-
if (node.parent && node.parent.kind ===
|
|
110163
|
+
if (node.parent && node.parent.kind === 316 /* JSDocFunctionType */ && !node.name) {
|
|
110036
110164
|
emit(node.type);
|
|
110037
110165
|
}
|
|
110038
110166
|
else {
|
|
@@ -110346,6 +110474,19 @@ var ts;
|
|
|
110346
110474
|
writeKeyword("import");
|
|
110347
110475
|
writePunctuation("(");
|
|
110348
110476
|
emit(node.argument);
|
|
110477
|
+
if (node.assertions) {
|
|
110478
|
+
writePunctuation(",");
|
|
110479
|
+
writeSpace();
|
|
110480
|
+
writePunctuation("{");
|
|
110481
|
+
writeSpace();
|
|
110482
|
+
writeKeyword("assert");
|
|
110483
|
+
writePunctuation(":");
|
|
110484
|
+
writeSpace();
|
|
110485
|
+
var elements = node.assertions.assertClause.elements;
|
|
110486
|
+
emitList(node.assertions.assertClause, elements, 526226 /* ImportClauseEntries */);
|
|
110487
|
+
writeSpace();
|
|
110488
|
+
writePunctuation("}");
|
|
110489
|
+
}
|
|
110349
110490
|
writePunctuation(")");
|
|
110350
110491
|
if (node.qualifier) {
|
|
110351
110492
|
writePunctuation(".");
|
|
@@ -111561,7 +111702,7 @@ var ts;
|
|
|
111561
111702
|
}
|
|
111562
111703
|
}
|
|
111563
111704
|
if (node.tags) {
|
|
111564
|
-
if (node.tags.length === 1 && node.tags[0].kind ===
|
|
111705
|
+
if (node.tags.length === 1 && node.tags[0].kind === 342 /* JSDocTypeTag */ && !node.comment) {
|
|
111565
111706
|
writeSpace();
|
|
111566
111707
|
emit(node.tags[0]);
|
|
111567
111708
|
}
|
|
@@ -111606,7 +111747,7 @@ var ts;
|
|
|
111606
111747
|
function emitJSDocTypedefTag(tag) {
|
|
111607
111748
|
emitJSDocTagName(tag.tagName);
|
|
111608
111749
|
if (tag.typeExpression) {
|
|
111609
|
-
if (tag.typeExpression.kind ===
|
|
111750
|
+
if (tag.typeExpression.kind === 308 /* JSDocTypeExpression */) {
|
|
111610
111751
|
emitJSDocTypeExpression(tag.typeExpression);
|
|
111611
111752
|
}
|
|
111612
111753
|
else {
|
|
@@ -111625,7 +111766,7 @@ var ts;
|
|
|
111625
111766
|
emit(tag.fullName);
|
|
111626
111767
|
}
|
|
111627
111768
|
emitJSDocComment(tag.comment);
|
|
111628
|
-
if (tag.typeExpression && tag.typeExpression.kind ===
|
|
111769
|
+
if (tag.typeExpression && tag.typeExpression.kind === 321 /* JSDocTypeLiteral */) {
|
|
111629
111770
|
emitJSDocTypeLiteral(tag.typeExpression);
|
|
111630
111771
|
}
|
|
111631
111772
|
}
|
|
@@ -112685,8 +112826,8 @@ var ts;
|
|
|
112685
112826
|
if (!node)
|
|
112686
112827
|
return;
|
|
112687
112828
|
switch (node.kind) {
|
|
112688
|
-
case
|
|
112689
|
-
case
|
|
112829
|
+
case 295 /* PropertyAssignment */:
|
|
112830
|
+
case 296 /* ShorthandPropertyAssignment */:
|
|
112690
112831
|
case 166 /* PropertyDeclaration */:
|
|
112691
112832
|
case 168 /* MethodDeclaration */:
|
|
112692
112833
|
case 171 /* GetAccessor */:
|
|
@@ -112973,7 +113114,7 @@ var ts;
|
|
|
112973
113114
|
// Emit leading comments if the position is not synthesized and the node
|
|
112974
113115
|
// has not opted out from emitting leading comments.
|
|
112975
113116
|
if (!skipLeadingComments) {
|
|
112976
|
-
emitLeadingComments(pos, /*isEmittedNode*/ node.kind !==
|
|
113117
|
+
emitLeadingComments(pos, /*isEmittedNode*/ node.kind !== 348 /* NotEmittedStatement */);
|
|
112977
113118
|
}
|
|
112978
113119
|
if (!skipLeadingComments || (pos >= 0 && (emitFlags & 512 /* NoLeadingComments */) !== 0)) {
|
|
112979
113120
|
// Advance the container position if comments get emitted or if they've been disabled explicitly using NoLeadingComments.
|
|
@@ -113003,7 +113144,7 @@ var ts;
|
|
|
113003
113144
|
declarationListContainerEnd = savedDeclarationListContainerEnd;
|
|
113004
113145
|
// Emit trailing comments if the position is not synthesized and the node
|
|
113005
113146
|
// has not opted out from emitting leading comments and is an emitted node.
|
|
113006
|
-
if (!skipTrailingComments && node.kind !==
|
|
113147
|
+
if (!skipTrailingComments && node.kind !== 348 /* NotEmittedStatement */) {
|
|
113007
113148
|
emitTrailingComments(end);
|
|
113008
113149
|
}
|
|
113009
113150
|
}
|
|
@@ -113278,7 +113419,7 @@ var ts;
|
|
|
113278
113419
|
}
|
|
113279
113420
|
else {
|
|
113280
113421
|
var source = sourceMapRange.source || sourceMapSource;
|
|
113281
|
-
if (node.kind !==
|
|
113422
|
+
if (node.kind !== 348 /* NotEmittedStatement */
|
|
113282
113423
|
&& (emitFlags & 16 /* NoLeadingSourceMap */) === 0
|
|
113283
113424
|
&& sourceMapRange.pos >= 0) {
|
|
113284
113425
|
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
|
|
@@ -113296,7 +113437,7 @@ var ts;
|
|
|
113296
113437
|
if (emitFlags & 64 /* NoNestedSourceMaps */) {
|
|
113297
113438
|
sourceMapsDisabled = false;
|
|
113298
113439
|
}
|
|
113299
|
-
if (node.kind !==
|
|
113440
|
+
if (node.kind !== 348 /* NotEmittedStatement */
|
|
113300
113441
|
&& (emitFlags & 32 /* NoTrailingSourceMap */) === 0
|
|
113301
113442
|
&& sourceMapRange.end >= 0) {
|
|
113302
113443
|
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
|
|
@@ -114419,21 +114560,72 @@ var ts;
|
|
|
114419
114560
|
}
|
|
114420
114561
|
ts.getModeForResolutionAtIndex = getModeForResolutionAtIndex;
|
|
114421
114562
|
/* @internal */
|
|
114422
|
-
function
|
|
114563
|
+
function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
114423
114564
|
var _a;
|
|
114565
|
+
if (ts.isExportDeclaration(decl)) {
|
|
114566
|
+
return decl.isTypeOnly;
|
|
114567
|
+
}
|
|
114568
|
+
if ((_a = decl.importClause) === null || _a === void 0 ? void 0 : _a.isTypeOnly) {
|
|
114569
|
+
return true;
|
|
114570
|
+
}
|
|
114571
|
+
return false;
|
|
114572
|
+
}
|
|
114573
|
+
ts.isExclusivelyTypeOnlyImportOrExport = isExclusivelyTypeOnlyImportOrExport;
|
|
114574
|
+
/* @internal */
|
|
114575
|
+
function getModeForUsageLocation(file, usage) {
|
|
114576
|
+
var _a, _b;
|
|
114424
114577
|
if (file.impliedNodeFormat === undefined)
|
|
114425
114578
|
return undefined;
|
|
114579
|
+
if ((ts.isImportDeclaration(usage.parent) || ts.isExportDeclaration(usage.parent))) {
|
|
114580
|
+
var isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
114581
|
+
if (isTypeOnly) {
|
|
114582
|
+
var override = getResolutionModeOverrideForClause(usage.parent.assertClause);
|
|
114583
|
+
if (override) {
|
|
114584
|
+
return override;
|
|
114585
|
+
}
|
|
114586
|
+
}
|
|
114587
|
+
}
|
|
114588
|
+
if (usage.parent.parent && ts.isImportTypeNode(usage.parent.parent)) {
|
|
114589
|
+
var override = getResolutionModeOverrideForClause((_a = usage.parent.parent.assertions) === null || _a === void 0 ? void 0 : _a.assertClause);
|
|
114590
|
+
if (override) {
|
|
114591
|
+
return override;
|
|
114592
|
+
}
|
|
114593
|
+
}
|
|
114426
114594
|
if (file.impliedNodeFormat !== ts.ModuleKind.ESNext) {
|
|
114427
114595
|
// in cjs files, import call expressions are esm format, otherwise everything is cjs
|
|
114428
114596
|
return ts.isImportCall(ts.walkUpParenthesizedExpressions(usage.parent)) ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS;
|
|
114429
114597
|
}
|
|
114430
114598
|
// in esm files, import=require statements are cjs format, otherwise everything is esm
|
|
114431
114599
|
// imports are only parent'd up to their containing declaration/expression, so access farther parents with care
|
|
114432
|
-
var exprParentParent = (
|
|
114600
|
+
var exprParentParent = (_b = ts.walkUpParenthesizedExpressions(usage.parent)) === null || _b === void 0 ? void 0 : _b.parent;
|
|
114433
114601
|
return exprParentParent && ts.isImportEqualsDeclaration(exprParentParent) ? ts.ModuleKind.CommonJS : ts.ModuleKind.ESNext;
|
|
114434
114602
|
}
|
|
114435
114603
|
ts.getModeForUsageLocation = getModeForUsageLocation;
|
|
114436
114604
|
/* @internal */
|
|
114605
|
+
function getResolutionModeOverrideForClause(clause, grammarErrorOnNode) {
|
|
114606
|
+
if (!clause)
|
|
114607
|
+
return undefined;
|
|
114608
|
+
if (ts.length(clause.elements) !== 1) {
|
|
114609
|
+
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);
|
|
114610
|
+
return undefined;
|
|
114611
|
+
}
|
|
114612
|
+
var elem = clause.elements[0];
|
|
114613
|
+
if (!ts.isStringLiteralLike(elem.name))
|
|
114614
|
+
return undefined;
|
|
114615
|
+
if (elem.name.text !== "resolution-mode") {
|
|
114616
|
+
grammarErrorOnNode === null || grammarErrorOnNode === void 0 ? void 0 : grammarErrorOnNode(elem.name, ts.Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions);
|
|
114617
|
+
return undefined;
|
|
114618
|
+
}
|
|
114619
|
+
if (!ts.isStringLiteralLike(elem.value))
|
|
114620
|
+
return undefined;
|
|
114621
|
+
if (elem.value.text !== "import" && elem.value.text !== "require") {
|
|
114622
|
+
grammarErrorOnNode === null || grammarErrorOnNode === void 0 ? void 0 : grammarErrorOnNode(elem.value, ts.Diagnostics.resolution_mode_should_be_either_require_or_import);
|
|
114623
|
+
return undefined;
|
|
114624
|
+
}
|
|
114625
|
+
return elem.value.text === "import" ? ts.ModuleKind.ESNext : ts.ModuleKind.CommonJS;
|
|
114626
|
+
}
|
|
114627
|
+
ts.getResolutionModeOverrideForClause = getResolutionModeOverrideForClause;
|
|
114628
|
+
/* @internal */
|
|
114437
114629
|
function loadWithModeAwareCache(names, containingFile, containingFileName, redirectedReference, loader) {
|
|
114438
114630
|
if (names.length === 0) {
|
|
114439
114631
|
return [];
|
|
@@ -120080,8 +120272,9 @@ var ts;
|
|
|
120080
120272
|
// Because when this is called by the file renamer, `importingSourceFile` is the file being renamed,
|
|
120081
120273
|
// while `importingSourceFileName` its *new* name. We need a source file just to get its
|
|
120082
120274
|
// `impliedNodeFormat` and to detect certain preferences from existing import module specifiers.
|
|
120083
|
-
function updateModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, oldImportSpecifier) {
|
|
120084
|
-
|
|
120275
|
+
function updateModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, oldImportSpecifier, options) {
|
|
120276
|
+
if (options === void 0) { options = {}; }
|
|
120277
|
+
var res = getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, getPreferencesForUpdate(compilerOptions, oldImportSpecifier, importingSourceFileName, host), {}, options);
|
|
120085
120278
|
if (res === oldImportSpecifier)
|
|
120086
120279
|
return undefined;
|
|
120087
120280
|
return res;
|
|
@@ -120093,65 +120286,77 @@ var ts;
|
|
|
120093
120286
|
// one currently being produced; the latter to the one being imported). We need an implementation file
|
|
120094
120287
|
// just to get its `impliedNodeFormat` and to detect certain preferences from existing import module
|
|
120095
120288
|
// specifiers.
|
|
120096
|
-
function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host) {
|
|
120097
|
-
|
|
120289
|
+
function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, options) {
|
|
120290
|
+
if (options === void 0) { options = {}; }
|
|
120291
|
+
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, getPreferences(host, {}, compilerOptions, importingSourceFile), {}, options);
|
|
120098
120292
|
}
|
|
120099
120293
|
moduleSpecifiers_1.getModuleSpecifier = getModuleSpecifier;
|
|
120100
|
-
function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences) {
|
|
120294
|
+
function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences, options) {
|
|
120295
|
+
if (options === void 0) { options = {}; }
|
|
120101
120296
|
var info = getInfo(importingSourceFile.path, host);
|
|
120102
|
-
var modulePaths = getAllModulePaths(importingSourceFile.path, nodeModulesFileName, host, preferences);
|
|
120103
|
-
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ true); });
|
|
120297
|
+
var modulePaths = getAllModulePaths(importingSourceFile.path, nodeModulesFileName, host, preferences, options);
|
|
120298
|
+
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ true, options.overrideImportMode); });
|
|
120104
120299
|
}
|
|
120105
120300
|
moduleSpecifiers_1.getNodeModulesPackageName = getNodeModulesPackageName;
|
|
120106
|
-
function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, preferences, userPreferences) {
|
|
120301
|
+
function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, preferences, userPreferences, options) {
|
|
120302
|
+
if (options === void 0) { options = {}; }
|
|
120107
120303
|
var info = getInfo(importingSourceFileName, host);
|
|
120108
|
-
var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences);
|
|
120109
|
-
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions); }) ||
|
|
120304
|
+
var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences, options);
|
|
120305
|
+
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ undefined, options.overrideImportMode); }) ||
|
|
120110
120306
|
getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences);
|
|
120111
120307
|
}
|
|
120112
|
-
function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences) {
|
|
120113
|
-
|
|
120308
|
+
function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences, options) {
|
|
120309
|
+
if (options === void 0) { options = {}; }
|
|
120310
|
+
return tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences, options)[0];
|
|
120114
120311
|
}
|
|
120115
120312
|
moduleSpecifiers_1.tryGetModuleSpecifiersFromCache = tryGetModuleSpecifiersFromCache;
|
|
120116
|
-
function tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences) {
|
|
120313
|
+
function tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences, options) {
|
|
120117
120314
|
var _a;
|
|
120315
|
+
if (options === void 0) { options = {}; }
|
|
120118
120316
|
var moduleSourceFile = ts.getSourceFileOfModule(moduleSymbol);
|
|
120119
120317
|
if (!moduleSourceFile) {
|
|
120120
120318
|
return ts.emptyArray;
|
|
120121
120319
|
}
|
|
120122
120320
|
var cache = (_a = host.getModuleSpecifierCache) === null || _a === void 0 ? void 0 : _a.call(host);
|
|
120123
|
-
var cached = cache === null || cache === void 0 ? void 0 : cache.get(importingSourceFile.path, moduleSourceFile.path, userPreferences);
|
|
120321
|
+
var cached = cache === null || cache === void 0 ? void 0 : cache.get(importingSourceFile.path, moduleSourceFile.path, userPreferences, options);
|
|
120124
120322
|
return [cached === null || cached === void 0 ? void 0 : cached.moduleSpecifiers, moduleSourceFile, cached === null || cached === void 0 ? void 0 : cached.modulePaths, cache];
|
|
120125
120323
|
}
|
|
120126
120324
|
/** Returns an import for each symlink and for the realpath. */
|
|
120127
|
-
function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences) {
|
|
120128
|
-
|
|
120325
|
+
function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options) {
|
|
120326
|
+
if (options === void 0) { options = {}; }
|
|
120327
|
+
return getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options).moduleSpecifiers;
|
|
120129
120328
|
}
|
|
120130
120329
|
moduleSpecifiers_1.getModuleSpecifiers = getModuleSpecifiers;
|
|
120131
|
-
function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences) {
|
|
120330
|
+
function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options) {
|
|
120331
|
+
if (options === void 0) { options = {}; }
|
|
120132
120332
|
var computedWithoutCache = false;
|
|
120133
120333
|
var ambient = tryGetModuleNameFromAmbientModule(moduleSymbol, checker);
|
|
120134
120334
|
if (ambient)
|
|
120135
120335
|
return { moduleSpecifiers: [ambient], computedWithoutCache: computedWithoutCache };
|
|
120136
120336
|
// eslint-disable-next-line prefer-const
|
|
120137
|
-
var _a = tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences), specifiers = _a[0], moduleSourceFile = _a[1], modulePaths = _a[2], cache = _a[3];
|
|
120337
|
+
var _a = tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences, options), specifiers = _a[0], moduleSourceFile = _a[1], modulePaths = _a[2], cache = _a[3];
|
|
120138
120338
|
if (specifiers)
|
|
120139
120339
|
return { moduleSpecifiers: specifiers, computedWithoutCache: computedWithoutCache };
|
|
120140
120340
|
if (!moduleSourceFile)
|
|
120141
120341
|
return { moduleSpecifiers: ts.emptyArray, computedWithoutCache: computedWithoutCache };
|
|
120142
120342
|
computedWithoutCache = true;
|
|
120143
120343
|
modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.path, moduleSourceFile.originalFileName, host));
|
|
120144
|
-
var result = computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences);
|
|
120145
|
-
cache === null || cache === void 0 ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, modulePaths, result);
|
|
120344
|
+
var result = computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options);
|
|
120345
|
+
cache === null || cache === void 0 ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, options, modulePaths, result);
|
|
120146
120346
|
return { moduleSpecifiers: result, computedWithoutCache: computedWithoutCache };
|
|
120147
120347
|
}
|
|
120148
120348
|
moduleSpecifiers_1.getModuleSpecifiersWithCacheInfo = getModuleSpecifiersWithCacheInfo;
|
|
120149
|
-
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences) {
|
|
120349
|
+
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options) {
|
|
120350
|
+
if (options === void 0) { options = {}; }
|
|
120150
120351
|
var info = getInfo(importingSourceFile.path, host);
|
|
120151
120352
|
var preferences = getPreferences(host, userPreferences, compilerOptions, importingSourceFile);
|
|
120152
120353
|
var existingSpecifier = ts.forEach(modulePaths, function (modulePath) { return ts.forEach(host.getFileIncludeReasons().get(ts.toPath(modulePath.path, host.getCurrentDirectory(), info.getCanonicalFileName)), function (reason) {
|
|
120153
120354
|
if (reason.kind !== ts.FileIncludeKind.Import || reason.file !== importingSourceFile.path)
|
|
120154
120355
|
return undefined;
|
|
120356
|
+
// If the candidate import mode doesn't match the mode we're generating for, don't consider it
|
|
120357
|
+
// TODO: maybe useful to keep around as an alternative option for certain contexts where the mode is overridable
|
|
120358
|
+
if (importingSourceFile.impliedNodeFormat && importingSourceFile.impliedNodeFormat !== ts.getModeForResolutionAtIndex(importingSourceFile, reason.index))
|
|
120359
|
+
return undefined;
|
|
120155
120360
|
var specifier = ts.getModuleNameStringLiteralAt(importingSourceFile, reason.index).text;
|
|
120156
120361
|
// If the preference is for non relative and the module specifier is relative, ignore it
|
|
120157
120362
|
return preferences.relativePreference !== 1 /* NonRelative */ || !ts.pathIsRelative(specifier) ?
|
|
@@ -120173,7 +120378,7 @@ var ts;
|
|
|
120173
120378
|
var relativeSpecifiers;
|
|
120174
120379
|
for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) {
|
|
120175
120380
|
var modulePath = modulePaths_1[_i];
|
|
120176
|
-
var specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions);
|
|
120381
|
+
var specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ undefined, options.overrideImportMode);
|
|
120177
120382
|
nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier);
|
|
120178
120383
|
if (specifier && modulePath.isRedirect) {
|
|
120179
120384
|
// If we got a specifier for a redirect, it was a bare package specifier (e.g. "@foo/bar",
|
|
@@ -120349,18 +120554,19 @@ var ts;
|
|
|
120349
120554
|
* Looks for existing imports that use symlinks to this module.
|
|
120350
120555
|
* Symlinks will be returned first so they are preferred over the real path.
|
|
120351
120556
|
*/
|
|
120352
|
-
function getAllModulePaths(importingFilePath, importedFileName, host, preferences,
|
|
120557
|
+
function getAllModulePaths(importingFilePath, importedFileName, host, preferences, options) {
|
|
120353
120558
|
var _a;
|
|
120354
|
-
if (
|
|
120559
|
+
if (options === void 0) { options = {}; }
|
|
120560
|
+
var importedFilePath = ts.toPath(importedFileName, host.getCurrentDirectory(), ts.hostGetCanonicalFileName(host));
|
|
120355
120561
|
var cache = (_a = host.getModuleSpecifierCache) === null || _a === void 0 ? void 0 : _a.call(host);
|
|
120356
120562
|
if (cache) {
|
|
120357
|
-
var cached = cache.get(importingFilePath, importedFilePath, preferences);
|
|
120563
|
+
var cached = cache.get(importingFilePath, importedFilePath, preferences, options);
|
|
120358
120564
|
if (cached === null || cached === void 0 ? void 0 : cached.modulePaths)
|
|
120359
120565
|
return cached.modulePaths;
|
|
120360
120566
|
}
|
|
120361
120567
|
var modulePaths = getAllModulePathsWorker(importingFilePath, importedFileName, host);
|
|
120362
120568
|
if (cache) {
|
|
120363
|
-
cache.setModulePaths(importingFilePath, importedFilePath, preferences, modulePaths);
|
|
120569
|
+
cache.setModulePaths(importingFilePath, importedFilePath, preferences, options, modulePaths);
|
|
120364
120570
|
}
|
|
120365
120571
|
return modulePaths;
|
|
120366
120572
|
}
|
|
@@ -120565,7 +120771,7 @@ var ts;
|
|
|
120565
120771
|
? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions)
|
|
120566
120772
|
: ts.removeFileExtension(relativePath);
|
|
120567
120773
|
}
|
|
120568
|
-
function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, packageNameOnly) {
|
|
120774
|
+
function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, packageNameOnly, overrideMode) {
|
|
120569
120775
|
var path = _a.path, isRedirect = _a.isRedirect;
|
|
120570
120776
|
var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory;
|
|
120571
120777
|
if (!host.fileExists || !host.readFile) {
|
|
@@ -120635,7 +120841,7 @@ var ts;
|
|
|
120635
120841
|
// an ImportEqualsDeclaration in an ESM-implied file or an ImportCall in a CJS-implied file. But since this function is
|
|
120636
120842
|
// usually called to conjure an import out of thin air, we don't have an existing usage to call `getModeForUsageAtIndex`
|
|
120637
120843
|
// with, so for now we just stick with the mode of the file.
|
|
120638
|
-
var conditions = ["node", importingSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext ? "import" : "require", "types"];
|
|
120844
|
+
var conditions = ["node", overrideMode || importingSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext ? "import" : "require", "types"];
|
|
120639
120845
|
var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string"
|
|
120640
120846
|
? tryGetModuleNameFromExports(options, path, packageRootPath, ts.getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions)
|
|
120641
120847
|
: undefined;
|