@typescript-deploys/pr-build 5.3.0-pr-56201-9 → 5.3.0-pr-56220-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +525 -431
- package/lib/tsserver.js +854 -623
- package/lib/typescript.d.ts +26 -25
- package/lib/typescript.js +854 -623
- package/lib/typingsInstaller.js +118 -93
- package/package.json +3 -3
package/lib/tsserver.js
CHANGED
|
@@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2328
2328
|
|
|
2329
2329
|
// src/compiler/corePublic.ts
|
|
2330
2330
|
var versionMajorMinor = "5.3";
|
|
2331
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2331
|
+
var version = `${versionMajorMinor}.0-insiders.20231031`;
|
|
2332
2332
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2333
2333
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2334
2334
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6185,32 +6185,43 @@ var NodeFlags = /* @__PURE__ */ ((NodeFlags3) => {
|
|
|
6185
6185
|
})(NodeFlags || {});
|
|
6186
6186
|
var ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => {
|
|
6187
6187
|
ModifierFlags3[ModifierFlags3["None"] = 0] = "None";
|
|
6188
|
-
ModifierFlags3[ModifierFlags3["
|
|
6189
|
-
ModifierFlags3[ModifierFlags3["
|
|
6190
|
-
ModifierFlags3[ModifierFlags3["
|
|
6191
|
-
ModifierFlags3[ModifierFlags3["
|
|
6192
|
-
ModifierFlags3[ModifierFlags3["
|
|
6193
|
-
ModifierFlags3[ModifierFlags3["
|
|
6194
|
-
ModifierFlags3[ModifierFlags3["
|
|
6195
|
-
ModifierFlags3[ModifierFlags3["
|
|
6196
|
-
ModifierFlags3[ModifierFlags3["
|
|
6197
|
-
ModifierFlags3[ModifierFlags3["
|
|
6198
|
-
ModifierFlags3[ModifierFlags3["
|
|
6199
|
-
ModifierFlags3[ModifierFlags3["
|
|
6200
|
-
ModifierFlags3[ModifierFlags3["
|
|
6201
|
-
ModifierFlags3[ModifierFlags3["
|
|
6202
|
-
ModifierFlags3[ModifierFlags3["
|
|
6203
|
-
ModifierFlags3[ModifierFlags3["
|
|
6204
|
-
ModifierFlags3[ModifierFlags3["
|
|
6205
|
-
ModifierFlags3[ModifierFlags3["
|
|
6188
|
+
ModifierFlags3[ModifierFlags3["Public"] = 1] = "Public";
|
|
6189
|
+
ModifierFlags3[ModifierFlags3["Private"] = 2] = "Private";
|
|
6190
|
+
ModifierFlags3[ModifierFlags3["Protected"] = 4] = "Protected";
|
|
6191
|
+
ModifierFlags3[ModifierFlags3["Readonly"] = 8] = "Readonly";
|
|
6192
|
+
ModifierFlags3[ModifierFlags3["Override"] = 16] = "Override";
|
|
6193
|
+
ModifierFlags3[ModifierFlags3["Export"] = 32] = "Export";
|
|
6194
|
+
ModifierFlags3[ModifierFlags3["Abstract"] = 64] = "Abstract";
|
|
6195
|
+
ModifierFlags3[ModifierFlags3["Ambient"] = 128] = "Ambient";
|
|
6196
|
+
ModifierFlags3[ModifierFlags3["Static"] = 256] = "Static";
|
|
6197
|
+
ModifierFlags3[ModifierFlags3["Accessor"] = 512] = "Accessor";
|
|
6198
|
+
ModifierFlags3[ModifierFlags3["Async"] = 1024] = "Async";
|
|
6199
|
+
ModifierFlags3[ModifierFlags3["Default"] = 2048] = "Default";
|
|
6200
|
+
ModifierFlags3[ModifierFlags3["Const"] = 4096] = "Const";
|
|
6201
|
+
ModifierFlags3[ModifierFlags3["In"] = 8192] = "In";
|
|
6202
|
+
ModifierFlags3[ModifierFlags3["Out"] = 16384] = "Out";
|
|
6203
|
+
ModifierFlags3[ModifierFlags3["Decorator"] = 32768] = "Decorator";
|
|
6204
|
+
ModifierFlags3[ModifierFlags3["Deprecated"] = 65536] = "Deprecated";
|
|
6205
|
+
ModifierFlags3[ModifierFlags3["JSDocPublic"] = 8388608] = "JSDocPublic";
|
|
6206
|
+
ModifierFlags3[ModifierFlags3["JSDocPrivate"] = 16777216] = "JSDocPrivate";
|
|
6207
|
+
ModifierFlags3[ModifierFlags3["JSDocProtected"] = 33554432] = "JSDocProtected";
|
|
6208
|
+
ModifierFlags3[ModifierFlags3["JSDocReadonly"] = 67108864] = "JSDocReadonly";
|
|
6209
|
+
ModifierFlags3[ModifierFlags3["JSDocOverride"] = 134217728] = "JSDocOverride";
|
|
6210
|
+
ModifierFlags3[ModifierFlags3["SyntacticOrJSDocModifiers"] = 31] = "SyntacticOrJSDocModifiers";
|
|
6211
|
+
ModifierFlags3[ModifierFlags3["SyntacticOnlyModifiers"] = 65504] = "SyntacticOnlyModifiers";
|
|
6212
|
+
ModifierFlags3[ModifierFlags3["SyntacticModifiers"] = 65535] = "SyntacticModifiers";
|
|
6213
|
+
ModifierFlags3[ModifierFlags3["JSDocCacheOnlyModifiers"] = 260046848] = "JSDocCacheOnlyModifiers";
|
|
6214
|
+
ModifierFlags3[ModifierFlags3["JSDocOnlyModifiers"] = 65536 /* Deprecated */] = "JSDocOnlyModifiers";
|
|
6215
|
+
ModifierFlags3[ModifierFlags3["NonCacheOnlyModifiers"] = 131071] = "NonCacheOnlyModifiers";
|
|
6216
|
+
ModifierFlags3[ModifierFlags3["HasComputedJSDocModifiers"] = 268435456] = "HasComputedJSDocModifiers";
|
|
6206
6217
|
ModifierFlags3[ModifierFlags3["HasComputedFlags"] = 536870912] = "HasComputedFlags";
|
|
6207
|
-
ModifierFlags3[ModifierFlags3["AccessibilityModifier"] =
|
|
6208
|
-
ModifierFlags3[ModifierFlags3["ParameterPropertyModifier"] =
|
|
6209
|
-
ModifierFlags3[ModifierFlags3["NonPublicAccessibilityModifier"] =
|
|
6210
|
-
ModifierFlags3[ModifierFlags3["TypeScriptModifier"] =
|
|
6211
|
-
ModifierFlags3[ModifierFlags3["ExportDefault"] =
|
|
6212
|
-
ModifierFlags3[ModifierFlags3["All"] =
|
|
6213
|
-
ModifierFlags3[ModifierFlags3["Modifier"] =
|
|
6218
|
+
ModifierFlags3[ModifierFlags3["AccessibilityModifier"] = 7] = "AccessibilityModifier";
|
|
6219
|
+
ModifierFlags3[ModifierFlags3["ParameterPropertyModifier"] = 31] = "ParameterPropertyModifier";
|
|
6220
|
+
ModifierFlags3[ModifierFlags3["NonPublicAccessibilityModifier"] = 6] = "NonPublicAccessibilityModifier";
|
|
6221
|
+
ModifierFlags3[ModifierFlags3["TypeScriptModifier"] = 28895] = "TypeScriptModifier";
|
|
6222
|
+
ModifierFlags3[ModifierFlags3["ExportDefault"] = 2080] = "ExportDefault";
|
|
6223
|
+
ModifierFlags3[ModifierFlags3["All"] = 131071] = "All";
|
|
6224
|
+
ModifierFlags3[ModifierFlags3["Modifier"] = 98303] = "Modifier";
|
|
6214
6225
|
return ModifierFlags3;
|
|
6215
6226
|
})(ModifierFlags || {});
|
|
6216
6227
|
var JsxFlags = /* @__PURE__ */ ((JsxFlags2) => {
|
|
@@ -10161,7 +10172,7 @@ var Diagnostics = {
|
|
|
10161
10172
|
Import_assertion_values_must_be_string_literal_expressions: diag(2837, 1 /* Error */, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
10162
10173
|
All_declarations_of_0_must_have_identical_constraints: diag(2838, 1 /* Error */, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
10163
10174
|
This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, 1 /* Error */, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."),
|
|
10164
|
-
|
|
10175
|
+
An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types: diag(2840, 1 /* Error */, "An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types_2840", "An interface cannot extend a primitive type like '{0}'. It can only extend other named object types."),
|
|
10165
10176
|
_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, 1 /* Error */, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),
|
|
10166
10177
|
We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, 1 /* Error */, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."),
|
|
10167
10178
|
Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, 1 /* Error */, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
|
|
@@ -10182,6 +10193,8 @@ var Diagnostics = {
|
|
|
10182
10193
|
The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method: diag(2860, 1 /* Error */, "The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_2860", "The left-hand side of an 'instanceof' expression must be assignable to the first argument of the right-hand side's '[Symbol.hasInstance]' method."),
|
|
10183
10194
|
An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression: diag(2861, 1 /* Error */, "An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_han_2861", "An object's '[Symbol.hasInstance]' method must return a boolean value for it to be used on the right-hand side of an 'instanceof' expression."),
|
|
10184
10195
|
Type_0_is_generic_and_can_only_be_indexed_for_reading: diag(2862, 1 /* Error */, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."),
|
|
10196
|
+
A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: diag(2863, 1 /* Error */, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),
|
|
10197
|
+
A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
|
|
10185
10198
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
10186
10199
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
10187
10200
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -13686,7 +13699,7 @@ function getTypeParameterOwner(d) {
|
|
|
13686
13699
|
}
|
|
13687
13700
|
}
|
|
13688
13701
|
function isParameterPropertyDeclaration(node, parent2) {
|
|
13689
|
-
return isParameter(node) && hasSyntacticModifier(node,
|
|
13702
|
+
return isParameter(node) && hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) && parent2.kind === 176 /* Constructor */;
|
|
13690
13703
|
}
|
|
13691
13704
|
function isEmptyBindingPattern(node) {
|
|
13692
13705
|
if (isBindingPattern(node)) {
|
|
@@ -13976,7 +13989,7 @@ function getDecorators(node) {
|
|
|
13976
13989
|
}
|
|
13977
13990
|
}
|
|
13978
13991
|
function getModifiers(node) {
|
|
13979
|
-
if (hasSyntacticModifier(node,
|
|
13992
|
+
if (hasSyntacticModifier(node, 98303 /* Modifier */)) {
|
|
13980
13993
|
return filter(node.modifiers, isModifier);
|
|
13981
13994
|
}
|
|
13982
13995
|
}
|
|
@@ -14410,7 +14423,7 @@ function isModifierKind(token) {
|
|
|
14410
14423
|
return false;
|
|
14411
14424
|
}
|
|
14412
14425
|
function isParameterPropertyModifier(kind) {
|
|
14413
|
-
return !!(modifierToFlag(kind) &
|
|
14426
|
+
return !!(modifierToFlag(kind) & 31 /* ParameterPropertyModifier */);
|
|
14414
14427
|
}
|
|
14415
14428
|
function isClassMemberModifier(idToken) {
|
|
14416
14429
|
return isParameterPropertyModifier(idToken) || idToken === 126 /* StaticKeyword */ || idToken === 164 /* OverrideKeyword */ || idToken === 129 /* AccessorKeyword */;
|
|
@@ -14774,10 +14787,10 @@ function hasScopeMarker(statements) {
|
|
|
14774
14787
|
return some(statements, isScopeMarker);
|
|
14775
14788
|
}
|
|
14776
14789
|
function needsScopeMarker(result) {
|
|
14777
|
-
return !isAnyImportOrReExport(result) && !isExportAssignment(result) && !hasSyntacticModifier(result,
|
|
14790
|
+
return !isAnyImportOrReExport(result) && !isExportAssignment(result) && !hasSyntacticModifier(result, 32 /* Export */) && !isAmbientModule(result);
|
|
14778
14791
|
}
|
|
14779
14792
|
function isExternalModuleIndicator(result) {
|
|
14780
|
-
return isAnyImportOrReExport(result) || isExportAssignment(result) || hasSyntacticModifier(result,
|
|
14793
|
+
return isAnyImportOrReExport(result) || isExportAssignment(result) || hasSyntacticModifier(result, 32 /* Export */);
|
|
14781
14794
|
}
|
|
14782
14795
|
function isForInOrOfStatement(node) {
|
|
14783
14796
|
return node.kind === 249 /* ForInStatement */ || node.kind === 250 /* ForOfStatement */;
|
|
@@ -16053,7 +16066,7 @@ function isEffectiveStrictModeSourceFile(node, compilerOptions) {
|
|
|
16053
16066
|
return false;
|
|
16054
16067
|
}
|
|
16055
16068
|
function isAmbientPropertyDeclaration(node) {
|
|
16056
|
-
return !!(node.flags & 33554432 /* Ambient */) || hasSyntacticModifier(node,
|
|
16069
|
+
return !!(node.flags & 33554432 /* Ambient */) || hasSyntacticModifier(node, 128 /* Ambient */);
|
|
16057
16070
|
}
|
|
16058
16071
|
function isBlockScope(node, parentNode) {
|
|
16059
16072
|
switch (node.kind) {
|
|
@@ -16406,10 +16419,10 @@ function isJsonSourceFile(file) {
|
|
|
16406
16419
|
return file.scriptKind === 6 /* JSON */;
|
|
16407
16420
|
}
|
|
16408
16421
|
function isEnumConst(node) {
|
|
16409
|
-
return !!(getCombinedModifierFlags(node) &
|
|
16422
|
+
return !!(getCombinedModifierFlags(node) & 4096 /* Const */);
|
|
16410
16423
|
}
|
|
16411
16424
|
function isDeclarationReadonly(declaration) {
|
|
16412
|
-
return !!(getCombinedModifierFlags(declaration) &
|
|
16425
|
+
return !!(getCombinedModifierFlags(declaration) & 8 /* Readonly */ && !isParameterPropertyDeclaration(declaration, declaration.parent));
|
|
16413
16426
|
}
|
|
16414
16427
|
function isVarAwaitUsing(node) {
|
|
16415
16428
|
return (getCombinedNodeFlags(node) & 7 /* BlockScoped */) === 6 /* AwaitUsing */;
|
|
@@ -18158,7 +18171,7 @@ function getFunctionFlags(node) {
|
|
|
18158
18171
|
flags |= 1 /* Generator */;
|
|
18159
18172
|
}
|
|
18160
18173
|
case 219 /* ArrowFunction */:
|
|
18161
|
-
if (hasSyntacticModifier(node,
|
|
18174
|
+
if (hasSyntacticModifier(node, 1024 /* Async */)) {
|
|
18162
18175
|
flags |= 2 /* Async */;
|
|
18163
18176
|
}
|
|
18164
18177
|
break;
|
|
@@ -18174,7 +18187,7 @@ function isAsyncFunction(node) {
|
|
|
18174
18187
|
case 218 /* FunctionExpression */:
|
|
18175
18188
|
case 219 /* ArrowFunction */:
|
|
18176
18189
|
case 174 /* MethodDeclaration */:
|
|
18177
|
-
return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node,
|
|
18190
|
+
return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 1024 /* Async */);
|
|
18178
18191
|
}
|
|
18179
18192
|
return false;
|
|
18180
18193
|
}
|
|
@@ -19338,25 +19351,25 @@ function isStatic(node) {
|
|
|
19338
19351
|
return isClassElement(node) && hasStaticModifier(node) || isClassStaticBlockDeclaration(node);
|
|
19339
19352
|
}
|
|
19340
19353
|
function hasStaticModifier(node) {
|
|
19341
|
-
return hasSyntacticModifier(node,
|
|
19354
|
+
return hasSyntacticModifier(node, 256 /* Static */);
|
|
19342
19355
|
}
|
|
19343
19356
|
function hasOverrideModifier(node) {
|
|
19344
|
-
return hasEffectiveModifier(node,
|
|
19357
|
+
return hasEffectiveModifier(node, 16 /* Override */);
|
|
19345
19358
|
}
|
|
19346
19359
|
function hasAbstractModifier(node) {
|
|
19347
|
-
return hasSyntacticModifier(node,
|
|
19360
|
+
return hasSyntacticModifier(node, 64 /* Abstract */);
|
|
19348
19361
|
}
|
|
19349
19362
|
function hasAmbientModifier(node) {
|
|
19350
|
-
return hasSyntacticModifier(node,
|
|
19363
|
+
return hasSyntacticModifier(node, 128 /* Ambient */);
|
|
19351
19364
|
}
|
|
19352
19365
|
function hasAccessorModifier(node) {
|
|
19353
|
-
return hasSyntacticModifier(node,
|
|
19366
|
+
return hasSyntacticModifier(node, 512 /* Accessor */);
|
|
19354
19367
|
}
|
|
19355
19368
|
function hasEffectiveReadonlyModifier(node) {
|
|
19356
|
-
return hasEffectiveModifier(node,
|
|
19369
|
+
return hasEffectiveModifier(node, 8 /* Readonly */);
|
|
19357
19370
|
}
|
|
19358
19371
|
function hasDecorators(node) {
|
|
19359
|
-
return hasSyntacticModifier(node,
|
|
19372
|
+
return hasSyntacticModifier(node, 32768 /* Decorator */);
|
|
19360
19373
|
}
|
|
19361
19374
|
function getSelectedEffectiveModifierFlags(node, flags) {
|
|
19362
19375
|
return getEffectiveModifierFlags(node) & flags;
|
|
@@ -19371,10 +19384,13 @@ function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) {
|
|
|
19371
19384
|
if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) {
|
|
19372
19385
|
node.modifierFlagsCache = getSyntacticModifierFlagsNoCache(node) | 536870912 /* HasComputedFlags */;
|
|
19373
19386
|
}
|
|
19374
|
-
if (
|
|
19375
|
-
node.modifierFlagsCache
|
|
19387
|
+
if (alwaysIncludeJSDoc || includeJSDoc && isInJSFile(node)) {
|
|
19388
|
+
if (!(node.modifierFlagsCache & 268435456 /* HasComputedJSDocModifiers */) && node.parent) {
|
|
19389
|
+
node.modifierFlagsCache |= getRawJSDocModifierFlagsNoCache(node) | 268435456 /* HasComputedJSDocModifiers */;
|
|
19390
|
+
}
|
|
19391
|
+
return selectEffectiveModifierFlags(node.modifierFlagsCache);
|
|
19376
19392
|
}
|
|
19377
|
-
return node.modifierFlagsCache
|
|
19393
|
+
return selectSyntacticModifierFlags(node.modifierFlagsCache);
|
|
19378
19394
|
}
|
|
19379
19395
|
function getEffectiveModifierFlags(node) {
|
|
19380
19396
|
return getModifierFlagsWorker(
|
|
@@ -19399,33 +19415,42 @@ function getSyntacticModifierFlags(node) {
|
|
|
19399
19415
|
false
|
|
19400
19416
|
);
|
|
19401
19417
|
}
|
|
19402
|
-
function
|
|
19418
|
+
function getRawJSDocModifierFlagsNoCache(node) {
|
|
19403
19419
|
let flags = 0 /* None */;
|
|
19404
19420
|
if (!!node.parent && !isParameter(node)) {
|
|
19405
19421
|
if (isInJSFile(node)) {
|
|
19406
19422
|
if (getJSDocPublicTagNoCache(node))
|
|
19407
|
-
flags |=
|
|
19423
|
+
flags |= 8388608 /* JSDocPublic */;
|
|
19408
19424
|
if (getJSDocPrivateTagNoCache(node))
|
|
19409
|
-
flags |=
|
|
19425
|
+
flags |= 16777216 /* JSDocPrivate */;
|
|
19410
19426
|
if (getJSDocProtectedTagNoCache(node))
|
|
19411
|
-
flags |=
|
|
19427
|
+
flags |= 33554432 /* JSDocProtected */;
|
|
19412
19428
|
if (getJSDocReadonlyTagNoCache(node))
|
|
19413
|
-
flags |=
|
|
19429
|
+
flags |= 67108864 /* JSDocReadonly */;
|
|
19414
19430
|
if (getJSDocOverrideTagNoCache(node))
|
|
19415
|
-
flags |=
|
|
19431
|
+
flags |= 134217728 /* JSDocOverride */;
|
|
19416
19432
|
}
|
|
19417
19433
|
if (getJSDocDeprecatedTagNoCache(node))
|
|
19418
|
-
flags |=
|
|
19434
|
+
flags |= 65536 /* Deprecated */;
|
|
19419
19435
|
}
|
|
19420
19436
|
return flags;
|
|
19421
19437
|
}
|
|
19438
|
+
function selectSyntacticModifierFlags(flags) {
|
|
19439
|
+
return flags & 65535 /* SyntacticModifiers */;
|
|
19440
|
+
}
|
|
19441
|
+
function selectEffectiveModifierFlags(flags) {
|
|
19442
|
+
return flags & 131071 /* NonCacheOnlyModifiers */ | (flags & 260046848 /* JSDocCacheOnlyModifiers */) >>> 23;
|
|
19443
|
+
}
|
|
19444
|
+
function getJSDocModifierFlagsNoCache(node) {
|
|
19445
|
+
return selectEffectiveModifierFlags(getRawJSDocModifierFlagsNoCache(node));
|
|
19446
|
+
}
|
|
19422
19447
|
function getEffectiveModifierFlagsNoCache(node) {
|
|
19423
19448
|
return getSyntacticModifierFlagsNoCache(node) | getJSDocModifierFlagsNoCache(node);
|
|
19424
19449
|
}
|
|
19425
19450
|
function getSyntacticModifierFlagsNoCache(node) {
|
|
19426
19451
|
let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */;
|
|
19427
19452
|
if (node.flags & 8 /* NestedNamespace */ || node.kind === 80 /* Identifier */ && node.flags & 4096 /* IdentifierIsInJSDocNamespace */) {
|
|
19428
|
-
flags |=
|
|
19453
|
+
flags |= 32 /* Export */;
|
|
19429
19454
|
}
|
|
19430
19455
|
return flags;
|
|
19431
19456
|
}
|
|
@@ -19441,37 +19466,37 @@ function modifiersToFlags(modifiers) {
|
|
|
19441
19466
|
function modifierToFlag(token) {
|
|
19442
19467
|
switch (token) {
|
|
19443
19468
|
case 126 /* StaticKeyword */:
|
|
19444
|
-
return
|
|
19469
|
+
return 256 /* Static */;
|
|
19445
19470
|
case 125 /* PublicKeyword */:
|
|
19446
|
-
return
|
|
19471
|
+
return 1 /* Public */;
|
|
19447
19472
|
case 124 /* ProtectedKeyword */:
|
|
19448
|
-
return
|
|
19473
|
+
return 4 /* Protected */;
|
|
19449
19474
|
case 123 /* PrivateKeyword */:
|
|
19450
|
-
return
|
|
19475
|
+
return 2 /* Private */;
|
|
19451
19476
|
case 128 /* AbstractKeyword */:
|
|
19452
|
-
return
|
|
19477
|
+
return 64 /* Abstract */;
|
|
19453
19478
|
case 129 /* AccessorKeyword */:
|
|
19454
|
-
return
|
|
19479
|
+
return 512 /* Accessor */;
|
|
19455
19480
|
case 95 /* ExportKeyword */:
|
|
19456
|
-
return
|
|
19481
|
+
return 32 /* Export */;
|
|
19457
19482
|
case 138 /* DeclareKeyword */:
|
|
19458
|
-
return
|
|
19483
|
+
return 128 /* Ambient */;
|
|
19459
19484
|
case 87 /* ConstKeyword */:
|
|
19460
|
-
return
|
|
19485
|
+
return 4096 /* Const */;
|
|
19461
19486
|
case 90 /* DefaultKeyword */:
|
|
19462
|
-
return
|
|
19487
|
+
return 2048 /* Default */;
|
|
19463
19488
|
case 134 /* AsyncKeyword */:
|
|
19464
|
-
return
|
|
19489
|
+
return 1024 /* Async */;
|
|
19465
19490
|
case 148 /* ReadonlyKeyword */:
|
|
19466
|
-
return
|
|
19491
|
+
return 8 /* Readonly */;
|
|
19467
19492
|
case 164 /* OverrideKeyword */:
|
|
19468
|
-
return
|
|
19493
|
+
return 16 /* Override */;
|
|
19469
19494
|
case 103 /* InKeyword */:
|
|
19470
|
-
return
|
|
19495
|
+
return 8192 /* In */;
|
|
19471
19496
|
case 147 /* OutKeyword */:
|
|
19472
|
-
return
|
|
19497
|
+
return 16384 /* Out */;
|
|
19473
19498
|
case 170 /* Decorator */:
|
|
19474
|
-
return
|
|
19499
|
+
return 32768 /* Decorator */;
|
|
19475
19500
|
}
|
|
19476
19501
|
return 0 /* None */;
|
|
19477
19502
|
}
|
|
@@ -19611,7 +19636,7 @@ function getLocalSymbolForExportDefault(symbol) {
|
|
|
19611
19636
|
return void 0;
|
|
19612
19637
|
}
|
|
19613
19638
|
function isExportDefaultSymbol(symbol) {
|
|
19614
|
-
return symbol && length(symbol.declarations) > 0 && hasSyntacticModifier(symbol.declarations[0],
|
|
19639
|
+
return symbol && length(symbol.declarations) > 0 && hasSyntacticModifier(symbol.declarations[0], 2048 /* Default */);
|
|
19615
19640
|
}
|
|
19616
19641
|
function tryExtractTSExtension(fileName) {
|
|
19617
19642
|
return find(supportedTSExtensionsForExtractExtension, (extension) => fileExtensionIs(fileName, extension));
|
|
@@ -19894,16 +19919,16 @@ function getDeclarationModifierFlagsFromSymbol(s, isWrite = false) {
|
|
|
19894
19919
|
if (s.valueDeclaration) {
|
|
19895
19920
|
const declaration = isWrite && s.declarations && find(s.declarations, isSetAccessorDeclaration) || s.flags & 32768 /* GetAccessor */ && find(s.declarations, isGetAccessorDeclaration) || s.valueDeclaration;
|
|
19896
19921
|
const flags = getCombinedModifierFlags(declaration);
|
|
19897
|
-
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~
|
|
19922
|
+
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~7 /* AccessibilityModifier */;
|
|
19898
19923
|
}
|
|
19899
19924
|
if (getCheckFlags(s) & 6 /* Synthetic */) {
|
|
19900
19925
|
const checkFlags = s.links.checkFlags;
|
|
19901
|
-
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ?
|
|
19902
|
-
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ?
|
|
19926
|
+
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 2 /* Private */ : checkFlags & 256 /* ContainsPublic */ ? 1 /* Public */ : 4 /* Protected */;
|
|
19927
|
+
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 256 /* Static */ : 0;
|
|
19903
19928
|
return accessModifier | staticModifier;
|
|
19904
19929
|
}
|
|
19905
19930
|
if (s.flags & 4194304 /* Prototype */) {
|
|
19906
|
-
return
|
|
19931
|
+
return 1 /* Public */ | 256 /* Static */;
|
|
19907
19932
|
}
|
|
19908
19933
|
return 0;
|
|
19909
19934
|
}
|
|
@@ -20002,7 +20027,7 @@ function mutateMap(map2, newMap, options) {
|
|
|
20002
20027
|
function isAbstractConstructorSymbol(symbol) {
|
|
20003
20028
|
if (symbol.flags & 32 /* Class */) {
|
|
20004
20029
|
const declaration = getClassLikeDeclarationOfSymbol(symbol);
|
|
20005
|
-
return !!declaration && hasSyntacticModifier(declaration,
|
|
20030
|
+
return !!declaration && hasSyntacticModifier(declaration, 64 /* Abstract */);
|
|
20006
20031
|
}
|
|
20007
20032
|
return false;
|
|
20008
20033
|
}
|
|
@@ -21296,7 +21321,7 @@ function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) {
|
|
|
21296
21321
|
if (node.kind !== 167 /* ComputedPropertyName */) {
|
|
21297
21322
|
return false;
|
|
21298
21323
|
}
|
|
21299
|
-
if (hasSyntacticModifier(node.parent,
|
|
21324
|
+
if (hasSyntacticModifier(node.parent, 64 /* Abstract */)) {
|
|
21300
21325
|
return true;
|
|
21301
21326
|
}
|
|
21302
21327
|
const containerKind = node.parent.parent.kind;
|
|
@@ -23292,35 +23317,35 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23292
23317
|
}
|
|
23293
23318
|
function createModifiersFromModifierFlags(flags2) {
|
|
23294
23319
|
const result = [];
|
|
23295
|
-
if (flags2 &
|
|
23320
|
+
if (flags2 & 32 /* Export */)
|
|
23296
23321
|
result.push(createModifier(95 /* ExportKeyword */));
|
|
23297
|
-
if (flags2 &
|
|
23322
|
+
if (flags2 & 128 /* Ambient */)
|
|
23298
23323
|
result.push(createModifier(138 /* DeclareKeyword */));
|
|
23299
|
-
if (flags2 &
|
|
23324
|
+
if (flags2 & 2048 /* Default */)
|
|
23300
23325
|
result.push(createModifier(90 /* DefaultKeyword */));
|
|
23301
|
-
if (flags2 &
|
|
23326
|
+
if (flags2 & 4096 /* Const */)
|
|
23302
23327
|
result.push(createModifier(87 /* ConstKeyword */));
|
|
23303
|
-
if (flags2 &
|
|
23328
|
+
if (flags2 & 1 /* Public */)
|
|
23304
23329
|
result.push(createModifier(125 /* PublicKeyword */));
|
|
23305
|
-
if (flags2 &
|
|
23330
|
+
if (flags2 & 2 /* Private */)
|
|
23306
23331
|
result.push(createModifier(123 /* PrivateKeyword */));
|
|
23307
|
-
if (flags2 &
|
|
23332
|
+
if (flags2 & 4 /* Protected */)
|
|
23308
23333
|
result.push(createModifier(124 /* ProtectedKeyword */));
|
|
23309
|
-
if (flags2 &
|
|
23334
|
+
if (flags2 & 64 /* Abstract */)
|
|
23310
23335
|
result.push(createModifier(128 /* AbstractKeyword */));
|
|
23311
|
-
if (flags2 &
|
|
23336
|
+
if (flags2 & 256 /* Static */)
|
|
23312
23337
|
result.push(createModifier(126 /* StaticKeyword */));
|
|
23313
|
-
if (flags2 &
|
|
23338
|
+
if (flags2 & 16 /* Override */)
|
|
23314
23339
|
result.push(createModifier(164 /* OverrideKeyword */));
|
|
23315
|
-
if (flags2 &
|
|
23340
|
+
if (flags2 & 8 /* Readonly */)
|
|
23316
23341
|
result.push(createModifier(148 /* ReadonlyKeyword */));
|
|
23317
|
-
if (flags2 &
|
|
23342
|
+
if (flags2 & 512 /* Accessor */)
|
|
23318
23343
|
result.push(createModifier(129 /* AccessorKeyword */));
|
|
23319
|
-
if (flags2 &
|
|
23344
|
+
if (flags2 & 1024 /* Async */)
|
|
23320
23345
|
result.push(createModifier(134 /* AsyncKeyword */));
|
|
23321
|
-
if (flags2 &
|
|
23346
|
+
if (flags2 & 8192 /* In */)
|
|
23322
23347
|
result.push(createModifier(103 /* InKeyword */));
|
|
23323
|
-
if (flags2 &
|
|
23348
|
+
if (flags2 & 16384 /* Out */)
|
|
23324
23349
|
result.push(createModifier(147 /* OutKeyword */));
|
|
23325
23350
|
return result.length ? result : void 0;
|
|
23326
23351
|
}
|
|
@@ -23369,7 +23394,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23369
23394
|
if (isThisIdentifier(node.name)) {
|
|
23370
23395
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
23371
23396
|
} else {
|
|
23372
|
-
node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (node.questionToken ?? node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (node.dotDotDotToken ?? node.initializer ? 1024 /* ContainsES2015 */ : 0 /* None */) | (modifiersToFlags(node.modifiers) &
|
|
23397
|
+
node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (node.questionToken ?? node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (node.dotDotDotToken ?? node.initializer ? 1024 /* ContainsES2015 */ : 0 /* None */) | (modifiersToFlags(node.modifiers) & 31 /* ParameterPropertyModifier */ ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */);
|
|
23373
23398
|
}
|
|
23374
23399
|
node.jsDoc = void 0;
|
|
23375
23400
|
return node;
|
|
@@ -23418,8 +23443,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23418
23443
|
node.exclamationToken = questionOrExclamationToken && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0;
|
|
23419
23444
|
node.type = type;
|
|
23420
23445
|
node.initializer = asInitializer(initializer);
|
|
23421
|
-
const isAmbient = node.flags & 33554432 /* Ambient */ || modifiersToFlags(node.modifiers) &
|
|
23422
|
-
node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) &
|
|
23446
|
+
const isAmbient = node.flags & 33554432 /* Ambient */ || modifiersToFlags(node.modifiers) & 128 /* Ambient */;
|
|
23447
|
+
node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) & 256 /* Static */ && node.initializer ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */) | 16777216 /* ContainsClassFields */;
|
|
23423
23448
|
node.jsDoc = void 0;
|
|
23424
23449
|
return node;
|
|
23425
23450
|
}
|
|
@@ -23458,7 +23483,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23458
23483
|
if (!node.body) {
|
|
23459
23484
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
23460
23485
|
} else {
|
|
23461
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
23486
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
23462
23487
|
const isGenerator = !!node.asteriskToken;
|
|
23463
23488
|
const isAsyncGenerator = isAsync && isGenerator;
|
|
23464
23489
|
node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.questionToken || node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */;
|
|
@@ -24201,7 +24226,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24201
24226
|
node.parameters = createNodeArray(parameters);
|
|
24202
24227
|
node.type = type;
|
|
24203
24228
|
node.body = body;
|
|
24204
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
24229
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
24205
24230
|
const isGenerator = !!node.asteriskToken;
|
|
24206
24231
|
const isAsyncGenerator = isAsync && isGenerator;
|
|
24207
24232
|
node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
|
|
@@ -24225,7 +24250,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24225
24250
|
node.type = type;
|
|
24226
24251
|
node.equalsGreaterThanToken = equalsGreaterThanToken ?? createToken(39 /* EqualsGreaterThanToken */);
|
|
24227
24252
|
node.body = parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body);
|
|
24228
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
24253
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
24229
24254
|
node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.equalsGreaterThanToken) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isAsync ? 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */ : 0 /* None */) | 1024 /* ContainsES2015 */;
|
|
24230
24255
|
node.typeArguments = void 0;
|
|
24231
24256
|
node.jsDoc = void 0;
|
|
@@ -24577,7 +24602,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24577
24602
|
node.modifiers = asNodeArray(modifiers);
|
|
24578
24603
|
node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
|
|
24579
24604
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList);
|
|
24580
|
-
if (modifiersToFlags(node.modifiers) &
|
|
24605
|
+
if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
24581
24606
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
24582
24607
|
}
|
|
24583
24608
|
node.jsDoc = void 0;
|
|
@@ -24827,10 +24852,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24827
24852
|
node.parameters = createNodeArray(parameters);
|
|
24828
24853
|
node.type = type;
|
|
24829
24854
|
node.body = body;
|
|
24830
|
-
if (!node.body || modifiersToFlags(node.modifiers) &
|
|
24855
|
+
if (!node.body || modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
24831
24856
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
24832
24857
|
} else {
|
|
24833
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
24858
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
24834
24859
|
const isGenerator = !!node.asteriskToken;
|
|
24835
24860
|
const isAsyncGenerator = isAsync && isGenerator;
|
|
24836
24861
|
node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
|
|
@@ -24861,7 +24886,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24861
24886
|
node.typeParameters = asNodeArray(typeParameters);
|
|
24862
24887
|
node.heritageClauses = asNodeArray(heritageClauses);
|
|
24863
24888
|
node.members = createNodeArray(members);
|
|
24864
|
-
if (modifiersToFlags(node.modifiers) &
|
|
24889
|
+
if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
24865
24890
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
24866
24891
|
} else {
|
|
24867
24892
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */;
|
|
@@ -24923,7 +24948,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24923
24948
|
node.flags |= flags2 & (32 /* Namespace */ | 8 /* NestedNamespace */ | 2048 /* GlobalAugmentation */);
|
|
24924
24949
|
node.name = name;
|
|
24925
24950
|
node.body = body;
|
|
24926
|
-
if (modifiersToFlags(node.modifiers) &
|
|
24951
|
+
if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
24927
24952
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
24928
24953
|
} else {
|
|
24929
24954
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1 /* ContainsTypeScript */;
|
|
@@ -26354,7 +26379,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26354
26379
|
return qualifiedName;
|
|
26355
26380
|
}
|
|
26356
26381
|
function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) {
|
|
26357
|
-
if (ns && hasSyntacticModifier(node,
|
|
26382
|
+
if (ns && hasSyntacticModifier(node, 32 /* Export */)) {
|
|
26358
26383
|
return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps);
|
|
26359
26384
|
}
|
|
26360
26385
|
return getExportName(node, allowComments, allowSourceMaps);
|
|
@@ -35751,11 +35776,11 @@ var Parser;
|
|
|
35751
35776
|
const modifierFlags = modifiersToFlags(modifiers);
|
|
35752
35777
|
parseExpected(100 /* FunctionKeyword */);
|
|
35753
35778
|
const asteriskToken = parseOptionalToken(42 /* AsteriskToken */);
|
|
35754
|
-
const name = modifierFlags &
|
|
35779
|
+
const name = modifierFlags & 2048 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier();
|
|
35755
35780
|
const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */;
|
|
35756
|
-
const isAsync = modifierFlags &
|
|
35781
|
+
const isAsync = modifierFlags & 1024 /* Async */ ? 2 /* Await */ : 0 /* None */;
|
|
35757
35782
|
const typeParameters = parseTypeParameters();
|
|
35758
|
-
if (modifierFlags &
|
|
35783
|
+
if (modifierFlags & 32 /* Export */)
|
|
35759
35784
|
setAwaitContext(
|
|
35760
35785
|
/*value*/
|
|
35761
35786
|
true
|
|
@@ -41664,8 +41689,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
41664
41689
|
if (resolutionMode === 99 /* ESNext */ && (3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */)) {
|
|
41665
41690
|
features |= 32 /* EsmMode */;
|
|
41666
41691
|
}
|
|
41667
|
-
const
|
|
41668
|
-
const conditions = features & 8 /* Exports */ ? getConditions(options, useImportCondition) : [];
|
|
41692
|
+
const conditions = features & 8 /* Exports */ ? getConditions(options, resolutionMode) : [];
|
|
41669
41693
|
const diagnostics = [];
|
|
41670
41694
|
const moduleResolutionState = {
|
|
41671
41695
|
compilerOptions: options,
|
|
@@ -41833,16 +41857,16 @@ function getNodeResolutionFeatures(options) {
|
|
|
41833
41857
|
}
|
|
41834
41858
|
return features;
|
|
41835
41859
|
}
|
|
41836
|
-
function getConditions(options,
|
|
41860
|
+
function getConditions(options, resolutionMode) {
|
|
41837
41861
|
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
41838
|
-
if (
|
|
41862
|
+
if (resolutionMode === void 0) {
|
|
41839
41863
|
if (moduleResolution === 100 /* Bundler */) {
|
|
41840
|
-
|
|
41864
|
+
resolutionMode = 99 /* ESNext */;
|
|
41841
41865
|
} else if (moduleResolution === 2 /* Node10 */) {
|
|
41842
41866
|
return [];
|
|
41843
41867
|
}
|
|
41844
41868
|
}
|
|
41845
|
-
const conditions =
|
|
41869
|
+
const conditions = resolutionMode === 99 /* ESNext */ ? ["import"] : ["require"];
|
|
41846
41870
|
if (!options.noDtsResolution) {
|
|
41847
41871
|
conditions.push("types");
|
|
41848
41872
|
}
|
|
@@ -42291,13 +42315,13 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
42291
42315
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42292
42316
|
break;
|
|
42293
42317
|
case 2 /* Node10 */:
|
|
42294
|
-
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode
|
|
42318
|
+
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode) : void 0);
|
|
42295
42319
|
break;
|
|
42296
42320
|
case 1 /* Classic */:
|
|
42297
42321
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
42298
42322
|
break;
|
|
42299
42323
|
case 100 /* Bundler */:
|
|
42300
|
-
result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode
|
|
42324
|
+
result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode) : void 0);
|
|
42301
42325
|
break;
|
|
42302
42326
|
default:
|
|
42303
42327
|
return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
|
|
@@ -42575,7 +42599,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42575
42599
|
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
42576
42600
|
conditions ?? (conditions = getConditions(
|
|
42577
42601
|
compilerOptions,
|
|
42578
|
-
moduleResolution === 100 /* Bundler */ || moduleResolution === 2 /* Node10 */ ? void 0 :
|
|
42602
|
+
moduleResolution === 100 /* Bundler */ || moduleResolution === 2 /* Node10 */ ? void 0 : features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */
|
|
42579
42603
|
));
|
|
42580
42604
|
const diagnostics = [];
|
|
42581
42605
|
const state = {
|
|
@@ -42886,15 +42910,7 @@ function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache
|
|
|
42886
42910
|
entrypoints = append(entrypoints, mainResolution == null ? void 0 : mainResolution.path);
|
|
42887
42911
|
if (features & 8 /* Exports */ && packageJsonInfo.contents.packageJsonContent.exports) {
|
|
42888
42912
|
const conditionSets = deduplicate(
|
|
42889
|
-
[getConditions(
|
|
42890
|
-
options,
|
|
42891
|
-
/*esmMode*/
|
|
42892
|
-
true
|
|
42893
|
-
), getConditions(
|
|
42894
|
-
options,
|
|
42895
|
-
/*esmMode*/
|
|
42896
|
-
false
|
|
42897
|
-
)],
|
|
42913
|
+
[getConditions(options, 99 /* ESNext */), getConditions(options, 1 /* CommonJS */)],
|
|
42898
42914
|
arrayIsEqualTo
|
|
42899
42915
|
);
|
|
42900
42916
|
for (const conditions of conditionSets) {
|
|
@@ -44031,7 +44047,7 @@ function getModuleInstanceStateWorker(node, visited) {
|
|
|
44031
44047
|
break;
|
|
44032
44048
|
case 272 /* ImportDeclaration */:
|
|
44033
44049
|
case 271 /* ImportEqualsDeclaration */:
|
|
44034
|
-
if (!hasSyntacticModifier(node,
|
|
44050
|
+
if (!hasSyntacticModifier(node, 32 /* Export */)) {
|
|
44035
44051
|
return 0 /* NonInstantiated */;
|
|
44036
44052
|
}
|
|
44037
44053
|
break;
|
|
@@ -44321,7 +44337,7 @@ function createBinder() {
|
|
|
44321
44337
|
}
|
|
44322
44338
|
function declareSymbol(symbolTable, parent3, node, includes, excludes, isReplaceableByMethod, isComputedName) {
|
|
44323
44339
|
Debug.assert(isComputedName || !hasDynamicName(node));
|
|
44324
|
-
const isDefaultExport = hasSyntacticModifier(node,
|
|
44340
|
+
const isDefaultExport = hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) && node.name.escapedText === "default";
|
|
44325
44341
|
const name = isComputedName ? "__computed" /* Computed */ : isDefaultExport && parent3 ? "default" /* Default */ : getDeclarationName(node);
|
|
44326
44342
|
let symbol;
|
|
44327
44343
|
if (name === void 0) {
|
|
@@ -44365,7 +44381,7 @@ function createBinder() {
|
|
|
44365
44381
|
}
|
|
44366
44382
|
}
|
|
44367
44383
|
const relatedInformation = [];
|
|
44368
|
-
if (isTypeAliasDeclaration(node) && nodeIsMissing(node.type) && hasSyntacticModifier(node,
|
|
44384
|
+
if (isTypeAliasDeclaration(node) && nodeIsMissing(node.type) && hasSyntacticModifier(node, 32 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
|
|
44369
44385
|
relatedInformation.push(createDiagnosticForNode2(node, Diagnostics.Did_you_mean_0, `export type { ${unescapeLeadingUnderscores(node.name.escapedText)} }`));
|
|
44370
44386
|
}
|
|
44371
44387
|
const declarationName = getNameOfDeclaration(node) || node;
|
|
@@ -44394,7 +44410,7 @@ function createBinder() {
|
|
|
44394
44410
|
return symbol;
|
|
44395
44411
|
}
|
|
44396
44412
|
function declareModuleMember(node, symbolFlags, symbolExcludes) {
|
|
44397
|
-
const hasExportModifier = !!(getCombinedModifierFlags(node) &
|
|
44413
|
+
const hasExportModifier = !!(getCombinedModifierFlags(node) & 32 /* Export */) || jsdocTreatAsExported(node);
|
|
44398
44414
|
if (symbolFlags & 2097152 /* Alias */) {
|
|
44399
44415
|
if (node.kind === 281 /* ExportSpecifier */ || node.kind === 271 /* ImportEqualsDeclaration */ && hasExportModifier) {
|
|
44400
44416
|
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
|
|
@@ -44413,7 +44429,7 @@ function createBinder() {
|
|
|
44413
44429
|
if (isJSDocTypeAlias(node))
|
|
44414
44430
|
Debug.assert(isInJSFile(node));
|
|
44415
44431
|
if (!isAmbientModule(node) && (hasExportModifier || container.flags & 128 /* ExportContext */)) {
|
|
44416
|
-
if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier(node,
|
|
44432
|
+
if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier(node, 2048 /* Default */) && !getDeclarationName(node)) {
|
|
44417
44433
|
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
|
|
44418
44434
|
}
|
|
44419
44435
|
const exportKind = symbolFlags & 111551 /* Value */ ? 1048576 /* ExportValue */ : 0;
|
|
@@ -44454,7 +44470,7 @@ function createBinder() {
|
|
|
44454
44470
|
return false;
|
|
44455
44471
|
if (isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent))
|
|
44456
44472
|
return true;
|
|
44457
|
-
if (isDeclaration(declName.parent) && getCombinedModifierFlags(declName.parent) &
|
|
44473
|
+
if (isDeclaration(declName.parent) && getCombinedModifierFlags(declName.parent) & 32 /* Export */)
|
|
44458
44474
|
return true;
|
|
44459
44475
|
return false;
|
|
44460
44476
|
}
|
|
@@ -44485,7 +44501,7 @@ function createBinder() {
|
|
|
44485
44501
|
const saveExceptionTarget = currentExceptionTarget;
|
|
44486
44502
|
const saveActiveLabelList = activeLabelList;
|
|
44487
44503
|
const saveHasExplicitReturn = hasExplicitReturn;
|
|
44488
|
-
const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node,
|
|
44504
|
+
const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175 /* ClassStaticBlockDeclaration */;
|
|
44489
44505
|
if (!isImmediatelyInvoked) {
|
|
44490
44506
|
currentFlow = initFlowNode({ flags: 2 /* Start */ });
|
|
44491
44507
|
if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */)) {
|
|
@@ -45532,7 +45548,7 @@ function createBinder() {
|
|
|
45532
45548
|
function bindModuleDeclaration(node) {
|
|
45533
45549
|
setExportContextFlag(node);
|
|
45534
45550
|
if (isAmbientModule(node)) {
|
|
45535
|
-
if (hasSyntacticModifier(node,
|
|
45551
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
45536
45552
|
errorOnFirstToken(node, Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible);
|
|
45537
45553
|
}
|
|
45538
45554
|
if (isModuleAugmentationExternal(node)) {
|
|
@@ -46593,7 +46609,7 @@ function createBinder() {
|
|
|
46593
46609
|
}
|
|
46594
46610
|
if (!isBindingPattern(node.name)) {
|
|
46595
46611
|
const possibleVariableDecl = node.kind === 260 /* VariableDeclaration */ ? node : node.parent.parent;
|
|
46596
|
-
if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) &
|
|
46612
|
+
if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 32 /* Export */)) {
|
|
46597
46613
|
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
|
|
46598
46614
|
} else if (isBlockOrCatchScoped(node)) {
|
|
46599
46615
|
bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */);
|
|
@@ -46745,7 +46761,7 @@ function isPurelyTypeDeclaration(s) {
|
|
|
46745
46761
|
case 267 /* ModuleDeclaration */:
|
|
46746
46762
|
return getModuleInstanceState(s) !== 1 /* Instantiated */;
|
|
46747
46763
|
case 266 /* EnumDeclaration */:
|
|
46748
|
-
return hasSyntacticModifier(s,
|
|
46764
|
+
return hasSyntacticModifier(s, 4096 /* Const */);
|
|
46749
46765
|
default:
|
|
46750
46766
|
return false;
|
|
46751
46767
|
}
|
|
@@ -47607,7 +47623,7 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
|
|
|
47607
47623
|
if (getResolvePackageJsonExports(options)) {
|
|
47608
47624
|
const nodeModulesDirectoryName2 = packageRootPath.substring(parts.topLevelPackageNameIndex + 1);
|
|
47609
47625
|
const packageName2 = getPackageNameFromTypesPackageName(nodeModulesDirectoryName2);
|
|
47610
|
-
const conditions = getConditions(options, importMode
|
|
47626
|
+
const conditions = getConditions(options, importMode);
|
|
47611
47627
|
const fromExports = packageJsonContent.exports ? tryGetModuleNameFromExports(options, path, packageRootPath, packageName2, packageJsonContent.exports, conditions) : void 0;
|
|
47612
47628
|
if (fromExports) {
|
|
47613
47629
|
const withJsExtension = !hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) };
|
|
@@ -49896,7 +49912,7 @@ function createTypeChecker(host) {
|
|
|
49896
49912
|
if (lastLocation && lastLocation === location.name) {
|
|
49897
49913
|
return false;
|
|
49898
49914
|
}
|
|
49899
|
-
if (location.asteriskToken || hasSyntacticModifier(location,
|
|
49915
|
+
if (location.asteriskToken || hasSyntacticModifier(location, 1024 /* Async */)) {
|
|
49900
49916
|
return true;
|
|
49901
49917
|
}
|
|
49902
49918
|
return !getImmediatelyInvokedFunctionExpression(location);
|
|
@@ -50060,8 +50076,17 @@ function createTypeChecker(host) {
|
|
|
50060
50076
|
function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
|
|
50061
50077
|
if (meaning & 111551 /* Value */) {
|
|
50062
50078
|
if (isPrimitiveTypeName(name)) {
|
|
50063
|
-
|
|
50064
|
-
|
|
50079
|
+
const grandparent = errorLocation.parent.parent;
|
|
50080
|
+
if (grandparent && grandparent.parent && isHeritageClause(grandparent)) {
|
|
50081
|
+
const heritageKind = grandparent.token;
|
|
50082
|
+
const containerKind = grandparent.parent.kind;
|
|
50083
|
+
if (containerKind === 264 /* InterfaceDeclaration */ && heritageKind === 96 /* ExtendsKeyword */) {
|
|
50084
|
+
error2(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types, unescapeLeadingUnderscores(name));
|
|
50085
|
+
} else if (containerKind === 263 /* ClassDeclaration */ && heritageKind === 96 /* ExtendsKeyword */) {
|
|
50086
|
+
error2(errorLocation, Diagnostics.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values, unescapeLeadingUnderscores(name));
|
|
50087
|
+
} else if (containerKind === 263 /* ClassDeclaration */ && heritageKind === 119 /* ImplementsKeyword */) {
|
|
50088
|
+
error2(errorLocation, Diagnostics.A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types, unescapeLeadingUnderscores(name));
|
|
50089
|
+
}
|
|
50065
50090
|
} else {
|
|
50066
50091
|
error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, unescapeLeadingUnderscores(name));
|
|
50067
50092
|
}
|
|
@@ -50093,16 +50118,6 @@ function createTypeChecker(host) {
|
|
|
50093
50118
|
}
|
|
50094
50119
|
return false;
|
|
50095
50120
|
}
|
|
50096
|
-
function isExtendedByInterface(node) {
|
|
50097
|
-
const grandparent = node.parent.parent;
|
|
50098
|
-
const parentOfGrandparent = grandparent.parent;
|
|
50099
|
-
if (grandparent && parentOfGrandparent) {
|
|
50100
|
-
const isExtending = isHeritageClause(grandparent) && grandparent.token === 96 /* ExtendsKeyword */;
|
|
50101
|
-
const isInterface = isInterfaceDeclaration(parentOfGrandparent);
|
|
50102
|
-
return isExtending && isInterface;
|
|
50103
|
-
}
|
|
50104
|
-
return false;
|
|
50105
|
-
}
|
|
50106
50121
|
function maybeMappedType(node, symbol) {
|
|
50107
50122
|
const container = findAncestor(node.parent, (n) => isComputedPropertyName(n) || isPropertySignature(n) ? false : isTypeLiteralNode(n) || "quit");
|
|
50108
50123
|
if (container && container.members.length === 1) {
|
|
@@ -50281,7 +50296,7 @@ function createTypeChecker(host) {
|
|
|
50281
50296
|
return resolved;
|
|
50282
50297
|
}
|
|
50283
50298
|
function isSyntacticDefault(node) {
|
|
50284
|
-
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node,
|
|
50299
|
+
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) || isNamespaceExport(node);
|
|
50285
50300
|
}
|
|
50286
50301
|
function getUsageModeForExpression(usage) {
|
|
50287
50302
|
return isStringLiteralLike(usage) ? getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
|
|
@@ -52207,20 +52222,20 @@ function createTypeChecker(host) {
|
|
|
52207
52222
|
var _a, _b;
|
|
52208
52223
|
if (!isDeclarationVisible(declaration)) {
|
|
52209
52224
|
const anyImportSyntax = getAnyImportSyntax(declaration);
|
|
52210
|
-
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax,
|
|
52225
|
+
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax, 32 /* Export */) && // import clause without export
|
|
52211
52226
|
isDeclarationVisible(anyImportSyntax.parent)) {
|
|
52212
52227
|
return addVisibleAlias(declaration, anyImportSyntax);
|
|
52213
|
-
} else if (isVariableDeclaration(declaration) && isVariableStatement(declaration.parent.parent) && !hasSyntacticModifier(declaration.parent.parent,
|
|
52228
|
+
} else if (isVariableDeclaration(declaration) && isVariableStatement(declaration.parent.parent) && !hasSyntacticModifier(declaration.parent.parent, 32 /* Export */) && // unexported variable statement
|
|
52214
52229
|
isDeclarationVisible(declaration.parent.parent.parent)) {
|
|
52215
52230
|
return addVisibleAlias(declaration, declaration.parent.parent);
|
|
52216
|
-
} else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier(declaration,
|
|
52231
|
+
} else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier(declaration, 32 /* Export */) && isDeclarationVisible(declaration.parent)) {
|
|
52217
52232
|
return addVisibleAlias(declaration, declaration);
|
|
52218
52233
|
} else if (isBindingElement(declaration)) {
|
|
52219
|
-
if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((_a = declaration.parent) == null ? void 0 : _a.parent) && isVariableDeclaration(declaration.parent.parent) && ((_b = declaration.parent.parent.parent) == null ? void 0 : _b.parent) && isVariableStatement(declaration.parent.parent.parent.parent) && !hasSyntacticModifier(declaration.parent.parent.parent.parent,
|
|
52234
|
+
if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((_a = declaration.parent) == null ? void 0 : _a.parent) && isVariableDeclaration(declaration.parent.parent) && ((_b = declaration.parent.parent.parent) == null ? void 0 : _b.parent) && isVariableStatement(declaration.parent.parent.parent.parent) && !hasSyntacticModifier(declaration.parent.parent.parent.parent, 32 /* Export */) && declaration.parent.parent.parent.parent.parent && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) {
|
|
52220
52235
|
return addVisibleAlias(declaration, declaration.parent.parent.parent.parent);
|
|
52221
52236
|
} else if (symbol.flags & 2 /* BlockScopedVariable */) {
|
|
52222
52237
|
const variableStatement = findAncestor(declaration, isVariableStatement);
|
|
52223
|
-
if (hasSyntacticModifier(variableStatement,
|
|
52238
|
+
if (hasSyntacticModifier(variableStatement, 32 /* Export */)) {
|
|
52224
52239
|
return true;
|
|
52225
52240
|
}
|
|
52226
52241
|
if (!isDeclarationVisible(variableStatement.parent)) {
|
|
@@ -52443,7 +52458,8 @@ function createTypeChecker(host) {
|
|
|
52443
52458
|
visitedTypes: void 0,
|
|
52444
52459
|
symbolDepth: void 0,
|
|
52445
52460
|
inferTypeParameters: void 0,
|
|
52446
|
-
approximateLength: 0
|
|
52461
|
+
approximateLength: 0,
|
|
52462
|
+
trackedSymbols: void 0
|
|
52447
52463
|
};
|
|
52448
52464
|
context.tracker = new SymbolTrackerImpl(context, tracker, moduleResolverHost);
|
|
52449
52465
|
const resultingNode = cb(context);
|
|
@@ -52897,7 +52913,7 @@ function createTypeChecker(host) {
|
|
|
52897
52913
|
}
|
|
52898
52914
|
}
|
|
52899
52915
|
function visitAndTransformType(type2, transform2) {
|
|
52900
|
-
var _a2, _b2;
|
|
52916
|
+
var _a2, _b2, _c;
|
|
52901
52917
|
const typeId = type2.id;
|
|
52902
52918
|
const isConstructorObject = getObjectFlags(type2) & 16 /* Anonymous */ && type2.symbol && type2.symbol.flags & 32 /* Class */;
|
|
52903
52919
|
const id = getObjectFlags(type2) & 4 /* Reference */ && type2.node ? "N" + getNodeId(type2.node) : type2.flags & 16777216 /* Conditional */ ? "N" + getNodeId(type2.root.node) : type2.symbol ? (isConstructorObject ? "+" : "") + getSymbolId(type2.symbol) : void 0;
|
|
@@ -52914,6 +52930,13 @@ function createTypeChecker(host) {
|
|
|
52914
52930
|
}
|
|
52915
52931
|
const cachedResult = (_a2 = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _a2.get(key);
|
|
52916
52932
|
if (cachedResult) {
|
|
52933
|
+
(_b2 = cachedResult.trackedSymbols) == null ? void 0 : _b2.forEach(
|
|
52934
|
+
([symbol, enclosingDeclaration, meaning]) => context.tracker.trackSymbol(
|
|
52935
|
+
symbol,
|
|
52936
|
+
enclosingDeclaration,
|
|
52937
|
+
meaning
|
|
52938
|
+
)
|
|
52939
|
+
);
|
|
52917
52940
|
if (cachedResult.truncating) {
|
|
52918
52941
|
context.truncating = true;
|
|
52919
52942
|
}
|
|
@@ -52933,7 +52956,12 @@ function createTypeChecker(host) {
|
|
|
52933
52956
|
const result = transform2(type2);
|
|
52934
52957
|
const addedLength = context.approximateLength - startLength;
|
|
52935
52958
|
if (!context.reportedDiagnostic && !context.encounteredError) {
|
|
52936
|
-
(
|
|
52959
|
+
(_c = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _c.set(key, {
|
|
52960
|
+
node: result,
|
|
52961
|
+
truncating: context.truncating,
|
|
52962
|
+
addedLength,
|
|
52963
|
+
trackedSymbols: context.trackedSymbols
|
|
52964
|
+
});
|
|
52937
52965
|
}
|
|
52938
52966
|
context.visitedTypes.delete(typeId);
|
|
52939
52967
|
if (id) {
|
|
@@ -53175,7 +53203,7 @@ function createTypeChecker(host) {
|
|
|
53175
53203
|
if (propertySymbol.flags & 4194304 /* Prototype */) {
|
|
53176
53204
|
continue;
|
|
53177
53205
|
}
|
|
53178
|
-
if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (
|
|
53206
|
+
if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (2 /* Private */ | 4 /* Protected */) && context.tracker.reportPrivateInBaseOfClassExpression) {
|
|
53179
53207
|
context.tracker.reportPrivateInBaseOfClassExpression(unescapeLeadingUnderscores(propertySymbol.escapedName));
|
|
53180
53208
|
}
|
|
53181
53209
|
}
|
|
@@ -53478,7 +53506,7 @@ function createTypeChecker(host) {
|
|
|
53478
53506
|
let modifiers = options == null ? void 0 : options.modifiers;
|
|
53479
53507
|
if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
|
|
53480
53508
|
const flags = modifiersToFlags(modifiers);
|
|
53481
|
-
modifiers = factory.createModifiersFromModifierFlags(flags |
|
|
53509
|
+
modifiers = factory.createModifiersFromModifierFlags(flags | 64 /* Abstract */);
|
|
53482
53510
|
}
|
|
53483
53511
|
const node = kind === 179 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 180 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 173 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 174 /* MethodDeclaration */ ? factory.createMethodDeclaration(
|
|
53484
53512
|
modifiers,
|
|
@@ -54535,7 +54563,7 @@ function createTypeChecker(host) {
|
|
|
54535
54563
|
const nsIndex = findIndex(statements, isModuleDeclaration);
|
|
54536
54564
|
let ns = nsIndex !== -1 ? statements[nsIndex] : void 0;
|
|
54537
54565
|
if (ns && exportAssignment && exportAssignment.isExportEquals && isIdentifier(exportAssignment.expression) && isIdentifier(ns.name) && idText(ns.name) === idText(exportAssignment.expression) && ns.body && isModuleBlock(ns.body)) {
|
|
54538
|
-
const excessExports = filter(statements, (s) => !!(getEffectiveModifierFlags(s) &
|
|
54566
|
+
const excessExports = filter(statements, (s) => !!(getEffectiveModifierFlags(s) & 32 /* Export */));
|
|
54539
54567
|
const name = ns.name;
|
|
54540
54568
|
let body = ns.body;
|
|
54541
54569
|
if (length(excessExports)) {
|
|
@@ -54569,9 +54597,9 @@ function createTypeChecker(host) {
|
|
|
54569
54597
|
}
|
|
54570
54598
|
if (!find(statements, (s) => s !== ns && nodeHasName(s, name))) {
|
|
54571
54599
|
results = [];
|
|
54572
|
-
const mixinExportFlag = !some(body.statements, (s) => hasSyntacticModifier(s,
|
|
54600
|
+
const mixinExportFlag = !some(body.statements, (s) => hasSyntacticModifier(s, 32 /* Export */) || isExportAssignment(s) || isExportDeclaration(s));
|
|
54573
54601
|
forEach(body.statements, (s) => {
|
|
54574
|
-
addResult(s, mixinExportFlag ?
|
|
54602
|
+
addResult(s, mixinExportFlag ? 32 /* Export */ : 0 /* None */);
|
|
54575
54603
|
});
|
|
54576
54604
|
statements = [...filter(statements, (s) => s !== ns && s !== exportAssignment), ...results];
|
|
54577
54605
|
}
|
|
@@ -54663,11 +54691,11 @@ function createTypeChecker(host) {
|
|
|
54663
54691
|
return statements;
|
|
54664
54692
|
}
|
|
54665
54693
|
function addExportModifier(node) {
|
|
54666
|
-
const flags = (getEffectiveModifierFlags(node) |
|
|
54694
|
+
const flags = (getEffectiveModifierFlags(node) | 32 /* Export */) & ~128 /* Ambient */;
|
|
54667
54695
|
return factory.replaceModifiers(node, flags);
|
|
54668
54696
|
}
|
|
54669
54697
|
function removeExportModifier(node) {
|
|
54670
|
-
const flags = getEffectiveModifierFlags(node) & ~
|
|
54698
|
+
const flags = getEffectiveModifierFlags(node) & ~32 /* Export */;
|
|
54671
54699
|
return factory.replaceModifiers(node, flags);
|
|
54672
54700
|
}
|
|
54673
54701
|
function visitSymbolTable(symbolTable2, suppressNewPrivateContext, propertyAsAlias) {
|
|
@@ -54708,6 +54736,12 @@ function createTypeChecker(host) {
|
|
|
54708
54736
|
if (context.reportedDiagnostic) {
|
|
54709
54737
|
oldcontext.reportedDiagnostic = context.reportedDiagnostic;
|
|
54710
54738
|
}
|
|
54739
|
+
if (context.trackedSymbols) {
|
|
54740
|
+
if (!oldContext.trackedSymbols)
|
|
54741
|
+
oldContext.trackedSymbols = context.trackedSymbols;
|
|
54742
|
+
else
|
|
54743
|
+
Debug.assert(context.trackedSymbols === oldContext.trackedSymbols);
|
|
54744
|
+
}
|
|
54711
54745
|
context = oldContext;
|
|
54712
54746
|
}
|
|
54713
54747
|
}
|
|
@@ -54724,7 +54758,7 @@ function createTypeChecker(host) {
|
|
|
54724
54758
|
if (needsPostExportDefault || needsExportDeclaration) {
|
|
54725
54759
|
isPrivate = true;
|
|
54726
54760
|
}
|
|
54727
|
-
const modifierFlags = (!isPrivate ?
|
|
54761
|
+
const modifierFlags = (!isPrivate ? 32 /* Export */ : 0) | (isDefault && !needsPostExportDefault ? 2048 /* Default */ : 0);
|
|
54728
54762
|
const isConstMergedWithNS = symbol.flags & 1536 /* Module */ && symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && escapedSymbolName !== "export=" /* ExportEquals */;
|
|
54729
54763
|
const isConstMergedWithNSPrintableAsSignatureMerge = isConstMergedWithNS && isTypeRepresentableAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol);
|
|
54730
54764
|
if (symbol.flags & (16 /* Function */ | 8192 /* Method */) || isConstMergedWithNSPrintableAsSignatureMerge) {
|
|
@@ -54794,7 +54828,7 @@ function createTypeChecker(host) {
|
|
|
54794
54828
|
),
|
|
54795
54829
|
textRange
|
|
54796
54830
|
);
|
|
54797
|
-
addResult(statement, name !== localName ? modifierFlags & ~
|
|
54831
|
+
addResult(statement, name !== localName ? modifierFlags & ~32 /* Export */ : modifierFlags);
|
|
54798
54832
|
if (name !== localName && !isPrivate) {
|
|
54799
54833
|
addResult(
|
|
54800
54834
|
factory.createExportDeclaration(
|
|
@@ -54899,14 +54933,14 @@ function createTypeChecker(host) {
|
|
|
54899
54933
|
if (canHaveModifiers(node)) {
|
|
54900
54934
|
let newModifierFlags = 0 /* None */;
|
|
54901
54935
|
const enclosingDeclaration2 = context.enclosingDeclaration && (isJSDocTypeAlias(context.enclosingDeclaration) ? getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration);
|
|
54902
|
-
if (additionalModifierFlags &
|
|
54903
|
-
newModifierFlags |=
|
|
54936
|
+
if (additionalModifierFlags & 32 /* Export */ && enclosingDeclaration2 && (isExportingScope(enclosingDeclaration2) || isModuleDeclaration(enclosingDeclaration2)) && canHaveExportModifier(node)) {
|
|
54937
|
+
newModifierFlags |= 32 /* Export */;
|
|
54904
54938
|
}
|
|
54905
|
-
if (addingDeclare && !(newModifierFlags &
|
|
54906
|
-
newModifierFlags |=
|
|
54939
|
+
if (addingDeclare && !(newModifierFlags & 32 /* Export */) && (!enclosingDeclaration2 || !(enclosingDeclaration2.flags & 33554432 /* Ambient */)) && (isEnumDeclaration(node) || isVariableStatement(node) || isFunctionDeclaration(node) || isClassDeclaration(node) || isModuleDeclaration(node))) {
|
|
54940
|
+
newModifierFlags |= 128 /* Ambient */;
|
|
54907
54941
|
}
|
|
54908
|
-
if (additionalModifierFlags &
|
|
54909
|
-
newModifierFlags |=
|
|
54942
|
+
if (additionalModifierFlags & 2048 /* Default */ && (isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionDeclaration(node))) {
|
|
54943
|
+
newModifierFlags |= 2048 /* Default */;
|
|
54910
54944
|
}
|
|
54911
54945
|
if (newModifierFlags) {
|
|
54912
54946
|
node = factory.replaceModifiers(node, newModifierFlags | getEffectiveModifierFlags(node));
|
|
@@ -55028,7 +55062,7 @@ function createTypeChecker(host) {
|
|
|
55028
55062
|
function serializeEnum(symbol, symbolName2, modifierFlags) {
|
|
55029
55063
|
addResult(
|
|
55030
55064
|
factory.createEnumDeclaration(
|
|
55031
|
-
factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ?
|
|
55065
|
+
factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 4096 /* Const */ : 0),
|
|
55032
55066
|
getInternalSymbolName(symbol, symbolName2),
|
|
55033
55067
|
map(filter(getPropertiesOfType(getTypeOfSymbol(symbol)), (p) => !!(p.flags & 8 /* EnumMember */)), (p) => {
|
|
55034
55068
|
const initializedValue = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? getConstantValue2(p.declarations[0]) : void 0;
|
|
@@ -55112,7 +55146,7 @@ function createTypeChecker(host) {
|
|
|
55112
55146
|
factory.createIdentifier("default" /* Default */)
|
|
55113
55147
|
)])
|
|
55114
55148
|
) : d);
|
|
55115
|
-
const exportModifierStripped = every(defaultReplaced, (d) => hasSyntacticModifier(d,
|
|
55149
|
+
const exportModifierStripped = every(defaultReplaced, (d) => hasSyntacticModifier(d, 32 /* Export */)) ? map(defaultReplaced, removeExportModifier) : defaultReplaced;
|
|
55116
55150
|
fakespace = factory.updateModuleDeclaration(
|
|
55117
55151
|
fakespace,
|
|
55118
55152
|
fakespace.modifiers,
|
|
@@ -55215,7 +55249,7 @@ function createTypeChecker(host) {
|
|
|
55215
55249
|
);
|
|
55216
55250
|
const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */));
|
|
55217
55251
|
const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(
|
|
55218
|
-
factory.createModifiersFromModifierFlags(
|
|
55252
|
+
factory.createModifiersFromModifierFlags(2 /* Private */),
|
|
55219
55253
|
[],
|
|
55220
55254
|
/*body*/
|
|
55221
55255
|
void 0
|
|
@@ -55568,7 +55602,7 @@ function createTypeChecker(host) {
|
|
|
55568
55602
|
const varName = getUnusedName(name, symbol);
|
|
55569
55603
|
const typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol)));
|
|
55570
55604
|
if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) {
|
|
55571
|
-
serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ :
|
|
55605
|
+
serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 32 /* Export */);
|
|
55572
55606
|
} else {
|
|
55573
55607
|
const flags = ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 267 /* ModuleDeclaration */ && (!(symbol.flags & 98304 /* Accessor */) || symbol.flags & 65536 /* SetAccessor */) ? 1 /* Let */ : 2 /* Const */;
|
|
55574
55608
|
const statement = factory.createVariableStatement(
|
|
@@ -55585,7 +55619,7 @@ function createTypeChecker(host) {
|
|
|
55585
55619
|
);
|
|
55586
55620
|
addResult(
|
|
55587
55621
|
statement,
|
|
55588
|
-
target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ?
|
|
55622
|
+
target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ? 128 /* Ambient */ : name === varName ? 32 /* Export */ : 0 /* None */
|
|
55589
55623
|
);
|
|
55590
55624
|
}
|
|
55591
55625
|
if (isExportAssignmentCompatibleSymbolName) {
|
|
@@ -55621,14 +55655,14 @@ function createTypeChecker(host) {
|
|
|
55621
55655
|
return function serializePropertySymbol(p, isStatic2, baseType) {
|
|
55622
55656
|
var _a2, _b, _c, _d, _e;
|
|
55623
55657
|
const modifierFlags = getDeclarationModifierFlagsFromSymbol(p);
|
|
55624
|
-
const isPrivate = !!(modifierFlags &
|
|
55658
|
+
const isPrivate = !!(modifierFlags & 2 /* Private */);
|
|
55625
55659
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
55626
55660
|
return [];
|
|
55627
55661
|
}
|
|
55628
55662
|
if (p.flags & 4194304 /* Prototype */ || p.escapedName === "constructor" || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
55629
55663
|
return [];
|
|
55630
55664
|
}
|
|
55631
|
-
const flag = modifierFlags & ~
|
|
55665
|
+
const flag = modifierFlags & ~1024 /* Async */ | (isStatic2 ? 256 /* Static */ : 0);
|
|
55632
55666
|
const name = getPropertyNameNodeForSymbol(p, context);
|
|
55633
55667
|
const firstPropertyLikeDecl = (_a2 = p.declarations) == null ? void 0 : _a2.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression));
|
|
55634
55668
|
if (p.flags & 98304 /* Accessor */ && useAccessors) {
|
|
@@ -55670,7 +55704,7 @@ function createTypeChecker(host) {
|
|
|
55670
55704
|
));
|
|
55671
55705
|
}
|
|
55672
55706
|
if (p.flags & 32768 /* GetAccessor */) {
|
|
55673
|
-
const isPrivate2 = modifierFlags &
|
|
55707
|
+
const isPrivate2 = modifierFlags & 2 /* Private */;
|
|
55674
55708
|
result.push(setTextRange(
|
|
55675
55709
|
factory.createGetAccessorDeclaration(
|
|
55676
55710
|
factory.createModifiersFromModifierFlags(flag),
|
|
@@ -55687,7 +55721,7 @@ function createTypeChecker(host) {
|
|
|
55687
55721
|
} else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) {
|
|
55688
55722
|
return setTextRange(
|
|
55689
55723
|
createProperty2(
|
|
55690
|
-
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ?
|
|
55724
|
+
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag),
|
|
55691
55725
|
name,
|
|
55692
55726
|
p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
55693
55727
|
isPrivate ? void 0 : serializeTypeForDeclaration(context, getWriteTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled),
|
|
@@ -55702,10 +55736,10 @@ function createTypeChecker(host) {
|
|
|
55702
55736
|
if (p.flags & (8192 /* Method */ | 16 /* Function */)) {
|
|
55703
55737
|
const type = getTypeOfSymbol(p);
|
|
55704
55738
|
const signatures = getSignaturesOfType(type, 0 /* Call */);
|
|
55705
|
-
if (flag &
|
|
55739
|
+
if (flag & 2 /* Private */) {
|
|
55706
55740
|
return setTextRange(
|
|
55707
55741
|
createProperty2(
|
|
55708
|
-
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ?
|
|
55742
|
+
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag),
|
|
55709
55743
|
name,
|
|
55710
55744
|
p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
55711
55745
|
/*type*/
|
|
@@ -55781,7 +55815,7 @@ function createTypeChecker(host) {
|
|
|
55781
55815
|
let privateProtected = 0;
|
|
55782
55816
|
for (const s of signatures) {
|
|
55783
55817
|
if (s.declaration) {
|
|
55784
|
-
privateProtected |= getSelectedEffectiveModifierFlags(s.declaration,
|
|
55818
|
+
privateProtected |= getSelectedEffectiveModifierFlags(s.declaration, 2 /* Private */ | 4 /* Protected */);
|
|
55785
55819
|
}
|
|
55786
55820
|
}
|
|
55787
55821
|
if (privateProtected) {
|
|
@@ -55974,10 +56008,10 @@ function createTypeChecker(host) {
|
|
|
55974
56008
|
return result || types;
|
|
55975
56009
|
}
|
|
55976
56010
|
function visibilityToString(flags) {
|
|
55977
|
-
if (flags ===
|
|
56011
|
+
if (flags === 2 /* Private */) {
|
|
55978
56012
|
return "private";
|
|
55979
56013
|
}
|
|
55980
|
-
if (flags ===
|
|
56014
|
+
if (flags === 4 /* Protected */) {
|
|
55981
56015
|
return "protected";
|
|
55982
56016
|
}
|
|
55983
56017
|
return "public";
|
|
@@ -56095,7 +56129,7 @@ function createTypeChecker(host) {
|
|
|
56095
56129
|
return true;
|
|
56096
56130
|
}
|
|
56097
56131
|
const parent2 = getDeclarationContainer(node);
|
|
56098
|
-
if (!(getCombinedModifierFlagsCached(node) &
|
|
56132
|
+
if (!(getCombinedModifierFlagsCached(node) & 32 /* Export */) && !(node.kind !== 271 /* ImportEqualsDeclaration */ && parent2.kind !== 312 /* SourceFile */ && parent2.flags & 33554432 /* Ambient */)) {
|
|
56099
56133
|
return isGlobalSourceFile(parent2);
|
|
56100
56134
|
}
|
|
56101
56135
|
return isDeclarationVisible(parent2);
|
|
@@ -56105,7 +56139,7 @@ function createTypeChecker(host) {
|
|
|
56105
56139
|
case 178 /* SetAccessor */:
|
|
56106
56140
|
case 174 /* MethodDeclaration */:
|
|
56107
56141
|
case 173 /* MethodSignature */:
|
|
56108
|
-
if (hasEffectiveModifier(node,
|
|
56142
|
+
if (hasEffectiveModifier(node, 2 /* Private */ | 4 /* Protected */)) {
|
|
56109
56143
|
return false;
|
|
56110
56144
|
}
|
|
56111
56145
|
case 176 /* Constructor */:
|
|
@@ -56324,7 +56358,7 @@ function createTypeChecker(host) {
|
|
|
56324
56358
|
const unspreadableToRestKeys = [];
|
|
56325
56359
|
for (const prop of getPropertiesOfType(source)) {
|
|
56326
56360
|
const literalTypeFromProperty = getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */);
|
|
56327
|
-
if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType) && !(getDeclarationModifierFlagsFromSymbol(prop) & (
|
|
56361
|
+
if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType) && !(getDeclarationModifierFlagsFromSymbol(prop) & (2 /* Private */ | 4 /* Protected */)) && isSpreadableProperty(prop)) {
|
|
56328
56362
|
spreadableProperties.push(prop);
|
|
56329
56363
|
} else {
|
|
56330
56364
|
unspreadableToRestKeys.push(literalTypeFromProperty);
|
|
@@ -56530,7 +56564,7 @@ function createTypeChecker(host) {
|
|
|
56530
56564
|
if (declaredType) {
|
|
56531
56565
|
return addOptionality(declaredType, isProperty, isOptional);
|
|
56532
56566
|
}
|
|
56533
|
-
if ((noImplicitAny || isInJSFile(declaration)) && isVariableDeclaration(declaration) && !isBindingPattern(declaration.name) && !(getCombinedModifierFlagsCached(declaration) &
|
|
56567
|
+
if ((noImplicitAny || isInJSFile(declaration)) && isVariableDeclaration(declaration) && !isBindingPattern(declaration.name) && !(getCombinedModifierFlagsCached(declaration) & 32 /* Export */) && !(declaration.flags & 33554432 /* Ambient */)) {
|
|
56534
56568
|
if (!(getCombinedNodeFlagsCached(declaration) & 6 /* Constant */) && (!declaration.initializer || isNullOrUndefined3(declaration.initializer))) {
|
|
56535
56569
|
return autoType;
|
|
56536
56570
|
}
|
|
@@ -56578,7 +56612,7 @@ function createTypeChecker(host) {
|
|
|
56578
56612
|
if (isPropertyDeclaration(declaration) && (noImplicitAny || isInJSFile(declaration))) {
|
|
56579
56613
|
if (!hasStaticModifier(declaration)) {
|
|
56580
56614
|
const constructor = findConstructorDeclaration(declaration.parent);
|
|
56581
|
-
const type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : getEffectiveModifierFlags(declaration) &
|
|
56615
|
+
const type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : getEffectiveModifierFlags(declaration) & 128 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0;
|
|
56582
56616
|
return type && addOptionality(
|
|
56583
56617
|
type,
|
|
56584
56618
|
/*isProperty*/
|
|
@@ -56587,7 +56621,7 @@ function createTypeChecker(host) {
|
|
|
56587
56621
|
);
|
|
56588
56622
|
} else {
|
|
56589
56623
|
const staticBlocks = filter(declaration.parent.members, isClassStaticBlockDeclaration);
|
|
56590
|
-
const type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) : getEffectiveModifierFlags(declaration) &
|
|
56624
|
+
const type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) : getEffectiveModifierFlags(declaration) & 128 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0;
|
|
56591
56625
|
return type && addOptionality(
|
|
56592
56626
|
type,
|
|
56593
56627
|
/*isProperty*/
|
|
@@ -56691,7 +56725,7 @@ function createTypeChecker(host) {
|
|
|
56691
56725
|
return everyType(flowType, isNullableType) ? void 0 : convertAutoToAny(flowType);
|
|
56692
56726
|
}
|
|
56693
56727
|
function getFlowTypeOfProperty(reference, prop) {
|
|
56694
|
-
const initialType = (prop == null ? void 0 : prop.valueDeclaration) && (!isAutoTypedProperty(prop) || getEffectiveModifierFlags(prop.valueDeclaration) &
|
|
56728
|
+
const initialType = (prop == null ? void 0 : prop.valueDeclaration) && (!isAutoTypedProperty(prop) || getEffectiveModifierFlags(prop.valueDeclaration) & 128 /* Ambient */) && getTypeOfPropertyInBaseClass(prop) || undefinedType;
|
|
56695
56729
|
return getFlowTypeOfReference(reference, autoType, initialType);
|
|
56696
56730
|
}
|
|
56697
56731
|
function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) {
|
|
@@ -57315,6 +57349,9 @@ function createTypeChecker(host) {
|
|
|
57315
57349
|
function getTypeOfAlias(symbol) {
|
|
57316
57350
|
const links = getSymbolLinks(symbol);
|
|
57317
57351
|
if (!links.type) {
|
|
57352
|
+
if (!pushTypeResolution(symbol, 0 /* Type */)) {
|
|
57353
|
+
return errorType;
|
|
57354
|
+
}
|
|
57318
57355
|
const targetSymbol = resolveAlias(symbol);
|
|
57319
57356
|
const exportSymbol = symbol.declarations && getTargetOfAliasDeclaration(
|
|
57320
57357
|
getDeclarationOfAliasSymbol(symbol),
|
|
@@ -57323,6 +57360,10 @@ function createTypeChecker(host) {
|
|
|
57323
57360
|
);
|
|
57324
57361
|
const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d) => isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : void 0);
|
|
57325
57362
|
links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
|
|
57363
|
+
if (!popTypeResolution()) {
|
|
57364
|
+
reportCircularityError(exportSymbol ?? symbol);
|
|
57365
|
+
return links.type = errorType;
|
|
57366
|
+
}
|
|
57326
57367
|
}
|
|
57327
57368
|
return links.type;
|
|
57328
57369
|
}
|
|
@@ -57336,12 +57377,19 @@ function createTypeChecker(host) {
|
|
|
57336
57377
|
}
|
|
57337
57378
|
function reportCircularityError(symbol) {
|
|
57338
57379
|
const declaration = symbol.valueDeclaration;
|
|
57339
|
-
if (
|
|
57340
|
-
|
|
57341
|
-
|
|
57342
|
-
|
|
57343
|
-
|
|
57344
|
-
|
|
57380
|
+
if (declaration) {
|
|
57381
|
+
if (getEffectiveTypeAnnotationNode(declaration)) {
|
|
57382
|
+
error2(symbol.valueDeclaration, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
57383
|
+
return errorType;
|
|
57384
|
+
}
|
|
57385
|
+
if (noImplicitAny && (declaration.kind !== 169 /* Parameter */ || declaration.initializer)) {
|
|
57386
|
+
error2(symbol.valueDeclaration, Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol));
|
|
57387
|
+
}
|
|
57388
|
+
} else if (symbol.flags & 2097152 /* Alias */) {
|
|
57389
|
+
const node = getDeclarationOfAliasSymbol(symbol);
|
|
57390
|
+
if (node) {
|
|
57391
|
+
error2(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol));
|
|
57392
|
+
}
|
|
57345
57393
|
}
|
|
57346
57394
|
return anyType;
|
|
57347
57395
|
}
|
|
@@ -58344,7 +58392,7 @@ function createTypeChecker(host) {
|
|
|
58344
58392
|
const baseConstructorType = getBaseConstructorTypeOfClass(classType);
|
|
58345
58393
|
const baseSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */);
|
|
58346
58394
|
const declaration = getClassLikeDeclarationOfSymbol(classType.symbol);
|
|
58347
|
-
const isAbstract = !!declaration && hasSyntacticModifier(declaration,
|
|
58395
|
+
const isAbstract = !!declaration && hasSyntacticModifier(declaration, 64 /* Abstract */);
|
|
58348
58396
|
if (baseSignatures.length === 0) {
|
|
58349
58397
|
return [createSignature(
|
|
58350
58398
|
/*declaration*/
|
|
@@ -59120,7 +59168,7 @@ function createTypeChecker(host) {
|
|
|
59120
59168
|
}
|
|
59121
59169
|
function isConstTypeVariable(type, depth = 0) {
|
|
59122
59170
|
var _a;
|
|
59123
|
-
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d,
|
|
59171
|
+
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d, 4096 /* Const */)) || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isConstTypeVariable(t, depth)) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType, depth + 1) || type.flags & 16777216 /* Conditional */ && isConstTypeVariable(getConstraintOfConditionalType(type), depth + 1) || type.flags & 33554432 /* Substitution */ && isConstTypeVariable(type.baseType, depth) || isGenericTupleType(type) && findIndex(getElementTypes(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t, depth)) >= 0));
|
|
59124
59172
|
}
|
|
59125
59173
|
function getConstraintOfIndexedAccess(type) {
|
|
59126
59174
|
return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0;
|
|
@@ -59446,7 +59494,7 @@ function createTypeChecker(host) {
|
|
|
59446
59494
|
} else if (!isUnion && !isReadonlySymbol(prop)) {
|
|
59447
59495
|
checkFlags &= ~8 /* Readonly */;
|
|
59448
59496
|
}
|
|
59449
|
-
checkFlags |= (!(modifiers &
|
|
59497
|
+
checkFlags |= (!(modifiers & 6 /* NonPublicAccessibilityModifier */) ? 256 /* ContainsPublic */ : 0) | (modifiers & 4 /* Protected */ ? 512 /* ContainsProtected */ : 0) | (modifiers & 2 /* Private */ ? 1024 /* ContainsPrivate */ : 0) | (modifiers & 256 /* Static */ ? 2048 /* ContainsStatic */ : 0);
|
|
59450
59498
|
if (!isPrototypeProperty(prop)) {
|
|
59451
59499
|
syntheticFlag = 2 /* SyntheticProperty */;
|
|
59452
59500
|
}
|
|
@@ -59898,7 +59946,7 @@ function createTypeChecker(host) {
|
|
|
59898
59946
|
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
|
|
59899
59947
|
flags |= 1 /* HasRestParameter */;
|
|
59900
59948
|
}
|
|
59901
|
-
if (isConstructorTypeNode(declaration) && hasSyntacticModifier(declaration,
|
|
59949
|
+
if (isConstructorTypeNode(declaration) && hasSyntacticModifier(declaration, 64 /* Abstract */) || isConstructorDeclaration(declaration) && hasSyntacticModifier(declaration.parent, 64 /* Abstract */)) {
|
|
59902
59950
|
flags |= 4 /* Abstract */;
|
|
59903
59951
|
}
|
|
59904
59952
|
links.resolvedSignature = createSignature(
|
|
@@ -60268,7 +60316,7 @@ function createTypeChecker(host) {
|
|
|
60268
60316
|
if (parameter.type) {
|
|
60269
60317
|
forEachType(getTypeFromTypeNode(parameter.type), (keyType) => {
|
|
60270
60318
|
if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) {
|
|
60271
|
-
indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration,
|
|
60319
|
+
indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 8 /* Readonly */), declaration));
|
|
60272
60320
|
}
|
|
60273
60321
|
});
|
|
60274
60322
|
}
|
|
@@ -62093,7 +62141,7 @@ function createTypeChecker(host) {
|
|
|
62093
62141
|
return neverType;
|
|
62094
62142
|
}
|
|
62095
62143
|
function getLiteralTypeFromProperty(prop, include, includeNonPublic) {
|
|
62096
|
-
if (includeNonPublic || !(getDeclarationModifierFlagsFromSymbol(prop) &
|
|
62144
|
+
if (includeNonPublic || !(getDeclarationModifierFlagsFromSymbol(prop) & 6 /* NonPublicAccessibilityModifier */)) {
|
|
62097
62145
|
let type = getSymbolLinks(getLateBoundSymbol(prop)).nameType;
|
|
62098
62146
|
if (!type) {
|
|
62099
62147
|
const name = getNameOfDeclaration(prop.valueDeclaration);
|
|
@@ -62527,7 +62575,7 @@ function createTypeChecker(host) {
|
|
|
62527
62575
|
}
|
|
62528
62576
|
function isPatternLiteralPlaceholderType(type) {
|
|
62529
62577
|
if (type.flags & 2097152 /* Intersection */) {
|
|
62530
|
-
return some(type.types, (t) => !!(t.flags & (2944 /* Literal */ |
|
|
62578
|
+
return !isGenericType(type) && some(type.types, (t) => !!(t.flags & (2944 /* Literal */ | 98304 /* Nullable */)) || isPatternLiteralPlaceholderType(t));
|
|
62531
62579
|
}
|
|
62532
62580
|
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
62533
62581
|
}
|
|
@@ -63038,7 +63086,7 @@ function createTypeChecker(host) {
|
|
|
63038
63086
|
function getAnonymousPartialType(type2) {
|
|
63039
63087
|
const members = createSymbolTable();
|
|
63040
63088
|
for (const prop of getPropertiesOfType(type2)) {
|
|
63041
|
-
if (getDeclarationModifierFlagsFromSymbol(prop) & (
|
|
63089
|
+
if (getDeclarationModifierFlagsFromSymbol(prop) & (2 /* Private */ | 4 /* Protected */)) {
|
|
63042
63090
|
} else if (isSpreadableProperty(prop)) {
|
|
63043
63091
|
const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
|
|
63044
63092
|
const flags = 4 /* Property */ | 16777216 /* Optional */;
|
|
@@ -63100,7 +63148,7 @@ function createTypeChecker(host) {
|
|
|
63100
63148
|
const skippedPrivateMembers = /* @__PURE__ */ new Set();
|
|
63101
63149
|
const indexInfos = left === emptyObjectType ? getIndexInfosOfType(right) : getUnionIndexInfos([left, right]);
|
|
63102
63150
|
for (const rightProp of getPropertiesOfType(right)) {
|
|
63103
|
-
if (getDeclarationModifierFlagsFromSymbol(rightProp) & (
|
|
63151
|
+
if (getDeclarationModifierFlagsFromSymbol(rightProp) & (2 /* Private */ | 4 /* Protected */)) {
|
|
63104
63152
|
skippedPrivateMembers.add(rightProp.escapedName);
|
|
63105
63153
|
} else if (isSpreadableProperty(rightProp)) {
|
|
63106
63154
|
members.set(rightProp.escapedName, getSpreadSymbol(rightProp, readonly));
|
|
@@ -66667,25 +66715,25 @@ function createTypeChecker(host) {
|
|
|
66667
66715
|
function propertyRelatedTo(source2, target2, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState, skipOptional) {
|
|
66668
66716
|
const sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp);
|
|
66669
66717
|
const targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp);
|
|
66670
|
-
if (sourcePropFlags &
|
|
66718
|
+
if (sourcePropFlags & 2 /* Private */ || targetPropFlags & 2 /* Private */) {
|
|
66671
66719
|
if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) {
|
|
66672
66720
|
if (reportErrors2) {
|
|
66673
|
-
if (sourcePropFlags &
|
|
66721
|
+
if (sourcePropFlags & 2 /* Private */ && targetPropFlags & 2 /* Private */) {
|
|
66674
66722
|
reportError(Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp));
|
|
66675
66723
|
} else {
|
|
66676
|
-
reportError(Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourcePropFlags &
|
|
66724
|
+
reportError(Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourcePropFlags & 2 /* Private */ ? source2 : target2), typeToString(sourcePropFlags & 2 /* Private */ ? target2 : source2));
|
|
66677
66725
|
}
|
|
66678
66726
|
}
|
|
66679
66727
|
return 0 /* False */;
|
|
66680
66728
|
}
|
|
66681
|
-
} else if (targetPropFlags &
|
|
66729
|
+
} else if (targetPropFlags & 4 /* Protected */) {
|
|
66682
66730
|
if (!isValidOverrideOf(sourceProp, targetProp)) {
|
|
66683
66731
|
if (reportErrors2) {
|
|
66684
66732
|
reportError(Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(getDeclaringClass(sourceProp) || source2), typeToString(getDeclaringClass(targetProp) || target2));
|
|
66685
66733
|
}
|
|
66686
66734
|
return 0 /* False */;
|
|
66687
66735
|
}
|
|
66688
|
-
} else if (sourcePropFlags &
|
|
66736
|
+
} else if (sourcePropFlags & 4 /* Protected */) {
|
|
66689
66737
|
if (reportErrors2) {
|
|
66690
66738
|
reportError(Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source2), typeToString(target2));
|
|
66691
66739
|
}
|
|
@@ -67215,15 +67263,15 @@ function createTypeChecker(host) {
|
|
|
67215
67263
|
if (!sourceSignature.declaration || !targetSignature.declaration) {
|
|
67216
67264
|
return true;
|
|
67217
67265
|
}
|
|
67218
|
-
const sourceAccessibility = getSelectedEffectiveModifierFlags(sourceSignature.declaration,
|
|
67219
|
-
const targetAccessibility = getSelectedEffectiveModifierFlags(targetSignature.declaration,
|
|
67220
|
-
if (targetAccessibility ===
|
|
67266
|
+
const sourceAccessibility = getSelectedEffectiveModifierFlags(sourceSignature.declaration, 6 /* NonPublicAccessibilityModifier */);
|
|
67267
|
+
const targetAccessibility = getSelectedEffectiveModifierFlags(targetSignature.declaration, 6 /* NonPublicAccessibilityModifier */);
|
|
67268
|
+
if (targetAccessibility === 2 /* Private */) {
|
|
67221
67269
|
return true;
|
|
67222
67270
|
}
|
|
67223
|
-
if (targetAccessibility ===
|
|
67271
|
+
if (targetAccessibility === 4 /* Protected */ && sourceAccessibility !== 2 /* Private */) {
|
|
67224
67272
|
return true;
|
|
67225
67273
|
}
|
|
67226
|
-
if (targetAccessibility !==
|
|
67274
|
+
if (targetAccessibility !== 4 /* Protected */ && !sourceAccessibility) {
|
|
67227
67275
|
return true;
|
|
67228
67276
|
}
|
|
67229
67277
|
if (reportErrors2) {
|
|
@@ -67323,7 +67371,7 @@ function createTypeChecker(host) {
|
|
|
67323
67371
|
const variances = [];
|
|
67324
67372
|
for (const tp of typeParameters) {
|
|
67325
67373
|
const modifiers = getTypeParameterModifiers(tp);
|
|
67326
|
-
let variance = modifiers &
|
|
67374
|
+
let variance = modifiers & 16384 /* Out */ ? modifiers & 8192 /* In */ ? 0 /* Invariant */ : 1 /* Covariant */ : modifiers & 8192 /* In */ ? 2 /* Contravariant */ : void 0;
|
|
67327
67375
|
if (variance === void 0) {
|
|
67328
67376
|
let unmeasurable = false;
|
|
67329
67377
|
let unreliable = false;
|
|
@@ -67371,7 +67419,7 @@ function createTypeChecker(host) {
|
|
|
67371
67419
|
}
|
|
67372
67420
|
function getTypeParameterModifiers(tp) {
|
|
67373
67421
|
var _a;
|
|
67374
|
-
return reduceLeft((_a = tp.symbol) == null ? void 0 : _a.declarations, (modifiers, d) => modifiers | getEffectiveModifierFlags(d), 0 /* None */) & (
|
|
67422
|
+
return reduceLeft((_a = tp.symbol) == null ? void 0 : _a.declarations, (modifiers, d) => modifiers | getEffectiveModifierFlags(d), 0 /* None */) & (8192 /* In */ | 16384 /* Out */ | 4096 /* Const */);
|
|
67375
67423
|
}
|
|
67376
67424
|
function hasCovariantVoidArgument(typeArguments, variances) {
|
|
67377
67425
|
for (let i = 0; i < variances.length; i++) {
|
|
@@ -67456,10 +67504,10 @@ function createTypeChecker(host) {
|
|
|
67456
67504
|
});
|
|
67457
67505
|
}
|
|
67458
67506
|
function isValidOverrideOf(sourceProp, targetProp) {
|
|
67459
|
-
return !forEachProperty2(targetProp, (tp) => getDeclarationModifierFlagsFromSymbol(tp) &
|
|
67507
|
+
return !forEachProperty2(targetProp, (tp) => getDeclarationModifierFlagsFromSymbol(tp) & 4 /* Protected */ ? !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false);
|
|
67460
67508
|
}
|
|
67461
67509
|
function isClassDerivedFromDeclaringClasses(checkClass, prop, writing) {
|
|
67462
|
-
return forEachProperty2(prop, (p) => getDeclarationModifierFlagsFromSymbol(p, writing) &
|
|
67510
|
+
return forEachProperty2(prop, (p) => getDeclarationModifierFlagsFromSymbol(p, writing) & 4 /* Protected */ ? !hasBaseType(checkClass, getDeclaringClass(p)) : false) ? void 0 : checkClass;
|
|
67463
67511
|
}
|
|
67464
67512
|
function isDeeplyNestedType(type, stack, depth, maxDepth = 3) {
|
|
67465
67513
|
if (depth >= maxDepth) {
|
|
@@ -67536,8 +67584,8 @@ function createTypeChecker(host) {
|
|
|
67536
67584
|
if (sourceProp === targetProp) {
|
|
67537
67585
|
return -1 /* True */;
|
|
67538
67586
|
}
|
|
67539
|
-
const sourcePropAccessibility = getDeclarationModifierFlagsFromSymbol(sourceProp) &
|
|
67540
|
-
const targetPropAccessibility = getDeclarationModifierFlagsFromSymbol(targetProp) &
|
|
67587
|
+
const sourcePropAccessibility = getDeclarationModifierFlagsFromSymbol(sourceProp) & 6 /* NonPublicAccessibilityModifier */;
|
|
67588
|
+
const targetPropAccessibility = getDeclarationModifierFlagsFromSymbol(targetProp) & 6 /* NonPublicAccessibilityModifier */;
|
|
67541
67589
|
if (sourcePropAccessibility !== targetPropAccessibility) {
|
|
67542
67590
|
return 0 /* False */;
|
|
67543
67591
|
}
|
|
@@ -71531,7 +71579,7 @@ function createTypeChecker(host) {
|
|
|
71531
71579
|
if (languageVersion < 2 /* ES2015 */) {
|
|
71532
71580
|
if (container.kind === 219 /* ArrowFunction */) {
|
|
71533
71581
|
error2(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
|
|
71534
|
-
} else if (hasSyntacticModifier(container,
|
|
71582
|
+
} else if (hasSyntacticModifier(container, 1024 /* Async */)) {
|
|
71535
71583
|
error2(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);
|
|
71536
71584
|
}
|
|
71537
71585
|
}
|
|
@@ -71944,7 +71992,7 @@ function createTypeChecker(host) {
|
|
|
71944
71992
|
let inAsyncFunction = false;
|
|
71945
71993
|
if (!isCallExpression2) {
|
|
71946
71994
|
while (container && container.kind === 219 /* ArrowFunction */) {
|
|
71947
|
-
if (hasSyntacticModifier(container,
|
|
71995
|
+
if (hasSyntacticModifier(container, 1024 /* Async */))
|
|
71948
71996
|
inAsyncFunction = true;
|
|
71949
71997
|
container = getSuperContainer(
|
|
71950
71998
|
container,
|
|
@@ -71953,7 +72001,7 @@ function createTypeChecker(host) {
|
|
|
71953
72001
|
);
|
|
71954
72002
|
needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */;
|
|
71955
72003
|
}
|
|
71956
|
-
if (container && hasSyntacticModifier(container,
|
|
72004
|
+
if (container && hasSyntacticModifier(container, 1024 /* Async */))
|
|
71957
72005
|
inAsyncFunction = true;
|
|
71958
72006
|
}
|
|
71959
72007
|
let nodeCheckFlag = 0;
|
|
@@ -72285,7 +72333,24 @@ function createTypeChecker(host) {
|
|
|
72285
72333
|
}
|
|
72286
72334
|
const signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl);
|
|
72287
72335
|
if (signature && !isResolvingReturnTypeOfSignature(signature)) {
|
|
72288
|
-
|
|
72336
|
+
const returnType2 = getReturnTypeOfSignature(signature);
|
|
72337
|
+
const functionFlags = getFunctionFlags(functionDecl);
|
|
72338
|
+
if (functionFlags & 1 /* Generator */) {
|
|
72339
|
+
return filterType(returnType2, (t) => {
|
|
72340
|
+
return !!(t.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */ | 58982400 /* InstantiableNonPrimitive */)) || checkGeneratorInstantiationAssignabilityToReturnType(
|
|
72341
|
+
t,
|
|
72342
|
+
functionFlags,
|
|
72343
|
+
/*errorNode*/
|
|
72344
|
+
void 0
|
|
72345
|
+
);
|
|
72346
|
+
});
|
|
72347
|
+
}
|
|
72348
|
+
if (functionFlags & 2 /* Async */) {
|
|
72349
|
+
return filterType(returnType2, (t) => {
|
|
72350
|
+
return !!(t.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */ | 58982400 /* InstantiableNonPrimitive */)) || !!getAwaitedTypeOfPromise(t);
|
|
72351
|
+
});
|
|
72352
|
+
}
|
|
72353
|
+
return returnType2;
|
|
72289
72354
|
}
|
|
72290
72355
|
const iife = getImmediatelyInvokedFunctionExpression(functionDecl);
|
|
72291
72356
|
if (iife) {
|
|
@@ -72498,7 +72563,7 @@ function createTypeChecker(host) {
|
|
|
72498
72563
|
type,
|
|
72499
72564
|
(t) => {
|
|
72500
72565
|
var _a;
|
|
72501
|
-
if (isGenericMappedType(t) &&
|
|
72566
|
+
if (isGenericMappedType(t) && !t.declaration.nameType) {
|
|
72502
72567
|
const constraint = getConstraintTypeFromMappedType(t);
|
|
72503
72568
|
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
72504
72569
|
const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
|
|
@@ -74141,20 +74206,20 @@ function createTypeChecker(host) {
|
|
|
74141
74206
|
return false;
|
|
74142
74207
|
}
|
|
74143
74208
|
}
|
|
74144
|
-
if (flags &
|
|
74209
|
+
if (flags & 64 /* Abstract */) {
|
|
74145
74210
|
if (errorNode) {
|
|
74146
74211
|
error2(errorNode, Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop)));
|
|
74147
74212
|
}
|
|
74148
74213
|
return false;
|
|
74149
74214
|
}
|
|
74150
|
-
if (!(flags &
|
|
74215
|
+
if (!(flags & 256 /* Static */) && ((_a = prop.declarations) == null ? void 0 : _a.some(isClassInstanceProperty))) {
|
|
74151
74216
|
if (errorNode) {
|
|
74152
74217
|
error2(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString(prop));
|
|
74153
74218
|
}
|
|
74154
74219
|
return false;
|
|
74155
74220
|
}
|
|
74156
74221
|
}
|
|
74157
|
-
if (flags &
|
|
74222
|
+
if (flags & 64 /* Abstract */ && symbolHasNonMethodDeclaration(prop) && (isThisProperty(location) || isThisInitializedObjectBindingExpression(location) || isObjectBindingPattern(location.parent) && isThisInitializedDeclaration(location.parent.parent))) {
|
|
74158
74223
|
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
|
|
74159
74224
|
if (declaringClassDeclaration && isNodeUsedDuringClassInitialization(location)) {
|
|
74160
74225
|
if (errorNode) {
|
|
@@ -74163,10 +74228,10 @@ function createTypeChecker(host) {
|
|
|
74163
74228
|
return false;
|
|
74164
74229
|
}
|
|
74165
74230
|
}
|
|
74166
|
-
if (!(flags &
|
|
74231
|
+
if (!(flags & 6 /* NonPublicAccessibilityModifier */)) {
|
|
74167
74232
|
return true;
|
|
74168
74233
|
}
|
|
74169
|
-
if (flags &
|
|
74234
|
+
if (flags & 2 /* Private */) {
|
|
74170
74235
|
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
|
|
74171
74236
|
if (!isNodeWithinClass(location, declaringClassDeclaration)) {
|
|
74172
74237
|
if (errorNode) {
|
|
@@ -74186,14 +74251,14 @@ function createTypeChecker(host) {
|
|
|
74186
74251
|
if (!enclosingClass) {
|
|
74187
74252
|
enclosingClass = getEnclosingClassFromThisParameter(location);
|
|
74188
74253
|
enclosingClass = enclosingClass && isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing);
|
|
74189
|
-
if (flags &
|
|
74254
|
+
if (flags & 256 /* Static */ || !enclosingClass) {
|
|
74190
74255
|
if (errorNode) {
|
|
74191
74256
|
error2(errorNode, Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || containingType));
|
|
74192
74257
|
}
|
|
74193
74258
|
return false;
|
|
74194
74259
|
}
|
|
74195
74260
|
}
|
|
74196
|
-
if (flags &
|
|
74261
|
+
if (flags & 256 /* Static */) {
|
|
74197
74262
|
return true;
|
|
74198
74263
|
}
|
|
74199
74264
|
if (containingType.flags & 262144 /* TypeParameter */) {
|
|
@@ -74613,7 +74678,7 @@ function createTypeChecker(host) {
|
|
|
74613
74678
|
}
|
|
74614
74679
|
let diagnosticMessage;
|
|
74615
74680
|
const declarationName = idText(right);
|
|
74616
|
-
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) &
|
|
74681
|
+
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 256 /* Static */) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) {
|
|
74617
74682
|
diagnosticMessage = error2(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
|
|
74618
74683
|
} else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
|
|
74619
74684
|
diagnosticMessage = error2(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
@@ -74867,7 +74932,7 @@ function createTypeChecker(host) {
|
|
|
74867
74932
|
if (!valueDeclaration) {
|
|
74868
74933
|
return;
|
|
74869
74934
|
}
|
|
74870
|
-
const hasPrivateModifier = hasEffectiveModifier(valueDeclaration,
|
|
74935
|
+
const hasPrivateModifier = hasEffectiveModifier(valueDeclaration, 2 /* Private */);
|
|
74871
74936
|
const hasPrivateIdentifier = prop.valueDeclaration && isNamedDeclaration(prop.valueDeclaration) && isPrivateIdentifier(prop.valueDeclaration.name);
|
|
74872
74937
|
if (!hasPrivateModifier && !hasPrivateIdentifier) {
|
|
74873
74938
|
return;
|
|
@@ -76312,7 +76377,7 @@ function createTypeChecker(host) {
|
|
|
76312
76377
|
return resolveErrorCall(node);
|
|
76313
76378
|
}
|
|
76314
76379
|
const valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol);
|
|
76315
|
-
if (valueDecl && hasSyntacticModifier(valueDecl,
|
|
76380
|
+
if (valueDecl && hasSyntacticModifier(valueDecl, 64 /* Abstract */)) {
|
|
76316
76381
|
error2(node, Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
|
|
76317
76382
|
return resolveErrorCall(node);
|
|
76318
76383
|
}
|
|
@@ -76375,7 +76440,7 @@ function createTypeChecker(host) {
|
|
|
76375
76440
|
return true;
|
|
76376
76441
|
}
|
|
76377
76442
|
const declaration = signature.declaration;
|
|
76378
|
-
const modifiers = getSelectedEffectiveModifierFlags(declaration,
|
|
76443
|
+
const modifiers = getSelectedEffectiveModifierFlags(declaration, 6 /* NonPublicAccessibilityModifier */);
|
|
76379
76444
|
if (!modifiers || declaration.kind !== 176 /* Constructor */) {
|
|
76380
76445
|
return true;
|
|
76381
76446
|
}
|
|
@@ -76383,16 +76448,16 @@ function createTypeChecker(host) {
|
|
|
76383
76448
|
const declaringClass = getDeclaredTypeOfSymbol(declaration.parent.symbol);
|
|
76384
76449
|
if (!isNodeWithinClass(node, declaringClassDeclaration)) {
|
|
76385
76450
|
const containingClass = getContainingClass(node);
|
|
76386
|
-
if (containingClass && modifiers &
|
|
76451
|
+
if (containingClass && modifiers & 4 /* Protected */) {
|
|
76387
76452
|
const containingType = getTypeOfNode(containingClass);
|
|
76388
76453
|
if (typeHasProtectedAccessibleBase(declaration.parent.symbol, containingType)) {
|
|
76389
76454
|
return true;
|
|
76390
76455
|
}
|
|
76391
76456
|
}
|
|
76392
|
-
if (modifiers &
|
|
76457
|
+
if (modifiers & 2 /* Private */) {
|
|
76393
76458
|
error2(node, Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration, typeToString(declaringClass));
|
|
76394
76459
|
}
|
|
76395
|
-
if (modifiers &
|
|
76460
|
+
if (modifiers & 4 /* Protected */) {
|
|
76396
76461
|
error2(node, Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration, typeToString(declaringClass));
|
|
76397
76462
|
}
|
|
76398
76463
|
return false;
|
|
@@ -78369,7 +78434,7 @@ function createTypeChecker(host) {
|
|
|
78369
78434
|
return !setProp;
|
|
78370
78435
|
}
|
|
78371
78436
|
function isReadonlySymbol(symbol) {
|
|
78372
|
-
return !!(getCheckFlags(symbol) & 8 /* Readonly */ || symbol.flags & 4 /* Property */ && getDeclarationModifierFlagsFromSymbol(symbol) &
|
|
78437
|
+
return !!(getCheckFlags(symbol) & 8 /* Readonly */ || symbol.flags & 4 /* Property */ && getDeclarationModifierFlagsFromSymbol(symbol) & 8 /* Readonly */ || symbol.flags & 3 /* Variable */ && getDeclarationNodeFlagsFromSymbol(symbol) & 6 /* Constant */ || symbol.flags & 98304 /* Accessor */ && !(symbol.flags & 65536 /* SetAccessor */) || symbol.flags & 8 /* EnumMember */ || some(symbol.declarations, isReadonlyAssignmentDeclaration));
|
|
78373
78438
|
}
|
|
78374
78439
|
function isAssignmentToReadonlyEntity(expr, symbol, assignmentKind) {
|
|
78375
78440
|
var _a, _b;
|
|
@@ -79486,7 +79551,15 @@ function createTypeChecker(host) {
|
|
|
79486
79551
|
checkExternalEmitHelpers(node, 256 /* Values */);
|
|
79487
79552
|
}
|
|
79488
79553
|
}
|
|
79489
|
-
|
|
79554
|
+
let returnType = getReturnTypeFromAnnotation(func);
|
|
79555
|
+
if (returnType && returnType.flags & 1048576 /* Union */) {
|
|
79556
|
+
returnType = filterType(returnType, (t) => checkGeneratorInstantiationAssignabilityToReturnType(
|
|
79557
|
+
t,
|
|
79558
|
+
functionFlags,
|
|
79559
|
+
/*errorNode*/
|
|
79560
|
+
void 0
|
|
79561
|
+
));
|
|
79562
|
+
}
|
|
79490
79563
|
const iterationTypes = returnType && getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsync);
|
|
79491
79564
|
const signatureYieldType = iterationTypes && iterationTypes.yieldType || anyType;
|
|
79492
79565
|
const signatureNextType = iterationTypes && iterationTypes.nextType || anyType;
|
|
@@ -80107,15 +80180,15 @@ function createTypeChecker(host) {
|
|
|
80107
80180
|
var _a, _b;
|
|
80108
80181
|
if (isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent)) {
|
|
80109
80182
|
const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node));
|
|
80110
|
-
const modifiers = getTypeParameterModifiers(typeParameter) & (
|
|
80183
|
+
const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
|
|
80111
80184
|
if (modifiers) {
|
|
80112
80185
|
const symbol = getSymbolOfDeclaration(node.parent);
|
|
80113
80186
|
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
80114
80187
|
error2(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
80115
|
-
} else if (modifiers ===
|
|
80188
|
+
} else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
|
|
80116
80189
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|
|
80117
|
-
const source = createMarkerType(symbol, typeParameter, modifiers ===
|
|
80118
|
-
const target = createMarkerType(symbol, typeParameter, modifiers ===
|
|
80190
|
+
const source = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSubTypeForCheck : markerSuperTypeForCheck);
|
|
80191
|
+
const target = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSuperTypeForCheck : markerSubTypeForCheck);
|
|
80119
80192
|
const saveVarianceTypeParameter = typeParameter;
|
|
80120
80193
|
varianceTypeParameter = typeParameter;
|
|
80121
80194
|
checkTypeAssignableTo(source, target, node, Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation);
|
|
@@ -80129,7 +80202,7 @@ function createTypeChecker(host) {
|
|
|
80129
80202
|
checkGrammarModifiers(node);
|
|
80130
80203
|
checkVariableLikeDeclaration(node);
|
|
80131
80204
|
const func = getContainingFunction(node);
|
|
80132
|
-
if (hasSyntacticModifier(node,
|
|
80205
|
+
if (hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) {
|
|
80133
80206
|
if (!(func.kind === 176 /* Constructor */ && nodeIsPresent(func.body))) {
|
|
80134
80207
|
error2(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
|
|
80135
80208
|
}
|
|
@@ -80299,11 +80372,7 @@ function createTypeChecker(host) {
|
|
|
80299
80372
|
if (returnType === voidType) {
|
|
80300
80373
|
error2(returnTypeErrorLocation, Diagnostics.A_generator_cannot_have_a_void_type_annotation);
|
|
80301
80374
|
} else {
|
|
80302
|
-
|
|
80303
|
-
const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || generatorYieldType;
|
|
80304
|
-
const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || unknownType;
|
|
80305
|
-
const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags2 & 2 /* Async */));
|
|
80306
|
-
checkTypeAssignableTo(generatorInstantiation, returnType, returnTypeErrorLocation);
|
|
80375
|
+
checkGeneratorInstantiationAssignabilityToReturnType(returnType, functionFlags2, returnTypeErrorLocation);
|
|
80307
80376
|
}
|
|
80308
80377
|
} else if ((functionFlags2 & 3 /* AsyncGenerator */) === 2 /* Async */) {
|
|
80309
80378
|
checkAsyncFunctionReturnType(node, returnTypeNode, returnTypeErrorLocation);
|
|
@@ -80314,6 +80383,13 @@ function createTypeChecker(host) {
|
|
|
80314
80383
|
}
|
|
80315
80384
|
}
|
|
80316
80385
|
}
|
|
80386
|
+
function checkGeneratorInstantiationAssignabilityToReturnType(returnType, functionFlags, errorNode) {
|
|
80387
|
+
const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, (functionFlags & 2 /* Async */) !== 0) || anyType;
|
|
80388
|
+
const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags & 2 /* Async */) !== 0) || generatorYieldType;
|
|
80389
|
+
const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags & 2 /* Async */) !== 0) || unknownType;
|
|
80390
|
+
const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags & 2 /* Async */));
|
|
80391
|
+
return checkTypeAssignableTo(generatorInstantiation, returnType, errorNode);
|
|
80392
|
+
}
|
|
80317
80393
|
function checkClassForDuplicateDeclarations(node) {
|
|
80318
80394
|
const instanceNames = /* @__PURE__ */ new Map();
|
|
80319
80395
|
const staticNames = /* @__PURE__ */ new Map();
|
|
@@ -80461,7 +80537,7 @@ function createTypeChecker(host) {
|
|
|
80461
80537
|
checkGrammarComputedPropertyName(node.name);
|
|
80462
80538
|
checkVariableLikeDeclaration(node);
|
|
80463
80539
|
setNodeLinksForPrivateIdentifierScope(node);
|
|
80464
|
-
if (hasSyntacticModifier(node,
|
|
80540
|
+
if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 172 /* PropertyDeclaration */ && node.initializer) {
|
|
80465
80541
|
error2(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name));
|
|
80466
80542
|
}
|
|
80467
80543
|
}
|
|
@@ -80478,7 +80554,7 @@ function createTypeChecker(host) {
|
|
|
80478
80554
|
error2(node.name, Diagnostics.Class_constructor_may_not_be_a_generator);
|
|
80479
80555
|
}
|
|
80480
80556
|
checkFunctionOrMethodDeclaration(node);
|
|
80481
|
-
if (hasSyntacticModifier(node,
|
|
80557
|
+
if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 174 /* MethodDeclaration */ && node.body) {
|
|
80482
80558
|
error2(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name));
|
|
80483
80559
|
}
|
|
80484
80560
|
if (isPrivateIdentifier(node.name) && !getContainingClass(node)) {
|
|
@@ -80535,7 +80611,7 @@ function createTypeChecker(host) {
|
|
|
80535
80611
|
if (classExtendsNull) {
|
|
80536
80612
|
error2(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
|
|
80537
80613
|
}
|
|
80538
|
-
const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p,
|
|
80614
|
+
const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 31 /* ParameterPropertyModifier */)));
|
|
80539
80615
|
if (superCallShouldBeRootLevel) {
|
|
80540
80616
|
if (!superCallIsRootLevelInConstructor(superCall, node.body)) {
|
|
80541
80617
|
error2(superCall, Diagnostics.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers);
|
|
@@ -80604,11 +80680,11 @@ function createTypeChecker(host) {
|
|
|
80604
80680
|
getNodeLinks(getter).flags |= 1 /* TypeChecked */;
|
|
80605
80681
|
const getterFlags = getEffectiveModifierFlags(getter);
|
|
80606
80682
|
const setterFlags = getEffectiveModifierFlags(setter);
|
|
80607
|
-
if ((getterFlags &
|
|
80683
|
+
if ((getterFlags & 64 /* Abstract */) !== (setterFlags & 64 /* Abstract */)) {
|
|
80608
80684
|
error2(getter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract);
|
|
80609
80685
|
error2(setter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract);
|
|
80610
80686
|
}
|
|
80611
|
-
if (getterFlags &
|
|
80687
|
+
if (getterFlags & 4 /* Protected */ && !(setterFlags & (4 /* Protected */ | 2 /* Private */)) || getterFlags & 2 /* Private */ && !(setterFlags & 2 /* Private */)) {
|
|
80612
80688
|
error2(getter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter);
|
|
80613
80689
|
error2(setter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter);
|
|
80614
80690
|
}
|
|
@@ -80788,7 +80864,7 @@ function createTypeChecker(host) {
|
|
|
80788
80864
|
const propertyName = getPropertyNameFromIndex(indexType, accessNode);
|
|
80789
80865
|
if (propertyName) {
|
|
80790
80866
|
const propertySymbol = forEachType(apparentObjectType, (t) => getPropertyOfType(t, propertyName));
|
|
80791
|
-
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) &
|
|
80867
|
+
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6 /* NonPublicAccessibilityModifier */) {
|
|
80792
80868
|
error2(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, unescapeLeadingUnderscores(propertyName));
|
|
80793
80869
|
return errorType;
|
|
80794
80870
|
}
|
|
@@ -80886,16 +80962,16 @@ function createTypeChecker(host) {
|
|
|
80886
80962
|
getTypeFromTypeNode(node);
|
|
80887
80963
|
}
|
|
80888
80964
|
function isPrivateWithinAmbient(node) {
|
|
80889
|
-
return (hasEffectiveModifier(node,
|
|
80965
|
+
return (hasEffectiveModifier(node, 2 /* Private */) || isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags & 33554432 /* Ambient */);
|
|
80890
80966
|
}
|
|
80891
80967
|
function getEffectiveDeclarationFlags(n, flagsToCheck) {
|
|
80892
80968
|
let flags = getCombinedModifierFlagsCached(n);
|
|
80893
80969
|
if (n.parent.kind !== 264 /* InterfaceDeclaration */ && n.parent.kind !== 263 /* ClassDeclaration */ && n.parent.kind !== 231 /* ClassExpression */ && n.flags & 33554432 /* Ambient */) {
|
|
80894
80970
|
const container = getEnclosingContainer(n);
|
|
80895
|
-
if (container && container.flags & 128 /* ExportContext */ && !(flags &
|
|
80896
|
-
flags |=
|
|
80971
|
+
if (container && container.flags & 128 /* ExportContext */ && !(flags & 128 /* Ambient */) && !(isModuleBlock(n.parent) && isModuleDeclaration(n.parent.parent) && isGlobalScopeAugmentation(n.parent.parent))) {
|
|
80972
|
+
flags |= 32 /* Export */;
|
|
80897
80973
|
}
|
|
80898
|
-
flags |=
|
|
80974
|
+
flags |= 128 /* Ambient */;
|
|
80899
80975
|
}
|
|
80900
80976
|
return flags & flagsToCheck;
|
|
80901
80977
|
}
|
|
@@ -80913,13 +80989,13 @@ function createTypeChecker(host) {
|
|
|
80913
80989
|
const canonicalFlags = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck2);
|
|
80914
80990
|
forEach(overloads, (o) => {
|
|
80915
80991
|
const deviation = getEffectiveDeclarationFlags(o, flagsToCheck2) ^ canonicalFlags;
|
|
80916
|
-
if (deviation &
|
|
80992
|
+
if (deviation & 32 /* Export */) {
|
|
80917
80993
|
error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported);
|
|
80918
|
-
} else if (deviation &
|
|
80994
|
+
} else if (deviation & 128 /* Ambient */) {
|
|
80919
80995
|
error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient);
|
|
80920
|
-
} else if (deviation & (
|
|
80996
|
+
} else if (deviation & (2 /* Private */ | 4 /* Protected */)) {
|
|
80921
80997
|
error2(getNameOfDeclaration(o) || o, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected);
|
|
80922
|
-
} else if (deviation &
|
|
80998
|
+
} else if (deviation & 64 /* Abstract */) {
|
|
80923
80999
|
error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract);
|
|
80924
81000
|
}
|
|
80925
81001
|
});
|
|
@@ -80936,7 +81012,7 @@ function createTypeChecker(host) {
|
|
|
80936
81012
|
});
|
|
80937
81013
|
}
|
|
80938
81014
|
}
|
|
80939
|
-
const flagsToCheck =
|
|
81015
|
+
const flagsToCheck = 32 /* Export */ | 128 /* Ambient */ | 2 /* Private */ | 4 /* Protected */ | 64 /* Abstract */;
|
|
80940
81016
|
let someNodeFlags = 0 /* None */;
|
|
80941
81017
|
let allNodeFlags = flagsToCheck;
|
|
80942
81018
|
let someHaveQuestionToken = false;
|
|
@@ -80984,7 +81060,7 @@ function createTypeChecker(host) {
|
|
|
80984
81060
|
if (isConstructor) {
|
|
80985
81061
|
error2(errorNode, Diagnostics.Constructor_implementation_is_missing);
|
|
80986
81062
|
} else {
|
|
80987
|
-
if (hasSyntacticModifier(node,
|
|
81063
|
+
if (hasSyntacticModifier(node, 64 /* Abstract */)) {
|
|
80988
81064
|
error2(errorNode, Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive);
|
|
80989
81065
|
} else {
|
|
80990
81066
|
error2(errorNode, Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration);
|
|
@@ -81070,7 +81146,7 @@ function createTypeChecker(host) {
|
|
|
81070
81146
|
}
|
|
81071
81147
|
});
|
|
81072
81148
|
}
|
|
81073
|
-
if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && !hasSyntacticModifier(lastSeenNonAmbientDeclaration,
|
|
81149
|
+
if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && !hasSyntacticModifier(lastSeenNonAmbientDeclaration, 64 /* Abstract */) && !lastSeenNonAmbientDeclaration.questionToken) {
|
|
81074
81150
|
reportImplementationExpectedError(lastSeenNonAmbientDeclaration);
|
|
81075
81151
|
}
|
|
81076
81152
|
if (hasOverloads) {
|
|
@@ -81113,9 +81189,9 @@ function createTypeChecker(host) {
|
|
|
81113
81189
|
let defaultExportedDeclarationSpaces = 0 /* None */;
|
|
81114
81190
|
for (const d of symbol.declarations) {
|
|
81115
81191
|
const declarationSpaces = getDeclarationSpaces(d);
|
|
81116
|
-
const effectiveDeclarationFlags = getEffectiveDeclarationFlags(d,
|
|
81117
|
-
if (effectiveDeclarationFlags &
|
|
81118
|
-
if (effectiveDeclarationFlags &
|
|
81192
|
+
const effectiveDeclarationFlags = getEffectiveDeclarationFlags(d, 32 /* Export */ | 2048 /* Default */);
|
|
81193
|
+
if (effectiveDeclarationFlags & 32 /* Export */) {
|
|
81194
|
+
if (effectiveDeclarationFlags & 2048 /* Default */) {
|
|
81119
81195
|
defaultExportedDeclarationSpaces |= declarationSpaces;
|
|
81120
81196
|
} else {
|
|
81121
81197
|
exportedDeclarationSpaces |= declarationSpaces;
|
|
@@ -81756,6 +81832,12 @@ function createTypeChecker(host) {
|
|
|
81756
81832
|
}
|
|
81757
81833
|
}
|
|
81758
81834
|
}
|
|
81835
|
+
function checkJSDocThisTag(node) {
|
|
81836
|
+
const host2 = getEffectiveJSDocHost(node);
|
|
81837
|
+
if (host2 && isArrowFunction(host2)) {
|
|
81838
|
+
error2(node.tagName, Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
|
|
81839
|
+
}
|
|
81840
|
+
}
|
|
81759
81841
|
function checkJSDocImplementsTag(node) {
|
|
81760
81842
|
const classLike = getEffectiveJSDocHost(node);
|
|
81761
81843
|
if (!classLike || !isClassDeclaration(classLike) && !isClassExpression(classLike)) {
|
|
@@ -81918,13 +82000,13 @@ function createTypeChecker(host) {
|
|
|
81918
82000
|
break;
|
|
81919
82001
|
}
|
|
81920
82002
|
const symbol = getSymbolOfDeclaration(member);
|
|
81921
|
-
if (!symbol.isReferenced && (hasEffectiveModifier(member,
|
|
82003
|
+
if (!symbol.isReferenced && (hasEffectiveModifier(member, 2 /* Private */) || isNamedDeclaration(member) && isPrivateIdentifier(member.name)) && !(member.flags & 33554432 /* Ambient */)) {
|
|
81922
82004
|
addDiagnostic(member, 0 /* Local */, createDiagnosticForNode(member.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
|
|
81923
82005
|
}
|
|
81924
82006
|
break;
|
|
81925
82007
|
case 176 /* Constructor */:
|
|
81926
82008
|
for (const parameter of member.parameters) {
|
|
81927
|
-
if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter,
|
|
82009
|
+
if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter, 2 /* Private */)) {
|
|
81928
82010
|
addDiagnostic(parameter, 0 /* Local */, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol)));
|
|
81929
82011
|
}
|
|
81930
82012
|
}
|
|
@@ -82370,7 +82452,7 @@ function createTypeChecker(host) {
|
|
|
82370
82452
|
}
|
|
82371
82453
|
forEach(node.name.elements, checkSourceElement);
|
|
82372
82454
|
}
|
|
82373
|
-
if (
|
|
82455
|
+
if (node.initializer && isParameterDeclaration(node) && nodeIsMissing(getContainingFunction(node).body)) {
|
|
82374
82456
|
error2(node, Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);
|
|
82375
82457
|
return;
|
|
82376
82458
|
}
|
|
@@ -82500,7 +82582,7 @@ function createTypeChecker(host) {
|
|
|
82500
82582
|
if (hasQuestionToken(left) !== hasQuestionToken(right)) {
|
|
82501
82583
|
return false;
|
|
82502
82584
|
}
|
|
82503
|
-
const interestingFlags =
|
|
82585
|
+
const interestingFlags = 2 /* Private */ | 4 /* Protected */ | 1024 /* Async */ | 64 /* Abstract */ | 8 /* Readonly */ | 256 /* Static */;
|
|
82504
82586
|
return getSelectedEffectiveModifierFlags(left, interestingFlags) === getSelectedEffectiveModifierFlags(right, interestingFlags);
|
|
82505
82587
|
}
|
|
82506
82588
|
function checkVariableDeclaration(node) {
|
|
@@ -83828,7 +83910,7 @@ function createTypeChecker(host) {
|
|
|
83828
83910
|
if (legacyDecorators && firstDecorator && some(node.members, (p) => hasStaticModifier(p) && isPrivateIdentifierClassElementDeclaration(p))) {
|
|
83829
83911
|
grammarErrorOnNode(firstDecorator, Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator);
|
|
83830
83912
|
}
|
|
83831
|
-
if (!node.name && !hasSyntacticModifier(node,
|
|
83913
|
+
if (!node.name && !hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
83832
83914
|
grammarErrorOnFirstToken(node, Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name);
|
|
83833
83915
|
}
|
|
83834
83916
|
checkClassLikeDeclaration(node);
|
|
@@ -83894,7 +83976,7 @@ function createTypeChecker(host) {
|
|
|
83894
83976
|
error2(node.name || node, Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any);
|
|
83895
83977
|
} else {
|
|
83896
83978
|
const constructSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */);
|
|
83897
|
-
if (constructSignatures.some((signature) => signature.flags & 4 /* Abstract */) && !hasSyntacticModifier(node,
|
|
83979
|
+
if (constructSignatures.some((signature) => signature.flags & 4 /* Abstract */) && !hasSyntacticModifier(node, 64 /* Abstract */)) {
|
|
83898
83980
|
error2(node.name || node, Diagnostics.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract);
|
|
83899
83981
|
}
|
|
83900
83982
|
}
|
|
@@ -84108,7 +84190,7 @@ function createTypeChecker(host) {
|
|
|
84108
84190
|
const signatures = getSignaturesOfType(type, 1 /* Construct */);
|
|
84109
84191
|
if (signatures.length) {
|
|
84110
84192
|
const declaration = signatures[0].declaration;
|
|
84111
|
-
if (declaration && hasEffectiveModifier(declaration,
|
|
84193
|
+
if (declaration && hasEffectiveModifier(declaration, 2 /* Private */)) {
|
|
84112
84194
|
const typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol);
|
|
84113
84195
|
if (!isNodeWithinClass(node, typeClassDeclaration)) {
|
|
84114
84196
|
error2(node, Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol));
|
|
@@ -84128,7 +84210,7 @@ function createTypeChecker(host) {
|
|
|
84128
84210
|
const baseTypes = baseTypeNode && getBaseTypes(type);
|
|
84129
84211
|
const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0;
|
|
84130
84212
|
const baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
84131
|
-
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member,
|
|
84213
|
+
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16 /* Override */);
|
|
84132
84214
|
return checkMemberForOverrideModifier(
|
|
84133
84215
|
node,
|
|
84134
84216
|
staticType,
|
|
@@ -84169,7 +84251,7 @@ function createTypeChecker(host) {
|
|
|
84169
84251
|
Debug.assert(!!derived, "derived should point to something, even if it is the base class' declaration.");
|
|
84170
84252
|
if (derived === base) {
|
|
84171
84253
|
const derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol);
|
|
84172
|
-
if (baseDeclarationFlags &
|
|
84254
|
+
if (baseDeclarationFlags & 64 /* Abstract */ && (!derivedClassDecl || !hasSyntacticModifier(derivedClassDecl, 64 /* Abstract */))) {
|
|
84173
84255
|
for (const otherBaseType of getBaseTypes(type)) {
|
|
84174
84256
|
if (otherBaseType === baseType)
|
|
84175
84257
|
continue;
|
|
@@ -84212,7 +84294,7 @@ function createTypeChecker(host) {
|
|
|
84212
84294
|
}
|
|
84213
84295
|
} else {
|
|
84214
84296
|
const derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived);
|
|
84215
|
-
if (baseDeclarationFlags &
|
|
84297
|
+
if (baseDeclarationFlags & 2 /* Private */ || derivedDeclarationFlags & 2 /* Private */) {
|
|
84216
84298
|
continue;
|
|
84217
84299
|
}
|
|
84218
84300
|
let errorMessage;
|
|
@@ -84229,7 +84311,7 @@ function createTypeChecker(host) {
|
|
|
84229
84311
|
error2(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
84230
84312
|
} else if (useDefineForClassFields) {
|
|
84231
84313
|
const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer);
|
|
84232
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags &
|
|
84314
|
+
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 64 /* Abstract */) && !(derivedDeclarationFlags & 64 /* Abstract */) && !((_d = derived.declarations) == null ? void 0 : _d.some((d) => !!(d.flags & 33554432 /* Ambient */)))) {
|
|
84233
84315
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
84234
84316
|
const propName = uninitialized.name;
|
|
84235
84317
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -84256,7 +84338,7 @@ function createTypeChecker(host) {
|
|
|
84256
84338
|
}
|
|
84257
84339
|
}
|
|
84258
84340
|
function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
|
|
84259
|
-
return baseDeclarationFlags &
|
|
84341
|
+
return baseDeclarationFlags & 64 /* Abstract */ && (!isPropertyDeclaration(declaration) || !declaration.initializer) || isInterfaceDeclaration(declaration.parent);
|
|
84260
84342
|
}
|
|
84261
84343
|
function getNonInheritedProperties(type, baseTypes, properties) {
|
|
84262
84344
|
if (!length(baseTypes)) {
|
|
@@ -84321,7 +84403,7 @@ function createTypeChecker(host) {
|
|
|
84321
84403
|
}
|
|
84322
84404
|
const constructor = findConstructorDeclaration(node);
|
|
84323
84405
|
for (const member of node.members) {
|
|
84324
|
-
if (getEffectiveModifierFlags(member) &
|
|
84406
|
+
if (getEffectiveModifierFlags(member) & 128 /* Ambient */) {
|
|
84325
84407
|
continue;
|
|
84326
84408
|
}
|
|
84327
84409
|
if (!isStatic(member) && isPropertyWithoutInitializer(member)) {
|
|
@@ -84908,7 +84990,7 @@ function createTypeChecker(host) {
|
|
|
84908
84990
|
name
|
|
84909
84991
|
);
|
|
84910
84992
|
}
|
|
84911
|
-
if (isType && node.kind === 271 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node,
|
|
84993
|
+
if (isType && node.kind === 271 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 32 /* Export */)) {
|
|
84912
84994
|
error2(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, isolatedModulesLikeFlagName);
|
|
84913
84995
|
}
|
|
84914
84996
|
break;
|
|
@@ -85030,7 +85112,7 @@ function createTypeChecker(host) {
|
|
|
85030
85112
|
checkGrammarModifiers(node);
|
|
85031
85113
|
if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
|
|
85032
85114
|
checkImportBinding(node);
|
|
85033
|
-
if (hasSyntacticModifier(node,
|
|
85115
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
85034
85116
|
markExportAsReferenced(node);
|
|
85035
85117
|
}
|
|
85036
85118
|
if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
|
|
@@ -85442,6 +85524,8 @@ function createTypeChecker(host) {
|
|
|
85442
85524
|
return checkJSDocAccessibilityModifiers(node);
|
|
85443
85525
|
case 357 /* JSDocSatisfiesTag */:
|
|
85444
85526
|
return checkJSDocSatisfiesTag(node);
|
|
85527
|
+
case 350 /* JSDocThisTag */:
|
|
85528
|
+
return checkJSDocThisTag(node);
|
|
85445
85529
|
case 199 /* IndexedAccessType */:
|
|
85446
85530
|
return checkIndexedAccessType(node);
|
|
85447
85531
|
case 200 /* MappedType */:
|
|
@@ -86668,7 +86752,7 @@ function createTypeChecker(host) {
|
|
|
86668
86752
|
return true;
|
|
86669
86753
|
}
|
|
86670
86754
|
const target = getSymbolLinks(symbol).aliasTarget;
|
|
86671
|
-
if (target && getEffectiveModifierFlags(node) &
|
|
86755
|
+
if (target && getEffectiveModifierFlags(node) & 32 /* Export */ && getSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
|
|
86672
86756
|
return true;
|
|
86673
86757
|
}
|
|
86674
86758
|
}
|
|
@@ -86693,10 +86777,10 @@ function createTypeChecker(host) {
|
|
|
86693
86777
|
return false;
|
|
86694
86778
|
}
|
|
86695
86779
|
function isRequiredInitializedParameter(parameter) {
|
|
86696
|
-
return !!strictNullChecks && !isOptionalParameter(parameter) && !isJSDocParameterTag(parameter) && !!parameter.initializer && !hasSyntacticModifier(parameter,
|
|
86780
|
+
return !!strictNullChecks && !isOptionalParameter(parameter) && !isJSDocParameterTag(parameter) && !!parameter.initializer && !hasSyntacticModifier(parameter, 31 /* ParameterPropertyModifier */);
|
|
86697
86781
|
}
|
|
86698
86782
|
function isOptionalUninitializedParameterProperty(parameter) {
|
|
86699
|
-
return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && hasSyntacticModifier(parameter,
|
|
86783
|
+
return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && hasSyntacticModifier(parameter, 31 /* ParameterPropertyModifier */);
|
|
86700
86784
|
}
|
|
86701
86785
|
function isExpandoFunctionDeclaration(node) {
|
|
86702
86786
|
const declaration = getParseTreeNode(node, isFunctionDeclaration);
|
|
@@ -87550,10 +87634,10 @@ function createTypeChecker(host) {
|
|
|
87550
87634
|
return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
|
|
87551
87635
|
}
|
|
87552
87636
|
}
|
|
87553
|
-
if (flags & ~(
|
|
87637
|
+
if (flags & ~(2080 /* ExportDefault */ | 32768 /* Decorator */)) {
|
|
87554
87638
|
return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here);
|
|
87555
87639
|
}
|
|
87556
|
-
if (hasLeadingDecorators && flags &
|
|
87640
|
+
if (hasLeadingDecorators && flags & 98303 /* Modifier */) {
|
|
87557
87641
|
Debug.assertIsDefined(firstDecorator);
|
|
87558
87642
|
const sourceFile = getSourceFileOfNode(modifier);
|
|
87559
87643
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
@@ -87565,10 +87649,10 @@ function createTypeChecker(host) {
|
|
|
87565
87649
|
}
|
|
87566
87650
|
return false;
|
|
87567
87651
|
}
|
|
87568
|
-
flags |=
|
|
87569
|
-
if (!(flags &
|
|
87652
|
+
flags |= 32768 /* Decorator */;
|
|
87653
|
+
if (!(flags & 98303 /* Modifier */)) {
|
|
87570
87654
|
hasLeadingDecorators = true;
|
|
87571
|
-
} else if (flags &
|
|
87655
|
+
} else if (flags & 32 /* Export */) {
|
|
87572
87656
|
sawExportBeforeDecorators = true;
|
|
87573
87657
|
}
|
|
87574
87658
|
firstDecorator ?? (firstDecorator = modifier);
|
|
@@ -87597,39 +87681,39 @@ function createTypeChecker(host) {
|
|
|
87597
87681
|
}
|
|
87598
87682
|
break;
|
|
87599
87683
|
case 164 /* OverrideKeyword */:
|
|
87600
|
-
if (flags &
|
|
87684
|
+
if (flags & 16 /* Override */) {
|
|
87601
87685
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override");
|
|
87602
|
-
} else if (flags &
|
|
87686
|
+
} else if (flags & 128 /* Ambient */) {
|
|
87603
87687
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare");
|
|
87604
|
-
} else if (flags &
|
|
87688
|
+
} else if (flags & 8 /* Readonly */) {
|
|
87605
87689
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly");
|
|
87606
|
-
} else if (flags &
|
|
87690
|
+
} else if (flags & 512 /* Accessor */) {
|
|
87607
87691
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor");
|
|
87608
|
-
} else if (flags &
|
|
87692
|
+
} else if (flags & 1024 /* Async */) {
|
|
87609
87693
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async");
|
|
87610
87694
|
}
|
|
87611
|
-
flags |=
|
|
87695
|
+
flags |= 16 /* Override */;
|
|
87612
87696
|
lastOverride = modifier;
|
|
87613
87697
|
break;
|
|
87614
87698
|
case 125 /* PublicKeyword */:
|
|
87615
87699
|
case 124 /* ProtectedKeyword */:
|
|
87616
87700
|
case 123 /* PrivateKeyword */:
|
|
87617
87701
|
const text = visibilityToString(modifierToFlag(modifier.kind));
|
|
87618
|
-
if (flags &
|
|
87702
|
+
if (flags & 7 /* AccessibilityModifier */) {
|
|
87619
87703
|
return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen);
|
|
87620
|
-
} else if (flags &
|
|
87704
|
+
} else if (flags & 16 /* Override */) {
|
|
87621
87705
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override");
|
|
87622
|
-
} else if (flags &
|
|
87706
|
+
} else if (flags & 256 /* Static */) {
|
|
87623
87707
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static");
|
|
87624
|
-
} else if (flags &
|
|
87708
|
+
} else if (flags & 512 /* Accessor */) {
|
|
87625
87709
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor");
|
|
87626
|
-
} else if (flags &
|
|
87710
|
+
} else if (flags & 8 /* Readonly */) {
|
|
87627
87711
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly");
|
|
87628
|
-
} else if (flags &
|
|
87712
|
+
} else if (flags & 1024 /* Async */) {
|
|
87629
87713
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
|
|
87630
87714
|
} else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 312 /* SourceFile */) {
|
|
87631
87715
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
|
|
87632
|
-
} else if (flags &
|
|
87716
|
+
} else if (flags & 64 /* Abstract */) {
|
|
87633
87717
|
if (modifier.kind === 123 /* PrivateKeyword */) {
|
|
87634
87718
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract");
|
|
87635
87719
|
} else {
|
|
@@ -87641,60 +87725,60 @@ function createTypeChecker(host) {
|
|
|
87641
87725
|
flags |= modifierToFlag(modifier.kind);
|
|
87642
87726
|
break;
|
|
87643
87727
|
case 126 /* StaticKeyword */:
|
|
87644
|
-
if (flags &
|
|
87728
|
+
if (flags & 256 /* Static */) {
|
|
87645
87729
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static");
|
|
87646
|
-
} else if (flags &
|
|
87730
|
+
} else if (flags & 8 /* Readonly */) {
|
|
87647
87731
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly");
|
|
87648
|
-
} else if (flags &
|
|
87732
|
+
} else if (flags & 1024 /* Async */) {
|
|
87649
87733
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
|
|
87650
|
-
} else if (flags &
|
|
87734
|
+
} else if (flags & 512 /* Accessor */) {
|
|
87651
87735
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor");
|
|
87652
87736
|
} else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 312 /* SourceFile */) {
|
|
87653
87737
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
|
|
87654
87738
|
} else if (node.kind === 169 /* Parameter */) {
|
|
87655
87739
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
|
|
87656
|
-
} else if (flags &
|
|
87740
|
+
} else if (flags & 64 /* Abstract */) {
|
|
87657
87741
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
|
|
87658
|
-
} else if (flags &
|
|
87742
|
+
} else if (flags & 16 /* Override */) {
|
|
87659
87743
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override");
|
|
87660
87744
|
}
|
|
87661
|
-
flags |=
|
|
87745
|
+
flags |= 256 /* Static */;
|
|
87662
87746
|
lastStatic = modifier;
|
|
87663
87747
|
break;
|
|
87664
87748
|
case 129 /* AccessorKeyword */:
|
|
87665
|
-
if (flags &
|
|
87749
|
+
if (flags & 512 /* Accessor */) {
|
|
87666
87750
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor");
|
|
87667
|
-
} else if (flags &
|
|
87751
|
+
} else if (flags & 8 /* Readonly */) {
|
|
87668
87752
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly");
|
|
87669
|
-
} else if (flags &
|
|
87753
|
+
} else if (flags & 128 /* Ambient */) {
|
|
87670
87754
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare");
|
|
87671
87755
|
} else if (node.kind !== 172 /* PropertyDeclaration */) {
|
|
87672
87756
|
return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration);
|
|
87673
87757
|
}
|
|
87674
|
-
flags |=
|
|
87758
|
+
flags |= 512 /* Accessor */;
|
|
87675
87759
|
break;
|
|
87676
87760
|
case 148 /* ReadonlyKeyword */:
|
|
87677
|
-
if (flags &
|
|
87761
|
+
if (flags & 8 /* Readonly */) {
|
|
87678
87762
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly");
|
|
87679
87763
|
} else if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 181 /* IndexSignature */ && node.kind !== 169 /* Parameter */) {
|
|
87680
87764
|
return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
|
|
87681
|
-
} else if (flags &
|
|
87765
|
+
} else if (flags & 512 /* Accessor */) {
|
|
87682
87766
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor");
|
|
87683
87767
|
}
|
|
87684
|
-
flags |=
|
|
87768
|
+
flags |= 8 /* Readonly */;
|
|
87685
87769
|
break;
|
|
87686
87770
|
case 95 /* ExportKeyword */:
|
|
87687
87771
|
if (compilerOptions.verbatimModuleSyntax && !(node.flags & 33554432 /* Ambient */) && node.kind !== 265 /* TypeAliasDeclaration */ && node.kind !== 264 /* InterfaceDeclaration */ && // ModuleDeclaration needs to be checked that it is uninstantiated later
|
|
87688
87772
|
node.kind !== 267 /* ModuleDeclaration */ && node.parent.kind === 312 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
|
|
87689
87773
|
return grammarErrorOnNode(modifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
|
|
87690
87774
|
}
|
|
87691
|
-
if (flags &
|
|
87775
|
+
if (flags & 32 /* Export */) {
|
|
87692
87776
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export");
|
|
87693
|
-
} else if (flags &
|
|
87777
|
+
} else if (flags & 128 /* Ambient */) {
|
|
87694
87778
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare");
|
|
87695
|
-
} else if (flags &
|
|
87779
|
+
} else if (flags & 64 /* Abstract */) {
|
|
87696
87780
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract");
|
|
87697
|
-
} else if (flags &
|
|
87781
|
+
} else if (flags & 1024 /* Async */) {
|
|
87698
87782
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
|
|
87699
87783
|
} else if (isClassLike(node.parent)) {
|
|
87700
87784
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export");
|
|
@@ -87705,7 +87789,7 @@ function createTypeChecker(host) {
|
|
|
87705
87789
|
} else if (blockScopeKind === 6 /* AwaitUsing */) {
|
|
87706
87790
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "export");
|
|
87707
87791
|
}
|
|
87708
|
-
flags |=
|
|
87792
|
+
flags |= 32 /* Export */;
|
|
87709
87793
|
break;
|
|
87710
87794
|
case 90 /* DefaultKeyword */:
|
|
87711
87795
|
const container = node.parent.kind === 312 /* SourceFile */ ? node.parent : node.parent.parent;
|
|
@@ -87715,19 +87799,19 @@ function createTypeChecker(host) {
|
|
|
87715
87799
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "default");
|
|
87716
87800
|
} else if (blockScopeKind === 6 /* AwaitUsing */) {
|
|
87717
87801
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "default");
|
|
87718
|
-
} else if (!(flags &
|
|
87802
|
+
} else if (!(flags & 32 /* Export */)) {
|
|
87719
87803
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default");
|
|
87720
87804
|
} else if (sawExportBeforeDecorators) {
|
|
87721
87805
|
return grammarErrorOnNode(firstDecorator, Diagnostics.Decorators_are_not_valid_here);
|
|
87722
87806
|
}
|
|
87723
|
-
flags |=
|
|
87807
|
+
flags |= 2048 /* Default */;
|
|
87724
87808
|
break;
|
|
87725
87809
|
case 138 /* DeclareKeyword */:
|
|
87726
|
-
if (flags &
|
|
87810
|
+
if (flags & 128 /* Ambient */) {
|
|
87727
87811
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare");
|
|
87728
|
-
} else if (flags &
|
|
87812
|
+
} else if (flags & 1024 /* Async */) {
|
|
87729
87813
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
|
|
87730
|
-
} else if (flags &
|
|
87814
|
+
} else if (flags & 16 /* Override */) {
|
|
87731
87815
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override");
|
|
87732
87816
|
} else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) {
|
|
87733
87817
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare");
|
|
@@ -87741,62 +87825,62 @@ function createTypeChecker(host) {
|
|
|
87741
87825
|
return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
|
|
87742
87826
|
} else if (isPrivateIdentifierClassElementDeclaration(node)) {
|
|
87743
87827
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
|
|
87744
|
-
} else if (flags &
|
|
87828
|
+
} else if (flags & 512 /* Accessor */) {
|
|
87745
87829
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor");
|
|
87746
87830
|
}
|
|
87747
|
-
flags |=
|
|
87831
|
+
flags |= 128 /* Ambient */;
|
|
87748
87832
|
lastDeclare = modifier;
|
|
87749
87833
|
break;
|
|
87750
87834
|
case 128 /* AbstractKeyword */:
|
|
87751
|
-
if (flags &
|
|
87835
|
+
if (flags & 64 /* Abstract */) {
|
|
87752
87836
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract");
|
|
87753
87837
|
}
|
|
87754
87838
|
if (node.kind !== 263 /* ClassDeclaration */ && node.kind !== 185 /* ConstructorType */) {
|
|
87755
87839
|
if (node.kind !== 174 /* MethodDeclaration */ && node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 177 /* GetAccessor */ && node.kind !== 178 /* SetAccessor */) {
|
|
87756
87840
|
return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
|
|
87757
87841
|
}
|
|
87758
|
-
if (!(node.parent.kind === 263 /* ClassDeclaration */ && hasSyntacticModifier(node.parent,
|
|
87842
|
+
if (!(node.parent.kind === 263 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 64 /* Abstract */))) {
|
|
87759
87843
|
const message = node.kind === 172 /* PropertyDeclaration */ ? Diagnostics.Abstract_properties_can_only_appear_within_an_abstract_class : Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class;
|
|
87760
87844
|
return grammarErrorOnNode(modifier, message);
|
|
87761
87845
|
}
|
|
87762
|
-
if (flags &
|
|
87846
|
+
if (flags & 256 /* Static */) {
|
|
87763
87847
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
|
|
87764
87848
|
}
|
|
87765
|
-
if (flags &
|
|
87849
|
+
if (flags & 2 /* Private */) {
|
|
87766
87850
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract");
|
|
87767
87851
|
}
|
|
87768
|
-
if (flags &
|
|
87852
|
+
if (flags & 1024 /* Async */ && lastAsync) {
|
|
87769
87853
|
return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract");
|
|
87770
87854
|
}
|
|
87771
|
-
if (flags &
|
|
87855
|
+
if (flags & 16 /* Override */) {
|
|
87772
87856
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override");
|
|
87773
87857
|
}
|
|
87774
|
-
if (flags &
|
|
87858
|
+
if (flags & 512 /* Accessor */) {
|
|
87775
87859
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor");
|
|
87776
87860
|
}
|
|
87777
87861
|
}
|
|
87778
87862
|
if (isNamedDeclaration(node) && node.name.kind === 81 /* PrivateIdentifier */) {
|
|
87779
87863
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract");
|
|
87780
87864
|
}
|
|
87781
|
-
flags |=
|
|
87865
|
+
flags |= 64 /* Abstract */;
|
|
87782
87866
|
break;
|
|
87783
87867
|
case 134 /* AsyncKeyword */:
|
|
87784
|
-
if (flags &
|
|
87868
|
+
if (flags & 1024 /* Async */) {
|
|
87785
87869
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async");
|
|
87786
|
-
} else if (flags &
|
|
87870
|
+
} else if (flags & 128 /* Ambient */ || node.parent.flags & 33554432 /* Ambient */) {
|
|
87787
87871
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
|
|
87788
87872
|
} else if (node.kind === 169 /* Parameter */) {
|
|
87789
87873
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
|
|
87790
87874
|
}
|
|
87791
|
-
if (flags &
|
|
87875
|
+
if (flags & 64 /* Abstract */) {
|
|
87792
87876
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract");
|
|
87793
87877
|
}
|
|
87794
|
-
flags |=
|
|
87878
|
+
flags |= 1024 /* Async */;
|
|
87795
87879
|
lastAsync = modifier;
|
|
87796
87880
|
break;
|
|
87797
87881
|
case 103 /* InKeyword */:
|
|
87798
87882
|
case 147 /* OutKeyword */:
|
|
87799
|
-
const inOutFlag = modifier.kind === 103 /* InKeyword */ ?
|
|
87883
|
+
const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */;
|
|
87800
87884
|
const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out";
|
|
87801
87885
|
if (node.kind !== 168 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
|
|
87802
87886
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
|
|
@@ -87804,7 +87888,7 @@ function createTypeChecker(host) {
|
|
|
87804
87888
|
if (flags & inOutFlag) {
|
|
87805
87889
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText);
|
|
87806
87890
|
}
|
|
87807
|
-
if (inOutFlag &
|
|
87891
|
+
if (inOutFlag & 8192 /* In */ && flags & 16384 /* Out */) {
|
|
87808
87892
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out");
|
|
87809
87893
|
}
|
|
87810
87894
|
flags |= inOutFlag;
|
|
@@ -87813,24 +87897,24 @@ function createTypeChecker(host) {
|
|
|
87813
87897
|
}
|
|
87814
87898
|
}
|
|
87815
87899
|
if (node.kind === 176 /* Constructor */) {
|
|
87816
|
-
if (flags &
|
|
87900
|
+
if (flags & 256 /* Static */) {
|
|
87817
87901
|
return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
|
|
87818
87902
|
}
|
|
87819
|
-
if (flags &
|
|
87903
|
+
if (flags & 16 /* Override */) {
|
|
87820
87904
|
return grammarErrorOnNode(lastOverride, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "override");
|
|
87821
87905
|
}
|
|
87822
|
-
if (flags &
|
|
87906
|
+
if (flags & 1024 /* Async */) {
|
|
87823
87907
|
return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async");
|
|
87824
87908
|
}
|
|
87825
87909
|
return false;
|
|
87826
|
-
} else if ((node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */) && flags &
|
|
87910
|
+
} else if ((node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */) && flags & 128 /* Ambient */) {
|
|
87827
87911
|
return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
|
|
87828
|
-
} else if (node.kind === 169 /* Parameter */ && flags &
|
|
87912
|
+
} else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) {
|
|
87829
87913
|
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);
|
|
87830
|
-
} else if (node.kind === 169 /* Parameter */ && flags &
|
|
87914
|
+
} else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && node.dotDotDotToken) {
|
|
87831
87915
|
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
|
|
87832
87916
|
}
|
|
87833
|
-
if (flags &
|
|
87917
|
+
if (flags & 1024 /* Async */) {
|
|
87834
87918
|
return checkGrammarAsyncModifier(node, lastAsync);
|
|
87835
87919
|
}
|
|
87836
87920
|
return false;
|
|
@@ -88350,12 +88434,12 @@ function createTypeChecker(host) {
|
|
|
88350
88434
|
if (languageVersion < 2 /* ES2015 */ && isPrivateIdentifier(accessor.name)) {
|
|
88351
88435
|
return grammarErrorOnNode(accessor.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
|
|
88352
88436
|
}
|
|
88353
|
-
if (accessor.body === void 0 && !hasSyntacticModifier(accessor,
|
|
88437
|
+
if (accessor.body === void 0 && !hasSyntacticModifier(accessor, 64 /* Abstract */)) {
|
|
88354
88438
|
return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, Diagnostics._0_expected, "{");
|
|
88355
88439
|
}
|
|
88356
88440
|
}
|
|
88357
88441
|
if (accessor.body) {
|
|
88358
|
-
if (hasSyntacticModifier(accessor,
|
|
88442
|
+
if (hasSyntacticModifier(accessor, 64 /* Abstract */)) {
|
|
88359
88443
|
return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation);
|
|
88360
88444
|
}
|
|
88361
88445
|
if (accessor.parent.kind === 187 /* TypeLiteral */ || accessor.parent.kind === 264 /* InterfaceDeclaration */) {
|
|
@@ -88427,7 +88511,7 @@ function createTypeChecker(host) {
|
|
|
88427
88511
|
}
|
|
88428
88512
|
break;
|
|
88429
88513
|
case 171 /* PropertySignature */:
|
|
88430
|
-
if (!hasSyntacticModifier(parent2,
|
|
88514
|
+
if (!hasSyntacticModifier(parent2, 8 /* Readonly */)) {
|
|
88431
88515
|
return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);
|
|
88432
88516
|
}
|
|
88433
88517
|
break;
|
|
@@ -88597,7 +88681,7 @@ function createTypeChecker(host) {
|
|
|
88597
88681
|
const message = node.initializer ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context;
|
|
88598
88682
|
return grammarErrorOnNode(node.exclamationToken, message);
|
|
88599
88683
|
}
|
|
88600
|
-
if ((moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && moduleKind !== 4 /* System */ && !(node.parent.parent.flags & 33554432 /* Ambient */) && hasSyntacticModifier(node.parent.parent,
|
|
88684
|
+
if ((moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && moduleKind !== 4 /* System */ && !(node.parent.parent.flags & 33554432 /* Ambient */) && hasSyntacticModifier(node.parent.parent, 32 /* Export */)) {
|
|
88601
88685
|
checkESModuleMarker(node.name);
|
|
88602
88686
|
}
|
|
88603
88687
|
return !!blockScopeKind && checkGrammarNameInLetOrConstDeclarations(node.name);
|
|
@@ -88787,7 +88871,7 @@ function createTypeChecker(host) {
|
|
|
88787
88871
|
}
|
|
88788
88872
|
}
|
|
88789
88873
|
function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {
|
|
88790
|
-
if (node.kind === 264 /* InterfaceDeclaration */ || node.kind === 265 /* TypeAliasDeclaration */ || node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */ || node.kind === 278 /* ExportDeclaration */ || node.kind === 277 /* ExportAssignment */ || node.kind === 270 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node,
|
|
88874
|
+
if (node.kind === 264 /* InterfaceDeclaration */ || node.kind === 265 /* TypeAliasDeclaration */ || node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */ || node.kind === 278 /* ExportDeclaration */ || node.kind === 277 /* ExportAssignment */ || node.kind === 270 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 128 /* Ambient */ | 32 /* Export */ | 2048 /* Default */)) {
|
|
88791
88875
|
return false;
|
|
88792
88876
|
}
|
|
88793
88877
|
return grammarErrorOnFirstToken(node, Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier);
|
|
@@ -89102,12 +89186,14 @@ var SymbolTrackerImpl = class _SymbolTrackerImpl {
|
|
|
89102
89186
|
this.canTrackSymbol = !!((_a = this.inner) == null ? void 0 : _a.trackSymbol);
|
|
89103
89187
|
}
|
|
89104
89188
|
trackSymbol(symbol, enclosingDeclaration, meaning) {
|
|
89105
|
-
var _a;
|
|
89189
|
+
var _a, _b;
|
|
89106
89190
|
if (((_a = this.inner) == null ? void 0 : _a.trackSymbol) && !this.disableTrackSymbol) {
|
|
89107
89191
|
if (this.inner.trackSymbol(symbol, enclosingDeclaration, meaning)) {
|
|
89108
89192
|
this.onDiagnosticReported();
|
|
89109
89193
|
return true;
|
|
89110
89194
|
}
|
|
89195
|
+
if (!(symbol.flags & 262144 /* TypeParameter */))
|
|
89196
|
+
((_b = this.context).trackedSymbols ?? (_b.trackedSymbols = [])).push([symbol, enclosingDeclaration, meaning]);
|
|
89111
89197
|
}
|
|
89112
89198
|
return false;
|
|
89113
89199
|
}
|
|
@@ -91153,15 +91239,15 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
91153
91239
|
}
|
|
91154
91240
|
break;
|
|
91155
91241
|
case 243 /* VariableStatement */:
|
|
91156
|
-
if (hasSyntacticModifier(node,
|
|
91242
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
91157
91243
|
for (const decl of node.declarationList.declarations) {
|
|
91158
91244
|
exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings);
|
|
91159
91245
|
}
|
|
91160
91246
|
}
|
|
91161
91247
|
break;
|
|
91162
91248
|
case 262 /* FunctionDeclaration */:
|
|
91163
|
-
if (hasSyntacticModifier(node,
|
|
91164
|
-
if (hasSyntacticModifier(node,
|
|
91249
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
91250
|
+
if (hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
91165
91251
|
if (!hasExportDefault) {
|
|
91166
91252
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));
|
|
91167
91253
|
hasExportDefault = true;
|
|
@@ -91177,8 +91263,8 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
91177
91263
|
}
|
|
91178
91264
|
break;
|
|
91179
91265
|
case 263 /* ClassDeclaration */:
|
|
91180
|
-
if (hasSyntacticModifier(node,
|
|
91181
|
-
if (hasSyntacticModifier(node,
|
|
91266
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
91267
|
+
if (hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
91182
91268
|
if (!hasExportDefault) {
|
|
91183
91269
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));
|
|
91184
91270
|
hasExportDefault = true;
|
|
@@ -92048,7 +92134,7 @@ function injectClassThisAssignmentIfMissing(factory2, node, classThis, thisExpre
|
|
|
92048
92134
|
// src/compiler/transformers/namedEvaluation.ts
|
|
92049
92135
|
function getAssignedNameOfIdentifier(factory2, name, expression) {
|
|
92050
92136
|
const original = getOriginalNode(skipOuterExpressions(expression));
|
|
92051
|
-
if ((isClassDeclaration(original) || isFunctionDeclaration(original)) && !original.name && hasSyntacticModifier(original,
|
|
92137
|
+
if ((isClassDeclaration(original) || isFunctionDeclaration(original)) && !original.name && hasSyntacticModifier(original, 2048 /* Default */)) {
|
|
92052
92138
|
return factory2.createStringLiteral("default");
|
|
92053
92139
|
}
|
|
92054
92140
|
return factory2.createStringLiteralFromNode(name);
|
|
@@ -92407,13 +92493,13 @@ function transformTypeScript(context) {
|
|
|
92407
92493
|
break;
|
|
92408
92494
|
case 263 /* ClassDeclaration */:
|
|
92409
92495
|
case 262 /* FunctionDeclaration */:
|
|
92410
|
-
if (hasSyntacticModifier(node,
|
|
92496
|
+
if (hasSyntacticModifier(node, 128 /* Ambient */)) {
|
|
92411
92497
|
break;
|
|
92412
92498
|
}
|
|
92413
92499
|
if (node.name) {
|
|
92414
92500
|
recordEmittedDeclarationInScope(node);
|
|
92415
92501
|
} else {
|
|
92416
|
-
Debug.assert(node.kind === 263 /* ClassDeclaration */ || hasSyntacticModifier(node,
|
|
92502
|
+
Debug.assert(node.kind === 263 /* ClassDeclaration */ || hasSyntacticModifier(node, 2048 /* Default */));
|
|
92417
92503
|
}
|
|
92418
92504
|
break;
|
|
92419
92505
|
}
|
|
@@ -92468,7 +92554,7 @@ function transformTypeScript(context) {
|
|
|
92468
92554
|
function namespaceElementVisitorWorker(node) {
|
|
92469
92555
|
if (node.kind === 278 /* ExportDeclaration */ || node.kind === 272 /* ImportDeclaration */ || node.kind === 273 /* ImportClause */ || node.kind === 271 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 283 /* ExternalModuleReference */) {
|
|
92470
92556
|
return void 0;
|
|
92471
|
-
} else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node,
|
|
92557
|
+
} else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node, 32 /* Export */)) {
|
|
92472
92558
|
return visitTypeScript(node);
|
|
92473
92559
|
}
|
|
92474
92560
|
return node;
|
|
@@ -92526,7 +92612,7 @@ function transformTypeScript(context) {
|
|
|
92526
92612
|
function modifierVisitor(node) {
|
|
92527
92613
|
if (isDecorator(node))
|
|
92528
92614
|
return void 0;
|
|
92529
|
-
if (modifierToFlag(node.kind) &
|
|
92615
|
+
if (modifierToFlag(node.kind) & 28895 /* TypeScriptModifier */) {
|
|
92530
92616
|
return void 0;
|
|
92531
92617
|
} else if (currentNamespace && node.kind === 95 /* ExportKeyword */) {
|
|
92532
92618
|
return void 0;
|
|
@@ -92534,7 +92620,7 @@ function transformTypeScript(context) {
|
|
|
92534
92620
|
return node;
|
|
92535
92621
|
}
|
|
92536
92622
|
function visitTypeScript(node) {
|
|
92537
|
-
if (isStatement(node) && hasSyntacticModifier(node,
|
|
92623
|
+
if (isStatement(node) && hasSyntacticModifier(node, 128 /* Ambient */)) {
|
|
92538
92624
|
return factory2.createNotEmittedStatement(node);
|
|
92539
92625
|
}
|
|
92540
92626
|
switch (node.kind) {
|
|
@@ -93024,7 +93110,7 @@ function transformTypeScript(context) {
|
|
|
93024
93110
|
return !nodeIsMissing(node.body);
|
|
93025
93111
|
}
|
|
93026
93112
|
function visitPropertyDeclaration(node, parent2) {
|
|
93027
|
-
const isAmbient = node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node,
|
|
93113
|
+
const isAmbient = node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node, 64 /* Abstract */);
|
|
93028
93114
|
if (isAmbient && !(legacyDecorators && hasDecorators(node))) {
|
|
93029
93115
|
return void 0;
|
|
93030
93116
|
}
|
|
@@ -93033,7 +93119,7 @@ function transformTypeScript(context) {
|
|
|
93033
93119
|
if (isAmbient) {
|
|
93034
93120
|
return factory2.updatePropertyDeclaration(
|
|
93035
93121
|
node,
|
|
93036
|
-
concatenate(modifiers, factory2.createModifiersFromModifierFlags(
|
|
93122
|
+
concatenate(modifiers, factory2.createModifiersFromModifierFlags(128 /* Ambient */)),
|
|
93037
93123
|
Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)),
|
|
93038
93124
|
/*questionOrExclamationToken*/
|
|
93039
93125
|
void 0,
|
|
@@ -93196,7 +93282,7 @@ function transformTypeScript(context) {
|
|
|
93196
93282
|
);
|
|
93197
93283
|
}
|
|
93198
93284
|
function shouldEmitAccessorDeclaration(node) {
|
|
93199
|
-
return !(nodeIsMissing(node.body) && hasSyntacticModifier(node,
|
|
93285
|
+
return !(nodeIsMissing(node.body) && hasSyntacticModifier(node, 64 /* Abstract */));
|
|
93200
93286
|
}
|
|
93201
93287
|
function visitGetAccessor(node, parent2) {
|
|
93202
93288
|
if (!(node.transformFlags & 1 /* ContainsTypeScript */)) {
|
|
@@ -93929,16 +94015,16 @@ function transformTypeScript(context) {
|
|
|
93929
94015
|
}
|
|
93930
94016
|
}
|
|
93931
94017
|
function isExportOfNamespace(node) {
|
|
93932
|
-
return currentNamespace !== void 0 && hasSyntacticModifier(node,
|
|
94018
|
+
return currentNamespace !== void 0 && hasSyntacticModifier(node, 32 /* Export */);
|
|
93933
94019
|
}
|
|
93934
94020
|
function isExternalModuleExport(node) {
|
|
93935
|
-
return currentNamespace === void 0 && hasSyntacticModifier(node,
|
|
94021
|
+
return currentNamespace === void 0 && hasSyntacticModifier(node, 32 /* Export */);
|
|
93936
94022
|
}
|
|
93937
94023
|
function isNamedExternalModuleExport(node) {
|
|
93938
|
-
return isExternalModuleExport(node) && !hasSyntacticModifier(node,
|
|
94024
|
+
return isExternalModuleExport(node) && !hasSyntacticModifier(node, 2048 /* Default */);
|
|
93939
94025
|
}
|
|
93940
94026
|
function isDefaultExternalModuleExport(node) {
|
|
93941
|
-
return isExternalModuleExport(node) && hasSyntacticModifier(node,
|
|
94027
|
+
return isExternalModuleExport(node) && hasSyntacticModifier(node, 2048 /* Default */);
|
|
93942
94028
|
}
|
|
93943
94029
|
function createExportMemberAssignmentStatement(node) {
|
|
93944
94030
|
const expression = factory2.createAssignment(
|
|
@@ -95271,8 +95357,8 @@ function transformClassFields(context) {
|
|
|
95271
95357
|
getClassLexicalEnvironment().classThis = node.emitNode.classThis;
|
|
95272
95358
|
}
|
|
95273
95359
|
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */;
|
|
95274
|
-
const isExport = hasSyntacticModifier(node,
|
|
95275
|
-
const isDefault = hasSyntacticModifier(node,
|
|
95360
|
+
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
95361
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
95276
95362
|
let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
|
|
95277
95363
|
const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause);
|
|
95278
95364
|
const { members, prologue } = transformClassMembers(node);
|
|
@@ -95818,7 +95904,7 @@ function transformClassFields(context) {
|
|
|
95818
95904
|
return void 0;
|
|
95819
95905
|
}
|
|
95820
95906
|
const propertyOriginalNode = getOriginalNode(property);
|
|
95821
|
-
if (hasSyntacticModifier(propertyOriginalNode,
|
|
95907
|
+
if (hasSyntacticModifier(propertyOriginalNode, 64 /* Abstract */)) {
|
|
95822
95908
|
return void 0;
|
|
95823
95909
|
}
|
|
95824
95910
|
let initializer = visitNode(property.initializer, visitor, isExpression);
|
|
@@ -96854,8 +96940,8 @@ function transformLegacyDecorators(context) {
|
|
|
96854
96940
|
return addRange([updated], decorationStatements);
|
|
96855
96941
|
}
|
|
96856
96942
|
function transformClassDeclarationWithClassDecorators(node, name) {
|
|
96857
|
-
const isExport = hasSyntacticModifier(node,
|
|
96858
|
-
const isDefault = hasSyntacticModifier(node,
|
|
96943
|
+
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
96944
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
96859
96945
|
const modifiers = visitNodes2(node.modifiers, (node2) => isExportOrDefaultModifier(node2) || isDecorator(node2) ? void 0 : node2, isModifierLike);
|
|
96860
96946
|
const location = moveRangePastModifiers(node);
|
|
96861
96947
|
const classAlias = getClassAliasIfNeeded(node);
|
|
@@ -96876,7 +96962,7 @@ function transformLegacyDecorators(context) {
|
|
|
96876
96962
|
let members = visitNodes2(node.members, visitor, isClassElement);
|
|
96877
96963
|
let decorationStatements = [];
|
|
96878
96964
|
({ members, decorationStatements } = transformDecoratorsOfClassElements(node, members));
|
|
96879
|
-
const assignClassAliasInStaticBlock = languageVersion >= 9 /* ES2022 */ && !!classAlias && some(members, (member) => isPropertyDeclaration(member) && hasSyntacticModifier(member,
|
|
96965
|
+
const assignClassAliasInStaticBlock = languageVersion >= 9 /* ES2022 */ && !!classAlias && some(members, (member) => isPropertyDeclaration(member) && hasSyntacticModifier(member, 256 /* Static */) || isClassStaticBlockDeclaration(member));
|
|
96880
96966
|
if (assignClassAliasInStaticBlock) {
|
|
96881
96967
|
members = setTextRange(
|
|
96882
96968
|
factory2.createNodeArray([
|
|
@@ -97007,7 +97093,7 @@ function transformLegacyDecorators(context) {
|
|
|
97007
97093
|
);
|
|
97008
97094
|
}
|
|
97009
97095
|
function visitPropertyDeclaration(node) {
|
|
97010
|
-
if (node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node,
|
|
97096
|
+
if (node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node, 128 /* Ambient */)) {
|
|
97011
97097
|
return void 0;
|
|
97012
97098
|
}
|
|
97013
97099
|
return finishClassElement(
|
|
@@ -97095,7 +97181,7 @@ function transformLegacyDecorators(context) {
|
|
|
97095
97181
|
const memberName = getExpressionForPropertyName(
|
|
97096
97182
|
member,
|
|
97097
97183
|
/*generateNameForComputedPropertyName*/
|
|
97098
|
-
!hasSyntacticModifier(member,
|
|
97184
|
+
!hasSyntacticModifier(member, 128 /* Ambient */)
|
|
97099
97185
|
);
|
|
97100
97186
|
const descriptor = languageVersion > 0 /* ES3 */ ? isPropertyDeclaration(member) && !hasAccessorModifier(member) ? factory2.createVoidZero() : factory2.createNull() : void 0;
|
|
97101
97187
|
const helper = emitHelpers().createDecorateHelper(
|
|
@@ -97878,8 +97964,8 @@ function transformESDecorators(context) {
|
|
|
97878
97964
|
const statements = [];
|
|
97879
97965
|
const originalClass = getOriginalNode(node, isClassLike) ?? node;
|
|
97880
97966
|
const className = originalClass.name ? factory2.createStringLiteralFromNode(originalClass.name) : factory2.createStringLiteral("default");
|
|
97881
|
-
const isExport = hasSyntacticModifier(node,
|
|
97882
|
-
const isDefault = hasSyntacticModifier(node,
|
|
97967
|
+
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
97968
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
97883
97969
|
if (!node.name) {
|
|
97884
97970
|
node = injectClassNamedEvaluationHelperBlockIfMissing(context, node, className);
|
|
97885
97971
|
}
|
|
@@ -100190,7 +100276,7 @@ function transformES2018(context) {
|
|
|
100190
100276
|
return visitEachChild(node, visitor, context);
|
|
100191
100277
|
}
|
|
100192
100278
|
function visitVariableStatement(node) {
|
|
100193
|
-
if (hasSyntacticModifier(node,
|
|
100279
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
100194
100280
|
const savedExportedVariableStatement = exportedVariableStatement;
|
|
100195
100281
|
exportedVariableStatement = true;
|
|
100196
100282
|
const visited = visitEachChild(node, visitor, context);
|
|
@@ -101402,7 +101488,7 @@ function transformESNext(context) {
|
|
|
101402
101488
|
addRange(topLevelStatements, endLexicalEnvironment());
|
|
101403
101489
|
if (exportVars.length) {
|
|
101404
101490
|
topLevelStatements.push(factory2.createVariableStatement(
|
|
101405
|
-
factory2.createModifiersFromModifierFlags(
|
|
101491
|
+
factory2.createModifiersFromModifierFlags(32 /* Export */),
|
|
101406
101492
|
factory2.createVariableDeclarationList(
|
|
101407
101493
|
exportVars,
|
|
101408
101494
|
1 /* Let */
|
|
@@ -101699,8 +101785,8 @@ function transformESNext(context) {
|
|
|
101699
101785
|
if (!node.name && defaultExportBinding) {
|
|
101700
101786
|
return node;
|
|
101701
101787
|
}
|
|
101702
|
-
const isExported2 = hasSyntacticModifier(node,
|
|
101703
|
-
const isDefault = hasSyntacticModifier(node,
|
|
101788
|
+
const isExported2 = hasSyntacticModifier(node, 32 /* Export */);
|
|
101789
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
101704
101790
|
let expression = factory2.converters.convertToClassExpression(node);
|
|
101705
101791
|
if (node.name) {
|
|
101706
101792
|
hoistBindingIdentifier(
|
|
@@ -101748,7 +101834,7 @@ function transformESNext(context) {
|
|
|
101748
101834
|
}
|
|
101749
101835
|
function hoistVariableStatement(node) {
|
|
101750
101836
|
let expressions;
|
|
101751
|
-
const isExported2 = hasSyntacticModifier(node,
|
|
101837
|
+
const isExported2 = hasSyntacticModifier(node, 32 /* Export */);
|
|
101752
101838
|
for (const variable of node.declarationList.declarations) {
|
|
101753
101839
|
hoistBindingElement(variable, isExported2, variable);
|
|
101754
101840
|
if (variable.initializer) {
|
|
@@ -102336,7 +102422,7 @@ function transformJsx(context) {
|
|
|
102336
102422
|
}
|
|
102337
102423
|
function transformJsxSpreadAttributeToProps(node) {
|
|
102338
102424
|
if (isObjectLiteralExpression(node.expression) && !hasProto(node.expression)) {
|
|
102339
|
-
return node.expression.properties;
|
|
102425
|
+
return sameMap(node.expression.properties, (p) => Debug.checkDefined(visitNode(p, visitor, isObjectLiteralElementLike)));
|
|
102340
102426
|
}
|
|
102341
102427
|
return factory2.createSpreadAssignment(Debug.checkDefined(visitNode(node.expression, visitor, isExpression)));
|
|
102342
102428
|
}
|
|
@@ -103280,8 +103366,8 @@ function transformES2015(context) {
|
|
|
103280
103366
|
setTextRange(statement, node);
|
|
103281
103367
|
startOnNewLine(statement);
|
|
103282
103368
|
statements.push(statement);
|
|
103283
|
-
if (hasSyntacticModifier(node,
|
|
103284
|
-
const exportStatement = hasSyntacticModifier(node,
|
|
103369
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
103370
|
+
const exportStatement = hasSyntacticModifier(node, 2048 /* Default */) ? factory2.createExportDefault(factory2.getLocalName(node)) : factory2.createExternalModuleExport(factory2.getLocalName(node));
|
|
103285
103371
|
setOriginalNode(exportStatement, statement);
|
|
103286
103372
|
statements.push(exportStatement);
|
|
103287
103373
|
}
|
|
@@ -104473,7 +104559,7 @@ function transformES2015(context) {
|
|
|
104473
104559
|
return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getInternalEmitFlags(node.declarationList.declarations[0].initializer) & 1 /* TypeScriptClassWrapper */);
|
|
104474
104560
|
}
|
|
104475
104561
|
function visitVariableStatement(node) {
|
|
104476
|
-
const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node,
|
|
104562
|
+
const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node, 32 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */);
|
|
104477
104563
|
let updated;
|
|
104478
104564
|
if (convertedLoopState && (node.declarationList.flags & 7 /* BlockScoped */) === 0 && !isVariableStatementOfTypeScriptClassWrapper(node)) {
|
|
104479
104565
|
let assignments;
|
|
@@ -109422,7 +109508,7 @@ function transformModule(context) {
|
|
|
109422
109508
|
Debug.assert(isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer.");
|
|
109423
109509
|
let statements;
|
|
109424
109510
|
if (moduleKind !== 2 /* AMD */) {
|
|
109425
|
-
if (hasSyntacticModifier(node,
|
|
109511
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
109426
109512
|
statements = append(
|
|
109427
109513
|
statements,
|
|
109428
109514
|
setOriginalNode(
|
|
@@ -109468,7 +109554,7 @@ function transformModule(context) {
|
|
|
109468
109554
|
);
|
|
109469
109555
|
}
|
|
109470
109556
|
} else {
|
|
109471
|
-
if (hasSyntacticModifier(node,
|
|
109557
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
109472
109558
|
statements = append(
|
|
109473
109559
|
statements,
|
|
109474
109560
|
setOriginalNode(
|
|
@@ -109606,7 +109692,7 @@ function transformModule(context) {
|
|
|
109606
109692
|
}
|
|
109607
109693
|
function visitFunctionDeclaration(node) {
|
|
109608
109694
|
let statements;
|
|
109609
|
-
if (hasSyntacticModifier(node,
|
|
109695
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
109610
109696
|
statements = append(
|
|
109611
109697
|
statements,
|
|
109612
109698
|
setOriginalNode(
|
|
@@ -109643,7 +109729,7 @@ function transformModule(context) {
|
|
|
109643
109729
|
}
|
|
109644
109730
|
function visitClassDeclaration(node) {
|
|
109645
109731
|
let statements;
|
|
109646
|
-
if (hasSyntacticModifier(node,
|
|
109732
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
109647
109733
|
statements = append(
|
|
109648
109734
|
statements,
|
|
109649
109735
|
setOriginalNode(
|
|
@@ -109677,7 +109763,7 @@ function transformModule(context) {
|
|
|
109677
109763
|
let statements;
|
|
109678
109764
|
let variables;
|
|
109679
109765
|
let expressions;
|
|
109680
|
-
if (hasSyntacticModifier(node,
|
|
109766
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
109681
109767
|
let modifiers;
|
|
109682
109768
|
let removeCommentsOnExpressions = false;
|
|
109683
109769
|
for (const variable of node.declarationList.declarations) {
|
|
@@ -109863,8 +109949,8 @@ function transformModule(context) {
|
|
|
109863
109949
|
return statements;
|
|
109864
109950
|
}
|
|
109865
109951
|
const seen = new IdentifierNameMap();
|
|
109866
|
-
if (hasSyntacticModifier(decl,
|
|
109867
|
-
const exportName = hasSyntacticModifier(decl,
|
|
109952
|
+
if (hasSyntacticModifier(decl, 32 /* Export */)) {
|
|
109953
|
+
const exportName = hasSyntacticModifier(decl, 2048 /* Default */) ? factory2.createIdentifier("default") : factory2.getDeclarationName(decl);
|
|
109868
109954
|
statements = appendExportStatement(
|
|
109869
109955
|
statements,
|
|
109870
109956
|
seen,
|
|
@@ -110351,7 +110437,7 @@ function transformSystemModule(context) {
|
|
|
110351
110437
|
addRange(statements, hoistedStatements);
|
|
110352
110438
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
110353
110439
|
const exportStarFunction = addExportStarIfNeeded(statements);
|
|
110354
|
-
const modifiers = node.transformFlags & 2097152 /* ContainsAwait */ ? factory2.createModifiersFromModifierFlags(
|
|
110440
|
+
const modifiers = node.transformFlags & 2097152 /* ContainsAwait */ ? factory2.createModifiersFromModifierFlags(1024 /* Async */) : void 0;
|
|
110355
110441
|
const moduleObject = factory2.createObjectLiteralExpression(
|
|
110356
110442
|
[
|
|
110357
110443
|
factory2.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)),
|
|
@@ -110553,7 +110639,7 @@ function transformSystemModule(context) {
|
|
|
110553
110639
|
factory2.createAssignment(importVariableName, parameterName)
|
|
110554
110640
|
)
|
|
110555
110641
|
);
|
|
110556
|
-
if (hasSyntacticModifier(entry,
|
|
110642
|
+
if (hasSyntacticModifier(entry, 32 /* Export */)) {
|
|
110557
110643
|
statements.push(
|
|
110558
110644
|
factory2.createExpressionStatement(
|
|
110559
110645
|
factory2.createCallExpression(
|
|
@@ -110706,7 +110792,7 @@ function transformSystemModule(context) {
|
|
|
110706
110792
|
);
|
|
110707
110793
|
}
|
|
110708
110794
|
function visitFunctionDeclaration(node) {
|
|
110709
|
-
if (hasSyntacticModifier(node,
|
|
110795
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
110710
110796
|
hoistedStatements = append(
|
|
110711
110797
|
hoistedStatements,
|
|
110712
110798
|
factory2.updateFunctionDeclaration(
|
|
@@ -110793,7 +110879,7 @@ function transformSystemModule(context) {
|
|
|
110793
110879
|
statements = append(statements, factory2.updateVariableStatement(node, modifiers, declarationList));
|
|
110794
110880
|
} else {
|
|
110795
110881
|
let expressions;
|
|
110796
|
-
const isExportedDeclaration = hasSyntacticModifier(node,
|
|
110882
|
+
const isExportedDeclaration = hasSyntacticModifier(node, 32 /* Export */);
|
|
110797
110883
|
for (const variable of node.declarationList.declarations) {
|
|
110798
110884
|
if (variable.initializer) {
|
|
110799
110885
|
expressions = append(expressions, transformInitializedVariable(variable, isExportedDeclaration));
|
|
@@ -110929,8 +111015,8 @@ function transformSystemModule(context) {
|
|
|
110929
111015
|
return statements;
|
|
110930
111016
|
}
|
|
110931
111017
|
let excludeName;
|
|
110932
|
-
if (hasSyntacticModifier(decl,
|
|
110933
|
-
const exportName = hasSyntacticModifier(decl,
|
|
111018
|
+
if (hasSyntacticModifier(decl, 32 /* Export */)) {
|
|
111019
|
+
const exportName = hasSyntacticModifier(decl, 2048 /* Default */) ? factory2.createStringLiteral("default") : decl.name;
|
|
110934
111020
|
statements = appendExportStatement(statements, exportName, factory2.getLocalName(decl));
|
|
110935
111021
|
excludeName = getTextOfIdentifierOrLiteral(exportName);
|
|
110936
111022
|
}
|
|
@@ -111675,7 +111761,7 @@ function transformECMAScriptModule(context) {
|
|
|
111675
111761
|
return singleOrMany(statements);
|
|
111676
111762
|
}
|
|
111677
111763
|
function appendExportsOfImportEqualsDeclaration(statements, node) {
|
|
111678
|
-
if (hasSyntacticModifier(node,
|
|
111764
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
111679
111765
|
statements = append(
|
|
111680
111766
|
statements,
|
|
111681
111767
|
factory2.createExportDeclaration(
|
|
@@ -111885,7 +111971,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
111885
111971
|
} else if (isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isIndexSignatureDeclaration(node)) {
|
|
111886
111972
|
return getReturnTypeVisibilityError;
|
|
111887
111973
|
} else if (isParameter(node)) {
|
|
111888
|
-
if (isParameterPropertyDeclaration(node, node.parent) && hasSyntacticModifier(node.parent,
|
|
111974
|
+
if (isParameterPropertyDeclaration(node, node.parent) && hasSyntacticModifier(node.parent, 2 /* Private */)) {
|
|
111889
111975
|
return getVariableDeclarationTypeVisibilityError;
|
|
111890
111976
|
}
|
|
111891
111977
|
return getParameterDeclarationTypeVisibilityError;
|
|
@@ -111903,7 +111989,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
111903
111989
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
111904
111990
|
if (node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
|
|
111905
111991
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
|
|
111906
|
-
} else if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */ || node.kind === 226 /* BinaryExpression */ || node.kind === 171 /* PropertySignature */ || node.kind === 169 /* Parameter */ && hasSyntacticModifier(node.parent,
|
|
111992
|
+
} else if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */ || node.kind === 226 /* BinaryExpression */ || node.kind === 171 /* PropertySignature */ || node.kind === 169 /* Parameter */ && hasSyntacticModifier(node.parent, 2 /* Private */)) {
|
|
111907
111993
|
if (isStatic(node)) {
|
|
111908
111994
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
|
|
111909
111995
|
} else if (node.parent.kind === 263 /* ClassDeclaration */ || node.kind === 169 /* Parameter */) {
|
|
@@ -112624,7 +112710,7 @@ function transformDeclarations(context) {
|
|
|
112624
112710
|
return void 0;
|
|
112625
112711
|
}
|
|
112626
112712
|
function ensureType(node, type, ignorePrivate) {
|
|
112627
|
-
if (!ignorePrivate && hasEffectiveModifier(node,
|
|
112713
|
+
if (!ignorePrivate && hasEffectiveModifier(node, 2 /* Private */)) {
|
|
112628
112714
|
return;
|
|
112629
112715
|
}
|
|
112630
112716
|
if (shouldPrintWithInitializer(node)) {
|
|
@@ -112704,7 +112790,7 @@ function transformDeclarations(context) {
|
|
|
112704
112790
|
}
|
|
112705
112791
|
}
|
|
112706
112792
|
function updateParamsList(node, params, modifierMask) {
|
|
112707
|
-
if (hasEffectiveModifier(node,
|
|
112793
|
+
if (hasEffectiveModifier(node, 2 /* Private */)) {
|
|
112708
112794
|
return factory2.createNodeArray();
|
|
112709
112795
|
}
|
|
112710
112796
|
const newParams = map(params, (p) => ensureParameter(p, modifierMask));
|
|
@@ -112749,7 +112835,7 @@ function transformDeclarations(context) {
|
|
|
112749
112835
|
return factory2.createNodeArray(newParams || emptyArray);
|
|
112750
112836
|
}
|
|
112751
112837
|
function ensureTypeParams(node, params) {
|
|
112752
|
-
return hasEffectiveModifier(node,
|
|
112838
|
+
return hasEffectiveModifier(node, 2 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree, isTypeParameterDeclaration);
|
|
112753
112839
|
}
|
|
112754
112840
|
function isEnclosingDeclaration(node) {
|
|
112755
112841
|
return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node);
|
|
@@ -112935,7 +113021,7 @@ function transformDeclarations(context) {
|
|
|
112935
113021
|
const oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
|
|
112936
113022
|
let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 187 /* TypeLiteral */ || input.kind === 200 /* MappedType */) && input.parent.kind !== 265 /* TypeAliasDeclaration */;
|
|
112937
113023
|
if (isMethodDeclaration(input) || isMethodSignature(input)) {
|
|
112938
|
-
if (hasEffectiveModifier(input,
|
|
113024
|
+
if (hasEffectiveModifier(input, 2 /* Private */)) {
|
|
112939
113025
|
if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input)
|
|
112940
113026
|
return;
|
|
112941
113027
|
return cleanup(factory2.createPropertyDeclaration(
|
|
@@ -113023,7 +113109,7 @@ function transformDeclarations(context) {
|
|
|
113023
113109
|
input,
|
|
113024
113110
|
ensureModifiers(input),
|
|
113025
113111
|
input.name,
|
|
113026
|
-
updateAccessorParamsList(input, hasEffectiveModifier(input,
|
|
113112
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
113027
113113
|
ensureType(input, accessorType),
|
|
113028
113114
|
/*body*/
|
|
113029
113115
|
void 0
|
|
@@ -113040,7 +113126,7 @@ function transformDeclarations(context) {
|
|
|
113040
113126
|
input,
|
|
113041
113127
|
ensureModifiers(input),
|
|
113042
113128
|
input.name,
|
|
113043
|
-
updateAccessorParamsList(input, hasEffectiveModifier(input,
|
|
113129
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
113044
113130
|
/*body*/
|
|
113045
113131
|
void 0
|
|
113046
113132
|
));
|
|
@@ -113197,7 +113283,7 @@ function transformDeclarations(context) {
|
|
|
113197
113283
|
}
|
|
113198
113284
|
}
|
|
113199
113285
|
function isPrivateMethodTypeParameter(node) {
|
|
113200
|
-
return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent,
|
|
113286
|
+
return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 2 /* Private */);
|
|
113201
113287
|
}
|
|
113202
113288
|
function visitDeclarationStatements(input) {
|
|
113203
113289
|
if (!isPreservedDeclarationStatement(input)) {
|
|
@@ -113256,10 +113342,10 @@ function transformDeclarations(context) {
|
|
|
113256
113342
|
return input;
|
|
113257
113343
|
}
|
|
113258
113344
|
function stripExportModifiers(statement) {
|
|
113259
|
-
if (isImportEqualsDeclaration(statement) || hasEffectiveModifier(statement,
|
|
113345
|
+
if (isImportEqualsDeclaration(statement) || hasEffectiveModifier(statement, 2048 /* Default */) || !canHaveModifiers(statement)) {
|
|
113260
113346
|
return statement;
|
|
113261
113347
|
}
|
|
113262
|
-
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (
|
|
113348
|
+
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (131071 /* All */ ^ 32 /* Export */));
|
|
113263
113349
|
return factory2.replaceModifiers(statement, modifiers);
|
|
113264
113350
|
}
|
|
113265
113351
|
function updateModuleDeclarationAndKeyword(node, modifiers, name, body) {
|
|
@@ -113409,10 +113495,10 @@ function transformDeclarations(context) {
|
|
|
113409
113495
|
));
|
|
113410
113496
|
}
|
|
113411
113497
|
const namespaceDecl = factory2.createModuleDeclaration(ensureModifiers(input), input.name, factory2.createModuleBlock(declarations), 32 /* Namespace */);
|
|
113412
|
-
if (!hasEffectiveModifier(clean2,
|
|
113498
|
+
if (!hasEffectiveModifier(clean2, 2048 /* Default */)) {
|
|
113413
113499
|
return [clean2, namespaceDecl];
|
|
113414
113500
|
}
|
|
113415
|
-
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(clean2) & ~
|
|
113501
|
+
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(clean2) & ~2080 /* ExportDefault */ | 128 /* Ambient */);
|
|
113416
113502
|
const cleanDeclaration = factory2.updateFunctionDeclaration(
|
|
113417
113503
|
clean2,
|
|
113418
113504
|
modifiers,
|
|
@@ -113504,7 +113590,7 @@ function transformDeclarations(context) {
|
|
|
113504
113590
|
if (ctor) {
|
|
113505
113591
|
const oldDiag2 = getSymbolAccessibilityDiagnostic;
|
|
113506
113592
|
parameterProperties = compact(flatMap(ctor.parameters, (param) => {
|
|
113507
|
-
if (!hasSyntacticModifier(param,
|
|
113593
|
+
if (!hasSyntacticModifier(param, 31 /* ParameterPropertyModifier */) || shouldStripInternal(param))
|
|
113508
113594
|
return;
|
|
113509
113595
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(param);
|
|
113510
113596
|
if (param.name.kind === 80 /* Identifier */) {
|
|
@@ -113733,11 +113819,11 @@ function transformDeclarations(context) {
|
|
|
113733
113819
|
return factory2.createModifiersFromModifierFlags(newFlags);
|
|
113734
113820
|
}
|
|
113735
113821
|
function ensureModifierFlags(node) {
|
|
113736
|
-
let mask2 =
|
|
113737
|
-
let additions = needsDeclare && !isAlwaysType(node) ?
|
|
113822
|
+
let mask2 = 131071 /* All */ ^ (1 /* Public */ | 1024 /* Async */ | 16 /* Override */);
|
|
113823
|
+
let additions = needsDeclare && !isAlwaysType(node) ? 128 /* Ambient */ : 0 /* None */;
|
|
113738
113824
|
const parentIsFile = node.parent.kind === 312 /* SourceFile */;
|
|
113739
113825
|
if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) {
|
|
113740
|
-
mask2 ^=
|
|
113826
|
+
mask2 ^= 128 /* Ambient */;
|
|
113741
113827
|
additions = 0 /* None */;
|
|
113742
113828
|
}
|
|
113743
113829
|
return maskModifierFlags(node, mask2, additions);
|
|
@@ -113779,13 +113865,13 @@ function isAlwaysType(node) {
|
|
|
113779
113865
|
function maskModifiers(factory2, node, modifierMask, modifierAdditions) {
|
|
113780
113866
|
return factory2.createModifiersFromModifierFlags(maskModifierFlags(node, modifierMask, modifierAdditions));
|
|
113781
113867
|
}
|
|
113782
|
-
function maskModifierFlags(node, modifierMask =
|
|
113868
|
+
function maskModifierFlags(node, modifierMask = 131071 /* All */ ^ 1 /* Public */, modifierAdditions = 0 /* None */) {
|
|
113783
113869
|
let flags = getEffectiveModifierFlags(node) & modifierMask | modifierAdditions;
|
|
113784
|
-
if (flags &
|
|
113785
|
-
flags ^=
|
|
113870
|
+
if (flags & 2048 /* Default */ && !(flags & 32 /* Export */)) {
|
|
113871
|
+
flags ^= 32 /* Export */;
|
|
113786
113872
|
}
|
|
113787
|
-
if (flags &
|
|
113788
|
-
flags ^=
|
|
113873
|
+
if (flags & 2048 /* Default */ && flags & 128 /* Ambient */) {
|
|
113874
|
+
flags ^= 128 /* Ambient */;
|
|
113789
113875
|
}
|
|
113790
113876
|
return flags;
|
|
113791
113877
|
}
|
|
@@ -113798,7 +113884,7 @@ function canHaveLiteralInitializer(node) {
|
|
|
113798
113884
|
switch (node.kind) {
|
|
113799
113885
|
case 172 /* PropertyDeclaration */:
|
|
113800
113886
|
case 171 /* PropertySignature */:
|
|
113801
|
-
return !hasEffectiveModifier(node,
|
|
113887
|
+
return !hasEffectiveModifier(node, 2 /* Private */);
|
|
113802
113888
|
case 169 /* Parameter */:
|
|
113803
113889
|
case 260 /* VariableDeclaration */:
|
|
113804
113890
|
return true;
|
|
@@ -122622,7 +122708,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122622
122708
|
}
|
|
122623
122709
|
}
|
|
122624
122710
|
} else if (isModuleDeclaration(node)) {
|
|
122625
|
-
if (isAmbientModule(node) && (inAmbientModule || hasSyntacticModifier(node,
|
|
122711
|
+
if (isAmbientModule(node) && (inAmbientModule || hasSyntacticModifier(node, 128 /* Ambient */) || file.isDeclarationFile)) {
|
|
122626
122712
|
node.name.parent = node;
|
|
122627
122713
|
const nameText = getTextOfIdentifierOrLiteral(node.name);
|
|
122628
122714
|
if (isExternalModuleFile || inAmbientModule && !isExternalModuleNameRelative(nameText)) {
|
|
@@ -131560,7 +131646,7 @@ function getNodeKind(node) {
|
|
|
131560
131646
|
case 306 /* EnumMember */:
|
|
131561
131647
|
return "enum member" /* enumMemberElement */;
|
|
131562
131648
|
case 169 /* Parameter */:
|
|
131563
|
-
return hasSyntacticModifier(node,
|
|
131649
|
+
return hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */;
|
|
131564
131650
|
case 271 /* ImportEqualsDeclaration */:
|
|
131565
131651
|
case 276 /* ImportSpecifier */:
|
|
131566
131652
|
case 281 /* ExportSpecifier */:
|
|
@@ -132464,19 +132550,19 @@ function nodeHasTokens(n, sourceFile) {
|
|
|
132464
132550
|
function getNodeModifiers(node, excludeFlags = 0 /* None */) {
|
|
132465
132551
|
const result = [];
|
|
132466
132552
|
const flags = isDeclaration(node) ? getCombinedNodeFlagsAlwaysIncludeJSDoc(node) & ~excludeFlags : 0 /* None */;
|
|
132467
|
-
if (flags &
|
|
132553
|
+
if (flags & 2 /* Private */)
|
|
132468
132554
|
result.push("private" /* privateMemberModifier */);
|
|
132469
|
-
if (flags &
|
|
132555
|
+
if (flags & 4 /* Protected */)
|
|
132470
132556
|
result.push("protected" /* protectedMemberModifier */);
|
|
132471
|
-
if (flags &
|
|
132557
|
+
if (flags & 1 /* Public */)
|
|
132472
132558
|
result.push("public" /* publicMemberModifier */);
|
|
132473
|
-
if (flags &
|
|
132559
|
+
if (flags & 256 /* Static */ || isClassStaticBlockDeclaration(node))
|
|
132474
132560
|
result.push("static" /* staticModifier */);
|
|
132475
|
-
if (flags &
|
|
132561
|
+
if (flags & 64 /* Abstract */)
|
|
132476
132562
|
result.push("abstract" /* abstractModifier */);
|
|
132477
|
-
if (flags &
|
|
132563
|
+
if (flags & 32 /* Export */)
|
|
132478
132564
|
result.push("export" /* exportedModifier */);
|
|
132479
|
-
if (flags &
|
|
132565
|
+
if (flags & 65536 /* Deprecated */)
|
|
132480
132566
|
result.push("deprecated" /* deprecatedModifier */);
|
|
132481
132567
|
if (node.flags & 33554432 /* Ambient */)
|
|
132482
132568
|
result.push("declare" /* ambientModifier */);
|
|
@@ -133890,7 +133976,7 @@ function isNonGlobalDeclaration(declaration) {
|
|
|
133890
133976
|
return isInJSFile(declaration) || !findAncestor(declaration, (d) => isModuleDeclaration(d) && isGlobalScopeAugmentation(d));
|
|
133891
133977
|
}
|
|
133892
133978
|
function isDeprecatedDeclaration(decl) {
|
|
133893
|
-
return !!(getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) &
|
|
133979
|
+
return !!(getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) & 65536 /* Deprecated */);
|
|
133894
133980
|
}
|
|
133895
133981
|
function shouldUseUriStyleNodeCoreModules(file, program) {
|
|
133896
133982
|
const decisionFromFile = firstDefined(file.imports, (node) => {
|
|
@@ -135499,7 +135585,7 @@ var DocumentHighlights;
|
|
|
135499
135585
|
case 241 /* Block */:
|
|
135500
135586
|
case 296 /* CaseClause */:
|
|
135501
135587
|
case 297 /* DefaultClause */:
|
|
135502
|
-
if (modifierFlag &
|
|
135588
|
+
if (modifierFlag & 64 /* Abstract */ && isClassDeclaration(declaration)) {
|
|
135503
135589
|
return [...declaration.members, declaration];
|
|
135504
135590
|
} else {
|
|
135505
135591
|
return container.statements;
|
|
@@ -135513,12 +135599,12 @@ var DocumentHighlights;
|
|
|
135513
135599
|
case 264 /* InterfaceDeclaration */:
|
|
135514
135600
|
case 187 /* TypeLiteral */:
|
|
135515
135601
|
const nodes = container.members;
|
|
135516
|
-
if (modifierFlag & (
|
|
135602
|
+
if (modifierFlag & (7 /* AccessibilityModifier */ | 8 /* Readonly */)) {
|
|
135517
135603
|
const constructor = find(container.members, isConstructorDeclaration);
|
|
135518
135604
|
if (constructor) {
|
|
135519
135605
|
return [...nodes, ...constructor.parameters];
|
|
135520
135606
|
}
|
|
135521
|
-
} else if (modifierFlag &
|
|
135607
|
+
} else if (modifierFlag & 64 /* Abstract */) {
|
|
135522
135608
|
return [...nodes, container];
|
|
135523
135609
|
}
|
|
135524
135610
|
return nodes;
|
|
@@ -137981,7 +138067,7 @@ function getItemName(node, name) {
|
|
|
137981
138067
|
case 218 /* FunctionExpression */:
|
|
137982
138068
|
case 263 /* ClassDeclaration */:
|
|
137983
138069
|
case 231 /* ClassExpression */:
|
|
137984
|
-
if (getSyntacticModifierFlags(node) &
|
|
138070
|
+
if (getSyntacticModifierFlags(node) & 2048 /* Default */) {
|
|
137985
138071
|
return "default";
|
|
137986
138072
|
}
|
|
137987
138073
|
return getFunctionOrClassName(node);
|
|
@@ -138131,7 +138217,7 @@ function getFunctionOrClassName(node) {
|
|
|
138131
138217
|
return nodeText(parent2.left).replace(whiteSpaceRegex, "");
|
|
138132
138218
|
} else if (isPropertyAssignment(parent2)) {
|
|
138133
138219
|
return nodeText(parent2.name);
|
|
138134
|
-
} else if (getSyntacticModifierFlags(node) &
|
|
138220
|
+
} else if (getSyntacticModifierFlags(node) & 2048 /* Default */) {
|
|
138135
138221
|
return "default";
|
|
138136
138222
|
} else if (isClassLike(node)) {
|
|
138137
138223
|
return "<class>";
|
|
@@ -138278,15 +138364,15 @@ function getInfo2(context, considerPartialSpans = true) {
|
|
|
138278
138364
|
const { file, program } = context;
|
|
138279
138365
|
const span = getRefactorContextSpan(context);
|
|
138280
138366
|
const token = getTokenAtPosition(file, span.start);
|
|
138281
|
-
const exportNode = !!(token.parent && getSyntacticModifierFlags(token.parent) &
|
|
138367
|
+
const exportNode = !!(token.parent && getSyntacticModifierFlags(token.parent) & 32 /* Export */) && considerPartialSpans ? token.parent : getParentNodeInSpan(token, file, span);
|
|
138282
138368
|
if (!exportNode || !isSourceFile(exportNode.parent) && !(isModuleBlock(exportNode.parent) && isAmbientModule(exportNode.parent.parent))) {
|
|
138283
138369
|
return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_export_statement) };
|
|
138284
138370
|
}
|
|
138285
138371
|
const checker = program.getTypeChecker();
|
|
138286
138372
|
const exportingModuleSymbol = getExportingModuleSymbol(exportNode.parent, checker);
|
|
138287
|
-
const flags = getSyntacticModifierFlags(exportNode) || (isExportAssignment(exportNode) && !exportNode.isExportEquals ?
|
|
138288
|
-
const wasDefault = !!(flags &
|
|
138289
|
-
if (!(flags &
|
|
138373
|
+
const flags = getSyntacticModifierFlags(exportNode) || (isExportAssignment(exportNode) && !exportNode.isExportEquals ? 2080 /* ExportDefault */ : 0 /* None */);
|
|
138374
|
+
const wasDefault = !!(flags & 2048 /* Default */);
|
|
138375
|
+
if (!(flags & 32 /* Export */) || !wasDefault && exportingModuleSymbol.exports.has("default" /* Default */)) {
|
|
138290
138376
|
return { error: getLocaleSpecificMessage(Diagnostics.This_file_already_has_a_default_export) };
|
|
138291
138377
|
}
|
|
138292
138378
|
const noSymbolError = (id) => isIdentifier(id) && checker.getSymbolAtLocation(id) ? void 0 : { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_named_export) };
|
|
@@ -138783,26 +138869,50 @@ function getRangeToExtract(context, considerEmptySpans = true) {
|
|
|
138783
138869
|
const current = getTokenAtPosition(file, startPosition);
|
|
138784
138870
|
const range = createTextRangeFromSpan(getRefactorContextSpan(context));
|
|
138785
138871
|
const cursorRequest = range.pos === range.end && considerEmptySpans;
|
|
138786
|
-
const
|
|
138787
|
-
|
|
138872
|
+
const overlappingRange = nodeOverlapsWithStartEnd(current, file, range.pos, range.end);
|
|
138873
|
+
const firstType = findAncestor(current, (node) => node.parent && isTypeNode(node) && !rangeContainsSkipTrivia(range, node.parent, file) && (cursorRequest || overlappingRange));
|
|
138874
|
+
if (!firstType || !isTypeNode(firstType))
|
|
138788
138875
|
return { error: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_type_node) };
|
|
138789
138876
|
const checker = context.program.getTypeChecker();
|
|
138790
|
-
const enclosingNode = getEnclosingNode(
|
|
138877
|
+
const enclosingNode = getEnclosingNode(firstType, isJS);
|
|
138791
138878
|
if (enclosingNode === void 0)
|
|
138792
138879
|
return { error: getLocaleSpecificMessage(Diagnostics.No_type_could_be_extracted_from_this_type_node) };
|
|
138880
|
+
const expandedFirstType = getExpandedSelectionNode(firstType, enclosingNode);
|
|
138881
|
+
if (!isTypeNode(expandedFirstType))
|
|
138882
|
+
return { error: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_type_node) };
|
|
138883
|
+
const typeList = [];
|
|
138884
|
+
if ((isUnionTypeNode(expandedFirstType.parent) || isIntersectionTypeNode(expandedFirstType.parent)) && range.end > firstType.end) {
|
|
138885
|
+
addRange(
|
|
138886
|
+
typeList,
|
|
138887
|
+
expandedFirstType.parent.types.filter((type) => {
|
|
138888
|
+
return nodeOverlapsWithStartEnd(type, file, range.pos, range.end);
|
|
138889
|
+
})
|
|
138890
|
+
);
|
|
138891
|
+
}
|
|
138892
|
+
const selection = typeList.length > 1 ? typeList : expandedFirstType;
|
|
138793
138893
|
const typeParameters = collectTypeParameters(checker, selection, enclosingNode, file);
|
|
138794
138894
|
if (!typeParameters)
|
|
138795
138895
|
return { error: getLocaleSpecificMessage(Diagnostics.No_type_could_be_extracted_from_this_type_node) };
|
|
138796
138896
|
const typeElements = flattenTypeLiteralNodeReference(checker, selection);
|
|
138797
138897
|
return { isJS, selection, enclosingNode, typeParameters, typeElements };
|
|
138798
138898
|
}
|
|
138799
|
-
function flattenTypeLiteralNodeReference(checker,
|
|
138800
|
-
if (!
|
|
138899
|
+
function flattenTypeLiteralNodeReference(checker, selection) {
|
|
138900
|
+
if (!selection)
|
|
138801
138901
|
return void 0;
|
|
138802
|
-
if (
|
|
138902
|
+
if (isArray(selection)) {
|
|
138903
|
+
const result = [];
|
|
138904
|
+
for (const type of selection) {
|
|
138905
|
+
const flattenedTypeMembers = flattenTypeLiteralNodeReference(checker, type);
|
|
138906
|
+
if (!flattenedTypeMembers)
|
|
138907
|
+
return void 0;
|
|
138908
|
+
addRange(result, flattenedTypeMembers);
|
|
138909
|
+
}
|
|
138910
|
+
return result;
|
|
138911
|
+
}
|
|
138912
|
+
if (isIntersectionTypeNode(selection)) {
|
|
138803
138913
|
const result = [];
|
|
138804
138914
|
const seen = /* @__PURE__ */ new Map();
|
|
138805
|
-
for (const type of
|
|
138915
|
+
for (const type of selection.types) {
|
|
138806
138916
|
const flattenedTypeMembers = flattenTypeLiteralNodeReference(checker, type);
|
|
138807
138917
|
if (!flattenedTypeMembers || !flattenedTypeMembers.every((type2) => type2.name && addToSeen(seen, getNameFromPropertyName(type2.name)))) {
|
|
138808
138918
|
return void 0;
|
|
@@ -138810,10 +138920,10 @@ function flattenTypeLiteralNodeReference(checker, node) {
|
|
|
138810
138920
|
addRange(result, flattenedTypeMembers);
|
|
138811
138921
|
}
|
|
138812
138922
|
return result;
|
|
138813
|
-
} else if (isParenthesizedTypeNode(
|
|
138814
|
-
return flattenTypeLiteralNodeReference(checker,
|
|
138815
|
-
} else if (isTypeLiteralNode(
|
|
138816
|
-
return
|
|
138923
|
+
} else if (isParenthesizedTypeNode(selection)) {
|
|
138924
|
+
return flattenTypeLiteralNodeReference(checker, selection.type);
|
|
138925
|
+
} else if (isTypeLiteralNode(selection)) {
|
|
138926
|
+
return selection.members;
|
|
138817
138927
|
}
|
|
138818
138928
|
return void 0;
|
|
138819
138929
|
}
|
|
@@ -138822,7 +138932,13 @@ function rangeContainsSkipTrivia(r1, node, file) {
|
|
|
138822
138932
|
}
|
|
138823
138933
|
function collectTypeParameters(checker, selection, enclosingNode, file) {
|
|
138824
138934
|
const result = [];
|
|
138825
|
-
|
|
138935
|
+
const selectionArray = toArray(selection);
|
|
138936
|
+
const selectionRange = { pos: selectionArray[0].pos, end: selectionArray[selectionArray.length - 1].end };
|
|
138937
|
+
for (const t of selectionArray) {
|
|
138938
|
+
if (visitor(t))
|
|
138939
|
+
return void 0;
|
|
138940
|
+
}
|
|
138941
|
+
return result;
|
|
138826
138942
|
function visitor(node) {
|
|
138827
138943
|
if (isTypeReferenceNode(node)) {
|
|
138828
138944
|
if (isIdentifier(node.typeName)) {
|
|
@@ -138836,10 +138952,10 @@ function collectTypeParameters(checker, selection, enclosingNode, file) {
|
|
|
138836
138952
|
);
|
|
138837
138953
|
for (const decl of (symbol == null ? void 0 : symbol.declarations) || emptyArray) {
|
|
138838
138954
|
if (isTypeParameterDeclaration(decl) && decl.getSourceFile() === file) {
|
|
138839
|
-
if (decl.name.escapedText === typeName.escapedText && rangeContainsSkipTrivia(decl,
|
|
138955
|
+
if (decl.name.escapedText === typeName.escapedText && rangeContainsSkipTrivia(decl, selectionRange, file)) {
|
|
138840
138956
|
return true;
|
|
138841
138957
|
}
|
|
138842
|
-
if (rangeContainsSkipTrivia(enclosingNode, decl, file) && !rangeContainsSkipTrivia(
|
|
138958
|
+
if (rangeContainsSkipTrivia(enclosingNode, decl, file) && !rangeContainsSkipTrivia(selectionRange, decl, file)) {
|
|
138843
138959
|
pushIfUnique(result, decl);
|
|
138844
138960
|
break;
|
|
138845
138961
|
}
|
|
@@ -138848,12 +138964,12 @@ function collectTypeParameters(checker, selection, enclosingNode, file) {
|
|
|
138848
138964
|
}
|
|
138849
138965
|
} else if (isInferTypeNode(node)) {
|
|
138850
138966
|
const conditionalTypeNode = findAncestor(node, (n) => isConditionalTypeNode(n) && rangeContainsSkipTrivia(n.extendsType, node, file));
|
|
138851
|
-
if (!conditionalTypeNode || !rangeContainsSkipTrivia(
|
|
138967
|
+
if (!conditionalTypeNode || !rangeContainsSkipTrivia(selectionRange, conditionalTypeNode, file)) {
|
|
138852
138968
|
return true;
|
|
138853
138969
|
}
|
|
138854
138970
|
} else if (isTypePredicateNode(node) || isThisTypeNode(node)) {
|
|
138855
138971
|
const functionLikeNode = findAncestor(node.parent, isFunctionLike);
|
|
138856
|
-
if (functionLikeNode && functionLikeNode.type && rangeContainsSkipTrivia(functionLikeNode.type, node, file) && !rangeContainsSkipTrivia(
|
|
138972
|
+
if (functionLikeNode && functionLikeNode.type && rangeContainsSkipTrivia(functionLikeNode.type, node, file) && !rangeContainsSkipTrivia(selectionRange, functionLikeNode, file)) {
|
|
138857
138973
|
return true;
|
|
138858
138974
|
}
|
|
138859
138975
|
} else if (isTypeQueryNode(node)) {
|
|
@@ -138865,11 +138981,11 @@ function collectTypeParameters(checker, selection, enclosingNode, file) {
|
|
|
138865
138981
|
/*excludeGlobals*/
|
|
138866
138982
|
false
|
|
138867
138983
|
);
|
|
138868
|
-
if ((symbol == null ? void 0 : symbol.valueDeclaration) && rangeContainsSkipTrivia(enclosingNode, symbol.valueDeclaration, file) && !rangeContainsSkipTrivia(
|
|
138984
|
+
if ((symbol == null ? void 0 : symbol.valueDeclaration) && rangeContainsSkipTrivia(enclosingNode, symbol.valueDeclaration, file) && !rangeContainsSkipTrivia(selectionRange, symbol.valueDeclaration, file)) {
|
|
138869
138985
|
return true;
|
|
138870
138986
|
}
|
|
138871
138987
|
} else {
|
|
138872
|
-
if (isThisIdentifier(node.exprName.left) && !rangeContainsSkipTrivia(
|
|
138988
|
+
if (isThisIdentifier(node.exprName.left) && !rangeContainsSkipTrivia(selectionRange, node.parent, file)) {
|
|
138873
138989
|
return true;
|
|
138874
138990
|
}
|
|
138875
138991
|
}
|
|
@@ -138881,8 +138997,9 @@ function collectTypeParameters(checker, selection, enclosingNode, file) {
|
|
|
138881
138997
|
}
|
|
138882
138998
|
}
|
|
138883
138999
|
function doTypeAliasChange(changes, file, name, info) {
|
|
138884
|
-
const { enclosingNode,
|
|
138885
|
-
const newTypeNode =
|
|
139000
|
+
const { enclosingNode, typeParameters } = info;
|
|
139001
|
+
const { firstTypeNode, lastTypeNode, newTypeNode } = getNodesToEdit(info);
|
|
139002
|
+
const newTypeDeclaration = factory.createTypeAliasDeclaration(
|
|
138886
139003
|
/*modifiers*/
|
|
138887
139004
|
void 0,
|
|
138888
139005
|
name,
|
|
@@ -138894,16 +139011,16 @@ function doTypeAliasChange(changes, file, name, info) {
|
|
|
138894
139011
|
/*defaultType*/
|
|
138895
139012
|
void 0
|
|
138896
139013
|
)),
|
|
138897
|
-
|
|
139014
|
+
newTypeNode
|
|
138898
139015
|
);
|
|
138899
139016
|
changes.insertNodeBefore(
|
|
138900
139017
|
file,
|
|
138901
139018
|
enclosingNode,
|
|
138902
|
-
ignoreSourceNewlines(
|
|
139019
|
+
ignoreSourceNewlines(newTypeDeclaration),
|
|
138903
139020
|
/*blankLineBetween*/
|
|
138904
139021
|
true
|
|
138905
139022
|
);
|
|
138906
|
-
changes.
|
|
139023
|
+
changes.replaceNodeRange(file, firstTypeNode, lastTypeNode, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode(
|
|
138907
139024
|
id.name,
|
|
138908
139025
|
/*typeArguments*/
|
|
138909
139026
|
void 0
|
|
@@ -138911,7 +139028,7 @@ function doTypeAliasChange(changes, file, name, info) {
|
|
|
138911
139028
|
}
|
|
138912
139029
|
function doInterfaceChange(changes, file, name, info) {
|
|
138913
139030
|
var _a;
|
|
138914
|
-
const { enclosingNode,
|
|
139031
|
+
const { enclosingNode, typeParameters, typeElements } = info;
|
|
138915
139032
|
const newTypeNode = factory.createInterfaceDeclaration(
|
|
138916
139033
|
/*modifiers*/
|
|
138917
139034
|
void 0,
|
|
@@ -138929,7 +139046,8 @@ function doInterfaceChange(changes, file, name, info) {
|
|
|
138929
139046
|
/*blankLineBetween*/
|
|
138930
139047
|
true
|
|
138931
139048
|
);
|
|
138932
|
-
|
|
139049
|
+
const { firstTypeNode, lastTypeNode } = getNodesToEdit(info);
|
|
139050
|
+
changes.replaceNodeRange(file, firstTypeNode, lastTypeNode, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode(
|
|
138933
139051
|
id.name,
|
|
138934
139052
|
/*typeArguments*/
|
|
138935
139053
|
void 0
|
|
@@ -138937,11 +139055,14 @@ function doInterfaceChange(changes, file, name, info) {
|
|
|
138937
139055
|
}
|
|
138938
139056
|
function doTypedefChange(changes, context, file, name, info) {
|
|
138939
139057
|
var _a;
|
|
138940
|
-
|
|
138941
|
-
|
|
139058
|
+
toArray(info.selection).forEach((typeNode) => {
|
|
139059
|
+
setEmitFlags(typeNode, 3072 /* NoComments */ | 4096 /* NoNestedComments */);
|
|
139060
|
+
});
|
|
139061
|
+
const { enclosingNode, typeParameters } = info;
|
|
139062
|
+
const { firstTypeNode, lastTypeNode, newTypeNode } = getNodesToEdit(info);
|
|
138942
139063
|
const node = factory.createJSDocTypedefTag(
|
|
138943
139064
|
factory.createIdentifier("typedef"),
|
|
138944
|
-
factory.createJSDocTypeExpression(
|
|
139065
|
+
factory.createJSDocTypeExpression(newTypeNode),
|
|
138945
139066
|
factory.createIdentifier(name)
|
|
138946
139067
|
);
|
|
138947
139068
|
const templates = [];
|
|
@@ -138979,15 +139100,39 @@ function doTypedefChange(changes, context, file, name, info) {
|
|
|
138979
139100
|
true
|
|
138980
139101
|
);
|
|
138981
139102
|
}
|
|
138982
|
-
changes.
|
|
139103
|
+
changes.replaceNodeRange(file, firstTypeNode, lastTypeNode, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode(
|
|
138983
139104
|
id.name,
|
|
138984
139105
|
/*typeArguments*/
|
|
138985
139106
|
void 0
|
|
138986
139107
|
))));
|
|
138987
139108
|
}
|
|
139109
|
+
function getNodesToEdit(info) {
|
|
139110
|
+
if (isArray(info.selection)) {
|
|
139111
|
+
return {
|
|
139112
|
+
firstTypeNode: info.selection[0],
|
|
139113
|
+
lastTypeNode: info.selection[info.selection.length - 1],
|
|
139114
|
+
newTypeNode: isUnionTypeNode(info.selection[0].parent) ? factory.createUnionTypeNode(info.selection) : factory.createIntersectionTypeNode(info.selection)
|
|
139115
|
+
};
|
|
139116
|
+
}
|
|
139117
|
+
return {
|
|
139118
|
+
firstTypeNode: info.selection,
|
|
139119
|
+
lastTypeNode: info.selection,
|
|
139120
|
+
newTypeNode: info.selection
|
|
139121
|
+
};
|
|
139122
|
+
}
|
|
138988
139123
|
function getEnclosingNode(node, isJS) {
|
|
138989
139124
|
return findAncestor(node, isStatement) || (isJS ? findAncestor(node, isJSDoc) : void 0);
|
|
138990
139125
|
}
|
|
139126
|
+
function getExpandedSelectionNode(firstType, enclosingNode) {
|
|
139127
|
+
return findAncestor(firstType, (node) => {
|
|
139128
|
+
if (node === enclosingNode)
|
|
139129
|
+
return "quit";
|
|
139130
|
+
if (isUnionTypeNode(node.parent) || isIntersectionTypeNode(node.parent)) {
|
|
139131
|
+
return true;
|
|
139132
|
+
}
|
|
139133
|
+
return false;
|
|
139134
|
+
}) ?? firstType;
|
|
139135
|
+
}
|
|
138991
139136
|
|
|
138992
139137
|
// src/services/refactors/helpers.ts
|
|
138993
139138
|
function isRefactorErrorInfo(info) {
|
|
@@ -139240,7 +139385,7 @@ function getNewFileImportsAndAddExportInOldFile(oldFile, importsToCopy, newFileI
|
|
|
139240
139385
|
if (markSeenTop(top)) {
|
|
139241
139386
|
addExportToChanges(oldFile, top, name, changes, useEsModuleSyntax);
|
|
139242
139387
|
}
|
|
139243
|
-
if (hasSyntacticModifier(decl,
|
|
139388
|
+
if (hasSyntacticModifier(decl, 2048 /* Default */)) {
|
|
139244
139389
|
oldFileDefault = name;
|
|
139245
139390
|
} else {
|
|
139246
139391
|
oldFileNamedImports.push(name.text);
|
|
@@ -139295,14 +139440,13 @@ function error(notApplicableReason) {
|
|
|
139295
139440
|
}
|
|
139296
139441
|
function doChange4(context, oldFile, targetFile, program, toMove, changes, host, preferences) {
|
|
139297
139442
|
const checker = program.getTypeChecker();
|
|
139298
|
-
const usage = getUsageInfo(oldFile, toMove.all, checker);
|
|
139299
139443
|
if (!host.fileExists(targetFile)) {
|
|
139300
|
-
changes.createNewFile(oldFile, targetFile, getNewStatementsAndRemoveFromOldFile2(oldFile, targetFile,
|
|
139444
|
+
changes.createNewFile(oldFile, targetFile, getNewStatementsAndRemoveFromOldFile2(oldFile, targetFile, getUsageInfo(oldFile, toMove.all, checker), changes, toMove, program, host, preferences));
|
|
139301
139445
|
addNewFileToTsconfig(program, changes, oldFile.fileName, targetFile, hostGetCanonicalFileName(host));
|
|
139302
139446
|
} else {
|
|
139303
139447
|
const targetSourceFile = Debug.checkDefined(program.getSourceFile(targetFile));
|
|
139304
139448
|
const importAdder = ts_codefix_exports.createImportAdder(targetSourceFile, context.program, context.preferences, context.host);
|
|
139305
|
-
getNewStatementsAndRemoveFromOldFile2(oldFile, targetSourceFile,
|
|
139449
|
+
getNewStatementsAndRemoveFromOldFile2(oldFile, targetSourceFile, getUsageInfo(oldFile, toMove.all, checker, getExistingImports(targetSourceFile, checker)), changes, toMove, program, host, preferences, importAdder);
|
|
139306
139450
|
}
|
|
139307
139451
|
}
|
|
139308
139452
|
function getNewStatementsAndRemoveFromOldFile2(oldFile, targetFile, usage, changes, toMove, program, host, preferences, importAdder) {
|
|
@@ -139422,7 +139566,7 @@ function getTargetFileImportsAndAddExportInOldFile(oldFile, targetFile, importsT
|
|
|
139422
139566
|
if (importAdder && checker.isUnknownSymbol(symbol)) {
|
|
139423
139567
|
importAdder.addImportFromExportedSymbol(skipAlias(symbol, checker));
|
|
139424
139568
|
} else {
|
|
139425
|
-
if (hasSyntacticModifier(decl,
|
|
139569
|
+
if (hasSyntacticModifier(decl, 2048 /* Default */)) {
|
|
139426
139570
|
oldFileDefault = name;
|
|
139427
139571
|
} else {
|
|
139428
139572
|
oldFileNamedImports.push(name.text);
|
|
@@ -139662,7 +139806,7 @@ function addExports(sourceFile, toMove, needExport, useEs6Exports) {
|
|
|
139662
139806
|
function isExported(sourceFile, decl, useEs6Exports, name) {
|
|
139663
139807
|
var _a;
|
|
139664
139808
|
if (useEs6Exports) {
|
|
139665
|
-
return !isExpressionStatement(decl) && hasSyntacticModifier(decl,
|
|
139809
|
+
return !isExpressionStatement(decl) && hasSyntacticModifier(decl, 32 /* Export */) || !!(name && sourceFile.symbol && ((_a = sourceFile.symbol.exports) == null ? void 0 : _a.has(name.escapedText)));
|
|
139666
139810
|
}
|
|
139667
139811
|
return !!sourceFile.symbol && !!sourceFile.symbol.exports && getNamesToExportInCommonJS(decl).some((name2) => sourceFile.symbol.exports.has(escapeLeadingUnderscores(name2)));
|
|
139668
139812
|
}
|
|
@@ -139957,7 +140101,7 @@ function isPureImport(node) {
|
|
|
139957
140101
|
case 272 /* ImportDeclaration */:
|
|
139958
140102
|
return true;
|
|
139959
140103
|
case 271 /* ImportEqualsDeclaration */:
|
|
139960
|
-
return !hasSyntacticModifier(node,
|
|
140104
|
+
return !hasSyntacticModifier(node, 32 /* Export */);
|
|
139961
140105
|
case 243 /* VariableStatement */:
|
|
139962
140106
|
return node.declarationList.declarations.every((d) => !!d.initializer && isRequireCall(
|
|
139963
140107
|
d.initializer,
|
|
@@ -139968,7 +140112,7 @@ function isPureImport(node) {
|
|
|
139968
140112
|
return false;
|
|
139969
140113
|
}
|
|
139970
140114
|
}
|
|
139971
|
-
function getUsageInfo(oldFile, toMove, checker) {
|
|
140115
|
+
function getUsageInfo(oldFile, toMove, checker, existingTargetImports = /* @__PURE__ */ new Set()) {
|
|
139972
140116
|
const movedSymbols = /* @__PURE__ */ new Set();
|
|
139973
140117
|
const oldImportsNeededByTargetFile = /* @__PURE__ */ new Map();
|
|
139974
140118
|
const targetFileImportsFromOldFile = /* @__PURE__ */ new Set();
|
|
@@ -139982,10 +140126,16 @@ function getUsageInfo(oldFile, toMove, checker) {
|
|
|
139982
140126
|
movedSymbols.add(Debug.checkDefined(isExpressionStatement(decl) ? checker.getSymbolAtLocation(decl.expression.left) : decl.symbol, "Need a symbol here"));
|
|
139983
140127
|
});
|
|
139984
140128
|
}
|
|
140129
|
+
const unusedImportsFromOldFile = /* @__PURE__ */ new Set();
|
|
139985
140130
|
for (const statement of toMove) {
|
|
139986
140131
|
forEachReference(statement, checker, (symbol, isValidTypeOnlyUseSite) => {
|
|
139987
|
-
if (!symbol.declarations)
|
|
140132
|
+
if (!symbol.declarations) {
|
|
140133
|
+
return;
|
|
140134
|
+
}
|
|
140135
|
+
if (existingTargetImports.has(skipAlias(symbol, checker))) {
|
|
140136
|
+
unusedImportsFromOldFile.add(symbol);
|
|
139988
140137
|
return;
|
|
140138
|
+
}
|
|
139989
140139
|
for (const decl of symbol.declarations) {
|
|
139990
140140
|
if (isInImport(decl)) {
|
|
139991
140141
|
const prevIsTypeOnly = oldImportsNeededByTargetFile.get(symbol);
|
|
@@ -139996,7 +140146,9 @@ function getUsageInfo(oldFile, toMove, checker) {
|
|
|
139996
140146
|
}
|
|
139997
140147
|
});
|
|
139998
140148
|
}
|
|
139999
|
-
const
|
|
140149
|
+
for (const unusedImport of oldImportsNeededByTargetFile.keys()) {
|
|
140150
|
+
unusedImportsFromOldFile.add(unusedImport);
|
|
140151
|
+
}
|
|
140000
140152
|
const oldFileImportsFromTargetFile = /* @__PURE__ */ new Set();
|
|
140001
140153
|
for (const statement of oldFile.statements) {
|
|
140002
140154
|
if (contains(toMove, statement))
|
|
@@ -140128,7 +140280,7 @@ function moveStatementsToTargetFile(changes, program, statements, targetFile, to
|
|
|
140128
140280
|
const checker = program.getTypeChecker();
|
|
140129
140281
|
const targetToSourceExports = /* @__PURE__ */ new Map();
|
|
140130
140282
|
for (const node of toMove.all) {
|
|
140131
|
-
if (isTopLevelDeclarationStatement(node) && hasSyntacticModifier(node,
|
|
140283
|
+
if (isTopLevelDeclarationStatement(node) && hasSyntacticModifier(node, 32 /* Export */)) {
|
|
140132
140284
|
forEachTopLevelDeclaration(node, (declaration) => {
|
|
140133
140285
|
var _a2;
|
|
140134
140286
|
const targetDeclarations = canHaveSymbol(declaration) ? (_a2 = targetExports.get(declaration.symbol.escapedName)) == null ? void 0 : _a2.declarations : void 0;
|
|
@@ -140182,6 +140334,29 @@ function getOverloadRangeToMove(sourceFile, statement) {
|
|
|
140182
140334
|
}
|
|
140183
140335
|
return void 0;
|
|
140184
140336
|
}
|
|
140337
|
+
function getExistingImports(sourceFile, checker) {
|
|
140338
|
+
const imports = /* @__PURE__ */ new Set();
|
|
140339
|
+
for (const moduleSpecifier of sourceFile.imports) {
|
|
140340
|
+
const declaration = importFromModuleSpecifier(moduleSpecifier);
|
|
140341
|
+
if (isImportDeclaration(declaration) && declaration.importClause && declaration.importClause.namedBindings && isNamedImports(declaration.importClause.namedBindings)) {
|
|
140342
|
+
for (const e of declaration.importClause.namedBindings.elements) {
|
|
140343
|
+
const symbol = checker.getSymbolAtLocation(e.propertyName || e.name);
|
|
140344
|
+
if (symbol) {
|
|
140345
|
+
imports.add(skipAlias(symbol, checker));
|
|
140346
|
+
}
|
|
140347
|
+
}
|
|
140348
|
+
}
|
|
140349
|
+
if (isVariableDeclarationInitializedToRequire(declaration.parent) && isObjectBindingPattern(declaration.parent.name)) {
|
|
140350
|
+
for (const e of declaration.parent.name.elements) {
|
|
140351
|
+
const symbol = checker.getSymbolAtLocation(e.propertyName || e.name);
|
|
140352
|
+
if (symbol) {
|
|
140353
|
+
imports.add(skipAlias(symbol, checker));
|
|
140354
|
+
}
|
|
140355
|
+
}
|
|
140356
|
+
}
|
|
140357
|
+
}
|
|
140358
|
+
return imports;
|
|
140359
|
+
}
|
|
140185
140360
|
|
|
140186
140361
|
// src/services/_namespaces/ts.refactor.addOrRemoveBracesToArrowFunction.ts
|
|
140187
140362
|
var ts_refactor_addOrRemoveBracesToArrowFunction_exports = {};
|
|
@@ -140724,7 +140899,7 @@ function getEditInfoForConvertToNamedFunction(context, func, variableInfo) {
|
|
|
140724
140899
|
const body = convertToBlock(func.body);
|
|
140725
140900
|
const { variableDeclaration, variableDeclarationList, statement, name } = variableInfo;
|
|
140726
140901
|
suppressLeadingTrivia(statement);
|
|
140727
|
-
const modifiersFlags = getCombinedModifierFlags(variableDeclaration) &
|
|
140902
|
+
const modifiersFlags = getCombinedModifierFlags(variableDeclaration) & 32 /* Export */ | getEffectiveModifierFlags(func);
|
|
140728
140903
|
const modifiers = factory.createModifiersFromModifierFlags(modifiersFlags);
|
|
140729
140904
|
const newNode = factory.createFunctionDeclaration(length(modifiers) ? modifiers : void 0, func.asteriskToken, name, func.typeParameters, func.parameters, func.type, body);
|
|
140730
140905
|
if (variableDeclarationList.declarations.length === 1) {
|
|
@@ -142081,7 +142256,7 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
|
|
|
142081
142256
|
}
|
|
142082
142257
|
if (isDeclaration(node2)) {
|
|
142083
142258
|
const declaringNode = node2.kind === 260 /* VariableDeclaration */ ? node2.parent.parent : node2;
|
|
142084
|
-
if (hasSyntacticModifier(declaringNode,
|
|
142259
|
+
if (hasSyntacticModifier(declaringNode, 32 /* Export */)) {
|
|
142085
142260
|
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity));
|
|
142086
142261
|
return true;
|
|
142087
142262
|
}
|
|
@@ -143089,7 +143264,7 @@ function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFi
|
|
|
143089
143264
|
usagesPerScope[i].usages.forEach((value) => {
|
|
143090
143265
|
if (value.usage === 2 /* Write */) {
|
|
143091
143266
|
hasWrite = true;
|
|
143092
|
-
if (value.symbol.flags & 106500 /* ClassMember */ && value.symbol.valueDeclaration && hasEffectiveModifier(value.symbol.valueDeclaration,
|
|
143267
|
+
if (value.symbol.flags & 106500 /* ClassMember */ && value.symbol.valueDeclaration && hasEffectiveModifier(value.symbol.valueDeclaration, 8 /* Readonly */)) {
|
|
143093
143268
|
readonlyClassPropertyWrite = value.symbol.valueDeclaration;
|
|
143094
143269
|
}
|
|
143095
143270
|
}
|
|
@@ -143573,14 +143748,14 @@ function collectTokens(program, sourceFile, span, collector, cancellationToken)
|
|
|
143573
143748
|
if (decl) {
|
|
143574
143749
|
const modifiers = getCombinedModifierFlags(decl);
|
|
143575
143750
|
const nodeFlags = getCombinedNodeFlags(decl);
|
|
143576
|
-
if (modifiers &
|
|
143751
|
+
if (modifiers & 256 /* Static */) {
|
|
143577
143752
|
modifierSet |= 1 << 1 /* static */;
|
|
143578
143753
|
}
|
|
143579
|
-
if (modifiers &
|
|
143754
|
+
if (modifiers & 1024 /* Async */) {
|
|
143580
143755
|
modifierSet |= 1 << 2 /* async */;
|
|
143581
143756
|
}
|
|
143582
143757
|
if (typeIdx !== 0 /* class */ && typeIdx !== 2 /* interface */) {
|
|
143583
|
-
if (modifiers &
|
|
143758
|
+
if (modifiers & 8 /* Readonly */ || nodeFlags & 2 /* Const */ || symbol.getFlags() & 8 /* EnumMember */) {
|
|
143584
143759
|
modifierSet |= 1 << 3 /* readonly */;
|
|
143585
143760
|
}
|
|
143586
143761
|
}
|
|
@@ -144298,7 +144473,7 @@ var SourceFileObject = class extends NodeObject {
|
|
|
144298
144473
|
forEachChild(node, visit);
|
|
144299
144474
|
break;
|
|
144300
144475
|
case 169 /* Parameter */:
|
|
144301
|
-
if (!hasSyntacticModifier(node,
|
|
144476
|
+
if (!hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) {
|
|
144302
144477
|
break;
|
|
144303
144478
|
}
|
|
144304
144479
|
case 260 /* VariableDeclaration */:
|
|
@@ -146151,7 +146326,7 @@ function spanInSourceFileAtLocation(sourceFile, position) {
|
|
|
146151
146326
|
if (isBindingPattern(variableDeclaration.name)) {
|
|
146152
146327
|
return spanInBindingPattern(variableDeclaration.name);
|
|
146153
146328
|
}
|
|
146154
|
-
if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration,
|
|
146329
|
+
if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 32 /* Export */) || parent2.parent.kind === 250 /* ForOfStatement */) {
|
|
146155
146330
|
return textSpanFromVariableDeclaration(variableDeclaration);
|
|
146156
146331
|
}
|
|
146157
146332
|
if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) {
|
|
@@ -146159,7 +146334,7 @@ function spanInSourceFileAtLocation(sourceFile, position) {
|
|
|
146159
146334
|
}
|
|
146160
146335
|
}
|
|
146161
146336
|
function canHaveSpanInParameterDeclaration(parameter) {
|
|
146162
|
-
return !!parameter.initializer || parameter.dotDotDotToken !== void 0 || hasSyntacticModifier(parameter,
|
|
146337
|
+
return !!parameter.initializer || parameter.dotDotDotToken !== void 0 || hasSyntacticModifier(parameter, 1 /* Public */ | 2 /* Private */);
|
|
146163
146338
|
}
|
|
146164
146339
|
function spanInParameterDeclaration(parameter) {
|
|
146165
146340
|
if (isBindingPattern(parameter.name)) {
|
|
@@ -146178,7 +146353,7 @@ function spanInSourceFileAtLocation(sourceFile, position) {
|
|
|
146178
146353
|
}
|
|
146179
146354
|
}
|
|
146180
146355
|
function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) {
|
|
146181
|
-
return hasSyntacticModifier(functionDeclaration,
|
|
146356
|
+
return hasSyntacticModifier(functionDeclaration, 32 /* Export */) || functionDeclaration.parent.kind === 263 /* ClassDeclaration */ && functionDeclaration.kind !== 176 /* Constructor */;
|
|
146182
146357
|
}
|
|
146183
146358
|
function spanInFunctionDeclaration(functionDeclaration) {
|
|
146184
146359
|
if (!functionDeclaration.body) {
|
|
@@ -146740,7 +146915,7 @@ function collectCallSitesOfSourceFile(node, collect) {
|
|
|
146740
146915
|
forEach(node.statements, collect);
|
|
146741
146916
|
}
|
|
146742
146917
|
function collectCallSitesOfModuleDeclaration(node, collect) {
|
|
146743
|
-
if (!hasSyntacticModifier(node,
|
|
146918
|
+
if (!hasSyntacticModifier(node, 128 /* Ambient */) && node.body && isModuleBlock(node.body)) {
|
|
146744
146919
|
forEach(node.body.statements, collect);
|
|
146745
146920
|
}
|
|
146746
146921
|
}
|
|
@@ -147072,7 +147247,7 @@ function makeChange2(changeTracker, sourceFile, insertionSite, fixedDeclarations
|
|
|
147072
147247
|
/*includeTrivia*/
|
|
147073
147248
|
true
|
|
147074
147249
|
),
|
|
147075
|
-
factory.createNodeArray(factory.createModifiersFromModifierFlags(getSyntacticModifierFlags(insertionSite) |
|
|
147250
|
+
factory.createNodeArray(factory.createModifiersFromModifierFlags(getSyntacticModifierFlags(insertionSite) | 1024 /* Async */))
|
|
147076
147251
|
);
|
|
147077
147252
|
changeTracker.replaceNode(
|
|
147078
147253
|
sourceFile,
|
|
@@ -147197,7 +147372,7 @@ function findAwaitableInitializers(expression, sourceFile, cancellationToken, pr
|
|
|
147197
147372
|
const declaration = tryCast(symbol.valueDeclaration, isVariableDeclaration);
|
|
147198
147373
|
const variableName = declaration && tryCast(declaration.name, isIdentifier);
|
|
147199
147374
|
const variableStatement = getAncestor(declaration, 243 /* VariableStatement */);
|
|
147200
|
-
if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement,
|
|
147375
|
+
if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement, 32 /* Export */) || !variableName || !isInsideAwaitableBody(declaration.initializer)) {
|
|
147201
147376
|
isCompleteFix = false;
|
|
147202
147377
|
continue;
|
|
147203
147378
|
}
|
|
@@ -149841,7 +150016,7 @@ function getClass(sourceFile, pos) {
|
|
|
149841
150016
|
return Debug.checkDefined(getContainingClass(getTokenAtPosition(sourceFile, pos)), "There should be a containing class");
|
|
149842
150017
|
}
|
|
149843
150018
|
function symbolPointsToNonPrivateMember(symbol) {
|
|
149844
|
-
return !symbol.valueDeclaration || !(getEffectiveModifierFlags(symbol.valueDeclaration) &
|
|
150019
|
+
return !symbol.valueDeclaration || !(getEffectiveModifierFlags(symbol.valueDeclaration) & 2 /* Private */);
|
|
149845
150020
|
}
|
|
149846
150021
|
function addMissingDeclarations(context, implementedTypeNode, sourceFile, classDeclaration, changeTracker, preferences) {
|
|
149847
150022
|
const checker = context.program.getTypeChecker();
|
|
@@ -151814,7 +151989,7 @@ function getInfo8(sourceFile, pos, context, errorCode) {
|
|
|
151814
151989
|
const tag = findAncestor(node, isJsxOpeningLikeElement);
|
|
151815
151990
|
const props = checker.getContextualTypeForArgumentAtIndex(tag, 0);
|
|
151816
151991
|
suggestedSymbol = checker.getSuggestedSymbolForNonexistentJSXAttribute(node, props);
|
|
151817
|
-
} else if (
|
|
151992
|
+
} else if (hasOverrideModifier(parent2) && isClassElement(parent2) && parent2.name === node) {
|
|
151818
151993
|
const baseDeclaration = findAncestor(node, isClassLike);
|
|
151819
151994
|
const baseTypeNode = baseDeclaration ? getEffectiveBaseTypeNode(baseDeclaration) : void 0;
|
|
151820
151995
|
const baseType = baseTypeNode ? checker.getTypeAtLocation(baseTypeNode) : void 0;
|
|
@@ -151988,7 +152163,7 @@ function checkFixedAssignableTo(checker, declaration, exprType, type, isFunction
|
|
|
151988
152163
|
if (isFunctionType) {
|
|
151989
152164
|
const sig = checker.getSignatureFromDeclaration(declaration);
|
|
151990
152165
|
if (sig) {
|
|
151991
|
-
if (hasSyntacticModifier(declaration,
|
|
152166
|
+
if (hasSyntacticModifier(declaration, 1024 /* Async */)) {
|
|
151992
152167
|
exprType = checker.createPromiseType(exprType);
|
|
151993
152168
|
}
|
|
151994
152169
|
const newSig = checker.createSignature(
|
|
@@ -152202,13 +152377,13 @@ registerCodeFix({
|
|
|
152202
152377
|
continue;
|
|
152203
152378
|
const { parentDeclaration, declSourceFile, modifierFlags, token, call, isJSFile } = info;
|
|
152204
152379
|
if (call && !isPrivateIdentifier(token)) {
|
|
152205
|
-
addMethodDeclaration(context, changes, call, token, modifierFlags &
|
|
152380
|
+
addMethodDeclaration(context, changes, call, token, modifierFlags & 256 /* Static */, parentDeclaration, declSourceFile);
|
|
152206
152381
|
} else {
|
|
152207
152382
|
if (isJSFile && !isInterfaceDeclaration(parentDeclaration) && !isTypeLiteralNode(parentDeclaration)) {
|
|
152208
|
-
addMissingMemberInJs(changes, declSourceFile, parentDeclaration, token, !!(modifierFlags &
|
|
152383
|
+
addMissingMemberInJs(changes, declSourceFile, parentDeclaration, token, !!(modifierFlags & 256 /* Static */));
|
|
152209
152384
|
} else {
|
|
152210
152385
|
const typeNode = getTypeNode2(checker, parentDeclaration, token);
|
|
152211
|
-
addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, modifierFlags &
|
|
152386
|
+
addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, modifierFlags & 256 /* Static */);
|
|
152212
152387
|
}
|
|
152213
152388
|
}
|
|
152214
152389
|
}
|
|
@@ -152289,13 +152464,13 @@ function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
|
|
|
152289
152464
|
const moduleDeclaration = find(symbol.declarations, isModuleDeclaration);
|
|
152290
152465
|
const moduleDeclarationSourceFile = moduleDeclaration == null ? void 0 : moduleDeclaration.getSourceFile();
|
|
152291
152466
|
if (moduleDeclaration && moduleDeclarationSourceFile && !isSourceFileFromLibrary(program, moduleDeclarationSourceFile)) {
|
|
152292
|
-
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile, modifierFlags:
|
|
152467
|
+
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile, modifierFlags: 32 /* Export */, parentDeclaration: moduleDeclaration };
|
|
152293
152468
|
}
|
|
152294
152469
|
const moduleSourceFile = find(symbol.declarations, isSourceFile);
|
|
152295
152470
|
if (sourceFile.commonJsModuleIndicator)
|
|
152296
152471
|
return void 0;
|
|
152297
152472
|
if (moduleSourceFile && !isSourceFileFromLibrary(program, moduleSourceFile)) {
|
|
152298
|
-
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile: moduleSourceFile, modifierFlags:
|
|
152473
|
+
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile: moduleSourceFile, modifierFlags: 32 /* Export */, parentDeclaration: moduleSourceFile };
|
|
152299
152474
|
}
|
|
152300
152475
|
}
|
|
152301
152476
|
const classDeclaration = find(symbol.declarations, isClassLike);
|
|
@@ -152307,7 +152482,7 @@ function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
|
|
|
152307
152482
|
if (makeStatic && (isPrivateIdentifier(token) || isInterfaceDeclaration(declaration)))
|
|
152308
152483
|
return void 0;
|
|
152309
152484
|
const declSourceFile = declaration.getSourceFile();
|
|
152310
|
-
const modifierFlags = isTypeLiteralNode(declaration) ? 0 /* None */ : (makeStatic ?
|
|
152485
|
+
const modifierFlags = isTypeLiteralNode(declaration) ? 0 /* None */ : (makeStatic ? 256 /* Static */ : 0 /* None */) | (startsWithUnderscore(token.text) ? 2 /* Private */ : 0 /* None */);
|
|
152311
152486
|
const isJSFile = isSourceFileJS(declSourceFile);
|
|
152312
152487
|
const call = tryCast(parent2.parent, isCallExpression);
|
|
152313
152488
|
return { kind: 0 /* TypeLikeDeclaration */, token, call, modifierFlags, parentDeclaration: declaration, declSourceFile, isJSFile };
|
|
@@ -152325,11 +152500,11 @@ function createActionForAddMissingMemberInJavascriptFile(context, { parentDeclar
|
|
|
152325
152500
|
if (isInterfaceDeclaration(parentDeclaration) || isTypeLiteralNode(parentDeclaration)) {
|
|
152326
152501
|
return void 0;
|
|
152327
152502
|
}
|
|
152328
|
-
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addMissingMemberInJs(t, declSourceFile, parentDeclaration, token, !!(modifierFlags &
|
|
152503
|
+
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addMissingMemberInJs(t, declSourceFile, parentDeclaration, token, !!(modifierFlags & 256 /* Static */)));
|
|
152329
152504
|
if (changes.length === 0) {
|
|
152330
152505
|
return void 0;
|
|
152331
152506
|
}
|
|
152332
|
-
const diagnostic = modifierFlags &
|
|
152507
|
+
const diagnostic = modifierFlags & 256 /* Static */ ? Diagnostics.Initialize_static_property_0 : isPrivateIdentifier(token) ? Diagnostics.Declare_a_private_field_named_0 : Diagnostics.Initialize_property_0_in_the_constructor;
|
|
152333
152508
|
return createCodeFixAction(fixMissingMember, changes, [diagnostic, token.text], fixMissingMember, Diagnostics.Add_all_missing_members);
|
|
152334
152509
|
}
|
|
152335
152510
|
function addMissingMemberInJs(changeTracker, sourceFile, classDeclaration, token, makeStatic) {
|
|
@@ -152373,15 +152548,15 @@ function initializePropertyToUndefined(obj, propertyName) {
|
|
|
152373
152548
|
}
|
|
152374
152549
|
function createActionsForAddMissingMemberInTypeScriptFile(context, { parentDeclaration, declSourceFile, modifierFlags, token }) {
|
|
152375
152550
|
const memberName = token.text;
|
|
152376
|
-
const isStatic2 = modifierFlags &
|
|
152551
|
+
const isStatic2 = modifierFlags & 256 /* Static */;
|
|
152377
152552
|
const typeNode = getTypeNode2(context.program.getTypeChecker(), parentDeclaration, token);
|
|
152378
152553
|
const addPropertyDeclarationChanges = (modifierFlags2) => ts_textChanges_exports.ChangeTracker.with(context, (t) => addPropertyDeclaration(t, declSourceFile, parentDeclaration, memberName, typeNode, modifierFlags2));
|
|
152379
|
-
const actions2 = [createCodeFixAction(fixMissingMember, addPropertyDeclarationChanges(modifierFlags &
|
|
152554
|
+
const actions2 = [createCodeFixAction(fixMissingMember, addPropertyDeclarationChanges(modifierFlags & 256 /* Static */), [isStatic2 ? Diagnostics.Declare_static_property_0 : Diagnostics.Declare_property_0, memberName], fixMissingMember, Diagnostics.Add_all_missing_members)];
|
|
152380
152555
|
if (isStatic2 || isPrivateIdentifier(token)) {
|
|
152381
152556
|
return actions2;
|
|
152382
152557
|
}
|
|
152383
|
-
if (modifierFlags &
|
|
152384
|
-
actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addPropertyDeclarationChanges(
|
|
152558
|
+
if (modifierFlags & 2 /* Private */) {
|
|
152559
|
+
actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addPropertyDeclarationChanges(2 /* Private */), [Diagnostics.Declare_private_property_0, memberName]));
|
|
152385
152560
|
}
|
|
152386
152561
|
actions2.push(createAddIndexSignatureAction(context, declSourceFile, parentDeclaration, token.text, typeNode));
|
|
152387
152562
|
return actions2;
|
|
@@ -152468,9 +152643,9 @@ function getActionsForMissingMethodDeclaration(context, info) {
|
|
|
152468
152643
|
}
|
|
152469
152644
|
const methodName = token.text;
|
|
152470
152645
|
const addMethodDeclarationChanges = (modifierFlags2) => ts_textChanges_exports.ChangeTracker.with(context, (t) => addMethodDeclaration(context, t, call, token, modifierFlags2, parentDeclaration, declSourceFile));
|
|
152471
|
-
const actions2 = [createCodeFixAction(fixMissingMember, addMethodDeclarationChanges(modifierFlags &
|
|
152472
|
-
if (modifierFlags &
|
|
152473
|
-
actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addMethodDeclarationChanges(
|
|
152646
|
+
const actions2 = [createCodeFixAction(fixMissingMember, addMethodDeclarationChanges(modifierFlags & 256 /* Static */), [modifierFlags & 256 /* Static */ ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0, methodName], fixMissingMember, Diagnostics.Add_all_missing_members)];
|
|
152647
|
+
if (modifierFlags & 2 /* Private */) {
|
|
152648
|
+
actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addMethodDeclarationChanges(2 /* Private */), [Diagnostics.Declare_private_method_0, methodName]));
|
|
152474
152649
|
}
|
|
152475
152650
|
return actions2;
|
|
152476
152651
|
}
|
|
@@ -152886,7 +153061,7 @@ function addMissingMembers(classDeclaration, sourceFile, context, changeTracker,
|
|
|
152886
153061
|
}
|
|
152887
153062
|
function symbolPointsToNonPrivateAndAbstractMember(symbol) {
|
|
152888
153063
|
const flags = getSyntacticModifierFlags(first(symbol.getDeclarations()));
|
|
152889
|
-
return !(flags &
|
|
153064
|
+
return !(flags & 2 /* Private */) && !!(flags & 64 /* Abstract */);
|
|
152890
153065
|
}
|
|
152891
153066
|
|
|
152892
153067
|
// src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts
|
|
@@ -155220,10 +155395,10 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
|
|
|
155220
155395
|
const kind = (declaration == null ? void 0 : declaration.kind) ?? 171 /* PropertySignature */;
|
|
155221
155396
|
const declarationName = createDeclarationName(symbol, declaration);
|
|
155222
155397
|
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
|
|
155223
|
-
let modifierFlags = effectiveModifierFlags &
|
|
155224
|
-
modifierFlags |= effectiveModifierFlags &
|
|
155398
|
+
let modifierFlags = effectiveModifierFlags & 256 /* Static */;
|
|
155399
|
+
modifierFlags |= effectiveModifierFlags & 1 /* Public */ ? 1 /* Public */ : effectiveModifierFlags & 4 /* Protected */ ? 4 /* Protected */ : 0 /* None */;
|
|
155225
155400
|
if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
|
|
155226
|
-
modifierFlags |=
|
|
155401
|
+
modifierFlags |= 512 /* Accessor */;
|
|
155227
155402
|
}
|
|
155228
155403
|
const modifiers = createModifiers();
|
|
155229
155404
|
const type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration));
|
|
@@ -155889,24 +156064,24 @@ function createAccessorAccessExpression(fieldName, isStatic2, container) {
|
|
|
155889
156064
|
return isIdentifier(fieldName) ? factory.createPropertyAccessExpression(leftHead, fieldName) : factory.createElementAccessExpression(leftHead, factory.createStringLiteralFromNode(fieldName));
|
|
155890
156065
|
}
|
|
155891
156066
|
function prepareModifierFlagsForAccessor(modifierFlags) {
|
|
155892
|
-
modifierFlags &= ~
|
|
155893
|
-
modifierFlags &= ~
|
|
155894
|
-
if (!(modifierFlags &
|
|
155895
|
-
modifierFlags |=
|
|
156067
|
+
modifierFlags &= ~8 /* Readonly */;
|
|
156068
|
+
modifierFlags &= ~2 /* Private */;
|
|
156069
|
+
if (!(modifierFlags & 4 /* Protected */)) {
|
|
156070
|
+
modifierFlags |= 1 /* Public */;
|
|
155896
156071
|
}
|
|
155897
156072
|
return modifierFlags;
|
|
155898
156073
|
}
|
|
155899
156074
|
function prepareModifierFlagsForField(modifierFlags) {
|
|
155900
|
-
modifierFlags &= ~
|
|
155901
|
-
modifierFlags &= ~
|
|
155902
|
-
modifierFlags |=
|
|
156075
|
+
modifierFlags &= ~1 /* Public */;
|
|
156076
|
+
modifierFlags &= ~4 /* Protected */;
|
|
156077
|
+
modifierFlags |= 2 /* Private */;
|
|
155903
156078
|
return modifierFlags;
|
|
155904
156079
|
}
|
|
155905
156080
|
function getAccessorConvertiblePropertyAtPosition(file, program, start2, end, considerEmptySpans = true) {
|
|
155906
156081
|
const node = getTokenAtPosition(file, start2);
|
|
155907
156082
|
const cursorRequest = start2 === end && considerEmptySpans;
|
|
155908
156083
|
const declaration = findAncestor(node.parent, isAcceptedDeclaration);
|
|
155909
|
-
const meaning =
|
|
156084
|
+
const meaning = 7 /* AccessibilityModifier */ | 256 /* Static */ | 8 /* Readonly */;
|
|
155910
156085
|
if (!declaration || !(nodeOverlapsWithStartEnd(declaration.name, file, start2, end) || cursorRequest)) {
|
|
155911
156086
|
return {
|
|
155912
156087
|
error: getLocaleSpecificMessage(Diagnostics.Could_not_find_property_for_which_to_generate_accessor)
|
|
@@ -155917,7 +156092,7 @@ function getAccessorConvertiblePropertyAtPosition(file, program, start2, end, co
|
|
|
155917
156092
|
error: getLocaleSpecificMessage(Diagnostics.Name_is_not_valid)
|
|
155918
156093
|
};
|
|
155919
156094
|
}
|
|
155920
|
-
if ((getEffectiveModifierFlags(declaration) &
|
|
156095
|
+
if ((getEffectiveModifierFlags(declaration) & 98303 /* Modifier */ | meaning) !== meaning) {
|
|
155921
156096
|
return {
|
|
155922
156097
|
error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_property_with_modifier)
|
|
155923
156098
|
};
|
|
@@ -156287,7 +156462,7 @@ function getDefaultValueFromType(checker, type) {
|
|
|
156287
156462
|
return firstDefined(type.types, (t) => getDefaultValueFromType(checker, t));
|
|
156288
156463
|
} else if (type.isClass()) {
|
|
156289
156464
|
const classDeclaration = getClassLikeDeclarationOfSymbol(type.symbol);
|
|
156290
|
-
if (!classDeclaration || hasSyntacticModifier(classDeclaration,
|
|
156465
|
+
if (!classDeclaration || hasSyntacticModifier(classDeclaration, 64 /* Abstract */))
|
|
156291
156466
|
return void 0;
|
|
156292
156467
|
const constructorDeclaration = getFirstConstructorWithBody(classDeclaration);
|
|
156293
156468
|
if (constructorDeclaration && constructorDeclaration.parameters.length)
|
|
@@ -158004,7 +158179,7 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
158004
158179
|
}
|
|
158005
158180
|
let modifiers = 0 /* None */;
|
|
158006
158181
|
const { modifiers: presentModifiers, range: eraseRange, decorators: presentDecorators } = getPresentModifiers(contextToken, sourceFile, position);
|
|
158007
|
-
const isAbstract = presentModifiers &
|
|
158182
|
+
const isAbstract = presentModifiers & 64 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 64 /* Abstract */;
|
|
158008
158183
|
let completionNodes = [];
|
|
158009
158184
|
ts_codefix_exports.addNewNodeForMemberSymbol(
|
|
158010
158185
|
symbol,
|
|
@@ -158023,10 +158198,10 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
158023
158198
|
(node) => {
|
|
158024
158199
|
let requiredModifiers = 0 /* None */;
|
|
158025
158200
|
if (isAbstract) {
|
|
158026
|
-
requiredModifiers |=
|
|
158201
|
+
requiredModifiers |= 64 /* Abstract */;
|
|
158027
158202
|
}
|
|
158028
158203
|
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) {
|
|
158029
|
-
requiredModifiers |=
|
|
158204
|
+
requiredModifiers |= 16 /* Override */;
|
|
158030
158205
|
}
|
|
158031
158206
|
if (!completionNodes.length) {
|
|
158032
158207
|
modifiers = node.modifierFlagsCache | requiredModifiers;
|
|
@@ -158040,21 +158215,21 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
158040
158215
|
);
|
|
158041
158216
|
if (completionNodes.length) {
|
|
158042
158217
|
const isMethod = symbol.flags & 8192 /* Method */;
|
|
158043
|
-
let allowedModifiers = modifiers |
|
|
158218
|
+
let allowedModifiers = modifiers | 16 /* Override */ | 1 /* Public */;
|
|
158044
158219
|
if (!isMethod) {
|
|
158045
|
-
allowedModifiers |=
|
|
158220
|
+
allowedModifiers |= 128 /* Ambient */ | 8 /* Readonly */;
|
|
158046
158221
|
} else {
|
|
158047
|
-
allowedModifiers |=
|
|
158222
|
+
allowedModifiers |= 1024 /* Async */;
|
|
158048
158223
|
}
|
|
158049
158224
|
const allowedAndPresent = presentModifiers & allowedModifiers;
|
|
158050
158225
|
if (presentModifiers & ~allowedModifiers) {
|
|
158051
158226
|
return void 0;
|
|
158052
158227
|
}
|
|
158053
|
-
if (modifiers &
|
|
158054
|
-
modifiers &= ~
|
|
158228
|
+
if (modifiers & 4 /* Protected */ && allowedAndPresent & 1 /* Public */) {
|
|
158229
|
+
modifiers &= ~4 /* Protected */;
|
|
158055
158230
|
}
|
|
158056
|
-
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent &
|
|
158057
|
-
modifiers &= ~
|
|
158231
|
+
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 1 /* Public */)) {
|
|
158232
|
+
modifiers &= ~1 /* Public */;
|
|
158058
158233
|
}
|
|
158059
158234
|
modifiers |= allowedAndPresent;
|
|
158060
158235
|
completionNodes = completionNodes.map((node) => factory.replaceModifiers(node, modifiers));
|
|
@@ -158091,7 +158266,7 @@ function getPresentModifiers(contextToken, sourceFile, position) {
|
|
|
158091
158266
|
let contextMod;
|
|
158092
158267
|
const range = { pos: position, end: position };
|
|
158093
158268
|
if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) {
|
|
158094
|
-
modifiers |= modifiersToFlags(contextToken.parent.modifiers) &
|
|
158269
|
+
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 98303 /* Modifier */;
|
|
158095
158270
|
decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
|
|
158096
158271
|
range.pos = Math.min(range.pos, contextToken.parent.modifiers.pos);
|
|
158097
158272
|
}
|
|
@@ -159264,57 +159439,109 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
159264
159439
|
function addPropertySymbol(symbol, insertAwait, insertQuestionDot) {
|
|
159265
159440
|
var _a;
|
|
159266
159441
|
const computedPropertyName = firstDefined(symbol.declarations, (decl) => tryCast(getNameOfDeclaration(decl), isComputedPropertyName));
|
|
159267
|
-
if (computedPropertyName) {
|
|
159268
|
-
|
|
159269
|
-
|
|
159270
|
-
|
|
159271
|
-
|
|
159272
|
-
|
|
159273
|
-
|
|
159274
|
-
|
|
159275
|
-
|
|
159276
|
-
|
|
159277
|
-
|
|
159442
|
+
if (!computedPropertyName) {
|
|
159443
|
+
addLiteralSymbol();
|
|
159444
|
+
return;
|
|
159445
|
+
}
|
|
159446
|
+
const computedPropertyNameExpression = computedPropertyName.expression;
|
|
159447
|
+
const name = isEntityName(computedPropertyNameExpression) ? computedPropertyNameExpression : isPropertyAccessExpression(computedPropertyNameExpression) ? computedPropertyNameExpression.name : void 0;
|
|
159448
|
+
const nameSymbol = name && typeChecker.getSymbolAtLocation(name);
|
|
159449
|
+
const nameSymbolId = nameSymbol && getSymbolId(nameSymbol);
|
|
159450
|
+
if (!nameSymbolId) {
|
|
159451
|
+
addLiteralSymbol();
|
|
159452
|
+
return;
|
|
159453
|
+
}
|
|
159454
|
+
if (addToSeen(seenPropertySymbols, nameSymbolId)) {
|
|
159455
|
+
const leftMostName = getLeftMostName(computedPropertyNameExpression);
|
|
159456
|
+
const leftMostNameSymbol = leftMostName && typeChecker.getSymbolAtLocation(leftMostName);
|
|
159457
|
+
const firstAccessibleSymbol = leftMostNameSymbol && getFirstSymbolInChain(leftMostNameSymbol, contextToken, typeChecker);
|
|
159458
|
+
if (!firstAccessibleSymbol) {
|
|
159459
|
+
addLiteralSymbol();
|
|
159460
|
+
return;
|
|
159461
|
+
}
|
|
159462
|
+
const index = symbols.length;
|
|
159463
|
+
symbols.push(nameSymbol);
|
|
159464
|
+
const moduleSymbol = firstAccessibleSymbol.parent;
|
|
159465
|
+
if (!moduleSymbol || !isExternalModuleSymbol(moduleSymbol) || typeChecker.tryGetMemberInModuleExportsAndProperties(firstAccessibleSymbol.name, moduleSymbol) !== firstAccessibleSymbol) {
|
|
159466
|
+
const node2 = preferences.includeCompletionsWithInsertText ? createComputedPropertyAccess(nameSymbol, leftMostNameSymbol, computedPropertyNameExpression) : void 0;
|
|
159467
|
+
if (!node2) {
|
|
159468
|
+
symbols[index] = symbol;
|
|
159278
159469
|
} else {
|
|
159279
|
-
const
|
|
159280
|
-
|
|
159281
|
-
|
|
159282
|
-
|
|
159283
|
-
|
|
159284
|
-
|
|
159285
|
-
|
|
159286
|
-
|
|
159287
|
-
|
|
159288
|
-
|
|
159289
|
-
|
|
159290
|
-
isValidTypeOnlyAliasUseSite(location)
|
|
159291
|
-
) || {};
|
|
159292
|
-
if (moduleSpecifier) {
|
|
159293
|
-
const origin = {
|
|
159294
|
-
kind: getNullableSymbolOriginInfoKind(6 /* SymbolMemberExport */),
|
|
159295
|
-
moduleSymbol,
|
|
159296
|
-
isDefaultExport: false,
|
|
159297
|
-
symbolName: firstAccessibleSymbol.name,
|
|
159298
|
-
exportName: firstAccessibleSymbol.name,
|
|
159299
|
-
fileName,
|
|
159300
|
-
moduleSpecifier
|
|
159301
|
-
};
|
|
159302
|
-
symbolToOriginInfoMap[index] = origin;
|
|
159303
|
-
}
|
|
159470
|
+
const printer = createPrinter({
|
|
159471
|
+
removeComments: true,
|
|
159472
|
+
module: compilerOptions.module,
|
|
159473
|
+
target: compilerOptions.target,
|
|
159474
|
+
omitTrailingSemicolon: true
|
|
159475
|
+
});
|
|
159476
|
+
const origin = {
|
|
159477
|
+
kind: getNullableSymbolOriginInfoKind(2 /* SymbolMemberNoExport */) | 512 /* ComputedPropertyName */,
|
|
159478
|
+
symbolName: printer.printNode(4 /* Unspecified */, node2, contextToken.getSourceFile())
|
|
159479
|
+
};
|
|
159480
|
+
symbolToOriginInfoMap[index] = origin;
|
|
159304
159481
|
}
|
|
159305
|
-
} else
|
|
159306
|
-
|
|
159307
|
-
|
|
159482
|
+
} else {
|
|
159483
|
+
const fileName = isExternalModuleNameRelative(stripQuotes(moduleSymbol.name)) ? (_a = getSourceFileOfModule(moduleSymbol)) == null ? void 0 : _a.fileName : void 0;
|
|
159484
|
+
const { moduleSpecifier } = (importSpecifierResolver || (importSpecifierResolver = ts_codefix_exports.createImportSpecifierResolver(sourceFile, program, host, preferences))).getModuleSpecifierForBestExportInfo(
|
|
159485
|
+
[{
|
|
159486
|
+
exportKind: 0 /* Named */,
|
|
159487
|
+
moduleFileName: fileName,
|
|
159488
|
+
isFromPackageJson: false,
|
|
159489
|
+
moduleSymbol,
|
|
159490
|
+
symbol: firstAccessibleSymbol,
|
|
159491
|
+
targetFlags: skipAlias(firstAccessibleSymbol, typeChecker).flags
|
|
159492
|
+
}],
|
|
159493
|
+
position,
|
|
159494
|
+
isValidTypeOnlyAliasUseSite(location)
|
|
159495
|
+
) || {};
|
|
159496
|
+
if (moduleSpecifier) {
|
|
159497
|
+
const origin = {
|
|
159498
|
+
kind: getNullableSymbolOriginInfoKind(6 /* SymbolMemberExport */),
|
|
159499
|
+
moduleSymbol,
|
|
159500
|
+
isDefaultExport: false,
|
|
159501
|
+
symbolName: firstAccessibleSymbol.name,
|
|
159502
|
+
exportName: firstAccessibleSymbol.name,
|
|
159503
|
+
fileName,
|
|
159504
|
+
moduleSpecifier
|
|
159505
|
+
};
|
|
159506
|
+
symbolToOriginInfoMap[index] = origin;
|
|
159308
159507
|
}
|
|
159309
|
-
addSymbolOriginInfo(symbol);
|
|
159310
|
-
addSymbolSortInfo(symbol);
|
|
159311
|
-
symbols.push(symbol);
|
|
159312
159508
|
}
|
|
159313
|
-
}
|
|
159509
|
+
}
|
|
159510
|
+
function addLiteralSymbol() {
|
|
159314
159511
|
addSymbolOriginInfo(symbol);
|
|
159315
159512
|
addSymbolSortInfo(symbol);
|
|
159316
159513
|
symbols.push(symbol);
|
|
159317
159514
|
}
|
|
159515
|
+
function createComputedPropertyAccess(nameSymbol2, leftMostNameSymbol, computedPropertyNameExpression2) {
|
|
159516
|
+
let node2;
|
|
159517
|
+
if (!isTransientSymbol(nameSymbol2)) {
|
|
159518
|
+
node2 = typeChecker.symbolToEntityName(
|
|
159519
|
+
nameSymbol2,
|
|
159520
|
+
/*meaning*/
|
|
159521
|
+
void 0,
|
|
159522
|
+
contextToken,
|
|
159523
|
+
16384 /* UseAliasDefinedOutsideCurrentScope */
|
|
159524
|
+
);
|
|
159525
|
+
} else {
|
|
159526
|
+
let createPropertyAccess2 = function(n) {
|
|
159527
|
+
if (isIdentifier(n)) {
|
|
159528
|
+
Debug.assertNode(leftMostNodeAccessExpression, isExpression);
|
|
159529
|
+
return leftMostNodeAccessExpression;
|
|
159530
|
+
}
|
|
159531
|
+
return factory.createPropertyAccessExpression(createPropertyAccess2(n.expression), n.name);
|
|
159532
|
+
};
|
|
159533
|
+
var createPropertyAccess = createPropertyAccess2;
|
|
159534
|
+
const leftMostNodeAccessExpression = typeChecker.symbolToNode(
|
|
159535
|
+
leftMostNameSymbol,
|
|
159536
|
+
/*meaning*/
|
|
159537
|
+
void 0,
|
|
159538
|
+
contextToken,
|
|
159539
|
+
16384 /* UseAliasDefinedOutsideCurrentScope */
|
|
159540
|
+
);
|
|
159541
|
+
node2 = createPropertyAccess2(computedPropertyNameExpression2);
|
|
159542
|
+
}
|
|
159543
|
+
return node2;
|
|
159544
|
+
}
|
|
159318
159545
|
function addSymbolSortInfo(symbol2) {
|
|
159319
159546
|
if (isStaticProperty(symbol2)) {
|
|
159320
159547
|
symbolToSortTextMap[getSymbolId(symbol2)] = SortText.LocalDeclarationPriority;
|
|
@@ -159841,24 +160068,24 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
159841
160068
|
if (contextToken.kind === 80 /* Identifier */ && !isCurrentlyEditingNode(contextToken)) {
|
|
159842
160069
|
switch (contextToken.getText()) {
|
|
159843
160070
|
case "private":
|
|
159844
|
-
classElementModifierFlags = classElementModifierFlags |
|
|
160071
|
+
classElementModifierFlags = classElementModifierFlags | 2 /* Private */;
|
|
159845
160072
|
break;
|
|
159846
160073
|
case "static":
|
|
159847
|
-
classElementModifierFlags = classElementModifierFlags |
|
|
160074
|
+
classElementModifierFlags = classElementModifierFlags | 256 /* Static */;
|
|
159848
160075
|
break;
|
|
159849
160076
|
case "override":
|
|
159850
|
-
classElementModifierFlags = classElementModifierFlags |
|
|
160077
|
+
classElementModifierFlags = classElementModifierFlags | 16 /* Override */;
|
|
159851
160078
|
break;
|
|
159852
160079
|
}
|
|
159853
160080
|
}
|
|
159854
160081
|
if (isClassStaticBlockDeclaration(classElement)) {
|
|
159855
|
-
classElementModifierFlags |=
|
|
160082
|
+
classElementModifierFlags |= 256 /* Static */;
|
|
159856
160083
|
}
|
|
159857
|
-
if (!(classElementModifierFlags &
|
|
159858
|
-
const baseTypeNodes = isClassLike(decl) && classElementModifierFlags &
|
|
160084
|
+
if (!(classElementModifierFlags & 2 /* Private */)) {
|
|
160085
|
+
const baseTypeNodes = isClassLike(decl) && classElementModifierFlags & 16 /* Override */ ? singleElementArray(getEffectiveBaseTypeNode(decl)) : getAllSuperTypeNodes(decl);
|
|
159859
160086
|
const baseSymbols = flatMap(baseTypeNodes, (baseTypeNode) => {
|
|
159860
160087
|
const type = typeChecker.getTypeAtLocation(baseTypeNode);
|
|
159861
|
-
return classElementModifierFlags &
|
|
160088
|
+
return classElementModifierFlags & 256 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type);
|
|
159862
160089
|
});
|
|
159863
160090
|
symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags));
|
|
159864
160091
|
forEach(symbols, (symbol, index) => {
|
|
@@ -160161,10 +160388,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
160161
160388
|
if (isCurrentlyEditingNode(m)) {
|
|
160162
160389
|
continue;
|
|
160163
160390
|
}
|
|
160164
|
-
if (hasEffectiveModifier(m,
|
|
160391
|
+
if (hasEffectiveModifier(m, 2 /* Private */)) {
|
|
160165
160392
|
continue;
|
|
160166
160393
|
}
|
|
160167
|
-
if (isStatic(m) !== !!(currentClassElementModifierFlags &
|
|
160394
|
+
if (isStatic(m) !== !!(currentClassElementModifierFlags & 256 /* Static */)) {
|
|
160168
160395
|
continue;
|
|
160169
160396
|
}
|
|
160170
160397
|
const existingName = getPropertyNameForPropertyNameNode(m.name);
|
|
@@ -160173,7 +160400,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
160173
160400
|
}
|
|
160174
160401
|
}
|
|
160175
160402
|
return baseSymbols.filter(
|
|
160176
|
-
(propertySymbol) => !existingMemberNames.has(propertySymbol.escapedName) && !!propertySymbol.declarations && !(getDeclarationModifierFlagsFromSymbol(propertySymbol) &
|
|
160403
|
+
(propertySymbol) => !existingMemberNames.has(propertySymbol.escapedName) && !!propertySymbol.declarations && !(getDeclarationModifierFlagsFromSymbol(propertySymbol) & 2 /* Private */) && !(propertySymbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(propertySymbol.valueDeclaration))
|
|
160177
160404
|
);
|
|
160178
160405
|
}
|
|
160179
160406
|
function filterJsxAttributes(symbols2, attributes) {
|
|
@@ -160285,7 +160512,7 @@ function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, js
|
|
|
160285
160512
|
return { name: JSON.stringify(name), needsConvertPropertyAccess: false };
|
|
160286
160513
|
case 2 /* PropertyAccess */:
|
|
160287
160514
|
case 1 /* Global */:
|
|
160288
|
-
return name.charCodeAt(0) === 32 /* space */ ? void 0 : { name, needsConvertPropertyAccess:
|
|
160515
|
+
return name.charCodeAt(0) === 32 /* space */ ? void 0 : { name, needsConvertPropertyAccess: !originIsComputedPropertyName(origin) };
|
|
160289
160516
|
case 5 /* None */:
|
|
160290
160517
|
case 4 /* String */:
|
|
160291
160518
|
return validNameResult;
|
|
@@ -160435,7 +160662,7 @@ function getApparentProperties(type, node, checker) {
|
|
|
160435
160662
|
return checker.getAllPossiblePropertiesOfTypes(filter(type.types, (memberType) => !(memberType.flags & 402784252 /* Primitive */ || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || checker.typeHasCallOrConstructSignatures(memberType) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties()))));
|
|
160436
160663
|
}
|
|
160437
160664
|
function containsNonPublicProperties(props) {
|
|
160438
|
-
return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) &
|
|
160665
|
+
return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */));
|
|
160439
160666
|
}
|
|
160440
160667
|
function getPropertiesForCompletion(type, checker) {
|
|
160441
160668
|
return type.isUnion() ? Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type.types), "getAllPossiblePropertiesOfTypes() should all be defined") : Debug.checkEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined");
|
|
@@ -160595,7 +160822,7 @@ function isProbablyGlobalType(type, sourceFile, checker) {
|
|
|
160595
160822
|
return false;
|
|
160596
160823
|
}
|
|
160597
160824
|
function isStaticProperty(symbol) {
|
|
160598
|
-
return !!(symbol.valueDeclaration && getEffectiveModifierFlags(symbol.valueDeclaration) &
|
|
160825
|
+
return !!(symbol.valueDeclaration && getEffectiveModifierFlags(symbol.valueDeclaration) & 256 /* Static */ && isClassLike(symbol.valueDeclaration.parent));
|
|
160599
160826
|
}
|
|
160600
160827
|
function tryGetObjectLiteralContextualType(node, typeChecker) {
|
|
160601
160828
|
const type = typeChecker.getContextualType(node);
|
|
@@ -161395,7 +161622,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, c
|
|
|
161395
161622
|
}
|
|
161396
161623
|
const keys = getOwnKeys(exports);
|
|
161397
161624
|
const fragmentSubpath = components.join("/") + (components.length && hasTrailingDirectorySeparator(fragment) ? "/" : "");
|
|
161398
|
-
const conditions = getConditions(compilerOptions, mode
|
|
161625
|
+
const conditions = getConditions(compilerOptions, mode);
|
|
161399
161626
|
addCompletionEntriesFromPathsOrExports(
|
|
161400
161627
|
result,
|
|
161401
161628
|
fragmentSubpath,
|
|
@@ -161728,7 +161955,7 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, {
|
|
|
161728
161955
|
handleNamespaceImport(
|
|
161729
161956
|
direct,
|
|
161730
161957
|
direct.name,
|
|
161731
|
-
hasSyntacticModifier(direct,
|
|
161958
|
+
hasSyntacticModifier(direct, 32 /* Export */),
|
|
161732
161959
|
/*alreadyAddedDirect*/
|
|
161733
161960
|
false
|
|
161734
161961
|
);
|
|
@@ -162043,7 +162270,7 @@ function getImportOrExportSymbol(node, symbol, checker, comingFromExport) {
|
|
|
162043
162270
|
}
|
|
162044
162271
|
} else {
|
|
162045
162272
|
const exportNode = getExportNode(parent2, node);
|
|
162046
|
-
if (exportNode && hasSyntacticModifier(exportNode,
|
|
162273
|
+
if (exportNode && hasSyntacticModifier(exportNode, 32 /* Export */)) {
|
|
162047
162274
|
if (isImportEqualsDeclaration(exportNode) && exportNode.moduleReference === node) {
|
|
162048
162275
|
if (comingFromExport) {
|
|
162049
162276
|
return void 0;
|
|
@@ -162120,7 +162347,7 @@ function getImportOrExportSymbol(node, symbol, checker, comingFromExport) {
|
|
|
162120
162347
|
return exportInfo2 && { kind: 1 /* Export */, symbol: symbol2, exportInfo: exportInfo2 };
|
|
162121
162348
|
}
|
|
162122
162349
|
function getExportKindForDeclaration(node2) {
|
|
162123
|
-
return hasSyntacticModifier(node2,
|
|
162350
|
+
return hasSyntacticModifier(node2, 2048 /* Default */) ? 1 /* Default */ : 0 /* Named */;
|
|
162124
162351
|
}
|
|
162125
162352
|
}
|
|
162126
162353
|
function getExportEqualsLocalSymbol(importedSymbol, checker) {
|
|
@@ -162263,7 +162490,7 @@ function getContextNodeForNodeEntry(node) {
|
|
|
162263
162490
|
if (node.parent.name === node || // node is name of declaration, use parent
|
|
162264
162491
|
isConstructorDeclaration(node.parent) || isExportAssignment(node.parent) || // Property name of the import export specifier or binding pattern, use parent
|
|
162265
162492
|
(isImportOrExportSpecifier(node.parent) || isBindingElement(node.parent)) && node.parent.propertyName === node || // Is default export
|
|
162266
|
-
node.kind === 90 /* DefaultKeyword */ && hasSyntacticModifier(node.parent,
|
|
162493
|
+
node.kind === 90 /* DefaultKeyword */ && hasSyntacticModifier(node.parent, 2080 /* ExportDefault */)) {
|
|
162267
162494
|
return getContextNode(node.parent);
|
|
162268
162495
|
}
|
|
162269
162496
|
return void 0;
|
|
@@ -163224,7 +163451,7 @@ var Core;
|
|
|
163224
163451
|
return void 0;
|
|
163225
163452
|
}
|
|
163226
163453
|
if (flags & (4 /* Property */ | 8192 /* Method */)) {
|
|
163227
|
-
const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d,
|
|
163454
|
+
const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d, 2 /* Private */) || isPrivateIdentifierClassElementDeclaration(d));
|
|
163228
163455
|
if (privateDeclaration) {
|
|
163229
163456
|
return getAncestor(privateDeclaration, 263 /* ClassDeclaration */);
|
|
163230
163457
|
}
|
|
@@ -163734,7 +163961,7 @@ var Core;
|
|
|
163734
163961
|
if (!searchSpaceNode) {
|
|
163735
163962
|
return void 0;
|
|
163736
163963
|
}
|
|
163737
|
-
let staticFlag =
|
|
163964
|
+
let staticFlag = 256 /* Static */;
|
|
163738
163965
|
switch (searchSpaceNode.kind) {
|
|
163739
163966
|
case 172 /* PropertyDeclaration */:
|
|
163740
163967
|
case 171 /* PropertySignature */:
|
|
@@ -163774,7 +164001,7 @@ var Core;
|
|
|
163774
164001
|
/*includeClassComputedPropertyName*/
|
|
163775
164002
|
false
|
|
163776
164003
|
);
|
|
163777
|
-
let staticFlag =
|
|
164004
|
+
let staticFlag = 256 /* Static */;
|
|
163778
164005
|
switch (searchSpaceNode.kind) {
|
|
163779
164006
|
case 174 /* MethodDeclaration */:
|
|
163780
164007
|
case 173 /* MethodSignature */:
|
|
@@ -164016,7 +164243,7 @@ var Core;
|
|
|
164016
164243
|
if (!symbol.valueDeclaration)
|
|
164017
164244
|
return false;
|
|
164018
164245
|
const modifierFlags = getEffectiveModifierFlags(symbol.valueDeclaration);
|
|
164019
|
-
return !!(modifierFlags &
|
|
164246
|
+
return !!(modifierFlags & 256 /* Static */);
|
|
164020
164247
|
}
|
|
164021
164248
|
function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) {
|
|
164022
164249
|
const { checker } = state;
|
|
@@ -164566,7 +164793,7 @@ function isDefinitionVisible(checker, declaration) {
|
|
|
164566
164793
|
case 177 /* GetAccessor */:
|
|
164567
164794
|
case 178 /* SetAccessor */:
|
|
164568
164795
|
case 174 /* MethodDeclaration */:
|
|
164569
|
-
if (hasEffectiveModifier(declaration,
|
|
164796
|
+
if (hasEffectiveModifier(declaration, 2 /* Private */))
|
|
164570
164797
|
return false;
|
|
164571
164798
|
case 176 /* Constructor */:
|
|
164572
164799
|
case 303 /* PropertyAssignment */:
|
|
@@ -165387,6 +165614,10 @@ function getCommentHavingNodes(declaration) {
|
|
|
165387
165614
|
case 345 /* JSDocCallbackTag */:
|
|
165388
165615
|
case 353 /* JSDocTypedefTag */:
|
|
165389
165616
|
return [declaration, declaration.parent];
|
|
165617
|
+
case 330 /* JSDocSignature */:
|
|
165618
|
+
if (isJSDocOverloadTag(declaration.parent)) {
|
|
165619
|
+
return [declaration.parent.parent];
|
|
165620
|
+
}
|
|
165390
165621
|
default:
|
|
165391
165622
|
return getJSDocCommentsAndTags(declaration);
|
|
165392
165623
|
}
|
|
@@ -167642,7 +167873,7 @@ function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeCheck
|
|
|
167642
167873
|
function getNormalizedSymbolModifiers(symbol) {
|
|
167643
167874
|
if (symbol.declarations && symbol.declarations.length) {
|
|
167644
167875
|
const [declaration, ...declarations] = symbol.declarations;
|
|
167645
|
-
const excludeFlags = length(declarations) && isDeprecatedDeclaration(declaration) && some(declarations, (d) => !isDeprecatedDeclaration(d)) ?
|
|
167876
|
+
const excludeFlags = length(declarations) && isDeprecatedDeclaration(declaration) && some(declarations, (d) => !isDeprecatedDeclaration(d)) ? 65536 /* Deprecated */ : 0 /* None */;
|
|
167646
167877
|
const modifiers = getNodeModifiers(declaration, excludeFlags);
|
|
167647
167878
|
if (modifiers) {
|
|
167648
167879
|
return modifiers.split(",");
|
|
@@ -167918,7 +168149,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb
|
|
|
167918
168149
|
const resolvedNode = resolvedSymbol.declarations[0];
|
|
167919
168150
|
const declarationName = getNameOfDeclaration(resolvedNode);
|
|
167920
168151
|
if (declarationName && !hasAddedSymbolInfo) {
|
|
167921
|
-
const isExternalModuleDeclaration = isModuleWithStringLiteralName(resolvedNode) && hasSyntacticModifier(resolvedNode,
|
|
168152
|
+
const isExternalModuleDeclaration = isModuleWithStringLiteralName(resolvedNode) && hasSyntacticModifier(resolvedNode, 128 /* Ambient */);
|
|
167922
168153
|
const shouldUseAliasName = symbol.name !== "default" && !isExternalModuleDeclaration;
|
|
167923
168154
|
const resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
|
|
167924
168155
|
typeChecker,
|