typescript 5.3.0-dev.20231025 → 5.3.0-dev.20231027
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 +493 -412
- package/lib/tsserver.js +596 -515
- package/lib/typescript.d.ts +26 -25
- package/lib/typescript.js +596 -515
- package/lib/typingsInstaller.js +111 -86
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -56,7 +56,7 @@ var init_corePublic = __esm({
|
|
|
56
56
|
"src/compiler/corePublic.ts"() {
|
|
57
57
|
"use strict";
|
|
58
58
|
versionMajorMinor = "5.3";
|
|
59
|
-
version = `${versionMajorMinor}.0-dev.
|
|
59
|
+
version = `${versionMajorMinor}.0-dev.20231027`;
|
|
60
60
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
61
61
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
62
62
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3971,32 +3971,43 @@ var init_types = __esm({
|
|
|
3971
3971
|
})(NodeFlags || {});
|
|
3972
3972
|
ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => {
|
|
3973
3973
|
ModifierFlags3[ModifierFlags3["None"] = 0] = "None";
|
|
3974
|
-
ModifierFlags3[ModifierFlags3["
|
|
3975
|
-
ModifierFlags3[ModifierFlags3["
|
|
3976
|
-
ModifierFlags3[ModifierFlags3["
|
|
3977
|
-
ModifierFlags3[ModifierFlags3["
|
|
3978
|
-
ModifierFlags3[ModifierFlags3["
|
|
3979
|
-
ModifierFlags3[ModifierFlags3["
|
|
3980
|
-
ModifierFlags3[ModifierFlags3["
|
|
3981
|
-
ModifierFlags3[ModifierFlags3["
|
|
3982
|
-
ModifierFlags3[ModifierFlags3["
|
|
3983
|
-
ModifierFlags3[ModifierFlags3["
|
|
3984
|
-
ModifierFlags3[ModifierFlags3["
|
|
3985
|
-
ModifierFlags3[ModifierFlags3["
|
|
3986
|
-
ModifierFlags3[ModifierFlags3["
|
|
3987
|
-
ModifierFlags3[ModifierFlags3["
|
|
3988
|
-
ModifierFlags3[ModifierFlags3["
|
|
3989
|
-
ModifierFlags3[ModifierFlags3["
|
|
3990
|
-
ModifierFlags3[ModifierFlags3["
|
|
3991
|
-
ModifierFlags3[ModifierFlags3["
|
|
3974
|
+
ModifierFlags3[ModifierFlags3["Public"] = 1] = "Public";
|
|
3975
|
+
ModifierFlags3[ModifierFlags3["Private"] = 2] = "Private";
|
|
3976
|
+
ModifierFlags3[ModifierFlags3["Protected"] = 4] = "Protected";
|
|
3977
|
+
ModifierFlags3[ModifierFlags3["Readonly"] = 8] = "Readonly";
|
|
3978
|
+
ModifierFlags3[ModifierFlags3["Override"] = 16] = "Override";
|
|
3979
|
+
ModifierFlags3[ModifierFlags3["Export"] = 32] = "Export";
|
|
3980
|
+
ModifierFlags3[ModifierFlags3["Abstract"] = 64] = "Abstract";
|
|
3981
|
+
ModifierFlags3[ModifierFlags3["Ambient"] = 128] = "Ambient";
|
|
3982
|
+
ModifierFlags3[ModifierFlags3["Static"] = 256] = "Static";
|
|
3983
|
+
ModifierFlags3[ModifierFlags3["Accessor"] = 512] = "Accessor";
|
|
3984
|
+
ModifierFlags3[ModifierFlags3["Async"] = 1024] = "Async";
|
|
3985
|
+
ModifierFlags3[ModifierFlags3["Default"] = 2048] = "Default";
|
|
3986
|
+
ModifierFlags3[ModifierFlags3["Const"] = 4096] = "Const";
|
|
3987
|
+
ModifierFlags3[ModifierFlags3["In"] = 8192] = "In";
|
|
3988
|
+
ModifierFlags3[ModifierFlags3["Out"] = 16384] = "Out";
|
|
3989
|
+
ModifierFlags3[ModifierFlags3["Decorator"] = 32768] = "Decorator";
|
|
3990
|
+
ModifierFlags3[ModifierFlags3["Deprecated"] = 65536] = "Deprecated";
|
|
3991
|
+
ModifierFlags3[ModifierFlags3["JSDocPublic"] = 8388608] = "JSDocPublic";
|
|
3992
|
+
ModifierFlags3[ModifierFlags3["JSDocPrivate"] = 16777216] = "JSDocPrivate";
|
|
3993
|
+
ModifierFlags3[ModifierFlags3["JSDocProtected"] = 33554432] = "JSDocProtected";
|
|
3994
|
+
ModifierFlags3[ModifierFlags3["JSDocReadonly"] = 67108864] = "JSDocReadonly";
|
|
3995
|
+
ModifierFlags3[ModifierFlags3["JSDocOverride"] = 134217728] = "JSDocOverride";
|
|
3996
|
+
ModifierFlags3[ModifierFlags3["SyntacticOrJSDocModifiers"] = 31] = "SyntacticOrJSDocModifiers";
|
|
3997
|
+
ModifierFlags3[ModifierFlags3["SyntacticOnlyModifiers"] = 65504] = "SyntacticOnlyModifiers";
|
|
3998
|
+
ModifierFlags3[ModifierFlags3["SyntacticModifiers"] = 65535] = "SyntacticModifiers";
|
|
3999
|
+
ModifierFlags3[ModifierFlags3["JSDocCacheOnlyModifiers"] = 260046848] = "JSDocCacheOnlyModifiers";
|
|
4000
|
+
ModifierFlags3[ModifierFlags3["JSDocOnlyModifiers"] = 65536 /* Deprecated */] = "JSDocOnlyModifiers";
|
|
4001
|
+
ModifierFlags3[ModifierFlags3["NonCacheOnlyModifiers"] = 131071] = "NonCacheOnlyModifiers";
|
|
4002
|
+
ModifierFlags3[ModifierFlags3["HasComputedJSDocModifiers"] = 268435456] = "HasComputedJSDocModifiers";
|
|
3992
4003
|
ModifierFlags3[ModifierFlags3["HasComputedFlags"] = 536870912] = "HasComputedFlags";
|
|
3993
|
-
ModifierFlags3[ModifierFlags3["AccessibilityModifier"] =
|
|
3994
|
-
ModifierFlags3[ModifierFlags3["ParameterPropertyModifier"] =
|
|
3995
|
-
ModifierFlags3[ModifierFlags3["NonPublicAccessibilityModifier"] =
|
|
3996
|
-
ModifierFlags3[ModifierFlags3["TypeScriptModifier"] =
|
|
3997
|
-
ModifierFlags3[ModifierFlags3["ExportDefault"] =
|
|
3998
|
-
ModifierFlags3[ModifierFlags3["All"] =
|
|
3999
|
-
ModifierFlags3[ModifierFlags3["Modifier"] =
|
|
4004
|
+
ModifierFlags3[ModifierFlags3["AccessibilityModifier"] = 7] = "AccessibilityModifier";
|
|
4005
|
+
ModifierFlags3[ModifierFlags3["ParameterPropertyModifier"] = 31] = "ParameterPropertyModifier";
|
|
4006
|
+
ModifierFlags3[ModifierFlags3["NonPublicAccessibilityModifier"] = 6] = "NonPublicAccessibilityModifier";
|
|
4007
|
+
ModifierFlags3[ModifierFlags3["TypeScriptModifier"] = 28895] = "TypeScriptModifier";
|
|
4008
|
+
ModifierFlags3[ModifierFlags3["ExportDefault"] = 2080] = "ExportDefault";
|
|
4009
|
+
ModifierFlags3[ModifierFlags3["All"] = 131071] = "All";
|
|
4010
|
+
ModifierFlags3[ModifierFlags3["Modifier"] = 98303] = "Modifier";
|
|
4000
4011
|
return ModifierFlags3;
|
|
4001
4012
|
})(ModifierFlags || {});
|
|
4002
4013
|
JsxFlags = /* @__PURE__ */ ((JsxFlags2) => {
|
|
@@ -7964,7 +7975,7 @@ var init_diagnosticInformationMap_generated = __esm({
|
|
|
7964
7975
|
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."),
|
|
7965
7976
|
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."),
|
|
7966
7977
|
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."),
|
|
7967
|
-
|
|
7978
|
+
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."),
|
|
7968
7979
|
_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?"),
|
|
7969
7980
|
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."),
|
|
7970
7981
|
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."),
|
|
@@ -7985,6 +7996,8 @@ var init_diagnosticInformationMap_generated = __esm({
|
|
|
7985
7996
|
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."),
|
|
7986
7997
|
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."),
|
|
7987
7998
|
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."),
|
|
7999
|
+
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."),
|
|
8000
|
+
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."),
|
|
7988
8001
|
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}'."),
|
|
7989
8002
|
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}'."),
|
|
7990
8003
|
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}'."),
|
|
@@ -11497,7 +11510,7 @@ function getTypeParameterOwner(d) {
|
|
|
11497
11510
|
}
|
|
11498
11511
|
}
|
|
11499
11512
|
function isParameterPropertyDeclaration(node, parent2) {
|
|
11500
|
-
return isParameter(node) && hasSyntacticModifier(node,
|
|
11513
|
+
return isParameter(node) && hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) && parent2.kind === 176 /* Constructor */;
|
|
11501
11514
|
}
|
|
11502
11515
|
function isEmptyBindingPattern(node) {
|
|
11503
11516
|
if (isBindingPattern(node)) {
|
|
@@ -11786,7 +11799,7 @@ function getDecorators(node) {
|
|
|
11786
11799
|
}
|
|
11787
11800
|
}
|
|
11788
11801
|
function getModifiers(node) {
|
|
11789
|
-
if (hasSyntacticModifier(node,
|
|
11802
|
+
if (hasSyntacticModifier(node, 98303 /* Modifier */)) {
|
|
11790
11803
|
return filter(node.modifiers, isModifier);
|
|
11791
11804
|
}
|
|
11792
11805
|
}
|
|
@@ -12220,7 +12233,7 @@ function isModifierKind(token) {
|
|
|
12220
12233
|
return false;
|
|
12221
12234
|
}
|
|
12222
12235
|
function isParameterPropertyModifier(kind) {
|
|
12223
|
-
return !!(modifierToFlag(kind) &
|
|
12236
|
+
return !!(modifierToFlag(kind) & 31 /* ParameterPropertyModifier */);
|
|
12224
12237
|
}
|
|
12225
12238
|
function isClassMemberModifier(idToken) {
|
|
12226
12239
|
return isParameterPropertyModifier(idToken) || idToken === 126 /* StaticKeyword */ || idToken === 164 /* OverrideKeyword */ || idToken === 129 /* AccessorKeyword */;
|
|
@@ -12584,10 +12597,10 @@ function hasScopeMarker(statements) {
|
|
|
12584
12597
|
return some(statements, isScopeMarker);
|
|
12585
12598
|
}
|
|
12586
12599
|
function needsScopeMarker(result) {
|
|
12587
|
-
return !isAnyImportOrReExport(result) && !isExportAssignment(result) && !hasSyntacticModifier(result,
|
|
12600
|
+
return !isAnyImportOrReExport(result) && !isExportAssignment(result) && !hasSyntacticModifier(result, 32 /* Export */) && !isAmbientModule(result);
|
|
12588
12601
|
}
|
|
12589
12602
|
function isExternalModuleIndicator(result) {
|
|
12590
|
-
return isAnyImportOrReExport(result) || isExportAssignment(result) || hasSyntacticModifier(result,
|
|
12603
|
+
return isAnyImportOrReExport(result) || isExportAssignment(result) || hasSyntacticModifier(result, 32 /* Export */);
|
|
12591
12604
|
}
|
|
12592
12605
|
function isForInOrOfStatement(node) {
|
|
12593
12606
|
return node.kind === 249 /* ForInStatement */ || node.kind === 250 /* ForOfStatement */;
|
|
@@ -13463,7 +13476,7 @@ function isEffectiveStrictModeSourceFile(node, compilerOptions) {
|
|
|
13463
13476
|
return false;
|
|
13464
13477
|
}
|
|
13465
13478
|
function isAmbientPropertyDeclaration(node) {
|
|
13466
|
-
return !!(node.flags & 33554432 /* Ambient */) || hasSyntacticModifier(node,
|
|
13479
|
+
return !!(node.flags & 33554432 /* Ambient */) || hasSyntacticModifier(node, 128 /* Ambient */);
|
|
13467
13480
|
}
|
|
13468
13481
|
function isBlockScope(node, parentNode) {
|
|
13469
13482
|
switch (node.kind) {
|
|
@@ -13816,10 +13829,10 @@ function isJsonSourceFile(file) {
|
|
|
13816
13829
|
return file.scriptKind === 6 /* JSON */;
|
|
13817
13830
|
}
|
|
13818
13831
|
function isEnumConst(node) {
|
|
13819
|
-
return !!(getCombinedModifierFlags(node) &
|
|
13832
|
+
return !!(getCombinedModifierFlags(node) & 4096 /* Const */);
|
|
13820
13833
|
}
|
|
13821
13834
|
function isDeclarationReadonly(declaration) {
|
|
13822
|
-
return !!(getCombinedModifierFlags(declaration) &
|
|
13835
|
+
return !!(getCombinedModifierFlags(declaration) & 8 /* Readonly */ && !isParameterPropertyDeclaration(declaration, declaration.parent));
|
|
13823
13836
|
}
|
|
13824
13837
|
function isVarAwaitUsing(node) {
|
|
13825
13838
|
return (getCombinedNodeFlags(node) & 7 /* BlockScoped */) === 6 /* AwaitUsing */;
|
|
@@ -15548,7 +15561,7 @@ function getFunctionFlags(node) {
|
|
|
15548
15561
|
flags |= 1 /* Generator */;
|
|
15549
15562
|
}
|
|
15550
15563
|
case 219 /* ArrowFunction */:
|
|
15551
|
-
if (hasSyntacticModifier(node,
|
|
15564
|
+
if (hasSyntacticModifier(node, 1024 /* Async */)) {
|
|
15552
15565
|
flags |= 2 /* Async */;
|
|
15553
15566
|
}
|
|
15554
15567
|
break;
|
|
@@ -15564,7 +15577,7 @@ function isAsyncFunction(node) {
|
|
|
15564
15577
|
case 218 /* FunctionExpression */:
|
|
15565
15578
|
case 219 /* ArrowFunction */:
|
|
15566
15579
|
case 174 /* MethodDeclaration */:
|
|
15567
|
-
return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node,
|
|
15580
|
+
return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 1024 /* Async */);
|
|
15568
15581
|
}
|
|
15569
15582
|
return false;
|
|
15570
15583
|
}
|
|
@@ -16663,25 +16676,25 @@ function isStatic(node) {
|
|
|
16663
16676
|
return isClassElement(node) && hasStaticModifier(node) || isClassStaticBlockDeclaration(node);
|
|
16664
16677
|
}
|
|
16665
16678
|
function hasStaticModifier(node) {
|
|
16666
|
-
return hasSyntacticModifier(node,
|
|
16679
|
+
return hasSyntacticModifier(node, 256 /* Static */);
|
|
16667
16680
|
}
|
|
16668
16681
|
function hasOverrideModifier(node) {
|
|
16669
|
-
return hasEffectiveModifier(node,
|
|
16682
|
+
return hasEffectiveModifier(node, 16 /* Override */);
|
|
16670
16683
|
}
|
|
16671
16684
|
function hasAbstractModifier(node) {
|
|
16672
|
-
return hasSyntacticModifier(node,
|
|
16685
|
+
return hasSyntacticModifier(node, 64 /* Abstract */);
|
|
16673
16686
|
}
|
|
16674
16687
|
function hasAmbientModifier(node) {
|
|
16675
|
-
return hasSyntacticModifier(node,
|
|
16688
|
+
return hasSyntacticModifier(node, 128 /* Ambient */);
|
|
16676
16689
|
}
|
|
16677
16690
|
function hasAccessorModifier(node) {
|
|
16678
|
-
return hasSyntacticModifier(node,
|
|
16691
|
+
return hasSyntacticModifier(node, 512 /* Accessor */);
|
|
16679
16692
|
}
|
|
16680
16693
|
function hasEffectiveReadonlyModifier(node) {
|
|
16681
|
-
return hasEffectiveModifier(node,
|
|
16694
|
+
return hasEffectiveModifier(node, 8 /* Readonly */);
|
|
16682
16695
|
}
|
|
16683
16696
|
function hasDecorators(node) {
|
|
16684
|
-
return hasSyntacticModifier(node,
|
|
16697
|
+
return hasSyntacticModifier(node, 32768 /* Decorator */);
|
|
16685
16698
|
}
|
|
16686
16699
|
function getSelectedEffectiveModifierFlags(node, flags) {
|
|
16687
16700
|
return getEffectiveModifierFlags(node) & flags;
|
|
@@ -16696,10 +16709,13 @@ function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) {
|
|
|
16696
16709
|
if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) {
|
|
16697
16710
|
node.modifierFlagsCache = getSyntacticModifierFlagsNoCache(node) | 536870912 /* HasComputedFlags */;
|
|
16698
16711
|
}
|
|
16699
|
-
if (
|
|
16700
|
-
node.modifierFlagsCache
|
|
16712
|
+
if (alwaysIncludeJSDoc || includeJSDoc && isInJSFile(node)) {
|
|
16713
|
+
if (!(node.modifierFlagsCache & 268435456 /* HasComputedJSDocModifiers */) && node.parent) {
|
|
16714
|
+
node.modifierFlagsCache |= getRawJSDocModifierFlagsNoCache(node) | 268435456 /* HasComputedJSDocModifiers */;
|
|
16715
|
+
}
|
|
16716
|
+
return selectEffectiveModifierFlags(node.modifierFlagsCache);
|
|
16701
16717
|
}
|
|
16702
|
-
return node.modifierFlagsCache
|
|
16718
|
+
return selectSyntacticModifierFlags(node.modifierFlagsCache);
|
|
16703
16719
|
}
|
|
16704
16720
|
function getEffectiveModifierFlags(node) {
|
|
16705
16721
|
return getModifierFlagsWorker(
|
|
@@ -16724,33 +16740,42 @@ function getSyntacticModifierFlags(node) {
|
|
|
16724
16740
|
false
|
|
16725
16741
|
);
|
|
16726
16742
|
}
|
|
16727
|
-
function
|
|
16743
|
+
function getRawJSDocModifierFlagsNoCache(node) {
|
|
16728
16744
|
let flags = 0 /* None */;
|
|
16729
16745
|
if (!!node.parent && !isParameter(node)) {
|
|
16730
16746
|
if (isInJSFile(node)) {
|
|
16731
16747
|
if (getJSDocPublicTagNoCache(node))
|
|
16732
|
-
flags |=
|
|
16748
|
+
flags |= 8388608 /* JSDocPublic */;
|
|
16733
16749
|
if (getJSDocPrivateTagNoCache(node))
|
|
16734
|
-
flags |=
|
|
16750
|
+
flags |= 16777216 /* JSDocPrivate */;
|
|
16735
16751
|
if (getJSDocProtectedTagNoCache(node))
|
|
16736
|
-
flags |=
|
|
16752
|
+
flags |= 33554432 /* JSDocProtected */;
|
|
16737
16753
|
if (getJSDocReadonlyTagNoCache(node))
|
|
16738
|
-
flags |=
|
|
16754
|
+
flags |= 67108864 /* JSDocReadonly */;
|
|
16739
16755
|
if (getJSDocOverrideTagNoCache(node))
|
|
16740
|
-
flags |=
|
|
16756
|
+
flags |= 134217728 /* JSDocOverride */;
|
|
16741
16757
|
}
|
|
16742
16758
|
if (getJSDocDeprecatedTagNoCache(node))
|
|
16743
|
-
flags |=
|
|
16759
|
+
flags |= 65536 /* Deprecated */;
|
|
16744
16760
|
}
|
|
16745
16761
|
return flags;
|
|
16746
16762
|
}
|
|
16763
|
+
function selectSyntacticModifierFlags(flags) {
|
|
16764
|
+
return flags & 65535 /* SyntacticModifiers */;
|
|
16765
|
+
}
|
|
16766
|
+
function selectEffectiveModifierFlags(flags) {
|
|
16767
|
+
return flags & 131071 /* NonCacheOnlyModifiers */ | (flags & 260046848 /* JSDocCacheOnlyModifiers */) >>> 23;
|
|
16768
|
+
}
|
|
16769
|
+
function getJSDocModifierFlagsNoCache(node) {
|
|
16770
|
+
return selectEffectiveModifierFlags(getRawJSDocModifierFlagsNoCache(node));
|
|
16771
|
+
}
|
|
16747
16772
|
function getEffectiveModifierFlagsNoCache(node) {
|
|
16748
16773
|
return getSyntacticModifierFlagsNoCache(node) | getJSDocModifierFlagsNoCache(node);
|
|
16749
16774
|
}
|
|
16750
16775
|
function getSyntacticModifierFlagsNoCache(node) {
|
|
16751
16776
|
let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */;
|
|
16752
16777
|
if (node.flags & 8 /* NestedNamespace */ || node.kind === 80 /* Identifier */ && node.flags & 4096 /* IdentifierIsInJSDocNamespace */) {
|
|
16753
|
-
flags |=
|
|
16778
|
+
flags |= 32 /* Export */;
|
|
16754
16779
|
}
|
|
16755
16780
|
return flags;
|
|
16756
16781
|
}
|
|
@@ -16766,37 +16791,37 @@ function modifiersToFlags(modifiers) {
|
|
|
16766
16791
|
function modifierToFlag(token) {
|
|
16767
16792
|
switch (token) {
|
|
16768
16793
|
case 126 /* StaticKeyword */:
|
|
16769
|
-
return
|
|
16794
|
+
return 256 /* Static */;
|
|
16770
16795
|
case 125 /* PublicKeyword */:
|
|
16771
|
-
return
|
|
16796
|
+
return 1 /* Public */;
|
|
16772
16797
|
case 124 /* ProtectedKeyword */:
|
|
16773
|
-
return
|
|
16798
|
+
return 4 /* Protected */;
|
|
16774
16799
|
case 123 /* PrivateKeyword */:
|
|
16775
|
-
return
|
|
16800
|
+
return 2 /* Private */;
|
|
16776
16801
|
case 128 /* AbstractKeyword */:
|
|
16777
|
-
return
|
|
16802
|
+
return 64 /* Abstract */;
|
|
16778
16803
|
case 129 /* AccessorKeyword */:
|
|
16779
|
-
return
|
|
16804
|
+
return 512 /* Accessor */;
|
|
16780
16805
|
case 95 /* ExportKeyword */:
|
|
16781
|
-
return
|
|
16806
|
+
return 32 /* Export */;
|
|
16782
16807
|
case 138 /* DeclareKeyword */:
|
|
16783
|
-
return
|
|
16808
|
+
return 128 /* Ambient */;
|
|
16784
16809
|
case 87 /* ConstKeyword */:
|
|
16785
|
-
return
|
|
16810
|
+
return 4096 /* Const */;
|
|
16786
16811
|
case 90 /* DefaultKeyword */:
|
|
16787
|
-
return
|
|
16812
|
+
return 2048 /* Default */;
|
|
16788
16813
|
case 134 /* AsyncKeyword */:
|
|
16789
|
-
return
|
|
16814
|
+
return 1024 /* Async */;
|
|
16790
16815
|
case 148 /* ReadonlyKeyword */:
|
|
16791
|
-
return
|
|
16816
|
+
return 8 /* Readonly */;
|
|
16792
16817
|
case 164 /* OverrideKeyword */:
|
|
16793
|
-
return
|
|
16818
|
+
return 16 /* Override */;
|
|
16794
16819
|
case 103 /* InKeyword */:
|
|
16795
|
-
return
|
|
16820
|
+
return 8192 /* In */;
|
|
16796
16821
|
case 147 /* OutKeyword */:
|
|
16797
|
-
return
|
|
16822
|
+
return 16384 /* Out */;
|
|
16798
16823
|
case 170 /* Decorator */:
|
|
16799
|
-
return
|
|
16824
|
+
return 32768 /* Decorator */;
|
|
16800
16825
|
}
|
|
16801
16826
|
return 0 /* None */;
|
|
16802
16827
|
}
|
|
@@ -16936,7 +16961,7 @@ function getLocalSymbolForExportDefault(symbol) {
|
|
|
16936
16961
|
return void 0;
|
|
16937
16962
|
}
|
|
16938
16963
|
function isExportDefaultSymbol(symbol) {
|
|
16939
|
-
return symbol && length(symbol.declarations) > 0 && hasSyntacticModifier(symbol.declarations[0],
|
|
16964
|
+
return symbol && length(symbol.declarations) > 0 && hasSyntacticModifier(symbol.declarations[0], 2048 /* Default */);
|
|
16940
16965
|
}
|
|
16941
16966
|
function tryExtractTSExtension(fileName) {
|
|
16942
16967
|
return find(supportedTSExtensionsForExtractExtension, (extension) => fileExtensionIs(fileName, extension));
|
|
@@ -17216,16 +17241,16 @@ function getDeclarationModifierFlagsFromSymbol(s, isWrite = false) {
|
|
|
17216
17241
|
if (s.valueDeclaration) {
|
|
17217
17242
|
const declaration = isWrite && s.declarations && find(s.declarations, isSetAccessorDeclaration) || s.flags & 32768 /* GetAccessor */ && find(s.declarations, isGetAccessorDeclaration) || s.valueDeclaration;
|
|
17218
17243
|
const flags = getCombinedModifierFlags(declaration);
|
|
17219
|
-
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~
|
|
17244
|
+
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~7 /* AccessibilityModifier */;
|
|
17220
17245
|
}
|
|
17221
17246
|
if (getCheckFlags(s) & 6 /* Synthetic */) {
|
|
17222
17247
|
const checkFlags = s.links.checkFlags;
|
|
17223
|
-
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ?
|
|
17224
|
-
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ?
|
|
17248
|
+
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 2 /* Private */ : checkFlags & 256 /* ContainsPublic */ ? 1 /* Public */ : 4 /* Protected */;
|
|
17249
|
+
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 256 /* Static */ : 0;
|
|
17225
17250
|
return accessModifier | staticModifier;
|
|
17226
17251
|
}
|
|
17227
17252
|
if (s.flags & 4194304 /* Prototype */) {
|
|
17228
|
-
return
|
|
17253
|
+
return 1 /* Public */ | 256 /* Static */;
|
|
17229
17254
|
}
|
|
17230
17255
|
return 0;
|
|
17231
17256
|
}
|
|
@@ -17324,7 +17349,7 @@ function mutateMap(map2, newMap, options) {
|
|
|
17324
17349
|
function isAbstractConstructorSymbol(symbol) {
|
|
17325
17350
|
if (symbol.flags & 32 /* Class */) {
|
|
17326
17351
|
const declaration = getClassLikeDeclarationOfSymbol(symbol);
|
|
17327
|
-
return !!declaration && hasSyntacticModifier(declaration,
|
|
17352
|
+
return !!declaration && hasSyntacticModifier(declaration, 64 /* Abstract */);
|
|
17328
17353
|
}
|
|
17329
17354
|
return false;
|
|
17330
17355
|
}
|
|
@@ -18544,7 +18569,7 @@ function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) {
|
|
|
18544
18569
|
if (node.kind !== 167 /* ComputedPropertyName */) {
|
|
18545
18570
|
return false;
|
|
18546
18571
|
}
|
|
18547
|
-
if (hasSyntacticModifier(node.parent,
|
|
18572
|
+
if (hasSyntacticModifier(node.parent, 64 /* Abstract */)) {
|
|
18548
18573
|
return true;
|
|
18549
18574
|
}
|
|
18550
18575
|
const containerKind = node.parent.parent.kind;
|
|
@@ -21127,35 +21152,35 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21127
21152
|
}
|
|
21128
21153
|
function createModifiersFromModifierFlags(flags2) {
|
|
21129
21154
|
const result = [];
|
|
21130
|
-
if (flags2 &
|
|
21155
|
+
if (flags2 & 32 /* Export */)
|
|
21131
21156
|
result.push(createModifier(95 /* ExportKeyword */));
|
|
21132
|
-
if (flags2 &
|
|
21157
|
+
if (flags2 & 128 /* Ambient */)
|
|
21133
21158
|
result.push(createModifier(138 /* DeclareKeyword */));
|
|
21134
|
-
if (flags2 &
|
|
21159
|
+
if (flags2 & 2048 /* Default */)
|
|
21135
21160
|
result.push(createModifier(90 /* DefaultKeyword */));
|
|
21136
|
-
if (flags2 &
|
|
21161
|
+
if (flags2 & 4096 /* Const */)
|
|
21137
21162
|
result.push(createModifier(87 /* ConstKeyword */));
|
|
21138
|
-
if (flags2 &
|
|
21163
|
+
if (flags2 & 1 /* Public */)
|
|
21139
21164
|
result.push(createModifier(125 /* PublicKeyword */));
|
|
21140
|
-
if (flags2 &
|
|
21165
|
+
if (flags2 & 2 /* Private */)
|
|
21141
21166
|
result.push(createModifier(123 /* PrivateKeyword */));
|
|
21142
|
-
if (flags2 &
|
|
21167
|
+
if (flags2 & 4 /* Protected */)
|
|
21143
21168
|
result.push(createModifier(124 /* ProtectedKeyword */));
|
|
21144
|
-
if (flags2 &
|
|
21169
|
+
if (flags2 & 64 /* Abstract */)
|
|
21145
21170
|
result.push(createModifier(128 /* AbstractKeyword */));
|
|
21146
|
-
if (flags2 &
|
|
21171
|
+
if (flags2 & 256 /* Static */)
|
|
21147
21172
|
result.push(createModifier(126 /* StaticKeyword */));
|
|
21148
|
-
if (flags2 &
|
|
21173
|
+
if (flags2 & 16 /* Override */)
|
|
21149
21174
|
result.push(createModifier(164 /* OverrideKeyword */));
|
|
21150
|
-
if (flags2 &
|
|
21175
|
+
if (flags2 & 8 /* Readonly */)
|
|
21151
21176
|
result.push(createModifier(148 /* ReadonlyKeyword */));
|
|
21152
|
-
if (flags2 &
|
|
21177
|
+
if (flags2 & 512 /* Accessor */)
|
|
21153
21178
|
result.push(createModifier(129 /* AccessorKeyword */));
|
|
21154
|
-
if (flags2 &
|
|
21179
|
+
if (flags2 & 1024 /* Async */)
|
|
21155
21180
|
result.push(createModifier(134 /* AsyncKeyword */));
|
|
21156
|
-
if (flags2 &
|
|
21181
|
+
if (flags2 & 8192 /* In */)
|
|
21157
21182
|
result.push(createModifier(103 /* InKeyword */));
|
|
21158
|
-
if (flags2 &
|
|
21183
|
+
if (flags2 & 16384 /* Out */)
|
|
21159
21184
|
result.push(createModifier(147 /* OutKeyword */));
|
|
21160
21185
|
return result.length ? result : void 0;
|
|
21161
21186
|
}
|
|
@@ -21204,7 +21229,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21204
21229
|
if (isThisIdentifier(node.name)) {
|
|
21205
21230
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
21206
21231
|
} else {
|
|
21207
|
-
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) &
|
|
21232
|
+
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 */);
|
|
21208
21233
|
}
|
|
21209
21234
|
node.jsDoc = void 0;
|
|
21210
21235
|
return node;
|
|
@@ -21253,8 +21278,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21253
21278
|
node.exclamationToken = questionOrExclamationToken && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0;
|
|
21254
21279
|
node.type = type;
|
|
21255
21280
|
node.initializer = asInitializer(initializer);
|
|
21256
|
-
const isAmbient = node.flags & 33554432 /* Ambient */ || modifiersToFlags(node.modifiers) &
|
|
21257
|
-
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) &
|
|
21281
|
+
const isAmbient = node.flags & 33554432 /* Ambient */ || modifiersToFlags(node.modifiers) & 128 /* Ambient */;
|
|
21282
|
+
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 */;
|
|
21258
21283
|
node.jsDoc = void 0;
|
|
21259
21284
|
return node;
|
|
21260
21285
|
}
|
|
@@ -21293,7 +21318,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21293
21318
|
if (!node.body) {
|
|
21294
21319
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
21295
21320
|
} else {
|
|
21296
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
21321
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
21297
21322
|
const isGenerator = !!node.asteriskToken;
|
|
21298
21323
|
const isAsyncGenerator = isAsync && isGenerator;
|
|
21299
21324
|
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 */;
|
|
@@ -22036,7 +22061,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22036
22061
|
node.parameters = createNodeArray(parameters);
|
|
22037
22062
|
node.type = type;
|
|
22038
22063
|
node.body = body;
|
|
22039
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
22064
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
22040
22065
|
const isGenerator = !!node.asteriskToken;
|
|
22041
22066
|
const isAsyncGenerator = isAsync && isGenerator;
|
|
22042
22067
|
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 */;
|
|
@@ -22060,7 +22085,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22060
22085
|
node.type = type;
|
|
22061
22086
|
node.equalsGreaterThanToken = equalsGreaterThanToken ?? createToken(39 /* EqualsGreaterThanToken */);
|
|
22062
22087
|
node.body = parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body);
|
|
22063
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
22088
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
22064
22089
|
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 */;
|
|
22065
22090
|
node.typeArguments = void 0;
|
|
22066
22091
|
node.jsDoc = void 0;
|
|
@@ -22412,7 +22437,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22412
22437
|
node.modifiers = asNodeArray(modifiers);
|
|
22413
22438
|
node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
|
|
22414
22439
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList);
|
|
22415
|
-
if (modifiersToFlags(node.modifiers) &
|
|
22440
|
+
if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
22416
22441
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22417
22442
|
}
|
|
22418
22443
|
node.jsDoc = void 0;
|
|
@@ -22662,10 +22687,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22662
22687
|
node.parameters = createNodeArray(parameters);
|
|
22663
22688
|
node.type = type;
|
|
22664
22689
|
node.body = body;
|
|
22665
|
-
if (!node.body || modifiersToFlags(node.modifiers) &
|
|
22690
|
+
if (!node.body || modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
22666
22691
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22667
22692
|
} else {
|
|
22668
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
22693
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
22669
22694
|
const isGenerator = !!node.asteriskToken;
|
|
22670
22695
|
const isAsyncGenerator = isAsync && isGenerator;
|
|
22671
22696
|
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 */;
|
|
@@ -22696,7 +22721,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22696
22721
|
node.typeParameters = asNodeArray(typeParameters);
|
|
22697
22722
|
node.heritageClauses = asNodeArray(heritageClauses);
|
|
22698
22723
|
node.members = createNodeArray(members);
|
|
22699
|
-
if (modifiersToFlags(node.modifiers) &
|
|
22724
|
+
if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
22700
22725
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22701
22726
|
} else {
|
|
22702
22727
|
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 */;
|
|
@@ -22758,7 +22783,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22758
22783
|
node.flags |= flags2 & (32 /* Namespace */ | 8 /* NestedNamespace */ | 2048 /* GlobalAugmentation */);
|
|
22759
22784
|
node.name = name;
|
|
22760
22785
|
node.body = body;
|
|
22761
|
-
if (modifiersToFlags(node.modifiers) &
|
|
22786
|
+
if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
22762
22787
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22763
22788
|
} else {
|
|
22764
22789
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1 /* ContainsTypeScript */;
|
|
@@ -24189,7 +24214,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24189
24214
|
return qualifiedName;
|
|
24190
24215
|
}
|
|
24191
24216
|
function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) {
|
|
24192
|
-
if (ns && hasSyntacticModifier(node,
|
|
24217
|
+
if (ns && hasSyntacticModifier(node, 32 /* Export */)) {
|
|
24193
24218
|
return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps);
|
|
24194
24219
|
}
|
|
24195
24220
|
return getExportName(node, allowComments, allowSourceMaps);
|
|
@@ -33844,11 +33869,11 @@ var init_parser = __esm({
|
|
|
33844
33869
|
const modifierFlags = modifiersToFlags(modifiers);
|
|
33845
33870
|
parseExpected(100 /* FunctionKeyword */);
|
|
33846
33871
|
const asteriskToken = parseOptionalToken(42 /* AsteriskToken */);
|
|
33847
|
-
const name = modifierFlags &
|
|
33872
|
+
const name = modifierFlags & 2048 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier();
|
|
33848
33873
|
const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */;
|
|
33849
|
-
const isAsync = modifierFlags &
|
|
33874
|
+
const isAsync = modifierFlags & 1024 /* Async */ ? 2 /* Await */ : 0 /* None */;
|
|
33850
33875
|
const typeParameters = parseTypeParameters();
|
|
33851
|
-
if (modifierFlags &
|
|
33876
|
+
if (modifierFlags & 32 /* Export */)
|
|
33852
33877
|
setAwaitContext(
|
|
33853
33878
|
/*value*/
|
|
33854
33879
|
true
|
|
@@ -41912,7 +41937,7 @@ function getModuleInstanceStateWorker(node, visited) {
|
|
|
41912
41937
|
break;
|
|
41913
41938
|
case 272 /* ImportDeclaration */:
|
|
41914
41939
|
case 271 /* ImportEqualsDeclaration */:
|
|
41915
|
-
if (!hasSyntacticModifier(node,
|
|
41940
|
+
if (!hasSyntacticModifier(node, 32 /* Export */)) {
|
|
41916
41941
|
return 0 /* NonInstantiated */;
|
|
41917
41942
|
}
|
|
41918
41943
|
break;
|
|
@@ -42189,7 +42214,7 @@ function createBinder() {
|
|
|
42189
42214
|
}
|
|
42190
42215
|
function declareSymbol(symbolTable, parent3, node, includes, excludes, isReplaceableByMethod, isComputedName) {
|
|
42191
42216
|
Debug.assert(isComputedName || !hasDynamicName(node));
|
|
42192
|
-
const isDefaultExport = hasSyntacticModifier(node,
|
|
42217
|
+
const isDefaultExport = hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) && node.name.escapedText === "default";
|
|
42193
42218
|
const name = isComputedName ? "__computed" /* Computed */ : isDefaultExport && parent3 ? "default" /* Default */ : getDeclarationName(node);
|
|
42194
42219
|
let symbol;
|
|
42195
42220
|
if (name === void 0) {
|
|
@@ -42233,7 +42258,7 @@ function createBinder() {
|
|
|
42233
42258
|
}
|
|
42234
42259
|
}
|
|
42235
42260
|
const relatedInformation = [];
|
|
42236
|
-
if (isTypeAliasDeclaration(node) && nodeIsMissing(node.type) && hasSyntacticModifier(node,
|
|
42261
|
+
if (isTypeAliasDeclaration(node) && nodeIsMissing(node.type) && hasSyntacticModifier(node, 32 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
|
|
42237
42262
|
relatedInformation.push(createDiagnosticForNode2(node, Diagnostics.Did_you_mean_0, `export type { ${unescapeLeadingUnderscores(node.name.escapedText)} }`));
|
|
42238
42263
|
}
|
|
42239
42264
|
const declarationName = getNameOfDeclaration(node) || node;
|
|
@@ -42262,7 +42287,7 @@ function createBinder() {
|
|
|
42262
42287
|
return symbol;
|
|
42263
42288
|
}
|
|
42264
42289
|
function declareModuleMember(node, symbolFlags, symbolExcludes) {
|
|
42265
|
-
const hasExportModifier = !!(getCombinedModifierFlags(node) &
|
|
42290
|
+
const hasExportModifier = !!(getCombinedModifierFlags(node) & 32 /* Export */) || jsdocTreatAsExported(node);
|
|
42266
42291
|
if (symbolFlags & 2097152 /* Alias */) {
|
|
42267
42292
|
if (node.kind === 281 /* ExportSpecifier */ || node.kind === 271 /* ImportEqualsDeclaration */ && hasExportModifier) {
|
|
42268
42293
|
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
|
|
@@ -42281,7 +42306,7 @@ function createBinder() {
|
|
|
42281
42306
|
if (isJSDocTypeAlias(node))
|
|
42282
42307
|
Debug.assert(isInJSFile(node));
|
|
42283
42308
|
if (!isAmbientModule(node) && (hasExportModifier || container.flags & 128 /* ExportContext */)) {
|
|
42284
|
-
if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier(node,
|
|
42309
|
+
if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier(node, 2048 /* Default */) && !getDeclarationName(node)) {
|
|
42285
42310
|
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
|
|
42286
42311
|
}
|
|
42287
42312
|
const exportKind = symbolFlags & 111551 /* Value */ ? 1048576 /* ExportValue */ : 0;
|
|
@@ -42322,7 +42347,7 @@ function createBinder() {
|
|
|
42322
42347
|
return false;
|
|
42323
42348
|
if (isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent))
|
|
42324
42349
|
return true;
|
|
42325
|
-
if (isDeclaration(declName.parent) && getCombinedModifierFlags(declName.parent) &
|
|
42350
|
+
if (isDeclaration(declName.parent) && getCombinedModifierFlags(declName.parent) & 32 /* Export */)
|
|
42326
42351
|
return true;
|
|
42327
42352
|
return false;
|
|
42328
42353
|
}
|
|
@@ -42353,7 +42378,7 @@ function createBinder() {
|
|
|
42353
42378
|
const saveExceptionTarget = currentExceptionTarget;
|
|
42354
42379
|
const saveActiveLabelList = activeLabelList;
|
|
42355
42380
|
const saveHasExplicitReturn = hasExplicitReturn;
|
|
42356
|
-
const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node,
|
|
42381
|
+
const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175 /* ClassStaticBlockDeclaration */;
|
|
42357
42382
|
if (!isImmediatelyInvoked) {
|
|
42358
42383
|
currentFlow = initFlowNode({ flags: 2 /* Start */ });
|
|
42359
42384
|
if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */)) {
|
|
@@ -43400,7 +43425,7 @@ function createBinder() {
|
|
|
43400
43425
|
function bindModuleDeclaration(node) {
|
|
43401
43426
|
setExportContextFlag(node);
|
|
43402
43427
|
if (isAmbientModule(node)) {
|
|
43403
|
-
if (hasSyntacticModifier(node,
|
|
43428
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
43404
43429
|
errorOnFirstToken(node, Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible);
|
|
43405
43430
|
}
|
|
43406
43431
|
if (isModuleAugmentationExternal(node)) {
|
|
@@ -44461,7 +44486,7 @@ function createBinder() {
|
|
|
44461
44486
|
}
|
|
44462
44487
|
if (!isBindingPattern(node.name)) {
|
|
44463
44488
|
const possibleVariableDecl = node.kind === 260 /* VariableDeclaration */ ? node : node.parent.parent;
|
|
44464
|
-
if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) &
|
|
44489
|
+
if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 32 /* Export */)) {
|
|
44465
44490
|
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
|
|
44466
44491
|
} else if (isBlockOrCatchScoped(node)) {
|
|
44467
44492
|
bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */);
|
|
@@ -44613,7 +44638,7 @@ function isPurelyTypeDeclaration(s) {
|
|
|
44613
44638
|
case 267 /* ModuleDeclaration */:
|
|
44614
44639
|
return getModuleInstanceState(s) !== 1 /* Instantiated */;
|
|
44615
44640
|
case 266 /* EnumDeclaration */:
|
|
44616
|
-
return hasSyntacticModifier(s,
|
|
44641
|
+
return hasSyntacticModifier(s, 4096 /* Const */);
|
|
44617
44642
|
default:
|
|
44618
44643
|
return false;
|
|
44619
44644
|
}
|
|
@@ -47684,7 +47709,7 @@ function createTypeChecker(host) {
|
|
|
47684
47709
|
if (lastLocation && lastLocation === location.name) {
|
|
47685
47710
|
return false;
|
|
47686
47711
|
}
|
|
47687
|
-
if (location.asteriskToken || hasSyntacticModifier(location,
|
|
47712
|
+
if (location.asteriskToken || hasSyntacticModifier(location, 1024 /* Async */)) {
|
|
47688
47713
|
return true;
|
|
47689
47714
|
}
|
|
47690
47715
|
return !getImmediatelyInvokedFunctionExpression(location);
|
|
@@ -47848,8 +47873,17 @@ function createTypeChecker(host) {
|
|
|
47848
47873
|
function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
|
|
47849
47874
|
if (meaning & 111551 /* Value */) {
|
|
47850
47875
|
if (isPrimitiveTypeName(name)) {
|
|
47851
|
-
|
|
47852
|
-
|
|
47876
|
+
const grandparent = errorLocation.parent.parent;
|
|
47877
|
+
if (grandparent && grandparent.parent && isHeritageClause(grandparent)) {
|
|
47878
|
+
const heritageKind = grandparent.token;
|
|
47879
|
+
const containerKind = grandparent.parent.kind;
|
|
47880
|
+
if (containerKind === 264 /* InterfaceDeclaration */ && heritageKind === 96 /* ExtendsKeyword */) {
|
|
47881
|
+
error2(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types, unescapeLeadingUnderscores(name));
|
|
47882
|
+
} else if (containerKind === 263 /* ClassDeclaration */ && heritageKind === 96 /* ExtendsKeyword */) {
|
|
47883
|
+
error2(errorLocation, Diagnostics.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values, unescapeLeadingUnderscores(name));
|
|
47884
|
+
} else if (containerKind === 263 /* ClassDeclaration */ && heritageKind === 119 /* ImplementsKeyword */) {
|
|
47885
|
+
error2(errorLocation, Diagnostics.A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types, unescapeLeadingUnderscores(name));
|
|
47886
|
+
}
|
|
47853
47887
|
} else {
|
|
47854
47888
|
error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, unescapeLeadingUnderscores(name));
|
|
47855
47889
|
}
|
|
@@ -47881,16 +47915,6 @@ function createTypeChecker(host) {
|
|
|
47881
47915
|
}
|
|
47882
47916
|
return false;
|
|
47883
47917
|
}
|
|
47884
|
-
function isExtendedByInterface(node) {
|
|
47885
|
-
const grandparent = node.parent.parent;
|
|
47886
|
-
const parentOfGrandparent = grandparent.parent;
|
|
47887
|
-
if (grandparent && parentOfGrandparent) {
|
|
47888
|
-
const isExtending = isHeritageClause(grandparent) && grandparent.token === 96 /* ExtendsKeyword */;
|
|
47889
|
-
const isInterface = isInterfaceDeclaration(parentOfGrandparent);
|
|
47890
|
-
return isExtending && isInterface;
|
|
47891
|
-
}
|
|
47892
|
-
return false;
|
|
47893
|
-
}
|
|
47894
47918
|
function maybeMappedType(node, symbol) {
|
|
47895
47919
|
const container = findAncestor(node.parent, (n) => isComputedPropertyName(n) || isPropertySignature(n) ? false : isTypeLiteralNode(n) || "quit");
|
|
47896
47920
|
if (container && container.members.length === 1) {
|
|
@@ -48069,7 +48093,7 @@ function createTypeChecker(host) {
|
|
|
48069
48093
|
return resolved;
|
|
48070
48094
|
}
|
|
48071
48095
|
function isSyntacticDefault(node) {
|
|
48072
|
-
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node,
|
|
48096
|
+
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) || isNamespaceExport(node);
|
|
48073
48097
|
}
|
|
48074
48098
|
function getUsageModeForExpression(usage) {
|
|
48075
48099
|
return isStringLiteralLike(usage) ? getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
|
|
@@ -49995,20 +50019,20 @@ function createTypeChecker(host) {
|
|
|
49995
50019
|
var _a, _b;
|
|
49996
50020
|
if (!isDeclarationVisible(declaration)) {
|
|
49997
50021
|
const anyImportSyntax = getAnyImportSyntax(declaration);
|
|
49998
|
-
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax,
|
|
50022
|
+
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax, 32 /* Export */) && // import clause without export
|
|
49999
50023
|
isDeclarationVisible(anyImportSyntax.parent)) {
|
|
50000
50024
|
return addVisibleAlias(declaration, anyImportSyntax);
|
|
50001
|
-
} else if (isVariableDeclaration(declaration) && isVariableStatement(declaration.parent.parent) && !hasSyntacticModifier(declaration.parent.parent,
|
|
50025
|
+
} else if (isVariableDeclaration(declaration) && isVariableStatement(declaration.parent.parent) && !hasSyntacticModifier(declaration.parent.parent, 32 /* Export */) && // unexported variable statement
|
|
50002
50026
|
isDeclarationVisible(declaration.parent.parent.parent)) {
|
|
50003
50027
|
return addVisibleAlias(declaration, declaration.parent.parent);
|
|
50004
|
-
} else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier(declaration,
|
|
50028
|
+
} else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier(declaration, 32 /* Export */) && isDeclarationVisible(declaration.parent)) {
|
|
50005
50029
|
return addVisibleAlias(declaration, declaration);
|
|
50006
50030
|
} else if (isBindingElement(declaration)) {
|
|
50007
|
-
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,
|
|
50031
|
+
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)) {
|
|
50008
50032
|
return addVisibleAlias(declaration, declaration.parent.parent.parent.parent);
|
|
50009
50033
|
} else if (symbol.flags & 2 /* BlockScopedVariable */) {
|
|
50010
50034
|
const variableStatement = findAncestor(declaration, isVariableStatement);
|
|
50011
|
-
if (hasSyntacticModifier(variableStatement,
|
|
50035
|
+
if (hasSyntacticModifier(variableStatement, 32 /* Export */)) {
|
|
50012
50036
|
return true;
|
|
50013
50037
|
}
|
|
50014
50038
|
if (!isDeclarationVisible(variableStatement.parent)) {
|
|
@@ -50231,7 +50255,8 @@ function createTypeChecker(host) {
|
|
|
50231
50255
|
visitedTypes: void 0,
|
|
50232
50256
|
symbolDepth: void 0,
|
|
50233
50257
|
inferTypeParameters: void 0,
|
|
50234
|
-
approximateLength: 0
|
|
50258
|
+
approximateLength: 0,
|
|
50259
|
+
trackedSymbols: void 0
|
|
50235
50260
|
};
|
|
50236
50261
|
context.tracker = new SymbolTrackerImpl(context, tracker, moduleResolverHost);
|
|
50237
50262
|
const resultingNode = cb(context);
|
|
@@ -50685,7 +50710,7 @@ function createTypeChecker(host) {
|
|
|
50685
50710
|
}
|
|
50686
50711
|
}
|
|
50687
50712
|
function visitAndTransformType(type2, transform2) {
|
|
50688
|
-
var _a2, _b2;
|
|
50713
|
+
var _a2, _b2, _c;
|
|
50689
50714
|
const typeId = type2.id;
|
|
50690
50715
|
const isConstructorObject = getObjectFlags(type2) & 16 /* Anonymous */ && type2.symbol && type2.symbol.flags & 32 /* Class */;
|
|
50691
50716
|
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;
|
|
@@ -50702,6 +50727,13 @@ function createTypeChecker(host) {
|
|
|
50702
50727
|
}
|
|
50703
50728
|
const cachedResult = (_a2 = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _a2.get(key);
|
|
50704
50729
|
if (cachedResult) {
|
|
50730
|
+
(_b2 = cachedResult.trackedSymbols) == null ? void 0 : _b2.forEach(
|
|
50731
|
+
([symbol, enclosingDeclaration, meaning]) => context.tracker.trackSymbol(
|
|
50732
|
+
symbol,
|
|
50733
|
+
enclosingDeclaration,
|
|
50734
|
+
meaning
|
|
50735
|
+
)
|
|
50736
|
+
);
|
|
50705
50737
|
if (cachedResult.truncating) {
|
|
50706
50738
|
context.truncating = true;
|
|
50707
50739
|
}
|
|
@@ -50721,7 +50753,12 @@ function createTypeChecker(host) {
|
|
|
50721
50753
|
const result = transform2(type2);
|
|
50722
50754
|
const addedLength = context.approximateLength - startLength;
|
|
50723
50755
|
if (!context.reportedDiagnostic && !context.encounteredError) {
|
|
50724
|
-
(
|
|
50756
|
+
(_c = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _c.set(key, {
|
|
50757
|
+
node: result,
|
|
50758
|
+
truncating: context.truncating,
|
|
50759
|
+
addedLength,
|
|
50760
|
+
trackedSymbols: context.trackedSymbols
|
|
50761
|
+
});
|
|
50725
50762
|
}
|
|
50726
50763
|
context.visitedTypes.delete(typeId);
|
|
50727
50764
|
if (id) {
|
|
@@ -50963,7 +51000,7 @@ function createTypeChecker(host) {
|
|
|
50963
51000
|
if (propertySymbol.flags & 4194304 /* Prototype */) {
|
|
50964
51001
|
continue;
|
|
50965
51002
|
}
|
|
50966
|
-
if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (
|
|
51003
|
+
if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (2 /* Private */ | 4 /* Protected */) && context.tracker.reportPrivateInBaseOfClassExpression) {
|
|
50967
51004
|
context.tracker.reportPrivateInBaseOfClassExpression(unescapeLeadingUnderscores(propertySymbol.escapedName));
|
|
50968
51005
|
}
|
|
50969
51006
|
}
|
|
@@ -51266,7 +51303,7 @@ function createTypeChecker(host) {
|
|
|
51266
51303
|
let modifiers = options == null ? void 0 : options.modifiers;
|
|
51267
51304
|
if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
|
|
51268
51305
|
const flags = modifiersToFlags(modifiers);
|
|
51269
|
-
modifiers = factory.createModifiersFromModifierFlags(flags |
|
|
51306
|
+
modifiers = factory.createModifiersFromModifierFlags(flags | 64 /* Abstract */);
|
|
51270
51307
|
}
|
|
51271
51308
|
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(
|
|
51272
51309
|
modifiers,
|
|
@@ -52323,7 +52360,7 @@ function createTypeChecker(host) {
|
|
|
52323
52360
|
const nsIndex = findIndex(statements, isModuleDeclaration);
|
|
52324
52361
|
let ns = nsIndex !== -1 ? statements[nsIndex] : void 0;
|
|
52325
52362
|
if (ns && exportAssignment && exportAssignment.isExportEquals && isIdentifier(exportAssignment.expression) && isIdentifier(ns.name) && idText(ns.name) === idText(exportAssignment.expression) && ns.body && isModuleBlock(ns.body)) {
|
|
52326
|
-
const excessExports = filter(statements, (s) => !!(getEffectiveModifierFlags(s) &
|
|
52363
|
+
const excessExports = filter(statements, (s) => !!(getEffectiveModifierFlags(s) & 32 /* Export */));
|
|
52327
52364
|
const name = ns.name;
|
|
52328
52365
|
let body = ns.body;
|
|
52329
52366
|
if (length(excessExports)) {
|
|
@@ -52357,9 +52394,9 @@ function createTypeChecker(host) {
|
|
|
52357
52394
|
}
|
|
52358
52395
|
if (!find(statements, (s) => s !== ns && nodeHasName(s, name))) {
|
|
52359
52396
|
results = [];
|
|
52360
|
-
const mixinExportFlag = !some(body.statements, (s) => hasSyntacticModifier(s,
|
|
52397
|
+
const mixinExportFlag = !some(body.statements, (s) => hasSyntacticModifier(s, 32 /* Export */) || isExportAssignment(s) || isExportDeclaration(s));
|
|
52361
52398
|
forEach(body.statements, (s) => {
|
|
52362
|
-
addResult(s, mixinExportFlag ?
|
|
52399
|
+
addResult(s, mixinExportFlag ? 32 /* Export */ : 0 /* None */);
|
|
52363
52400
|
});
|
|
52364
52401
|
statements = [...filter(statements, (s) => s !== ns && s !== exportAssignment), ...results];
|
|
52365
52402
|
}
|
|
@@ -52451,11 +52488,11 @@ function createTypeChecker(host) {
|
|
|
52451
52488
|
return statements;
|
|
52452
52489
|
}
|
|
52453
52490
|
function addExportModifier(node) {
|
|
52454
|
-
const flags = (getEffectiveModifierFlags(node) |
|
|
52491
|
+
const flags = (getEffectiveModifierFlags(node) | 32 /* Export */) & ~128 /* Ambient */;
|
|
52455
52492
|
return factory.replaceModifiers(node, flags);
|
|
52456
52493
|
}
|
|
52457
52494
|
function removeExportModifier(node) {
|
|
52458
|
-
const flags = getEffectiveModifierFlags(node) & ~
|
|
52495
|
+
const flags = getEffectiveModifierFlags(node) & ~32 /* Export */;
|
|
52459
52496
|
return factory.replaceModifiers(node, flags);
|
|
52460
52497
|
}
|
|
52461
52498
|
function visitSymbolTable(symbolTable2, suppressNewPrivateContext, propertyAsAlias) {
|
|
@@ -52496,6 +52533,12 @@ function createTypeChecker(host) {
|
|
|
52496
52533
|
if (context.reportedDiagnostic) {
|
|
52497
52534
|
oldcontext.reportedDiagnostic = context.reportedDiagnostic;
|
|
52498
52535
|
}
|
|
52536
|
+
if (context.trackedSymbols) {
|
|
52537
|
+
if (!oldContext.trackedSymbols)
|
|
52538
|
+
oldContext.trackedSymbols = context.trackedSymbols;
|
|
52539
|
+
else
|
|
52540
|
+
Debug.assert(context.trackedSymbols === oldContext.trackedSymbols);
|
|
52541
|
+
}
|
|
52499
52542
|
context = oldContext;
|
|
52500
52543
|
}
|
|
52501
52544
|
}
|
|
@@ -52512,7 +52555,7 @@ function createTypeChecker(host) {
|
|
|
52512
52555
|
if (needsPostExportDefault || needsExportDeclaration) {
|
|
52513
52556
|
isPrivate = true;
|
|
52514
52557
|
}
|
|
52515
|
-
const modifierFlags = (!isPrivate ?
|
|
52558
|
+
const modifierFlags = (!isPrivate ? 32 /* Export */ : 0) | (isDefault && !needsPostExportDefault ? 2048 /* Default */ : 0);
|
|
52516
52559
|
const isConstMergedWithNS = symbol.flags & 1536 /* Module */ && symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && escapedSymbolName !== "export=" /* ExportEquals */;
|
|
52517
52560
|
const isConstMergedWithNSPrintableAsSignatureMerge = isConstMergedWithNS && isTypeRepresentableAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol);
|
|
52518
52561
|
if (symbol.flags & (16 /* Function */ | 8192 /* Method */) || isConstMergedWithNSPrintableAsSignatureMerge) {
|
|
@@ -52582,7 +52625,7 @@ function createTypeChecker(host) {
|
|
|
52582
52625
|
),
|
|
52583
52626
|
textRange
|
|
52584
52627
|
);
|
|
52585
|
-
addResult(statement, name !== localName ? modifierFlags & ~
|
|
52628
|
+
addResult(statement, name !== localName ? modifierFlags & ~32 /* Export */ : modifierFlags);
|
|
52586
52629
|
if (name !== localName && !isPrivate) {
|
|
52587
52630
|
addResult(
|
|
52588
52631
|
factory.createExportDeclaration(
|
|
@@ -52687,14 +52730,14 @@ function createTypeChecker(host) {
|
|
|
52687
52730
|
if (canHaveModifiers(node)) {
|
|
52688
52731
|
let newModifierFlags = 0 /* None */;
|
|
52689
52732
|
const enclosingDeclaration2 = context.enclosingDeclaration && (isJSDocTypeAlias(context.enclosingDeclaration) ? getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration);
|
|
52690
|
-
if (additionalModifierFlags &
|
|
52691
|
-
newModifierFlags |=
|
|
52733
|
+
if (additionalModifierFlags & 32 /* Export */ && enclosingDeclaration2 && (isExportingScope(enclosingDeclaration2) || isModuleDeclaration(enclosingDeclaration2)) && canHaveExportModifier(node)) {
|
|
52734
|
+
newModifierFlags |= 32 /* Export */;
|
|
52692
52735
|
}
|
|
52693
|
-
if (addingDeclare && !(newModifierFlags &
|
|
52694
|
-
newModifierFlags |=
|
|
52736
|
+
if (addingDeclare && !(newModifierFlags & 32 /* Export */) && (!enclosingDeclaration2 || !(enclosingDeclaration2.flags & 33554432 /* Ambient */)) && (isEnumDeclaration(node) || isVariableStatement(node) || isFunctionDeclaration(node) || isClassDeclaration(node) || isModuleDeclaration(node))) {
|
|
52737
|
+
newModifierFlags |= 128 /* Ambient */;
|
|
52695
52738
|
}
|
|
52696
|
-
if (additionalModifierFlags &
|
|
52697
|
-
newModifierFlags |=
|
|
52739
|
+
if (additionalModifierFlags & 2048 /* Default */ && (isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionDeclaration(node))) {
|
|
52740
|
+
newModifierFlags |= 2048 /* Default */;
|
|
52698
52741
|
}
|
|
52699
52742
|
if (newModifierFlags) {
|
|
52700
52743
|
node = factory.replaceModifiers(node, newModifierFlags | getEffectiveModifierFlags(node));
|
|
@@ -52816,7 +52859,7 @@ function createTypeChecker(host) {
|
|
|
52816
52859
|
function serializeEnum(symbol, symbolName2, modifierFlags) {
|
|
52817
52860
|
addResult(
|
|
52818
52861
|
factory.createEnumDeclaration(
|
|
52819
|
-
factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ?
|
|
52862
|
+
factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 4096 /* Const */ : 0),
|
|
52820
52863
|
getInternalSymbolName(symbol, symbolName2),
|
|
52821
52864
|
map(filter(getPropertiesOfType(getTypeOfSymbol(symbol)), (p) => !!(p.flags & 8 /* EnumMember */)), (p) => {
|
|
52822
52865
|
const initializedValue = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? getConstantValue2(p.declarations[0]) : void 0;
|
|
@@ -52900,7 +52943,7 @@ function createTypeChecker(host) {
|
|
|
52900
52943
|
factory.createIdentifier("default" /* Default */)
|
|
52901
52944
|
)])
|
|
52902
52945
|
) : d);
|
|
52903
|
-
const exportModifierStripped = every(defaultReplaced, (d) => hasSyntacticModifier(d,
|
|
52946
|
+
const exportModifierStripped = every(defaultReplaced, (d) => hasSyntacticModifier(d, 32 /* Export */)) ? map(defaultReplaced, removeExportModifier) : defaultReplaced;
|
|
52904
52947
|
fakespace = factory.updateModuleDeclaration(
|
|
52905
52948
|
fakespace,
|
|
52906
52949
|
fakespace.modifiers,
|
|
@@ -53003,7 +53046,7 @@ function createTypeChecker(host) {
|
|
|
53003
53046
|
);
|
|
53004
53047
|
const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */));
|
|
53005
53048
|
const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(
|
|
53006
|
-
factory.createModifiersFromModifierFlags(
|
|
53049
|
+
factory.createModifiersFromModifierFlags(2 /* Private */),
|
|
53007
53050
|
[],
|
|
53008
53051
|
/*body*/
|
|
53009
53052
|
void 0
|
|
@@ -53356,7 +53399,7 @@ function createTypeChecker(host) {
|
|
|
53356
53399
|
const varName = getUnusedName(name, symbol);
|
|
53357
53400
|
const typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol)));
|
|
53358
53401
|
if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) {
|
|
53359
|
-
serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ :
|
|
53402
|
+
serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 32 /* Export */);
|
|
53360
53403
|
} else {
|
|
53361
53404
|
const flags = ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 267 /* ModuleDeclaration */ && (!(symbol.flags & 98304 /* Accessor */) || symbol.flags & 65536 /* SetAccessor */) ? 1 /* Let */ : 2 /* Const */;
|
|
53362
53405
|
const statement = factory.createVariableStatement(
|
|
@@ -53373,7 +53416,7 @@ function createTypeChecker(host) {
|
|
|
53373
53416
|
);
|
|
53374
53417
|
addResult(
|
|
53375
53418
|
statement,
|
|
53376
|
-
target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ?
|
|
53419
|
+
target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ? 128 /* Ambient */ : name === varName ? 32 /* Export */ : 0 /* None */
|
|
53377
53420
|
);
|
|
53378
53421
|
}
|
|
53379
53422
|
if (isExportAssignmentCompatibleSymbolName) {
|
|
@@ -53409,14 +53452,14 @@ function createTypeChecker(host) {
|
|
|
53409
53452
|
return function serializePropertySymbol(p, isStatic2, baseType) {
|
|
53410
53453
|
var _a2, _b, _c, _d, _e;
|
|
53411
53454
|
const modifierFlags = getDeclarationModifierFlagsFromSymbol(p);
|
|
53412
|
-
const isPrivate = !!(modifierFlags &
|
|
53455
|
+
const isPrivate = !!(modifierFlags & 2 /* Private */);
|
|
53413
53456
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
53414
53457
|
return [];
|
|
53415
53458
|
}
|
|
53416
53459
|
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))) {
|
|
53417
53460
|
return [];
|
|
53418
53461
|
}
|
|
53419
|
-
const flag = modifierFlags & ~
|
|
53462
|
+
const flag = modifierFlags & ~1024 /* Async */ | (isStatic2 ? 256 /* Static */ : 0);
|
|
53420
53463
|
const name = getPropertyNameNodeForSymbol(p, context);
|
|
53421
53464
|
const firstPropertyLikeDecl = (_a2 = p.declarations) == null ? void 0 : _a2.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression));
|
|
53422
53465
|
if (p.flags & 98304 /* Accessor */ && useAccessors) {
|
|
@@ -53458,7 +53501,7 @@ function createTypeChecker(host) {
|
|
|
53458
53501
|
));
|
|
53459
53502
|
}
|
|
53460
53503
|
if (p.flags & 32768 /* GetAccessor */) {
|
|
53461
|
-
const isPrivate2 = modifierFlags &
|
|
53504
|
+
const isPrivate2 = modifierFlags & 2 /* Private */;
|
|
53462
53505
|
result.push(setTextRange(
|
|
53463
53506
|
factory.createGetAccessorDeclaration(
|
|
53464
53507
|
factory.createModifiersFromModifierFlags(flag),
|
|
@@ -53475,7 +53518,7 @@ function createTypeChecker(host) {
|
|
|
53475
53518
|
} else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) {
|
|
53476
53519
|
return setTextRange(
|
|
53477
53520
|
createProperty2(
|
|
53478
|
-
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ?
|
|
53521
|
+
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag),
|
|
53479
53522
|
name,
|
|
53480
53523
|
p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
53481
53524
|
isPrivate ? void 0 : serializeTypeForDeclaration(context, getWriteTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled),
|
|
@@ -53490,10 +53533,10 @@ function createTypeChecker(host) {
|
|
|
53490
53533
|
if (p.flags & (8192 /* Method */ | 16 /* Function */)) {
|
|
53491
53534
|
const type = getTypeOfSymbol(p);
|
|
53492
53535
|
const signatures = getSignaturesOfType(type, 0 /* Call */);
|
|
53493
|
-
if (flag &
|
|
53536
|
+
if (flag & 2 /* Private */) {
|
|
53494
53537
|
return setTextRange(
|
|
53495
53538
|
createProperty2(
|
|
53496
|
-
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ?
|
|
53539
|
+
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag),
|
|
53497
53540
|
name,
|
|
53498
53541
|
p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
53499
53542
|
/*type*/
|
|
@@ -53569,7 +53612,7 @@ function createTypeChecker(host) {
|
|
|
53569
53612
|
let privateProtected = 0;
|
|
53570
53613
|
for (const s of signatures) {
|
|
53571
53614
|
if (s.declaration) {
|
|
53572
|
-
privateProtected |= getSelectedEffectiveModifierFlags(s.declaration,
|
|
53615
|
+
privateProtected |= getSelectedEffectiveModifierFlags(s.declaration, 2 /* Private */ | 4 /* Protected */);
|
|
53573
53616
|
}
|
|
53574
53617
|
}
|
|
53575
53618
|
if (privateProtected) {
|
|
@@ -53762,10 +53805,10 @@ function createTypeChecker(host) {
|
|
|
53762
53805
|
return result || types;
|
|
53763
53806
|
}
|
|
53764
53807
|
function visibilityToString(flags) {
|
|
53765
|
-
if (flags ===
|
|
53808
|
+
if (flags === 2 /* Private */) {
|
|
53766
53809
|
return "private";
|
|
53767
53810
|
}
|
|
53768
|
-
if (flags ===
|
|
53811
|
+
if (flags === 4 /* Protected */) {
|
|
53769
53812
|
return "protected";
|
|
53770
53813
|
}
|
|
53771
53814
|
return "public";
|
|
@@ -53883,7 +53926,7 @@ function createTypeChecker(host) {
|
|
|
53883
53926
|
return true;
|
|
53884
53927
|
}
|
|
53885
53928
|
const parent2 = getDeclarationContainer(node);
|
|
53886
|
-
if (!(getCombinedModifierFlagsCached(node) &
|
|
53929
|
+
if (!(getCombinedModifierFlagsCached(node) & 32 /* Export */) && !(node.kind !== 271 /* ImportEqualsDeclaration */ && parent2.kind !== 312 /* SourceFile */ && parent2.flags & 33554432 /* Ambient */)) {
|
|
53887
53930
|
return isGlobalSourceFile(parent2);
|
|
53888
53931
|
}
|
|
53889
53932
|
return isDeclarationVisible(parent2);
|
|
@@ -53893,7 +53936,7 @@ function createTypeChecker(host) {
|
|
|
53893
53936
|
case 178 /* SetAccessor */:
|
|
53894
53937
|
case 174 /* MethodDeclaration */:
|
|
53895
53938
|
case 173 /* MethodSignature */:
|
|
53896
|
-
if (hasEffectiveModifier(node,
|
|
53939
|
+
if (hasEffectiveModifier(node, 2 /* Private */ | 4 /* Protected */)) {
|
|
53897
53940
|
return false;
|
|
53898
53941
|
}
|
|
53899
53942
|
case 176 /* Constructor */:
|
|
@@ -54112,7 +54155,7 @@ function createTypeChecker(host) {
|
|
|
54112
54155
|
const unspreadableToRestKeys = [];
|
|
54113
54156
|
for (const prop of getPropertiesOfType(source)) {
|
|
54114
54157
|
const literalTypeFromProperty = getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */);
|
|
54115
|
-
if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType) && !(getDeclarationModifierFlagsFromSymbol(prop) & (
|
|
54158
|
+
if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType) && !(getDeclarationModifierFlagsFromSymbol(prop) & (2 /* Private */ | 4 /* Protected */)) && isSpreadableProperty(prop)) {
|
|
54116
54159
|
spreadableProperties.push(prop);
|
|
54117
54160
|
} else {
|
|
54118
54161
|
unspreadableToRestKeys.push(literalTypeFromProperty);
|
|
@@ -54318,7 +54361,7 @@ function createTypeChecker(host) {
|
|
|
54318
54361
|
if (declaredType) {
|
|
54319
54362
|
return addOptionality(declaredType, isProperty, isOptional);
|
|
54320
54363
|
}
|
|
54321
|
-
if ((noImplicitAny || isInJSFile(declaration)) && isVariableDeclaration(declaration) && !isBindingPattern(declaration.name) && !(getCombinedModifierFlagsCached(declaration) &
|
|
54364
|
+
if ((noImplicitAny || isInJSFile(declaration)) && isVariableDeclaration(declaration) && !isBindingPattern(declaration.name) && !(getCombinedModifierFlagsCached(declaration) & 32 /* Export */) && !(declaration.flags & 33554432 /* Ambient */)) {
|
|
54322
54365
|
if (!(getCombinedNodeFlagsCached(declaration) & 6 /* Constant */) && (!declaration.initializer || isNullOrUndefined2(declaration.initializer))) {
|
|
54323
54366
|
return autoType;
|
|
54324
54367
|
}
|
|
@@ -54366,7 +54409,7 @@ function createTypeChecker(host) {
|
|
|
54366
54409
|
if (isPropertyDeclaration(declaration) && (noImplicitAny || isInJSFile(declaration))) {
|
|
54367
54410
|
if (!hasStaticModifier(declaration)) {
|
|
54368
54411
|
const constructor = findConstructorDeclaration(declaration.parent);
|
|
54369
|
-
const type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : getEffectiveModifierFlags(declaration) &
|
|
54412
|
+
const type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : getEffectiveModifierFlags(declaration) & 128 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0;
|
|
54370
54413
|
return type && addOptionality(
|
|
54371
54414
|
type,
|
|
54372
54415
|
/*isProperty*/
|
|
@@ -54375,7 +54418,7 @@ function createTypeChecker(host) {
|
|
|
54375
54418
|
);
|
|
54376
54419
|
} else {
|
|
54377
54420
|
const staticBlocks = filter(declaration.parent.members, isClassStaticBlockDeclaration);
|
|
54378
|
-
const type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) : getEffectiveModifierFlags(declaration) &
|
|
54421
|
+
const type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) : getEffectiveModifierFlags(declaration) & 128 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0;
|
|
54379
54422
|
return type && addOptionality(
|
|
54380
54423
|
type,
|
|
54381
54424
|
/*isProperty*/
|
|
@@ -54479,7 +54522,7 @@ function createTypeChecker(host) {
|
|
|
54479
54522
|
return everyType(flowType, isNullableType) ? void 0 : convertAutoToAny(flowType);
|
|
54480
54523
|
}
|
|
54481
54524
|
function getFlowTypeOfProperty(reference, prop) {
|
|
54482
|
-
const initialType = (prop == null ? void 0 : prop.valueDeclaration) && (!isAutoTypedProperty(prop) || getEffectiveModifierFlags(prop.valueDeclaration) &
|
|
54525
|
+
const initialType = (prop == null ? void 0 : prop.valueDeclaration) && (!isAutoTypedProperty(prop) || getEffectiveModifierFlags(prop.valueDeclaration) & 128 /* Ambient */) && getTypeOfPropertyInBaseClass(prop) || undefinedType;
|
|
54483
54526
|
return getFlowTypeOfReference(reference, autoType, initialType);
|
|
54484
54527
|
}
|
|
54485
54528
|
function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) {
|
|
@@ -56132,7 +56175,7 @@ function createTypeChecker(host) {
|
|
|
56132
56175
|
const baseConstructorType = getBaseConstructorTypeOfClass(classType);
|
|
56133
56176
|
const baseSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */);
|
|
56134
56177
|
const declaration = getClassLikeDeclarationOfSymbol(classType.symbol);
|
|
56135
|
-
const isAbstract = !!declaration && hasSyntacticModifier(declaration,
|
|
56178
|
+
const isAbstract = !!declaration && hasSyntacticModifier(declaration, 64 /* Abstract */);
|
|
56136
56179
|
if (baseSignatures.length === 0) {
|
|
56137
56180
|
return [createSignature(
|
|
56138
56181
|
/*declaration*/
|
|
@@ -56908,7 +56951,7 @@ function createTypeChecker(host) {
|
|
|
56908
56951
|
}
|
|
56909
56952
|
function isConstTypeVariable(type, depth = 0) {
|
|
56910
56953
|
var _a;
|
|
56911
|
-
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d,
|
|
56954
|
+
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));
|
|
56912
56955
|
}
|
|
56913
56956
|
function getConstraintOfIndexedAccess(type) {
|
|
56914
56957
|
return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0;
|
|
@@ -57234,7 +57277,7 @@ function createTypeChecker(host) {
|
|
|
57234
57277
|
} else if (!isUnion && !isReadonlySymbol(prop)) {
|
|
57235
57278
|
checkFlags &= ~8 /* Readonly */;
|
|
57236
57279
|
}
|
|
57237
|
-
checkFlags |= (!(modifiers &
|
|
57280
|
+
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);
|
|
57238
57281
|
if (!isPrototypeProperty(prop)) {
|
|
57239
57282
|
syntheticFlag = 2 /* SyntheticProperty */;
|
|
57240
57283
|
}
|
|
@@ -57686,7 +57729,7 @@ function createTypeChecker(host) {
|
|
|
57686
57729
|
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
|
|
57687
57730
|
flags |= 1 /* HasRestParameter */;
|
|
57688
57731
|
}
|
|
57689
|
-
if (isConstructorTypeNode(declaration) && hasSyntacticModifier(declaration,
|
|
57732
|
+
if (isConstructorTypeNode(declaration) && hasSyntacticModifier(declaration, 64 /* Abstract */) || isConstructorDeclaration(declaration) && hasSyntacticModifier(declaration.parent, 64 /* Abstract */)) {
|
|
57690
57733
|
flags |= 4 /* Abstract */;
|
|
57691
57734
|
}
|
|
57692
57735
|
links.resolvedSignature = createSignature(
|
|
@@ -58056,7 +58099,7 @@ function createTypeChecker(host) {
|
|
|
58056
58099
|
if (parameter.type) {
|
|
58057
58100
|
forEachType(getTypeFromTypeNode(parameter.type), (keyType) => {
|
|
58058
58101
|
if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) {
|
|
58059
|
-
indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration,
|
|
58102
|
+
indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 8 /* Readonly */), declaration));
|
|
58060
58103
|
}
|
|
58061
58104
|
});
|
|
58062
58105
|
}
|
|
@@ -59881,7 +59924,7 @@ function createTypeChecker(host) {
|
|
|
59881
59924
|
return neverType;
|
|
59882
59925
|
}
|
|
59883
59926
|
function getLiteralTypeFromProperty(prop, include, includeNonPublic) {
|
|
59884
|
-
if (includeNonPublic || !(getDeclarationModifierFlagsFromSymbol(prop) &
|
|
59927
|
+
if (includeNonPublic || !(getDeclarationModifierFlagsFromSymbol(prop) & 6 /* NonPublicAccessibilityModifier */)) {
|
|
59885
59928
|
let type = getSymbolLinks(getLateBoundSymbol(prop)).nameType;
|
|
59886
59929
|
if (!type) {
|
|
59887
59930
|
const name = getNameOfDeclaration(prop.valueDeclaration);
|
|
@@ -60315,7 +60358,7 @@ function createTypeChecker(host) {
|
|
|
60315
60358
|
}
|
|
60316
60359
|
function isPatternLiteralPlaceholderType(type) {
|
|
60317
60360
|
if (type.flags & 2097152 /* Intersection */) {
|
|
60318
|
-
return some(type.types, (t) => !!(t.flags & (2944 /* Literal */ |
|
|
60361
|
+
return !isGenericType(type) && some(type.types, (t) => !!(t.flags & (2944 /* Literal */ | 98304 /* Nullable */)) || isPatternLiteralPlaceholderType(t));
|
|
60319
60362
|
}
|
|
60320
60363
|
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
60321
60364
|
}
|
|
@@ -60826,7 +60869,7 @@ function createTypeChecker(host) {
|
|
|
60826
60869
|
function getAnonymousPartialType(type2) {
|
|
60827
60870
|
const members = createSymbolTable();
|
|
60828
60871
|
for (const prop of getPropertiesOfType(type2)) {
|
|
60829
|
-
if (getDeclarationModifierFlagsFromSymbol(prop) & (
|
|
60872
|
+
if (getDeclarationModifierFlagsFromSymbol(prop) & (2 /* Private */ | 4 /* Protected */)) {
|
|
60830
60873
|
} else if (isSpreadableProperty(prop)) {
|
|
60831
60874
|
const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
|
|
60832
60875
|
const flags = 4 /* Property */ | 16777216 /* Optional */;
|
|
@@ -60888,7 +60931,7 @@ function createTypeChecker(host) {
|
|
|
60888
60931
|
const skippedPrivateMembers = /* @__PURE__ */ new Set();
|
|
60889
60932
|
const indexInfos = left === emptyObjectType ? getIndexInfosOfType(right) : getUnionIndexInfos([left, right]);
|
|
60890
60933
|
for (const rightProp of getPropertiesOfType(right)) {
|
|
60891
|
-
if (getDeclarationModifierFlagsFromSymbol(rightProp) & (
|
|
60934
|
+
if (getDeclarationModifierFlagsFromSymbol(rightProp) & (2 /* Private */ | 4 /* Protected */)) {
|
|
60892
60935
|
skippedPrivateMembers.add(rightProp.escapedName);
|
|
60893
60936
|
} else if (isSpreadableProperty(rightProp)) {
|
|
60894
60937
|
members.set(rightProp.escapedName, getSpreadSymbol(rightProp, readonly));
|
|
@@ -64455,25 +64498,25 @@ function createTypeChecker(host) {
|
|
|
64455
64498
|
function propertyRelatedTo(source2, target2, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState, skipOptional) {
|
|
64456
64499
|
const sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp);
|
|
64457
64500
|
const targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp);
|
|
64458
|
-
if (sourcePropFlags &
|
|
64501
|
+
if (sourcePropFlags & 2 /* Private */ || targetPropFlags & 2 /* Private */) {
|
|
64459
64502
|
if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) {
|
|
64460
64503
|
if (reportErrors2) {
|
|
64461
|
-
if (sourcePropFlags &
|
|
64504
|
+
if (sourcePropFlags & 2 /* Private */ && targetPropFlags & 2 /* Private */) {
|
|
64462
64505
|
reportError(Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp));
|
|
64463
64506
|
} else {
|
|
64464
|
-
reportError(Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourcePropFlags &
|
|
64507
|
+
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));
|
|
64465
64508
|
}
|
|
64466
64509
|
}
|
|
64467
64510
|
return 0 /* False */;
|
|
64468
64511
|
}
|
|
64469
|
-
} else if (targetPropFlags &
|
|
64512
|
+
} else if (targetPropFlags & 4 /* Protected */) {
|
|
64470
64513
|
if (!isValidOverrideOf(sourceProp, targetProp)) {
|
|
64471
64514
|
if (reportErrors2) {
|
|
64472
64515
|
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));
|
|
64473
64516
|
}
|
|
64474
64517
|
return 0 /* False */;
|
|
64475
64518
|
}
|
|
64476
|
-
} else if (sourcePropFlags &
|
|
64519
|
+
} else if (sourcePropFlags & 4 /* Protected */) {
|
|
64477
64520
|
if (reportErrors2) {
|
|
64478
64521
|
reportError(Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source2), typeToString(target2));
|
|
64479
64522
|
}
|
|
@@ -65003,15 +65046,15 @@ function createTypeChecker(host) {
|
|
|
65003
65046
|
if (!sourceSignature.declaration || !targetSignature.declaration) {
|
|
65004
65047
|
return true;
|
|
65005
65048
|
}
|
|
65006
|
-
const sourceAccessibility = getSelectedEffectiveModifierFlags(sourceSignature.declaration,
|
|
65007
|
-
const targetAccessibility = getSelectedEffectiveModifierFlags(targetSignature.declaration,
|
|
65008
|
-
if (targetAccessibility ===
|
|
65049
|
+
const sourceAccessibility = getSelectedEffectiveModifierFlags(sourceSignature.declaration, 6 /* NonPublicAccessibilityModifier */);
|
|
65050
|
+
const targetAccessibility = getSelectedEffectiveModifierFlags(targetSignature.declaration, 6 /* NonPublicAccessibilityModifier */);
|
|
65051
|
+
if (targetAccessibility === 2 /* Private */) {
|
|
65009
65052
|
return true;
|
|
65010
65053
|
}
|
|
65011
|
-
if (targetAccessibility ===
|
|
65054
|
+
if (targetAccessibility === 4 /* Protected */ && sourceAccessibility !== 2 /* Private */) {
|
|
65012
65055
|
return true;
|
|
65013
65056
|
}
|
|
65014
|
-
if (targetAccessibility !==
|
|
65057
|
+
if (targetAccessibility !== 4 /* Protected */ && !sourceAccessibility) {
|
|
65015
65058
|
return true;
|
|
65016
65059
|
}
|
|
65017
65060
|
if (reportErrors2) {
|
|
@@ -65111,7 +65154,7 @@ function createTypeChecker(host) {
|
|
|
65111
65154
|
const variances = [];
|
|
65112
65155
|
for (const tp of typeParameters) {
|
|
65113
65156
|
const modifiers = getTypeParameterModifiers(tp);
|
|
65114
|
-
let variance = modifiers &
|
|
65157
|
+
let variance = modifiers & 16384 /* Out */ ? modifiers & 8192 /* In */ ? 0 /* Invariant */ : 1 /* Covariant */ : modifiers & 8192 /* In */ ? 2 /* Contravariant */ : void 0;
|
|
65115
65158
|
if (variance === void 0) {
|
|
65116
65159
|
let unmeasurable = false;
|
|
65117
65160
|
let unreliable = false;
|
|
@@ -65159,7 +65202,7 @@ function createTypeChecker(host) {
|
|
|
65159
65202
|
}
|
|
65160
65203
|
function getTypeParameterModifiers(tp) {
|
|
65161
65204
|
var _a;
|
|
65162
|
-
return reduceLeft((_a = tp.symbol) == null ? void 0 : _a.declarations, (modifiers, d) => modifiers | getEffectiveModifierFlags(d), 0 /* None */) & (
|
|
65205
|
+
return reduceLeft((_a = tp.symbol) == null ? void 0 : _a.declarations, (modifiers, d) => modifiers | getEffectiveModifierFlags(d), 0 /* None */) & (8192 /* In */ | 16384 /* Out */ | 4096 /* Const */);
|
|
65163
65206
|
}
|
|
65164
65207
|
function hasCovariantVoidArgument(typeArguments, variances) {
|
|
65165
65208
|
for (let i = 0; i < variances.length; i++) {
|
|
@@ -65244,10 +65287,10 @@ function createTypeChecker(host) {
|
|
|
65244
65287
|
});
|
|
65245
65288
|
}
|
|
65246
65289
|
function isValidOverrideOf(sourceProp, targetProp) {
|
|
65247
|
-
return !forEachProperty2(targetProp, (tp) => getDeclarationModifierFlagsFromSymbol(tp) &
|
|
65290
|
+
return !forEachProperty2(targetProp, (tp) => getDeclarationModifierFlagsFromSymbol(tp) & 4 /* Protected */ ? !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false);
|
|
65248
65291
|
}
|
|
65249
65292
|
function isClassDerivedFromDeclaringClasses(checkClass, prop, writing) {
|
|
65250
|
-
return forEachProperty2(prop, (p) => getDeclarationModifierFlagsFromSymbol(p, writing) &
|
|
65293
|
+
return forEachProperty2(prop, (p) => getDeclarationModifierFlagsFromSymbol(p, writing) & 4 /* Protected */ ? !hasBaseType(checkClass, getDeclaringClass(p)) : false) ? void 0 : checkClass;
|
|
65251
65294
|
}
|
|
65252
65295
|
function isDeeplyNestedType(type, stack, depth, maxDepth = 3) {
|
|
65253
65296
|
if (depth >= maxDepth) {
|
|
@@ -65324,8 +65367,8 @@ function createTypeChecker(host) {
|
|
|
65324
65367
|
if (sourceProp === targetProp) {
|
|
65325
65368
|
return -1 /* True */;
|
|
65326
65369
|
}
|
|
65327
|
-
const sourcePropAccessibility = getDeclarationModifierFlagsFromSymbol(sourceProp) &
|
|
65328
|
-
const targetPropAccessibility = getDeclarationModifierFlagsFromSymbol(targetProp) &
|
|
65370
|
+
const sourcePropAccessibility = getDeclarationModifierFlagsFromSymbol(sourceProp) & 6 /* NonPublicAccessibilityModifier */;
|
|
65371
|
+
const targetPropAccessibility = getDeclarationModifierFlagsFromSymbol(targetProp) & 6 /* NonPublicAccessibilityModifier */;
|
|
65329
65372
|
if (sourcePropAccessibility !== targetPropAccessibility) {
|
|
65330
65373
|
return 0 /* False */;
|
|
65331
65374
|
}
|
|
@@ -69319,7 +69362,7 @@ function createTypeChecker(host) {
|
|
|
69319
69362
|
if (languageVersion < 2 /* ES2015 */) {
|
|
69320
69363
|
if (container.kind === 219 /* ArrowFunction */) {
|
|
69321
69364
|
error2(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
|
|
69322
|
-
} else if (hasSyntacticModifier(container,
|
|
69365
|
+
} else if (hasSyntacticModifier(container, 1024 /* Async */)) {
|
|
69323
69366
|
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);
|
|
69324
69367
|
}
|
|
69325
69368
|
}
|
|
@@ -69732,7 +69775,7 @@ function createTypeChecker(host) {
|
|
|
69732
69775
|
let inAsyncFunction = false;
|
|
69733
69776
|
if (!isCallExpression2) {
|
|
69734
69777
|
while (container && container.kind === 219 /* ArrowFunction */) {
|
|
69735
|
-
if (hasSyntacticModifier(container,
|
|
69778
|
+
if (hasSyntacticModifier(container, 1024 /* Async */))
|
|
69736
69779
|
inAsyncFunction = true;
|
|
69737
69780
|
container = getSuperContainer(
|
|
69738
69781
|
container,
|
|
@@ -69741,7 +69784,7 @@ function createTypeChecker(host) {
|
|
|
69741
69784
|
);
|
|
69742
69785
|
needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */;
|
|
69743
69786
|
}
|
|
69744
|
-
if (container && hasSyntacticModifier(container,
|
|
69787
|
+
if (container && hasSyntacticModifier(container, 1024 /* Async */))
|
|
69745
69788
|
inAsyncFunction = true;
|
|
69746
69789
|
}
|
|
69747
69790
|
let nodeCheckFlag = 0;
|
|
@@ -70073,7 +70116,24 @@ function createTypeChecker(host) {
|
|
|
70073
70116
|
}
|
|
70074
70117
|
const signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl);
|
|
70075
70118
|
if (signature && !isResolvingReturnTypeOfSignature(signature)) {
|
|
70076
|
-
|
|
70119
|
+
const returnType2 = getReturnTypeOfSignature(signature);
|
|
70120
|
+
const functionFlags = getFunctionFlags(functionDecl);
|
|
70121
|
+
if (functionFlags & 1 /* Generator */) {
|
|
70122
|
+
return filterType(returnType2, (t) => {
|
|
70123
|
+
return !!(t.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */ | 58982400 /* InstantiableNonPrimitive */)) || checkGeneratorInstantiationAssignabilityToReturnType(
|
|
70124
|
+
t,
|
|
70125
|
+
functionFlags,
|
|
70126
|
+
/*errorNode*/
|
|
70127
|
+
void 0
|
|
70128
|
+
);
|
|
70129
|
+
});
|
|
70130
|
+
}
|
|
70131
|
+
if (functionFlags & 2 /* Async */) {
|
|
70132
|
+
return filterType(returnType2, (t) => {
|
|
70133
|
+
return !!(t.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */ | 58982400 /* InstantiableNonPrimitive */)) || !!getAwaitedTypeOfPromise(t);
|
|
70134
|
+
});
|
|
70135
|
+
}
|
|
70136
|
+
return returnType2;
|
|
70077
70137
|
}
|
|
70078
70138
|
const iife = getImmediatelyInvokedFunctionExpression(functionDecl);
|
|
70079
70139
|
if (iife) {
|
|
@@ -71929,20 +71989,20 @@ function createTypeChecker(host) {
|
|
|
71929
71989
|
return false;
|
|
71930
71990
|
}
|
|
71931
71991
|
}
|
|
71932
|
-
if (flags &
|
|
71992
|
+
if (flags & 64 /* Abstract */) {
|
|
71933
71993
|
if (errorNode) {
|
|
71934
71994
|
error2(errorNode, Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop)));
|
|
71935
71995
|
}
|
|
71936
71996
|
return false;
|
|
71937
71997
|
}
|
|
71938
|
-
if (!(flags &
|
|
71998
|
+
if (!(flags & 256 /* Static */) && ((_a = prop.declarations) == null ? void 0 : _a.some(isClassInstanceProperty))) {
|
|
71939
71999
|
if (errorNode) {
|
|
71940
72000
|
error2(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString(prop));
|
|
71941
72001
|
}
|
|
71942
72002
|
return false;
|
|
71943
72003
|
}
|
|
71944
72004
|
}
|
|
71945
|
-
if (flags &
|
|
72005
|
+
if (flags & 64 /* Abstract */ && symbolHasNonMethodDeclaration(prop) && (isThisProperty(location) || isThisInitializedObjectBindingExpression(location) || isObjectBindingPattern(location.parent) && isThisInitializedDeclaration(location.parent.parent))) {
|
|
71946
72006
|
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
|
|
71947
72007
|
if (declaringClassDeclaration && isNodeUsedDuringClassInitialization(location)) {
|
|
71948
72008
|
if (errorNode) {
|
|
@@ -71951,10 +72011,10 @@ function createTypeChecker(host) {
|
|
|
71951
72011
|
return false;
|
|
71952
72012
|
}
|
|
71953
72013
|
}
|
|
71954
|
-
if (!(flags &
|
|
72014
|
+
if (!(flags & 6 /* NonPublicAccessibilityModifier */)) {
|
|
71955
72015
|
return true;
|
|
71956
72016
|
}
|
|
71957
|
-
if (flags &
|
|
72017
|
+
if (flags & 2 /* Private */) {
|
|
71958
72018
|
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
|
|
71959
72019
|
if (!isNodeWithinClass(location, declaringClassDeclaration)) {
|
|
71960
72020
|
if (errorNode) {
|
|
@@ -71974,14 +72034,14 @@ function createTypeChecker(host) {
|
|
|
71974
72034
|
if (!enclosingClass) {
|
|
71975
72035
|
enclosingClass = getEnclosingClassFromThisParameter(location);
|
|
71976
72036
|
enclosingClass = enclosingClass && isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing);
|
|
71977
|
-
if (flags &
|
|
72037
|
+
if (flags & 256 /* Static */ || !enclosingClass) {
|
|
71978
72038
|
if (errorNode) {
|
|
71979
72039
|
error2(errorNode, Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || containingType));
|
|
71980
72040
|
}
|
|
71981
72041
|
return false;
|
|
71982
72042
|
}
|
|
71983
72043
|
}
|
|
71984
|
-
if (flags &
|
|
72044
|
+
if (flags & 256 /* Static */) {
|
|
71985
72045
|
return true;
|
|
71986
72046
|
}
|
|
71987
72047
|
if (containingType.flags & 262144 /* TypeParameter */) {
|
|
@@ -72401,7 +72461,7 @@ function createTypeChecker(host) {
|
|
|
72401
72461
|
}
|
|
72402
72462
|
let diagnosticMessage;
|
|
72403
72463
|
const declarationName = idText(right);
|
|
72404
|
-
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) &
|
|
72464
|
+
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 256 /* Static */) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) {
|
|
72405
72465
|
diagnosticMessage = error2(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
|
|
72406
72466
|
} else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
|
|
72407
72467
|
diagnosticMessage = error2(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
@@ -72655,7 +72715,7 @@ function createTypeChecker(host) {
|
|
|
72655
72715
|
if (!valueDeclaration) {
|
|
72656
72716
|
return;
|
|
72657
72717
|
}
|
|
72658
|
-
const hasPrivateModifier = hasEffectiveModifier(valueDeclaration,
|
|
72718
|
+
const hasPrivateModifier = hasEffectiveModifier(valueDeclaration, 2 /* Private */);
|
|
72659
72719
|
const hasPrivateIdentifier = prop.valueDeclaration && isNamedDeclaration(prop.valueDeclaration) && isPrivateIdentifier(prop.valueDeclaration.name);
|
|
72660
72720
|
if (!hasPrivateModifier && !hasPrivateIdentifier) {
|
|
72661
72721
|
return;
|
|
@@ -74100,7 +74160,7 @@ function createTypeChecker(host) {
|
|
|
74100
74160
|
return resolveErrorCall(node);
|
|
74101
74161
|
}
|
|
74102
74162
|
const valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol);
|
|
74103
|
-
if (valueDecl && hasSyntacticModifier(valueDecl,
|
|
74163
|
+
if (valueDecl && hasSyntacticModifier(valueDecl, 64 /* Abstract */)) {
|
|
74104
74164
|
error2(node, Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
|
|
74105
74165
|
return resolveErrorCall(node);
|
|
74106
74166
|
}
|
|
@@ -74163,7 +74223,7 @@ function createTypeChecker(host) {
|
|
|
74163
74223
|
return true;
|
|
74164
74224
|
}
|
|
74165
74225
|
const declaration = signature.declaration;
|
|
74166
|
-
const modifiers = getSelectedEffectiveModifierFlags(declaration,
|
|
74226
|
+
const modifiers = getSelectedEffectiveModifierFlags(declaration, 6 /* NonPublicAccessibilityModifier */);
|
|
74167
74227
|
if (!modifiers || declaration.kind !== 176 /* Constructor */) {
|
|
74168
74228
|
return true;
|
|
74169
74229
|
}
|
|
@@ -74171,16 +74231,16 @@ function createTypeChecker(host) {
|
|
|
74171
74231
|
const declaringClass = getDeclaredTypeOfSymbol(declaration.parent.symbol);
|
|
74172
74232
|
if (!isNodeWithinClass(node, declaringClassDeclaration)) {
|
|
74173
74233
|
const containingClass = getContainingClass(node);
|
|
74174
|
-
if (containingClass && modifiers &
|
|
74234
|
+
if (containingClass && modifiers & 4 /* Protected */) {
|
|
74175
74235
|
const containingType = getTypeOfNode(containingClass);
|
|
74176
74236
|
if (typeHasProtectedAccessibleBase(declaration.parent.symbol, containingType)) {
|
|
74177
74237
|
return true;
|
|
74178
74238
|
}
|
|
74179
74239
|
}
|
|
74180
|
-
if (modifiers &
|
|
74240
|
+
if (modifiers & 2 /* Private */) {
|
|
74181
74241
|
error2(node, Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration, typeToString(declaringClass));
|
|
74182
74242
|
}
|
|
74183
|
-
if (modifiers &
|
|
74243
|
+
if (modifiers & 4 /* Protected */) {
|
|
74184
74244
|
error2(node, Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration, typeToString(declaringClass));
|
|
74185
74245
|
}
|
|
74186
74246
|
return false;
|
|
@@ -76157,7 +76217,7 @@ function createTypeChecker(host) {
|
|
|
76157
76217
|
return !setProp;
|
|
76158
76218
|
}
|
|
76159
76219
|
function isReadonlySymbol(symbol) {
|
|
76160
|
-
return !!(getCheckFlags(symbol) & 8 /* Readonly */ || symbol.flags & 4 /* Property */ && getDeclarationModifierFlagsFromSymbol(symbol) &
|
|
76220
|
+
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));
|
|
76161
76221
|
}
|
|
76162
76222
|
function isAssignmentToReadonlyEntity(expr, symbol, assignmentKind) {
|
|
76163
76223
|
var _a, _b;
|
|
@@ -77274,7 +77334,15 @@ function createTypeChecker(host) {
|
|
|
77274
77334
|
checkExternalEmitHelpers(node, 256 /* Values */);
|
|
77275
77335
|
}
|
|
77276
77336
|
}
|
|
77277
|
-
|
|
77337
|
+
let returnType = getReturnTypeFromAnnotation(func);
|
|
77338
|
+
if (returnType && returnType.flags & 1048576 /* Union */) {
|
|
77339
|
+
returnType = filterType(returnType, (t) => checkGeneratorInstantiationAssignabilityToReturnType(
|
|
77340
|
+
t,
|
|
77341
|
+
functionFlags,
|
|
77342
|
+
/*errorNode*/
|
|
77343
|
+
void 0
|
|
77344
|
+
));
|
|
77345
|
+
}
|
|
77278
77346
|
const iterationTypes = returnType && getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsync);
|
|
77279
77347
|
const signatureYieldType = iterationTypes && iterationTypes.yieldType || anyType;
|
|
77280
77348
|
const signatureNextType = iterationTypes && iterationTypes.nextType || anyType;
|
|
@@ -77895,15 +77963,15 @@ function createTypeChecker(host) {
|
|
|
77895
77963
|
var _a, _b;
|
|
77896
77964
|
if (isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent)) {
|
|
77897
77965
|
const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node));
|
|
77898
|
-
const modifiers = getTypeParameterModifiers(typeParameter) & (
|
|
77966
|
+
const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
|
|
77899
77967
|
if (modifiers) {
|
|
77900
77968
|
const symbol = getSymbolOfDeclaration(node.parent);
|
|
77901
77969
|
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
77902
77970
|
error2(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
77903
|
-
} else if (modifiers ===
|
|
77971
|
+
} else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
|
|
77904
77972
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|
|
77905
|
-
const source = createMarkerType(symbol, typeParameter, modifiers ===
|
|
77906
|
-
const target = createMarkerType(symbol, typeParameter, modifiers ===
|
|
77973
|
+
const source = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSubTypeForCheck : markerSuperTypeForCheck);
|
|
77974
|
+
const target = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSuperTypeForCheck : markerSubTypeForCheck);
|
|
77907
77975
|
const saveVarianceTypeParameter = typeParameter;
|
|
77908
77976
|
varianceTypeParameter = typeParameter;
|
|
77909
77977
|
checkTypeAssignableTo(source, target, node, Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation);
|
|
@@ -77917,7 +77985,7 @@ function createTypeChecker(host) {
|
|
|
77917
77985
|
checkGrammarModifiers(node);
|
|
77918
77986
|
checkVariableLikeDeclaration(node);
|
|
77919
77987
|
const func = getContainingFunction(node);
|
|
77920
|
-
if (hasSyntacticModifier(node,
|
|
77988
|
+
if (hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) {
|
|
77921
77989
|
if (!(func.kind === 176 /* Constructor */ && nodeIsPresent(func.body))) {
|
|
77922
77990
|
error2(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
|
|
77923
77991
|
}
|
|
@@ -78087,11 +78155,7 @@ function createTypeChecker(host) {
|
|
|
78087
78155
|
if (returnType === voidType) {
|
|
78088
78156
|
error2(returnTypeErrorLocation, Diagnostics.A_generator_cannot_have_a_void_type_annotation);
|
|
78089
78157
|
} else {
|
|
78090
|
-
|
|
78091
|
-
const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || generatorYieldType;
|
|
78092
|
-
const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || unknownType;
|
|
78093
|
-
const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags2 & 2 /* Async */));
|
|
78094
|
-
checkTypeAssignableTo(generatorInstantiation, returnType, returnTypeErrorLocation);
|
|
78158
|
+
checkGeneratorInstantiationAssignabilityToReturnType(returnType, functionFlags2, returnTypeErrorLocation);
|
|
78095
78159
|
}
|
|
78096
78160
|
} else if ((functionFlags2 & 3 /* AsyncGenerator */) === 2 /* Async */) {
|
|
78097
78161
|
checkAsyncFunctionReturnType(node, returnTypeNode, returnTypeErrorLocation);
|
|
@@ -78102,6 +78166,13 @@ function createTypeChecker(host) {
|
|
|
78102
78166
|
}
|
|
78103
78167
|
}
|
|
78104
78168
|
}
|
|
78169
|
+
function checkGeneratorInstantiationAssignabilityToReturnType(returnType, functionFlags, errorNode) {
|
|
78170
|
+
const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, (functionFlags & 2 /* Async */) !== 0) || anyType;
|
|
78171
|
+
const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags & 2 /* Async */) !== 0) || generatorYieldType;
|
|
78172
|
+
const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags & 2 /* Async */) !== 0) || unknownType;
|
|
78173
|
+
const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags & 2 /* Async */));
|
|
78174
|
+
return checkTypeAssignableTo(generatorInstantiation, returnType, errorNode);
|
|
78175
|
+
}
|
|
78105
78176
|
function checkClassForDuplicateDeclarations(node) {
|
|
78106
78177
|
const instanceNames = /* @__PURE__ */ new Map();
|
|
78107
78178
|
const staticNames = /* @__PURE__ */ new Map();
|
|
@@ -78249,7 +78320,7 @@ function createTypeChecker(host) {
|
|
|
78249
78320
|
checkGrammarComputedPropertyName(node.name);
|
|
78250
78321
|
checkVariableLikeDeclaration(node);
|
|
78251
78322
|
setNodeLinksForPrivateIdentifierScope(node);
|
|
78252
|
-
if (hasSyntacticModifier(node,
|
|
78323
|
+
if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 172 /* PropertyDeclaration */ && node.initializer) {
|
|
78253
78324
|
error2(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name));
|
|
78254
78325
|
}
|
|
78255
78326
|
}
|
|
@@ -78266,7 +78337,7 @@ function createTypeChecker(host) {
|
|
|
78266
78337
|
error2(node.name, Diagnostics.Class_constructor_may_not_be_a_generator);
|
|
78267
78338
|
}
|
|
78268
78339
|
checkFunctionOrMethodDeclaration(node);
|
|
78269
|
-
if (hasSyntacticModifier(node,
|
|
78340
|
+
if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 174 /* MethodDeclaration */ && node.body) {
|
|
78270
78341
|
error2(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name));
|
|
78271
78342
|
}
|
|
78272
78343
|
if (isPrivateIdentifier(node.name) && !getContainingClass(node)) {
|
|
@@ -78323,7 +78394,7 @@ function createTypeChecker(host) {
|
|
|
78323
78394
|
if (classExtendsNull) {
|
|
78324
78395
|
error2(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
|
|
78325
78396
|
}
|
|
78326
|
-
const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p,
|
|
78397
|
+
const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 31 /* ParameterPropertyModifier */)));
|
|
78327
78398
|
if (superCallShouldBeRootLevel) {
|
|
78328
78399
|
if (!superCallIsRootLevelInConstructor(superCall, node.body)) {
|
|
78329
78400
|
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);
|
|
@@ -78392,11 +78463,11 @@ function createTypeChecker(host) {
|
|
|
78392
78463
|
getNodeLinks(getter).flags |= 1 /* TypeChecked */;
|
|
78393
78464
|
const getterFlags = getEffectiveModifierFlags(getter);
|
|
78394
78465
|
const setterFlags = getEffectiveModifierFlags(setter);
|
|
78395
|
-
if ((getterFlags &
|
|
78466
|
+
if ((getterFlags & 64 /* Abstract */) !== (setterFlags & 64 /* Abstract */)) {
|
|
78396
78467
|
error2(getter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract);
|
|
78397
78468
|
error2(setter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract);
|
|
78398
78469
|
}
|
|
78399
|
-
if (getterFlags &
|
|
78470
|
+
if (getterFlags & 4 /* Protected */ && !(setterFlags & (4 /* Protected */ | 2 /* Private */)) || getterFlags & 2 /* Private */ && !(setterFlags & 2 /* Private */)) {
|
|
78400
78471
|
error2(getter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter);
|
|
78401
78472
|
error2(setter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter);
|
|
78402
78473
|
}
|
|
@@ -78576,7 +78647,7 @@ function createTypeChecker(host) {
|
|
|
78576
78647
|
const propertyName = getPropertyNameFromIndex(indexType, accessNode);
|
|
78577
78648
|
if (propertyName) {
|
|
78578
78649
|
const propertySymbol = forEachType(apparentObjectType, (t) => getPropertyOfType(t, propertyName));
|
|
78579
|
-
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) &
|
|
78650
|
+
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6 /* NonPublicAccessibilityModifier */) {
|
|
78580
78651
|
error2(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, unescapeLeadingUnderscores(propertyName));
|
|
78581
78652
|
return errorType;
|
|
78582
78653
|
}
|
|
@@ -78674,16 +78745,16 @@ function createTypeChecker(host) {
|
|
|
78674
78745
|
getTypeFromTypeNode(node);
|
|
78675
78746
|
}
|
|
78676
78747
|
function isPrivateWithinAmbient(node) {
|
|
78677
|
-
return (hasEffectiveModifier(node,
|
|
78748
|
+
return (hasEffectiveModifier(node, 2 /* Private */) || isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags & 33554432 /* Ambient */);
|
|
78678
78749
|
}
|
|
78679
78750
|
function getEffectiveDeclarationFlags(n, flagsToCheck) {
|
|
78680
78751
|
let flags = getCombinedModifierFlagsCached(n);
|
|
78681
78752
|
if (n.parent.kind !== 264 /* InterfaceDeclaration */ && n.parent.kind !== 263 /* ClassDeclaration */ && n.parent.kind !== 231 /* ClassExpression */ && n.flags & 33554432 /* Ambient */) {
|
|
78682
78753
|
const container = getEnclosingContainer(n);
|
|
78683
|
-
if (container && container.flags & 128 /* ExportContext */ && !(flags &
|
|
78684
|
-
flags |=
|
|
78754
|
+
if (container && container.flags & 128 /* ExportContext */ && !(flags & 128 /* Ambient */) && !(isModuleBlock(n.parent) && isModuleDeclaration(n.parent.parent) && isGlobalScopeAugmentation(n.parent.parent))) {
|
|
78755
|
+
flags |= 32 /* Export */;
|
|
78685
78756
|
}
|
|
78686
|
-
flags |=
|
|
78757
|
+
flags |= 128 /* Ambient */;
|
|
78687
78758
|
}
|
|
78688
78759
|
return flags & flagsToCheck;
|
|
78689
78760
|
}
|
|
@@ -78701,13 +78772,13 @@ function createTypeChecker(host) {
|
|
|
78701
78772
|
const canonicalFlags = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck2);
|
|
78702
78773
|
forEach(overloads, (o) => {
|
|
78703
78774
|
const deviation = getEffectiveDeclarationFlags(o, flagsToCheck2) ^ canonicalFlags;
|
|
78704
|
-
if (deviation &
|
|
78775
|
+
if (deviation & 32 /* Export */) {
|
|
78705
78776
|
error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported);
|
|
78706
|
-
} else if (deviation &
|
|
78777
|
+
} else if (deviation & 128 /* Ambient */) {
|
|
78707
78778
|
error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient);
|
|
78708
|
-
} else if (deviation & (
|
|
78779
|
+
} else if (deviation & (2 /* Private */ | 4 /* Protected */)) {
|
|
78709
78780
|
error2(getNameOfDeclaration(o) || o, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected);
|
|
78710
|
-
} else if (deviation &
|
|
78781
|
+
} else if (deviation & 64 /* Abstract */) {
|
|
78711
78782
|
error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract);
|
|
78712
78783
|
}
|
|
78713
78784
|
});
|
|
@@ -78724,7 +78795,7 @@ function createTypeChecker(host) {
|
|
|
78724
78795
|
});
|
|
78725
78796
|
}
|
|
78726
78797
|
}
|
|
78727
|
-
const flagsToCheck =
|
|
78798
|
+
const flagsToCheck = 32 /* Export */ | 128 /* Ambient */ | 2 /* Private */ | 4 /* Protected */ | 64 /* Abstract */;
|
|
78728
78799
|
let someNodeFlags = 0 /* None */;
|
|
78729
78800
|
let allNodeFlags = flagsToCheck;
|
|
78730
78801
|
let someHaveQuestionToken = false;
|
|
@@ -78772,7 +78843,7 @@ function createTypeChecker(host) {
|
|
|
78772
78843
|
if (isConstructor) {
|
|
78773
78844
|
error2(errorNode, Diagnostics.Constructor_implementation_is_missing);
|
|
78774
78845
|
} else {
|
|
78775
|
-
if (hasSyntacticModifier(node,
|
|
78846
|
+
if (hasSyntacticModifier(node, 64 /* Abstract */)) {
|
|
78776
78847
|
error2(errorNode, Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive);
|
|
78777
78848
|
} else {
|
|
78778
78849
|
error2(errorNode, Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration);
|
|
@@ -78858,7 +78929,7 @@ function createTypeChecker(host) {
|
|
|
78858
78929
|
}
|
|
78859
78930
|
});
|
|
78860
78931
|
}
|
|
78861
|
-
if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && !hasSyntacticModifier(lastSeenNonAmbientDeclaration,
|
|
78932
|
+
if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && !hasSyntacticModifier(lastSeenNonAmbientDeclaration, 64 /* Abstract */) && !lastSeenNonAmbientDeclaration.questionToken) {
|
|
78862
78933
|
reportImplementationExpectedError(lastSeenNonAmbientDeclaration);
|
|
78863
78934
|
}
|
|
78864
78935
|
if (hasOverloads) {
|
|
@@ -78901,9 +78972,9 @@ function createTypeChecker(host) {
|
|
|
78901
78972
|
let defaultExportedDeclarationSpaces = 0 /* None */;
|
|
78902
78973
|
for (const d of symbol.declarations) {
|
|
78903
78974
|
const declarationSpaces = getDeclarationSpaces(d);
|
|
78904
|
-
const effectiveDeclarationFlags = getEffectiveDeclarationFlags(d,
|
|
78905
|
-
if (effectiveDeclarationFlags &
|
|
78906
|
-
if (effectiveDeclarationFlags &
|
|
78975
|
+
const effectiveDeclarationFlags = getEffectiveDeclarationFlags(d, 32 /* Export */ | 2048 /* Default */);
|
|
78976
|
+
if (effectiveDeclarationFlags & 32 /* Export */) {
|
|
78977
|
+
if (effectiveDeclarationFlags & 2048 /* Default */) {
|
|
78907
78978
|
defaultExportedDeclarationSpaces |= declarationSpaces;
|
|
78908
78979
|
} else {
|
|
78909
78980
|
exportedDeclarationSpaces |= declarationSpaces;
|
|
@@ -79544,6 +79615,12 @@ function createTypeChecker(host) {
|
|
|
79544
79615
|
}
|
|
79545
79616
|
}
|
|
79546
79617
|
}
|
|
79618
|
+
function checkJSDocThisTag(node) {
|
|
79619
|
+
const host2 = getEffectiveJSDocHost(node);
|
|
79620
|
+
if (host2 && isArrowFunction(host2)) {
|
|
79621
|
+
error2(node.tagName, Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
|
|
79622
|
+
}
|
|
79623
|
+
}
|
|
79547
79624
|
function checkJSDocImplementsTag(node) {
|
|
79548
79625
|
const classLike = getEffectiveJSDocHost(node);
|
|
79549
79626
|
if (!classLike || !isClassDeclaration(classLike) && !isClassExpression(classLike)) {
|
|
@@ -79706,13 +79783,13 @@ function createTypeChecker(host) {
|
|
|
79706
79783
|
break;
|
|
79707
79784
|
}
|
|
79708
79785
|
const symbol = getSymbolOfDeclaration(member);
|
|
79709
|
-
if (!symbol.isReferenced && (hasEffectiveModifier(member,
|
|
79786
|
+
if (!symbol.isReferenced && (hasEffectiveModifier(member, 2 /* Private */) || isNamedDeclaration(member) && isPrivateIdentifier(member.name)) && !(member.flags & 33554432 /* Ambient */)) {
|
|
79710
79787
|
addDiagnostic(member, 0 /* Local */, createDiagnosticForNode(member.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
|
|
79711
79788
|
}
|
|
79712
79789
|
break;
|
|
79713
79790
|
case 176 /* Constructor */:
|
|
79714
79791
|
for (const parameter of member.parameters) {
|
|
79715
|
-
if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter,
|
|
79792
|
+
if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter, 2 /* Private */)) {
|
|
79716
79793
|
addDiagnostic(parameter, 0 /* Local */, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol)));
|
|
79717
79794
|
}
|
|
79718
79795
|
}
|
|
@@ -80288,7 +80365,7 @@ function createTypeChecker(host) {
|
|
|
80288
80365
|
if (hasQuestionToken(left) !== hasQuestionToken(right)) {
|
|
80289
80366
|
return false;
|
|
80290
80367
|
}
|
|
80291
|
-
const interestingFlags =
|
|
80368
|
+
const interestingFlags = 2 /* Private */ | 4 /* Protected */ | 1024 /* Async */ | 64 /* Abstract */ | 8 /* Readonly */ | 256 /* Static */;
|
|
80292
80369
|
return getSelectedEffectiveModifierFlags(left, interestingFlags) === getSelectedEffectiveModifierFlags(right, interestingFlags);
|
|
80293
80370
|
}
|
|
80294
80371
|
function checkVariableDeclaration(node) {
|
|
@@ -81616,7 +81693,7 @@ function createTypeChecker(host) {
|
|
|
81616
81693
|
if (legacyDecorators && firstDecorator && some(node.members, (p) => hasStaticModifier(p) && isPrivateIdentifierClassElementDeclaration(p))) {
|
|
81617
81694
|
grammarErrorOnNode(firstDecorator, Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator);
|
|
81618
81695
|
}
|
|
81619
|
-
if (!node.name && !hasSyntacticModifier(node,
|
|
81696
|
+
if (!node.name && !hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
81620
81697
|
grammarErrorOnFirstToken(node, Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name);
|
|
81621
81698
|
}
|
|
81622
81699
|
checkClassLikeDeclaration(node);
|
|
@@ -81682,7 +81759,7 @@ function createTypeChecker(host) {
|
|
|
81682
81759
|
error2(node.name || node, Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any);
|
|
81683
81760
|
} else {
|
|
81684
81761
|
const constructSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */);
|
|
81685
|
-
if (constructSignatures.some((signature) => signature.flags & 4 /* Abstract */) && !hasSyntacticModifier(node,
|
|
81762
|
+
if (constructSignatures.some((signature) => signature.flags & 4 /* Abstract */) && !hasSyntacticModifier(node, 64 /* Abstract */)) {
|
|
81686
81763
|
error2(node.name || node, Diagnostics.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract);
|
|
81687
81764
|
}
|
|
81688
81765
|
}
|
|
@@ -81896,7 +81973,7 @@ function createTypeChecker(host) {
|
|
|
81896
81973
|
const signatures = getSignaturesOfType(type, 1 /* Construct */);
|
|
81897
81974
|
if (signatures.length) {
|
|
81898
81975
|
const declaration = signatures[0].declaration;
|
|
81899
|
-
if (declaration && hasEffectiveModifier(declaration,
|
|
81976
|
+
if (declaration && hasEffectiveModifier(declaration, 2 /* Private */)) {
|
|
81900
81977
|
const typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol);
|
|
81901
81978
|
if (!isNodeWithinClass(node, typeClassDeclaration)) {
|
|
81902
81979
|
error2(node, Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol));
|
|
@@ -81916,7 +81993,7 @@ function createTypeChecker(host) {
|
|
|
81916
81993
|
const baseTypes = baseTypeNode && getBaseTypes(type);
|
|
81917
81994
|
const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0;
|
|
81918
81995
|
const baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
81919
|
-
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member,
|
|
81996
|
+
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16 /* Override */);
|
|
81920
81997
|
return checkMemberForOverrideModifier(
|
|
81921
81998
|
node,
|
|
81922
81999
|
staticType,
|
|
@@ -81957,7 +82034,7 @@ function createTypeChecker(host) {
|
|
|
81957
82034
|
Debug.assert(!!derived, "derived should point to something, even if it is the base class' declaration.");
|
|
81958
82035
|
if (derived === base) {
|
|
81959
82036
|
const derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol);
|
|
81960
|
-
if (baseDeclarationFlags &
|
|
82037
|
+
if (baseDeclarationFlags & 64 /* Abstract */ && (!derivedClassDecl || !hasSyntacticModifier(derivedClassDecl, 64 /* Abstract */))) {
|
|
81961
82038
|
for (const otherBaseType of getBaseTypes(type)) {
|
|
81962
82039
|
if (otherBaseType === baseType)
|
|
81963
82040
|
continue;
|
|
@@ -82000,7 +82077,7 @@ function createTypeChecker(host) {
|
|
|
82000
82077
|
}
|
|
82001
82078
|
} else {
|
|
82002
82079
|
const derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived);
|
|
82003
|
-
if (baseDeclarationFlags &
|
|
82080
|
+
if (baseDeclarationFlags & 2 /* Private */ || derivedDeclarationFlags & 2 /* Private */) {
|
|
82004
82081
|
continue;
|
|
82005
82082
|
}
|
|
82006
82083
|
let errorMessage;
|
|
@@ -82017,7 +82094,7 @@ function createTypeChecker(host) {
|
|
|
82017
82094
|
error2(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
82018
82095
|
} else if (useDefineForClassFields) {
|
|
82019
82096
|
const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer);
|
|
82020
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags &
|
|
82097
|
+
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 */)))) {
|
|
82021
82098
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
82022
82099
|
const propName = uninitialized.name;
|
|
82023
82100
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -82044,7 +82121,7 @@ function createTypeChecker(host) {
|
|
|
82044
82121
|
}
|
|
82045
82122
|
}
|
|
82046
82123
|
function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
|
|
82047
|
-
return baseDeclarationFlags &
|
|
82124
|
+
return baseDeclarationFlags & 64 /* Abstract */ && (!isPropertyDeclaration(declaration) || !declaration.initializer) || isInterfaceDeclaration(declaration.parent);
|
|
82048
82125
|
}
|
|
82049
82126
|
function getNonInheritedProperties(type, baseTypes, properties) {
|
|
82050
82127
|
if (!length(baseTypes)) {
|
|
@@ -82109,7 +82186,7 @@ function createTypeChecker(host) {
|
|
|
82109
82186
|
}
|
|
82110
82187
|
const constructor = findConstructorDeclaration(node);
|
|
82111
82188
|
for (const member of node.members) {
|
|
82112
|
-
if (getEffectiveModifierFlags(member) &
|
|
82189
|
+
if (getEffectiveModifierFlags(member) & 128 /* Ambient */) {
|
|
82113
82190
|
continue;
|
|
82114
82191
|
}
|
|
82115
82192
|
if (!isStatic(member) && isPropertyWithoutInitializer(member)) {
|
|
@@ -82696,7 +82773,7 @@ function createTypeChecker(host) {
|
|
|
82696
82773
|
name
|
|
82697
82774
|
);
|
|
82698
82775
|
}
|
|
82699
|
-
if (isType && node.kind === 271 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node,
|
|
82776
|
+
if (isType && node.kind === 271 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 32 /* Export */)) {
|
|
82700
82777
|
error2(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, isolatedModulesLikeFlagName);
|
|
82701
82778
|
}
|
|
82702
82779
|
break;
|
|
@@ -82818,7 +82895,7 @@ function createTypeChecker(host) {
|
|
|
82818
82895
|
checkGrammarModifiers(node);
|
|
82819
82896
|
if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
|
|
82820
82897
|
checkImportBinding(node);
|
|
82821
|
-
if (hasSyntacticModifier(node,
|
|
82898
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
82822
82899
|
markExportAsReferenced(node);
|
|
82823
82900
|
}
|
|
82824
82901
|
if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
|
|
@@ -83230,6 +83307,8 @@ function createTypeChecker(host) {
|
|
|
83230
83307
|
return checkJSDocAccessibilityModifiers(node);
|
|
83231
83308
|
case 357 /* JSDocSatisfiesTag */:
|
|
83232
83309
|
return checkJSDocSatisfiesTag(node);
|
|
83310
|
+
case 350 /* JSDocThisTag */:
|
|
83311
|
+
return checkJSDocThisTag(node);
|
|
83233
83312
|
case 199 /* IndexedAccessType */:
|
|
83234
83313
|
return checkIndexedAccessType(node);
|
|
83235
83314
|
case 200 /* MappedType */:
|
|
@@ -84456,7 +84535,7 @@ function createTypeChecker(host) {
|
|
|
84456
84535
|
return true;
|
|
84457
84536
|
}
|
|
84458
84537
|
const target = getSymbolLinks(symbol).aliasTarget;
|
|
84459
|
-
if (target && getEffectiveModifierFlags(node) &
|
|
84538
|
+
if (target && getEffectiveModifierFlags(node) & 32 /* Export */ && getSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
|
|
84460
84539
|
return true;
|
|
84461
84540
|
}
|
|
84462
84541
|
}
|
|
@@ -84481,10 +84560,10 @@ function createTypeChecker(host) {
|
|
|
84481
84560
|
return false;
|
|
84482
84561
|
}
|
|
84483
84562
|
function isRequiredInitializedParameter(parameter) {
|
|
84484
|
-
return !!strictNullChecks && !isOptionalParameter(parameter) && !isJSDocParameterTag(parameter) && !!parameter.initializer && !hasSyntacticModifier(parameter,
|
|
84563
|
+
return !!strictNullChecks && !isOptionalParameter(parameter) && !isJSDocParameterTag(parameter) && !!parameter.initializer && !hasSyntacticModifier(parameter, 31 /* ParameterPropertyModifier */);
|
|
84485
84564
|
}
|
|
84486
84565
|
function isOptionalUninitializedParameterProperty(parameter) {
|
|
84487
|
-
return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && hasSyntacticModifier(parameter,
|
|
84566
|
+
return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && hasSyntacticModifier(parameter, 31 /* ParameterPropertyModifier */);
|
|
84488
84567
|
}
|
|
84489
84568
|
function isExpandoFunctionDeclaration(node) {
|
|
84490
84569
|
const declaration = getParseTreeNode(node, isFunctionDeclaration);
|
|
@@ -85338,10 +85417,10 @@ function createTypeChecker(host) {
|
|
|
85338
85417
|
return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
|
|
85339
85418
|
}
|
|
85340
85419
|
}
|
|
85341
|
-
if (flags & ~(
|
|
85420
|
+
if (flags & ~(2080 /* ExportDefault */ | 32768 /* Decorator */)) {
|
|
85342
85421
|
return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here);
|
|
85343
85422
|
}
|
|
85344
|
-
if (hasLeadingDecorators && flags &
|
|
85423
|
+
if (hasLeadingDecorators && flags & 98303 /* Modifier */) {
|
|
85345
85424
|
Debug.assertIsDefined(firstDecorator);
|
|
85346
85425
|
const sourceFile = getSourceFileOfNode(modifier);
|
|
85347
85426
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
@@ -85353,10 +85432,10 @@ function createTypeChecker(host) {
|
|
|
85353
85432
|
}
|
|
85354
85433
|
return false;
|
|
85355
85434
|
}
|
|
85356
|
-
flags |=
|
|
85357
|
-
if (!(flags &
|
|
85435
|
+
flags |= 32768 /* Decorator */;
|
|
85436
|
+
if (!(flags & 98303 /* Modifier */)) {
|
|
85358
85437
|
hasLeadingDecorators = true;
|
|
85359
|
-
} else if (flags &
|
|
85438
|
+
} else if (flags & 32 /* Export */) {
|
|
85360
85439
|
sawExportBeforeDecorators = true;
|
|
85361
85440
|
}
|
|
85362
85441
|
firstDecorator ?? (firstDecorator = modifier);
|
|
@@ -85385,39 +85464,39 @@ function createTypeChecker(host) {
|
|
|
85385
85464
|
}
|
|
85386
85465
|
break;
|
|
85387
85466
|
case 164 /* OverrideKeyword */:
|
|
85388
|
-
if (flags &
|
|
85467
|
+
if (flags & 16 /* Override */) {
|
|
85389
85468
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override");
|
|
85390
|
-
} else if (flags &
|
|
85469
|
+
} else if (flags & 128 /* Ambient */) {
|
|
85391
85470
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare");
|
|
85392
|
-
} else if (flags &
|
|
85471
|
+
} else if (flags & 8 /* Readonly */) {
|
|
85393
85472
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly");
|
|
85394
|
-
} else if (flags &
|
|
85473
|
+
} else if (flags & 512 /* Accessor */) {
|
|
85395
85474
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor");
|
|
85396
|
-
} else if (flags &
|
|
85475
|
+
} else if (flags & 1024 /* Async */) {
|
|
85397
85476
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async");
|
|
85398
85477
|
}
|
|
85399
|
-
flags |=
|
|
85478
|
+
flags |= 16 /* Override */;
|
|
85400
85479
|
lastOverride = modifier;
|
|
85401
85480
|
break;
|
|
85402
85481
|
case 125 /* PublicKeyword */:
|
|
85403
85482
|
case 124 /* ProtectedKeyword */:
|
|
85404
85483
|
case 123 /* PrivateKeyword */:
|
|
85405
85484
|
const text = visibilityToString(modifierToFlag(modifier.kind));
|
|
85406
|
-
if (flags &
|
|
85485
|
+
if (flags & 7 /* AccessibilityModifier */) {
|
|
85407
85486
|
return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen);
|
|
85408
|
-
} else if (flags &
|
|
85487
|
+
} else if (flags & 16 /* Override */) {
|
|
85409
85488
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override");
|
|
85410
|
-
} else if (flags &
|
|
85489
|
+
} else if (flags & 256 /* Static */) {
|
|
85411
85490
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static");
|
|
85412
|
-
} else if (flags &
|
|
85491
|
+
} else if (flags & 512 /* Accessor */) {
|
|
85413
85492
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor");
|
|
85414
|
-
} else if (flags &
|
|
85493
|
+
} else if (flags & 8 /* Readonly */) {
|
|
85415
85494
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly");
|
|
85416
|
-
} else if (flags &
|
|
85495
|
+
} else if (flags & 1024 /* Async */) {
|
|
85417
85496
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
|
|
85418
85497
|
} else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 312 /* SourceFile */) {
|
|
85419
85498
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
|
|
85420
|
-
} else if (flags &
|
|
85499
|
+
} else if (flags & 64 /* Abstract */) {
|
|
85421
85500
|
if (modifier.kind === 123 /* PrivateKeyword */) {
|
|
85422
85501
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract");
|
|
85423
85502
|
} else {
|
|
@@ -85429,60 +85508,60 @@ function createTypeChecker(host) {
|
|
|
85429
85508
|
flags |= modifierToFlag(modifier.kind);
|
|
85430
85509
|
break;
|
|
85431
85510
|
case 126 /* StaticKeyword */:
|
|
85432
|
-
if (flags &
|
|
85511
|
+
if (flags & 256 /* Static */) {
|
|
85433
85512
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static");
|
|
85434
|
-
} else if (flags &
|
|
85513
|
+
} else if (flags & 8 /* Readonly */) {
|
|
85435
85514
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly");
|
|
85436
|
-
} else if (flags &
|
|
85515
|
+
} else if (flags & 1024 /* Async */) {
|
|
85437
85516
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
|
|
85438
|
-
} else if (flags &
|
|
85517
|
+
} else if (flags & 512 /* Accessor */) {
|
|
85439
85518
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor");
|
|
85440
85519
|
} else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 312 /* SourceFile */) {
|
|
85441
85520
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
|
|
85442
85521
|
} else if (node.kind === 169 /* Parameter */) {
|
|
85443
85522
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
|
|
85444
|
-
} else if (flags &
|
|
85523
|
+
} else if (flags & 64 /* Abstract */) {
|
|
85445
85524
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
|
|
85446
|
-
} else if (flags &
|
|
85525
|
+
} else if (flags & 16 /* Override */) {
|
|
85447
85526
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override");
|
|
85448
85527
|
}
|
|
85449
|
-
flags |=
|
|
85528
|
+
flags |= 256 /* Static */;
|
|
85450
85529
|
lastStatic = modifier;
|
|
85451
85530
|
break;
|
|
85452
85531
|
case 129 /* AccessorKeyword */:
|
|
85453
|
-
if (flags &
|
|
85532
|
+
if (flags & 512 /* Accessor */) {
|
|
85454
85533
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor");
|
|
85455
|
-
} else if (flags &
|
|
85534
|
+
} else if (flags & 8 /* Readonly */) {
|
|
85456
85535
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly");
|
|
85457
|
-
} else if (flags &
|
|
85536
|
+
} else if (flags & 128 /* Ambient */) {
|
|
85458
85537
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare");
|
|
85459
85538
|
} else if (node.kind !== 172 /* PropertyDeclaration */) {
|
|
85460
85539
|
return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration);
|
|
85461
85540
|
}
|
|
85462
|
-
flags |=
|
|
85541
|
+
flags |= 512 /* Accessor */;
|
|
85463
85542
|
break;
|
|
85464
85543
|
case 148 /* ReadonlyKeyword */:
|
|
85465
|
-
if (flags &
|
|
85544
|
+
if (flags & 8 /* Readonly */) {
|
|
85466
85545
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly");
|
|
85467
85546
|
} else if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 181 /* IndexSignature */ && node.kind !== 169 /* Parameter */) {
|
|
85468
85547
|
return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
|
|
85469
|
-
} else if (flags &
|
|
85548
|
+
} else if (flags & 512 /* Accessor */) {
|
|
85470
85549
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor");
|
|
85471
85550
|
}
|
|
85472
|
-
flags |=
|
|
85551
|
+
flags |= 8 /* Readonly */;
|
|
85473
85552
|
break;
|
|
85474
85553
|
case 95 /* ExportKeyword */:
|
|
85475
85554
|
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
|
|
85476
85555
|
node.kind !== 267 /* ModuleDeclaration */ && node.parent.kind === 312 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
|
|
85477
85556
|
return grammarErrorOnNode(modifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
|
|
85478
85557
|
}
|
|
85479
|
-
if (flags &
|
|
85558
|
+
if (flags & 32 /* Export */) {
|
|
85480
85559
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export");
|
|
85481
|
-
} else if (flags &
|
|
85560
|
+
} else if (flags & 128 /* Ambient */) {
|
|
85482
85561
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare");
|
|
85483
|
-
} else if (flags &
|
|
85562
|
+
} else if (flags & 64 /* Abstract */) {
|
|
85484
85563
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract");
|
|
85485
|
-
} else if (flags &
|
|
85564
|
+
} else if (flags & 1024 /* Async */) {
|
|
85486
85565
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
|
|
85487
85566
|
} else if (isClassLike(node.parent)) {
|
|
85488
85567
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export");
|
|
@@ -85493,7 +85572,7 @@ function createTypeChecker(host) {
|
|
|
85493
85572
|
} else if (blockScopeKind === 6 /* AwaitUsing */) {
|
|
85494
85573
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "export");
|
|
85495
85574
|
}
|
|
85496
|
-
flags |=
|
|
85575
|
+
flags |= 32 /* Export */;
|
|
85497
85576
|
break;
|
|
85498
85577
|
case 90 /* DefaultKeyword */:
|
|
85499
85578
|
const container = node.parent.kind === 312 /* SourceFile */ ? node.parent : node.parent.parent;
|
|
@@ -85503,19 +85582,19 @@ function createTypeChecker(host) {
|
|
|
85503
85582
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "default");
|
|
85504
85583
|
} else if (blockScopeKind === 6 /* AwaitUsing */) {
|
|
85505
85584
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "default");
|
|
85506
|
-
} else if (!(flags &
|
|
85585
|
+
} else if (!(flags & 32 /* Export */)) {
|
|
85507
85586
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default");
|
|
85508
85587
|
} else if (sawExportBeforeDecorators) {
|
|
85509
85588
|
return grammarErrorOnNode(firstDecorator, Diagnostics.Decorators_are_not_valid_here);
|
|
85510
85589
|
}
|
|
85511
|
-
flags |=
|
|
85590
|
+
flags |= 2048 /* Default */;
|
|
85512
85591
|
break;
|
|
85513
85592
|
case 138 /* DeclareKeyword */:
|
|
85514
|
-
if (flags &
|
|
85593
|
+
if (flags & 128 /* Ambient */) {
|
|
85515
85594
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare");
|
|
85516
|
-
} else if (flags &
|
|
85595
|
+
} else if (flags & 1024 /* Async */) {
|
|
85517
85596
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
|
|
85518
|
-
} else if (flags &
|
|
85597
|
+
} else if (flags & 16 /* Override */) {
|
|
85519
85598
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override");
|
|
85520
85599
|
} else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) {
|
|
85521
85600
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare");
|
|
@@ -85529,62 +85608,62 @@ function createTypeChecker(host) {
|
|
|
85529
85608
|
return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
|
|
85530
85609
|
} else if (isPrivateIdentifierClassElementDeclaration(node)) {
|
|
85531
85610
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
|
|
85532
|
-
} else if (flags &
|
|
85611
|
+
} else if (flags & 512 /* Accessor */) {
|
|
85533
85612
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor");
|
|
85534
85613
|
}
|
|
85535
|
-
flags |=
|
|
85614
|
+
flags |= 128 /* Ambient */;
|
|
85536
85615
|
lastDeclare = modifier;
|
|
85537
85616
|
break;
|
|
85538
85617
|
case 128 /* AbstractKeyword */:
|
|
85539
|
-
if (flags &
|
|
85618
|
+
if (flags & 64 /* Abstract */) {
|
|
85540
85619
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract");
|
|
85541
85620
|
}
|
|
85542
85621
|
if (node.kind !== 263 /* ClassDeclaration */ && node.kind !== 185 /* ConstructorType */) {
|
|
85543
85622
|
if (node.kind !== 174 /* MethodDeclaration */ && node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 177 /* GetAccessor */ && node.kind !== 178 /* SetAccessor */) {
|
|
85544
85623
|
return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
|
|
85545
85624
|
}
|
|
85546
|
-
if (!(node.parent.kind === 263 /* ClassDeclaration */ && hasSyntacticModifier(node.parent,
|
|
85625
|
+
if (!(node.parent.kind === 263 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 64 /* Abstract */))) {
|
|
85547
85626
|
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;
|
|
85548
85627
|
return grammarErrorOnNode(modifier, message);
|
|
85549
85628
|
}
|
|
85550
|
-
if (flags &
|
|
85629
|
+
if (flags & 256 /* Static */) {
|
|
85551
85630
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
|
|
85552
85631
|
}
|
|
85553
|
-
if (flags &
|
|
85632
|
+
if (flags & 2 /* Private */) {
|
|
85554
85633
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract");
|
|
85555
85634
|
}
|
|
85556
|
-
if (flags &
|
|
85635
|
+
if (flags & 1024 /* Async */ && lastAsync) {
|
|
85557
85636
|
return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract");
|
|
85558
85637
|
}
|
|
85559
|
-
if (flags &
|
|
85638
|
+
if (flags & 16 /* Override */) {
|
|
85560
85639
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override");
|
|
85561
85640
|
}
|
|
85562
|
-
if (flags &
|
|
85641
|
+
if (flags & 512 /* Accessor */) {
|
|
85563
85642
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor");
|
|
85564
85643
|
}
|
|
85565
85644
|
}
|
|
85566
85645
|
if (isNamedDeclaration(node) && node.name.kind === 81 /* PrivateIdentifier */) {
|
|
85567
85646
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract");
|
|
85568
85647
|
}
|
|
85569
|
-
flags |=
|
|
85648
|
+
flags |= 64 /* Abstract */;
|
|
85570
85649
|
break;
|
|
85571
85650
|
case 134 /* AsyncKeyword */:
|
|
85572
|
-
if (flags &
|
|
85651
|
+
if (flags & 1024 /* Async */) {
|
|
85573
85652
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async");
|
|
85574
|
-
} else if (flags &
|
|
85653
|
+
} else if (flags & 128 /* Ambient */ || node.parent.flags & 33554432 /* Ambient */) {
|
|
85575
85654
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
|
|
85576
85655
|
} else if (node.kind === 169 /* Parameter */) {
|
|
85577
85656
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
|
|
85578
85657
|
}
|
|
85579
|
-
if (flags &
|
|
85658
|
+
if (flags & 64 /* Abstract */) {
|
|
85580
85659
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract");
|
|
85581
85660
|
}
|
|
85582
|
-
flags |=
|
|
85661
|
+
flags |= 1024 /* Async */;
|
|
85583
85662
|
lastAsync = modifier;
|
|
85584
85663
|
break;
|
|
85585
85664
|
case 103 /* InKeyword */:
|
|
85586
85665
|
case 147 /* OutKeyword */:
|
|
85587
|
-
const inOutFlag = modifier.kind === 103 /* InKeyword */ ?
|
|
85666
|
+
const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */;
|
|
85588
85667
|
const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out";
|
|
85589
85668
|
if (node.kind !== 168 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
|
|
85590
85669
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
|
|
@@ -85592,7 +85671,7 @@ function createTypeChecker(host) {
|
|
|
85592
85671
|
if (flags & inOutFlag) {
|
|
85593
85672
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText);
|
|
85594
85673
|
}
|
|
85595
|
-
if (inOutFlag &
|
|
85674
|
+
if (inOutFlag & 8192 /* In */ && flags & 16384 /* Out */) {
|
|
85596
85675
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out");
|
|
85597
85676
|
}
|
|
85598
85677
|
flags |= inOutFlag;
|
|
@@ -85601,24 +85680,24 @@ function createTypeChecker(host) {
|
|
|
85601
85680
|
}
|
|
85602
85681
|
}
|
|
85603
85682
|
if (node.kind === 176 /* Constructor */) {
|
|
85604
|
-
if (flags &
|
|
85683
|
+
if (flags & 256 /* Static */) {
|
|
85605
85684
|
return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
|
|
85606
85685
|
}
|
|
85607
|
-
if (flags &
|
|
85686
|
+
if (flags & 16 /* Override */) {
|
|
85608
85687
|
return grammarErrorOnNode(lastOverride, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "override");
|
|
85609
85688
|
}
|
|
85610
|
-
if (flags &
|
|
85689
|
+
if (flags & 1024 /* Async */) {
|
|
85611
85690
|
return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async");
|
|
85612
85691
|
}
|
|
85613
85692
|
return false;
|
|
85614
|
-
} else if ((node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */) && flags &
|
|
85693
|
+
} else if ((node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */) && flags & 128 /* Ambient */) {
|
|
85615
85694
|
return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
|
|
85616
|
-
} else if (node.kind === 169 /* Parameter */ && flags &
|
|
85695
|
+
} else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) {
|
|
85617
85696
|
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);
|
|
85618
|
-
} else if (node.kind === 169 /* Parameter */ && flags &
|
|
85697
|
+
} else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && node.dotDotDotToken) {
|
|
85619
85698
|
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
|
|
85620
85699
|
}
|
|
85621
|
-
if (flags &
|
|
85700
|
+
if (flags & 1024 /* Async */) {
|
|
85622
85701
|
return checkGrammarAsyncModifier(node, lastAsync);
|
|
85623
85702
|
}
|
|
85624
85703
|
return false;
|
|
@@ -86138,12 +86217,12 @@ function createTypeChecker(host) {
|
|
|
86138
86217
|
if (languageVersion < 2 /* ES2015 */ && isPrivateIdentifier(accessor.name)) {
|
|
86139
86218
|
return grammarErrorOnNode(accessor.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
|
|
86140
86219
|
}
|
|
86141
|
-
if (accessor.body === void 0 && !hasSyntacticModifier(accessor,
|
|
86220
|
+
if (accessor.body === void 0 && !hasSyntacticModifier(accessor, 64 /* Abstract */)) {
|
|
86142
86221
|
return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, Diagnostics._0_expected, "{");
|
|
86143
86222
|
}
|
|
86144
86223
|
}
|
|
86145
86224
|
if (accessor.body) {
|
|
86146
|
-
if (hasSyntacticModifier(accessor,
|
|
86225
|
+
if (hasSyntacticModifier(accessor, 64 /* Abstract */)) {
|
|
86147
86226
|
return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation);
|
|
86148
86227
|
}
|
|
86149
86228
|
if (accessor.parent.kind === 187 /* TypeLiteral */ || accessor.parent.kind === 264 /* InterfaceDeclaration */) {
|
|
@@ -86215,7 +86294,7 @@ function createTypeChecker(host) {
|
|
|
86215
86294
|
}
|
|
86216
86295
|
break;
|
|
86217
86296
|
case 171 /* PropertySignature */:
|
|
86218
|
-
if (!hasSyntacticModifier(parent2,
|
|
86297
|
+
if (!hasSyntacticModifier(parent2, 8 /* Readonly */)) {
|
|
86219
86298
|
return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);
|
|
86220
86299
|
}
|
|
86221
86300
|
break;
|
|
@@ -86385,7 +86464,7 @@ function createTypeChecker(host) {
|
|
|
86385
86464
|
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;
|
|
86386
86465
|
return grammarErrorOnNode(node.exclamationToken, message);
|
|
86387
86466
|
}
|
|
86388
|
-
if ((moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && moduleKind !== 4 /* System */ && !(node.parent.parent.flags & 33554432 /* Ambient */) && hasSyntacticModifier(node.parent.parent,
|
|
86467
|
+
if ((moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && moduleKind !== 4 /* System */ && !(node.parent.parent.flags & 33554432 /* Ambient */) && hasSyntacticModifier(node.parent.parent, 32 /* Export */)) {
|
|
86389
86468
|
checkESModuleMarker(node.name);
|
|
86390
86469
|
}
|
|
86391
86470
|
return !!blockScopeKind && checkGrammarNameInLetOrConstDeclarations(node.name);
|
|
@@ -86575,7 +86654,7 @@ function createTypeChecker(host) {
|
|
|
86575
86654
|
}
|
|
86576
86655
|
}
|
|
86577
86656
|
function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {
|
|
86578
|
-
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,
|
|
86657
|
+
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 */)) {
|
|
86579
86658
|
return false;
|
|
86580
86659
|
}
|
|
86581
86660
|
return grammarErrorOnFirstToken(node, Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier);
|
|
@@ -87021,12 +87100,14 @@ var init_checker = __esm({
|
|
|
87021
87100
|
this.canTrackSymbol = !!((_a = this.inner) == null ? void 0 : _a.trackSymbol);
|
|
87022
87101
|
}
|
|
87023
87102
|
trackSymbol(symbol, enclosingDeclaration, meaning) {
|
|
87024
|
-
var _a;
|
|
87103
|
+
var _a, _b;
|
|
87025
87104
|
if (((_a = this.inner) == null ? void 0 : _a.trackSymbol) && !this.disableTrackSymbol) {
|
|
87026
87105
|
if (this.inner.trackSymbol(symbol, enclosingDeclaration, meaning)) {
|
|
87027
87106
|
this.onDiagnosticReported();
|
|
87028
87107
|
return true;
|
|
87029
87108
|
}
|
|
87109
|
+
if (!(symbol.flags & 262144 /* TypeParameter */))
|
|
87110
|
+
((_b = this.context).trackedSymbols ?? (_b.trackedSymbols = [])).push([symbol, enclosingDeclaration, meaning]);
|
|
87030
87111
|
}
|
|
87031
87112
|
return false;
|
|
87032
87113
|
}
|
|
@@ -89089,15 +89170,15 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89089
89170
|
}
|
|
89090
89171
|
break;
|
|
89091
89172
|
case 243 /* VariableStatement */:
|
|
89092
|
-
if (hasSyntacticModifier(node,
|
|
89173
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
89093
89174
|
for (const decl of node.declarationList.declarations) {
|
|
89094
89175
|
exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings);
|
|
89095
89176
|
}
|
|
89096
89177
|
}
|
|
89097
89178
|
break;
|
|
89098
89179
|
case 262 /* FunctionDeclaration */:
|
|
89099
|
-
if (hasSyntacticModifier(node,
|
|
89100
|
-
if (hasSyntacticModifier(node,
|
|
89180
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
89181
|
+
if (hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
89101
89182
|
if (!hasExportDefault) {
|
|
89102
89183
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));
|
|
89103
89184
|
hasExportDefault = true;
|
|
@@ -89113,8 +89194,8 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89113
89194
|
}
|
|
89114
89195
|
break;
|
|
89115
89196
|
case 263 /* ClassDeclaration */:
|
|
89116
|
-
if (hasSyntacticModifier(node,
|
|
89117
|
-
if (hasSyntacticModifier(node,
|
|
89197
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
89198
|
+
if (hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
89118
89199
|
if (!hasExportDefault) {
|
|
89119
89200
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));
|
|
89120
89201
|
hasExportDefault = true;
|
|
@@ -90004,7 +90085,7 @@ var init_classThis = __esm({
|
|
|
90004
90085
|
// src/compiler/transformers/namedEvaluation.ts
|
|
90005
90086
|
function getAssignedNameOfIdentifier(factory2, name, expression) {
|
|
90006
90087
|
const original = getOriginalNode(skipOuterExpressions(expression));
|
|
90007
|
-
if ((isClassDeclaration(original) || isFunctionDeclaration(original)) && !original.name && hasSyntacticModifier(original,
|
|
90088
|
+
if ((isClassDeclaration(original) || isFunctionDeclaration(original)) && !original.name && hasSyntacticModifier(original, 2048 /* Default */)) {
|
|
90008
90089
|
return factory2.createStringLiteral("default");
|
|
90009
90090
|
}
|
|
90010
90091
|
return factory2.createStringLiteralFromNode(name);
|
|
@@ -90375,13 +90456,13 @@ function transformTypeScript(context) {
|
|
|
90375
90456
|
break;
|
|
90376
90457
|
case 263 /* ClassDeclaration */:
|
|
90377
90458
|
case 262 /* FunctionDeclaration */:
|
|
90378
|
-
if (hasSyntacticModifier(node,
|
|
90459
|
+
if (hasSyntacticModifier(node, 128 /* Ambient */)) {
|
|
90379
90460
|
break;
|
|
90380
90461
|
}
|
|
90381
90462
|
if (node.name) {
|
|
90382
90463
|
recordEmittedDeclarationInScope(node);
|
|
90383
90464
|
} else {
|
|
90384
|
-
Debug.assert(node.kind === 263 /* ClassDeclaration */ || hasSyntacticModifier(node,
|
|
90465
|
+
Debug.assert(node.kind === 263 /* ClassDeclaration */ || hasSyntacticModifier(node, 2048 /* Default */));
|
|
90385
90466
|
}
|
|
90386
90467
|
break;
|
|
90387
90468
|
}
|
|
@@ -90436,7 +90517,7 @@ function transformTypeScript(context) {
|
|
|
90436
90517
|
function namespaceElementVisitorWorker(node) {
|
|
90437
90518
|
if (node.kind === 278 /* ExportDeclaration */ || node.kind === 272 /* ImportDeclaration */ || node.kind === 273 /* ImportClause */ || node.kind === 271 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 283 /* ExternalModuleReference */) {
|
|
90438
90519
|
return void 0;
|
|
90439
|
-
} else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node,
|
|
90520
|
+
} else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node, 32 /* Export */)) {
|
|
90440
90521
|
return visitTypeScript(node);
|
|
90441
90522
|
}
|
|
90442
90523
|
return node;
|
|
@@ -90494,7 +90575,7 @@ function transformTypeScript(context) {
|
|
|
90494
90575
|
function modifierVisitor(node) {
|
|
90495
90576
|
if (isDecorator(node))
|
|
90496
90577
|
return void 0;
|
|
90497
|
-
if (modifierToFlag(node.kind) &
|
|
90578
|
+
if (modifierToFlag(node.kind) & 28895 /* TypeScriptModifier */) {
|
|
90498
90579
|
return void 0;
|
|
90499
90580
|
} else if (currentNamespace && node.kind === 95 /* ExportKeyword */) {
|
|
90500
90581
|
return void 0;
|
|
@@ -90502,7 +90583,7 @@ function transformTypeScript(context) {
|
|
|
90502
90583
|
return node;
|
|
90503
90584
|
}
|
|
90504
90585
|
function visitTypeScript(node) {
|
|
90505
|
-
if (isStatement(node) && hasSyntacticModifier(node,
|
|
90586
|
+
if (isStatement(node) && hasSyntacticModifier(node, 128 /* Ambient */)) {
|
|
90506
90587
|
return factory2.createNotEmittedStatement(node);
|
|
90507
90588
|
}
|
|
90508
90589
|
switch (node.kind) {
|
|
@@ -90992,7 +91073,7 @@ function transformTypeScript(context) {
|
|
|
90992
91073
|
return !nodeIsMissing(node.body);
|
|
90993
91074
|
}
|
|
90994
91075
|
function visitPropertyDeclaration(node, parent2) {
|
|
90995
|
-
const isAmbient = node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node,
|
|
91076
|
+
const isAmbient = node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node, 64 /* Abstract */);
|
|
90996
91077
|
if (isAmbient && !(legacyDecorators && hasDecorators(node))) {
|
|
90997
91078
|
return void 0;
|
|
90998
91079
|
}
|
|
@@ -91001,7 +91082,7 @@ function transformTypeScript(context) {
|
|
|
91001
91082
|
if (isAmbient) {
|
|
91002
91083
|
return factory2.updatePropertyDeclaration(
|
|
91003
91084
|
node,
|
|
91004
|
-
concatenate(modifiers, factory2.createModifiersFromModifierFlags(
|
|
91085
|
+
concatenate(modifiers, factory2.createModifiersFromModifierFlags(128 /* Ambient */)),
|
|
91005
91086
|
Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)),
|
|
91006
91087
|
/*questionOrExclamationToken*/
|
|
91007
91088
|
void 0,
|
|
@@ -91164,7 +91245,7 @@ function transformTypeScript(context) {
|
|
|
91164
91245
|
);
|
|
91165
91246
|
}
|
|
91166
91247
|
function shouldEmitAccessorDeclaration(node) {
|
|
91167
|
-
return !(nodeIsMissing(node.body) && hasSyntacticModifier(node,
|
|
91248
|
+
return !(nodeIsMissing(node.body) && hasSyntacticModifier(node, 64 /* Abstract */));
|
|
91168
91249
|
}
|
|
91169
91250
|
function visitGetAccessor(node, parent2) {
|
|
91170
91251
|
if (!(node.transformFlags & 1 /* ContainsTypeScript */)) {
|
|
@@ -91897,16 +91978,16 @@ function transformTypeScript(context) {
|
|
|
91897
91978
|
}
|
|
91898
91979
|
}
|
|
91899
91980
|
function isExportOfNamespace(node) {
|
|
91900
|
-
return currentNamespace !== void 0 && hasSyntacticModifier(node,
|
|
91981
|
+
return currentNamespace !== void 0 && hasSyntacticModifier(node, 32 /* Export */);
|
|
91901
91982
|
}
|
|
91902
91983
|
function isExternalModuleExport(node) {
|
|
91903
|
-
return currentNamespace === void 0 && hasSyntacticModifier(node,
|
|
91984
|
+
return currentNamespace === void 0 && hasSyntacticModifier(node, 32 /* Export */);
|
|
91904
91985
|
}
|
|
91905
91986
|
function isNamedExternalModuleExport(node) {
|
|
91906
|
-
return isExternalModuleExport(node) && !hasSyntacticModifier(node,
|
|
91987
|
+
return isExternalModuleExport(node) && !hasSyntacticModifier(node, 2048 /* Default */);
|
|
91907
91988
|
}
|
|
91908
91989
|
function isDefaultExternalModuleExport(node) {
|
|
91909
|
-
return isExternalModuleExport(node) && hasSyntacticModifier(node,
|
|
91990
|
+
return isExternalModuleExport(node) && hasSyntacticModifier(node, 2048 /* Default */);
|
|
91910
91991
|
}
|
|
91911
91992
|
function createExportMemberAssignmentStatement(node) {
|
|
91912
91993
|
const expression = factory2.createAssignment(
|
|
@@ -93247,8 +93328,8 @@ function transformClassFields(context) {
|
|
|
93247
93328
|
getClassLexicalEnvironment().classThis = node.emitNode.classThis;
|
|
93248
93329
|
}
|
|
93249
93330
|
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */;
|
|
93250
|
-
const isExport = hasSyntacticModifier(node,
|
|
93251
|
-
const isDefault = hasSyntacticModifier(node,
|
|
93331
|
+
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
93332
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
93252
93333
|
let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
|
|
93253
93334
|
const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause);
|
|
93254
93335
|
const { members, prologue } = transformClassMembers(node);
|
|
@@ -93794,7 +93875,7 @@ function transformClassFields(context) {
|
|
|
93794
93875
|
return void 0;
|
|
93795
93876
|
}
|
|
93796
93877
|
const propertyOriginalNode = getOriginalNode(property);
|
|
93797
|
-
if (hasSyntacticModifier(propertyOriginalNode,
|
|
93878
|
+
if (hasSyntacticModifier(propertyOriginalNode, 64 /* Abstract */)) {
|
|
93798
93879
|
return void 0;
|
|
93799
93880
|
}
|
|
93800
93881
|
let initializer = visitNode(property.initializer, visitor, isExpression);
|
|
@@ -94842,8 +94923,8 @@ function transformLegacyDecorators(context) {
|
|
|
94842
94923
|
return addRange([updated], decorationStatements);
|
|
94843
94924
|
}
|
|
94844
94925
|
function transformClassDeclarationWithClassDecorators(node, name) {
|
|
94845
|
-
const isExport = hasSyntacticModifier(node,
|
|
94846
|
-
const isDefault = hasSyntacticModifier(node,
|
|
94926
|
+
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
94927
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
94847
94928
|
const modifiers = visitNodes2(node.modifiers, (node2) => isExportOrDefaultModifier(node2) || isDecorator(node2) ? void 0 : node2, isModifierLike);
|
|
94848
94929
|
const location = moveRangePastModifiers(node);
|
|
94849
94930
|
const classAlias = getClassAliasIfNeeded(node);
|
|
@@ -94864,7 +94945,7 @@ function transformLegacyDecorators(context) {
|
|
|
94864
94945
|
let members = visitNodes2(node.members, visitor, isClassElement);
|
|
94865
94946
|
let decorationStatements = [];
|
|
94866
94947
|
({ members, decorationStatements } = transformDecoratorsOfClassElements(node, members));
|
|
94867
|
-
const assignClassAliasInStaticBlock = languageVersion >= 9 /* ES2022 */ && !!classAlias && some(members, (member) => isPropertyDeclaration(member) && hasSyntacticModifier(member,
|
|
94948
|
+
const assignClassAliasInStaticBlock = languageVersion >= 9 /* ES2022 */ && !!classAlias && some(members, (member) => isPropertyDeclaration(member) && hasSyntacticModifier(member, 256 /* Static */) || isClassStaticBlockDeclaration(member));
|
|
94868
94949
|
if (assignClassAliasInStaticBlock) {
|
|
94869
94950
|
members = setTextRange(
|
|
94870
94951
|
factory2.createNodeArray([
|
|
@@ -94995,7 +95076,7 @@ function transformLegacyDecorators(context) {
|
|
|
94995
95076
|
);
|
|
94996
95077
|
}
|
|
94997
95078
|
function visitPropertyDeclaration(node) {
|
|
94998
|
-
if (node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node,
|
|
95079
|
+
if (node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node, 128 /* Ambient */)) {
|
|
94999
95080
|
return void 0;
|
|
95000
95081
|
}
|
|
95001
95082
|
return finishClassElement(
|
|
@@ -95083,7 +95164,7 @@ function transformLegacyDecorators(context) {
|
|
|
95083
95164
|
const memberName = getExpressionForPropertyName(
|
|
95084
95165
|
member,
|
|
95085
95166
|
/*generateNameForComputedPropertyName*/
|
|
95086
|
-
!hasSyntacticModifier(member,
|
|
95167
|
+
!hasSyntacticModifier(member, 128 /* Ambient */)
|
|
95087
95168
|
);
|
|
95088
95169
|
const descriptor = languageVersion > 0 /* ES3 */ ? isPropertyDeclaration(member) && !hasAccessorModifier(member) ? factory2.createVoidZero() : factory2.createNull() : void 0;
|
|
95089
95170
|
const helper = emitHelpers().createDecorateHelper(
|
|
@@ -95872,8 +95953,8 @@ function transformESDecorators(context) {
|
|
|
95872
95953
|
const statements = [];
|
|
95873
95954
|
const originalClass = getOriginalNode(node, isClassLike) ?? node;
|
|
95874
95955
|
const className = originalClass.name ? factory2.createStringLiteralFromNode(originalClass.name) : factory2.createStringLiteral("default");
|
|
95875
|
-
const isExport = hasSyntacticModifier(node,
|
|
95876
|
-
const isDefault = hasSyntacticModifier(node,
|
|
95956
|
+
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
95957
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
95877
95958
|
if (!node.name) {
|
|
95878
95959
|
node = injectClassNamedEvaluationHelperBlockIfMissing(context, node, className);
|
|
95879
95960
|
}
|
|
@@ -98196,7 +98277,7 @@ function transformES2018(context) {
|
|
|
98196
98277
|
return visitEachChild(node, visitor, context);
|
|
98197
98278
|
}
|
|
98198
98279
|
function visitVariableStatement(node) {
|
|
98199
|
-
if (hasSyntacticModifier(node,
|
|
98280
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
98200
98281
|
const savedExportedVariableStatement = exportedVariableStatement;
|
|
98201
98282
|
exportedVariableStatement = true;
|
|
98202
98283
|
const visited = visitEachChild(node, visitor, context);
|
|
@@ -99432,7 +99513,7 @@ function transformESNext(context) {
|
|
|
99432
99513
|
addRange(topLevelStatements, endLexicalEnvironment());
|
|
99433
99514
|
if (exportVars.length) {
|
|
99434
99515
|
topLevelStatements.push(factory2.createVariableStatement(
|
|
99435
|
-
factory2.createModifiersFromModifierFlags(
|
|
99516
|
+
factory2.createModifiersFromModifierFlags(32 /* Export */),
|
|
99436
99517
|
factory2.createVariableDeclarationList(
|
|
99437
99518
|
exportVars,
|
|
99438
99519
|
1 /* Let */
|
|
@@ -99729,8 +99810,8 @@ function transformESNext(context) {
|
|
|
99729
99810
|
if (!node.name && defaultExportBinding) {
|
|
99730
99811
|
return node;
|
|
99731
99812
|
}
|
|
99732
|
-
const isExported2 = hasSyntacticModifier(node,
|
|
99733
|
-
const isDefault = hasSyntacticModifier(node,
|
|
99813
|
+
const isExported2 = hasSyntacticModifier(node, 32 /* Export */);
|
|
99814
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
99734
99815
|
let expression = factory2.converters.convertToClassExpression(node);
|
|
99735
99816
|
if (node.name) {
|
|
99736
99817
|
hoistBindingIdentifier(
|
|
@@ -99778,7 +99859,7 @@ function transformESNext(context) {
|
|
|
99778
99859
|
}
|
|
99779
99860
|
function hoistVariableStatement(node) {
|
|
99780
99861
|
let expressions;
|
|
99781
|
-
const isExported2 = hasSyntacticModifier(node,
|
|
99862
|
+
const isExported2 = hasSyntacticModifier(node, 32 /* Export */);
|
|
99782
99863
|
for (const variable of node.declarationList.declarations) {
|
|
99783
99864
|
hoistBindingElement(variable, isExported2, variable);
|
|
99784
99865
|
if (variable.initializer) {
|
|
@@ -101329,8 +101410,8 @@ function transformES2015(context) {
|
|
|
101329
101410
|
setTextRange(statement, node);
|
|
101330
101411
|
startOnNewLine(statement);
|
|
101331
101412
|
statements.push(statement);
|
|
101332
|
-
if (hasSyntacticModifier(node,
|
|
101333
|
-
const exportStatement = hasSyntacticModifier(node,
|
|
101413
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
101414
|
+
const exportStatement = hasSyntacticModifier(node, 2048 /* Default */) ? factory2.createExportDefault(factory2.getLocalName(node)) : factory2.createExternalModuleExport(factory2.getLocalName(node));
|
|
101334
101415
|
setOriginalNode(exportStatement, statement);
|
|
101335
101416
|
statements.push(exportStatement);
|
|
101336
101417
|
}
|
|
@@ -102522,7 +102603,7 @@ function transformES2015(context) {
|
|
|
102522
102603
|
return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getInternalEmitFlags(node.declarationList.declarations[0].initializer) & 1 /* TypeScriptClassWrapper */);
|
|
102523
102604
|
}
|
|
102524
102605
|
function visitVariableStatement(node) {
|
|
102525
|
-
const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node,
|
|
102606
|
+
const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node, 32 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */);
|
|
102526
102607
|
let updated;
|
|
102527
102608
|
if (convertedLoopState && (node.declarationList.flags & 7 /* BlockScoped */) === 0 && !isVariableStatementOfTypeScriptClassWrapper(node)) {
|
|
102528
102609
|
let assignments;
|
|
@@ -107489,7 +107570,7 @@ function transformModule(context) {
|
|
|
107489
107570
|
Debug.assert(isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer.");
|
|
107490
107571
|
let statements;
|
|
107491
107572
|
if (moduleKind !== 2 /* AMD */) {
|
|
107492
|
-
if (hasSyntacticModifier(node,
|
|
107573
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
107493
107574
|
statements = append(
|
|
107494
107575
|
statements,
|
|
107495
107576
|
setOriginalNode(
|
|
@@ -107535,7 +107616,7 @@ function transformModule(context) {
|
|
|
107535
107616
|
);
|
|
107536
107617
|
}
|
|
107537
107618
|
} else {
|
|
107538
|
-
if (hasSyntacticModifier(node,
|
|
107619
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
107539
107620
|
statements = append(
|
|
107540
107621
|
statements,
|
|
107541
107622
|
setOriginalNode(
|
|
@@ -107673,7 +107754,7 @@ function transformModule(context) {
|
|
|
107673
107754
|
}
|
|
107674
107755
|
function visitFunctionDeclaration(node) {
|
|
107675
107756
|
let statements;
|
|
107676
|
-
if (hasSyntacticModifier(node,
|
|
107757
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
107677
107758
|
statements = append(
|
|
107678
107759
|
statements,
|
|
107679
107760
|
setOriginalNode(
|
|
@@ -107710,7 +107791,7 @@ function transformModule(context) {
|
|
|
107710
107791
|
}
|
|
107711
107792
|
function visitClassDeclaration(node) {
|
|
107712
107793
|
let statements;
|
|
107713
|
-
if (hasSyntacticModifier(node,
|
|
107794
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
107714
107795
|
statements = append(
|
|
107715
107796
|
statements,
|
|
107716
107797
|
setOriginalNode(
|
|
@@ -107744,7 +107825,7 @@ function transformModule(context) {
|
|
|
107744
107825
|
let statements;
|
|
107745
107826
|
let variables;
|
|
107746
107827
|
let expressions;
|
|
107747
|
-
if (hasSyntacticModifier(node,
|
|
107828
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
107748
107829
|
let modifiers;
|
|
107749
107830
|
let removeCommentsOnExpressions = false;
|
|
107750
107831
|
for (const variable of node.declarationList.declarations) {
|
|
@@ -107930,8 +108011,8 @@ function transformModule(context) {
|
|
|
107930
108011
|
return statements;
|
|
107931
108012
|
}
|
|
107932
108013
|
const seen = new IdentifierNameMap();
|
|
107933
|
-
if (hasSyntacticModifier(decl,
|
|
107934
|
-
const exportName = hasSyntacticModifier(decl,
|
|
108014
|
+
if (hasSyntacticModifier(decl, 32 /* Export */)) {
|
|
108015
|
+
const exportName = hasSyntacticModifier(decl, 2048 /* Default */) ? factory2.createIdentifier("default") : factory2.getDeclarationName(decl);
|
|
107935
108016
|
statements = appendExportStatement(
|
|
107936
108017
|
statements,
|
|
107937
108018
|
seen,
|
|
@@ -108425,7 +108506,7 @@ function transformSystemModule(context) {
|
|
|
108425
108506
|
addRange(statements, hoistedStatements);
|
|
108426
108507
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
108427
108508
|
const exportStarFunction = addExportStarIfNeeded(statements);
|
|
108428
|
-
const modifiers = node.transformFlags & 2097152 /* ContainsAwait */ ? factory2.createModifiersFromModifierFlags(
|
|
108509
|
+
const modifiers = node.transformFlags & 2097152 /* ContainsAwait */ ? factory2.createModifiersFromModifierFlags(1024 /* Async */) : void 0;
|
|
108429
108510
|
const moduleObject = factory2.createObjectLiteralExpression(
|
|
108430
108511
|
[
|
|
108431
108512
|
factory2.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)),
|
|
@@ -108627,7 +108708,7 @@ function transformSystemModule(context) {
|
|
|
108627
108708
|
factory2.createAssignment(importVariableName, parameterName)
|
|
108628
108709
|
)
|
|
108629
108710
|
);
|
|
108630
|
-
if (hasSyntacticModifier(entry,
|
|
108711
|
+
if (hasSyntacticModifier(entry, 32 /* Export */)) {
|
|
108631
108712
|
statements.push(
|
|
108632
108713
|
factory2.createExpressionStatement(
|
|
108633
108714
|
factory2.createCallExpression(
|
|
@@ -108780,7 +108861,7 @@ function transformSystemModule(context) {
|
|
|
108780
108861
|
);
|
|
108781
108862
|
}
|
|
108782
108863
|
function visitFunctionDeclaration(node) {
|
|
108783
|
-
if (hasSyntacticModifier(node,
|
|
108864
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
108784
108865
|
hoistedStatements = append(
|
|
108785
108866
|
hoistedStatements,
|
|
108786
108867
|
factory2.updateFunctionDeclaration(
|
|
@@ -108867,7 +108948,7 @@ function transformSystemModule(context) {
|
|
|
108867
108948
|
statements = append(statements, factory2.updateVariableStatement(node, modifiers, declarationList));
|
|
108868
108949
|
} else {
|
|
108869
108950
|
let expressions;
|
|
108870
|
-
const isExportedDeclaration = hasSyntacticModifier(node,
|
|
108951
|
+
const isExportedDeclaration = hasSyntacticModifier(node, 32 /* Export */);
|
|
108871
108952
|
for (const variable of node.declarationList.declarations) {
|
|
108872
108953
|
if (variable.initializer) {
|
|
108873
108954
|
expressions = append(expressions, transformInitializedVariable(variable, isExportedDeclaration));
|
|
@@ -109003,8 +109084,8 @@ function transformSystemModule(context) {
|
|
|
109003
109084
|
return statements;
|
|
109004
109085
|
}
|
|
109005
109086
|
let excludeName;
|
|
109006
|
-
if (hasSyntacticModifier(decl,
|
|
109007
|
-
const exportName = hasSyntacticModifier(decl,
|
|
109087
|
+
if (hasSyntacticModifier(decl, 32 /* Export */)) {
|
|
109088
|
+
const exportName = hasSyntacticModifier(decl, 2048 /* Default */) ? factory2.createStringLiteral("default") : decl.name;
|
|
109008
109089
|
statements = appendExportStatement(statements, exportName, factory2.getLocalName(decl));
|
|
109009
109090
|
excludeName = getTextOfIdentifierOrLiteral(exportName);
|
|
109010
109091
|
}
|
|
@@ -109755,7 +109836,7 @@ function transformECMAScriptModule(context) {
|
|
|
109755
109836
|
return singleOrMany(statements);
|
|
109756
109837
|
}
|
|
109757
109838
|
function appendExportsOfImportEqualsDeclaration(statements, node) {
|
|
109758
|
-
if (hasSyntacticModifier(node,
|
|
109839
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
109759
109840
|
statements = append(
|
|
109760
109841
|
statements,
|
|
109761
109842
|
factory2.createExportDeclaration(
|
|
@@ -109977,7 +110058,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
109977
110058
|
} else if (isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isIndexSignatureDeclaration(node)) {
|
|
109978
110059
|
return getReturnTypeVisibilityError;
|
|
109979
110060
|
} else if (isParameter(node)) {
|
|
109980
|
-
if (isParameterPropertyDeclaration(node, node.parent) && hasSyntacticModifier(node.parent,
|
|
110061
|
+
if (isParameterPropertyDeclaration(node, node.parent) && hasSyntacticModifier(node.parent, 2 /* Private */)) {
|
|
109981
110062
|
return getVariableDeclarationTypeVisibilityError;
|
|
109982
110063
|
}
|
|
109983
110064
|
return getParameterDeclarationTypeVisibilityError;
|
|
@@ -109995,7 +110076,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
109995
110076
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
109996
110077
|
if (node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
|
|
109997
110078
|
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;
|
|
109998
|
-
} 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,
|
|
110079
|
+
} 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 */)) {
|
|
109999
110080
|
if (isStatic(node)) {
|
|
110000
110081
|
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;
|
|
110001
110082
|
} else if (node.parent.kind === 263 /* ClassDeclaration */ || node.kind === 169 /* Parameter */) {
|
|
@@ -110721,7 +110802,7 @@ function transformDeclarations(context) {
|
|
|
110721
110802
|
return void 0;
|
|
110722
110803
|
}
|
|
110723
110804
|
function ensureType(node, type, ignorePrivate) {
|
|
110724
|
-
if (!ignorePrivate && hasEffectiveModifier(node,
|
|
110805
|
+
if (!ignorePrivate && hasEffectiveModifier(node, 2 /* Private */)) {
|
|
110725
110806
|
return;
|
|
110726
110807
|
}
|
|
110727
110808
|
if (shouldPrintWithInitializer(node)) {
|
|
@@ -110801,7 +110882,7 @@ function transformDeclarations(context) {
|
|
|
110801
110882
|
}
|
|
110802
110883
|
}
|
|
110803
110884
|
function updateParamsList(node, params, modifierMask) {
|
|
110804
|
-
if (hasEffectiveModifier(node,
|
|
110885
|
+
if (hasEffectiveModifier(node, 2 /* Private */)) {
|
|
110805
110886
|
return factory2.createNodeArray();
|
|
110806
110887
|
}
|
|
110807
110888
|
const newParams = map(params, (p) => ensureParameter(p, modifierMask));
|
|
@@ -110846,7 +110927,7 @@ function transformDeclarations(context) {
|
|
|
110846
110927
|
return factory2.createNodeArray(newParams || emptyArray);
|
|
110847
110928
|
}
|
|
110848
110929
|
function ensureTypeParams(node, params) {
|
|
110849
|
-
return hasEffectiveModifier(node,
|
|
110930
|
+
return hasEffectiveModifier(node, 2 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree, isTypeParameterDeclaration);
|
|
110850
110931
|
}
|
|
110851
110932
|
function isEnclosingDeclaration(node) {
|
|
110852
110933
|
return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node);
|
|
@@ -111032,7 +111113,7 @@ function transformDeclarations(context) {
|
|
|
111032
111113
|
const oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
|
|
111033
111114
|
let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 187 /* TypeLiteral */ || input.kind === 200 /* MappedType */) && input.parent.kind !== 265 /* TypeAliasDeclaration */;
|
|
111034
111115
|
if (isMethodDeclaration(input) || isMethodSignature(input)) {
|
|
111035
|
-
if (hasEffectiveModifier(input,
|
|
111116
|
+
if (hasEffectiveModifier(input, 2 /* Private */)) {
|
|
111036
111117
|
if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input)
|
|
111037
111118
|
return;
|
|
111038
111119
|
return cleanup(factory2.createPropertyDeclaration(
|
|
@@ -111120,7 +111201,7 @@ function transformDeclarations(context) {
|
|
|
111120
111201
|
input,
|
|
111121
111202
|
ensureModifiers(input),
|
|
111122
111203
|
input.name,
|
|
111123
|
-
updateAccessorParamsList(input, hasEffectiveModifier(input,
|
|
111204
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
111124
111205
|
ensureType(input, accessorType),
|
|
111125
111206
|
/*body*/
|
|
111126
111207
|
void 0
|
|
@@ -111137,7 +111218,7 @@ function transformDeclarations(context) {
|
|
|
111137
111218
|
input,
|
|
111138
111219
|
ensureModifiers(input),
|
|
111139
111220
|
input.name,
|
|
111140
|
-
updateAccessorParamsList(input, hasEffectiveModifier(input,
|
|
111221
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
111141
111222
|
/*body*/
|
|
111142
111223
|
void 0
|
|
111143
111224
|
));
|
|
@@ -111294,7 +111375,7 @@ function transformDeclarations(context) {
|
|
|
111294
111375
|
}
|
|
111295
111376
|
}
|
|
111296
111377
|
function isPrivateMethodTypeParameter(node) {
|
|
111297
|
-
return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent,
|
|
111378
|
+
return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 2 /* Private */);
|
|
111298
111379
|
}
|
|
111299
111380
|
function visitDeclarationStatements(input) {
|
|
111300
111381
|
if (!isPreservedDeclarationStatement(input)) {
|
|
@@ -111353,10 +111434,10 @@ function transformDeclarations(context) {
|
|
|
111353
111434
|
return input;
|
|
111354
111435
|
}
|
|
111355
111436
|
function stripExportModifiers(statement) {
|
|
111356
|
-
if (isImportEqualsDeclaration(statement) || hasEffectiveModifier(statement,
|
|
111437
|
+
if (isImportEqualsDeclaration(statement) || hasEffectiveModifier(statement, 2048 /* Default */) || !canHaveModifiers(statement)) {
|
|
111357
111438
|
return statement;
|
|
111358
111439
|
}
|
|
111359
|
-
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (
|
|
111440
|
+
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (131071 /* All */ ^ 32 /* Export */));
|
|
111360
111441
|
return factory2.replaceModifiers(statement, modifiers);
|
|
111361
111442
|
}
|
|
111362
111443
|
function updateModuleDeclarationAndKeyword(node, modifiers, name, body) {
|
|
@@ -111506,10 +111587,10 @@ function transformDeclarations(context) {
|
|
|
111506
111587
|
));
|
|
111507
111588
|
}
|
|
111508
111589
|
const namespaceDecl = factory2.createModuleDeclaration(ensureModifiers(input), input.name, factory2.createModuleBlock(declarations), 32 /* Namespace */);
|
|
111509
|
-
if (!hasEffectiveModifier(clean2,
|
|
111590
|
+
if (!hasEffectiveModifier(clean2, 2048 /* Default */)) {
|
|
111510
111591
|
return [clean2, namespaceDecl];
|
|
111511
111592
|
}
|
|
111512
|
-
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(clean2) & ~
|
|
111593
|
+
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(clean2) & ~2080 /* ExportDefault */ | 128 /* Ambient */);
|
|
111513
111594
|
const cleanDeclaration = factory2.updateFunctionDeclaration(
|
|
111514
111595
|
clean2,
|
|
111515
111596
|
modifiers,
|
|
@@ -111601,7 +111682,7 @@ function transformDeclarations(context) {
|
|
|
111601
111682
|
if (ctor) {
|
|
111602
111683
|
const oldDiag2 = getSymbolAccessibilityDiagnostic;
|
|
111603
111684
|
parameterProperties = compact(flatMap(ctor.parameters, (param) => {
|
|
111604
|
-
if (!hasSyntacticModifier(param,
|
|
111685
|
+
if (!hasSyntacticModifier(param, 31 /* ParameterPropertyModifier */) || shouldStripInternal(param))
|
|
111605
111686
|
return;
|
|
111606
111687
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(param);
|
|
111607
111688
|
if (param.name.kind === 80 /* Identifier */) {
|
|
@@ -111830,11 +111911,11 @@ function transformDeclarations(context) {
|
|
|
111830
111911
|
return factory2.createModifiersFromModifierFlags(newFlags);
|
|
111831
111912
|
}
|
|
111832
111913
|
function ensureModifierFlags(node) {
|
|
111833
|
-
let mask2 =
|
|
111834
|
-
let additions = needsDeclare && !isAlwaysType(node) ?
|
|
111914
|
+
let mask2 = 131071 /* All */ ^ (1 /* Public */ | 1024 /* Async */ | 16 /* Override */);
|
|
111915
|
+
let additions = needsDeclare && !isAlwaysType(node) ? 128 /* Ambient */ : 0 /* None */;
|
|
111835
111916
|
const parentIsFile = node.parent.kind === 312 /* SourceFile */;
|
|
111836
111917
|
if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) {
|
|
111837
|
-
mask2 ^=
|
|
111918
|
+
mask2 ^= 128 /* Ambient */;
|
|
111838
111919
|
additions = 0 /* None */;
|
|
111839
111920
|
}
|
|
111840
111921
|
return maskModifierFlags(node, mask2, additions);
|
|
@@ -111876,13 +111957,13 @@ function isAlwaysType(node) {
|
|
|
111876
111957
|
function maskModifiers(factory2, node, modifierMask, modifierAdditions) {
|
|
111877
111958
|
return factory2.createModifiersFromModifierFlags(maskModifierFlags(node, modifierMask, modifierAdditions));
|
|
111878
111959
|
}
|
|
111879
|
-
function maskModifierFlags(node, modifierMask =
|
|
111960
|
+
function maskModifierFlags(node, modifierMask = 131071 /* All */ ^ 1 /* Public */, modifierAdditions = 0 /* None */) {
|
|
111880
111961
|
let flags = getEffectiveModifierFlags(node) & modifierMask | modifierAdditions;
|
|
111881
|
-
if (flags &
|
|
111882
|
-
flags ^=
|
|
111962
|
+
if (flags & 2048 /* Default */ && !(flags & 32 /* Export */)) {
|
|
111963
|
+
flags ^= 32 /* Export */;
|
|
111883
111964
|
}
|
|
111884
|
-
if (flags &
|
|
111885
|
-
flags ^=
|
|
111965
|
+
if (flags & 2048 /* Default */ && flags & 128 /* Ambient */) {
|
|
111966
|
+
flags ^= 128 /* Ambient */;
|
|
111886
111967
|
}
|
|
111887
111968
|
return flags;
|
|
111888
111969
|
}
|
|
@@ -111895,7 +111976,7 @@ function canHaveLiteralInitializer(node) {
|
|
|
111895
111976
|
switch (node.kind) {
|
|
111896
111977
|
case 172 /* PropertyDeclaration */:
|
|
111897
111978
|
case 171 /* PropertySignature */:
|
|
111898
|
-
return !hasEffectiveModifier(node,
|
|
111979
|
+
return !hasEffectiveModifier(node, 2 /* Private */);
|
|
111899
111980
|
case 169 /* Parameter */:
|
|
111900
111981
|
case 260 /* VariableDeclaration */:
|
|
111901
111982
|
return true;
|
|
@@ -120628,7 +120709,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120628
120709
|
}
|
|
120629
120710
|
}
|
|
120630
120711
|
} else if (isModuleDeclaration(node)) {
|
|
120631
|
-
if (isAmbientModule(node) && (inAmbientModule || hasSyntacticModifier(node,
|
|
120712
|
+
if (isAmbientModule(node) && (inAmbientModule || hasSyntacticModifier(node, 128 /* Ambient */) || file.isDeclarationFile)) {
|
|
120632
120713
|
node.name.parent = node;
|
|
120633
120714
|
const nameText = getTextOfIdentifierOrLiteral(node.name);
|
|
120634
120715
|
if (isExternalModuleFile || inAmbientModule && !isExternalModuleNameRelative(nameText)) {
|
|
@@ -129876,7 +129957,7 @@ function getNodeKind(node) {
|
|
|
129876
129957
|
case 306 /* EnumMember */:
|
|
129877
129958
|
return "enum member" /* enumMemberElement */;
|
|
129878
129959
|
case 169 /* Parameter */:
|
|
129879
|
-
return hasSyntacticModifier(node,
|
|
129960
|
+
return hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */;
|
|
129880
129961
|
case 271 /* ImportEqualsDeclaration */:
|
|
129881
129962
|
case 276 /* ImportSpecifier */:
|
|
129882
129963
|
case 281 /* ExportSpecifier */:
|
|
@@ -130779,19 +130860,19 @@ function nodeHasTokens(n, sourceFile) {
|
|
|
130779
130860
|
function getNodeModifiers(node, excludeFlags = 0 /* None */) {
|
|
130780
130861
|
const result = [];
|
|
130781
130862
|
const flags = isDeclaration(node) ? getCombinedNodeFlagsAlwaysIncludeJSDoc(node) & ~excludeFlags : 0 /* None */;
|
|
130782
|
-
if (flags &
|
|
130863
|
+
if (flags & 2 /* Private */)
|
|
130783
130864
|
result.push("private" /* privateMemberModifier */);
|
|
130784
|
-
if (flags &
|
|
130865
|
+
if (flags & 4 /* Protected */)
|
|
130785
130866
|
result.push("protected" /* protectedMemberModifier */);
|
|
130786
|
-
if (flags &
|
|
130867
|
+
if (flags & 1 /* Public */)
|
|
130787
130868
|
result.push("public" /* publicMemberModifier */);
|
|
130788
|
-
if (flags &
|
|
130869
|
+
if (flags & 256 /* Static */ || isClassStaticBlockDeclaration(node))
|
|
130789
130870
|
result.push("static" /* staticModifier */);
|
|
130790
|
-
if (flags &
|
|
130871
|
+
if (flags & 64 /* Abstract */)
|
|
130791
130872
|
result.push("abstract" /* abstractModifier */);
|
|
130792
|
-
if (flags &
|
|
130873
|
+
if (flags & 32 /* Export */)
|
|
130793
130874
|
result.push("export" /* exportedModifier */);
|
|
130794
|
-
if (flags &
|
|
130875
|
+
if (flags & 65536 /* Deprecated */)
|
|
130795
130876
|
result.push("deprecated" /* deprecatedModifier */);
|
|
130796
130877
|
if (node.flags & 33554432 /* Ambient */)
|
|
130797
130878
|
result.push("declare" /* ambientModifier */);
|
|
@@ -132169,7 +132250,7 @@ function isNonGlobalDeclaration(declaration) {
|
|
|
132169
132250
|
return isInJSFile(declaration) || !findAncestor(declaration, (d) => isModuleDeclaration(d) && isGlobalScopeAugmentation(d));
|
|
132170
132251
|
}
|
|
132171
132252
|
function isDeprecatedDeclaration(decl) {
|
|
132172
|
-
return !!(getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) &
|
|
132253
|
+
return !!(getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) & 65536 /* Deprecated */);
|
|
132173
132254
|
}
|
|
132174
132255
|
function shouldUseUriStyleNodeCoreModules(file, program) {
|
|
132175
132256
|
const decisionFromFile = firstDefined(file.imports, (node) => {
|
|
@@ -133853,7 +133934,7 @@ var init_documentHighlights = __esm({
|
|
|
133853
133934
|
case 241 /* Block */:
|
|
133854
133935
|
case 296 /* CaseClause */:
|
|
133855
133936
|
case 297 /* DefaultClause */:
|
|
133856
|
-
if (modifierFlag &
|
|
133937
|
+
if (modifierFlag & 64 /* Abstract */ && isClassDeclaration(declaration)) {
|
|
133857
133938
|
return [...declaration.members, declaration];
|
|
133858
133939
|
} else {
|
|
133859
133940
|
return container.statements;
|
|
@@ -133867,12 +133948,12 @@ var init_documentHighlights = __esm({
|
|
|
133867
133948
|
case 264 /* InterfaceDeclaration */:
|
|
133868
133949
|
case 187 /* TypeLiteral */:
|
|
133869
133950
|
const nodes = container.members;
|
|
133870
|
-
if (modifierFlag & (
|
|
133951
|
+
if (modifierFlag & (7 /* AccessibilityModifier */ | 8 /* Readonly */)) {
|
|
133871
133952
|
const constructor = find(container.members, isConstructorDeclaration);
|
|
133872
133953
|
if (constructor) {
|
|
133873
133954
|
return [...nodes, ...constructor.parameters];
|
|
133874
133955
|
}
|
|
133875
|
-
} else if (modifierFlag &
|
|
133956
|
+
} else if (modifierFlag & 64 /* Abstract */) {
|
|
133876
133957
|
return [...nodes, container];
|
|
133877
133958
|
}
|
|
133878
133959
|
return nodes;
|
|
@@ -136366,7 +136447,7 @@ function getItemName(node, name) {
|
|
|
136366
136447
|
case 218 /* FunctionExpression */:
|
|
136367
136448
|
case 263 /* ClassDeclaration */:
|
|
136368
136449
|
case 231 /* ClassExpression */:
|
|
136369
|
-
if (getSyntacticModifierFlags(node) &
|
|
136450
|
+
if (getSyntacticModifierFlags(node) & 2048 /* Default */) {
|
|
136370
136451
|
return "default";
|
|
136371
136452
|
}
|
|
136372
136453
|
return getFunctionOrClassName(node);
|
|
@@ -136516,7 +136597,7 @@ function getFunctionOrClassName(node) {
|
|
|
136516
136597
|
return nodeText(parent2.left).replace(whiteSpaceRegex, "");
|
|
136517
136598
|
} else if (isPropertyAssignment(parent2)) {
|
|
136518
136599
|
return nodeText(parent2.name);
|
|
136519
|
-
} else if (getSyntacticModifierFlags(node) &
|
|
136600
|
+
} else if (getSyntacticModifierFlags(node) & 2048 /* Default */) {
|
|
136520
136601
|
return "default";
|
|
136521
136602
|
} else if (isClassLike(node)) {
|
|
136522
136603
|
return "<class>";
|
|
@@ -136676,15 +136757,15 @@ var require_convertExport = __commonJS({
|
|
|
136676
136757
|
const { file, program } = context;
|
|
136677
136758
|
const span = getRefactorContextSpan(context);
|
|
136678
136759
|
const token = getTokenAtPosition(file, span.start);
|
|
136679
|
-
const exportNode = !!(token.parent && getSyntacticModifierFlags(token.parent) &
|
|
136760
|
+
const exportNode = !!(token.parent && getSyntacticModifierFlags(token.parent) & 32 /* Export */) && considerPartialSpans ? token.parent : getParentNodeInSpan(token, file, span);
|
|
136680
136761
|
if (!exportNode || !isSourceFile(exportNode.parent) && !(isModuleBlock(exportNode.parent) && isAmbientModule(exportNode.parent.parent))) {
|
|
136681
136762
|
return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_export_statement) };
|
|
136682
136763
|
}
|
|
136683
136764
|
const checker = program.getTypeChecker();
|
|
136684
136765
|
const exportingModuleSymbol = getExportingModuleSymbol(exportNode.parent, checker);
|
|
136685
|
-
const flags = getSyntacticModifierFlags(exportNode) || (isExportAssignment(exportNode) && !exportNode.isExportEquals ?
|
|
136686
|
-
const wasDefault = !!(flags &
|
|
136687
|
-
if (!(flags &
|
|
136766
|
+
const flags = getSyntacticModifierFlags(exportNode) || (isExportAssignment(exportNode) && !exportNode.isExportEquals ? 2080 /* ExportDefault */ : 0 /* None */);
|
|
136767
|
+
const wasDefault = !!(flags & 2048 /* Default */);
|
|
136768
|
+
if (!(flags & 32 /* Export */) || !wasDefault && exportingModuleSymbol.exports.has("default" /* Default */)) {
|
|
136688
136769
|
return { error: getLocaleSpecificMessage(Diagnostics.This_file_already_has_a_default_export) };
|
|
136689
136770
|
}
|
|
136690
136771
|
const noSymbolError = (id) => isIdentifier(id) && checker.getSymbolAtLocation(id) ? void 0 : { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_named_export) };
|
|
@@ -137672,7 +137753,7 @@ var require_moveToNewFile = __commonJS({
|
|
|
137672
137753
|
if (markSeenTop(top)) {
|
|
137673
137754
|
addExportToChanges(oldFile, top, name, changes, useEsModuleSyntax);
|
|
137674
137755
|
}
|
|
137675
|
-
if (hasSyntacticModifier(decl,
|
|
137756
|
+
if (hasSyntacticModifier(decl, 2048 /* Default */)) {
|
|
137676
137757
|
oldFileDefault = name;
|
|
137677
137758
|
} else {
|
|
137678
137759
|
oldFileNamedImports.push(name.text);
|
|
@@ -137818,7 +137899,7 @@ function getTargetFileImportsAndAddExportInOldFile(oldFile, targetFile, importsT
|
|
|
137818
137899
|
if (importAdder && checker.isUnknownSymbol(symbol)) {
|
|
137819
137900
|
importAdder.addImportFromExportedSymbol(skipAlias(symbol, checker));
|
|
137820
137901
|
} else {
|
|
137821
|
-
if (hasSyntacticModifier(decl,
|
|
137902
|
+
if (hasSyntacticModifier(decl, 2048 /* Default */)) {
|
|
137822
137903
|
oldFileDefault = name;
|
|
137823
137904
|
} else {
|
|
137824
137905
|
oldFileNamedImports.push(name.text);
|
|
@@ -138058,7 +138139,7 @@ function addExports(sourceFile, toMove, needExport, useEs6Exports) {
|
|
|
138058
138139
|
function isExported(sourceFile, decl, useEs6Exports, name) {
|
|
138059
138140
|
var _a;
|
|
138060
138141
|
if (useEs6Exports) {
|
|
138061
|
-
return !isExpressionStatement(decl) && hasSyntacticModifier(decl,
|
|
138142
|
+
return !isExpressionStatement(decl) && hasSyntacticModifier(decl, 32 /* Export */) || !!(name && sourceFile.symbol && ((_a = sourceFile.symbol.exports) == null ? void 0 : _a.has(name.escapedText)));
|
|
138062
138143
|
}
|
|
138063
138144
|
return !!sourceFile.symbol && !!sourceFile.symbol.exports && getNamesToExportInCommonJS(decl).some((name2) => sourceFile.symbol.exports.has(escapeLeadingUnderscores(name2)));
|
|
138064
138145
|
}
|
|
@@ -138353,7 +138434,7 @@ function isPureImport(node) {
|
|
|
138353
138434
|
case 272 /* ImportDeclaration */:
|
|
138354
138435
|
return true;
|
|
138355
138436
|
case 271 /* ImportEqualsDeclaration */:
|
|
138356
|
-
return !hasSyntacticModifier(node,
|
|
138437
|
+
return !hasSyntacticModifier(node, 32 /* Export */);
|
|
138357
138438
|
case 243 /* VariableStatement */:
|
|
138358
138439
|
return node.declarationList.declarations.every((d) => !!d.initializer && isRequireCall(
|
|
138359
138440
|
d.initializer,
|
|
@@ -138524,7 +138605,7 @@ function moveStatementsToTargetFile(changes, program, statements, targetFile, to
|
|
|
138524
138605
|
const checker = program.getTypeChecker();
|
|
138525
138606
|
const targetToSourceExports = /* @__PURE__ */ new Map();
|
|
138526
138607
|
for (const node of toMove.all) {
|
|
138527
|
-
if (isTopLevelDeclarationStatement(node) && hasSyntacticModifier(node,
|
|
138608
|
+
if (isTopLevelDeclarationStatement(node) && hasSyntacticModifier(node, 32 /* Export */)) {
|
|
138528
138609
|
forEachTopLevelDeclaration(node, (declaration) => {
|
|
138529
138610
|
var _a2;
|
|
138530
138611
|
const targetDeclarations = canHaveSymbol(declaration) ? (_a2 = targetExports.get(declaration.symbol.escapedName)) == null ? void 0 : _a2.declarations : void 0;
|
|
@@ -139190,7 +139271,7 @@ var require_convertArrowFunctionOrFunctionExpression = __commonJS({
|
|
|
139190
139271
|
const body = convertToBlock(func.body);
|
|
139191
139272
|
const { variableDeclaration, variableDeclarationList, statement, name } = variableInfo;
|
|
139192
139273
|
suppressLeadingTrivia(statement);
|
|
139193
|
-
const modifiersFlags = getCombinedModifierFlags(variableDeclaration) &
|
|
139274
|
+
const modifiersFlags = getCombinedModifierFlags(variableDeclaration) & 32 /* Export */ | getEffectiveModifierFlags(func);
|
|
139194
139275
|
const modifiers = factory.createModifiersFromModifierFlags(modifiersFlags);
|
|
139195
139276
|
const newNode = factory.createFunctionDeclaration(length(modifiers) ? modifiers : void 0, func.asteriskToken, name, func.typeParameters, func.parameters, func.type, body);
|
|
139196
139277
|
if (variableDeclarationList.declarations.length === 1) {
|
|
@@ -140529,7 +140610,7 @@ function getRangeToExtract(sourceFile, span, invoked = true) {
|
|
|
140529
140610
|
}
|
|
140530
140611
|
if (isDeclaration(node2)) {
|
|
140531
140612
|
const declaringNode = node2.kind === 260 /* VariableDeclaration */ ? node2.parent.parent : node2;
|
|
140532
|
-
if (hasSyntacticModifier(declaringNode,
|
|
140613
|
+
if (hasSyntacticModifier(declaringNode, 32 /* Export */)) {
|
|
140533
140614
|
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity));
|
|
140534
140615
|
return true;
|
|
140535
140616
|
}
|
|
@@ -141537,7 +141618,7 @@ function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFi
|
|
|
141537
141618
|
usagesPerScope[i].usages.forEach((value) => {
|
|
141538
141619
|
if (value.usage === 2 /* Write */) {
|
|
141539
141620
|
hasWrite = true;
|
|
141540
|
-
if (value.symbol.flags & 106500 /* ClassMember */ && value.symbol.valueDeclaration && hasEffectiveModifier(value.symbol.valueDeclaration,
|
|
141621
|
+
if (value.symbol.flags & 106500 /* ClassMember */ && value.symbol.valueDeclaration && hasEffectiveModifier(value.symbol.valueDeclaration, 8 /* Readonly */)) {
|
|
141541
141622
|
readonlyClassPropertyWrite = value.symbol.valueDeclaration;
|
|
141542
141623
|
}
|
|
141543
141624
|
}
|
|
@@ -142157,14 +142238,14 @@ function collectTokens(program, sourceFile, span, collector, cancellationToken)
|
|
|
142157
142238
|
if (decl) {
|
|
142158
142239
|
const modifiers = getCombinedModifierFlags(decl);
|
|
142159
142240
|
const nodeFlags = getCombinedNodeFlags(decl);
|
|
142160
|
-
if (modifiers &
|
|
142241
|
+
if (modifiers & 256 /* Static */) {
|
|
142161
142242
|
modifierSet |= 1 << 1 /* static */;
|
|
142162
142243
|
}
|
|
142163
|
-
if (modifiers &
|
|
142244
|
+
if (modifiers & 1024 /* Async */) {
|
|
142164
142245
|
modifierSet |= 1 << 2 /* async */;
|
|
142165
142246
|
}
|
|
142166
142247
|
if (typeIdx !== 0 /* class */ && typeIdx !== 2 /* interface */) {
|
|
142167
|
-
if (modifiers &
|
|
142248
|
+
if (modifiers & 8 /* Readonly */ || nodeFlags & 2 /* Const */ || symbol.getFlags() & 8 /* EnumMember */) {
|
|
142168
142249
|
modifierSet |= 1 << 3 /* readonly */;
|
|
142169
142250
|
}
|
|
142170
142251
|
}
|
|
@@ -144296,7 +144377,7 @@ var init_services = __esm({
|
|
|
144296
144377
|
forEachChild(node, visit);
|
|
144297
144378
|
break;
|
|
144298
144379
|
case 169 /* Parameter */:
|
|
144299
|
-
if (!hasSyntacticModifier(node,
|
|
144380
|
+
if (!hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) {
|
|
144300
144381
|
break;
|
|
144301
144382
|
}
|
|
144302
144383
|
case 260 /* VariableDeclaration */:
|
|
@@ -144783,7 +144864,7 @@ function spanInSourceFileAtLocation(sourceFile, position) {
|
|
|
144783
144864
|
if (isBindingPattern(variableDeclaration.name)) {
|
|
144784
144865
|
return spanInBindingPattern(variableDeclaration.name);
|
|
144785
144866
|
}
|
|
144786
|
-
if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration,
|
|
144867
|
+
if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 32 /* Export */) || parent2.parent.kind === 250 /* ForOfStatement */) {
|
|
144787
144868
|
return textSpanFromVariableDeclaration(variableDeclaration);
|
|
144788
144869
|
}
|
|
144789
144870
|
if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) {
|
|
@@ -144791,7 +144872,7 @@ function spanInSourceFileAtLocation(sourceFile, position) {
|
|
|
144791
144872
|
}
|
|
144792
144873
|
}
|
|
144793
144874
|
function canHaveSpanInParameterDeclaration(parameter) {
|
|
144794
|
-
return !!parameter.initializer || parameter.dotDotDotToken !== void 0 || hasSyntacticModifier(parameter,
|
|
144875
|
+
return !!parameter.initializer || parameter.dotDotDotToken !== void 0 || hasSyntacticModifier(parameter, 1 /* Public */ | 2 /* Private */);
|
|
144795
144876
|
}
|
|
144796
144877
|
function spanInParameterDeclaration(parameter) {
|
|
144797
144878
|
if (isBindingPattern(parameter.name)) {
|
|
@@ -144810,7 +144891,7 @@ function spanInSourceFileAtLocation(sourceFile, position) {
|
|
|
144810
144891
|
}
|
|
144811
144892
|
}
|
|
144812
144893
|
function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) {
|
|
144813
|
-
return hasSyntacticModifier(functionDeclaration,
|
|
144894
|
+
return hasSyntacticModifier(functionDeclaration, 32 /* Export */) || functionDeclaration.parent.kind === 263 /* ClassDeclaration */ && functionDeclaration.kind !== 176 /* Constructor */;
|
|
144814
144895
|
}
|
|
144815
144896
|
function spanInFunctionDeclaration(functionDeclaration) {
|
|
144816
144897
|
if (!functionDeclaration.body) {
|
|
@@ -145381,7 +145462,7 @@ function collectCallSitesOfSourceFile(node, collect) {
|
|
|
145381
145462
|
forEach(node.statements, collect);
|
|
145382
145463
|
}
|
|
145383
145464
|
function collectCallSitesOfModuleDeclaration(node, collect) {
|
|
145384
|
-
if (!hasSyntacticModifier(node,
|
|
145465
|
+
if (!hasSyntacticModifier(node, 128 /* Ambient */) && node.body && isModuleBlock(node.body)) {
|
|
145385
145466
|
forEach(node.body.statements, collect);
|
|
145386
145467
|
}
|
|
145387
145468
|
}
|
|
@@ -145726,7 +145807,7 @@ var require_addMissingAsync = __commonJS({
|
|
|
145726
145807
|
/*includeTrivia*/
|
|
145727
145808
|
true
|
|
145728
145809
|
),
|
|
145729
|
-
factory.createNodeArray(factory.createModifiersFromModifierFlags(getSyntacticModifierFlags(insertionSite) |
|
|
145810
|
+
factory.createNodeArray(factory.createModifiersFromModifierFlags(getSyntacticModifierFlags(insertionSite) | 1024 /* Async */))
|
|
145730
145811
|
);
|
|
145731
145812
|
changeTracker.replaceNode(
|
|
145732
145813
|
sourceFile,
|
|
@@ -145858,7 +145939,7 @@ var require_addMissingAwait = __commonJS({
|
|
|
145858
145939
|
const declaration = tryCast(symbol.valueDeclaration, isVariableDeclaration);
|
|
145859
145940
|
const variableName = declaration && tryCast(declaration.name, isIdentifier);
|
|
145860
145941
|
const variableStatement = getAncestor(declaration, 243 /* VariableStatement */);
|
|
145861
|
-
if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement,
|
|
145942
|
+
if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement, 32 /* Export */) || !variableName || !isInsideAwaitableBody(declaration.initializer)) {
|
|
145862
145943
|
isCompleteFix = false;
|
|
145863
145944
|
continue;
|
|
145864
145945
|
}
|
|
@@ -148609,7 +148690,7 @@ var require_fixClassIncorrectlyImplementsInterface = __commonJS({
|
|
|
148609
148690
|
return Debug.checkDefined(getContainingClass(getTokenAtPosition(sourceFile, pos)), "There should be a containing class");
|
|
148610
148691
|
}
|
|
148611
148692
|
function symbolPointsToNonPrivateMember(symbol) {
|
|
148612
|
-
return !symbol.valueDeclaration || !(getEffectiveModifierFlags(symbol.valueDeclaration) &
|
|
148693
|
+
return !symbol.valueDeclaration || !(getEffectiveModifierFlags(symbol.valueDeclaration) & 2 /* Private */);
|
|
148613
148694
|
}
|
|
148614
148695
|
function addMissingDeclarations(context, implementedTypeNode, sourceFile, classDeclaration, changeTracker, preferences) {
|
|
148615
148696
|
const checker = context.program.getTypeChecker();
|
|
@@ -150639,7 +150720,7 @@ var require_fixSpelling = __commonJS({
|
|
|
150639
150720
|
const tag = findAncestor(node, isJsxOpeningLikeElement);
|
|
150640
150721
|
const props = checker.getContextualTypeForArgumentAtIndex(tag, 0);
|
|
150641
150722
|
suggestedSymbol = checker.getSuggestedSymbolForNonexistentJSXAttribute(node, props);
|
|
150642
|
-
} else if (
|
|
150723
|
+
} else if (hasOverrideModifier(parent2) && isClassElement(parent2) && parent2.name === node) {
|
|
150643
150724
|
const baseDeclaration = findAncestor(node, isClassLike);
|
|
150644
150725
|
const baseTypeNode = baseDeclaration ? getEffectiveBaseTypeNode(baseDeclaration) : void 0;
|
|
150645
150726
|
const baseType = baseTypeNode ? checker.getTypeAtLocation(baseTypeNode) : void 0;
|
|
@@ -150820,7 +150901,7 @@ var require_returnValueCorrect = __commonJS({
|
|
|
150820
150901
|
if (isFunctionType) {
|
|
150821
150902
|
const sig = checker.getSignatureFromDeclaration(declaration);
|
|
150822
150903
|
if (sig) {
|
|
150823
|
-
if (hasSyntacticModifier(declaration,
|
|
150904
|
+
if (hasSyntacticModifier(declaration, 1024 /* Async */)) {
|
|
150824
150905
|
exprType = checker.createPromiseType(exprType);
|
|
150825
150906
|
}
|
|
150826
150907
|
const newSig = checker.createSignature(
|
|
@@ -151041,13 +151122,13 @@ var require_fixAddMissingMember = __commonJS({
|
|
|
151041
151122
|
continue;
|
|
151042
151123
|
const { parentDeclaration, declSourceFile, modifierFlags, token, call, isJSFile } = info;
|
|
151043
151124
|
if (call && !isPrivateIdentifier(token)) {
|
|
151044
|
-
addMethodDeclaration(context, changes, call, token, modifierFlags &
|
|
151125
|
+
addMethodDeclaration(context, changes, call, token, modifierFlags & 256 /* Static */, parentDeclaration, declSourceFile);
|
|
151045
151126
|
} else {
|
|
151046
151127
|
if (isJSFile && !isInterfaceDeclaration(parentDeclaration) && !isTypeLiteralNode(parentDeclaration)) {
|
|
151047
|
-
addMissingMemberInJs(changes, declSourceFile, parentDeclaration, token, !!(modifierFlags &
|
|
151128
|
+
addMissingMemberInJs(changes, declSourceFile, parentDeclaration, token, !!(modifierFlags & 256 /* Static */));
|
|
151048
151129
|
} else {
|
|
151049
151130
|
const typeNode = getTypeNode2(checker, parentDeclaration, token);
|
|
151050
|
-
addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, modifierFlags &
|
|
151131
|
+
addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, modifierFlags & 256 /* Static */);
|
|
151051
151132
|
}
|
|
151052
151133
|
}
|
|
151053
151134
|
}
|
|
@@ -151128,13 +151209,13 @@ var require_fixAddMissingMember = __commonJS({
|
|
|
151128
151209
|
const moduleDeclaration = find(symbol.declarations, isModuleDeclaration);
|
|
151129
151210
|
const moduleDeclarationSourceFile = moduleDeclaration == null ? void 0 : moduleDeclaration.getSourceFile();
|
|
151130
151211
|
if (moduleDeclaration && moduleDeclarationSourceFile && !isSourceFileFromLibrary(program, moduleDeclarationSourceFile)) {
|
|
151131
|
-
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile, modifierFlags:
|
|
151212
|
+
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile, modifierFlags: 32 /* Export */, parentDeclaration: moduleDeclaration };
|
|
151132
151213
|
}
|
|
151133
151214
|
const moduleSourceFile = find(symbol.declarations, isSourceFile);
|
|
151134
151215
|
if (sourceFile.commonJsModuleIndicator)
|
|
151135
151216
|
return void 0;
|
|
151136
151217
|
if (moduleSourceFile && !isSourceFileFromLibrary(program, moduleSourceFile)) {
|
|
151137
|
-
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile: moduleSourceFile, modifierFlags:
|
|
151218
|
+
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile: moduleSourceFile, modifierFlags: 32 /* Export */, parentDeclaration: moduleSourceFile };
|
|
151138
151219
|
}
|
|
151139
151220
|
}
|
|
151140
151221
|
const classDeclaration = find(symbol.declarations, isClassLike);
|
|
@@ -151146,7 +151227,7 @@ var require_fixAddMissingMember = __commonJS({
|
|
|
151146
151227
|
if (makeStatic && (isPrivateIdentifier(token) || isInterfaceDeclaration(declaration)))
|
|
151147
151228
|
return void 0;
|
|
151148
151229
|
const declSourceFile = declaration.getSourceFile();
|
|
151149
|
-
const modifierFlags = isTypeLiteralNode(declaration) ? 0 /* None */ : (makeStatic ?
|
|
151230
|
+
const modifierFlags = isTypeLiteralNode(declaration) ? 0 /* None */ : (makeStatic ? 256 /* Static */ : 0 /* None */) | (startsWithUnderscore(token.text) ? 2 /* Private */ : 0 /* None */);
|
|
151150
151231
|
const isJSFile = isSourceFileJS(declSourceFile);
|
|
151151
151232
|
const call = tryCast(parent2.parent, isCallExpression);
|
|
151152
151233
|
return { kind: 0 /* TypeLikeDeclaration */, token, call, modifierFlags, parentDeclaration: declaration, declSourceFile, isJSFile };
|
|
@@ -151164,11 +151245,11 @@ var require_fixAddMissingMember = __commonJS({
|
|
|
151164
151245
|
if (isInterfaceDeclaration(parentDeclaration) || isTypeLiteralNode(parentDeclaration)) {
|
|
151165
151246
|
return void 0;
|
|
151166
151247
|
}
|
|
151167
|
-
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addMissingMemberInJs(t, declSourceFile, parentDeclaration, token, !!(modifierFlags &
|
|
151248
|
+
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addMissingMemberInJs(t, declSourceFile, parentDeclaration, token, !!(modifierFlags & 256 /* Static */)));
|
|
151168
151249
|
if (changes.length === 0) {
|
|
151169
151250
|
return void 0;
|
|
151170
151251
|
}
|
|
151171
|
-
const diagnostic = modifierFlags &
|
|
151252
|
+
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;
|
|
151172
151253
|
return createCodeFixAction(fixMissingMember, changes, [diagnostic, token.text], fixMissingMember, Diagnostics.Add_all_missing_members);
|
|
151173
151254
|
}
|
|
151174
151255
|
function addMissingMemberInJs(changeTracker, sourceFile, classDeclaration, token, makeStatic) {
|
|
@@ -151212,15 +151293,15 @@ var require_fixAddMissingMember = __commonJS({
|
|
|
151212
151293
|
}
|
|
151213
151294
|
function createActionsForAddMissingMemberInTypeScriptFile(context, { parentDeclaration, declSourceFile, modifierFlags, token }) {
|
|
151214
151295
|
const memberName = token.text;
|
|
151215
|
-
const isStatic2 = modifierFlags &
|
|
151296
|
+
const isStatic2 = modifierFlags & 256 /* Static */;
|
|
151216
151297
|
const typeNode = getTypeNode2(context.program.getTypeChecker(), parentDeclaration, token);
|
|
151217
151298
|
const addPropertyDeclarationChanges = (modifierFlags2) => ts_textChanges_exports.ChangeTracker.with(context, (t) => addPropertyDeclaration(t, declSourceFile, parentDeclaration, memberName, typeNode, modifierFlags2));
|
|
151218
|
-
const actions2 = [createCodeFixAction(fixMissingMember, addPropertyDeclarationChanges(modifierFlags &
|
|
151299
|
+
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)];
|
|
151219
151300
|
if (isStatic2 || isPrivateIdentifier(token)) {
|
|
151220
151301
|
return actions2;
|
|
151221
151302
|
}
|
|
151222
|
-
if (modifierFlags &
|
|
151223
|
-
actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addPropertyDeclarationChanges(
|
|
151303
|
+
if (modifierFlags & 2 /* Private */) {
|
|
151304
|
+
actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addPropertyDeclarationChanges(2 /* Private */), [Diagnostics.Declare_private_property_0, memberName]));
|
|
151224
151305
|
}
|
|
151225
151306
|
actions2.push(createAddIndexSignatureAction(context, declSourceFile, parentDeclaration, token.text, typeNode));
|
|
151226
151307
|
return actions2;
|
|
@@ -151307,9 +151388,9 @@ var require_fixAddMissingMember = __commonJS({
|
|
|
151307
151388
|
}
|
|
151308
151389
|
const methodName = token.text;
|
|
151309
151390
|
const addMethodDeclarationChanges = (modifierFlags2) => ts_textChanges_exports.ChangeTracker.with(context, (t) => addMethodDeclaration(context, t, call, token, modifierFlags2, parentDeclaration, declSourceFile));
|
|
151310
|
-
const actions2 = [createCodeFixAction(fixMissingMember, addMethodDeclarationChanges(modifierFlags &
|
|
151311
|
-
if (modifierFlags &
|
|
151312
|
-
actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addMethodDeclarationChanges(
|
|
151391
|
+
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)];
|
|
151392
|
+
if (modifierFlags & 2 /* Private */) {
|
|
151393
|
+
actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addMethodDeclarationChanges(2 /* Private */), [Diagnostics.Declare_private_method_0, methodName]));
|
|
151313
151394
|
}
|
|
151314
151395
|
return actions2;
|
|
151315
151396
|
}
|
|
@@ -151746,7 +151827,7 @@ var require_fixClassDoesntImplementInheritedAbstractMember = __commonJS({
|
|
|
151746
151827
|
}
|
|
151747
151828
|
function symbolPointsToNonPrivateAndAbstractMember(symbol) {
|
|
151748
151829
|
const flags = getSyntacticModifierFlags(first(symbol.getDeclarations()));
|
|
151749
|
-
return !(flags &
|
|
151830
|
+
return !(flags & 2 /* Private */) && !!(flags & 64 /* Abstract */);
|
|
151750
151831
|
}
|
|
151751
151832
|
}
|
|
151752
151833
|
});
|
|
@@ -154223,10 +154304,10 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
|
|
|
154223
154304
|
const kind = (declaration == null ? void 0 : declaration.kind) ?? 171 /* PropertySignature */;
|
|
154224
154305
|
const declarationName = createDeclarationName(symbol, declaration);
|
|
154225
154306
|
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
|
|
154226
|
-
let modifierFlags = effectiveModifierFlags &
|
|
154227
|
-
modifierFlags |= effectiveModifierFlags &
|
|
154307
|
+
let modifierFlags = effectiveModifierFlags & 256 /* Static */;
|
|
154308
|
+
modifierFlags |= effectiveModifierFlags & 1 /* Public */ ? 1 /* Public */ : effectiveModifierFlags & 4 /* Protected */ ? 4 /* Protected */ : 0 /* None */;
|
|
154228
154309
|
if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
|
|
154229
|
-
modifierFlags |=
|
|
154310
|
+
modifierFlags |= 512 /* Accessor */;
|
|
154230
154311
|
}
|
|
154231
154312
|
const modifiers = createModifiers();
|
|
154232
154313
|
const type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration));
|
|
@@ -154905,24 +154986,24 @@ function createAccessorAccessExpression(fieldName, isStatic2, container) {
|
|
|
154905
154986
|
return isIdentifier(fieldName) ? factory.createPropertyAccessExpression(leftHead, fieldName) : factory.createElementAccessExpression(leftHead, factory.createStringLiteralFromNode(fieldName));
|
|
154906
154987
|
}
|
|
154907
154988
|
function prepareModifierFlagsForAccessor(modifierFlags) {
|
|
154908
|
-
modifierFlags &= ~
|
|
154909
|
-
modifierFlags &= ~
|
|
154910
|
-
if (!(modifierFlags &
|
|
154911
|
-
modifierFlags |=
|
|
154989
|
+
modifierFlags &= ~8 /* Readonly */;
|
|
154990
|
+
modifierFlags &= ~2 /* Private */;
|
|
154991
|
+
if (!(modifierFlags & 4 /* Protected */)) {
|
|
154992
|
+
modifierFlags |= 1 /* Public */;
|
|
154912
154993
|
}
|
|
154913
154994
|
return modifierFlags;
|
|
154914
154995
|
}
|
|
154915
154996
|
function prepareModifierFlagsForField(modifierFlags) {
|
|
154916
|
-
modifierFlags &= ~
|
|
154917
|
-
modifierFlags &= ~
|
|
154918
|
-
modifierFlags |=
|
|
154997
|
+
modifierFlags &= ~1 /* Public */;
|
|
154998
|
+
modifierFlags &= ~4 /* Protected */;
|
|
154999
|
+
modifierFlags |= 2 /* Private */;
|
|
154919
155000
|
return modifierFlags;
|
|
154920
155001
|
}
|
|
154921
155002
|
function getAccessorConvertiblePropertyAtPosition(file, program, start2, end, considerEmptySpans = true) {
|
|
154922
155003
|
const node = getTokenAtPosition(file, start2);
|
|
154923
155004
|
const cursorRequest = start2 === end && considerEmptySpans;
|
|
154924
155005
|
const declaration = findAncestor(node.parent, isAcceptedDeclaration);
|
|
154925
|
-
const meaning =
|
|
155006
|
+
const meaning = 7 /* AccessibilityModifier */ | 256 /* Static */ | 8 /* Readonly */;
|
|
154926
155007
|
if (!declaration || !(nodeOverlapsWithStartEnd(declaration.name, file, start2, end) || cursorRequest)) {
|
|
154927
155008
|
return {
|
|
154928
155009
|
error: getLocaleSpecificMessage(Diagnostics.Could_not_find_property_for_which_to_generate_accessor)
|
|
@@ -154933,7 +155014,7 @@ function getAccessorConvertiblePropertyAtPosition(file, program, start2, end, co
|
|
|
154933
155014
|
error: getLocaleSpecificMessage(Diagnostics.Name_is_not_valid)
|
|
154934
155015
|
};
|
|
154935
155016
|
}
|
|
154936
|
-
if ((getEffectiveModifierFlags(declaration) &
|
|
155017
|
+
if ((getEffectiveModifierFlags(declaration) & 98303 /* Modifier */ | meaning) !== meaning) {
|
|
154937
155018
|
return {
|
|
154938
155019
|
error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_property_with_modifier)
|
|
154939
155020
|
};
|
|
@@ -155321,7 +155402,7 @@ var require_fixStrictClassInitialization = __commonJS({
|
|
|
155321
155402
|
return firstDefined(type.types, (t) => getDefaultValueFromType(checker, t));
|
|
155322
155403
|
} else if (type.isClass()) {
|
|
155323
155404
|
const classDeclaration = getClassLikeDeclarationOfSymbol(type.symbol);
|
|
155324
|
-
if (!classDeclaration || hasSyntacticModifier(classDeclaration,
|
|
155405
|
+
if (!classDeclaration || hasSyntacticModifier(classDeclaration, 64 /* Abstract */))
|
|
155325
155406
|
return void 0;
|
|
155326
155407
|
const constructorDeclaration = getFirstConstructorWithBody(classDeclaration);
|
|
155327
155408
|
if (constructorDeclaration && constructorDeclaration.parameters.length)
|
|
@@ -157177,7 +157258,7 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
157177
157258
|
}
|
|
157178
157259
|
let modifiers = 0 /* None */;
|
|
157179
157260
|
const { modifiers: presentModifiers, range: eraseRange, decorators: presentDecorators } = getPresentModifiers(contextToken, sourceFile, position);
|
|
157180
|
-
const isAbstract = presentModifiers &
|
|
157261
|
+
const isAbstract = presentModifiers & 64 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 64 /* Abstract */;
|
|
157181
157262
|
let completionNodes = [];
|
|
157182
157263
|
ts_codefix_exports.addNewNodeForMemberSymbol(
|
|
157183
157264
|
symbol,
|
|
@@ -157196,10 +157277,10 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
157196
157277
|
(node) => {
|
|
157197
157278
|
let requiredModifiers = 0 /* None */;
|
|
157198
157279
|
if (isAbstract) {
|
|
157199
|
-
requiredModifiers |=
|
|
157280
|
+
requiredModifiers |= 64 /* Abstract */;
|
|
157200
157281
|
}
|
|
157201
157282
|
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) {
|
|
157202
|
-
requiredModifiers |=
|
|
157283
|
+
requiredModifiers |= 16 /* Override */;
|
|
157203
157284
|
}
|
|
157204
157285
|
if (!completionNodes.length) {
|
|
157205
157286
|
modifiers = node.modifierFlagsCache | requiredModifiers;
|
|
@@ -157213,21 +157294,21 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
157213
157294
|
);
|
|
157214
157295
|
if (completionNodes.length) {
|
|
157215
157296
|
const isMethod = symbol.flags & 8192 /* Method */;
|
|
157216
|
-
let allowedModifiers = modifiers |
|
|
157297
|
+
let allowedModifiers = modifiers | 16 /* Override */ | 1 /* Public */;
|
|
157217
157298
|
if (!isMethod) {
|
|
157218
|
-
allowedModifiers |=
|
|
157299
|
+
allowedModifiers |= 128 /* Ambient */ | 8 /* Readonly */;
|
|
157219
157300
|
} else {
|
|
157220
|
-
allowedModifiers |=
|
|
157301
|
+
allowedModifiers |= 1024 /* Async */;
|
|
157221
157302
|
}
|
|
157222
157303
|
const allowedAndPresent = presentModifiers & allowedModifiers;
|
|
157223
157304
|
if (presentModifiers & ~allowedModifiers) {
|
|
157224
157305
|
return void 0;
|
|
157225
157306
|
}
|
|
157226
|
-
if (modifiers &
|
|
157227
|
-
modifiers &= ~
|
|
157307
|
+
if (modifiers & 4 /* Protected */ && allowedAndPresent & 1 /* Public */) {
|
|
157308
|
+
modifiers &= ~4 /* Protected */;
|
|
157228
157309
|
}
|
|
157229
|
-
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent &
|
|
157230
|
-
modifiers &= ~
|
|
157310
|
+
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 1 /* Public */)) {
|
|
157311
|
+
modifiers &= ~1 /* Public */;
|
|
157231
157312
|
}
|
|
157232
157313
|
modifiers |= allowedAndPresent;
|
|
157233
157314
|
completionNodes = completionNodes.map((node) => factory.replaceModifiers(node, modifiers));
|
|
@@ -157264,7 +157345,7 @@ function getPresentModifiers(contextToken, sourceFile, position) {
|
|
|
157264
157345
|
let contextMod;
|
|
157265
157346
|
const range = { pos: position, end: position };
|
|
157266
157347
|
if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) {
|
|
157267
|
-
modifiers |= modifiersToFlags(contextToken.parent.modifiers) &
|
|
157348
|
+
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 98303 /* Modifier */;
|
|
157268
157349
|
decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
|
|
157269
157350
|
range.pos = Math.min(range.pos, contextToken.parent.modifiers.pos);
|
|
157270
157351
|
}
|
|
@@ -159005,24 +159086,24 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
159005
159086
|
if (contextToken.kind === 80 /* Identifier */ && !isCurrentlyEditingNode(contextToken)) {
|
|
159006
159087
|
switch (contextToken.getText()) {
|
|
159007
159088
|
case "private":
|
|
159008
|
-
classElementModifierFlags = classElementModifierFlags |
|
|
159089
|
+
classElementModifierFlags = classElementModifierFlags | 2 /* Private */;
|
|
159009
159090
|
break;
|
|
159010
159091
|
case "static":
|
|
159011
|
-
classElementModifierFlags = classElementModifierFlags |
|
|
159092
|
+
classElementModifierFlags = classElementModifierFlags | 256 /* Static */;
|
|
159012
159093
|
break;
|
|
159013
159094
|
case "override":
|
|
159014
|
-
classElementModifierFlags = classElementModifierFlags |
|
|
159095
|
+
classElementModifierFlags = classElementModifierFlags | 16 /* Override */;
|
|
159015
159096
|
break;
|
|
159016
159097
|
}
|
|
159017
159098
|
}
|
|
159018
159099
|
if (isClassStaticBlockDeclaration(classElement)) {
|
|
159019
|
-
classElementModifierFlags |=
|
|
159100
|
+
classElementModifierFlags |= 256 /* Static */;
|
|
159020
159101
|
}
|
|
159021
|
-
if (!(classElementModifierFlags &
|
|
159022
|
-
const baseTypeNodes = isClassLike(decl) && classElementModifierFlags &
|
|
159102
|
+
if (!(classElementModifierFlags & 2 /* Private */)) {
|
|
159103
|
+
const baseTypeNodes = isClassLike(decl) && classElementModifierFlags & 16 /* Override */ ? singleElementArray(getEffectiveBaseTypeNode(decl)) : getAllSuperTypeNodes(decl);
|
|
159023
159104
|
const baseSymbols = flatMap(baseTypeNodes, (baseTypeNode) => {
|
|
159024
159105
|
const type = typeChecker.getTypeAtLocation(baseTypeNode);
|
|
159025
|
-
return classElementModifierFlags &
|
|
159106
|
+
return classElementModifierFlags & 256 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type);
|
|
159026
159107
|
});
|
|
159027
159108
|
symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags));
|
|
159028
159109
|
forEach(symbols, (symbol, index) => {
|
|
@@ -159325,10 +159406,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
159325
159406
|
if (isCurrentlyEditingNode(m)) {
|
|
159326
159407
|
continue;
|
|
159327
159408
|
}
|
|
159328
|
-
if (hasEffectiveModifier(m,
|
|
159409
|
+
if (hasEffectiveModifier(m, 2 /* Private */)) {
|
|
159329
159410
|
continue;
|
|
159330
159411
|
}
|
|
159331
|
-
if (isStatic(m) !== !!(currentClassElementModifierFlags &
|
|
159412
|
+
if (isStatic(m) !== !!(currentClassElementModifierFlags & 256 /* Static */)) {
|
|
159332
159413
|
continue;
|
|
159333
159414
|
}
|
|
159334
159415
|
const existingName = getPropertyNameForPropertyNameNode(m.name);
|
|
@@ -159337,7 +159418,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
159337
159418
|
}
|
|
159338
159419
|
}
|
|
159339
159420
|
return baseSymbols.filter(
|
|
159340
|
-
(propertySymbol) => !existingMemberNames.has(propertySymbol.escapedName) && !!propertySymbol.declarations && !(getDeclarationModifierFlagsFromSymbol(propertySymbol) &
|
|
159421
|
+
(propertySymbol) => !existingMemberNames.has(propertySymbol.escapedName) && !!propertySymbol.declarations && !(getDeclarationModifierFlagsFromSymbol(propertySymbol) & 2 /* Private */) && !(propertySymbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(propertySymbol.valueDeclaration))
|
|
159341
159422
|
);
|
|
159342
159423
|
}
|
|
159343
159424
|
function filterJsxAttributes(symbols2, attributes) {
|
|
@@ -159586,7 +159667,7 @@ function getApparentProperties(type, node, checker) {
|
|
|
159586
159667
|
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()))));
|
|
159587
159668
|
}
|
|
159588
159669
|
function containsNonPublicProperties(props) {
|
|
159589
|
-
return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) &
|
|
159670
|
+
return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */));
|
|
159590
159671
|
}
|
|
159591
159672
|
function getPropertiesForCompletion(type, checker) {
|
|
159592
159673
|
return type.isUnion() ? Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type.types), "getAllPossiblePropertiesOfTypes() should all be defined") : Debug.checkEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined");
|
|
@@ -159746,7 +159827,7 @@ function isProbablyGlobalType(type, sourceFile, checker) {
|
|
|
159746
159827
|
return false;
|
|
159747
159828
|
}
|
|
159748
159829
|
function isStaticProperty(symbol) {
|
|
159749
|
-
return !!(symbol.valueDeclaration && getEffectiveModifierFlags(symbol.valueDeclaration) &
|
|
159830
|
+
return !!(symbol.valueDeclaration && getEffectiveModifierFlags(symbol.valueDeclaration) & 256 /* Static */ && isClassLike(symbol.valueDeclaration.parent));
|
|
159750
159831
|
}
|
|
159751
159832
|
function tryGetObjectLiteralContextualType(node, typeChecker) {
|
|
159752
159833
|
const type = typeChecker.getContextualType(node);
|
|
@@ -160957,7 +161038,7 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, {
|
|
|
160957
161038
|
handleNamespaceImport(
|
|
160958
161039
|
direct,
|
|
160959
161040
|
direct.name,
|
|
160960
|
-
hasSyntacticModifier(direct,
|
|
161041
|
+
hasSyntacticModifier(direct, 32 /* Export */),
|
|
160961
161042
|
/*alreadyAddedDirect*/
|
|
160962
161043
|
false
|
|
160963
161044
|
);
|
|
@@ -161272,7 +161353,7 @@ function getImportOrExportSymbol(node, symbol, checker, comingFromExport) {
|
|
|
161272
161353
|
}
|
|
161273
161354
|
} else {
|
|
161274
161355
|
const exportNode = getExportNode(parent2, node);
|
|
161275
|
-
if (exportNode && hasSyntacticModifier(exportNode,
|
|
161356
|
+
if (exportNode && hasSyntacticModifier(exportNode, 32 /* Export */)) {
|
|
161276
161357
|
if (isImportEqualsDeclaration(exportNode) && exportNode.moduleReference === node) {
|
|
161277
161358
|
if (comingFromExport) {
|
|
161278
161359
|
return void 0;
|
|
@@ -161349,7 +161430,7 @@ function getImportOrExportSymbol(node, symbol, checker, comingFromExport) {
|
|
|
161349
161430
|
return exportInfo2 && { kind: 1 /* Export */, symbol: symbol2, exportInfo: exportInfo2 };
|
|
161350
161431
|
}
|
|
161351
161432
|
function getExportKindForDeclaration(node2) {
|
|
161352
|
-
return hasSyntacticModifier(node2,
|
|
161433
|
+
return hasSyntacticModifier(node2, 2048 /* Default */) ? 1 /* Default */ : 0 /* Named */;
|
|
161353
161434
|
}
|
|
161354
161435
|
}
|
|
161355
161436
|
function getExportEqualsLocalSymbol(importedSymbol, checker) {
|
|
@@ -161493,7 +161574,7 @@ function getContextNodeForNodeEntry(node) {
|
|
|
161493
161574
|
if (node.parent.name === node || // node is name of declaration, use parent
|
|
161494
161575
|
isConstructorDeclaration(node.parent) || isExportAssignment(node.parent) || // Property name of the import export specifier or binding pattern, use parent
|
|
161495
161576
|
(isImportOrExportSpecifier(node.parent) || isBindingElement(node.parent)) && node.parent.propertyName === node || // Is default export
|
|
161496
|
-
node.kind === 90 /* DefaultKeyword */ && hasSyntacticModifier(node.parent,
|
|
161577
|
+
node.kind === 90 /* DefaultKeyword */ && hasSyntacticModifier(node.parent, 2080 /* ExportDefault */)) {
|
|
161497
161578
|
return getContextNode(node.parent);
|
|
161498
161579
|
}
|
|
161499
161580
|
return void 0;
|
|
@@ -162476,7 +162557,7 @@ var init_findAllReferences = __esm({
|
|
|
162476
162557
|
return void 0;
|
|
162477
162558
|
}
|
|
162478
162559
|
if (flags & (4 /* Property */ | 8192 /* Method */)) {
|
|
162479
|
-
const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d,
|
|
162560
|
+
const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d, 2 /* Private */) || isPrivateIdentifierClassElementDeclaration(d));
|
|
162480
162561
|
if (privateDeclaration) {
|
|
162481
162562
|
return getAncestor(privateDeclaration, 263 /* ClassDeclaration */);
|
|
162482
162563
|
}
|
|
@@ -162986,7 +163067,7 @@ var init_findAllReferences = __esm({
|
|
|
162986
163067
|
if (!searchSpaceNode) {
|
|
162987
163068
|
return void 0;
|
|
162988
163069
|
}
|
|
162989
|
-
let staticFlag =
|
|
163070
|
+
let staticFlag = 256 /* Static */;
|
|
162990
163071
|
switch (searchSpaceNode.kind) {
|
|
162991
163072
|
case 172 /* PropertyDeclaration */:
|
|
162992
163073
|
case 171 /* PropertySignature */:
|
|
@@ -163026,7 +163107,7 @@ var init_findAllReferences = __esm({
|
|
|
163026
163107
|
/*includeClassComputedPropertyName*/
|
|
163027
163108
|
false
|
|
163028
163109
|
);
|
|
163029
|
-
let staticFlag =
|
|
163110
|
+
let staticFlag = 256 /* Static */;
|
|
163030
163111
|
switch (searchSpaceNode.kind) {
|
|
163031
163112
|
case 174 /* MethodDeclaration */:
|
|
163032
163113
|
case 173 /* MethodSignature */:
|
|
@@ -163268,7 +163349,7 @@ var init_findAllReferences = __esm({
|
|
|
163268
163349
|
if (!symbol.valueDeclaration)
|
|
163269
163350
|
return false;
|
|
163270
163351
|
const modifierFlags = getEffectiveModifierFlags(symbol.valueDeclaration);
|
|
163271
|
-
return !!(modifierFlags &
|
|
163352
|
+
return !!(modifierFlags & 256 /* Static */);
|
|
163272
163353
|
}
|
|
163273
163354
|
function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) {
|
|
163274
163355
|
const { checker } = state;
|
|
@@ -163824,7 +163905,7 @@ function isDefinitionVisible(checker, declaration) {
|
|
|
163824
163905
|
case 177 /* GetAccessor */:
|
|
163825
163906
|
case 178 /* SetAccessor */:
|
|
163826
163907
|
case 174 /* MethodDeclaration */:
|
|
163827
|
-
if (hasEffectiveModifier(declaration,
|
|
163908
|
+
if (hasEffectiveModifier(declaration, 2 /* Private */))
|
|
163828
163909
|
return false;
|
|
163829
163910
|
case 176 /* Constructor */:
|
|
163830
163911
|
case 303 /* PropertyAssignment */:
|
|
@@ -167024,7 +167105,7 @@ function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeCheck
|
|
|
167024
167105
|
function getNormalizedSymbolModifiers(symbol) {
|
|
167025
167106
|
if (symbol.declarations && symbol.declarations.length) {
|
|
167026
167107
|
const [declaration, ...declarations] = symbol.declarations;
|
|
167027
|
-
const excludeFlags = length(declarations) && isDeprecatedDeclaration(declaration) && some(declarations, (d) => !isDeprecatedDeclaration(d)) ?
|
|
167108
|
+
const excludeFlags = length(declarations) && isDeprecatedDeclaration(declaration) && some(declarations, (d) => !isDeprecatedDeclaration(d)) ? 65536 /* Deprecated */ : 0 /* None */;
|
|
167028
167109
|
const modifiers = getNodeModifiers(declaration, excludeFlags);
|
|
167029
167110
|
if (modifiers) {
|
|
167030
167111
|
return modifiers.split(",");
|
|
@@ -167300,7 +167381,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb
|
|
|
167300
167381
|
const resolvedNode = resolvedSymbol.declarations[0];
|
|
167301
167382
|
const declarationName = getNameOfDeclaration(resolvedNode);
|
|
167302
167383
|
if (declarationName && !hasAddedSymbolInfo) {
|
|
167303
|
-
const isExternalModuleDeclaration = isModuleWithStringLiteralName(resolvedNode) && hasSyntacticModifier(resolvedNode,
|
|
167384
|
+
const isExternalModuleDeclaration = isModuleWithStringLiteralName(resolvedNode) && hasSyntacticModifier(resolvedNode, 128 /* Ambient */);
|
|
167304
167385
|
const shouldUseAliasName = symbol.name !== "default" && !isExternalModuleDeclaration;
|
|
167305
167386
|
const resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
|
|
167306
167387
|
typeChecker,
|