typescript 5.3.0-dev.20231025 → 5.3.0-dev.20231026
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 +443 -391
- package/lib/tsserver.js +546 -494
- package/lib/typescript.d.ts +26 -25
- package/lib/typescript.js +546 -494
- package/lib/typingsInstaller.js +108 -85
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -56,7 +56,7 @@ var ts = (() => {
|
|
|
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.20231026`;
|
|
60
60
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
61
61
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
62
62
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3971,32 +3971,43 @@ ${lanes.join("\n")}
|
|
|
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) => {
|
|
@@ -11497,7 +11508,7 @@ ${lanes.join("\n")}
|
|
|
11497
11508
|
}
|
|
11498
11509
|
}
|
|
11499
11510
|
function isParameterPropertyDeclaration(node, parent2) {
|
|
11500
|
-
return isParameter(node) && hasSyntacticModifier(node,
|
|
11511
|
+
return isParameter(node) && hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) && parent2.kind === 176 /* Constructor */;
|
|
11501
11512
|
}
|
|
11502
11513
|
function isEmptyBindingPattern(node) {
|
|
11503
11514
|
if (isBindingPattern(node)) {
|
|
@@ -11786,7 +11797,7 @@ ${lanes.join("\n")}
|
|
|
11786
11797
|
}
|
|
11787
11798
|
}
|
|
11788
11799
|
function getModifiers(node) {
|
|
11789
|
-
if (hasSyntacticModifier(node,
|
|
11800
|
+
if (hasSyntacticModifier(node, 98303 /* Modifier */)) {
|
|
11790
11801
|
return filter(node.modifiers, isModifier);
|
|
11791
11802
|
}
|
|
11792
11803
|
}
|
|
@@ -12220,7 +12231,7 @@ ${lanes.join("\n")}
|
|
|
12220
12231
|
return false;
|
|
12221
12232
|
}
|
|
12222
12233
|
function isParameterPropertyModifier(kind) {
|
|
12223
|
-
return !!(modifierToFlag(kind) &
|
|
12234
|
+
return !!(modifierToFlag(kind) & 31 /* ParameterPropertyModifier */);
|
|
12224
12235
|
}
|
|
12225
12236
|
function isClassMemberModifier(idToken) {
|
|
12226
12237
|
return isParameterPropertyModifier(idToken) || idToken === 126 /* StaticKeyword */ || idToken === 164 /* OverrideKeyword */ || idToken === 129 /* AccessorKeyword */;
|
|
@@ -12584,10 +12595,10 @@ ${lanes.join("\n")}
|
|
|
12584
12595
|
return some(statements, isScopeMarker);
|
|
12585
12596
|
}
|
|
12586
12597
|
function needsScopeMarker(result) {
|
|
12587
|
-
return !isAnyImportOrReExport(result) && !isExportAssignment(result) && !hasSyntacticModifier(result,
|
|
12598
|
+
return !isAnyImportOrReExport(result) && !isExportAssignment(result) && !hasSyntacticModifier(result, 32 /* Export */) && !isAmbientModule(result);
|
|
12588
12599
|
}
|
|
12589
12600
|
function isExternalModuleIndicator(result) {
|
|
12590
|
-
return isAnyImportOrReExport(result) || isExportAssignment(result) || hasSyntacticModifier(result,
|
|
12601
|
+
return isAnyImportOrReExport(result) || isExportAssignment(result) || hasSyntacticModifier(result, 32 /* Export */);
|
|
12591
12602
|
}
|
|
12592
12603
|
function isForInOrOfStatement(node) {
|
|
12593
12604
|
return node.kind === 249 /* ForInStatement */ || node.kind === 250 /* ForOfStatement */;
|
|
@@ -13463,7 +13474,7 @@ ${lanes.join("\n")}
|
|
|
13463
13474
|
return false;
|
|
13464
13475
|
}
|
|
13465
13476
|
function isAmbientPropertyDeclaration(node) {
|
|
13466
|
-
return !!(node.flags & 33554432 /* Ambient */) || hasSyntacticModifier(node,
|
|
13477
|
+
return !!(node.flags & 33554432 /* Ambient */) || hasSyntacticModifier(node, 128 /* Ambient */);
|
|
13467
13478
|
}
|
|
13468
13479
|
function isBlockScope(node, parentNode) {
|
|
13469
13480
|
switch (node.kind) {
|
|
@@ -13816,10 +13827,10 @@ ${lanes.join("\n")}
|
|
|
13816
13827
|
return file.scriptKind === 6 /* JSON */;
|
|
13817
13828
|
}
|
|
13818
13829
|
function isEnumConst(node) {
|
|
13819
|
-
return !!(getCombinedModifierFlags(node) &
|
|
13830
|
+
return !!(getCombinedModifierFlags(node) & 4096 /* Const */);
|
|
13820
13831
|
}
|
|
13821
13832
|
function isDeclarationReadonly(declaration) {
|
|
13822
|
-
return !!(getCombinedModifierFlags(declaration) &
|
|
13833
|
+
return !!(getCombinedModifierFlags(declaration) & 8 /* Readonly */ && !isParameterPropertyDeclaration(declaration, declaration.parent));
|
|
13823
13834
|
}
|
|
13824
13835
|
function isVarAwaitUsing(node) {
|
|
13825
13836
|
return (getCombinedNodeFlags(node) & 7 /* BlockScoped */) === 6 /* AwaitUsing */;
|
|
@@ -15548,7 +15559,7 @@ ${lanes.join("\n")}
|
|
|
15548
15559
|
flags |= 1 /* Generator */;
|
|
15549
15560
|
}
|
|
15550
15561
|
case 219 /* ArrowFunction */:
|
|
15551
|
-
if (hasSyntacticModifier(node,
|
|
15562
|
+
if (hasSyntacticModifier(node, 1024 /* Async */)) {
|
|
15552
15563
|
flags |= 2 /* Async */;
|
|
15553
15564
|
}
|
|
15554
15565
|
break;
|
|
@@ -15564,7 +15575,7 @@ ${lanes.join("\n")}
|
|
|
15564
15575
|
case 218 /* FunctionExpression */:
|
|
15565
15576
|
case 219 /* ArrowFunction */:
|
|
15566
15577
|
case 174 /* MethodDeclaration */:
|
|
15567
|
-
return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node,
|
|
15578
|
+
return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 1024 /* Async */);
|
|
15568
15579
|
}
|
|
15569
15580
|
return false;
|
|
15570
15581
|
}
|
|
@@ -16663,25 +16674,25 @@ ${lanes.join("\n")}
|
|
|
16663
16674
|
return isClassElement(node) && hasStaticModifier(node) || isClassStaticBlockDeclaration(node);
|
|
16664
16675
|
}
|
|
16665
16676
|
function hasStaticModifier(node) {
|
|
16666
|
-
return hasSyntacticModifier(node,
|
|
16677
|
+
return hasSyntacticModifier(node, 256 /* Static */);
|
|
16667
16678
|
}
|
|
16668
16679
|
function hasOverrideModifier(node) {
|
|
16669
|
-
return hasEffectiveModifier(node,
|
|
16680
|
+
return hasEffectiveModifier(node, 16 /* Override */);
|
|
16670
16681
|
}
|
|
16671
16682
|
function hasAbstractModifier(node) {
|
|
16672
|
-
return hasSyntacticModifier(node,
|
|
16683
|
+
return hasSyntacticModifier(node, 64 /* Abstract */);
|
|
16673
16684
|
}
|
|
16674
16685
|
function hasAmbientModifier(node) {
|
|
16675
|
-
return hasSyntacticModifier(node,
|
|
16686
|
+
return hasSyntacticModifier(node, 128 /* Ambient */);
|
|
16676
16687
|
}
|
|
16677
16688
|
function hasAccessorModifier(node) {
|
|
16678
|
-
return hasSyntacticModifier(node,
|
|
16689
|
+
return hasSyntacticModifier(node, 512 /* Accessor */);
|
|
16679
16690
|
}
|
|
16680
16691
|
function hasEffectiveReadonlyModifier(node) {
|
|
16681
|
-
return hasEffectiveModifier(node,
|
|
16692
|
+
return hasEffectiveModifier(node, 8 /* Readonly */);
|
|
16682
16693
|
}
|
|
16683
16694
|
function hasDecorators(node) {
|
|
16684
|
-
return hasSyntacticModifier(node,
|
|
16695
|
+
return hasSyntacticModifier(node, 32768 /* Decorator */);
|
|
16685
16696
|
}
|
|
16686
16697
|
function getSelectedEffectiveModifierFlags(node, flags) {
|
|
16687
16698
|
return getEffectiveModifierFlags(node) & flags;
|
|
@@ -16696,10 +16707,13 @@ ${lanes.join("\n")}
|
|
|
16696
16707
|
if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) {
|
|
16697
16708
|
node.modifierFlagsCache = getSyntacticModifierFlagsNoCache(node) | 536870912 /* HasComputedFlags */;
|
|
16698
16709
|
}
|
|
16699
|
-
if (
|
|
16700
|
-
node.modifierFlagsCache
|
|
16710
|
+
if (alwaysIncludeJSDoc || includeJSDoc && isInJSFile(node)) {
|
|
16711
|
+
if (!(node.modifierFlagsCache & 268435456 /* HasComputedJSDocModifiers */) && node.parent) {
|
|
16712
|
+
node.modifierFlagsCache |= getRawJSDocModifierFlagsNoCache(node) | 268435456 /* HasComputedJSDocModifiers */;
|
|
16713
|
+
}
|
|
16714
|
+
return selectEffectiveModifierFlags(node.modifierFlagsCache);
|
|
16701
16715
|
}
|
|
16702
|
-
return node.modifierFlagsCache
|
|
16716
|
+
return selectSyntacticModifierFlags(node.modifierFlagsCache);
|
|
16703
16717
|
}
|
|
16704
16718
|
function getEffectiveModifierFlags(node) {
|
|
16705
16719
|
return getModifierFlagsWorker(
|
|
@@ -16724,33 +16738,42 @@ ${lanes.join("\n")}
|
|
|
16724
16738
|
false
|
|
16725
16739
|
);
|
|
16726
16740
|
}
|
|
16727
|
-
function
|
|
16741
|
+
function getRawJSDocModifierFlagsNoCache(node) {
|
|
16728
16742
|
let flags = 0 /* None */;
|
|
16729
16743
|
if (!!node.parent && !isParameter(node)) {
|
|
16730
16744
|
if (isInJSFile(node)) {
|
|
16731
16745
|
if (getJSDocPublicTagNoCache(node))
|
|
16732
|
-
flags |=
|
|
16746
|
+
flags |= 8388608 /* JSDocPublic */;
|
|
16733
16747
|
if (getJSDocPrivateTagNoCache(node))
|
|
16734
|
-
flags |=
|
|
16748
|
+
flags |= 16777216 /* JSDocPrivate */;
|
|
16735
16749
|
if (getJSDocProtectedTagNoCache(node))
|
|
16736
|
-
flags |=
|
|
16750
|
+
flags |= 33554432 /* JSDocProtected */;
|
|
16737
16751
|
if (getJSDocReadonlyTagNoCache(node))
|
|
16738
|
-
flags |=
|
|
16752
|
+
flags |= 67108864 /* JSDocReadonly */;
|
|
16739
16753
|
if (getJSDocOverrideTagNoCache(node))
|
|
16740
|
-
flags |=
|
|
16754
|
+
flags |= 134217728 /* JSDocOverride */;
|
|
16741
16755
|
}
|
|
16742
16756
|
if (getJSDocDeprecatedTagNoCache(node))
|
|
16743
|
-
flags |=
|
|
16757
|
+
flags |= 65536 /* Deprecated */;
|
|
16744
16758
|
}
|
|
16745
16759
|
return flags;
|
|
16746
16760
|
}
|
|
16761
|
+
function selectSyntacticModifierFlags(flags) {
|
|
16762
|
+
return flags & 65535 /* SyntacticModifiers */;
|
|
16763
|
+
}
|
|
16764
|
+
function selectEffectiveModifierFlags(flags) {
|
|
16765
|
+
return flags & 131071 /* NonCacheOnlyModifiers */ | (flags & 260046848 /* JSDocCacheOnlyModifiers */) >>> 23;
|
|
16766
|
+
}
|
|
16767
|
+
function getJSDocModifierFlagsNoCache(node) {
|
|
16768
|
+
return selectEffectiveModifierFlags(getRawJSDocModifierFlagsNoCache(node));
|
|
16769
|
+
}
|
|
16747
16770
|
function getEffectiveModifierFlagsNoCache(node) {
|
|
16748
16771
|
return getSyntacticModifierFlagsNoCache(node) | getJSDocModifierFlagsNoCache(node);
|
|
16749
16772
|
}
|
|
16750
16773
|
function getSyntacticModifierFlagsNoCache(node) {
|
|
16751
16774
|
let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */;
|
|
16752
16775
|
if (node.flags & 8 /* NestedNamespace */ || node.kind === 80 /* Identifier */ && node.flags & 4096 /* IdentifierIsInJSDocNamespace */) {
|
|
16753
|
-
flags |=
|
|
16776
|
+
flags |= 32 /* Export */;
|
|
16754
16777
|
}
|
|
16755
16778
|
return flags;
|
|
16756
16779
|
}
|
|
@@ -16766,37 +16789,37 @@ ${lanes.join("\n")}
|
|
|
16766
16789
|
function modifierToFlag(token) {
|
|
16767
16790
|
switch (token) {
|
|
16768
16791
|
case 126 /* StaticKeyword */:
|
|
16769
|
-
return
|
|
16792
|
+
return 256 /* Static */;
|
|
16770
16793
|
case 125 /* PublicKeyword */:
|
|
16771
|
-
return
|
|
16794
|
+
return 1 /* Public */;
|
|
16772
16795
|
case 124 /* ProtectedKeyword */:
|
|
16773
|
-
return
|
|
16796
|
+
return 4 /* Protected */;
|
|
16774
16797
|
case 123 /* PrivateKeyword */:
|
|
16775
|
-
return
|
|
16798
|
+
return 2 /* Private */;
|
|
16776
16799
|
case 128 /* AbstractKeyword */:
|
|
16777
|
-
return
|
|
16800
|
+
return 64 /* Abstract */;
|
|
16778
16801
|
case 129 /* AccessorKeyword */:
|
|
16779
|
-
return
|
|
16802
|
+
return 512 /* Accessor */;
|
|
16780
16803
|
case 95 /* ExportKeyword */:
|
|
16781
|
-
return
|
|
16804
|
+
return 32 /* Export */;
|
|
16782
16805
|
case 138 /* DeclareKeyword */:
|
|
16783
|
-
return
|
|
16806
|
+
return 128 /* Ambient */;
|
|
16784
16807
|
case 87 /* ConstKeyword */:
|
|
16785
|
-
return
|
|
16808
|
+
return 4096 /* Const */;
|
|
16786
16809
|
case 90 /* DefaultKeyword */:
|
|
16787
|
-
return
|
|
16810
|
+
return 2048 /* Default */;
|
|
16788
16811
|
case 134 /* AsyncKeyword */:
|
|
16789
|
-
return
|
|
16812
|
+
return 1024 /* Async */;
|
|
16790
16813
|
case 148 /* ReadonlyKeyword */:
|
|
16791
|
-
return
|
|
16814
|
+
return 8 /* Readonly */;
|
|
16792
16815
|
case 164 /* OverrideKeyword */:
|
|
16793
|
-
return
|
|
16816
|
+
return 16 /* Override */;
|
|
16794
16817
|
case 103 /* InKeyword */:
|
|
16795
|
-
return
|
|
16818
|
+
return 8192 /* In */;
|
|
16796
16819
|
case 147 /* OutKeyword */:
|
|
16797
|
-
return
|
|
16820
|
+
return 16384 /* Out */;
|
|
16798
16821
|
case 170 /* Decorator */:
|
|
16799
|
-
return
|
|
16822
|
+
return 32768 /* Decorator */;
|
|
16800
16823
|
}
|
|
16801
16824
|
return 0 /* None */;
|
|
16802
16825
|
}
|
|
@@ -16936,7 +16959,7 @@ ${lanes.join("\n")}
|
|
|
16936
16959
|
return void 0;
|
|
16937
16960
|
}
|
|
16938
16961
|
function isExportDefaultSymbol(symbol) {
|
|
16939
|
-
return symbol && length(symbol.declarations) > 0 && hasSyntacticModifier(symbol.declarations[0],
|
|
16962
|
+
return symbol && length(symbol.declarations) > 0 && hasSyntacticModifier(symbol.declarations[0], 2048 /* Default */);
|
|
16940
16963
|
}
|
|
16941
16964
|
function tryExtractTSExtension(fileName) {
|
|
16942
16965
|
return find(supportedTSExtensionsForExtractExtension, (extension) => fileExtensionIs(fileName, extension));
|
|
@@ -17216,16 +17239,16 @@ ${lanes.join("\n")}
|
|
|
17216
17239
|
if (s.valueDeclaration) {
|
|
17217
17240
|
const declaration = isWrite && s.declarations && find(s.declarations, isSetAccessorDeclaration) || s.flags & 32768 /* GetAccessor */ && find(s.declarations, isGetAccessorDeclaration) || s.valueDeclaration;
|
|
17218
17241
|
const flags = getCombinedModifierFlags(declaration);
|
|
17219
|
-
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~
|
|
17242
|
+
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~7 /* AccessibilityModifier */;
|
|
17220
17243
|
}
|
|
17221
17244
|
if (getCheckFlags(s) & 6 /* Synthetic */) {
|
|
17222
17245
|
const checkFlags = s.links.checkFlags;
|
|
17223
|
-
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ?
|
|
17224
|
-
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ?
|
|
17246
|
+
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 2 /* Private */ : checkFlags & 256 /* ContainsPublic */ ? 1 /* Public */ : 4 /* Protected */;
|
|
17247
|
+
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 256 /* Static */ : 0;
|
|
17225
17248
|
return accessModifier | staticModifier;
|
|
17226
17249
|
}
|
|
17227
17250
|
if (s.flags & 4194304 /* Prototype */) {
|
|
17228
|
-
return
|
|
17251
|
+
return 1 /* Public */ | 256 /* Static */;
|
|
17229
17252
|
}
|
|
17230
17253
|
return 0;
|
|
17231
17254
|
}
|
|
@@ -17324,7 +17347,7 @@ ${lanes.join("\n")}
|
|
|
17324
17347
|
function isAbstractConstructorSymbol(symbol) {
|
|
17325
17348
|
if (symbol.flags & 32 /* Class */) {
|
|
17326
17349
|
const declaration = getClassLikeDeclarationOfSymbol(symbol);
|
|
17327
|
-
return !!declaration && hasSyntacticModifier(declaration,
|
|
17350
|
+
return !!declaration && hasSyntacticModifier(declaration, 64 /* Abstract */);
|
|
17328
17351
|
}
|
|
17329
17352
|
return false;
|
|
17330
17353
|
}
|
|
@@ -18544,7 +18567,7 @@ ${lanes.join("\n")}
|
|
|
18544
18567
|
if (node.kind !== 167 /* ComputedPropertyName */) {
|
|
18545
18568
|
return false;
|
|
18546
18569
|
}
|
|
18547
|
-
if (hasSyntacticModifier(node.parent,
|
|
18570
|
+
if (hasSyntacticModifier(node.parent, 64 /* Abstract */)) {
|
|
18548
18571
|
return true;
|
|
18549
18572
|
}
|
|
18550
18573
|
const containerKind = node.parent.parent.kind;
|
|
@@ -21127,35 +21150,35 @@ ${lanes.join("\n")}
|
|
|
21127
21150
|
}
|
|
21128
21151
|
function createModifiersFromModifierFlags(flags2) {
|
|
21129
21152
|
const result = [];
|
|
21130
|
-
if (flags2 &
|
|
21153
|
+
if (flags2 & 32 /* Export */)
|
|
21131
21154
|
result.push(createModifier(95 /* ExportKeyword */));
|
|
21132
|
-
if (flags2 &
|
|
21155
|
+
if (flags2 & 128 /* Ambient */)
|
|
21133
21156
|
result.push(createModifier(138 /* DeclareKeyword */));
|
|
21134
|
-
if (flags2 &
|
|
21157
|
+
if (flags2 & 2048 /* Default */)
|
|
21135
21158
|
result.push(createModifier(90 /* DefaultKeyword */));
|
|
21136
|
-
if (flags2 &
|
|
21159
|
+
if (flags2 & 4096 /* Const */)
|
|
21137
21160
|
result.push(createModifier(87 /* ConstKeyword */));
|
|
21138
|
-
if (flags2 &
|
|
21161
|
+
if (flags2 & 1 /* Public */)
|
|
21139
21162
|
result.push(createModifier(125 /* PublicKeyword */));
|
|
21140
|
-
if (flags2 &
|
|
21163
|
+
if (flags2 & 2 /* Private */)
|
|
21141
21164
|
result.push(createModifier(123 /* PrivateKeyword */));
|
|
21142
|
-
if (flags2 &
|
|
21165
|
+
if (flags2 & 4 /* Protected */)
|
|
21143
21166
|
result.push(createModifier(124 /* ProtectedKeyword */));
|
|
21144
|
-
if (flags2 &
|
|
21167
|
+
if (flags2 & 64 /* Abstract */)
|
|
21145
21168
|
result.push(createModifier(128 /* AbstractKeyword */));
|
|
21146
|
-
if (flags2 &
|
|
21169
|
+
if (flags2 & 256 /* Static */)
|
|
21147
21170
|
result.push(createModifier(126 /* StaticKeyword */));
|
|
21148
|
-
if (flags2 &
|
|
21171
|
+
if (flags2 & 16 /* Override */)
|
|
21149
21172
|
result.push(createModifier(164 /* OverrideKeyword */));
|
|
21150
|
-
if (flags2 &
|
|
21173
|
+
if (flags2 & 8 /* Readonly */)
|
|
21151
21174
|
result.push(createModifier(148 /* ReadonlyKeyword */));
|
|
21152
|
-
if (flags2 &
|
|
21175
|
+
if (flags2 & 512 /* Accessor */)
|
|
21153
21176
|
result.push(createModifier(129 /* AccessorKeyword */));
|
|
21154
|
-
if (flags2 &
|
|
21177
|
+
if (flags2 & 1024 /* Async */)
|
|
21155
21178
|
result.push(createModifier(134 /* AsyncKeyword */));
|
|
21156
|
-
if (flags2 &
|
|
21179
|
+
if (flags2 & 8192 /* In */)
|
|
21157
21180
|
result.push(createModifier(103 /* InKeyword */));
|
|
21158
|
-
if (flags2 &
|
|
21181
|
+
if (flags2 & 16384 /* Out */)
|
|
21159
21182
|
result.push(createModifier(147 /* OutKeyword */));
|
|
21160
21183
|
return result.length ? result : void 0;
|
|
21161
21184
|
}
|
|
@@ -21204,7 +21227,7 @@ ${lanes.join("\n")}
|
|
|
21204
21227
|
if (isThisIdentifier(node.name)) {
|
|
21205
21228
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
21206
21229
|
} 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) &
|
|
21230
|
+
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
21231
|
}
|
|
21209
21232
|
node.jsDoc = void 0;
|
|
21210
21233
|
return node;
|
|
@@ -21253,8 +21276,8 @@ ${lanes.join("\n")}
|
|
|
21253
21276
|
node.exclamationToken = questionOrExclamationToken && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0;
|
|
21254
21277
|
node.type = type;
|
|
21255
21278
|
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) &
|
|
21279
|
+
const isAmbient = node.flags & 33554432 /* Ambient */ || modifiersToFlags(node.modifiers) & 128 /* Ambient */;
|
|
21280
|
+
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
21281
|
node.jsDoc = void 0;
|
|
21259
21282
|
return node;
|
|
21260
21283
|
}
|
|
@@ -21293,7 +21316,7 @@ ${lanes.join("\n")}
|
|
|
21293
21316
|
if (!node.body) {
|
|
21294
21317
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
21295
21318
|
} else {
|
|
21296
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
21319
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
21297
21320
|
const isGenerator = !!node.asteriskToken;
|
|
21298
21321
|
const isAsyncGenerator = isAsync && isGenerator;
|
|
21299
21322
|
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 +22059,7 @@ ${lanes.join("\n")}
|
|
|
22036
22059
|
node.parameters = createNodeArray(parameters);
|
|
22037
22060
|
node.type = type;
|
|
22038
22061
|
node.body = body;
|
|
22039
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
22062
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
22040
22063
|
const isGenerator = !!node.asteriskToken;
|
|
22041
22064
|
const isAsyncGenerator = isAsync && isGenerator;
|
|
22042
22065
|
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 +22083,7 @@ ${lanes.join("\n")}
|
|
|
22060
22083
|
node.type = type;
|
|
22061
22084
|
node.equalsGreaterThanToken = equalsGreaterThanToken ?? createToken(39 /* EqualsGreaterThanToken */);
|
|
22062
22085
|
node.body = parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body);
|
|
22063
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
22086
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
22064
22087
|
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
22088
|
node.typeArguments = void 0;
|
|
22066
22089
|
node.jsDoc = void 0;
|
|
@@ -22412,7 +22435,7 @@ ${lanes.join("\n")}
|
|
|
22412
22435
|
node.modifiers = asNodeArray(modifiers);
|
|
22413
22436
|
node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
|
|
22414
22437
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList);
|
|
22415
|
-
if (modifiersToFlags(node.modifiers) &
|
|
22438
|
+
if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
22416
22439
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22417
22440
|
}
|
|
22418
22441
|
node.jsDoc = void 0;
|
|
@@ -22662,10 +22685,10 @@ ${lanes.join("\n")}
|
|
|
22662
22685
|
node.parameters = createNodeArray(parameters);
|
|
22663
22686
|
node.type = type;
|
|
22664
22687
|
node.body = body;
|
|
22665
|
-
if (!node.body || modifiersToFlags(node.modifiers) &
|
|
22688
|
+
if (!node.body || modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
22666
22689
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22667
22690
|
} else {
|
|
22668
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
22691
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
22669
22692
|
const isGenerator = !!node.asteriskToken;
|
|
22670
22693
|
const isAsyncGenerator = isAsync && isGenerator;
|
|
22671
22694
|
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 +22719,7 @@ ${lanes.join("\n")}
|
|
|
22696
22719
|
node.typeParameters = asNodeArray(typeParameters);
|
|
22697
22720
|
node.heritageClauses = asNodeArray(heritageClauses);
|
|
22698
22721
|
node.members = createNodeArray(members);
|
|
22699
|
-
if (modifiersToFlags(node.modifiers) &
|
|
22722
|
+
if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
22700
22723
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22701
22724
|
} else {
|
|
22702
22725
|
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 +22781,7 @@ ${lanes.join("\n")}
|
|
|
22758
22781
|
node.flags |= flags2 & (32 /* Namespace */ | 8 /* NestedNamespace */ | 2048 /* GlobalAugmentation */);
|
|
22759
22782
|
node.name = name;
|
|
22760
22783
|
node.body = body;
|
|
22761
|
-
if (modifiersToFlags(node.modifiers) &
|
|
22784
|
+
if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
22762
22785
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22763
22786
|
} else {
|
|
22764
22787
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1 /* ContainsTypeScript */;
|
|
@@ -24189,7 +24212,7 @@ ${lanes.join("\n")}
|
|
|
24189
24212
|
return qualifiedName;
|
|
24190
24213
|
}
|
|
24191
24214
|
function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) {
|
|
24192
|
-
if (ns && hasSyntacticModifier(node,
|
|
24215
|
+
if (ns && hasSyntacticModifier(node, 32 /* Export */)) {
|
|
24193
24216
|
return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps);
|
|
24194
24217
|
}
|
|
24195
24218
|
return getExportName(node, allowComments, allowSourceMaps);
|
|
@@ -33844,11 +33867,11 @@ ${lanes.join("\n")}
|
|
|
33844
33867
|
const modifierFlags = modifiersToFlags(modifiers);
|
|
33845
33868
|
parseExpected(100 /* FunctionKeyword */);
|
|
33846
33869
|
const asteriskToken = parseOptionalToken(42 /* AsteriskToken */);
|
|
33847
|
-
const name = modifierFlags &
|
|
33870
|
+
const name = modifierFlags & 2048 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier();
|
|
33848
33871
|
const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */;
|
|
33849
|
-
const isAsync = modifierFlags &
|
|
33872
|
+
const isAsync = modifierFlags & 1024 /* Async */ ? 2 /* Await */ : 0 /* None */;
|
|
33850
33873
|
const typeParameters = parseTypeParameters();
|
|
33851
|
-
if (modifierFlags &
|
|
33874
|
+
if (modifierFlags & 32 /* Export */)
|
|
33852
33875
|
setAwaitContext(
|
|
33853
33876
|
/*value*/
|
|
33854
33877
|
true
|
|
@@ -41912,7 +41935,7 @@ ${lanes.join("\n")}
|
|
|
41912
41935
|
break;
|
|
41913
41936
|
case 272 /* ImportDeclaration */:
|
|
41914
41937
|
case 271 /* ImportEqualsDeclaration */:
|
|
41915
|
-
if (!hasSyntacticModifier(node,
|
|
41938
|
+
if (!hasSyntacticModifier(node, 32 /* Export */)) {
|
|
41916
41939
|
return 0 /* NonInstantiated */;
|
|
41917
41940
|
}
|
|
41918
41941
|
break;
|
|
@@ -42189,7 +42212,7 @@ ${lanes.join("\n")}
|
|
|
42189
42212
|
}
|
|
42190
42213
|
function declareSymbol(symbolTable, parent3, node, includes, excludes, isReplaceableByMethod, isComputedName) {
|
|
42191
42214
|
Debug.assert(isComputedName || !hasDynamicName(node));
|
|
42192
|
-
const isDefaultExport = hasSyntacticModifier(node,
|
|
42215
|
+
const isDefaultExport = hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) && node.name.escapedText === "default";
|
|
42193
42216
|
const name = isComputedName ? "__computed" /* Computed */ : isDefaultExport && parent3 ? "default" /* Default */ : getDeclarationName(node);
|
|
42194
42217
|
let symbol;
|
|
42195
42218
|
if (name === void 0) {
|
|
@@ -42233,7 +42256,7 @@ ${lanes.join("\n")}
|
|
|
42233
42256
|
}
|
|
42234
42257
|
}
|
|
42235
42258
|
const relatedInformation = [];
|
|
42236
|
-
if (isTypeAliasDeclaration(node) && nodeIsMissing(node.type) && hasSyntacticModifier(node,
|
|
42259
|
+
if (isTypeAliasDeclaration(node) && nodeIsMissing(node.type) && hasSyntacticModifier(node, 32 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
|
|
42237
42260
|
relatedInformation.push(createDiagnosticForNode2(node, Diagnostics.Did_you_mean_0, `export type { ${unescapeLeadingUnderscores(node.name.escapedText)} }`));
|
|
42238
42261
|
}
|
|
42239
42262
|
const declarationName = getNameOfDeclaration(node) || node;
|
|
@@ -42262,7 +42285,7 @@ ${lanes.join("\n")}
|
|
|
42262
42285
|
return symbol;
|
|
42263
42286
|
}
|
|
42264
42287
|
function declareModuleMember(node, symbolFlags, symbolExcludes) {
|
|
42265
|
-
const hasExportModifier = !!(getCombinedModifierFlags(node) &
|
|
42288
|
+
const hasExportModifier = !!(getCombinedModifierFlags(node) & 32 /* Export */) || jsdocTreatAsExported(node);
|
|
42266
42289
|
if (symbolFlags & 2097152 /* Alias */) {
|
|
42267
42290
|
if (node.kind === 281 /* ExportSpecifier */ || node.kind === 271 /* ImportEqualsDeclaration */ && hasExportModifier) {
|
|
42268
42291
|
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
|
|
@@ -42281,7 +42304,7 @@ ${lanes.join("\n")}
|
|
|
42281
42304
|
if (isJSDocTypeAlias(node))
|
|
42282
42305
|
Debug.assert(isInJSFile(node));
|
|
42283
42306
|
if (!isAmbientModule(node) && (hasExportModifier || container.flags & 128 /* ExportContext */)) {
|
|
42284
|
-
if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier(node,
|
|
42307
|
+
if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier(node, 2048 /* Default */) && !getDeclarationName(node)) {
|
|
42285
42308
|
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
|
|
42286
42309
|
}
|
|
42287
42310
|
const exportKind = symbolFlags & 111551 /* Value */ ? 1048576 /* ExportValue */ : 0;
|
|
@@ -42322,7 +42345,7 @@ ${lanes.join("\n")}
|
|
|
42322
42345
|
return false;
|
|
42323
42346
|
if (isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent))
|
|
42324
42347
|
return true;
|
|
42325
|
-
if (isDeclaration(declName.parent) && getCombinedModifierFlags(declName.parent) &
|
|
42348
|
+
if (isDeclaration(declName.parent) && getCombinedModifierFlags(declName.parent) & 32 /* Export */)
|
|
42326
42349
|
return true;
|
|
42327
42350
|
return false;
|
|
42328
42351
|
}
|
|
@@ -42353,7 +42376,7 @@ ${lanes.join("\n")}
|
|
|
42353
42376
|
const saveExceptionTarget = currentExceptionTarget;
|
|
42354
42377
|
const saveActiveLabelList = activeLabelList;
|
|
42355
42378
|
const saveHasExplicitReturn = hasExplicitReturn;
|
|
42356
|
-
const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node,
|
|
42379
|
+
const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175 /* ClassStaticBlockDeclaration */;
|
|
42357
42380
|
if (!isImmediatelyInvoked) {
|
|
42358
42381
|
currentFlow = initFlowNode({ flags: 2 /* Start */ });
|
|
42359
42382
|
if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */)) {
|
|
@@ -43400,7 +43423,7 @@ ${lanes.join("\n")}
|
|
|
43400
43423
|
function bindModuleDeclaration(node) {
|
|
43401
43424
|
setExportContextFlag(node);
|
|
43402
43425
|
if (isAmbientModule(node)) {
|
|
43403
|
-
if (hasSyntacticModifier(node,
|
|
43426
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
43404
43427
|
errorOnFirstToken(node, Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible);
|
|
43405
43428
|
}
|
|
43406
43429
|
if (isModuleAugmentationExternal(node)) {
|
|
@@ -44461,7 +44484,7 @@ ${lanes.join("\n")}
|
|
|
44461
44484
|
}
|
|
44462
44485
|
if (!isBindingPattern(node.name)) {
|
|
44463
44486
|
const possibleVariableDecl = node.kind === 260 /* VariableDeclaration */ ? node : node.parent.parent;
|
|
44464
|
-
if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) &
|
|
44487
|
+
if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 32 /* Export */)) {
|
|
44465
44488
|
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
|
|
44466
44489
|
} else if (isBlockOrCatchScoped(node)) {
|
|
44467
44490
|
bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */);
|
|
@@ -44613,7 +44636,7 @@ ${lanes.join("\n")}
|
|
|
44613
44636
|
case 267 /* ModuleDeclaration */:
|
|
44614
44637
|
return getModuleInstanceState(s) !== 1 /* Instantiated */;
|
|
44615
44638
|
case 266 /* EnumDeclaration */:
|
|
44616
|
-
return hasSyntacticModifier(s,
|
|
44639
|
+
return hasSyntacticModifier(s, 4096 /* Const */);
|
|
44617
44640
|
default:
|
|
44618
44641
|
return false;
|
|
44619
44642
|
}
|
|
@@ -47684,7 +47707,7 @@ ${lanes.join("\n")}
|
|
|
47684
47707
|
if (lastLocation && lastLocation === location.name) {
|
|
47685
47708
|
return false;
|
|
47686
47709
|
}
|
|
47687
|
-
if (location.asteriskToken || hasSyntacticModifier(location,
|
|
47710
|
+
if (location.asteriskToken || hasSyntacticModifier(location, 1024 /* Async */)) {
|
|
47688
47711
|
return true;
|
|
47689
47712
|
}
|
|
47690
47713
|
return !getImmediatelyInvokedFunctionExpression(location);
|
|
@@ -48069,7 +48092,7 @@ ${lanes.join("\n")}
|
|
|
48069
48092
|
return resolved;
|
|
48070
48093
|
}
|
|
48071
48094
|
function isSyntacticDefault(node) {
|
|
48072
|
-
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node,
|
|
48095
|
+
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) || isNamespaceExport(node);
|
|
48073
48096
|
}
|
|
48074
48097
|
function getUsageModeForExpression(usage) {
|
|
48075
48098
|
return isStringLiteralLike(usage) ? getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
|
|
@@ -49995,20 +50018,20 @@ ${lanes.join("\n")}
|
|
|
49995
50018
|
var _a, _b;
|
|
49996
50019
|
if (!isDeclarationVisible(declaration)) {
|
|
49997
50020
|
const anyImportSyntax = getAnyImportSyntax(declaration);
|
|
49998
|
-
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax,
|
|
50021
|
+
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax, 32 /* Export */) && // import clause without export
|
|
49999
50022
|
isDeclarationVisible(anyImportSyntax.parent)) {
|
|
50000
50023
|
return addVisibleAlias(declaration, anyImportSyntax);
|
|
50001
|
-
} else if (isVariableDeclaration(declaration) && isVariableStatement(declaration.parent.parent) && !hasSyntacticModifier(declaration.parent.parent,
|
|
50024
|
+
} else if (isVariableDeclaration(declaration) && isVariableStatement(declaration.parent.parent) && !hasSyntacticModifier(declaration.parent.parent, 32 /* Export */) && // unexported variable statement
|
|
50002
50025
|
isDeclarationVisible(declaration.parent.parent.parent)) {
|
|
50003
50026
|
return addVisibleAlias(declaration, declaration.parent.parent);
|
|
50004
|
-
} else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier(declaration,
|
|
50027
|
+
} else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier(declaration, 32 /* Export */) && isDeclarationVisible(declaration.parent)) {
|
|
50005
50028
|
return addVisibleAlias(declaration, declaration);
|
|
50006
50029
|
} 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,
|
|
50030
|
+
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
50031
|
return addVisibleAlias(declaration, declaration.parent.parent.parent.parent);
|
|
50009
50032
|
} else if (symbol.flags & 2 /* BlockScopedVariable */) {
|
|
50010
50033
|
const variableStatement = findAncestor(declaration, isVariableStatement);
|
|
50011
|
-
if (hasSyntacticModifier(variableStatement,
|
|
50034
|
+
if (hasSyntacticModifier(variableStatement, 32 /* Export */)) {
|
|
50012
50035
|
return true;
|
|
50013
50036
|
}
|
|
50014
50037
|
if (!isDeclarationVisible(variableStatement.parent)) {
|
|
@@ -50231,7 +50254,8 @@ ${lanes.join("\n")}
|
|
|
50231
50254
|
visitedTypes: void 0,
|
|
50232
50255
|
symbolDepth: void 0,
|
|
50233
50256
|
inferTypeParameters: void 0,
|
|
50234
|
-
approximateLength: 0
|
|
50257
|
+
approximateLength: 0,
|
|
50258
|
+
trackedSymbols: void 0
|
|
50235
50259
|
};
|
|
50236
50260
|
context.tracker = new SymbolTrackerImpl(context, tracker, moduleResolverHost);
|
|
50237
50261
|
const resultingNode = cb(context);
|
|
@@ -50685,7 +50709,7 @@ ${lanes.join("\n")}
|
|
|
50685
50709
|
}
|
|
50686
50710
|
}
|
|
50687
50711
|
function visitAndTransformType(type2, transform2) {
|
|
50688
|
-
var _a2, _b2;
|
|
50712
|
+
var _a2, _b2, _c;
|
|
50689
50713
|
const typeId = type2.id;
|
|
50690
50714
|
const isConstructorObject = getObjectFlags(type2) & 16 /* Anonymous */ && type2.symbol && type2.symbol.flags & 32 /* Class */;
|
|
50691
50715
|
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 +50726,13 @@ ${lanes.join("\n")}
|
|
|
50702
50726
|
}
|
|
50703
50727
|
const cachedResult = (_a2 = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _a2.get(key);
|
|
50704
50728
|
if (cachedResult) {
|
|
50729
|
+
(_b2 = cachedResult.trackedSymbols) == null ? void 0 : _b2.forEach(
|
|
50730
|
+
([symbol, enclosingDeclaration, meaning]) => context.tracker.trackSymbol(
|
|
50731
|
+
symbol,
|
|
50732
|
+
enclosingDeclaration,
|
|
50733
|
+
meaning
|
|
50734
|
+
)
|
|
50735
|
+
);
|
|
50705
50736
|
if (cachedResult.truncating) {
|
|
50706
50737
|
context.truncating = true;
|
|
50707
50738
|
}
|
|
@@ -50721,7 +50752,12 @@ ${lanes.join("\n")}
|
|
|
50721
50752
|
const result = transform2(type2);
|
|
50722
50753
|
const addedLength = context.approximateLength - startLength;
|
|
50723
50754
|
if (!context.reportedDiagnostic && !context.encounteredError) {
|
|
50724
|
-
(
|
|
50755
|
+
(_c = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _c.set(key, {
|
|
50756
|
+
node: result,
|
|
50757
|
+
truncating: context.truncating,
|
|
50758
|
+
addedLength,
|
|
50759
|
+
trackedSymbols: context.trackedSymbols
|
|
50760
|
+
});
|
|
50725
50761
|
}
|
|
50726
50762
|
context.visitedTypes.delete(typeId);
|
|
50727
50763
|
if (id) {
|
|
@@ -50963,7 +50999,7 @@ ${lanes.join("\n")}
|
|
|
50963
50999
|
if (propertySymbol.flags & 4194304 /* Prototype */) {
|
|
50964
51000
|
continue;
|
|
50965
51001
|
}
|
|
50966
|
-
if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (
|
|
51002
|
+
if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (2 /* Private */ | 4 /* Protected */) && context.tracker.reportPrivateInBaseOfClassExpression) {
|
|
50967
51003
|
context.tracker.reportPrivateInBaseOfClassExpression(unescapeLeadingUnderscores(propertySymbol.escapedName));
|
|
50968
51004
|
}
|
|
50969
51005
|
}
|
|
@@ -51266,7 +51302,7 @@ ${lanes.join("\n")}
|
|
|
51266
51302
|
let modifiers = options == null ? void 0 : options.modifiers;
|
|
51267
51303
|
if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
|
|
51268
51304
|
const flags = modifiersToFlags(modifiers);
|
|
51269
|
-
modifiers = factory.createModifiersFromModifierFlags(flags |
|
|
51305
|
+
modifiers = factory.createModifiersFromModifierFlags(flags | 64 /* Abstract */);
|
|
51270
51306
|
}
|
|
51271
51307
|
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
51308
|
modifiers,
|
|
@@ -52323,7 +52359,7 @@ ${lanes.join("\n")}
|
|
|
52323
52359
|
const nsIndex = findIndex(statements, isModuleDeclaration);
|
|
52324
52360
|
let ns = nsIndex !== -1 ? statements[nsIndex] : void 0;
|
|
52325
52361
|
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) &
|
|
52362
|
+
const excessExports = filter(statements, (s) => !!(getEffectiveModifierFlags(s) & 32 /* Export */));
|
|
52327
52363
|
const name = ns.name;
|
|
52328
52364
|
let body = ns.body;
|
|
52329
52365
|
if (length(excessExports)) {
|
|
@@ -52357,9 +52393,9 @@ ${lanes.join("\n")}
|
|
|
52357
52393
|
}
|
|
52358
52394
|
if (!find(statements, (s) => s !== ns && nodeHasName(s, name))) {
|
|
52359
52395
|
results = [];
|
|
52360
|
-
const mixinExportFlag = !some(body.statements, (s) => hasSyntacticModifier(s,
|
|
52396
|
+
const mixinExportFlag = !some(body.statements, (s) => hasSyntacticModifier(s, 32 /* Export */) || isExportAssignment(s) || isExportDeclaration(s));
|
|
52361
52397
|
forEach(body.statements, (s) => {
|
|
52362
|
-
addResult(s, mixinExportFlag ?
|
|
52398
|
+
addResult(s, mixinExportFlag ? 32 /* Export */ : 0 /* None */);
|
|
52363
52399
|
});
|
|
52364
52400
|
statements = [...filter(statements, (s) => s !== ns && s !== exportAssignment), ...results];
|
|
52365
52401
|
}
|
|
@@ -52451,11 +52487,11 @@ ${lanes.join("\n")}
|
|
|
52451
52487
|
return statements;
|
|
52452
52488
|
}
|
|
52453
52489
|
function addExportModifier(node) {
|
|
52454
|
-
const flags = (getEffectiveModifierFlags(node) |
|
|
52490
|
+
const flags = (getEffectiveModifierFlags(node) | 32 /* Export */) & ~128 /* Ambient */;
|
|
52455
52491
|
return factory.replaceModifiers(node, flags);
|
|
52456
52492
|
}
|
|
52457
52493
|
function removeExportModifier(node) {
|
|
52458
|
-
const flags = getEffectiveModifierFlags(node) & ~
|
|
52494
|
+
const flags = getEffectiveModifierFlags(node) & ~32 /* Export */;
|
|
52459
52495
|
return factory.replaceModifiers(node, flags);
|
|
52460
52496
|
}
|
|
52461
52497
|
function visitSymbolTable(symbolTable2, suppressNewPrivateContext, propertyAsAlias) {
|
|
@@ -52496,6 +52532,12 @@ ${lanes.join("\n")}
|
|
|
52496
52532
|
if (context.reportedDiagnostic) {
|
|
52497
52533
|
oldcontext.reportedDiagnostic = context.reportedDiagnostic;
|
|
52498
52534
|
}
|
|
52535
|
+
if (context.trackedSymbols) {
|
|
52536
|
+
if (!oldContext.trackedSymbols)
|
|
52537
|
+
oldContext.trackedSymbols = context.trackedSymbols;
|
|
52538
|
+
else
|
|
52539
|
+
Debug.assert(context.trackedSymbols === oldContext.trackedSymbols);
|
|
52540
|
+
}
|
|
52499
52541
|
context = oldContext;
|
|
52500
52542
|
}
|
|
52501
52543
|
}
|
|
@@ -52512,7 +52554,7 @@ ${lanes.join("\n")}
|
|
|
52512
52554
|
if (needsPostExportDefault || needsExportDeclaration) {
|
|
52513
52555
|
isPrivate = true;
|
|
52514
52556
|
}
|
|
52515
|
-
const modifierFlags = (!isPrivate ?
|
|
52557
|
+
const modifierFlags = (!isPrivate ? 32 /* Export */ : 0) | (isDefault && !needsPostExportDefault ? 2048 /* Default */ : 0);
|
|
52516
52558
|
const isConstMergedWithNS = symbol.flags & 1536 /* Module */ && symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && escapedSymbolName !== "export=" /* ExportEquals */;
|
|
52517
52559
|
const isConstMergedWithNSPrintableAsSignatureMerge = isConstMergedWithNS && isTypeRepresentableAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol);
|
|
52518
52560
|
if (symbol.flags & (16 /* Function */ | 8192 /* Method */) || isConstMergedWithNSPrintableAsSignatureMerge) {
|
|
@@ -52582,7 +52624,7 @@ ${lanes.join("\n")}
|
|
|
52582
52624
|
),
|
|
52583
52625
|
textRange
|
|
52584
52626
|
);
|
|
52585
|
-
addResult(statement, name !== localName ? modifierFlags & ~
|
|
52627
|
+
addResult(statement, name !== localName ? modifierFlags & ~32 /* Export */ : modifierFlags);
|
|
52586
52628
|
if (name !== localName && !isPrivate) {
|
|
52587
52629
|
addResult(
|
|
52588
52630
|
factory.createExportDeclaration(
|
|
@@ -52687,14 +52729,14 @@ ${lanes.join("\n")}
|
|
|
52687
52729
|
if (canHaveModifiers(node)) {
|
|
52688
52730
|
let newModifierFlags = 0 /* None */;
|
|
52689
52731
|
const enclosingDeclaration2 = context.enclosingDeclaration && (isJSDocTypeAlias(context.enclosingDeclaration) ? getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration);
|
|
52690
|
-
if (additionalModifierFlags &
|
|
52691
|
-
newModifierFlags |=
|
|
52732
|
+
if (additionalModifierFlags & 32 /* Export */ && enclosingDeclaration2 && (isExportingScope(enclosingDeclaration2) || isModuleDeclaration(enclosingDeclaration2)) && canHaveExportModifier(node)) {
|
|
52733
|
+
newModifierFlags |= 32 /* Export */;
|
|
52692
52734
|
}
|
|
52693
|
-
if (addingDeclare && !(newModifierFlags &
|
|
52694
|
-
newModifierFlags |=
|
|
52735
|
+
if (addingDeclare && !(newModifierFlags & 32 /* Export */) && (!enclosingDeclaration2 || !(enclosingDeclaration2.flags & 33554432 /* Ambient */)) && (isEnumDeclaration(node) || isVariableStatement(node) || isFunctionDeclaration(node) || isClassDeclaration(node) || isModuleDeclaration(node))) {
|
|
52736
|
+
newModifierFlags |= 128 /* Ambient */;
|
|
52695
52737
|
}
|
|
52696
|
-
if (additionalModifierFlags &
|
|
52697
|
-
newModifierFlags |=
|
|
52738
|
+
if (additionalModifierFlags & 2048 /* Default */ && (isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionDeclaration(node))) {
|
|
52739
|
+
newModifierFlags |= 2048 /* Default */;
|
|
52698
52740
|
}
|
|
52699
52741
|
if (newModifierFlags) {
|
|
52700
52742
|
node = factory.replaceModifiers(node, newModifierFlags | getEffectiveModifierFlags(node));
|
|
@@ -52816,7 +52858,7 @@ ${lanes.join("\n")}
|
|
|
52816
52858
|
function serializeEnum(symbol, symbolName2, modifierFlags) {
|
|
52817
52859
|
addResult(
|
|
52818
52860
|
factory.createEnumDeclaration(
|
|
52819
|
-
factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ?
|
|
52861
|
+
factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 4096 /* Const */ : 0),
|
|
52820
52862
|
getInternalSymbolName(symbol, symbolName2),
|
|
52821
52863
|
map(filter(getPropertiesOfType(getTypeOfSymbol(symbol)), (p) => !!(p.flags & 8 /* EnumMember */)), (p) => {
|
|
52822
52864
|
const initializedValue = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? getConstantValue2(p.declarations[0]) : void 0;
|
|
@@ -52900,7 +52942,7 @@ ${lanes.join("\n")}
|
|
|
52900
52942
|
factory.createIdentifier("default" /* Default */)
|
|
52901
52943
|
)])
|
|
52902
52944
|
) : d);
|
|
52903
|
-
const exportModifierStripped = every(defaultReplaced, (d) => hasSyntacticModifier(d,
|
|
52945
|
+
const exportModifierStripped = every(defaultReplaced, (d) => hasSyntacticModifier(d, 32 /* Export */)) ? map(defaultReplaced, removeExportModifier) : defaultReplaced;
|
|
52904
52946
|
fakespace = factory.updateModuleDeclaration(
|
|
52905
52947
|
fakespace,
|
|
52906
52948
|
fakespace.modifiers,
|
|
@@ -53003,7 +53045,7 @@ ${lanes.join("\n")}
|
|
|
53003
53045
|
);
|
|
53004
53046
|
const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */));
|
|
53005
53047
|
const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(
|
|
53006
|
-
factory.createModifiersFromModifierFlags(
|
|
53048
|
+
factory.createModifiersFromModifierFlags(2 /* Private */),
|
|
53007
53049
|
[],
|
|
53008
53050
|
/*body*/
|
|
53009
53051
|
void 0
|
|
@@ -53356,7 +53398,7 @@ ${lanes.join("\n")}
|
|
|
53356
53398
|
const varName = getUnusedName(name, symbol);
|
|
53357
53399
|
const typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol)));
|
|
53358
53400
|
if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) {
|
|
53359
|
-
serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ :
|
|
53401
|
+
serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 32 /* Export */);
|
|
53360
53402
|
} else {
|
|
53361
53403
|
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
53404
|
const statement = factory.createVariableStatement(
|
|
@@ -53373,7 +53415,7 @@ ${lanes.join("\n")}
|
|
|
53373
53415
|
);
|
|
53374
53416
|
addResult(
|
|
53375
53417
|
statement,
|
|
53376
|
-
target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ?
|
|
53418
|
+
target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ? 128 /* Ambient */ : name === varName ? 32 /* Export */ : 0 /* None */
|
|
53377
53419
|
);
|
|
53378
53420
|
}
|
|
53379
53421
|
if (isExportAssignmentCompatibleSymbolName) {
|
|
@@ -53409,14 +53451,14 @@ ${lanes.join("\n")}
|
|
|
53409
53451
|
return function serializePropertySymbol(p, isStatic2, baseType) {
|
|
53410
53452
|
var _a2, _b, _c, _d, _e;
|
|
53411
53453
|
const modifierFlags = getDeclarationModifierFlagsFromSymbol(p);
|
|
53412
|
-
const isPrivate = !!(modifierFlags &
|
|
53454
|
+
const isPrivate = !!(modifierFlags & 2 /* Private */);
|
|
53413
53455
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
53414
53456
|
return [];
|
|
53415
53457
|
}
|
|
53416
53458
|
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
53459
|
return [];
|
|
53418
53460
|
}
|
|
53419
|
-
const flag = modifierFlags & ~
|
|
53461
|
+
const flag = modifierFlags & ~1024 /* Async */ | (isStatic2 ? 256 /* Static */ : 0);
|
|
53420
53462
|
const name = getPropertyNameNodeForSymbol(p, context);
|
|
53421
53463
|
const firstPropertyLikeDecl = (_a2 = p.declarations) == null ? void 0 : _a2.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression));
|
|
53422
53464
|
if (p.flags & 98304 /* Accessor */ && useAccessors) {
|
|
@@ -53458,7 +53500,7 @@ ${lanes.join("\n")}
|
|
|
53458
53500
|
));
|
|
53459
53501
|
}
|
|
53460
53502
|
if (p.flags & 32768 /* GetAccessor */) {
|
|
53461
|
-
const isPrivate2 = modifierFlags &
|
|
53503
|
+
const isPrivate2 = modifierFlags & 2 /* Private */;
|
|
53462
53504
|
result.push(setTextRange(
|
|
53463
53505
|
factory.createGetAccessorDeclaration(
|
|
53464
53506
|
factory.createModifiersFromModifierFlags(flag),
|
|
@@ -53475,7 +53517,7 @@ ${lanes.join("\n")}
|
|
|
53475
53517
|
} else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) {
|
|
53476
53518
|
return setTextRange(
|
|
53477
53519
|
createProperty2(
|
|
53478
|
-
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ?
|
|
53520
|
+
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag),
|
|
53479
53521
|
name,
|
|
53480
53522
|
p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
53481
53523
|
isPrivate ? void 0 : serializeTypeForDeclaration(context, getWriteTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled),
|
|
@@ -53490,10 +53532,10 @@ ${lanes.join("\n")}
|
|
|
53490
53532
|
if (p.flags & (8192 /* Method */ | 16 /* Function */)) {
|
|
53491
53533
|
const type = getTypeOfSymbol(p);
|
|
53492
53534
|
const signatures = getSignaturesOfType(type, 0 /* Call */);
|
|
53493
|
-
if (flag &
|
|
53535
|
+
if (flag & 2 /* Private */) {
|
|
53494
53536
|
return setTextRange(
|
|
53495
53537
|
createProperty2(
|
|
53496
|
-
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ?
|
|
53538
|
+
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag),
|
|
53497
53539
|
name,
|
|
53498
53540
|
p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
53499
53541
|
/*type*/
|
|
@@ -53569,7 +53611,7 @@ ${lanes.join("\n")}
|
|
|
53569
53611
|
let privateProtected = 0;
|
|
53570
53612
|
for (const s of signatures) {
|
|
53571
53613
|
if (s.declaration) {
|
|
53572
|
-
privateProtected |= getSelectedEffectiveModifierFlags(s.declaration,
|
|
53614
|
+
privateProtected |= getSelectedEffectiveModifierFlags(s.declaration, 2 /* Private */ | 4 /* Protected */);
|
|
53573
53615
|
}
|
|
53574
53616
|
}
|
|
53575
53617
|
if (privateProtected) {
|
|
@@ -53762,10 +53804,10 @@ ${lanes.join("\n")}
|
|
|
53762
53804
|
return result || types;
|
|
53763
53805
|
}
|
|
53764
53806
|
function visibilityToString(flags) {
|
|
53765
|
-
if (flags ===
|
|
53807
|
+
if (flags === 2 /* Private */) {
|
|
53766
53808
|
return "private";
|
|
53767
53809
|
}
|
|
53768
|
-
if (flags ===
|
|
53810
|
+
if (flags === 4 /* Protected */) {
|
|
53769
53811
|
return "protected";
|
|
53770
53812
|
}
|
|
53771
53813
|
return "public";
|
|
@@ -53883,7 +53925,7 @@ ${lanes.join("\n")}
|
|
|
53883
53925
|
return true;
|
|
53884
53926
|
}
|
|
53885
53927
|
const parent2 = getDeclarationContainer(node);
|
|
53886
|
-
if (!(getCombinedModifierFlagsCached(node) &
|
|
53928
|
+
if (!(getCombinedModifierFlagsCached(node) & 32 /* Export */) && !(node.kind !== 271 /* ImportEqualsDeclaration */ && parent2.kind !== 312 /* SourceFile */ && parent2.flags & 33554432 /* Ambient */)) {
|
|
53887
53929
|
return isGlobalSourceFile(parent2);
|
|
53888
53930
|
}
|
|
53889
53931
|
return isDeclarationVisible(parent2);
|
|
@@ -53893,7 +53935,7 @@ ${lanes.join("\n")}
|
|
|
53893
53935
|
case 178 /* SetAccessor */:
|
|
53894
53936
|
case 174 /* MethodDeclaration */:
|
|
53895
53937
|
case 173 /* MethodSignature */:
|
|
53896
|
-
if (hasEffectiveModifier(node,
|
|
53938
|
+
if (hasEffectiveModifier(node, 2 /* Private */ | 4 /* Protected */)) {
|
|
53897
53939
|
return false;
|
|
53898
53940
|
}
|
|
53899
53941
|
case 176 /* Constructor */:
|
|
@@ -54112,7 +54154,7 @@ ${lanes.join("\n")}
|
|
|
54112
54154
|
const unspreadableToRestKeys = [];
|
|
54113
54155
|
for (const prop of getPropertiesOfType(source)) {
|
|
54114
54156
|
const literalTypeFromProperty = getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */);
|
|
54115
|
-
if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType) && !(getDeclarationModifierFlagsFromSymbol(prop) & (
|
|
54157
|
+
if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType) && !(getDeclarationModifierFlagsFromSymbol(prop) & (2 /* Private */ | 4 /* Protected */)) && isSpreadableProperty(prop)) {
|
|
54116
54158
|
spreadableProperties.push(prop);
|
|
54117
54159
|
} else {
|
|
54118
54160
|
unspreadableToRestKeys.push(literalTypeFromProperty);
|
|
@@ -54318,7 +54360,7 @@ ${lanes.join("\n")}
|
|
|
54318
54360
|
if (declaredType) {
|
|
54319
54361
|
return addOptionality(declaredType, isProperty, isOptional);
|
|
54320
54362
|
}
|
|
54321
|
-
if ((noImplicitAny || isInJSFile(declaration)) && isVariableDeclaration(declaration) && !isBindingPattern(declaration.name) && !(getCombinedModifierFlagsCached(declaration) &
|
|
54363
|
+
if ((noImplicitAny || isInJSFile(declaration)) && isVariableDeclaration(declaration) && !isBindingPattern(declaration.name) && !(getCombinedModifierFlagsCached(declaration) & 32 /* Export */) && !(declaration.flags & 33554432 /* Ambient */)) {
|
|
54322
54364
|
if (!(getCombinedNodeFlagsCached(declaration) & 6 /* Constant */) && (!declaration.initializer || isNullOrUndefined2(declaration.initializer))) {
|
|
54323
54365
|
return autoType;
|
|
54324
54366
|
}
|
|
@@ -54366,7 +54408,7 @@ ${lanes.join("\n")}
|
|
|
54366
54408
|
if (isPropertyDeclaration(declaration) && (noImplicitAny || isInJSFile(declaration))) {
|
|
54367
54409
|
if (!hasStaticModifier(declaration)) {
|
|
54368
54410
|
const constructor = findConstructorDeclaration(declaration.parent);
|
|
54369
|
-
const type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : getEffectiveModifierFlags(declaration) &
|
|
54411
|
+
const type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : getEffectiveModifierFlags(declaration) & 128 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0;
|
|
54370
54412
|
return type && addOptionality(
|
|
54371
54413
|
type,
|
|
54372
54414
|
/*isProperty*/
|
|
@@ -54375,7 +54417,7 @@ ${lanes.join("\n")}
|
|
|
54375
54417
|
);
|
|
54376
54418
|
} else {
|
|
54377
54419
|
const staticBlocks = filter(declaration.parent.members, isClassStaticBlockDeclaration);
|
|
54378
|
-
const type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) : getEffectiveModifierFlags(declaration) &
|
|
54420
|
+
const type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) : getEffectiveModifierFlags(declaration) & 128 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0;
|
|
54379
54421
|
return type && addOptionality(
|
|
54380
54422
|
type,
|
|
54381
54423
|
/*isProperty*/
|
|
@@ -54479,7 +54521,7 @@ ${lanes.join("\n")}
|
|
|
54479
54521
|
return everyType(flowType, isNullableType) ? void 0 : convertAutoToAny(flowType);
|
|
54480
54522
|
}
|
|
54481
54523
|
function getFlowTypeOfProperty(reference, prop) {
|
|
54482
|
-
const initialType = (prop == null ? void 0 : prop.valueDeclaration) && (!isAutoTypedProperty(prop) || getEffectiveModifierFlags(prop.valueDeclaration) &
|
|
54524
|
+
const initialType = (prop == null ? void 0 : prop.valueDeclaration) && (!isAutoTypedProperty(prop) || getEffectiveModifierFlags(prop.valueDeclaration) & 128 /* Ambient */) && getTypeOfPropertyInBaseClass(prop) || undefinedType;
|
|
54483
54525
|
return getFlowTypeOfReference(reference, autoType, initialType);
|
|
54484
54526
|
}
|
|
54485
54527
|
function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) {
|
|
@@ -56132,7 +56174,7 @@ ${lanes.join("\n")}
|
|
|
56132
56174
|
const baseConstructorType = getBaseConstructorTypeOfClass(classType);
|
|
56133
56175
|
const baseSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */);
|
|
56134
56176
|
const declaration = getClassLikeDeclarationOfSymbol(classType.symbol);
|
|
56135
|
-
const isAbstract = !!declaration && hasSyntacticModifier(declaration,
|
|
56177
|
+
const isAbstract = !!declaration && hasSyntacticModifier(declaration, 64 /* Abstract */);
|
|
56136
56178
|
if (baseSignatures.length === 0) {
|
|
56137
56179
|
return [createSignature(
|
|
56138
56180
|
/*declaration*/
|
|
@@ -56908,7 +56950,7 @@ ${lanes.join("\n")}
|
|
|
56908
56950
|
}
|
|
56909
56951
|
function isConstTypeVariable(type, depth = 0) {
|
|
56910
56952
|
var _a;
|
|
56911
|
-
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d,
|
|
56953
|
+
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
56954
|
}
|
|
56913
56955
|
function getConstraintOfIndexedAccess(type) {
|
|
56914
56956
|
return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0;
|
|
@@ -57234,7 +57276,7 @@ ${lanes.join("\n")}
|
|
|
57234
57276
|
} else if (!isUnion && !isReadonlySymbol(prop)) {
|
|
57235
57277
|
checkFlags &= ~8 /* Readonly */;
|
|
57236
57278
|
}
|
|
57237
|
-
checkFlags |= (!(modifiers &
|
|
57279
|
+
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
57280
|
if (!isPrototypeProperty(prop)) {
|
|
57239
57281
|
syntheticFlag = 2 /* SyntheticProperty */;
|
|
57240
57282
|
}
|
|
@@ -57686,7 +57728,7 @@ ${lanes.join("\n")}
|
|
|
57686
57728
|
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
|
|
57687
57729
|
flags |= 1 /* HasRestParameter */;
|
|
57688
57730
|
}
|
|
57689
|
-
if (isConstructorTypeNode(declaration) && hasSyntacticModifier(declaration,
|
|
57731
|
+
if (isConstructorTypeNode(declaration) && hasSyntacticModifier(declaration, 64 /* Abstract */) || isConstructorDeclaration(declaration) && hasSyntacticModifier(declaration.parent, 64 /* Abstract */)) {
|
|
57690
57732
|
flags |= 4 /* Abstract */;
|
|
57691
57733
|
}
|
|
57692
57734
|
links.resolvedSignature = createSignature(
|
|
@@ -58056,7 +58098,7 @@ ${lanes.join("\n")}
|
|
|
58056
58098
|
if (parameter.type) {
|
|
58057
58099
|
forEachType(getTypeFromTypeNode(parameter.type), (keyType) => {
|
|
58058
58100
|
if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) {
|
|
58059
|
-
indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration,
|
|
58101
|
+
indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 8 /* Readonly */), declaration));
|
|
58060
58102
|
}
|
|
58061
58103
|
});
|
|
58062
58104
|
}
|
|
@@ -59881,7 +59923,7 @@ ${lanes.join("\n")}
|
|
|
59881
59923
|
return neverType;
|
|
59882
59924
|
}
|
|
59883
59925
|
function getLiteralTypeFromProperty(prop, include, includeNonPublic) {
|
|
59884
|
-
if (includeNonPublic || !(getDeclarationModifierFlagsFromSymbol(prop) &
|
|
59926
|
+
if (includeNonPublic || !(getDeclarationModifierFlagsFromSymbol(prop) & 6 /* NonPublicAccessibilityModifier */)) {
|
|
59885
59927
|
let type = getSymbolLinks(getLateBoundSymbol(prop)).nameType;
|
|
59886
59928
|
if (!type) {
|
|
59887
59929
|
const name = getNameOfDeclaration(prop.valueDeclaration);
|
|
@@ -60826,7 +60868,7 @@ ${lanes.join("\n")}
|
|
|
60826
60868
|
function getAnonymousPartialType(type2) {
|
|
60827
60869
|
const members = createSymbolTable();
|
|
60828
60870
|
for (const prop of getPropertiesOfType(type2)) {
|
|
60829
|
-
if (getDeclarationModifierFlagsFromSymbol(prop) & (
|
|
60871
|
+
if (getDeclarationModifierFlagsFromSymbol(prop) & (2 /* Private */ | 4 /* Protected */)) {
|
|
60830
60872
|
} else if (isSpreadableProperty(prop)) {
|
|
60831
60873
|
const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
|
|
60832
60874
|
const flags = 4 /* Property */ | 16777216 /* Optional */;
|
|
@@ -60888,7 +60930,7 @@ ${lanes.join("\n")}
|
|
|
60888
60930
|
const skippedPrivateMembers = /* @__PURE__ */ new Set();
|
|
60889
60931
|
const indexInfos = left === emptyObjectType ? getIndexInfosOfType(right) : getUnionIndexInfos([left, right]);
|
|
60890
60932
|
for (const rightProp of getPropertiesOfType(right)) {
|
|
60891
|
-
if (getDeclarationModifierFlagsFromSymbol(rightProp) & (
|
|
60933
|
+
if (getDeclarationModifierFlagsFromSymbol(rightProp) & (2 /* Private */ | 4 /* Protected */)) {
|
|
60892
60934
|
skippedPrivateMembers.add(rightProp.escapedName);
|
|
60893
60935
|
} else if (isSpreadableProperty(rightProp)) {
|
|
60894
60936
|
members.set(rightProp.escapedName, getSpreadSymbol(rightProp, readonly));
|
|
@@ -64455,25 +64497,25 @@ ${lanes.join("\n")}
|
|
|
64455
64497
|
function propertyRelatedTo(source2, target2, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState, skipOptional) {
|
|
64456
64498
|
const sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp);
|
|
64457
64499
|
const targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp);
|
|
64458
|
-
if (sourcePropFlags &
|
|
64500
|
+
if (sourcePropFlags & 2 /* Private */ || targetPropFlags & 2 /* Private */) {
|
|
64459
64501
|
if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) {
|
|
64460
64502
|
if (reportErrors2) {
|
|
64461
|
-
if (sourcePropFlags &
|
|
64503
|
+
if (sourcePropFlags & 2 /* Private */ && targetPropFlags & 2 /* Private */) {
|
|
64462
64504
|
reportError(Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp));
|
|
64463
64505
|
} else {
|
|
64464
|
-
reportError(Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourcePropFlags &
|
|
64506
|
+
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
64507
|
}
|
|
64466
64508
|
}
|
|
64467
64509
|
return 0 /* False */;
|
|
64468
64510
|
}
|
|
64469
|
-
} else if (targetPropFlags &
|
|
64511
|
+
} else if (targetPropFlags & 4 /* Protected */) {
|
|
64470
64512
|
if (!isValidOverrideOf(sourceProp, targetProp)) {
|
|
64471
64513
|
if (reportErrors2) {
|
|
64472
64514
|
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
64515
|
}
|
|
64474
64516
|
return 0 /* False */;
|
|
64475
64517
|
}
|
|
64476
|
-
} else if (sourcePropFlags &
|
|
64518
|
+
} else if (sourcePropFlags & 4 /* Protected */) {
|
|
64477
64519
|
if (reportErrors2) {
|
|
64478
64520
|
reportError(Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source2), typeToString(target2));
|
|
64479
64521
|
}
|
|
@@ -65003,15 +65045,15 @@ ${lanes.join("\n")}
|
|
|
65003
65045
|
if (!sourceSignature.declaration || !targetSignature.declaration) {
|
|
65004
65046
|
return true;
|
|
65005
65047
|
}
|
|
65006
|
-
const sourceAccessibility = getSelectedEffectiveModifierFlags(sourceSignature.declaration,
|
|
65007
|
-
const targetAccessibility = getSelectedEffectiveModifierFlags(targetSignature.declaration,
|
|
65008
|
-
if (targetAccessibility ===
|
|
65048
|
+
const sourceAccessibility = getSelectedEffectiveModifierFlags(sourceSignature.declaration, 6 /* NonPublicAccessibilityModifier */);
|
|
65049
|
+
const targetAccessibility = getSelectedEffectiveModifierFlags(targetSignature.declaration, 6 /* NonPublicAccessibilityModifier */);
|
|
65050
|
+
if (targetAccessibility === 2 /* Private */) {
|
|
65009
65051
|
return true;
|
|
65010
65052
|
}
|
|
65011
|
-
if (targetAccessibility ===
|
|
65053
|
+
if (targetAccessibility === 4 /* Protected */ && sourceAccessibility !== 2 /* Private */) {
|
|
65012
65054
|
return true;
|
|
65013
65055
|
}
|
|
65014
|
-
if (targetAccessibility !==
|
|
65056
|
+
if (targetAccessibility !== 4 /* Protected */ && !sourceAccessibility) {
|
|
65015
65057
|
return true;
|
|
65016
65058
|
}
|
|
65017
65059
|
if (reportErrors2) {
|
|
@@ -65111,7 +65153,7 @@ ${lanes.join("\n")}
|
|
|
65111
65153
|
const variances = [];
|
|
65112
65154
|
for (const tp of typeParameters) {
|
|
65113
65155
|
const modifiers = getTypeParameterModifiers(tp);
|
|
65114
|
-
let variance = modifiers &
|
|
65156
|
+
let variance = modifiers & 16384 /* Out */ ? modifiers & 8192 /* In */ ? 0 /* Invariant */ : 1 /* Covariant */ : modifiers & 8192 /* In */ ? 2 /* Contravariant */ : void 0;
|
|
65115
65157
|
if (variance === void 0) {
|
|
65116
65158
|
let unmeasurable = false;
|
|
65117
65159
|
let unreliable = false;
|
|
@@ -65159,7 +65201,7 @@ ${lanes.join("\n")}
|
|
|
65159
65201
|
}
|
|
65160
65202
|
function getTypeParameterModifiers(tp) {
|
|
65161
65203
|
var _a;
|
|
65162
|
-
return reduceLeft((_a = tp.symbol) == null ? void 0 : _a.declarations, (modifiers, d) => modifiers | getEffectiveModifierFlags(d), 0 /* None */) & (
|
|
65204
|
+
return reduceLeft((_a = tp.symbol) == null ? void 0 : _a.declarations, (modifiers, d) => modifiers | getEffectiveModifierFlags(d), 0 /* None */) & (8192 /* In */ | 16384 /* Out */ | 4096 /* Const */);
|
|
65163
65205
|
}
|
|
65164
65206
|
function hasCovariantVoidArgument(typeArguments, variances) {
|
|
65165
65207
|
for (let i = 0; i < variances.length; i++) {
|
|
@@ -65244,10 +65286,10 @@ ${lanes.join("\n")}
|
|
|
65244
65286
|
});
|
|
65245
65287
|
}
|
|
65246
65288
|
function isValidOverrideOf(sourceProp, targetProp) {
|
|
65247
|
-
return !forEachProperty2(targetProp, (tp) => getDeclarationModifierFlagsFromSymbol(tp) &
|
|
65289
|
+
return !forEachProperty2(targetProp, (tp) => getDeclarationModifierFlagsFromSymbol(tp) & 4 /* Protected */ ? !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false);
|
|
65248
65290
|
}
|
|
65249
65291
|
function isClassDerivedFromDeclaringClasses(checkClass, prop, writing) {
|
|
65250
|
-
return forEachProperty2(prop, (p) => getDeclarationModifierFlagsFromSymbol(p, writing) &
|
|
65292
|
+
return forEachProperty2(prop, (p) => getDeclarationModifierFlagsFromSymbol(p, writing) & 4 /* Protected */ ? !hasBaseType(checkClass, getDeclaringClass(p)) : false) ? void 0 : checkClass;
|
|
65251
65293
|
}
|
|
65252
65294
|
function isDeeplyNestedType(type, stack, depth, maxDepth = 3) {
|
|
65253
65295
|
if (depth >= maxDepth) {
|
|
@@ -65324,8 +65366,8 @@ ${lanes.join("\n")}
|
|
|
65324
65366
|
if (sourceProp === targetProp) {
|
|
65325
65367
|
return -1 /* True */;
|
|
65326
65368
|
}
|
|
65327
|
-
const sourcePropAccessibility = getDeclarationModifierFlagsFromSymbol(sourceProp) &
|
|
65328
|
-
const targetPropAccessibility = getDeclarationModifierFlagsFromSymbol(targetProp) &
|
|
65369
|
+
const sourcePropAccessibility = getDeclarationModifierFlagsFromSymbol(sourceProp) & 6 /* NonPublicAccessibilityModifier */;
|
|
65370
|
+
const targetPropAccessibility = getDeclarationModifierFlagsFromSymbol(targetProp) & 6 /* NonPublicAccessibilityModifier */;
|
|
65329
65371
|
if (sourcePropAccessibility !== targetPropAccessibility) {
|
|
65330
65372
|
return 0 /* False */;
|
|
65331
65373
|
}
|
|
@@ -69319,7 +69361,7 @@ ${lanes.join("\n")}
|
|
|
69319
69361
|
if (languageVersion < 2 /* ES2015 */) {
|
|
69320
69362
|
if (container.kind === 219 /* ArrowFunction */) {
|
|
69321
69363
|
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,
|
|
69364
|
+
} else if (hasSyntacticModifier(container, 1024 /* Async */)) {
|
|
69323
69365
|
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
69366
|
}
|
|
69325
69367
|
}
|
|
@@ -69732,7 +69774,7 @@ ${lanes.join("\n")}
|
|
|
69732
69774
|
let inAsyncFunction = false;
|
|
69733
69775
|
if (!isCallExpression2) {
|
|
69734
69776
|
while (container && container.kind === 219 /* ArrowFunction */) {
|
|
69735
|
-
if (hasSyntacticModifier(container,
|
|
69777
|
+
if (hasSyntacticModifier(container, 1024 /* Async */))
|
|
69736
69778
|
inAsyncFunction = true;
|
|
69737
69779
|
container = getSuperContainer(
|
|
69738
69780
|
container,
|
|
@@ -69741,7 +69783,7 @@ ${lanes.join("\n")}
|
|
|
69741
69783
|
);
|
|
69742
69784
|
needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */;
|
|
69743
69785
|
}
|
|
69744
|
-
if (container && hasSyntacticModifier(container,
|
|
69786
|
+
if (container && hasSyntacticModifier(container, 1024 /* Async */))
|
|
69745
69787
|
inAsyncFunction = true;
|
|
69746
69788
|
}
|
|
69747
69789
|
let nodeCheckFlag = 0;
|
|
@@ -71929,20 +71971,20 @@ ${lanes.join("\n")}
|
|
|
71929
71971
|
return false;
|
|
71930
71972
|
}
|
|
71931
71973
|
}
|
|
71932
|
-
if (flags &
|
|
71974
|
+
if (flags & 64 /* Abstract */) {
|
|
71933
71975
|
if (errorNode) {
|
|
71934
71976
|
error2(errorNode, Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop)));
|
|
71935
71977
|
}
|
|
71936
71978
|
return false;
|
|
71937
71979
|
}
|
|
71938
|
-
if (!(flags &
|
|
71980
|
+
if (!(flags & 256 /* Static */) && ((_a = prop.declarations) == null ? void 0 : _a.some(isClassInstanceProperty))) {
|
|
71939
71981
|
if (errorNode) {
|
|
71940
71982
|
error2(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString(prop));
|
|
71941
71983
|
}
|
|
71942
71984
|
return false;
|
|
71943
71985
|
}
|
|
71944
71986
|
}
|
|
71945
|
-
if (flags &
|
|
71987
|
+
if (flags & 64 /* Abstract */ && symbolHasNonMethodDeclaration(prop) && (isThisProperty(location) || isThisInitializedObjectBindingExpression(location) || isObjectBindingPattern(location.parent) && isThisInitializedDeclaration(location.parent.parent))) {
|
|
71946
71988
|
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
|
|
71947
71989
|
if (declaringClassDeclaration && isNodeUsedDuringClassInitialization(location)) {
|
|
71948
71990
|
if (errorNode) {
|
|
@@ -71951,10 +71993,10 @@ ${lanes.join("\n")}
|
|
|
71951
71993
|
return false;
|
|
71952
71994
|
}
|
|
71953
71995
|
}
|
|
71954
|
-
if (!(flags &
|
|
71996
|
+
if (!(flags & 6 /* NonPublicAccessibilityModifier */)) {
|
|
71955
71997
|
return true;
|
|
71956
71998
|
}
|
|
71957
|
-
if (flags &
|
|
71999
|
+
if (flags & 2 /* Private */) {
|
|
71958
72000
|
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
|
|
71959
72001
|
if (!isNodeWithinClass(location, declaringClassDeclaration)) {
|
|
71960
72002
|
if (errorNode) {
|
|
@@ -71974,14 +72016,14 @@ ${lanes.join("\n")}
|
|
|
71974
72016
|
if (!enclosingClass) {
|
|
71975
72017
|
enclosingClass = getEnclosingClassFromThisParameter(location);
|
|
71976
72018
|
enclosingClass = enclosingClass && isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing);
|
|
71977
|
-
if (flags &
|
|
72019
|
+
if (flags & 256 /* Static */ || !enclosingClass) {
|
|
71978
72020
|
if (errorNode) {
|
|
71979
72021
|
error2(errorNode, Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || containingType));
|
|
71980
72022
|
}
|
|
71981
72023
|
return false;
|
|
71982
72024
|
}
|
|
71983
72025
|
}
|
|
71984
|
-
if (flags &
|
|
72026
|
+
if (flags & 256 /* Static */) {
|
|
71985
72027
|
return true;
|
|
71986
72028
|
}
|
|
71987
72029
|
if (containingType.flags & 262144 /* TypeParameter */) {
|
|
@@ -72401,7 +72443,7 @@ ${lanes.join("\n")}
|
|
|
72401
72443
|
}
|
|
72402
72444
|
let diagnosticMessage;
|
|
72403
72445
|
const declarationName = idText(right);
|
|
72404
|
-
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) &
|
|
72446
|
+
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 256 /* Static */) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) {
|
|
72405
72447
|
diagnosticMessage = error2(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
|
|
72406
72448
|
} else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
|
|
72407
72449
|
diagnosticMessage = error2(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
@@ -72655,7 +72697,7 @@ ${lanes.join("\n")}
|
|
|
72655
72697
|
if (!valueDeclaration) {
|
|
72656
72698
|
return;
|
|
72657
72699
|
}
|
|
72658
|
-
const hasPrivateModifier = hasEffectiveModifier(valueDeclaration,
|
|
72700
|
+
const hasPrivateModifier = hasEffectiveModifier(valueDeclaration, 2 /* Private */);
|
|
72659
72701
|
const hasPrivateIdentifier = prop.valueDeclaration && isNamedDeclaration(prop.valueDeclaration) && isPrivateIdentifier(prop.valueDeclaration.name);
|
|
72660
72702
|
if (!hasPrivateModifier && !hasPrivateIdentifier) {
|
|
72661
72703
|
return;
|
|
@@ -74100,7 +74142,7 @@ ${lanes.join("\n")}
|
|
|
74100
74142
|
return resolveErrorCall(node);
|
|
74101
74143
|
}
|
|
74102
74144
|
const valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol);
|
|
74103
|
-
if (valueDecl && hasSyntacticModifier(valueDecl,
|
|
74145
|
+
if (valueDecl && hasSyntacticModifier(valueDecl, 64 /* Abstract */)) {
|
|
74104
74146
|
error2(node, Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
|
|
74105
74147
|
return resolveErrorCall(node);
|
|
74106
74148
|
}
|
|
@@ -74163,7 +74205,7 @@ ${lanes.join("\n")}
|
|
|
74163
74205
|
return true;
|
|
74164
74206
|
}
|
|
74165
74207
|
const declaration = signature.declaration;
|
|
74166
|
-
const modifiers = getSelectedEffectiveModifierFlags(declaration,
|
|
74208
|
+
const modifiers = getSelectedEffectiveModifierFlags(declaration, 6 /* NonPublicAccessibilityModifier */);
|
|
74167
74209
|
if (!modifiers || declaration.kind !== 176 /* Constructor */) {
|
|
74168
74210
|
return true;
|
|
74169
74211
|
}
|
|
@@ -74171,16 +74213,16 @@ ${lanes.join("\n")}
|
|
|
74171
74213
|
const declaringClass = getDeclaredTypeOfSymbol(declaration.parent.symbol);
|
|
74172
74214
|
if (!isNodeWithinClass(node, declaringClassDeclaration)) {
|
|
74173
74215
|
const containingClass = getContainingClass(node);
|
|
74174
|
-
if (containingClass && modifiers &
|
|
74216
|
+
if (containingClass && modifiers & 4 /* Protected */) {
|
|
74175
74217
|
const containingType = getTypeOfNode(containingClass);
|
|
74176
74218
|
if (typeHasProtectedAccessibleBase(declaration.parent.symbol, containingType)) {
|
|
74177
74219
|
return true;
|
|
74178
74220
|
}
|
|
74179
74221
|
}
|
|
74180
|
-
if (modifiers &
|
|
74222
|
+
if (modifiers & 2 /* Private */) {
|
|
74181
74223
|
error2(node, Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration, typeToString(declaringClass));
|
|
74182
74224
|
}
|
|
74183
|
-
if (modifiers &
|
|
74225
|
+
if (modifiers & 4 /* Protected */) {
|
|
74184
74226
|
error2(node, Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration, typeToString(declaringClass));
|
|
74185
74227
|
}
|
|
74186
74228
|
return false;
|
|
@@ -76157,7 +76199,7 @@ ${lanes.join("\n")}
|
|
|
76157
76199
|
return !setProp;
|
|
76158
76200
|
}
|
|
76159
76201
|
function isReadonlySymbol(symbol) {
|
|
76160
|
-
return !!(getCheckFlags(symbol) & 8 /* Readonly */ || symbol.flags & 4 /* Property */ && getDeclarationModifierFlagsFromSymbol(symbol) &
|
|
76202
|
+
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
76203
|
}
|
|
76162
76204
|
function isAssignmentToReadonlyEntity(expr, symbol, assignmentKind) {
|
|
76163
76205
|
var _a, _b;
|
|
@@ -77895,15 +77937,15 @@ ${lanes.join("\n")}
|
|
|
77895
77937
|
var _a, _b;
|
|
77896
77938
|
if (isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent)) {
|
|
77897
77939
|
const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node));
|
|
77898
|
-
const modifiers = getTypeParameterModifiers(typeParameter) & (
|
|
77940
|
+
const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
|
|
77899
77941
|
if (modifiers) {
|
|
77900
77942
|
const symbol = getSymbolOfDeclaration(node.parent);
|
|
77901
77943
|
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
77902
77944
|
error2(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
77903
|
-
} else if (modifiers ===
|
|
77945
|
+
} else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
|
|
77904
77946
|
(_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 ===
|
|
77947
|
+
const source = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSubTypeForCheck : markerSuperTypeForCheck);
|
|
77948
|
+
const target = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSuperTypeForCheck : markerSubTypeForCheck);
|
|
77907
77949
|
const saveVarianceTypeParameter = typeParameter;
|
|
77908
77950
|
varianceTypeParameter = typeParameter;
|
|
77909
77951
|
checkTypeAssignableTo(source, target, node, Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation);
|
|
@@ -77917,7 +77959,7 @@ ${lanes.join("\n")}
|
|
|
77917
77959
|
checkGrammarModifiers(node);
|
|
77918
77960
|
checkVariableLikeDeclaration(node);
|
|
77919
77961
|
const func = getContainingFunction(node);
|
|
77920
|
-
if (hasSyntacticModifier(node,
|
|
77962
|
+
if (hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) {
|
|
77921
77963
|
if (!(func.kind === 176 /* Constructor */ && nodeIsPresent(func.body))) {
|
|
77922
77964
|
error2(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
|
|
77923
77965
|
}
|
|
@@ -78249,7 +78291,7 @@ ${lanes.join("\n")}
|
|
|
78249
78291
|
checkGrammarComputedPropertyName(node.name);
|
|
78250
78292
|
checkVariableLikeDeclaration(node);
|
|
78251
78293
|
setNodeLinksForPrivateIdentifierScope(node);
|
|
78252
|
-
if (hasSyntacticModifier(node,
|
|
78294
|
+
if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 172 /* PropertyDeclaration */ && node.initializer) {
|
|
78253
78295
|
error2(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name));
|
|
78254
78296
|
}
|
|
78255
78297
|
}
|
|
@@ -78266,7 +78308,7 @@ ${lanes.join("\n")}
|
|
|
78266
78308
|
error2(node.name, Diagnostics.Class_constructor_may_not_be_a_generator);
|
|
78267
78309
|
}
|
|
78268
78310
|
checkFunctionOrMethodDeclaration(node);
|
|
78269
|
-
if (hasSyntacticModifier(node,
|
|
78311
|
+
if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 174 /* MethodDeclaration */ && node.body) {
|
|
78270
78312
|
error2(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name));
|
|
78271
78313
|
}
|
|
78272
78314
|
if (isPrivateIdentifier(node.name) && !getContainingClass(node)) {
|
|
@@ -78323,7 +78365,7 @@ ${lanes.join("\n")}
|
|
|
78323
78365
|
if (classExtendsNull) {
|
|
78324
78366
|
error2(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
|
|
78325
78367
|
}
|
|
78326
|
-
const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p,
|
|
78368
|
+
const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 31 /* ParameterPropertyModifier */)));
|
|
78327
78369
|
if (superCallShouldBeRootLevel) {
|
|
78328
78370
|
if (!superCallIsRootLevelInConstructor(superCall, node.body)) {
|
|
78329
78371
|
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 +78434,11 @@ ${lanes.join("\n")}
|
|
|
78392
78434
|
getNodeLinks(getter).flags |= 1 /* TypeChecked */;
|
|
78393
78435
|
const getterFlags = getEffectiveModifierFlags(getter);
|
|
78394
78436
|
const setterFlags = getEffectiveModifierFlags(setter);
|
|
78395
|
-
if ((getterFlags &
|
|
78437
|
+
if ((getterFlags & 64 /* Abstract */) !== (setterFlags & 64 /* Abstract */)) {
|
|
78396
78438
|
error2(getter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract);
|
|
78397
78439
|
error2(setter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract);
|
|
78398
78440
|
}
|
|
78399
|
-
if (getterFlags &
|
|
78441
|
+
if (getterFlags & 4 /* Protected */ && !(setterFlags & (4 /* Protected */ | 2 /* Private */)) || getterFlags & 2 /* Private */ && !(setterFlags & 2 /* Private */)) {
|
|
78400
78442
|
error2(getter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter);
|
|
78401
78443
|
error2(setter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter);
|
|
78402
78444
|
}
|
|
@@ -78576,7 +78618,7 @@ ${lanes.join("\n")}
|
|
|
78576
78618
|
const propertyName = getPropertyNameFromIndex(indexType, accessNode);
|
|
78577
78619
|
if (propertyName) {
|
|
78578
78620
|
const propertySymbol = forEachType(apparentObjectType, (t) => getPropertyOfType(t, propertyName));
|
|
78579
|
-
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) &
|
|
78621
|
+
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6 /* NonPublicAccessibilityModifier */) {
|
|
78580
78622
|
error2(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, unescapeLeadingUnderscores(propertyName));
|
|
78581
78623
|
return errorType;
|
|
78582
78624
|
}
|
|
@@ -78674,16 +78716,16 @@ ${lanes.join("\n")}
|
|
|
78674
78716
|
getTypeFromTypeNode(node);
|
|
78675
78717
|
}
|
|
78676
78718
|
function isPrivateWithinAmbient(node) {
|
|
78677
|
-
return (hasEffectiveModifier(node,
|
|
78719
|
+
return (hasEffectiveModifier(node, 2 /* Private */) || isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags & 33554432 /* Ambient */);
|
|
78678
78720
|
}
|
|
78679
78721
|
function getEffectiveDeclarationFlags(n, flagsToCheck) {
|
|
78680
78722
|
let flags = getCombinedModifierFlagsCached(n);
|
|
78681
78723
|
if (n.parent.kind !== 264 /* InterfaceDeclaration */ && n.parent.kind !== 263 /* ClassDeclaration */ && n.parent.kind !== 231 /* ClassExpression */ && n.flags & 33554432 /* Ambient */) {
|
|
78682
78724
|
const container = getEnclosingContainer(n);
|
|
78683
|
-
if (container && container.flags & 128 /* ExportContext */ && !(flags &
|
|
78684
|
-
flags |=
|
|
78725
|
+
if (container && container.flags & 128 /* ExportContext */ && !(flags & 128 /* Ambient */) && !(isModuleBlock(n.parent) && isModuleDeclaration(n.parent.parent) && isGlobalScopeAugmentation(n.parent.parent))) {
|
|
78726
|
+
flags |= 32 /* Export */;
|
|
78685
78727
|
}
|
|
78686
|
-
flags |=
|
|
78728
|
+
flags |= 128 /* Ambient */;
|
|
78687
78729
|
}
|
|
78688
78730
|
return flags & flagsToCheck;
|
|
78689
78731
|
}
|
|
@@ -78701,13 +78743,13 @@ ${lanes.join("\n")}
|
|
|
78701
78743
|
const canonicalFlags = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck2);
|
|
78702
78744
|
forEach(overloads, (o) => {
|
|
78703
78745
|
const deviation = getEffectiveDeclarationFlags(o, flagsToCheck2) ^ canonicalFlags;
|
|
78704
|
-
if (deviation &
|
|
78746
|
+
if (deviation & 32 /* Export */) {
|
|
78705
78747
|
error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported);
|
|
78706
|
-
} else if (deviation &
|
|
78748
|
+
} else if (deviation & 128 /* Ambient */) {
|
|
78707
78749
|
error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient);
|
|
78708
|
-
} else if (deviation & (
|
|
78750
|
+
} else if (deviation & (2 /* Private */ | 4 /* Protected */)) {
|
|
78709
78751
|
error2(getNameOfDeclaration(o) || o, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected);
|
|
78710
|
-
} else if (deviation &
|
|
78752
|
+
} else if (deviation & 64 /* Abstract */) {
|
|
78711
78753
|
error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract);
|
|
78712
78754
|
}
|
|
78713
78755
|
});
|
|
@@ -78724,7 +78766,7 @@ ${lanes.join("\n")}
|
|
|
78724
78766
|
});
|
|
78725
78767
|
}
|
|
78726
78768
|
}
|
|
78727
|
-
const flagsToCheck =
|
|
78769
|
+
const flagsToCheck = 32 /* Export */ | 128 /* Ambient */ | 2 /* Private */ | 4 /* Protected */ | 64 /* Abstract */;
|
|
78728
78770
|
let someNodeFlags = 0 /* None */;
|
|
78729
78771
|
let allNodeFlags = flagsToCheck;
|
|
78730
78772
|
let someHaveQuestionToken = false;
|
|
@@ -78772,7 +78814,7 @@ ${lanes.join("\n")}
|
|
|
78772
78814
|
if (isConstructor) {
|
|
78773
78815
|
error2(errorNode, Diagnostics.Constructor_implementation_is_missing);
|
|
78774
78816
|
} else {
|
|
78775
|
-
if (hasSyntacticModifier(node,
|
|
78817
|
+
if (hasSyntacticModifier(node, 64 /* Abstract */)) {
|
|
78776
78818
|
error2(errorNode, Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive);
|
|
78777
78819
|
} else {
|
|
78778
78820
|
error2(errorNode, Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration);
|
|
@@ -78858,7 +78900,7 @@ ${lanes.join("\n")}
|
|
|
78858
78900
|
}
|
|
78859
78901
|
});
|
|
78860
78902
|
}
|
|
78861
|
-
if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && !hasSyntacticModifier(lastSeenNonAmbientDeclaration,
|
|
78903
|
+
if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && !hasSyntacticModifier(lastSeenNonAmbientDeclaration, 64 /* Abstract */) && !lastSeenNonAmbientDeclaration.questionToken) {
|
|
78862
78904
|
reportImplementationExpectedError(lastSeenNonAmbientDeclaration);
|
|
78863
78905
|
}
|
|
78864
78906
|
if (hasOverloads) {
|
|
@@ -78901,9 +78943,9 @@ ${lanes.join("\n")}
|
|
|
78901
78943
|
let defaultExportedDeclarationSpaces = 0 /* None */;
|
|
78902
78944
|
for (const d of symbol.declarations) {
|
|
78903
78945
|
const declarationSpaces = getDeclarationSpaces(d);
|
|
78904
|
-
const effectiveDeclarationFlags = getEffectiveDeclarationFlags(d,
|
|
78905
|
-
if (effectiveDeclarationFlags &
|
|
78906
|
-
if (effectiveDeclarationFlags &
|
|
78946
|
+
const effectiveDeclarationFlags = getEffectiveDeclarationFlags(d, 32 /* Export */ | 2048 /* Default */);
|
|
78947
|
+
if (effectiveDeclarationFlags & 32 /* Export */) {
|
|
78948
|
+
if (effectiveDeclarationFlags & 2048 /* Default */) {
|
|
78907
78949
|
defaultExportedDeclarationSpaces |= declarationSpaces;
|
|
78908
78950
|
} else {
|
|
78909
78951
|
exportedDeclarationSpaces |= declarationSpaces;
|
|
@@ -79544,6 +79586,12 @@ ${lanes.join("\n")}
|
|
|
79544
79586
|
}
|
|
79545
79587
|
}
|
|
79546
79588
|
}
|
|
79589
|
+
function checkJSDocThisTag(node) {
|
|
79590
|
+
const host2 = getEffectiveJSDocHost(node);
|
|
79591
|
+
if (host2 && isArrowFunction(host2)) {
|
|
79592
|
+
error2(node.tagName, Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
|
|
79593
|
+
}
|
|
79594
|
+
}
|
|
79547
79595
|
function checkJSDocImplementsTag(node) {
|
|
79548
79596
|
const classLike = getEffectiveJSDocHost(node);
|
|
79549
79597
|
if (!classLike || !isClassDeclaration(classLike) && !isClassExpression(classLike)) {
|
|
@@ -79706,13 +79754,13 @@ ${lanes.join("\n")}
|
|
|
79706
79754
|
break;
|
|
79707
79755
|
}
|
|
79708
79756
|
const symbol = getSymbolOfDeclaration(member);
|
|
79709
|
-
if (!symbol.isReferenced && (hasEffectiveModifier(member,
|
|
79757
|
+
if (!symbol.isReferenced && (hasEffectiveModifier(member, 2 /* Private */) || isNamedDeclaration(member) && isPrivateIdentifier(member.name)) && !(member.flags & 33554432 /* Ambient */)) {
|
|
79710
79758
|
addDiagnostic(member, 0 /* Local */, createDiagnosticForNode(member.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
|
|
79711
79759
|
}
|
|
79712
79760
|
break;
|
|
79713
79761
|
case 176 /* Constructor */:
|
|
79714
79762
|
for (const parameter of member.parameters) {
|
|
79715
|
-
if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter,
|
|
79763
|
+
if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter, 2 /* Private */)) {
|
|
79716
79764
|
addDiagnostic(parameter, 0 /* Local */, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol)));
|
|
79717
79765
|
}
|
|
79718
79766
|
}
|
|
@@ -80288,7 +80336,7 @@ ${lanes.join("\n")}
|
|
|
80288
80336
|
if (hasQuestionToken(left) !== hasQuestionToken(right)) {
|
|
80289
80337
|
return false;
|
|
80290
80338
|
}
|
|
80291
|
-
const interestingFlags =
|
|
80339
|
+
const interestingFlags = 2 /* Private */ | 4 /* Protected */ | 1024 /* Async */ | 64 /* Abstract */ | 8 /* Readonly */ | 256 /* Static */;
|
|
80292
80340
|
return getSelectedEffectiveModifierFlags(left, interestingFlags) === getSelectedEffectiveModifierFlags(right, interestingFlags);
|
|
80293
80341
|
}
|
|
80294
80342
|
function checkVariableDeclaration(node) {
|
|
@@ -81616,7 +81664,7 @@ ${lanes.join("\n")}
|
|
|
81616
81664
|
if (legacyDecorators && firstDecorator && some(node.members, (p) => hasStaticModifier(p) && isPrivateIdentifierClassElementDeclaration(p))) {
|
|
81617
81665
|
grammarErrorOnNode(firstDecorator, Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator);
|
|
81618
81666
|
}
|
|
81619
|
-
if (!node.name && !hasSyntacticModifier(node,
|
|
81667
|
+
if (!node.name && !hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
81620
81668
|
grammarErrorOnFirstToken(node, Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name);
|
|
81621
81669
|
}
|
|
81622
81670
|
checkClassLikeDeclaration(node);
|
|
@@ -81682,7 +81730,7 @@ ${lanes.join("\n")}
|
|
|
81682
81730
|
error2(node.name || node, Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any);
|
|
81683
81731
|
} else {
|
|
81684
81732
|
const constructSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */);
|
|
81685
|
-
if (constructSignatures.some((signature) => signature.flags & 4 /* Abstract */) && !hasSyntacticModifier(node,
|
|
81733
|
+
if (constructSignatures.some((signature) => signature.flags & 4 /* Abstract */) && !hasSyntacticModifier(node, 64 /* Abstract */)) {
|
|
81686
81734
|
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
81735
|
}
|
|
81688
81736
|
}
|
|
@@ -81896,7 +81944,7 @@ ${lanes.join("\n")}
|
|
|
81896
81944
|
const signatures = getSignaturesOfType(type, 1 /* Construct */);
|
|
81897
81945
|
if (signatures.length) {
|
|
81898
81946
|
const declaration = signatures[0].declaration;
|
|
81899
|
-
if (declaration && hasEffectiveModifier(declaration,
|
|
81947
|
+
if (declaration && hasEffectiveModifier(declaration, 2 /* Private */)) {
|
|
81900
81948
|
const typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol);
|
|
81901
81949
|
if (!isNodeWithinClass(node, typeClassDeclaration)) {
|
|
81902
81950
|
error2(node, Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol));
|
|
@@ -81916,7 +81964,7 @@ ${lanes.join("\n")}
|
|
|
81916
81964
|
const baseTypes = baseTypeNode && getBaseTypes(type);
|
|
81917
81965
|
const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0;
|
|
81918
81966
|
const baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
81919
|
-
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member,
|
|
81967
|
+
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16 /* Override */);
|
|
81920
81968
|
return checkMemberForOverrideModifier(
|
|
81921
81969
|
node,
|
|
81922
81970
|
staticType,
|
|
@@ -81957,7 +82005,7 @@ ${lanes.join("\n")}
|
|
|
81957
82005
|
Debug.assert(!!derived, "derived should point to something, even if it is the base class' declaration.");
|
|
81958
82006
|
if (derived === base) {
|
|
81959
82007
|
const derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol);
|
|
81960
|
-
if (baseDeclarationFlags &
|
|
82008
|
+
if (baseDeclarationFlags & 64 /* Abstract */ && (!derivedClassDecl || !hasSyntacticModifier(derivedClassDecl, 64 /* Abstract */))) {
|
|
81961
82009
|
for (const otherBaseType of getBaseTypes(type)) {
|
|
81962
82010
|
if (otherBaseType === baseType)
|
|
81963
82011
|
continue;
|
|
@@ -82000,7 +82048,7 @@ ${lanes.join("\n")}
|
|
|
82000
82048
|
}
|
|
82001
82049
|
} else {
|
|
82002
82050
|
const derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived);
|
|
82003
|
-
if (baseDeclarationFlags &
|
|
82051
|
+
if (baseDeclarationFlags & 2 /* Private */ || derivedDeclarationFlags & 2 /* Private */) {
|
|
82004
82052
|
continue;
|
|
82005
82053
|
}
|
|
82006
82054
|
let errorMessage;
|
|
@@ -82017,7 +82065,7 @@ ${lanes.join("\n")}
|
|
|
82017
82065
|
error2(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
82018
82066
|
} else if (useDefineForClassFields) {
|
|
82019
82067
|
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 &
|
|
82068
|
+
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
82069
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
82022
82070
|
const propName = uninitialized.name;
|
|
82023
82071
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -82044,7 +82092,7 @@ ${lanes.join("\n")}
|
|
|
82044
82092
|
}
|
|
82045
82093
|
}
|
|
82046
82094
|
function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
|
|
82047
|
-
return baseDeclarationFlags &
|
|
82095
|
+
return baseDeclarationFlags & 64 /* Abstract */ && (!isPropertyDeclaration(declaration) || !declaration.initializer) || isInterfaceDeclaration(declaration.parent);
|
|
82048
82096
|
}
|
|
82049
82097
|
function getNonInheritedProperties(type, baseTypes, properties) {
|
|
82050
82098
|
if (!length(baseTypes)) {
|
|
@@ -82109,7 +82157,7 @@ ${lanes.join("\n")}
|
|
|
82109
82157
|
}
|
|
82110
82158
|
const constructor = findConstructorDeclaration(node);
|
|
82111
82159
|
for (const member of node.members) {
|
|
82112
|
-
if (getEffectiveModifierFlags(member) &
|
|
82160
|
+
if (getEffectiveModifierFlags(member) & 128 /* Ambient */) {
|
|
82113
82161
|
continue;
|
|
82114
82162
|
}
|
|
82115
82163
|
if (!isStatic(member) && isPropertyWithoutInitializer(member)) {
|
|
@@ -82696,7 +82744,7 @@ ${lanes.join("\n")}
|
|
|
82696
82744
|
name
|
|
82697
82745
|
);
|
|
82698
82746
|
}
|
|
82699
|
-
if (isType && node.kind === 271 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node,
|
|
82747
|
+
if (isType && node.kind === 271 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 32 /* Export */)) {
|
|
82700
82748
|
error2(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, isolatedModulesLikeFlagName);
|
|
82701
82749
|
}
|
|
82702
82750
|
break;
|
|
@@ -82818,7 +82866,7 @@ ${lanes.join("\n")}
|
|
|
82818
82866
|
checkGrammarModifiers(node);
|
|
82819
82867
|
if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
|
|
82820
82868
|
checkImportBinding(node);
|
|
82821
|
-
if (hasSyntacticModifier(node,
|
|
82869
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
82822
82870
|
markExportAsReferenced(node);
|
|
82823
82871
|
}
|
|
82824
82872
|
if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
|
|
@@ -83230,6 +83278,8 @@ ${lanes.join("\n")}
|
|
|
83230
83278
|
return checkJSDocAccessibilityModifiers(node);
|
|
83231
83279
|
case 357 /* JSDocSatisfiesTag */:
|
|
83232
83280
|
return checkJSDocSatisfiesTag(node);
|
|
83281
|
+
case 350 /* JSDocThisTag */:
|
|
83282
|
+
return checkJSDocThisTag(node);
|
|
83233
83283
|
case 199 /* IndexedAccessType */:
|
|
83234
83284
|
return checkIndexedAccessType(node);
|
|
83235
83285
|
case 200 /* MappedType */:
|
|
@@ -84456,7 +84506,7 @@ ${lanes.join("\n")}
|
|
|
84456
84506
|
return true;
|
|
84457
84507
|
}
|
|
84458
84508
|
const target = getSymbolLinks(symbol).aliasTarget;
|
|
84459
|
-
if (target && getEffectiveModifierFlags(node) &
|
|
84509
|
+
if (target && getEffectiveModifierFlags(node) & 32 /* Export */ && getSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
|
|
84460
84510
|
return true;
|
|
84461
84511
|
}
|
|
84462
84512
|
}
|
|
@@ -84481,10 +84531,10 @@ ${lanes.join("\n")}
|
|
|
84481
84531
|
return false;
|
|
84482
84532
|
}
|
|
84483
84533
|
function isRequiredInitializedParameter(parameter) {
|
|
84484
|
-
return !!strictNullChecks && !isOptionalParameter(parameter) && !isJSDocParameterTag(parameter) && !!parameter.initializer && !hasSyntacticModifier(parameter,
|
|
84534
|
+
return !!strictNullChecks && !isOptionalParameter(parameter) && !isJSDocParameterTag(parameter) && !!parameter.initializer && !hasSyntacticModifier(parameter, 31 /* ParameterPropertyModifier */);
|
|
84485
84535
|
}
|
|
84486
84536
|
function isOptionalUninitializedParameterProperty(parameter) {
|
|
84487
|
-
return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && hasSyntacticModifier(parameter,
|
|
84537
|
+
return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && hasSyntacticModifier(parameter, 31 /* ParameterPropertyModifier */);
|
|
84488
84538
|
}
|
|
84489
84539
|
function isExpandoFunctionDeclaration(node) {
|
|
84490
84540
|
const declaration = getParseTreeNode(node, isFunctionDeclaration);
|
|
@@ -85338,10 +85388,10 @@ ${lanes.join("\n")}
|
|
|
85338
85388
|
return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
|
|
85339
85389
|
}
|
|
85340
85390
|
}
|
|
85341
|
-
if (flags & ~(
|
|
85391
|
+
if (flags & ~(2080 /* ExportDefault */ | 32768 /* Decorator */)) {
|
|
85342
85392
|
return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here);
|
|
85343
85393
|
}
|
|
85344
|
-
if (hasLeadingDecorators && flags &
|
|
85394
|
+
if (hasLeadingDecorators && flags & 98303 /* Modifier */) {
|
|
85345
85395
|
Debug.assertIsDefined(firstDecorator);
|
|
85346
85396
|
const sourceFile = getSourceFileOfNode(modifier);
|
|
85347
85397
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
@@ -85353,10 +85403,10 @@ ${lanes.join("\n")}
|
|
|
85353
85403
|
}
|
|
85354
85404
|
return false;
|
|
85355
85405
|
}
|
|
85356
|
-
flags |=
|
|
85357
|
-
if (!(flags &
|
|
85406
|
+
flags |= 32768 /* Decorator */;
|
|
85407
|
+
if (!(flags & 98303 /* Modifier */)) {
|
|
85358
85408
|
hasLeadingDecorators = true;
|
|
85359
|
-
} else if (flags &
|
|
85409
|
+
} else if (flags & 32 /* Export */) {
|
|
85360
85410
|
sawExportBeforeDecorators = true;
|
|
85361
85411
|
}
|
|
85362
85412
|
firstDecorator ?? (firstDecorator = modifier);
|
|
@@ -85385,39 +85435,39 @@ ${lanes.join("\n")}
|
|
|
85385
85435
|
}
|
|
85386
85436
|
break;
|
|
85387
85437
|
case 164 /* OverrideKeyword */:
|
|
85388
|
-
if (flags &
|
|
85438
|
+
if (flags & 16 /* Override */) {
|
|
85389
85439
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override");
|
|
85390
|
-
} else if (flags &
|
|
85440
|
+
} else if (flags & 128 /* Ambient */) {
|
|
85391
85441
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare");
|
|
85392
|
-
} else if (flags &
|
|
85442
|
+
} else if (flags & 8 /* Readonly */) {
|
|
85393
85443
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly");
|
|
85394
|
-
} else if (flags &
|
|
85444
|
+
} else if (flags & 512 /* Accessor */) {
|
|
85395
85445
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor");
|
|
85396
|
-
} else if (flags &
|
|
85446
|
+
} else if (flags & 1024 /* Async */) {
|
|
85397
85447
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async");
|
|
85398
85448
|
}
|
|
85399
|
-
flags |=
|
|
85449
|
+
flags |= 16 /* Override */;
|
|
85400
85450
|
lastOverride = modifier;
|
|
85401
85451
|
break;
|
|
85402
85452
|
case 125 /* PublicKeyword */:
|
|
85403
85453
|
case 124 /* ProtectedKeyword */:
|
|
85404
85454
|
case 123 /* PrivateKeyword */:
|
|
85405
85455
|
const text = visibilityToString(modifierToFlag(modifier.kind));
|
|
85406
|
-
if (flags &
|
|
85456
|
+
if (flags & 7 /* AccessibilityModifier */) {
|
|
85407
85457
|
return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen);
|
|
85408
|
-
} else if (flags &
|
|
85458
|
+
} else if (flags & 16 /* Override */) {
|
|
85409
85459
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override");
|
|
85410
|
-
} else if (flags &
|
|
85460
|
+
} else if (flags & 256 /* Static */) {
|
|
85411
85461
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static");
|
|
85412
|
-
} else if (flags &
|
|
85462
|
+
} else if (flags & 512 /* Accessor */) {
|
|
85413
85463
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor");
|
|
85414
|
-
} else if (flags &
|
|
85464
|
+
} else if (flags & 8 /* Readonly */) {
|
|
85415
85465
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly");
|
|
85416
|
-
} else if (flags &
|
|
85466
|
+
} else if (flags & 1024 /* Async */) {
|
|
85417
85467
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
|
|
85418
85468
|
} else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 312 /* SourceFile */) {
|
|
85419
85469
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
|
|
85420
|
-
} else if (flags &
|
|
85470
|
+
} else if (flags & 64 /* Abstract */) {
|
|
85421
85471
|
if (modifier.kind === 123 /* PrivateKeyword */) {
|
|
85422
85472
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract");
|
|
85423
85473
|
} else {
|
|
@@ -85429,60 +85479,60 @@ ${lanes.join("\n")}
|
|
|
85429
85479
|
flags |= modifierToFlag(modifier.kind);
|
|
85430
85480
|
break;
|
|
85431
85481
|
case 126 /* StaticKeyword */:
|
|
85432
|
-
if (flags &
|
|
85482
|
+
if (flags & 256 /* Static */) {
|
|
85433
85483
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static");
|
|
85434
|
-
} else if (flags &
|
|
85484
|
+
} else if (flags & 8 /* Readonly */) {
|
|
85435
85485
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly");
|
|
85436
|
-
} else if (flags &
|
|
85486
|
+
} else if (flags & 1024 /* Async */) {
|
|
85437
85487
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
|
|
85438
|
-
} else if (flags &
|
|
85488
|
+
} else if (flags & 512 /* Accessor */) {
|
|
85439
85489
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor");
|
|
85440
85490
|
} else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 312 /* SourceFile */) {
|
|
85441
85491
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
|
|
85442
85492
|
} else if (node.kind === 169 /* Parameter */) {
|
|
85443
85493
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
|
|
85444
|
-
} else if (flags &
|
|
85494
|
+
} else if (flags & 64 /* Abstract */) {
|
|
85445
85495
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
|
|
85446
|
-
} else if (flags &
|
|
85496
|
+
} else if (flags & 16 /* Override */) {
|
|
85447
85497
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override");
|
|
85448
85498
|
}
|
|
85449
|
-
flags |=
|
|
85499
|
+
flags |= 256 /* Static */;
|
|
85450
85500
|
lastStatic = modifier;
|
|
85451
85501
|
break;
|
|
85452
85502
|
case 129 /* AccessorKeyword */:
|
|
85453
|
-
if (flags &
|
|
85503
|
+
if (flags & 512 /* Accessor */) {
|
|
85454
85504
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor");
|
|
85455
|
-
} else if (flags &
|
|
85505
|
+
} else if (flags & 8 /* Readonly */) {
|
|
85456
85506
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly");
|
|
85457
|
-
} else if (flags &
|
|
85507
|
+
} else if (flags & 128 /* Ambient */) {
|
|
85458
85508
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare");
|
|
85459
85509
|
} else if (node.kind !== 172 /* PropertyDeclaration */) {
|
|
85460
85510
|
return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration);
|
|
85461
85511
|
}
|
|
85462
|
-
flags |=
|
|
85512
|
+
flags |= 512 /* Accessor */;
|
|
85463
85513
|
break;
|
|
85464
85514
|
case 148 /* ReadonlyKeyword */:
|
|
85465
|
-
if (flags &
|
|
85515
|
+
if (flags & 8 /* Readonly */) {
|
|
85466
85516
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly");
|
|
85467
85517
|
} else if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 181 /* IndexSignature */ && node.kind !== 169 /* Parameter */) {
|
|
85468
85518
|
return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
|
|
85469
|
-
} else if (flags &
|
|
85519
|
+
} else if (flags & 512 /* Accessor */) {
|
|
85470
85520
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor");
|
|
85471
85521
|
}
|
|
85472
|
-
flags |=
|
|
85522
|
+
flags |= 8 /* Readonly */;
|
|
85473
85523
|
break;
|
|
85474
85524
|
case 95 /* ExportKeyword */:
|
|
85475
85525
|
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
85526
|
node.kind !== 267 /* ModuleDeclaration */ && node.parent.kind === 312 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
|
|
85477
85527
|
return grammarErrorOnNode(modifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
|
|
85478
85528
|
}
|
|
85479
|
-
if (flags &
|
|
85529
|
+
if (flags & 32 /* Export */) {
|
|
85480
85530
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export");
|
|
85481
|
-
} else if (flags &
|
|
85531
|
+
} else if (flags & 128 /* Ambient */) {
|
|
85482
85532
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare");
|
|
85483
|
-
} else if (flags &
|
|
85533
|
+
} else if (flags & 64 /* Abstract */) {
|
|
85484
85534
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract");
|
|
85485
|
-
} else if (flags &
|
|
85535
|
+
} else if (flags & 1024 /* Async */) {
|
|
85486
85536
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
|
|
85487
85537
|
} else if (isClassLike(node.parent)) {
|
|
85488
85538
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export");
|
|
@@ -85493,7 +85543,7 @@ ${lanes.join("\n")}
|
|
|
85493
85543
|
} else if (blockScopeKind === 6 /* AwaitUsing */) {
|
|
85494
85544
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "export");
|
|
85495
85545
|
}
|
|
85496
|
-
flags |=
|
|
85546
|
+
flags |= 32 /* Export */;
|
|
85497
85547
|
break;
|
|
85498
85548
|
case 90 /* DefaultKeyword */:
|
|
85499
85549
|
const container = node.parent.kind === 312 /* SourceFile */ ? node.parent : node.parent.parent;
|
|
@@ -85503,19 +85553,19 @@ ${lanes.join("\n")}
|
|
|
85503
85553
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "default");
|
|
85504
85554
|
} else if (blockScopeKind === 6 /* AwaitUsing */) {
|
|
85505
85555
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "default");
|
|
85506
|
-
} else if (!(flags &
|
|
85556
|
+
} else if (!(flags & 32 /* Export */)) {
|
|
85507
85557
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default");
|
|
85508
85558
|
} else if (sawExportBeforeDecorators) {
|
|
85509
85559
|
return grammarErrorOnNode(firstDecorator, Diagnostics.Decorators_are_not_valid_here);
|
|
85510
85560
|
}
|
|
85511
|
-
flags |=
|
|
85561
|
+
flags |= 2048 /* Default */;
|
|
85512
85562
|
break;
|
|
85513
85563
|
case 138 /* DeclareKeyword */:
|
|
85514
|
-
if (flags &
|
|
85564
|
+
if (flags & 128 /* Ambient */) {
|
|
85515
85565
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare");
|
|
85516
|
-
} else if (flags &
|
|
85566
|
+
} else if (flags & 1024 /* Async */) {
|
|
85517
85567
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
|
|
85518
|
-
} else if (flags &
|
|
85568
|
+
} else if (flags & 16 /* Override */) {
|
|
85519
85569
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override");
|
|
85520
85570
|
} else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) {
|
|
85521
85571
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare");
|
|
@@ -85529,62 +85579,62 @@ ${lanes.join("\n")}
|
|
|
85529
85579
|
return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
|
|
85530
85580
|
} else if (isPrivateIdentifierClassElementDeclaration(node)) {
|
|
85531
85581
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
|
|
85532
|
-
} else if (flags &
|
|
85582
|
+
} else if (flags & 512 /* Accessor */) {
|
|
85533
85583
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor");
|
|
85534
85584
|
}
|
|
85535
|
-
flags |=
|
|
85585
|
+
flags |= 128 /* Ambient */;
|
|
85536
85586
|
lastDeclare = modifier;
|
|
85537
85587
|
break;
|
|
85538
85588
|
case 128 /* AbstractKeyword */:
|
|
85539
|
-
if (flags &
|
|
85589
|
+
if (flags & 64 /* Abstract */) {
|
|
85540
85590
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract");
|
|
85541
85591
|
}
|
|
85542
85592
|
if (node.kind !== 263 /* ClassDeclaration */ && node.kind !== 185 /* ConstructorType */) {
|
|
85543
85593
|
if (node.kind !== 174 /* MethodDeclaration */ && node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 177 /* GetAccessor */ && node.kind !== 178 /* SetAccessor */) {
|
|
85544
85594
|
return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
|
|
85545
85595
|
}
|
|
85546
|
-
if (!(node.parent.kind === 263 /* ClassDeclaration */ && hasSyntacticModifier(node.parent,
|
|
85596
|
+
if (!(node.parent.kind === 263 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 64 /* Abstract */))) {
|
|
85547
85597
|
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
85598
|
return grammarErrorOnNode(modifier, message);
|
|
85549
85599
|
}
|
|
85550
|
-
if (flags &
|
|
85600
|
+
if (flags & 256 /* Static */) {
|
|
85551
85601
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
|
|
85552
85602
|
}
|
|
85553
|
-
if (flags &
|
|
85603
|
+
if (flags & 2 /* Private */) {
|
|
85554
85604
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract");
|
|
85555
85605
|
}
|
|
85556
|
-
if (flags &
|
|
85606
|
+
if (flags & 1024 /* Async */ && lastAsync) {
|
|
85557
85607
|
return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract");
|
|
85558
85608
|
}
|
|
85559
|
-
if (flags &
|
|
85609
|
+
if (flags & 16 /* Override */) {
|
|
85560
85610
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override");
|
|
85561
85611
|
}
|
|
85562
|
-
if (flags &
|
|
85612
|
+
if (flags & 512 /* Accessor */) {
|
|
85563
85613
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor");
|
|
85564
85614
|
}
|
|
85565
85615
|
}
|
|
85566
85616
|
if (isNamedDeclaration(node) && node.name.kind === 81 /* PrivateIdentifier */) {
|
|
85567
85617
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract");
|
|
85568
85618
|
}
|
|
85569
|
-
flags |=
|
|
85619
|
+
flags |= 64 /* Abstract */;
|
|
85570
85620
|
break;
|
|
85571
85621
|
case 134 /* AsyncKeyword */:
|
|
85572
|
-
if (flags &
|
|
85622
|
+
if (flags & 1024 /* Async */) {
|
|
85573
85623
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async");
|
|
85574
|
-
} else if (flags &
|
|
85624
|
+
} else if (flags & 128 /* Ambient */ || node.parent.flags & 33554432 /* Ambient */) {
|
|
85575
85625
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
|
|
85576
85626
|
} else if (node.kind === 169 /* Parameter */) {
|
|
85577
85627
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
|
|
85578
85628
|
}
|
|
85579
|
-
if (flags &
|
|
85629
|
+
if (flags & 64 /* Abstract */) {
|
|
85580
85630
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract");
|
|
85581
85631
|
}
|
|
85582
|
-
flags |=
|
|
85632
|
+
flags |= 1024 /* Async */;
|
|
85583
85633
|
lastAsync = modifier;
|
|
85584
85634
|
break;
|
|
85585
85635
|
case 103 /* InKeyword */:
|
|
85586
85636
|
case 147 /* OutKeyword */:
|
|
85587
|
-
const inOutFlag = modifier.kind === 103 /* InKeyword */ ?
|
|
85637
|
+
const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */;
|
|
85588
85638
|
const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out";
|
|
85589
85639
|
if (node.kind !== 168 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
|
|
85590
85640
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
|
|
@@ -85592,7 +85642,7 @@ ${lanes.join("\n")}
|
|
|
85592
85642
|
if (flags & inOutFlag) {
|
|
85593
85643
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText);
|
|
85594
85644
|
}
|
|
85595
|
-
if (inOutFlag &
|
|
85645
|
+
if (inOutFlag & 8192 /* In */ && flags & 16384 /* Out */) {
|
|
85596
85646
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out");
|
|
85597
85647
|
}
|
|
85598
85648
|
flags |= inOutFlag;
|
|
@@ -85601,24 +85651,24 @@ ${lanes.join("\n")}
|
|
|
85601
85651
|
}
|
|
85602
85652
|
}
|
|
85603
85653
|
if (node.kind === 176 /* Constructor */) {
|
|
85604
|
-
if (flags &
|
|
85654
|
+
if (flags & 256 /* Static */) {
|
|
85605
85655
|
return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
|
|
85606
85656
|
}
|
|
85607
|
-
if (flags &
|
|
85657
|
+
if (flags & 16 /* Override */) {
|
|
85608
85658
|
return grammarErrorOnNode(lastOverride, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "override");
|
|
85609
85659
|
}
|
|
85610
|
-
if (flags &
|
|
85660
|
+
if (flags & 1024 /* Async */) {
|
|
85611
85661
|
return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async");
|
|
85612
85662
|
}
|
|
85613
85663
|
return false;
|
|
85614
|
-
} else if ((node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */) && flags &
|
|
85664
|
+
} else if ((node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */) && flags & 128 /* Ambient */) {
|
|
85615
85665
|
return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
|
|
85616
|
-
} else if (node.kind === 169 /* Parameter */ && flags &
|
|
85666
|
+
} else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) {
|
|
85617
85667
|
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);
|
|
85618
|
-
} else if (node.kind === 169 /* Parameter */ && flags &
|
|
85668
|
+
} else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && node.dotDotDotToken) {
|
|
85619
85669
|
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
|
|
85620
85670
|
}
|
|
85621
|
-
if (flags &
|
|
85671
|
+
if (flags & 1024 /* Async */) {
|
|
85622
85672
|
return checkGrammarAsyncModifier(node, lastAsync);
|
|
85623
85673
|
}
|
|
85624
85674
|
return false;
|
|
@@ -86138,12 +86188,12 @@ ${lanes.join("\n")}
|
|
|
86138
86188
|
if (languageVersion < 2 /* ES2015 */ && isPrivateIdentifier(accessor.name)) {
|
|
86139
86189
|
return grammarErrorOnNode(accessor.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
|
|
86140
86190
|
}
|
|
86141
|
-
if (accessor.body === void 0 && !hasSyntacticModifier(accessor,
|
|
86191
|
+
if (accessor.body === void 0 && !hasSyntacticModifier(accessor, 64 /* Abstract */)) {
|
|
86142
86192
|
return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, Diagnostics._0_expected, "{");
|
|
86143
86193
|
}
|
|
86144
86194
|
}
|
|
86145
86195
|
if (accessor.body) {
|
|
86146
|
-
if (hasSyntacticModifier(accessor,
|
|
86196
|
+
if (hasSyntacticModifier(accessor, 64 /* Abstract */)) {
|
|
86147
86197
|
return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation);
|
|
86148
86198
|
}
|
|
86149
86199
|
if (accessor.parent.kind === 187 /* TypeLiteral */ || accessor.parent.kind === 264 /* InterfaceDeclaration */) {
|
|
@@ -86215,7 +86265,7 @@ ${lanes.join("\n")}
|
|
|
86215
86265
|
}
|
|
86216
86266
|
break;
|
|
86217
86267
|
case 171 /* PropertySignature */:
|
|
86218
|
-
if (!hasSyntacticModifier(parent2,
|
|
86268
|
+
if (!hasSyntacticModifier(parent2, 8 /* Readonly */)) {
|
|
86219
86269
|
return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);
|
|
86220
86270
|
}
|
|
86221
86271
|
break;
|
|
@@ -86385,7 +86435,7 @@ ${lanes.join("\n")}
|
|
|
86385
86435
|
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
86436
|
return grammarErrorOnNode(node.exclamationToken, message);
|
|
86387
86437
|
}
|
|
86388
|
-
if ((moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && moduleKind !== 4 /* System */ && !(node.parent.parent.flags & 33554432 /* Ambient */) && hasSyntacticModifier(node.parent.parent,
|
|
86438
|
+
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
86439
|
checkESModuleMarker(node.name);
|
|
86390
86440
|
}
|
|
86391
86441
|
return !!blockScopeKind && checkGrammarNameInLetOrConstDeclarations(node.name);
|
|
@@ -86575,7 +86625,7 @@ ${lanes.join("\n")}
|
|
|
86575
86625
|
}
|
|
86576
86626
|
}
|
|
86577
86627
|
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,
|
|
86628
|
+
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
86629
|
return false;
|
|
86580
86630
|
}
|
|
86581
86631
|
return grammarErrorOnFirstToken(node, Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier);
|
|
@@ -87021,12 +87071,14 @@ ${lanes.join("\n")}
|
|
|
87021
87071
|
this.canTrackSymbol = !!((_a = this.inner) == null ? void 0 : _a.trackSymbol);
|
|
87022
87072
|
}
|
|
87023
87073
|
trackSymbol(symbol, enclosingDeclaration, meaning) {
|
|
87024
|
-
var _a;
|
|
87074
|
+
var _a, _b;
|
|
87025
87075
|
if (((_a = this.inner) == null ? void 0 : _a.trackSymbol) && !this.disableTrackSymbol) {
|
|
87026
87076
|
if (this.inner.trackSymbol(symbol, enclosingDeclaration, meaning)) {
|
|
87027
87077
|
this.onDiagnosticReported();
|
|
87028
87078
|
return true;
|
|
87029
87079
|
}
|
|
87080
|
+
if (!(symbol.flags & 262144 /* TypeParameter */))
|
|
87081
|
+
((_b = this.context).trackedSymbols ?? (_b.trackedSymbols = [])).push([symbol, enclosingDeclaration, meaning]);
|
|
87030
87082
|
}
|
|
87031
87083
|
return false;
|
|
87032
87084
|
}
|
|
@@ -89089,15 +89141,15 @@ ${lanes.join("\n")}
|
|
|
89089
89141
|
}
|
|
89090
89142
|
break;
|
|
89091
89143
|
case 243 /* VariableStatement */:
|
|
89092
|
-
if (hasSyntacticModifier(node,
|
|
89144
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
89093
89145
|
for (const decl of node.declarationList.declarations) {
|
|
89094
89146
|
exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings);
|
|
89095
89147
|
}
|
|
89096
89148
|
}
|
|
89097
89149
|
break;
|
|
89098
89150
|
case 262 /* FunctionDeclaration */:
|
|
89099
|
-
if (hasSyntacticModifier(node,
|
|
89100
|
-
if (hasSyntacticModifier(node,
|
|
89151
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
89152
|
+
if (hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
89101
89153
|
if (!hasExportDefault) {
|
|
89102
89154
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));
|
|
89103
89155
|
hasExportDefault = true;
|
|
@@ -89113,8 +89165,8 @@ ${lanes.join("\n")}
|
|
|
89113
89165
|
}
|
|
89114
89166
|
break;
|
|
89115
89167
|
case 263 /* ClassDeclaration */:
|
|
89116
|
-
if (hasSyntacticModifier(node,
|
|
89117
|
-
if (hasSyntacticModifier(node,
|
|
89168
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
89169
|
+
if (hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
89118
89170
|
if (!hasExportDefault) {
|
|
89119
89171
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));
|
|
89120
89172
|
hasExportDefault = true;
|
|
@@ -90004,7 +90056,7 @@ ${lanes.join("\n")}
|
|
|
90004
90056
|
// src/compiler/transformers/namedEvaluation.ts
|
|
90005
90057
|
function getAssignedNameOfIdentifier(factory2, name, expression) {
|
|
90006
90058
|
const original = getOriginalNode(skipOuterExpressions(expression));
|
|
90007
|
-
if ((isClassDeclaration(original) || isFunctionDeclaration(original)) && !original.name && hasSyntacticModifier(original,
|
|
90059
|
+
if ((isClassDeclaration(original) || isFunctionDeclaration(original)) && !original.name && hasSyntacticModifier(original, 2048 /* Default */)) {
|
|
90008
90060
|
return factory2.createStringLiteral("default");
|
|
90009
90061
|
}
|
|
90010
90062
|
return factory2.createStringLiteralFromNode(name);
|
|
@@ -90375,13 +90427,13 @@ ${lanes.join("\n")}
|
|
|
90375
90427
|
break;
|
|
90376
90428
|
case 263 /* ClassDeclaration */:
|
|
90377
90429
|
case 262 /* FunctionDeclaration */:
|
|
90378
|
-
if (hasSyntacticModifier(node,
|
|
90430
|
+
if (hasSyntacticModifier(node, 128 /* Ambient */)) {
|
|
90379
90431
|
break;
|
|
90380
90432
|
}
|
|
90381
90433
|
if (node.name) {
|
|
90382
90434
|
recordEmittedDeclarationInScope(node);
|
|
90383
90435
|
} else {
|
|
90384
|
-
Debug.assert(node.kind === 263 /* ClassDeclaration */ || hasSyntacticModifier(node,
|
|
90436
|
+
Debug.assert(node.kind === 263 /* ClassDeclaration */ || hasSyntacticModifier(node, 2048 /* Default */));
|
|
90385
90437
|
}
|
|
90386
90438
|
break;
|
|
90387
90439
|
}
|
|
@@ -90436,7 +90488,7 @@ ${lanes.join("\n")}
|
|
|
90436
90488
|
function namespaceElementVisitorWorker(node) {
|
|
90437
90489
|
if (node.kind === 278 /* ExportDeclaration */ || node.kind === 272 /* ImportDeclaration */ || node.kind === 273 /* ImportClause */ || node.kind === 271 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 283 /* ExternalModuleReference */) {
|
|
90438
90490
|
return void 0;
|
|
90439
|
-
} else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node,
|
|
90491
|
+
} else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node, 32 /* Export */)) {
|
|
90440
90492
|
return visitTypeScript(node);
|
|
90441
90493
|
}
|
|
90442
90494
|
return node;
|
|
@@ -90494,7 +90546,7 @@ ${lanes.join("\n")}
|
|
|
90494
90546
|
function modifierVisitor(node) {
|
|
90495
90547
|
if (isDecorator(node))
|
|
90496
90548
|
return void 0;
|
|
90497
|
-
if (modifierToFlag(node.kind) &
|
|
90549
|
+
if (modifierToFlag(node.kind) & 28895 /* TypeScriptModifier */) {
|
|
90498
90550
|
return void 0;
|
|
90499
90551
|
} else if (currentNamespace && node.kind === 95 /* ExportKeyword */) {
|
|
90500
90552
|
return void 0;
|
|
@@ -90502,7 +90554,7 @@ ${lanes.join("\n")}
|
|
|
90502
90554
|
return node;
|
|
90503
90555
|
}
|
|
90504
90556
|
function visitTypeScript(node) {
|
|
90505
|
-
if (isStatement(node) && hasSyntacticModifier(node,
|
|
90557
|
+
if (isStatement(node) && hasSyntacticModifier(node, 128 /* Ambient */)) {
|
|
90506
90558
|
return factory2.createNotEmittedStatement(node);
|
|
90507
90559
|
}
|
|
90508
90560
|
switch (node.kind) {
|
|
@@ -90992,7 +91044,7 @@ ${lanes.join("\n")}
|
|
|
90992
91044
|
return !nodeIsMissing(node.body);
|
|
90993
91045
|
}
|
|
90994
91046
|
function visitPropertyDeclaration(node, parent2) {
|
|
90995
|
-
const isAmbient = node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node,
|
|
91047
|
+
const isAmbient = node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node, 64 /* Abstract */);
|
|
90996
91048
|
if (isAmbient && !(legacyDecorators && hasDecorators(node))) {
|
|
90997
91049
|
return void 0;
|
|
90998
91050
|
}
|
|
@@ -91001,7 +91053,7 @@ ${lanes.join("\n")}
|
|
|
91001
91053
|
if (isAmbient) {
|
|
91002
91054
|
return factory2.updatePropertyDeclaration(
|
|
91003
91055
|
node,
|
|
91004
|
-
concatenate(modifiers, factory2.createModifiersFromModifierFlags(
|
|
91056
|
+
concatenate(modifiers, factory2.createModifiersFromModifierFlags(128 /* Ambient */)),
|
|
91005
91057
|
Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)),
|
|
91006
91058
|
/*questionOrExclamationToken*/
|
|
91007
91059
|
void 0,
|
|
@@ -91164,7 +91216,7 @@ ${lanes.join("\n")}
|
|
|
91164
91216
|
);
|
|
91165
91217
|
}
|
|
91166
91218
|
function shouldEmitAccessorDeclaration(node) {
|
|
91167
|
-
return !(nodeIsMissing(node.body) && hasSyntacticModifier(node,
|
|
91219
|
+
return !(nodeIsMissing(node.body) && hasSyntacticModifier(node, 64 /* Abstract */));
|
|
91168
91220
|
}
|
|
91169
91221
|
function visitGetAccessor(node, parent2) {
|
|
91170
91222
|
if (!(node.transformFlags & 1 /* ContainsTypeScript */)) {
|
|
@@ -91897,16 +91949,16 @@ ${lanes.join("\n")}
|
|
|
91897
91949
|
}
|
|
91898
91950
|
}
|
|
91899
91951
|
function isExportOfNamespace(node) {
|
|
91900
|
-
return currentNamespace !== void 0 && hasSyntacticModifier(node,
|
|
91952
|
+
return currentNamespace !== void 0 && hasSyntacticModifier(node, 32 /* Export */);
|
|
91901
91953
|
}
|
|
91902
91954
|
function isExternalModuleExport(node) {
|
|
91903
|
-
return currentNamespace === void 0 && hasSyntacticModifier(node,
|
|
91955
|
+
return currentNamespace === void 0 && hasSyntacticModifier(node, 32 /* Export */);
|
|
91904
91956
|
}
|
|
91905
91957
|
function isNamedExternalModuleExport(node) {
|
|
91906
|
-
return isExternalModuleExport(node) && !hasSyntacticModifier(node,
|
|
91958
|
+
return isExternalModuleExport(node) && !hasSyntacticModifier(node, 2048 /* Default */);
|
|
91907
91959
|
}
|
|
91908
91960
|
function isDefaultExternalModuleExport(node) {
|
|
91909
|
-
return isExternalModuleExport(node) && hasSyntacticModifier(node,
|
|
91961
|
+
return isExternalModuleExport(node) && hasSyntacticModifier(node, 2048 /* Default */);
|
|
91910
91962
|
}
|
|
91911
91963
|
function createExportMemberAssignmentStatement(node) {
|
|
91912
91964
|
const expression = factory2.createAssignment(
|
|
@@ -93247,8 +93299,8 @@ ${lanes.join("\n")}
|
|
|
93247
93299
|
getClassLexicalEnvironment().classThis = node.emitNode.classThis;
|
|
93248
93300
|
}
|
|
93249
93301
|
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */;
|
|
93250
|
-
const isExport = hasSyntacticModifier(node,
|
|
93251
|
-
const isDefault = hasSyntacticModifier(node,
|
|
93302
|
+
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
93303
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
93252
93304
|
let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
|
|
93253
93305
|
const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause);
|
|
93254
93306
|
const { members, prologue } = transformClassMembers(node);
|
|
@@ -93794,7 +93846,7 @@ ${lanes.join("\n")}
|
|
|
93794
93846
|
return void 0;
|
|
93795
93847
|
}
|
|
93796
93848
|
const propertyOriginalNode = getOriginalNode(property);
|
|
93797
|
-
if (hasSyntacticModifier(propertyOriginalNode,
|
|
93849
|
+
if (hasSyntacticModifier(propertyOriginalNode, 64 /* Abstract */)) {
|
|
93798
93850
|
return void 0;
|
|
93799
93851
|
}
|
|
93800
93852
|
let initializer = visitNode(property.initializer, visitor, isExpression);
|
|
@@ -94842,8 +94894,8 @@ ${lanes.join("\n")}
|
|
|
94842
94894
|
return addRange([updated], decorationStatements);
|
|
94843
94895
|
}
|
|
94844
94896
|
function transformClassDeclarationWithClassDecorators(node, name) {
|
|
94845
|
-
const isExport = hasSyntacticModifier(node,
|
|
94846
|
-
const isDefault = hasSyntacticModifier(node,
|
|
94897
|
+
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
94898
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
94847
94899
|
const modifiers = visitNodes2(node.modifiers, (node2) => isExportOrDefaultModifier(node2) || isDecorator(node2) ? void 0 : node2, isModifierLike);
|
|
94848
94900
|
const location = moveRangePastModifiers(node);
|
|
94849
94901
|
const classAlias = getClassAliasIfNeeded(node);
|
|
@@ -94864,7 +94916,7 @@ ${lanes.join("\n")}
|
|
|
94864
94916
|
let members = visitNodes2(node.members, visitor, isClassElement);
|
|
94865
94917
|
let decorationStatements = [];
|
|
94866
94918
|
({ members, decorationStatements } = transformDecoratorsOfClassElements(node, members));
|
|
94867
|
-
const assignClassAliasInStaticBlock = languageVersion >= 9 /* ES2022 */ && !!classAlias && some(members, (member) => isPropertyDeclaration(member) && hasSyntacticModifier(member,
|
|
94919
|
+
const assignClassAliasInStaticBlock = languageVersion >= 9 /* ES2022 */ && !!classAlias && some(members, (member) => isPropertyDeclaration(member) && hasSyntacticModifier(member, 256 /* Static */) || isClassStaticBlockDeclaration(member));
|
|
94868
94920
|
if (assignClassAliasInStaticBlock) {
|
|
94869
94921
|
members = setTextRange(
|
|
94870
94922
|
factory2.createNodeArray([
|
|
@@ -94995,7 +95047,7 @@ ${lanes.join("\n")}
|
|
|
94995
95047
|
);
|
|
94996
95048
|
}
|
|
94997
95049
|
function visitPropertyDeclaration(node) {
|
|
94998
|
-
if (node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node,
|
|
95050
|
+
if (node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node, 128 /* Ambient */)) {
|
|
94999
95051
|
return void 0;
|
|
95000
95052
|
}
|
|
95001
95053
|
return finishClassElement(
|
|
@@ -95083,7 +95135,7 @@ ${lanes.join("\n")}
|
|
|
95083
95135
|
const memberName = getExpressionForPropertyName(
|
|
95084
95136
|
member,
|
|
95085
95137
|
/*generateNameForComputedPropertyName*/
|
|
95086
|
-
!hasSyntacticModifier(member,
|
|
95138
|
+
!hasSyntacticModifier(member, 128 /* Ambient */)
|
|
95087
95139
|
);
|
|
95088
95140
|
const descriptor = languageVersion > 0 /* ES3 */ ? isPropertyDeclaration(member) && !hasAccessorModifier(member) ? factory2.createVoidZero() : factory2.createNull() : void 0;
|
|
95089
95141
|
const helper = emitHelpers().createDecorateHelper(
|
|
@@ -95872,8 +95924,8 @@ ${lanes.join("\n")}
|
|
|
95872
95924
|
const statements = [];
|
|
95873
95925
|
const originalClass = getOriginalNode(node, isClassLike) ?? node;
|
|
95874
95926
|
const className = originalClass.name ? factory2.createStringLiteralFromNode(originalClass.name) : factory2.createStringLiteral("default");
|
|
95875
|
-
const isExport = hasSyntacticModifier(node,
|
|
95876
|
-
const isDefault = hasSyntacticModifier(node,
|
|
95927
|
+
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
95928
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
95877
95929
|
if (!node.name) {
|
|
95878
95930
|
node = injectClassNamedEvaluationHelperBlockIfMissing(context, node, className);
|
|
95879
95931
|
}
|
|
@@ -98196,7 +98248,7 @@ ${lanes.join("\n")}
|
|
|
98196
98248
|
return visitEachChild(node, visitor, context);
|
|
98197
98249
|
}
|
|
98198
98250
|
function visitVariableStatement(node) {
|
|
98199
|
-
if (hasSyntacticModifier(node,
|
|
98251
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
98200
98252
|
const savedExportedVariableStatement = exportedVariableStatement;
|
|
98201
98253
|
exportedVariableStatement = true;
|
|
98202
98254
|
const visited = visitEachChild(node, visitor, context);
|
|
@@ -99432,7 +99484,7 @@ ${lanes.join("\n")}
|
|
|
99432
99484
|
addRange(topLevelStatements, endLexicalEnvironment());
|
|
99433
99485
|
if (exportVars.length) {
|
|
99434
99486
|
topLevelStatements.push(factory2.createVariableStatement(
|
|
99435
|
-
factory2.createModifiersFromModifierFlags(
|
|
99487
|
+
factory2.createModifiersFromModifierFlags(32 /* Export */),
|
|
99436
99488
|
factory2.createVariableDeclarationList(
|
|
99437
99489
|
exportVars,
|
|
99438
99490
|
1 /* Let */
|
|
@@ -99729,8 +99781,8 @@ ${lanes.join("\n")}
|
|
|
99729
99781
|
if (!node.name && defaultExportBinding) {
|
|
99730
99782
|
return node;
|
|
99731
99783
|
}
|
|
99732
|
-
const isExported2 = hasSyntacticModifier(node,
|
|
99733
|
-
const isDefault = hasSyntacticModifier(node,
|
|
99784
|
+
const isExported2 = hasSyntacticModifier(node, 32 /* Export */);
|
|
99785
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
99734
99786
|
let expression = factory2.converters.convertToClassExpression(node);
|
|
99735
99787
|
if (node.name) {
|
|
99736
99788
|
hoistBindingIdentifier(
|
|
@@ -99778,7 +99830,7 @@ ${lanes.join("\n")}
|
|
|
99778
99830
|
}
|
|
99779
99831
|
function hoistVariableStatement(node) {
|
|
99780
99832
|
let expressions;
|
|
99781
|
-
const isExported2 = hasSyntacticModifier(node,
|
|
99833
|
+
const isExported2 = hasSyntacticModifier(node, 32 /* Export */);
|
|
99782
99834
|
for (const variable of node.declarationList.declarations) {
|
|
99783
99835
|
hoistBindingElement(variable, isExported2, variable);
|
|
99784
99836
|
if (variable.initializer) {
|
|
@@ -101329,8 +101381,8 @@ ${lanes.join("\n")}
|
|
|
101329
101381
|
setTextRange(statement, node);
|
|
101330
101382
|
startOnNewLine(statement);
|
|
101331
101383
|
statements.push(statement);
|
|
101332
|
-
if (hasSyntacticModifier(node,
|
|
101333
|
-
const exportStatement = hasSyntacticModifier(node,
|
|
101384
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
101385
|
+
const exportStatement = hasSyntacticModifier(node, 2048 /* Default */) ? factory2.createExportDefault(factory2.getLocalName(node)) : factory2.createExternalModuleExport(factory2.getLocalName(node));
|
|
101334
101386
|
setOriginalNode(exportStatement, statement);
|
|
101335
101387
|
statements.push(exportStatement);
|
|
101336
101388
|
}
|
|
@@ -102522,7 +102574,7 @@ ${lanes.join("\n")}
|
|
|
102522
102574
|
return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getInternalEmitFlags(node.declarationList.declarations[0].initializer) & 1 /* TypeScriptClassWrapper */);
|
|
102523
102575
|
}
|
|
102524
102576
|
function visitVariableStatement(node) {
|
|
102525
|
-
const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node,
|
|
102577
|
+
const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node, 32 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */);
|
|
102526
102578
|
let updated;
|
|
102527
102579
|
if (convertedLoopState && (node.declarationList.flags & 7 /* BlockScoped */) === 0 && !isVariableStatementOfTypeScriptClassWrapper(node)) {
|
|
102528
102580
|
let assignments;
|
|
@@ -107489,7 +107541,7 @@ ${lanes.join("\n")}
|
|
|
107489
107541
|
Debug.assert(isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer.");
|
|
107490
107542
|
let statements;
|
|
107491
107543
|
if (moduleKind !== 2 /* AMD */) {
|
|
107492
|
-
if (hasSyntacticModifier(node,
|
|
107544
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
107493
107545
|
statements = append(
|
|
107494
107546
|
statements,
|
|
107495
107547
|
setOriginalNode(
|
|
@@ -107535,7 +107587,7 @@ ${lanes.join("\n")}
|
|
|
107535
107587
|
);
|
|
107536
107588
|
}
|
|
107537
107589
|
} else {
|
|
107538
|
-
if (hasSyntacticModifier(node,
|
|
107590
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
107539
107591
|
statements = append(
|
|
107540
107592
|
statements,
|
|
107541
107593
|
setOriginalNode(
|
|
@@ -107673,7 +107725,7 @@ ${lanes.join("\n")}
|
|
|
107673
107725
|
}
|
|
107674
107726
|
function visitFunctionDeclaration(node) {
|
|
107675
107727
|
let statements;
|
|
107676
|
-
if (hasSyntacticModifier(node,
|
|
107728
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
107677
107729
|
statements = append(
|
|
107678
107730
|
statements,
|
|
107679
107731
|
setOriginalNode(
|
|
@@ -107710,7 +107762,7 @@ ${lanes.join("\n")}
|
|
|
107710
107762
|
}
|
|
107711
107763
|
function visitClassDeclaration(node) {
|
|
107712
107764
|
let statements;
|
|
107713
|
-
if (hasSyntacticModifier(node,
|
|
107765
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
107714
107766
|
statements = append(
|
|
107715
107767
|
statements,
|
|
107716
107768
|
setOriginalNode(
|
|
@@ -107744,7 +107796,7 @@ ${lanes.join("\n")}
|
|
|
107744
107796
|
let statements;
|
|
107745
107797
|
let variables;
|
|
107746
107798
|
let expressions;
|
|
107747
|
-
if (hasSyntacticModifier(node,
|
|
107799
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
107748
107800
|
let modifiers;
|
|
107749
107801
|
let removeCommentsOnExpressions = false;
|
|
107750
107802
|
for (const variable of node.declarationList.declarations) {
|
|
@@ -107930,8 +107982,8 @@ ${lanes.join("\n")}
|
|
|
107930
107982
|
return statements;
|
|
107931
107983
|
}
|
|
107932
107984
|
const seen = new IdentifierNameMap();
|
|
107933
|
-
if (hasSyntacticModifier(decl,
|
|
107934
|
-
const exportName = hasSyntacticModifier(decl,
|
|
107985
|
+
if (hasSyntacticModifier(decl, 32 /* Export */)) {
|
|
107986
|
+
const exportName = hasSyntacticModifier(decl, 2048 /* Default */) ? factory2.createIdentifier("default") : factory2.getDeclarationName(decl);
|
|
107935
107987
|
statements = appendExportStatement(
|
|
107936
107988
|
statements,
|
|
107937
107989
|
seen,
|
|
@@ -108425,7 +108477,7 @@ ${lanes.join("\n")}
|
|
|
108425
108477
|
addRange(statements, hoistedStatements);
|
|
108426
108478
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
108427
108479
|
const exportStarFunction = addExportStarIfNeeded(statements);
|
|
108428
|
-
const modifiers = node.transformFlags & 2097152 /* ContainsAwait */ ? factory2.createModifiersFromModifierFlags(
|
|
108480
|
+
const modifiers = node.transformFlags & 2097152 /* ContainsAwait */ ? factory2.createModifiersFromModifierFlags(1024 /* Async */) : void 0;
|
|
108429
108481
|
const moduleObject = factory2.createObjectLiteralExpression(
|
|
108430
108482
|
[
|
|
108431
108483
|
factory2.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)),
|
|
@@ -108627,7 +108679,7 @@ ${lanes.join("\n")}
|
|
|
108627
108679
|
factory2.createAssignment(importVariableName, parameterName)
|
|
108628
108680
|
)
|
|
108629
108681
|
);
|
|
108630
|
-
if (hasSyntacticModifier(entry,
|
|
108682
|
+
if (hasSyntacticModifier(entry, 32 /* Export */)) {
|
|
108631
108683
|
statements.push(
|
|
108632
108684
|
factory2.createExpressionStatement(
|
|
108633
108685
|
factory2.createCallExpression(
|
|
@@ -108780,7 +108832,7 @@ ${lanes.join("\n")}
|
|
|
108780
108832
|
);
|
|
108781
108833
|
}
|
|
108782
108834
|
function visitFunctionDeclaration(node) {
|
|
108783
|
-
if (hasSyntacticModifier(node,
|
|
108835
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
108784
108836
|
hoistedStatements = append(
|
|
108785
108837
|
hoistedStatements,
|
|
108786
108838
|
factory2.updateFunctionDeclaration(
|
|
@@ -108867,7 +108919,7 @@ ${lanes.join("\n")}
|
|
|
108867
108919
|
statements = append(statements, factory2.updateVariableStatement(node, modifiers, declarationList));
|
|
108868
108920
|
} else {
|
|
108869
108921
|
let expressions;
|
|
108870
|
-
const isExportedDeclaration = hasSyntacticModifier(node,
|
|
108922
|
+
const isExportedDeclaration = hasSyntacticModifier(node, 32 /* Export */);
|
|
108871
108923
|
for (const variable of node.declarationList.declarations) {
|
|
108872
108924
|
if (variable.initializer) {
|
|
108873
108925
|
expressions = append(expressions, transformInitializedVariable(variable, isExportedDeclaration));
|
|
@@ -109003,8 +109055,8 @@ ${lanes.join("\n")}
|
|
|
109003
109055
|
return statements;
|
|
109004
109056
|
}
|
|
109005
109057
|
let excludeName;
|
|
109006
|
-
if (hasSyntacticModifier(decl,
|
|
109007
|
-
const exportName = hasSyntacticModifier(decl,
|
|
109058
|
+
if (hasSyntacticModifier(decl, 32 /* Export */)) {
|
|
109059
|
+
const exportName = hasSyntacticModifier(decl, 2048 /* Default */) ? factory2.createStringLiteral("default") : decl.name;
|
|
109008
109060
|
statements = appendExportStatement(statements, exportName, factory2.getLocalName(decl));
|
|
109009
109061
|
excludeName = getTextOfIdentifierOrLiteral(exportName);
|
|
109010
109062
|
}
|
|
@@ -109755,7 +109807,7 @@ ${lanes.join("\n")}
|
|
|
109755
109807
|
return singleOrMany(statements);
|
|
109756
109808
|
}
|
|
109757
109809
|
function appendExportsOfImportEqualsDeclaration(statements, node) {
|
|
109758
|
-
if (hasSyntacticModifier(node,
|
|
109810
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
109759
109811
|
statements = append(
|
|
109760
109812
|
statements,
|
|
109761
109813
|
factory2.createExportDeclaration(
|
|
@@ -109977,7 +110029,7 @@ ${lanes.join("\n")}
|
|
|
109977
110029
|
} else if (isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isIndexSignatureDeclaration(node)) {
|
|
109978
110030
|
return getReturnTypeVisibilityError;
|
|
109979
110031
|
} else if (isParameter(node)) {
|
|
109980
|
-
if (isParameterPropertyDeclaration(node, node.parent) && hasSyntacticModifier(node.parent,
|
|
110032
|
+
if (isParameterPropertyDeclaration(node, node.parent) && hasSyntacticModifier(node.parent, 2 /* Private */)) {
|
|
109981
110033
|
return getVariableDeclarationTypeVisibilityError;
|
|
109982
110034
|
}
|
|
109983
110035
|
return getParameterDeclarationTypeVisibilityError;
|
|
@@ -109995,7 +110047,7 @@ ${lanes.join("\n")}
|
|
|
109995
110047
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
109996
110048
|
if (node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
|
|
109997
110049
|
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,
|
|
110050
|
+
} 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
110051
|
if (isStatic(node)) {
|
|
110000
110052
|
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
110053
|
} else if (node.parent.kind === 263 /* ClassDeclaration */ || node.kind === 169 /* Parameter */) {
|
|
@@ -110721,7 +110773,7 @@ ${lanes.join("\n")}
|
|
|
110721
110773
|
return void 0;
|
|
110722
110774
|
}
|
|
110723
110775
|
function ensureType(node, type, ignorePrivate) {
|
|
110724
|
-
if (!ignorePrivate && hasEffectiveModifier(node,
|
|
110776
|
+
if (!ignorePrivate && hasEffectiveModifier(node, 2 /* Private */)) {
|
|
110725
110777
|
return;
|
|
110726
110778
|
}
|
|
110727
110779
|
if (shouldPrintWithInitializer(node)) {
|
|
@@ -110801,7 +110853,7 @@ ${lanes.join("\n")}
|
|
|
110801
110853
|
}
|
|
110802
110854
|
}
|
|
110803
110855
|
function updateParamsList(node, params, modifierMask) {
|
|
110804
|
-
if (hasEffectiveModifier(node,
|
|
110856
|
+
if (hasEffectiveModifier(node, 2 /* Private */)) {
|
|
110805
110857
|
return factory2.createNodeArray();
|
|
110806
110858
|
}
|
|
110807
110859
|
const newParams = map(params, (p) => ensureParameter(p, modifierMask));
|
|
@@ -110846,7 +110898,7 @@ ${lanes.join("\n")}
|
|
|
110846
110898
|
return factory2.createNodeArray(newParams || emptyArray);
|
|
110847
110899
|
}
|
|
110848
110900
|
function ensureTypeParams(node, params) {
|
|
110849
|
-
return hasEffectiveModifier(node,
|
|
110901
|
+
return hasEffectiveModifier(node, 2 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree, isTypeParameterDeclaration);
|
|
110850
110902
|
}
|
|
110851
110903
|
function isEnclosingDeclaration(node) {
|
|
110852
110904
|
return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node);
|
|
@@ -111032,7 +111084,7 @@ ${lanes.join("\n")}
|
|
|
111032
111084
|
const oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
|
|
111033
111085
|
let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 187 /* TypeLiteral */ || input.kind === 200 /* MappedType */) && input.parent.kind !== 265 /* TypeAliasDeclaration */;
|
|
111034
111086
|
if (isMethodDeclaration(input) || isMethodSignature(input)) {
|
|
111035
|
-
if (hasEffectiveModifier(input,
|
|
111087
|
+
if (hasEffectiveModifier(input, 2 /* Private */)) {
|
|
111036
111088
|
if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input)
|
|
111037
111089
|
return;
|
|
111038
111090
|
return cleanup(factory2.createPropertyDeclaration(
|
|
@@ -111120,7 +111172,7 @@ ${lanes.join("\n")}
|
|
|
111120
111172
|
input,
|
|
111121
111173
|
ensureModifiers(input),
|
|
111122
111174
|
input.name,
|
|
111123
|
-
updateAccessorParamsList(input, hasEffectiveModifier(input,
|
|
111175
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
111124
111176
|
ensureType(input, accessorType),
|
|
111125
111177
|
/*body*/
|
|
111126
111178
|
void 0
|
|
@@ -111137,7 +111189,7 @@ ${lanes.join("\n")}
|
|
|
111137
111189
|
input,
|
|
111138
111190
|
ensureModifiers(input),
|
|
111139
111191
|
input.name,
|
|
111140
|
-
updateAccessorParamsList(input, hasEffectiveModifier(input,
|
|
111192
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
111141
111193
|
/*body*/
|
|
111142
111194
|
void 0
|
|
111143
111195
|
));
|
|
@@ -111294,7 +111346,7 @@ ${lanes.join("\n")}
|
|
|
111294
111346
|
}
|
|
111295
111347
|
}
|
|
111296
111348
|
function isPrivateMethodTypeParameter(node) {
|
|
111297
|
-
return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent,
|
|
111349
|
+
return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 2 /* Private */);
|
|
111298
111350
|
}
|
|
111299
111351
|
function visitDeclarationStatements(input) {
|
|
111300
111352
|
if (!isPreservedDeclarationStatement(input)) {
|
|
@@ -111353,10 +111405,10 @@ ${lanes.join("\n")}
|
|
|
111353
111405
|
return input;
|
|
111354
111406
|
}
|
|
111355
111407
|
function stripExportModifiers(statement) {
|
|
111356
|
-
if (isImportEqualsDeclaration(statement) || hasEffectiveModifier(statement,
|
|
111408
|
+
if (isImportEqualsDeclaration(statement) || hasEffectiveModifier(statement, 2048 /* Default */) || !canHaveModifiers(statement)) {
|
|
111357
111409
|
return statement;
|
|
111358
111410
|
}
|
|
111359
|
-
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (
|
|
111411
|
+
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (131071 /* All */ ^ 32 /* Export */));
|
|
111360
111412
|
return factory2.replaceModifiers(statement, modifiers);
|
|
111361
111413
|
}
|
|
111362
111414
|
function updateModuleDeclarationAndKeyword(node, modifiers, name, body) {
|
|
@@ -111506,10 +111558,10 @@ ${lanes.join("\n")}
|
|
|
111506
111558
|
));
|
|
111507
111559
|
}
|
|
111508
111560
|
const namespaceDecl = factory2.createModuleDeclaration(ensureModifiers(input), input.name, factory2.createModuleBlock(declarations), 32 /* Namespace */);
|
|
111509
|
-
if (!hasEffectiveModifier(clean2,
|
|
111561
|
+
if (!hasEffectiveModifier(clean2, 2048 /* Default */)) {
|
|
111510
111562
|
return [clean2, namespaceDecl];
|
|
111511
111563
|
}
|
|
111512
|
-
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(clean2) & ~
|
|
111564
|
+
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(clean2) & ~2080 /* ExportDefault */ | 128 /* Ambient */);
|
|
111513
111565
|
const cleanDeclaration = factory2.updateFunctionDeclaration(
|
|
111514
111566
|
clean2,
|
|
111515
111567
|
modifiers,
|
|
@@ -111601,7 +111653,7 @@ ${lanes.join("\n")}
|
|
|
111601
111653
|
if (ctor) {
|
|
111602
111654
|
const oldDiag2 = getSymbolAccessibilityDiagnostic;
|
|
111603
111655
|
parameterProperties = compact(flatMap(ctor.parameters, (param) => {
|
|
111604
|
-
if (!hasSyntacticModifier(param,
|
|
111656
|
+
if (!hasSyntacticModifier(param, 31 /* ParameterPropertyModifier */) || shouldStripInternal(param))
|
|
111605
111657
|
return;
|
|
111606
111658
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(param);
|
|
111607
111659
|
if (param.name.kind === 80 /* Identifier */) {
|
|
@@ -111830,11 +111882,11 @@ ${lanes.join("\n")}
|
|
|
111830
111882
|
return factory2.createModifiersFromModifierFlags(newFlags);
|
|
111831
111883
|
}
|
|
111832
111884
|
function ensureModifierFlags(node) {
|
|
111833
|
-
let mask2 =
|
|
111834
|
-
let additions = needsDeclare && !isAlwaysType(node) ?
|
|
111885
|
+
let mask2 = 131071 /* All */ ^ (1 /* Public */ | 1024 /* Async */ | 16 /* Override */);
|
|
111886
|
+
let additions = needsDeclare && !isAlwaysType(node) ? 128 /* Ambient */ : 0 /* None */;
|
|
111835
111887
|
const parentIsFile = node.parent.kind === 312 /* SourceFile */;
|
|
111836
111888
|
if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) {
|
|
111837
|
-
mask2 ^=
|
|
111889
|
+
mask2 ^= 128 /* Ambient */;
|
|
111838
111890
|
additions = 0 /* None */;
|
|
111839
111891
|
}
|
|
111840
111892
|
return maskModifierFlags(node, mask2, additions);
|
|
@@ -111876,13 +111928,13 @@ ${lanes.join("\n")}
|
|
|
111876
111928
|
function maskModifiers(factory2, node, modifierMask, modifierAdditions) {
|
|
111877
111929
|
return factory2.createModifiersFromModifierFlags(maskModifierFlags(node, modifierMask, modifierAdditions));
|
|
111878
111930
|
}
|
|
111879
|
-
function maskModifierFlags(node, modifierMask =
|
|
111931
|
+
function maskModifierFlags(node, modifierMask = 131071 /* All */ ^ 1 /* Public */, modifierAdditions = 0 /* None */) {
|
|
111880
111932
|
let flags = getEffectiveModifierFlags(node) & modifierMask | modifierAdditions;
|
|
111881
|
-
if (flags &
|
|
111882
|
-
flags ^=
|
|
111933
|
+
if (flags & 2048 /* Default */ && !(flags & 32 /* Export */)) {
|
|
111934
|
+
flags ^= 32 /* Export */;
|
|
111883
111935
|
}
|
|
111884
|
-
if (flags &
|
|
111885
|
-
flags ^=
|
|
111936
|
+
if (flags & 2048 /* Default */ && flags & 128 /* Ambient */) {
|
|
111937
|
+
flags ^= 128 /* Ambient */;
|
|
111886
111938
|
}
|
|
111887
111939
|
return flags;
|
|
111888
111940
|
}
|
|
@@ -111895,7 +111947,7 @@ ${lanes.join("\n")}
|
|
|
111895
111947
|
switch (node.kind) {
|
|
111896
111948
|
case 172 /* PropertyDeclaration */:
|
|
111897
111949
|
case 171 /* PropertySignature */:
|
|
111898
|
-
return !hasEffectiveModifier(node,
|
|
111950
|
+
return !hasEffectiveModifier(node, 2 /* Private */);
|
|
111899
111951
|
case 169 /* Parameter */:
|
|
111900
111952
|
case 260 /* VariableDeclaration */:
|
|
111901
111953
|
return true;
|
|
@@ -120628,7 +120680,7 @@ ${lanes.join("\n")}
|
|
|
120628
120680
|
}
|
|
120629
120681
|
}
|
|
120630
120682
|
} else if (isModuleDeclaration(node)) {
|
|
120631
|
-
if (isAmbientModule(node) && (inAmbientModule || hasSyntacticModifier(node,
|
|
120683
|
+
if (isAmbientModule(node) && (inAmbientModule || hasSyntacticModifier(node, 128 /* Ambient */) || file.isDeclarationFile)) {
|
|
120632
120684
|
node.name.parent = node;
|
|
120633
120685
|
const nameText = getTextOfIdentifierOrLiteral(node.name);
|
|
120634
120686
|
if (isExternalModuleFile || inAmbientModule && !isExternalModuleNameRelative(nameText)) {
|
|
@@ -129876,7 +129928,7 @@ ${lanes.join("\n")}
|
|
|
129876
129928
|
case 306 /* EnumMember */:
|
|
129877
129929
|
return "enum member" /* enumMemberElement */;
|
|
129878
129930
|
case 169 /* Parameter */:
|
|
129879
|
-
return hasSyntacticModifier(node,
|
|
129931
|
+
return hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */;
|
|
129880
129932
|
case 271 /* ImportEqualsDeclaration */:
|
|
129881
129933
|
case 276 /* ImportSpecifier */:
|
|
129882
129934
|
case 281 /* ExportSpecifier */:
|
|
@@ -130779,19 +130831,19 @@ ${lanes.join("\n")}
|
|
|
130779
130831
|
function getNodeModifiers(node, excludeFlags = 0 /* None */) {
|
|
130780
130832
|
const result = [];
|
|
130781
130833
|
const flags = isDeclaration(node) ? getCombinedNodeFlagsAlwaysIncludeJSDoc(node) & ~excludeFlags : 0 /* None */;
|
|
130782
|
-
if (flags &
|
|
130834
|
+
if (flags & 2 /* Private */)
|
|
130783
130835
|
result.push("private" /* privateMemberModifier */);
|
|
130784
|
-
if (flags &
|
|
130836
|
+
if (flags & 4 /* Protected */)
|
|
130785
130837
|
result.push("protected" /* protectedMemberModifier */);
|
|
130786
|
-
if (flags &
|
|
130838
|
+
if (flags & 1 /* Public */)
|
|
130787
130839
|
result.push("public" /* publicMemberModifier */);
|
|
130788
|
-
if (flags &
|
|
130840
|
+
if (flags & 256 /* Static */ || isClassStaticBlockDeclaration(node))
|
|
130789
130841
|
result.push("static" /* staticModifier */);
|
|
130790
|
-
if (flags &
|
|
130842
|
+
if (flags & 64 /* Abstract */)
|
|
130791
130843
|
result.push("abstract" /* abstractModifier */);
|
|
130792
|
-
if (flags &
|
|
130844
|
+
if (flags & 32 /* Export */)
|
|
130793
130845
|
result.push("export" /* exportedModifier */);
|
|
130794
|
-
if (flags &
|
|
130846
|
+
if (flags & 65536 /* Deprecated */)
|
|
130795
130847
|
result.push("deprecated" /* deprecatedModifier */);
|
|
130796
130848
|
if (node.flags & 33554432 /* Ambient */)
|
|
130797
130849
|
result.push("declare" /* ambientModifier */);
|
|
@@ -132169,7 +132221,7 @@ ${lanes.join("\n")}
|
|
|
132169
132221
|
return isInJSFile(declaration) || !findAncestor(declaration, (d) => isModuleDeclaration(d) && isGlobalScopeAugmentation(d));
|
|
132170
132222
|
}
|
|
132171
132223
|
function isDeprecatedDeclaration(decl) {
|
|
132172
|
-
return !!(getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) &
|
|
132224
|
+
return !!(getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) & 65536 /* Deprecated */);
|
|
132173
132225
|
}
|
|
132174
132226
|
function shouldUseUriStyleNodeCoreModules(file, program) {
|
|
132175
132227
|
const decisionFromFile = firstDefined(file.imports, (node) => {
|
|
@@ -133853,7 +133905,7 @@ ${lanes.join("\n")}
|
|
|
133853
133905
|
case 241 /* Block */:
|
|
133854
133906
|
case 296 /* CaseClause */:
|
|
133855
133907
|
case 297 /* DefaultClause */:
|
|
133856
|
-
if (modifierFlag &
|
|
133908
|
+
if (modifierFlag & 64 /* Abstract */ && isClassDeclaration(declaration)) {
|
|
133857
133909
|
return [...declaration.members, declaration];
|
|
133858
133910
|
} else {
|
|
133859
133911
|
return container.statements;
|
|
@@ -133867,12 +133919,12 @@ ${lanes.join("\n")}
|
|
|
133867
133919
|
case 264 /* InterfaceDeclaration */:
|
|
133868
133920
|
case 187 /* TypeLiteral */:
|
|
133869
133921
|
const nodes = container.members;
|
|
133870
|
-
if (modifierFlag & (
|
|
133922
|
+
if (modifierFlag & (7 /* AccessibilityModifier */ | 8 /* Readonly */)) {
|
|
133871
133923
|
const constructor = find(container.members, isConstructorDeclaration);
|
|
133872
133924
|
if (constructor) {
|
|
133873
133925
|
return [...nodes, ...constructor.parameters];
|
|
133874
133926
|
}
|
|
133875
|
-
} else if (modifierFlag &
|
|
133927
|
+
} else if (modifierFlag & 64 /* Abstract */) {
|
|
133876
133928
|
return [...nodes, container];
|
|
133877
133929
|
}
|
|
133878
133930
|
return nodes;
|
|
@@ -136366,7 +136418,7 @@ ${lanes.join("\n")}
|
|
|
136366
136418
|
case 218 /* FunctionExpression */:
|
|
136367
136419
|
case 263 /* ClassDeclaration */:
|
|
136368
136420
|
case 231 /* ClassExpression */:
|
|
136369
|
-
if (getSyntacticModifierFlags(node) &
|
|
136421
|
+
if (getSyntacticModifierFlags(node) & 2048 /* Default */) {
|
|
136370
136422
|
return "default";
|
|
136371
136423
|
}
|
|
136372
136424
|
return getFunctionOrClassName(node);
|
|
@@ -136516,7 +136568,7 @@ ${lanes.join("\n")}
|
|
|
136516
136568
|
return nodeText(parent2.left).replace(whiteSpaceRegex, "");
|
|
136517
136569
|
} else if (isPropertyAssignment(parent2)) {
|
|
136518
136570
|
return nodeText(parent2.name);
|
|
136519
|
-
} else if (getSyntacticModifierFlags(node) &
|
|
136571
|
+
} else if (getSyntacticModifierFlags(node) & 2048 /* Default */) {
|
|
136520
136572
|
return "default";
|
|
136521
136573
|
} else if (isClassLike(node)) {
|
|
136522
136574
|
return "<class>";
|
|
@@ -136676,15 +136728,15 @@ ${lanes.join("\n")}
|
|
|
136676
136728
|
const { file, program } = context;
|
|
136677
136729
|
const span = getRefactorContextSpan(context);
|
|
136678
136730
|
const token = getTokenAtPosition(file, span.start);
|
|
136679
|
-
const exportNode = !!(token.parent && getSyntacticModifierFlags(token.parent) &
|
|
136731
|
+
const exportNode = !!(token.parent && getSyntacticModifierFlags(token.parent) & 32 /* Export */) && considerPartialSpans ? token.parent : getParentNodeInSpan(token, file, span);
|
|
136680
136732
|
if (!exportNode || !isSourceFile(exportNode.parent) && !(isModuleBlock(exportNode.parent) && isAmbientModule(exportNode.parent.parent))) {
|
|
136681
136733
|
return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_export_statement) };
|
|
136682
136734
|
}
|
|
136683
136735
|
const checker = program.getTypeChecker();
|
|
136684
136736
|
const exportingModuleSymbol = getExportingModuleSymbol(exportNode.parent, checker);
|
|
136685
|
-
const flags = getSyntacticModifierFlags(exportNode) || (isExportAssignment(exportNode) && !exportNode.isExportEquals ?
|
|
136686
|
-
const wasDefault = !!(flags &
|
|
136687
|
-
if (!(flags &
|
|
136737
|
+
const flags = getSyntacticModifierFlags(exportNode) || (isExportAssignment(exportNode) && !exportNode.isExportEquals ? 2080 /* ExportDefault */ : 0 /* None */);
|
|
136738
|
+
const wasDefault = !!(flags & 2048 /* Default */);
|
|
136739
|
+
if (!(flags & 32 /* Export */) || !wasDefault && exportingModuleSymbol.exports.has("default" /* Default */)) {
|
|
136688
136740
|
return { error: getLocaleSpecificMessage(Diagnostics.This_file_already_has_a_default_export) };
|
|
136689
136741
|
}
|
|
136690
136742
|
const noSymbolError = (id) => isIdentifier(id) && checker.getSymbolAtLocation(id) ? void 0 : { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_named_export) };
|
|
@@ -137672,7 +137724,7 @@ ${lanes.join("\n")}
|
|
|
137672
137724
|
if (markSeenTop(top)) {
|
|
137673
137725
|
addExportToChanges(oldFile, top, name, changes, useEsModuleSyntax);
|
|
137674
137726
|
}
|
|
137675
|
-
if (hasSyntacticModifier(decl,
|
|
137727
|
+
if (hasSyntacticModifier(decl, 2048 /* Default */)) {
|
|
137676
137728
|
oldFileDefault = name;
|
|
137677
137729
|
} else {
|
|
137678
137730
|
oldFileNamedImports.push(name.text);
|
|
@@ -137818,7 +137870,7 @@ ${lanes.join("\n")}
|
|
|
137818
137870
|
if (importAdder && checker.isUnknownSymbol(symbol)) {
|
|
137819
137871
|
importAdder.addImportFromExportedSymbol(skipAlias(symbol, checker));
|
|
137820
137872
|
} else {
|
|
137821
|
-
if (hasSyntacticModifier(decl,
|
|
137873
|
+
if (hasSyntacticModifier(decl, 2048 /* Default */)) {
|
|
137822
137874
|
oldFileDefault = name;
|
|
137823
137875
|
} else {
|
|
137824
137876
|
oldFileNamedImports.push(name.text);
|
|
@@ -138058,7 +138110,7 @@ ${lanes.join("\n")}
|
|
|
138058
138110
|
function isExported(sourceFile, decl, useEs6Exports, name) {
|
|
138059
138111
|
var _a;
|
|
138060
138112
|
if (useEs6Exports) {
|
|
138061
|
-
return !isExpressionStatement(decl) && hasSyntacticModifier(decl,
|
|
138113
|
+
return !isExpressionStatement(decl) && hasSyntacticModifier(decl, 32 /* Export */) || !!(name && sourceFile.symbol && ((_a = sourceFile.symbol.exports) == null ? void 0 : _a.has(name.escapedText)));
|
|
138062
138114
|
}
|
|
138063
138115
|
return !!sourceFile.symbol && !!sourceFile.symbol.exports && getNamesToExportInCommonJS(decl).some((name2) => sourceFile.symbol.exports.has(escapeLeadingUnderscores(name2)));
|
|
138064
138116
|
}
|
|
@@ -138353,7 +138405,7 @@ ${lanes.join("\n")}
|
|
|
138353
138405
|
case 272 /* ImportDeclaration */:
|
|
138354
138406
|
return true;
|
|
138355
138407
|
case 271 /* ImportEqualsDeclaration */:
|
|
138356
|
-
return !hasSyntacticModifier(node,
|
|
138408
|
+
return !hasSyntacticModifier(node, 32 /* Export */);
|
|
138357
138409
|
case 243 /* VariableStatement */:
|
|
138358
138410
|
return node.declarationList.declarations.every((d) => !!d.initializer && isRequireCall(
|
|
138359
138411
|
d.initializer,
|
|
@@ -138524,7 +138576,7 @@ ${lanes.join("\n")}
|
|
|
138524
138576
|
const checker = program.getTypeChecker();
|
|
138525
138577
|
const targetToSourceExports = /* @__PURE__ */ new Map();
|
|
138526
138578
|
for (const node of toMove.all) {
|
|
138527
|
-
if (isTopLevelDeclarationStatement(node) && hasSyntacticModifier(node,
|
|
138579
|
+
if (isTopLevelDeclarationStatement(node) && hasSyntacticModifier(node, 32 /* Export */)) {
|
|
138528
138580
|
forEachTopLevelDeclaration(node, (declaration) => {
|
|
138529
138581
|
var _a2;
|
|
138530
138582
|
const targetDeclarations = canHaveSymbol(declaration) ? (_a2 = targetExports.get(declaration.symbol.escapedName)) == null ? void 0 : _a2.declarations : void 0;
|
|
@@ -139190,7 +139242,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
139190
139242
|
const body = convertToBlock(func.body);
|
|
139191
139243
|
const { variableDeclaration, variableDeclarationList, statement, name } = variableInfo;
|
|
139192
139244
|
suppressLeadingTrivia(statement);
|
|
139193
|
-
const modifiersFlags = getCombinedModifierFlags(variableDeclaration) &
|
|
139245
|
+
const modifiersFlags = getCombinedModifierFlags(variableDeclaration) & 32 /* Export */ | getEffectiveModifierFlags(func);
|
|
139194
139246
|
const modifiers = factory.createModifiersFromModifierFlags(modifiersFlags);
|
|
139195
139247
|
const newNode = factory.createFunctionDeclaration(length(modifiers) ? modifiers : void 0, func.asteriskToken, name, func.typeParameters, func.parameters, func.type, body);
|
|
139196
139248
|
if (variableDeclarationList.declarations.length === 1) {
|
|
@@ -140529,7 +140581,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
140529
140581
|
}
|
|
140530
140582
|
if (isDeclaration(node2)) {
|
|
140531
140583
|
const declaringNode = node2.kind === 260 /* VariableDeclaration */ ? node2.parent.parent : node2;
|
|
140532
|
-
if (hasSyntacticModifier(declaringNode,
|
|
140584
|
+
if (hasSyntacticModifier(declaringNode, 32 /* Export */)) {
|
|
140533
140585
|
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity));
|
|
140534
140586
|
return true;
|
|
140535
140587
|
}
|
|
@@ -141537,7 +141589,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
141537
141589
|
usagesPerScope[i].usages.forEach((value) => {
|
|
141538
141590
|
if (value.usage === 2 /* Write */) {
|
|
141539
141591
|
hasWrite = true;
|
|
141540
|
-
if (value.symbol.flags & 106500 /* ClassMember */ && value.symbol.valueDeclaration && hasEffectiveModifier(value.symbol.valueDeclaration,
|
|
141592
|
+
if (value.symbol.flags & 106500 /* ClassMember */ && value.symbol.valueDeclaration && hasEffectiveModifier(value.symbol.valueDeclaration, 8 /* Readonly */)) {
|
|
141541
141593
|
readonlyClassPropertyWrite = value.symbol.valueDeclaration;
|
|
141542
141594
|
}
|
|
141543
141595
|
}
|
|
@@ -142157,14 +142209,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
142157
142209
|
if (decl) {
|
|
142158
142210
|
const modifiers = getCombinedModifierFlags(decl);
|
|
142159
142211
|
const nodeFlags = getCombinedNodeFlags(decl);
|
|
142160
|
-
if (modifiers &
|
|
142212
|
+
if (modifiers & 256 /* Static */) {
|
|
142161
142213
|
modifierSet |= 1 << 1 /* static */;
|
|
142162
142214
|
}
|
|
142163
|
-
if (modifiers &
|
|
142215
|
+
if (modifiers & 1024 /* Async */) {
|
|
142164
142216
|
modifierSet |= 1 << 2 /* async */;
|
|
142165
142217
|
}
|
|
142166
142218
|
if (typeIdx !== 0 /* class */ && typeIdx !== 2 /* interface */) {
|
|
142167
|
-
if (modifiers &
|
|
142219
|
+
if (modifiers & 8 /* Readonly */ || nodeFlags & 2 /* Const */ || symbol.getFlags() & 8 /* EnumMember */) {
|
|
142168
142220
|
modifierSet |= 1 << 3 /* readonly */;
|
|
142169
142221
|
}
|
|
142170
142222
|
}
|
|
@@ -144296,7 +144348,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
144296
144348
|
forEachChild(node, visit);
|
|
144297
144349
|
break;
|
|
144298
144350
|
case 169 /* Parameter */:
|
|
144299
|
-
if (!hasSyntacticModifier(node,
|
|
144351
|
+
if (!hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) {
|
|
144300
144352
|
break;
|
|
144301
144353
|
}
|
|
144302
144354
|
case 260 /* VariableDeclaration */:
|
|
@@ -144783,7 +144835,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
144783
144835
|
if (isBindingPattern(variableDeclaration.name)) {
|
|
144784
144836
|
return spanInBindingPattern(variableDeclaration.name);
|
|
144785
144837
|
}
|
|
144786
|
-
if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration,
|
|
144838
|
+
if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 32 /* Export */) || parent2.parent.kind === 250 /* ForOfStatement */) {
|
|
144787
144839
|
return textSpanFromVariableDeclaration(variableDeclaration);
|
|
144788
144840
|
}
|
|
144789
144841
|
if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) {
|
|
@@ -144791,7 +144843,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
144791
144843
|
}
|
|
144792
144844
|
}
|
|
144793
144845
|
function canHaveSpanInParameterDeclaration(parameter) {
|
|
144794
|
-
return !!parameter.initializer || parameter.dotDotDotToken !== void 0 || hasSyntacticModifier(parameter,
|
|
144846
|
+
return !!parameter.initializer || parameter.dotDotDotToken !== void 0 || hasSyntacticModifier(parameter, 1 /* Public */ | 2 /* Private */);
|
|
144795
144847
|
}
|
|
144796
144848
|
function spanInParameterDeclaration(parameter) {
|
|
144797
144849
|
if (isBindingPattern(parameter.name)) {
|
|
@@ -144810,7 +144862,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
144810
144862
|
}
|
|
144811
144863
|
}
|
|
144812
144864
|
function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) {
|
|
144813
|
-
return hasSyntacticModifier(functionDeclaration,
|
|
144865
|
+
return hasSyntacticModifier(functionDeclaration, 32 /* Export */) || functionDeclaration.parent.kind === 263 /* ClassDeclaration */ && functionDeclaration.kind !== 176 /* Constructor */;
|
|
144814
144866
|
}
|
|
144815
144867
|
function spanInFunctionDeclaration(functionDeclaration) {
|
|
144816
144868
|
if (!functionDeclaration.body) {
|
|
@@ -145381,7 +145433,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
145381
145433
|
forEach(node.statements, collect);
|
|
145382
145434
|
}
|
|
145383
145435
|
function collectCallSitesOfModuleDeclaration(node, collect) {
|
|
145384
|
-
if (!hasSyntacticModifier(node,
|
|
145436
|
+
if (!hasSyntacticModifier(node, 128 /* Ambient */) && node.body && isModuleBlock(node.body)) {
|
|
145385
145437
|
forEach(node.body.statements, collect);
|
|
145386
145438
|
}
|
|
145387
145439
|
}
|
|
@@ -145726,7 +145778,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
145726
145778
|
/*includeTrivia*/
|
|
145727
145779
|
true
|
|
145728
145780
|
),
|
|
145729
|
-
factory.createNodeArray(factory.createModifiersFromModifierFlags(getSyntacticModifierFlags(insertionSite) |
|
|
145781
|
+
factory.createNodeArray(factory.createModifiersFromModifierFlags(getSyntacticModifierFlags(insertionSite) | 1024 /* Async */))
|
|
145730
145782
|
);
|
|
145731
145783
|
changeTracker.replaceNode(
|
|
145732
145784
|
sourceFile,
|
|
@@ -145858,7 +145910,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
145858
145910
|
const declaration = tryCast(symbol.valueDeclaration, isVariableDeclaration);
|
|
145859
145911
|
const variableName = declaration && tryCast(declaration.name, isIdentifier);
|
|
145860
145912
|
const variableStatement = getAncestor(declaration, 243 /* VariableStatement */);
|
|
145861
|
-
if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement,
|
|
145913
|
+
if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement, 32 /* Export */) || !variableName || !isInsideAwaitableBody(declaration.initializer)) {
|
|
145862
145914
|
isCompleteFix = false;
|
|
145863
145915
|
continue;
|
|
145864
145916
|
}
|
|
@@ -148609,7 +148661,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148609
148661
|
return Debug.checkDefined(getContainingClass(getTokenAtPosition(sourceFile, pos)), "There should be a containing class");
|
|
148610
148662
|
}
|
|
148611
148663
|
function symbolPointsToNonPrivateMember(symbol) {
|
|
148612
|
-
return !symbol.valueDeclaration || !(getEffectiveModifierFlags(symbol.valueDeclaration) &
|
|
148664
|
+
return !symbol.valueDeclaration || !(getEffectiveModifierFlags(symbol.valueDeclaration) & 2 /* Private */);
|
|
148613
148665
|
}
|
|
148614
148666
|
function addMissingDeclarations(context, implementedTypeNode, sourceFile, classDeclaration, changeTracker, preferences) {
|
|
148615
148667
|
const checker = context.program.getTypeChecker();
|
|
@@ -150639,7 +150691,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
150639
150691
|
const tag = findAncestor(node, isJsxOpeningLikeElement);
|
|
150640
150692
|
const props = checker.getContextualTypeForArgumentAtIndex(tag, 0);
|
|
150641
150693
|
suggestedSymbol = checker.getSuggestedSymbolForNonexistentJSXAttribute(node, props);
|
|
150642
|
-
} else if (
|
|
150694
|
+
} else if (hasOverrideModifier(parent2) && isClassElement(parent2) && parent2.name === node) {
|
|
150643
150695
|
const baseDeclaration = findAncestor(node, isClassLike);
|
|
150644
150696
|
const baseTypeNode = baseDeclaration ? getEffectiveBaseTypeNode(baseDeclaration) : void 0;
|
|
150645
150697
|
const baseType = baseTypeNode ? checker.getTypeAtLocation(baseTypeNode) : void 0;
|
|
@@ -150820,7 +150872,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
150820
150872
|
if (isFunctionType) {
|
|
150821
150873
|
const sig = checker.getSignatureFromDeclaration(declaration);
|
|
150822
150874
|
if (sig) {
|
|
150823
|
-
if (hasSyntacticModifier(declaration,
|
|
150875
|
+
if (hasSyntacticModifier(declaration, 1024 /* Async */)) {
|
|
150824
150876
|
exprType = checker.createPromiseType(exprType);
|
|
150825
150877
|
}
|
|
150826
150878
|
const newSig = checker.createSignature(
|
|
@@ -151041,13 +151093,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
151041
151093
|
continue;
|
|
151042
151094
|
const { parentDeclaration, declSourceFile, modifierFlags, token, call, isJSFile } = info;
|
|
151043
151095
|
if (call && !isPrivateIdentifier(token)) {
|
|
151044
|
-
addMethodDeclaration(context, changes, call, token, modifierFlags &
|
|
151096
|
+
addMethodDeclaration(context, changes, call, token, modifierFlags & 256 /* Static */, parentDeclaration, declSourceFile);
|
|
151045
151097
|
} else {
|
|
151046
151098
|
if (isJSFile && !isInterfaceDeclaration(parentDeclaration) && !isTypeLiteralNode(parentDeclaration)) {
|
|
151047
|
-
addMissingMemberInJs(changes, declSourceFile, parentDeclaration, token, !!(modifierFlags &
|
|
151099
|
+
addMissingMemberInJs(changes, declSourceFile, parentDeclaration, token, !!(modifierFlags & 256 /* Static */));
|
|
151048
151100
|
} else {
|
|
151049
151101
|
const typeNode = getTypeNode2(checker, parentDeclaration, token);
|
|
151050
|
-
addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, modifierFlags &
|
|
151102
|
+
addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, modifierFlags & 256 /* Static */);
|
|
151051
151103
|
}
|
|
151052
151104
|
}
|
|
151053
151105
|
}
|
|
@@ -151128,13 +151180,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
151128
151180
|
const moduleDeclaration = find(symbol.declarations, isModuleDeclaration);
|
|
151129
151181
|
const moduleDeclarationSourceFile = moduleDeclaration == null ? void 0 : moduleDeclaration.getSourceFile();
|
|
151130
151182
|
if (moduleDeclaration && moduleDeclarationSourceFile && !isSourceFileFromLibrary(program, moduleDeclarationSourceFile)) {
|
|
151131
|
-
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile, modifierFlags:
|
|
151183
|
+
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile, modifierFlags: 32 /* Export */, parentDeclaration: moduleDeclaration };
|
|
151132
151184
|
}
|
|
151133
151185
|
const moduleSourceFile = find(symbol.declarations, isSourceFile);
|
|
151134
151186
|
if (sourceFile.commonJsModuleIndicator)
|
|
151135
151187
|
return void 0;
|
|
151136
151188
|
if (moduleSourceFile && !isSourceFileFromLibrary(program, moduleSourceFile)) {
|
|
151137
|
-
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile: moduleSourceFile, modifierFlags:
|
|
151189
|
+
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile: moduleSourceFile, modifierFlags: 32 /* Export */, parentDeclaration: moduleSourceFile };
|
|
151138
151190
|
}
|
|
151139
151191
|
}
|
|
151140
151192
|
const classDeclaration = find(symbol.declarations, isClassLike);
|
|
@@ -151146,7 +151198,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
151146
151198
|
if (makeStatic && (isPrivateIdentifier(token) || isInterfaceDeclaration(declaration)))
|
|
151147
151199
|
return void 0;
|
|
151148
151200
|
const declSourceFile = declaration.getSourceFile();
|
|
151149
|
-
const modifierFlags = isTypeLiteralNode(declaration) ? 0 /* None */ : (makeStatic ?
|
|
151201
|
+
const modifierFlags = isTypeLiteralNode(declaration) ? 0 /* None */ : (makeStatic ? 256 /* Static */ : 0 /* None */) | (startsWithUnderscore(token.text) ? 2 /* Private */ : 0 /* None */);
|
|
151150
151202
|
const isJSFile = isSourceFileJS(declSourceFile);
|
|
151151
151203
|
const call = tryCast(parent2.parent, isCallExpression);
|
|
151152
151204
|
return { kind: 0 /* TypeLikeDeclaration */, token, call, modifierFlags, parentDeclaration: declaration, declSourceFile, isJSFile };
|
|
@@ -151164,11 +151216,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
151164
151216
|
if (isInterfaceDeclaration(parentDeclaration) || isTypeLiteralNode(parentDeclaration)) {
|
|
151165
151217
|
return void 0;
|
|
151166
151218
|
}
|
|
151167
|
-
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addMissingMemberInJs(t, declSourceFile, parentDeclaration, token, !!(modifierFlags &
|
|
151219
|
+
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addMissingMemberInJs(t, declSourceFile, parentDeclaration, token, !!(modifierFlags & 256 /* Static */)));
|
|
151168
151220
|
if (changes.length === 0) {
|
|
151169
151221
|
return void 0;
|
|
151170
151222
|
}
|
|
151171
|
-
const diagnostic = modifierFlags &
|
|
151223
|
+
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
151224
|
return createCodeFixAction(fixMissingMember, changes, [diagnostic, token.text], fixMissingMember, Diagnostics.Add_all_missing_members);
|
|
151173
151225
|
}
|
|
151174
151226
|
function addMissingMemberInJs(changeTracker, sourceFile, classDeclaration, token, makeStatic) {
|
|
@@ -151212,15 +151264,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
151212
151264
|
}
|
|
151213
151265
|
function createActionsForAddMissingMemberInTypeScriptFile(context, { parentDeclaration, declSourceFile, modifierFlags, token }) {
|
|
151214
151266
|
const memberName = token.text;
|
|
151215
|
-
const isStatic2 = modifierFlags &
|
|
151267
|
+
const isStatic2 = modifierFlags & 256 /* Static */;
|
|
151216
151268
|
const typeNode = getTypeNode2(context.program.getTypeChecker(), parentDeclaration, token);
|
|
151217
151269
|
const addPropertyDeclarationChanges = (modifierFlags2) => ts_textChanges_exports.ChangeTracker.with(context, (t) => addPropertyDeclaration(t, declSourceFile, parentDeclaration, memberName, typeNode, modifierFlags2));
|
|
151218
|
-
const actions2 = [createCodeFixAction(fixMissingMember, addPropertyDeclarationChanges(modifierFlags &
|
|
151270
|
+
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
151271
|
if (isStatic2 || isPrivateIdentifier(token)) {
|
|
151220
151272
|
return actions2;
|
|
151221
151273
|
}
|
|
151222
|
-
if (modifierFlags &
|
|
151223
|
-
actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addPropertyDeclarationChanges(
|
|
151274
|
+
if (modifierFlags & 2 /* Private */) {
|
|
151275
|
+
actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addPropertyDeclarationChanges(2 /* Private */), [Diagnostics.Declare_private_property_0, memberName]));
|
|
151224
151276
|
}
|
|
151225
151277
|
actions2.push(createAddIndexSignatureAction(context, declSourceFile, parentDeclaration, token.text, typeNode));
|
|
151226
151278
|
return actions2;
|
|
@@ -151307,9 +151359,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
151307
151359
|
}
|
|
151308
151360
|
const methodName = token.text;
|
|
151309
151361
|
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(
|
|
151362
|
+
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)];
|
|
151363
|
+
if (modifierFlags & 2 /* Private */) {
|
|
151364
|
+
actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addMethodDeclarationChanges(2 /* Private */), [Diagnostics.Declare_private_method_0, methodName]));
|
|
151313
151365
|
}
|
|
151314
151366
|
return actions2;
|
|
151315
151367
|
}
|
|
@@ -151746,7 +151798,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
151746
151798
|
}
|
|
151747
151799
|
function symbolPointsToNonPrivateAndAbstractMember(symbol) {
|
|
151748
151800
|
const flags = getSyntacticModifierFlags(first(symbol.getDeclarations()));
|
|
151749
|
-
return !(flags &
|
|
151801
|
+
return !(flags & 2 /* Private */) && !!(flags & 64 /* Abstract */);
|
|
151750
151802
|
}
|
|
151751
151803
|
}
|
|
151752
151804
|
});
|
|
@@ -154223,10 +154275,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
154223
154275
|
const kind = (declaration == null ? void 0 : declaration.kind) ?? 171 /* PropertySignature */;
|
|
154224
154276
|
const declarationName = createDeclarationName(symbol, declaration);
|
|
154225
154277
|
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
|
|
154226
|
-
let modifierFlags = effectiveModifierFlags &
|
|
154227
|
-
modifierFlags |= effectiveModifierFlags &
|
|
154278
|
+
let modifierFlags = effectiveModifierFlags & 256 /* Static */;
|
|
154279
|
+
modifierFlags |= effectiveModifierFlags & 1 /* Public */ ? 1 /* Public */ : effectiveModifierFlags & 4 /* Protected */ ? 4 /* Protected */ : 0 /* None */;
|
|
154228
154280
|
if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
|
|
154229
|
-
modifierFlags |=
|
|
154281
|
+
modifierFlags |= 512 /* Accessor */;
|
|
154230
154282
|
}
|
|
154231
154283
|
const modifiers = createModifiers();
|
|
154232
154284
|
const type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration));
|
|
@@ -154905,24 +154957,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
154905
154957
|
return isIdentifier(fieldName) ? factory.createPropertyAccessExpression(leftHead, fieldName) : factory.createElementAccessExpression(leftHead, factory.createStringLiteralFromNode(fieldName));
|
|
154906
154958
|
}
|
|
154907
154959
|
function prepareModifierFlagsForAccessor(modifierFlags) {
|
|
154908
|
-
modifierFlags &= ~
|
|
154909
|
-
modifierFlags &= ~
|
|
154910
|
-
if (!(modifierFlags &
|
|
154911
|
-
modifierFlags |=
|
|
154960
|
+
modifierFlags &= ~8 /* Readonly */;
|
|
154961
|
+
modifierFlags &= ~2 /* Private */;
|
|
154962
|
+
if (!(modifierFlags & 4 /* Protected */)) {
|
|
154963
|
+
modifierFlags |= 1 /* Public */;
|
|
154912
154964
|
}
|
|
154913
154965
|
return modifierFlags;
|
|
154914
154966
|
}
|
|
154915
154967
|
function prepareModifierFlagsForField(modifierFlags) {
|
|
154916
|
-
modifierFlags &= ~
|
|
154917
|
-
modifierFlags &= ~
|
|
154918
|
-
modifierFlags |=
|
|
154968
|
+
modifierFlags &= ~1 /* Public */;
|
|
154969
|
+
modifierFlags &= ~4 /* Protected */;
|
|
154970
|
+
modifierFlags |= 2 /* Private */;
|
|
154919
154971
|
return modifierFlags;
|
|
154920
154972
|
}
|
|
154921
154973
|
function getAccessorConvertiblePropertyAtPosition(file, program, start, end, considerEmptySpans = true) {
|
|
154922
154974
|
const node = getTokenAtPosition(file, start);
|
|
154923
154975
|
const cursorRequest = start === end && considerEmptySpans;
|
|
154924
154976
|
const declaration = findAncestor(node.parent, isAcceptedDeclaration);
|
|
154925
|
-
const meaning =
|
|
154977
|
+
const meaning = 7 /* AccessibilityModifier */ | 256 /* Static */ | 8 /* Readonly */;
|
|
154926
154978
|
if (!declaration || !(nodeOverlapsWithStartEnd(declaration.name, file, start, end) || cursorRequest)) {
|
|
154927
154979
|
return {
|
|
154928
154980
|
error: getLocaleSpecificMessage(Diagnostics.Could_not_find_property_for_which_to_generate_accessor)
|
|
@@ -154933,7 +154985,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
154933
154985
|
error: getLocaleSpecificMessage(Diagnostics.Name_is_not_valid)
|
|
154934
154986
|
};
|
|
154935
154987
|
}
|
|
154936
|
-
if ((getEffectiveModifierFlags(declaration) &
|
|
154988
|
+
if ((getEffectiveModifierFlags(declaration) & 98303 /* Modifier */ | meaning) !== meaning) {
|
|
154937
154989
|
return {
|
|
154938
154990
|
error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_property_with_modifier)
|
|
154939
154991
|
};
|
|
@@ -155321,7 +155373,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155321
155373
|
return firstDefined(type.types, (t) => getDefaultValueFromType(checker, t));
|
|
155322
155374
|
} else if (type.isClass()) {
|
|
155323
155375
|
const classDeclaration = getClassLikeDeclarationOfSymbol(type.symbol);
|
|
155324
|
-
if (!classDeclaration || hasSyntacticModifier(classDeclaration,
|
|
155376
|
+
if (!classDeclaration || hasSyntacticModifier(classDeclaration, 64 /* Abstract */))
|
|
155325
155377
|
return void 0;
|
|
155326
155378
|
const constructorDeclaration = getFirstConstructorWithBody(classDeclaration);
|
|
155327
155379
|
if (constructorDeclaration && constructorDeclaration.parameters.length)
|
|
@@ -157177,7 +157229,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157177
157229
|
}
|
|
157178
157230
|
let modifiers = 0 /* None */;
|
|
157179
157231
|
const { modifiers: presentModifiers, range: eraseRange, decorators: presentDecorators } = getPresentModifiers(contextToken, sourceFile, position);
|
|
157180
|
-
const isAbstract = presentModifiers &
|
|
157232
|
+
const isAbstract = presentModifiers & 64 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 64 /* Abstract */;
|
|
157181
157233
|
let completionNodes = [];
|
|
157182
157234
|
ts_codefix_exports.addNewNodeForMemberSymbol(
|
|
157183
157235
|
symbol,
|
|
@@ -157196,10 +157248,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157196
157248
|
(node) => {
|
|
157197
157249
|
let requiredModifiers = 0 /* None */;
|
|
157198
157250
|
if (isAbstract) {
|
|
157199
|
-
requiredModifiers |=
|
|
157251
|
+
requiredModifiers |= 64 /* Abstract */;
|
|
157200
157252
|
}
|
|
157201
157253
|
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) {
|
|
157202
|
-
requiredModifiers |=
|
|
157254
|
+
requiredModifiers |= 16 /* Override */;
|
|
157203
157255
|
}
|
|
157204
157256
|
if (!completionNodes.length) {
|
|
157205
157257
|
modifiers = node.modifierFlagsCache | requiredModifiers;
|
|
@@ -157213,21 +157265,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157213
157265
|
);
|
|
157214
157266
|
if (completionNodes.length) {
|
|
157215
157267
|
const isMethod = symbol.flags & 8192 /* Method */;
|
|
157216
|
-
let allowedModifiers = modifiers |
|
|
157268
|
+
let allowedModifiers = modifiers | 16 /* Override */ | 1 /* Public */;
|
|
157217
157269
|
if (!isMethod) {
|
|
157218
|
-
allowedModifiers |=
|
|
157270
|
+
allowedModifiers |= 128 /* Ambient */ | 8 /* Readonly */;
|
|
157219
157271
|
} else {
|
|
157220
|
-
allowedModifiers |=
|
|
157272
|
+
allowedModifiers |= 1024 /* Async */;
|
|
157221
157273
|
}
|
|
157222
157274
|
const allowedAndPresent = presentModifiers & allowedModifiers;
|
|
157223
157275
|
if (presentModifiers & ~allowedModifiers) {
|
|
157224
157276
|
return void 0;
|
|
157225
157277
|
}
|
|
157226
|
-
if (modifiers &
|
|
157227
|
-
modifiers &= ~
|
|
157278
|
+
if (modifiers & 4 /* Protected */ && allowedAndPresent & 1 /* Public */) {
|
|
157279
|
+
modifiers &= ~4 /* Protected */;
|
|
157228
157280
|
}
|
|
157229
|
-
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent &
|
|
157230
|
-
modifiers &= ~
|
|
157281
|
+
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 1 /* Public */)) {
|
|
157282
|
+
modifiers &= ~1 /* Public */;
|
|
157231
157283
|
}
|
|
157232
157284
|
modifiers |= allowedAndPresent;
|
|
157233
157285
|
completionNodes = completionNodes.map((node) => factory.replaceModifiers(node, modifiers));
|
|
@@ -157264,7 +157316,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157264
157316
|
let contextMod;
|
|
157265
157317
|
const range = { pos: position, end: position };
|
|
157266
157318
|
if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) {
|
|
157267
|
-
modifiers |= modifiersToFlags(contextToken.parent.modifiers) &
|
|
157319
|
+
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 98303 /* Modifier */;
|
|
157268
157320
|
decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
|
|
157269
157321
|
range.pos = Math.min(range.pos, contextToken.parent.modifiers.pos);
|
|
157270
157322
|
}
|
|
@@ -159005,24 +159057,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159005
159057
|
if (contextToken.kind === 80 /* Identifier */ && !isCurrentlyEditingNode(contextToken)) {
|
|
159006
159058
|
switch (contextToken.getText()) {
|
|
159007
159059
|
case "private":
|
|
159008
|
-
classElementModifierFlags = classElementModifierFlags |
|
|
159060
|
+
classElementModifierFlags = classElementModifierFlags | 2 /* Private */;
|
|
159009
159061
|
break;
|
|
159010
159062
|
case "static":
|
|
159011
|
-
classElementModifierFlags = classElementModifierFlags |
|
|
159063
|
+
classElementModifierFlags = classElementModifierFlags | 256 /* Static */;
|
|
159012
159064
|
break;
|
|
159013
159065
|
case "override":
|
|
159014
|
-
classElementModifierFlags = classElementModifierFlags |
|
|
159066
|
+
classElementModifierFlags = classElementModifierFlags | 16 /* Override */;
|
|
159015
159067
|
break;
|
|
159016
159068
|
}
|
|
159017
159069
|
}
|
|
159018
159070
|
if (isClassStaticBlockDeclaration(classElement)) {
|
|
159019
|
-
classElementModifierFlags |=
|
|
159071
|
+
classElementModifierFlags |= 256 /* Static */;
|
|
159020
159072
|
}
|
|
159021
|
-
if (!(classElementModifierFlags &
|
|
159022
|
-
const baseTypeNodes = isClassLike(decl) && classElementModifierFlags &
|
|
159073
|
+
if (!(classElementModifierFlags & 2 /* Private */)) {
|
|
159074
|
+
const baseTypeNodes = isClassLike(decl) && classElementModifierFlags & 16 /* Override */ ? singleElementArray(getEffectiveBaseTypeNode(decl)) : getAllSuperTypeNodes(decl);
|
|
159023
159075
|
const baseSymbols = flatMap(baseTypeNodes, (baseTypeNode) => {
|
|
159024
159076
|
const type = typeChecker.getTypeAtLocation(baseTypeNode);
|
|
159025
|
-
return classElementModifierFlags &
|
|
159077
|
+
return classElementModifierFlags & 256 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type);
|
|
159026
159078
|
});
|
|
159027
159079
|
symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags));
|
|
159028
159080
|
forEach(symbols, (symbol, index) => {
|
|
@@ -159325,10 +159377,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159325
159377
|
if (isCurrentlyEditingNode(m)) {
|
|
159326
159378
|
continue;
|
|
159327
159379
|
}
|
|
159328
|
-
if (hasEffectiveModifier(m,
|
|
159380
|
+
if (hasEffectiveModifier(m, 2 /* Private */)) {
|
|
159329
159381
|
continue;
|
|
159330
159382
|
}
|
|
159331
|
-
if (isStatic(m) !== !!(currentClassElementModifierFlags &
|
|
159383
|
+
if (isStatic(m) !== !!(currentClassElementModifierFlags & 256 /* Static */)) {
|
|
159332
159384
|
continue;
|
|
159333
159385
|
}
|
|
159334
159386
|
const existingName = getPropertyNameForPropertyNameNode(m.name);
|
|
@@ -159337,7 +159389,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159337
159389
|
}
|
|
159338
159390
|
}
|
|
159339
159391
|
return baseSymbols.filter(
|
|
159340
|
-
(propertySymbol) => !existingMemberNames.has(propertySymbol.escapedName) && !!propertySymbol.declarations && !(getDeclarationModifierFlagsFromSymbol(propertySymbol) &
|
|
159392
|
+
(propertySymbol) => !existingMemberNames.has(propertySymbol.escapedName) && !!propertySymbol.declarations && !(getDeclarationModifierFlagsFromSymbol(propertySymbol) & 2 /* Private */) && !(propertySymbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(propertySymbol.valueDeclaration))
|
|
159341
159393
|
);
|
|
159342
159394
|
}
|
|
159343
159395
|
function filterJsxAttributes(symbols2, attributes) {
|
|
@@ -159586,7 +159638,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159586
159638
|
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
159639
|
}
|
|
159588
159640
|
function containsNonPublicProperties(props) {
|
|
159589
|
-
return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) &
|
|
159641
|
+
return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */));
|
|
159590
159642
|
}
|
|
159591
159643
|
function getPropertiesForCompletion(type, checker) {
|
|
159592
159644
|
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 +159798,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159746
159798
|
return false;
|
|
159747
159799
|
}
|
|
159748
159800
|
function isStaticProperty(symbol) {
|
|
159749
|
-
return !!(symbol.valueDeclaration && getEffectiveModifierFlags(symbol.valueDeclaration) &
|
|
159801
|
+
return !!(symbol.valueDeclaration && getEffectiveModifierFlags(symbol.valueDeclaration) & 256 /* Static */ && isClassLike(symbol.valueDeclaration.parent));
|
|
159750
159802
|
}
|
|
159751
159803
|
function tryGetObjectLiteralContextualType(node, typeChecker) {
|
|
159752
159804
|
const type = typeChecker.getContextualType(node);
|
|
@@ -160957,7 +161009,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160957
161009
|
handleNamespaceImport(
|
|
160958
161010
|
direct,
|
|
160959
161011
|
direct.name,
|
|
160960
|
-
hasSyntacticModifier(direct,
|
|
161012
|
+
hasSyntacticModifier(direct, 32 /* Export */),
|
|
160961
161013
|
/*alreadyAddedDirect*/
|
|
160962
161014
|
false
|
|
160963
161015
|
);
|
|
@@ -161272,7 +161324,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161272
161324
|
}
|
|
161273
161325
|
} else {
|
|
161274
161326
|
const exportNode = getExportNode(parent2, node);
|
|
161275
|
-
if (exportNode && hasSyntacticModifier(exportNode,
|
|
161327
|
+
if (exportNode && hasSyntacticModifier(exportNode, 32 /* Export */)) {
|
|
161276
161328
|
if (isImportEqualsDeclaration(exportNode) && exportNode.moduleReference === node) {
|
|
161277
161329
|
if (comingFromExport) {
|
|
161278
161330
|
return void 0;
|
|
@@ -161349,7 +161401,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161349
161401
|
return exportInfo2 && { kind: 1 /* Export */, symbol: symbol2, exportInfo: exportInfo2 };
|
|
161350
161402
|
}
|
|
161351
161403
|
function getExportKindForDeclaration(node2) {
|
|
161352
|
-
return hasSyntacticModifier(node2,
|
|
161404
|
+
return hasSyntacticModifier(node2, 2048 /* Default */) ? 1 /* Default */ : 0 /* Named */;
|
|
161353
161405
|
}
|
|
161354
161406
|
}
|
|
161355
161407
|
function getExportEqualsLocalSymbol(importedSymbol, checker) {
|
|
@@ -161493,7 +161545,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161493
161545
|
if (node.parent.name === node || // node is name of declaration, use parent
|
|
161494
161546
|
isConstructorDeclaration(node.parent) || isExportAssignment(node.parent) || // Property name of the import export specifier or binding pattern, use parent
|
|
161495
161547
|
(isImportOrExportSpecifier(node.parent) || isBindingElement(node.parent)) && node.parent.propertyName === node || // Is default export
|
|
161496
|
-
node.kind === 90 /* DefaultKeyword */ && hasSyntacticModifier(node.parent,
|
|
161548
|
+
node.kind === 90 /* DefaultKeyword */ && hasSyntacticModifier(node.parent, 2080 /* ExportDefault */)) {
|
|
161497
161549
|
return getContextNode(node.parent);
|
|
161498
161550
|
}
|
|
161499
161551
|
return void 0;
|
|
@@ -162476,7 +162528,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162476
162528
|
return void 0;
|
|
162477
162529
|
}
|
|
162478
162530
|
if (flags & (4 /* Property */ | 8192 /* Method */)) {
|
|
162479
|
-
const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d,
|
|
162531
|
+
const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d, 2 /* Private */) || isPrivateIdentifierClassElementDeclaration(d));
|
|
162480
162532
|
if (privateDeclaration) {
|
|
162481
162533
|
return getAncestor(privateDeclaration, 263 /* ClassDeclaration */);
|
|
162482
162534
|
}
|
|
@@ -162986,7 +163038,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162986
163038
|
if (!searchSpaceNode) {
|
|
162987
163039
|
return void 0;
|
|
162988
163040
|
}
|
|
162989
|
-
let staticFlag =
|
|
163041
|
+
let staticFlag = 256 /* Static */;
|
|
162990
163042
|
switch (searchSpaceNode.kind) {
|
|
162991
163043
|
case 172 /* PropertyDeclaration */:
|
|
162992
163044
|
case 171 /* PropertySignature */:
|
|
@@ -163026,7 +163078,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163026
163078
|
/*includeClassComputedPropertyName*/
|
|
163027
163079
|
false
|
|
163028
163080
|
);
|
|
163029
|
-
let staticFlag =
|
|
163081
|
+
let staticFlag = 256 /* Static */;
|
|
163030
163082
|
switch (searchSpaceNode.kind) {
|
|
163031
163083
|
case 174 /* MethodDeclaration */:
|
|
163032
163084
|
case 173 /* MethodSignature */:
|
|
@@ -163268,7 +163320,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163268
163320
|
if (!symbol.valueDeclaration)
|
|
163269
163321
|
return false;
|
|
163270
163322
|
const modifierFlags = getEffectiveModifierFlags(symbol.valueDeclaration);
|
|
163271
|
-
return !!(modifierFlags &
|
|
163323
|
+
return !!(modifierFlags & 256 /* Static */);
|
|
163272
163324
|
}
|
|
163273
163325
|
function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) {
|
|
163274
163326
|
const { checker } = state;
|
|
@@ -163824,7 +163876,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163824
163876
|
case 177 /* GetAccessor */:
|
|
163825
163877
|
case 178 /* SetAccessor */:
|
|
163826
163878
|
case 174 /* MethodDeclaration */:
|
|
163827
|
-
if (hasEffectiveModifier(declaration,
|
|
163879
|
+
if (hasEffectiveModifier(declaration, 2 /* Private */))
|
|
163828
163880
|
return false;
|
|
163829
163881
|
case 176 /* Constructor */:
|
|
163830
163882
|
case 303 /* PropertyAssignment */:
|
|
@@ -167024,7 +167076,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
167024
167076
|
function getNormalizedSymbolModifiers(symbol) {
|
|
167025
167077
|
if (symbol.declarations && symbol.declarations.length) {
|
|
167026
167078
|
const [declaration, ...declarations] = symbol.declarations;
|
|
167027
|
-
const excludeFlags = length(declarations) && isDeprecatedDeclaration(declaration) && some(declarations, (d) => !isDeprecatedDeclaration(d)) ?
|
|
167079
|
+
const excludeFlags = length(declarations) && isDeprecatedDeclaration(declaration) && some(declarations, (d) => !isDeprecatedDeclaration(d)) ? 65536 /* Deprecated */ : 0 /* None */;
|
|
167028
167080
|
const modifiers = getNodeModifiers(declaration, excludeFlags);
|
|
167029
167081
|
if (modifiers) {
|
|
167030
167082
|
return modifiers.split(",");
|
|
@@ -167300,7 +167352,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
167300
167352
|
const resolvedNode = resolvedSymbol.declarations[0];
|
|
167301
167353
|
const declarationName = getNameOfDeclaration(resolvedNode);
|
|
167302
167354
|
if (declarationName && !hasAddedSymbolInfo) {
|
|
167303
|
-
const isExternalModuleDeclaration = isModuleWithStringLiteralName(resolvedNode) && hasSyntacticModifier(resolvedNode,
|
|
167355
|
+
const isExternalModuleDeclaration = isModuleWithStringLiteralName(resolvedNode) && hasSyntacticModifier(resolvedNode, 128 /* Ambient */);
|
|
167304
167356
|
const shouldUseAliasName = symbol.name !== "default" && !isExternalModuleDeclaration;
|
|
167305
167357
|
const resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
|
|
167306
167358
|
typeChecker,
|