typescript 5.3.0-dev.20231024 → 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/lib.es2023.array.d.ts +11 -11
- package/lib/tsc.js +494 -442
- package/lib/tsserver.js +43426 -37239
- package/lib/typescript.d.ts +26 -25
- package/lib/typescript.js +10794 -8811
- package/lib/typingsInstaller.js +108 -85
- package/package.json +3 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.3";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20231026`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3460,32 +3460,43 @@ var NodeFlags = /* @__PURE__ */ ((NodeFlags3) => {
|
|
|
3460
3460
|
})(NodeFlags || {});
|
|
3461
3461
|
var ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => {
|
|
3462
3462
|
ModifierFlags3[ModifierFlags3["None"] = 0] = "None";
|
|
3463
|
-
ModifierFlags3[ModifierFlags3["
|
|
3464
|
-
ModifierFlags3[ModifierFlags3["
|
|
3465
|
-
ModifierFlags3[ModifierFlags3["
|
|
3466
|
-
ModifierFlags3[ModifierFlags3["
|
|
3467
|
-
ModifierFlags3[ModifierFlags3["
|
|
3468
|
-
ModifierFlags3[ModifierFlags3["
|
|
3469
|
-
ModifierFlags3[ModifierFlags3["
|
|
3470
|
-
ModifierFlags3[ModifierFlags3["
|
|
3471
|
-
ModifierFlags3[ModifierFlags3["
|
|
3472
|
-
ModifierFlags3[ModifierFlags3["
|
|
3473
|
-
ModifierFlags3[ModifierFlags3["
|
|
3474
|
-
ModifierFlags3[ModifierFlags3["
|
|
3475
|
-
ModifierFlags3[ModifierFlags3["
|
|
3476
|
-
ModifierFlags3[ModifierFlags3["
|
|
3477
|
-
ModifierFlags3[ModifierFlags3["
|
|
3478
|
-
ModifierFlags3[ModifierFlags3["
|
|
3479
|
-
ModifierFlags3[ModifierFlags3["
|
|
3480
|
-
ModifierFlags3[ModifierFlags3["
|
|
3463
|
+
ModifierFlags3[ModifierFlags3["Public"] = 1] = "Public";
|
|
3464
|
+
ModifierFlags3[ModifierFlags3["Private"] = 2] = "Private";
|
|
3465
|
+
ModifierFlags3[ModifierFlags3["Protected"] = 4] = "Protected";
|
|
3466
|
+
ModifierFlags3[ModifierFlags3["Readonly"] = 8] = "Readonly";
|
|
3467
|
+
ModifierFlags3[ModifierFlags3["Override"] = 16] = "Override";
|
|
3468
|
+
ModifierFlags3[ModifierFlags3["Export"] = 32] = "Export";
|
|
3469
|
+
ModifierFlags3[ModifierFlags3["Abstract"] = 64] = "Abstract";
|
|
3470
|
+
ModifierFlags3[ModifierFlags3["Ambient"] = 128] = "Ambient";
|
|
3471
|
+
ModifierFlags3[ModifierFlags3["Static"] = 256] = "Static";
|
|
3472
|
+
ModifierFlags3[ModifierFlags3["Accessor"] = 512] = "Accessor";
|
|
3473
|
+
ModifierFlags3[ModifierFlags3["Async"] = 1024] = "Async";
|
|
3474
|
+
ModifierFlags3[ModifierFlags3["Default"] = 2048] = "Default";
|
|
3475
|
+
ModifierFlags3[ModifierFlags3["Const"] = 4096] = "Const";
|
|
3476
|
+
ModifierFlags3[ModifierFlags3["In"] = 8192] = "In";
|
|
3477
|
+
ModifierFlags3[ModifierFlags3["Out"] = 16384] = "Out";
|
|
3478
|
+
ModifierFlags3[ModifierFlags3["Decorator"] = 32768] = "Decorator";
|
|
3479
|
+
ModifierFlags3[ModifierFlags3["Deprecated"] = 65536] = "Deprecated";
|
|
3480
|
+
ModifierFlags3[ModifierFlags3["JSDocPublic"] = 8388608] = "JSDocPublic";
|
|
3481
|
+
ModifierFlags3[ModifierFlags3["JSDocPrivate"] = 16777216] = "JSDocPrivate";
|
|
3482
|
+
ModifierFlags3[ModifierFlags3["JSDocProtected"] = 33554432] = "JSDocProtected";
|
|
3483
|
+
ModifierFlags3[ModifierFlags3["JSDocReadonly"] = 67108864] = "JSDocReadonly";
|
|
3484
|
+
ModifierFlags3[ModifierFlags3["JSDocOverride"] = 134217728] = "JSDocOverride";
|
|
3485
|
+
ModifierFlags3[ModifierFlags3["SyntacticOrJSDocModifiers"] = 31] = "SyntacticOrJSDocModifiers";
|
|
3486
|
+
ModifierFlags3[ModifierFlags3["SyntacticOnlyModifiers"] = 65504] = "SyntacticOnlyModifiers";
|
|
3487
|
+
ModifierFlags3[ModifierFlags3["SyntacticModifiers"] = 65535] = "SyntacticModifiers";
|
|
3488
|
+
ModifierFlags3[ModifierFlags3["JSDocCacheOnlyModifiers"] = 260046848] = "JSDocCacheOnlyModifiers";
|
|
3489
|
+
ModifierFlags3[ModifierFlags3["JSDocOnlyModifiers"] = 65536 /* Deprecated */] = "JSDocOnlyModifiers";
|
|
3490
|
+
ModifierFlags3[ModifierFlags3["NonCacheOnlyModifiers"] = 131071] = "NonCacheOnlyModifiers";
|
|
3491
|
+
ModifierFlags3[ModifierFlags3["HasComputedJSDocModifiers"] = 268435456] = "HasComputedJSDocModifiers";
|
|
3481
3492
|
ModifierFlags3[ModifierFlags3["HasComputedFlags"] = 536870912] = "HasComputedFlags";
|
|
3482
|
-
ModifierFlags3[ModifierFlags3["AccessibilityModifier"] =
|
|
3483
|
-
ModifierFlags3[ModifierFlags3["ParameterPropertyModifier"] =
|
|
3484
|
-
ModifierFlags3[ModifierFlags3["NonPublicAccessibilityModifier"] =
|
|
3485
|
-
ModifierFlags3[ModifierFlags3["TypeScriptModifier"] =
|
|
3486
|
-
ModifierFlags3[ModifierFlags3["ExportDefault"] =
|
|
3487
|
-
ModifierFlags3[ModifierFlags3["All"] =
|
|
3488
|
-
ModifierFlags3[ModifierFlags3["Modifier"] =
|
|
3493
|
+
ModifierFlags3[ModifierFlags3["AccessibilityModifier"] = 7] = "AccessibilityModifier";
|
|
3494
|
+
ModifierFlags3[ModifierFlags3["ParameterPropertyModifier"] = 31] = "ParameterPropertyModifier";
|
|
3495
|
+
ModifierFlags3[ModifierFlags3["NonPublicAccessibilityModifier"] = 6] = "NonPublicAccessibilityModifier";
|
|
3496
|
+
ModifierFlags3[ModifierFlags3["TypeScriptModifier"] = 28895] = "TypeScriptModifier";
|
|
3497
|
+
ModifierFlags3[ModifierFlags3["ExportDefault"] = 2080] = "ExportDefault";
|
|
3498
|
+
ModifierFlags3[ModifierFlags3["All"] = 131071] = "All";
|
|
3499
|
+
ModifierFlags3[ModifierFlags3["Modifier"] = 98303] = "Modifier";
|
|
3489
3500
|
return ModifierFlags3;
|
|
3490
3501
|
})(ModifierFlags || {});
|
|
3491
3502
|
var RelationComparisonResult = /* @__PURE__ */ ((RelationComparisonResult3) => {
|
|
@@ -10070,7 +10081,7 @@ function createTextChangeRange(span, newLength) {
|
|
|
10070
10081
|
}
|
|
10071
10082
|
var unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
|
|
10072
10083
|
function isParameterPropertyDeclaration(node, parent) {
|
|
10073
|
-
return isParameter(node) && hasSyntacticModifier(node,
|
|
10084
|
+
return isParameter(node) && hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) && parent.kind === 176 /* Constructor */;
|
|
10074
10085
|
}
|
|
10075
10086
|
function walkUpBindingElementsAndPatterns(binding) {
|
|
10076
10087
|
let node = binding.parent;
|
|
@@ -10345,7 +10356,7 @@ function getDecorators(node) {
|
|
|
10345
10356
|
}
|
|
10346
10357
|
}
|
|
10347
10358
|
function getModifiers(node) {
|
|
10348
|
-
if (hasSyntacticModifier(node,
|
|
10359
|
+
if (hasSyntacticModifier(node, 98303 /* Modifier */)) {
|
|
10349
10360
|
return filter(node.modifiers, isModifier);
|
|
10350
10361
|
}
|
|
10351
10362
|
}
|
|
@@ -10739,7 +10750,7 @@ function isModifierKind(token) {
|
|
|
10739
10750
|
return false;
|
|
10740
10751
|
}
|
|
10741
10752
|
function isParameterPropertyModifier(kind) {
|
|
10742
|
-
return !!(modifierToFlag(kind) &
|
|
10753
|
+
return !!(modifierToFlag(kind) & 31 /* ParameterPropertyModifier */);
|
|
10743
10754
|
}
|
|
10744
10755
|
function isClassMemberModifier(idToken) {
|
|
10745
10756
|
return isParameterPropertyModifier(idToken) || idToken === 126 /* StaticKeyword */ || idToken === 164 /* OverrideKeyword */ || idToken === 129 /* AccessorKeyword */;
|
|
@@ -11083,10 +11094,10 @@ function hasScopeMarker(statements) {
|
|
|
11083
11094
|
return some(statements, isScopeMarker);
|
|
11084
11095
|
}
|
|
11085
11096
|
function needsScopeMarker(result) {
|
|
11086
|
-
return !isAnyImportOrReExport(result) && !isExportAssignment(result) && !hasSyntacticModifier(result,
|
|
11097
|
+
return !isAnyImportOrReExport(result) && !isExportAssignment(result) && !hasSyntacticModifier(result, 32 /* Export */) && !isAmbientModule(result);
|
|
11087
11098
|
}
|
|
11088
11099
|
function isExternalModuleIndicator(result) {
|
|
11089
|
-
return isAnyImportOrReExport(result) || isExportAssignment(result) || hasSyntacticModifier(result,
|
|
11100
|
+
return isAnyImportOrReExport(result) || isExportAssignment(result) || hasSyntacticModifier(result, 32 /* Export */);
|
|
11090
11101
|
}
|
|
11091
11102
|
function isForInOrOfStatement(node) {
|
|
11092
11103
|
return node.kind === 249 /* ForInStatement */ || node.kind === 250 /* ForOfStatement */;
|
|
@@ -12273,7 +12284,7 @@ function isEffectiveStrictModeSourceFile(node, compilerOptions) {
|
|
|
12273
12284
|
return false;
|
|
12274
12285
|
}
|
|
12275
12286
|
function isAmbientPropertyDeclaration(node) {
|
|
12276
|
-
return !!(node.flags & 33554432 /* Ambient */) || hasSyntacticModifier(node,
|
|
12287
|
+
return !!(node.flags & 33554432 /* Ambient */) || hasSyntacticModifier(node, 128 /* Ambient */);
|
|
12277
12288
|
}
|
|
12278
12289
|
function isBlockScope(node, parentNode) {
|
|
12279
12290
|
switch (node.kind) {
|
|
@@ -12583,10 +12594,10 @@ function isJsonSourceFile(file) {
|
|
|
12583
12594
|
return file.scriptKind === 6 /* JSON */;
|
|
12584
12595
|
}
|
|
12585
12596
|
function isEnumConst(node) {
|
|
12586
|
-
return !!(getCombinedModifierFlags(node) &
|
|
12597
|
+
return !!(getCombinedModifierFlags(node) & 4096 /* Const */);
|
|
12587
12598
|
}
|
|
12588
12599
|
function isDeclarationReadonly(declaration) {
|
|
12589
|
-
return !!(getCombinedModifierFlags(declaration) &
|
|
12600
|
+
return !!(getCombinedModifierFlags(declaration) & 8 /* Readonly */ && !isParameterPropertyDeclaration(declaration, declaration.parent));
|
|
12590
12601
|
}
|
|
12591
12602
|
function isVarAwaitUsing(node) {
|
|
12592
12603
|
return (getCombinedNodeFlags(node) & 7 /* BlockScoped */) === 6 /* AwaitUsing */;
|
|
@@ -14231,7 +14242,7 @@ function getFunctionFlags(node) {
|
|
|
14231
14242
|
flags |= 1 /* Generator */;
|
|
14232
14243
|
}
|
|
14233
14244
|
case 219 /* ArrowFunction */:
|
|
14234
|
-
if (hasSyntacticModifier(node,
|
|
14245
|
+
if (hasSyntacticModifier(node, 1024 /* Async */)) {
|
|
14235
14246
|
flags |= 2 /* Async */;
|
|
14236
14247
|
}
|
|
14237
14248
|
break;
|
|
@@ -14247,7 +14258,7 @@ function isAsyncFunction(node) {
|
|
|
14247
14258
|
case 218 /* FunctionExpression */:
|
|
14248
14259
|
case 219 /* ArrowFunction */:
|
|
14249
14260
|
case 174 /* MethodDeclaration */:
|
|
14250
|
-
return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node,
|
|
14261
|
+
return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 1024 /* Async */);
|
|
14251
14262
|
}
|
|
14252
14263
|
return false;
|
|
14253
14264
|
}
|
|
@@ -15359,25 +15370,25 @@ function isStatic(node) {
|
|
|
15359
15370
|
return isClassElement(node) && hasStaticModifier(node) || isClassStaticBlockDeclaration(node);
|
|
15360
15371
|
}
|
|
15361
15372
|
function hasStaticModifier(node) {
|
|
15362
|
-
return hasSyntacticModifier(node,
|
|
15373
|
+
return hasSyntacticModifier(node, 256 /* Static */);
|
|
15363
15374
|
}
|
|
15364
15375
|
function hasOverrideModifier(node) {
|
|
15365
|
-
return hasEffectiveModifier(node,
|
|
15376
|
+
return hasEffectiveModifier(node, 16 /* Override */);
|
|
15366
15377
|
}
|
|
15367
15378
|
function hasAbstractModifier(node) {
|
|
15368
|
-
return hasSyntacticModifier(node,
|
|
15379
|
+
return hasSyntacticModifier(node, 64 /* Abstract */);
|
|
15369
15380
|
}
|
|
15370
15381
|
function hasAmbientModifier(node) {
|
|
15371
|
-
return hasSyntacticModifier(node,
|
|
15382
|
+
return hasSyntacticModifier(node, 128 /* Ambient */);
|
|
15372
15383
|
}
|
|
15373
15384
|
function hasAccessorModifier(node) {
|
|
15374
|
-
return hasSyntacticModifier(node,
|
|
15385
|
+
return hasSyntacticModifier(node, 512 /* Accessor */);
|
|
15375
15386
|
}
|
|
15376
15387
|
function hasEffectiveReadonlyModifier(node) {
|
|
15377
|
-
return hasEffectiveModifier(node,
|
|
15388
|
+
return hasEffectiveModifier(node, 8 /* Readonly */);
|
|
15378
15389
|
}
|
|
15379
15390
|
function hasDecorators(node) {
|
|
15380
|
-
return hasSyntacticModifier(node,
|
|
15391
|
+
return hasSyntacticModifier(node, 32768 /* Decorator */);
|
|
15381
15392
|
}
|
|
15382
15393
|
function getSelectedEffectiveModifierFlags(node, flags) {
|
|
15383
15394
|
return getEffectiveModifierFlags(node) & flags;
|
|
@@ -15392,10 +15403,13 @@ function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) {
|
|
|
15392
15403
|
if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) {
|
|
15393
15404
|
node.modifierFlagsCache = getSyntacticModifierFlagsNoCache(node) | 536870912 /* HasComputedFlags */;
|
|
15394
15405
|
}
|
|
15395
|
-
if (
|
|
15396
|
-
node.modifierFlagsCache
|
|
15406
|
+
if (alwaysIncludeJSDoc || includeJSDoc && isInJSFile(node)) {
|
|
15407
|
+
if (!(node.modifierFlagsCache & 268435456 /* HasComputedJSDocModifiers */) && node.parent) {
|
|
15408
|
+
node.modifierFlagsCache |= getRawJSDocModifierFlagsNoCache(node) | 268435456 /* HasComputedJSDocModifiers */;
|
|
15409
|
+
}
|
|
15410
|
+
return selectEffectiveModifierFlags(node.modifierFlagsCache);
|
|
15397
15411
|
}
|
|
15398
|
-
return node.modifierFlagsCache
|
|
15412
|
+
return selectSyntacticModifierFlags(node.modifierFlagsCache);
|
|
15399
15413
|
}
|
|
15400
15414
|
function getEffectiveModifierFlags(node) {
|
|
15401
15415
|
return getModifierFlagsWorker(
|
|
@@ -15411,33 +15425,42 @@ function getSyntacticModifierFlags(node) {
|
|
|
15411
15425
|
false
|
|
15412
15426
|
);
|
|
15413
15427
|
}
|
|
15414
|
-
function
|
|
15428
|
+
function getRawJSDocModifierFlagsNoCache(node) {
|
|
15415
15429
|
let flags = 0 /* None */;
|
|
15416
15430
|
if (!!node.parent && !isParameter(node)) {
|
|
15417
15431
|
if (isInJSFile(node)) {
|
|
15418
15432
|
if (getJSDocPublicTagNoCache(node))
|
|
15419
|
-
flags |=
|
|
15433
|
+
flags |= 8388608 /* JSDocPublic */;
|
|
15420
15434
|
if (getJSDocPrivateTagNoCache(node))
|
|
15421
|
-
flags |=
|
|
15435
|
+
flags |= 16777216 /* JSDocPrivate */;
|
|
15422
15436
|
if (getJSDocProtectedTagNoCache(node))
|
|
15423
|
-
flags |=
|
|
15437
|
+
flags |= 33554432 /* JSDocProtected */;
|
|
15424
15438
|
if (getJSDocReadonlyTagNoCache(node))
|
|
15425
|
-
flags |=
|
|
15439
|
+
flags |= 67108864 /* JSDocReadonly */;
|
|
15426
15440
|
if (getJSDocOverrideTagNoCache(node))
|
|
15427
|
-
flags |=
|
|
15441
|
+
flags |= 134217728 /* JSDocOverride */;
|
|
15428
15442
|
}
|
|
15429
15443
|
if (getJSDocDeprecatedTagNoCache(node))
|
|
15430
|
-
flags |=
|
|
15444
|
+
flags |= 65536 /* Deprecated */;
|
|
15431
15445
|
}
|
|
15432
15446
|
return flags;
|
|
15433
15447
|
}
|
|
15448
|
+
function selectSyntacticModifierFlags(flags) {
|
|
15449
|
+
return flags & 65535 /* SyntacticModifiers */;
|
|
15450
|
+
}
|
|
15451
|
+
function selectEffectiveModifierFlags(flags) {
|
|
15452
|
+
return flags & 131071 /* NonCacheOnlyModifiers */ | (flags & 260046848 /* JSDocCacheOnlyModifiers */) >>> 23;
|
|
15453
|
+
}
|
|
15454
|
+
function getJSDocModifierFlagsNoCache(node) {
|
|
15455
|
+
return selectEffectiveModifierFlags(getRawJSDocModifierFlagsNoCache(node));
|
|
15456
|
+
}
|
|
15434
15457
|
function getEffectiveModifierFlagsNoCache(node) {
|
|
15435
15458
|
return getSyntacticModifierFlagsNoCache(node) | getJSDocModifierFlagsNoCache(node);
|
|
15436
15459
|
}
|
|
15437
15460
|
function getSyntacticModifierFlagsNoCache(node) {
|
|
15438
15461
|
let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */;
|
|
15439
15462
|
if (node.flags & 8 /* NestedNamespace */ || node.kind === 80 /* Identifier */ && node.flags & 4096 /* IdentifierIsInJSDocNamespace */) {
|
|
15440
|
-
flags |=
|
|
15463
|
+
flags |= 32 /* Export */;
|
|
15441
15464
|
}
|
|
15442
15465
|
return flags;
|
|
15443
15466
|
}
|
|
@@ -15453,37 +15476,37 @@ function modifiersToFlags(modifiers) {
|
|
|
15453
15476
|
function modifierToFlag(token) {
|
|
15454
15477
|
switch (token) {
|
|
15455
15478
|
case 126 /* StaticKeyword */:
|
|
15456
|
-
return
|
|
15479
|
+
return 256 /* Static */;
|
|
15457
15480
|
case 125 /* PublicKeyword */:
|
|
15458
|
-
return
|
|
15481
|
+
return 1 /* Public */;
|
|
15459
15482
|
case 124 /* ProtectedKeyword */:
|
|
15460
|
-
return
|
|
15483
|
+
return 4 /* Protected */;
|
|
15461
15484
|
case 123 /* PrivateKeyword */:
|
|
15462
|
-
return
|
|
15485
|
+
return 2 /* Private */;
|
|
15463
15486
|
case 128 /* AbstractKeyword */:
|
|
15464
|
-
return
|
|
15487
|
+
return 64 /* Abstract */;
|
|
15465
15488
|
case 129 /* AccessorKeyword */:
|
|
15466
|
-
return
|
|
15489
|
+
return 512 /* Accessor */;
|
|
15467
15490
|
case 95 /* ExportKeyword */:
|
|
15468
|
-
return
|
|
15491
|
+
return 32 /* Export */;
|
|
15469
15492
|
case 138 /* DeclareKeyword */:
|
|
15470
|
-
return
|
|
15493
|
+
return 128 /* Ambient */;
|
|
15471
15494
|
case 87 /* ConstKeyword */:
|
|
15472
|
-
return
|
|
15495
|
+
return 4096 /* Const */;
|
|
15473
15496
|
case 90 /* DefaultKeyword */:
|
|
15474
|
-
return
|
|
15497
|
+
return 2048 /* Default */;
|
|
15475
15498
|
case 134 /* AsyncKeyword */:
|
|
15476
|
-
return
|
|
15499
|
+
return 1024 /* Async */;
|
|
15477
15500
|
case 148 /* ReadonlyKeyword */:
|
|
15478
|
-
return
|
|
15501
|
+
return 8 /* Readonly */;
|
|
15479
15502
|
case 164 /* OverrideKeyword */:
|
|
15480
|
-
return
|
|
15503
|
+
return 16 /* Override */;
|
|
15481
15504
|
case 103 /* InKeyword */:
|
|
15482
|
-
return
|
|
15505
|
+
return 8192 /* In */;
|
|
15483
15506
|
case 147 /* OutKeyword */:
|
|
15484
|
-
return
|
|
15507
|
+
return 16384 /* Out */;
|
|
15485
15508
|
case 170 /* Decorator */:
|
|
15486
|
-
return
|
|
15509
|
+
return 32768 /* Decorator */;
|
|
15487
15510
|
}
|
|
15488
15511
|
return 0 /* None */;
|
|
15489
15512
|
}
|
|
@@ -15620,7 +15643,7 @@ function getLocalSymbolForExportDefault(symbol) {
|
|
|
15620
15643
|
return void 0;
|
|
15621
15644
|
}
|
|
15622
15645
|
function isExportDefaultSymbol(symbol) {
|
|
15623
|
-
return symbol && length(symbol.declarations) > 0 && hasSyntacticModifier(symbol.declarations[0],
|
|
15646
|
+
return symbol && length(symbol.declarations) > 0 && hasSyntacticModifier(symbol.declarations[0], 2048 /* Default */);
|
|
15624
15647
|
}
|
|
15625
15648
|
function tryExtractTSExtension(fileName) {
|
|
15626
15649
|
return find(supportedTSExtensionsForExtractExtension, (extension) => fileExtensionIs(fileName, extension));
|
|
@@ -15839,16 +15862,16 @@ function getDeclarationModifierFlagsFromSymbol(s, isWrite = false) {
|
|
|
15839
15862
|
if (s.valueDeclaration) {
|
|
15840
15863
|
const declaration = isWrite && s.declarations && find(s.declarations, isSetAccessorDeclaration) || s.flags & 32768 /* GetAccessor */ && find(s.declarations, isGetAccessorDeclaration) || s.valueDeclaration;
|
|
15841
15864
|
const flags = getCombinedModifierFlags(declaration);
|
|
15842
|
-
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~
|
|
15865
|
+
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~7 /* AccessibilityModifier */;
|
|
15843
15866
|
}
|
|
15844
15867
|
if (getCheckFlags(s) & 6 /* Synthetic */) {
|
|
15845
15868
|
const checkFlags = s.links.checkFlags;
|
|
15846
|
-
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ?
|
|
15847
|
-
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ?
|
|
15869
|
+
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 2 /* Private */ : checkFlags & 256 /* ContainsPublic */ ? 1 /* Public */ : 4 /* Protected */;
|
|
15870
|
+
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 256 /* Static */ : 0;
|
|
15848
15871
|
return accessModifier | staticModifier;
|
|
15849
15872
|
}
|
|
15850
15873
|
if (s.flags & 4194304 /* Prototype */) {
|
|
15851
|
-
return
|
|
15874
|
+
return 1 /* Public */ | 256 /* Static */;
|
|
15852
15875
|
}
|
|
15853
15876
|
return 0;
|
|
15854
15877
|
}
|
|
@@ -17110,7 +17133,7 @@ function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) {
|
|
|
17110
17133
|
if (node.kind !== 167 /* ComputedPropertyName */) {
|
|
17111
17134
|
return false;
|
|
17112
17135
|
}
|
|
17113
|
-
if (hasSyntacticModifier(node.parent,
|
|
17136
|
+
if (hasSyntacticModifier(node.parent, 64 /* Abstract */)) {
|
|
17114
17137
|
return true;
|
|
17115
17138
|
}
|
|
17116
17139
|
const containerKind = node.parent.parent.kind;
|
|
@@ -19084,35 +19107,35 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19084
19107
|
}
|
|
19085
19108
|
function createModifiersFromModifierFlags(flags2) {
|
|
19086
19109
|
const result = [];
|
|
19087
|
-
if (flags2 &
|
|
19110
|
+
if (flags2 & 32 /* Export */)
|
|
19088
19111
|
result.push(createModifier(95 /* ExportKeyword */));
|
|
19089
|
-
if (flags2 &
|
|
19112
|
+
if (flags2 & 128 /* Ambient */)
|
|
19090
19113
|
result.push(createModifier(138 /* DeclareKeyword */));
|
|
19091
|
-
if (flags2 &
|
|
19114
|
+
if (flags2 & 2048 /* Default */)
|
|
19092
19115
|
result.push(createModifier(90 /* DefaultKeyword */));
|
|
19093
|
-
if (flags2 &
|
|
19116
|
+
if (flags2 & 4096 /* Const */)
|
|
19094
19117
|
result.push(createModifier(87 /* ConstKeyword */));
|
|
19095
|
-
if (flags2 &
|
|
19118
|
+
if (flags2 & 1 /* Public */)
|
|
19096
19119
|
result.push(createModifier(125 /* PublicKeyword */));
|
|
19097
|
-
if (flags2 &
|
|
19120
|
+
if (flags2 & 2 /* Private */)
|
|
19098
19121
|
result.push(createModifier(123 /* PrivateKeyword */));
|
|
19099
|
-
if (flags2 &
|
|
19122
|
+
if (flags2 & 4 /* Protected */)
|
|
19100
19123
|
result.push(createModifier(124 /* ProtectedKeyword */));
|
|
19101
|
-
if (flags2 &
|
|
19124
|
+
if (flags2 & 64 /* Abstract */)
|
|
19102
19125
|
result.push(createModifier(128 /* AbstractKeyword */));
|
|
19103
|
-
if (flags2 &
|
|
19126
|
+
if (flags2 & 256 /* Static */)
|
|
19104
19127
|
result.push(createModifier(126 /* StaticKeyword */));
|
|
19105
|
-
if (flags2 &
|
|
19128
|
+
if (flags2 & 16 /* Override */)
|
|
19106
19129
|
result.push(createModifier(164 /* OverrideKeyword */));
|
|
19107
|
-
if (flags2 &
|
|
19130
|
+
if (flags2 & 8 /* Readonly */)
|
|
19108
19131
|
result.push(createModifier(148 /* ReadonlyKeyword */));
|
|
19109
|
-
if (flags2 &
|
|
19132
|
+
if (flags2 & 512 /* Accessor */)
|
|
19110
19133
|
result.push(createModifier(129 /* AccessorKeyword */));
|
|
19111
|
-
if (flags2 &
|
|
19134
|
+
if (flags2 & 1024 /* Async */)
|
|
19112
19135
|
result.push(createModifier(134 /* AsyncKeyword */));
|
|
19113
|
-
if (flags2 &
|
|
19136
|
+
if (flags2 & 8192 /* In */)
|
|
19114
19137
|
result.push(createModifier(103 /* InKeyword */));
|
|
19115
|
-
if (flags2 &
|
|
19138
|
+
if (flags2 & 16384 /* Out */)
|
|
19116
19139
|
result.push(createModifier(147 /* OutKeyword */));
|
|
19117
19140
|
return result.length ? result : void 0;
|
|
19118
19141
|
}
|
|
@@ -19161,7 +19184,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19161
19184
|
if (isThisIdentifier(node.name)) {
|
|
19162
19185
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
19163
19186
|
} else {
|
|
19164
|
-
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) &
|
|
19187
|
+
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 */);
|
|
19165
19188
|
}
|
|
19166
19189
|
node.jsDoc = void 0;
|
|
19167
19190
|
return node;
|
|
@@ -19210,8 +19233,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19210
19233
|
node.exclamationToken = questionOrExclamationToken && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0;
|
|
19211
19234
|
node.type = type;
|
|
19212
19235
|
node.initializer = asInitializer(initializer);
|
|
19213
|
-
const isAmbient = node.flags & 33554432 /* Ambient */ || modifiersToFlags(node.modifiers) &
|
|
19214
|
-
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) &
|
|
19236
|
+
const isAmbient = node.flags & 33554432 /* Ambient */ || modifiersToFlags(node.modifiers) & 128 /* Ambient */;
|
|
19237
|
+
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 */;
|
|
19215
19238
|
node.jsDoc = void 0;
|
|
19216
19239
|
return node;
|
|
19217
19240
|
}
|
|
@@ -19250,7 +19273,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19250
19273
|
if (!node.body) {
|
|
19251
19274
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
19252
19275
|
} else {
|
|
19253
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
19276
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
19254
19277
|
const isGenerator = !!node.asteriskToken;
|
|
19255
19278
|
const isAsyncGenerator = isAsync && isGenerator;
|
|
19256
19279
|
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 */;
|
|
@@ -19993,7 +20016,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19993
20016
|
node.parameters = createNodeArray(parameters);
|
|
19994
20017
|
node.type = type;
|
|
19995
20018
|
node.body = body;
|
|
19996
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
20019
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
19997
20020
|
const isGenerator = !!node.asteriskToken;
|
|
19998
20021
|
const isAsyncGenerator = isAsync && isGenerator;
|
|
19999
20022
|
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 */;
|
|
@@ -20017,7 +20040,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20017
20040
|
node.type = type;
|
|
20018
20041
|
node.equalsGreaterThanToken = equalsGreaterThanToken ?? createToken(39 /* EqualsGreaterThanToken */);
|
|
20019
20042
|
node.body = parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body);
|
|
20020
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
20043
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
20021
20044
|
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 */;
|
|
20022
20045
|
node.typeArguments = void 0;
|
|
20023
20046
|
node.jsDoc = void 0;
|
|
@@ -20369,7 +20392,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20369
20392
|
node.modifiers = asNodeArray(modifiers);
|
|
20370
20393
|
node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
|
|
20371
20394
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList);
|
|
20372
|
-
if (modifiersToFlags(node.modifiers) &
|
|
20395
|
+
if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
20373
20396
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
20374
20397
|
}
|
|
20375
20398
|
node.jsDoc = void 0;
|
|
@@ -20619,10 +20642,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20619
20642
|
node.parameters = createNodeArray(parameters);
|
|
20620
20643
|
node.type = type;
|
|
20621
20644
|
node.body = body;
|
|
20622
|
-
if (!node.body || modifiersToFlags(node.modifiers) &
|
|
20645
|
+
if (!node.body || modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
20623
20646
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
20624
20647
|
} else {
|
|
20625
|
-
const isAsync = modifiersToFlags(node.modifiers) &
|
|
20648
|
+
const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */;
|
|
20626
20649
|
const isGenerator = !!node.asteriskToken;
|
|
20627
20650
|
const isAsyncGenerator = isAsync && isGenerator;
|
|
20628
20651
|
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 */;
|
|
@@ -20653,7 +20676,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20653
20676
|
node.typeParameters = asNodeArray(typeParameters);
|
|
20654
20677
|
node.heritageClauses = asNodeArray(heritageClauses);
|
|
20655
20678
|
node.members = createNodeArray(members);
|
|
20656
|
-
if (modifiersToFlags(node.modifiers) &
|
|
20679
|
+
if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
20657
20680
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
20658
20681
|
} else {
|
|
20659
20682
|
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 */;
|
|
@@ -20715,7 +20738,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20715
20738
|
node.flags |= flags2 & (32 /* Namespace */ | 8 /* NestedNamespace */ | 2048 /* GlobalAugmentation */);
|
|
20716
20739
|
node.name = name;
|
|
20717
20740
|
node.body = body;
|
|
20718
|
-
if (modifiersToFlags(node.modifiers) &
|
|
20741
|
+
if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) {
|
|
20719
20742
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
20720
20743
|
} else {
|
|
20721
20744
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1 /* ContainsTypeScript */;
|
|
@@ -22146,7 +22169,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22146
22169
|
return qualifiedName;
|
|
22147
22170
|
}
|
|
22148
22171
|
function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) {
|
|
22149
|
-
if (ns && hasSyntacticModifier(node,
|
|
22172
|
+
if (ns && hasSyntacticModifier(node, 32 /* Export */)) {
|
|
22150
22173
|
return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps);
|
|
22151
22174
|
}
|
|
22152
22175
|
return getExportName(node, allowComments, allowSourceMaps);
|
|
@@ -31347,11 +31370,11 @@ var Parser;
|
|
|
31347
31370
|
const modifierFlags = modifiersToFlags(modifiers);
|
|
31348
31371
|
parseExpected(100 /* FunctionKeyword */);
|
|
31349
31372
|
const asteriskToken = parseOptionalToken(42 /* AsteriskToken */);
|
|
31350
|
-
const name = modifierFlags &
|
|
31373
|
+
const name = modifierFlags & 2048 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier();
|
|
31351
31374
|
const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */;
|
|
31352
|
-
const isAsync = modifierFlags &
|
|
31375
|
+
const isAsync = modifierFlags & 1024 /* Async */ ? 2 /* Await */ : 0 /* None */;
|
|
31353
31376
|
const typeParameters = parseTypeParameters();
|
|
31354
|
-
if (modifierFlags &
|
|
31377
|
+
if (modifierFlags & 32 /* Export */)
|
|
31355
31378
|
setAwaitContext(
|
|
31356
31379
|
/*value*/
|
|
31357
31380
|
true
|
|
@@ -39376,7 +39399,7 @@ function getModuleInstanceStateWorker(node, visited) {
|
|
|
39376
39399
|
break;
|
|
39377
39400
|
case 272 /* ImportDeclaration */:
|
|
39378
39401
|
case 271 /* ImportEqualsDeclaration */:
|
|
39379
|
-
if (!hasSyntacticModifier(node,
|
|
39402
|
+
if (!hasSyntacticModifier(node, 32 /* Export */)) {
|
|
39380
39403
|
return 0 /* NonInstantiated */;
|
|
39381
39404
|
}
|
|
39382
39405
|
break;
|
|
@@ -39654,7 +39677,7 @@ function createBinder() {
|
|
|
39654
39677
|
}
|
|
39655
39678
|
function declareSymbol(symbolTable, parent2, node, includes, excludes, isReplaceableByMethod, isComputedName) {
|
|
39656
39679
|
Debug.assert(isComputedName || !hasDynamicName(node));
|
|
39657
|
-
const isDefaultExport = hasSyntacticModifier(node,
|
|
39680
|
+
const isDefaultExport = hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) && node.name.escapedText === "default";
|
|
39658
39681
|
const name = isComputedName ? "__computed" /* Computed */ : isDefaultExport && parent2 ? "default" /* Default */ : getDeclarationName(node);
|
|
39659
39682
|
let symbol;
|
|
39660
39683
|
if (name === void 0) {
|
|
@@ -39698,7 +39721,7 @@ function createBinder() {
|
|
|
39698
39721
|
}
|
|
39699
39722
|
}
|
|
39700
39723
|
const relatedInformation = [];
|
|
39701
|
-
if (isTypeAliasDeclaration(node) && nodeIsMissing(node.type) && hasSyntacticModifier(node,
|
|
39724
|
+
if (isTypeAliasDeclaration(node) && nodeIsMissing(node.type) && hasSyntacticModifier(node, 32 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
|
|
39702
39725
|
relatedInformation.push(createDiagnosticForNode2(node, Diagnostics.Did_you_mean_0, `export type { ${unescapeLeadingUnderscores(node.name.escapedText)} }`));
|
|
39703
39726
|
}
|
|
39704
39727
|
const declarationName = getNameOfDeclaration(node) || node;
|
|
@@ -39727,7 +39750,7 @@ function createBinder() {
|
|
|
39727
39750
|
return symbol;
|
|
39728
39751
|
}
|
|
39729
39752
|
function declareModuleMember(node, symbolFlags, symbolExcludes) {
|
|
39730
|
-
const hasExportModifier = !!(getCombinedModifierFlags(node) &
|
|
39753
|
+
const hasExportModifier = !!(getCombinedModifierFlags(node) & 32 /* Export */) || jsdocTreatAsExported(node);
|
|
39731
39754
|
if (symbolFlags & 2097152 /* Alias */) {
|
|
39732
39755
|
if (node.kind === 281 /* ExportSpecifier */ || node.kind === 271 /* ImportEqualsDeclaration */ && hasExportModifier) {
|
|
39733
39756
|
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
|
|
@@ -39746,7 +39769,7 @@ function createBinder() {
|
|
|
39746
39769
|
if (isJSDocTypeAlias(node))
|
|
39747
39770
|
Debug.assert(isInJSFile(node));
|
|
39748
39771
|
if (!isAmbientModule(node) && (hasExportModifier || container.flags & 128 /* ExportContext */)) {
|
|
39749
|
-
if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier(node,
|
|
39772
|
+
if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier(node, 2048 /* Default */) && !getDeclarationName(node)) {
|
|
39750
39773
|
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
|
|
39751
39774
|
}
|
|
39752
39775
|
const exportKind = symbolFlags & 111551 /* Value */ ? 1048576 /* ExportValue */ : 0;
|
|
@@ -39787,7 +39810,7 @@ function createBinder() {
|
|
|
39787
39810
|
return false;
|
|
39788
39811
|
if (isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent))
|
|
39789
39812
|
return true;
|
|
39790
|
-
if (isDeclaration(declName.parent) && getCombinedModifierFlags(declName.parent) &
|
|
39813
|
+
if (isDeclaration(declName.parent) && getCombinedModifierFlags(declName.parent) & 32 /* Export */)
|
|
39791
39814
|
return true;
|
|
39792
39815
|
return false;
|
|
39793
39816
|
}
|
|
@@ -39818,7 +39841,7 @@ function createBinder() {
|
|
|
39818
39841
|
const saveExceptionTarget = currentExceptionTarget;
|
|
39819
39842
|
const saveActiveLabelList = activeLabelList;
|
|
39820
39843
|
const saveHasExplicitReturn = hasExplicitReturn;
|
|
39821
|
-
const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node,
|
|
39844
|
+
const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175 /* ClassStaticBlockDeclaration */;
|
|
39822
39845
|
if (!isImmediatelyInvoked) {
|
|
39823
39846
|
currentFlow = initFlowNode({ flags: 2 /* Start */ });
|
|
39824
39847
|
if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */)) {
|
|
@@ -40865,7 +40888,7 @@ function createBinder() {
|
|
|
40865
40888
|
function bindModuleDeclaration(node) {
|
|
40866
40889
|
setExportContextFlag(node);
|
|
40867
40890
|
if (isAmbientModule(node)) {
|
|
40868
|
-
if (hasSyntacticModifier(node,
|
|
40891
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
40869
40892
|
errorOnFirstToken(node, Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible);
|
|
40870
40893
|
}
|
|
40871
40894
|
if (isModuleAugmentationExternal(node)) {
|
|
@@ -41926,7 +41949,7 @@ function createBinder() {
|
|
|
41926
41949
|
}
|
|
41927
41950
|
if (!isBindingPattern(node.name)) {
|
|
41928
41951
|
const possibleVariableDecl = node.kind === 260 /* VariableDeclaration */ ? node : node.parent.parent;
|
|
41929
|
-
if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) &
|
|
41952
|
+
if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 32 /* Export */)) {
|
|
41930
41953
|
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
|
|
41931
41954
|
} else if (isBlockOrCatchScoped(node)) {
|
|
41932
41955
|
bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */);
|
|
@@ -42078,7 +42101,7 @@ function isPurelyTypeDeclaration(s) {
|
|
|
42078
42101
|
case 267 /* ModuleDeclaration */:
|
|
42079
42102
|
return getModuleInstanceState(s) !== 1 /* Instantiated */;
|
|
42080
42103
|
case 266 /* EnumDeclaration */:
|
|
42081
|
-
return hasSyntacticModifier(s,
|
|
42104
|
+
return hasSyntacticModifier(s, 4096 /* Const */);
|
|
42082
42105
|
default:
|
|
42083
42106
|
return false;
|
|
42084
42107
|
}
|
|
@@ -42747,10 +42770,10 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, hos
|
|
|
42747
42770
|
return ending !== 0 /* Minimal */ || value === processEnding(relativeToBaseUrl, [ending], compilerOptions, host);
|
|
42748
42771
|
}
|
|
42749
42772
|
}
|
|
42750
|
-
function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName,
|
|
42751
|
-
if (typeof
|
|
42773
|
+
function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, exports2, conditions, mode = 0 /* Exact */) {
|
|
42774
|
+
if (typeof exports2 === "string") {
|
|
42752
42775
|
const pathOrPattern = getNormalizedAbsolutePath(
|
|
42753
|
-
combinePaths(packageDirectory,
|
|
42776
|
+
combinePaths(packageDirectory, exports2),
|
|
42754
42777
|
/*currentDirectory*/
|
|
42755
42778
|
void 0
|
|
42756
42779
|
);
|
|
@@ -42770,7 +42793,7 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
42770
42793
|
false
|
|
42771
42794
|
);
|
|
42772
42795
|
return { moduleFileToTry: getNormalizedAbsolutePath(
|
|
42773
|
-
combinePaths(combinePaths(packageName,
|
|
42796
|
+
combinePaths(combinePaths(packageName, exports2), fragment),
|
|
42774
42797
|
/*currentDirectory*/
|
|
42775
42798
|
void 0
|
|
42776
42799
|
) };
|
|
@@ -42790,23 +42813,23 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
42790
42813
|
}
|
|
42791
42814
|
break;
|
|
42792
42815
|
}
|
|
42793
|
-
} else if (Array.isArray(
|
|
42794
|
-
return forEach(
|
|
42795
|
-
} else if (typeof
|
|
42796
|
-
if (allKeysStartWithDot(
|
|
42797
|
-
return forEach(getOwnKeys(
|
|
42816
|
+
} else if (Array.isArray(exports2)) {
|
|
42817
|
+
return forEach(exports2, (e) => tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, e, conditions));
|
|
42818
|
+
} else if (typeof exports2 === "object" && exports2 !== null) {
|
|
42819
|
+
if (allKeysStartWithDot(exports2)) {
|
|
42820
|
+
return forEach(getOwnKeys(exports2), (k) => {
|
|
42798
42821
|
const subPackageName = getNormalizedAbsolutePath(
|
|
42799
42822
|
combinePaths(packageName, k),
|
|
42800
42823
|
/*currentDirectory*/
|
|
42801
42824
|
void 0
|
|
42802
42825
|
);
|
|
42803
42826
|
const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
|
|
42804
|
-
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName,
|
|
42827
|
+
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports2[k], conditions, mode2);
|
|
42805
42828
|
});
|
|
42806
42829
|
} else {
|
|
42807
|
-
for (const key of getOwnKeys(
|
|
42830
|
+
for (const key of getOwnKeys(exports2)) {
|
|
42808
42831
|
if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
|
|
42809
|
-
const subTarget =
|
|
42832
|
+
const subTarget = exports2[key];
|
|
42810
42833
|
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
|
|
42811
42834
|
if (result) {
|
|
42812
42835
|
return result;
|
|
@@ -45184,7 +45207,7 @@ function createTypeChecker(host) {
|
|
|
45184
45207
|
if (lastLocation && lastLocation === location.name) {
|
|
45185
45208
|
return false;
|
|
45186
45209
|
}
|
|
45187
|
-
if (location.asteriskToken || hasSyntacticModifier(location,
|
|
45210
|
+
if (location.asteriskToken || hasSyntacticModifier(location, 1024 /* Async */)) {
|
|
45188
45211
|
return true;
|
|
45189
45212
|
}
|
|
45190
45213
|
return !getImmediatelyInvokedFunctionExpression(location);
|
|
@@ -45569,7 +45592,7 @@ function createTypeChecker(host) {
|
|
|
45569
45592
|
return resolved;
|
|
45570
45593
|
}
|
|
45571
45594
|
function isSyntacticDefault(node) {
|
|
45572
|
-
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node,
|
|
45595
|
+
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) || isNamespaceExport(node);
|
|
45573
45596
|
}
|
|
45574
45597
|
function getUsageModeForExpression(usage) {
|
|
45575
45598
|
return isStringLiteralLike(usage) ? getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
|
|
@@ -45888,13 +45911,13 @@ function createTypeChecker(host) {
|
|
|
45888
45911
|
function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
|
|
45889
45912
|
var _a, _b;
|
|
45890
45913
|
const localSymbol = (_b = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(name.escapedText);
|
|
45891
|
-
const
|
|
45914
|
+
const exports2 = moduleSymbol.exports;
|
|
45892
45915
|
if (localSymbol) {
|
|
45893
|
-
const exportedEqualsSymbol =
|
|
45916
|
+
const exportedEqualsSymbol = exports2 == null ? void 0 : exports2.get("export=" /* ExportEquals */);
|
|
45894
45917
|
if (exportedEqualsSymbol) {
|
|
45895
45918
|
getSymbolIfSameReference(exportedEqualsSymbol, localSymbol) ? reportInvalidImportEqualsExportMember(node, name, declarationName, moduleName) : error(name, Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName);
|
|
45896
45919
|
} else {
|
|
45897
|
-
const exportedSymbol =
|
|
45920
|
+
const exportedSymbol = exports2 ? find(symbolsToArray(exports2), (symbol) => !!getSymbolIfSameReference(symbol, localSymbol)) : void 0;
|
|
45898
45921
|
const diagnostic = exportedSymbol ? error(name, Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2, moduleName, declarationName, symbolToString(exportedSymbol)) : error(name, Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName);
|
|
45899
45922
|
if (localSymbol.declarations) {
|
|
45900
45923
|
addRelatedInfo(diagnostic, ...map(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here : Diagnostics.and_here, declarationName)));
|
|
@@ -46758,19 +46781,19 @@ function createTypeChecker(host) {
|
|
|
46758
46781
|
return symbolsToArray(getExportsOfModule(moduleSymbol));
|
|
46759
46782
|
}
|
|
46760
46783
|
function getExportsAndPropertiesOfModule(moduleSymbol) {
|
|
46761
|
-
const
|
|
46784
|
+
const exports2 = getExportsOfModuleAsArray(moduleSymbol);
|
|
46762
46785
|
const exportEquals = resolveExternalModuleSymbol(moduleSymbol);
|
|
46763
46786
|
if (exportEquals !== moduleSymbol) {
|
|
46764
46787
|
const type = getTypeOfSymbol(exportEquals);
|
|
46765
46788
|
if (shouldTreatPropertiesOfExternalModuleAsExports(type)) {
|
|
46766
|
-
addRange(
|
|
46789
|
+
addRange(exports2, getPropertiesOfType(type));
|
|
46767
46790
|
}
|
|
46768
46791
|
}
|
|
46769
|
-
return
|
|
46792
|
+
return exports2;
|
|
46770
46793
|
}
|
|
46771
46794
|
function forEachExportAndPropertyOfModule(moduleSymbol, cb) {
|
|
46772
|
-
const
|
|
46773
|
-
|
|
46795
|
+
const exports2 = getExportsOfModule(moduleSymbol);
|
|
46796
|
+
exports2.forEach((symbol, key) => {
|
|
46774
46797
|
if (!isReservedMemberName(key)) {
|
|
46775
46798
|
cb(symbol, key);
|
|
46776
46799
|
}
|
|
@@ -46813,8 +46836,8 @@ function createTypeChecker(host) {
|
|
|
46813
46836
|
function getExportsOfModule(moduleSymbol) {
|
|
46814
46837
|
const links = getSymbolLinks(moduleSymbol);
|
|
46815
46838
|
if (!links.resolvedExports) {
|
|
46816
|
-
const { exports, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol);
|
|
46817
|
-
links.resolvedExports =
|
|
46839
|
+
const { exports: exports2, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol);
|
|
46840
|
+
links.resolvedExports = exports2;
|
|
46818
46841
|
links.typeOnlyExportStarMap = typeOnlyExportStarMap;
|
|
46819
46842
|
}
|
|
46820
46843
|
return links.resolvedExports;
|
|
@@ -46848,12 +46871,12 @@ function createTypeChecker(host) {
|
|
|
46848
46871
|
let typeOnlyExportStarMap;
|
|
46849
46872
|
const nonTypeOnlyNames = /* @__PURE__ */ new Set();
|
|
46850
46873
|
moduleSymbol = resolveExternalModuleSymbol(moduleSymbol);
|
|
46851
|
-
const
|
|
46874
|
+
const exports2 = visit(moduleSymbol) || emptySymbols;
|
|
46852
46875
|
if (typeOnlyExportStarMap) {
|
|
46853
46876
|
nonTypeOnlyNames.forEach((name) => typeOnlyExportStarMap.delete(name));
|
|
46854
46877
|
}
|
|
46855
46878
|
return {
|
|
46856
|
-
exports,
|
|
46879
|
+
exports: exports2,
|
|
46857
46880
|
typeOnlyExportStarMap
|
|
46858
46881
|
};
|
|
46859
46882
|
function visit(symbol, exportStar, isTypeOnly) {
|
|
@@ -47038,12 +47061,12 @@ function createTypeChecker(host) {
|
|
|
47038
47061
|
if (exportEquals && getSymbolIfSameReference(exportEquals, symbol)) {
|
|
47039
47062
|
return container;
|
|
47040
47063
|
}
|
|
47041
|
-
const
|
|
47042
|
-
const quick =
|
|
47064
|
+
const exports2 = getExportsOfSymbol(container);
|
|
47065
|
+
const quick = exports2.get(symbol.escapedName);
|
|
47043
47066
|
if (quick && getSymbolIfSameReference(quick, symbol)) {
|
|
47044
47067
|
return quick;
|
|
47045
47068
|
}
|
|
47046
|
-
return forEachEntry(
|
|
47069
|
+
return forEachEntry(exports2, (exported) => {
|
|
47047
47070
|
if (getSymbolIfSameReference(exported, symbol)) {
|
|
47048
47071
|
return exported;
|
|
47049
47072
|
}
|
|
@@ -47495,20 +47518,20 @@ function createTypeChecker(host) {
|
|
|
47495
47518
|
var _a, _b;
|
|
47496
47519
|
if (!isDeclarationVisible(declaration)) {
|
|
47497
47520
|
const anyImportSyntax = getAnyImportSyntax(declaration);
|
|
47498
|
-
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax,
|
|
47521
|
+
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax, 32 /* Export */) && // import clause without export
|
|
47499
47522
|
isDeclarationVisible(anyImportSyntax.parent)) {
|
|
47500
47523
|
return addVisibleAlias(declaration, anyImportSyntax);
|
|
47501
|
-
} else if (isVariableDeclaration(declaration) && isVariableStatement(declaration.parent.parent) && !hasSyntacticModifier(declaration.parent.parent,
|
|
47524
|
+
} else if (isVariableDeclaration(declaration) && isVariableStatement(declaration.parent.parent) && !hasSyntacticModifier(declaration.parent.parent, 32 /* Export */) && // unexported variable statement
|
|
47502
47525
|
isDeclarationVisible(declaration.parent.parent.parent)) {
|
|
47503
47526
|
return addVisibleAlias(declaration, declaration.parent.parent);
|
|
47504
|
-
} else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier(declaration,
|
|
47527
|
+
} else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier(declaration, 32 /* Export */) && isDeclarationVisible(declaration.parent)) {
|
|
47505
47528
|
return addVisibleAlias(declaration, declaration);
|
|
47506
47529
|
} else if (isBindingElement(declaration)) {
|
|
47507
|
-
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,
|
|
47530
|
+
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)) {
|
|
47508
47531
|
return addVisibleAlias(declaration, declaration.parent.parent.parent.parent);
|
|
47509
47532
|
} else if (symbol.flags & 2 /* BlockScopedVariable */) {
|
|
47510
47533
|
const variableStatement = findAncestor(declaration, isVariableStatement);
|
|
47511
|
-
if (hasSyntacticModifier(variableStatement,
|
|
47534
|
+
if (hasSyntacticModifier(variableStatement, 32 /* Export */)) {
|
|
47512
47535
|
return true;
|
|
47513
47536
|
}
|
|
47514
47537
|
if (!isDeclarationVisible(variableStatement.parent)) {
|
|
@@ -47731,7 +47754,8 @@ function createTypeChecker(host) {
|
|
|
47731
47754
|
visitedTypes: void 0,
|
|
47732
47755
|
symbolDepth: void 0,
|
|
47733
47756
|
inferTypeParameters: void 0,
|
|
47734
|
-
approximateLength: 0
|
|
47757
|
+
approximateLength: 0,
|
|
47758
|
+
trackedSymbols: void 0
|
|
47735
47759
|
};
|
|
47736
47760
|
context.tracker = new SymbolTrackerImpl(context, tracker, moduleResolverHost);
|
|
47737
47761
|
const resultingNode = cb(context);
|
|
@@ -48185,7 +48209,7 @@ function createTypeChecker(host) {
|
|
|
48185
48209
|
}
|
|
48186
48210
|
}
|
|
48187
48211
|
function visitAndTransformType(type2, transform) {
|
|
48188
|
-
var _a2, _b2;
|
|
48212
|
+
var _a2, _b2, _c;
|
|
48189
48213
|
const typeId = type2.id;
|
|
48190
48214
|
const isConstructorObject = getObjectFlags(type2) & 16 /* Anonymous */ && type2.symbol && type2.symbol.flags & 32 /* Class */;
|
|
48191
48215
|
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;
|
|
@@ -48202,6 +48226,13 @@ function createTypeChecker(host) {
|
|
|
48202
48226
|
}
|
|
48203
48227
|
const cachedResult = (_a2 = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _a2.get(key);
|
|
48204
48228
|
if (cachedResult) {
|
|
48229
|
+
(_b2 = cachedResult.trackedSymbols) == null ? void 0 : _b2.forEach(
|
|
48230
|
+
([symbol, enclosingDeclaration, meaning]) => context.tracker.trackSymbol(
|
|
48231
|
+
symbol,
|
|
48232
|
+
enclosingDeclaration,
|
|
48233
|
+
meaning
|
|
48234
|
+
)
|
|
48235
|
+
);
|
|
48205
48236
|
if (cachedResult.truncating) {
|
|
48206
48237
|
context.truncating = true;
|
|
48207
48238
|
}
|
|
@@ -48221,7 +48252,12 @@ function createTypeChecker(host) {
|
|
|
48221
48252
|
const result = transform(type2);
|
|
48222
48253
|
const addedLength = context.approximateLength - startLength;
|
|
48223
48254
|
if (!context.reportedDiagnostic && !context.encounteredError) {
|
|
48224
|
-
(
|
|
48255
|
+
(_c = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _c.set(key, {
|
|
48256
|
+
node: result,
|
|
48257
|
+
truncating: context.truncating,
|
|
48258
|
+
addedLength,
|
|
48259
|
+
trackedSymbols: context.trackedSymbols
|
|
48260
|
+
});
|
|
48225
48261
|
}
|
|
48226
48262
|
context.visitedTypes.delete(typeId);
|
|
48227
48263
|
if (id) {
|
|
@@ -48463,7 +48499,7 @@ function createTypeChecker(host) {
|
|
|
48463
48499
|
if (propertySymbol.flags & 4194304 /* Prototype */) {
|
|
48464
48500
|
continue;
|
|
48465
48501
|
}
|
|
48466
|
-
if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (
|
|
48502
|
+
if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (2 /* Private */ | 4 /* Protected */) && context.tracker.reportPrivateInBaseOfClassExpression) {
|
|
48467
48503
|
context.tracker.reportPrivateInBaseOfClassExpression(unescapeLeadingUnderscores(propertySymbol.escapedName));
|
|
48468
48504
|
}
|
|
48469
48505
|
}
|
|
@@ -48766,7 +48802,7 @@ function createTypeChecker(host) {
|
|
|
48766
48802
|
let modifiers = options == null ? void 0 : options.modifiers;
|
|
48767
48803
|
if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
|
|
48768
48804
|
const flags = modifiersToFlags(modifiers);
|
|
48769
|
-
modifiers = factory.createModifiersFromModifierFlags(flags |
|
|
48805
|
+
modifiers = factory.createModifiersFromModifierFlags(flags | 64 /* Abstract */);
|
|
48770
48806
|
}
|
|
48771
48807
|
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(
|
|
48772
48808
|
modifiers,
|
|
@@ -49242,8 +49278,8 @@ function createTypeChecker(host) {
|
|
|
49242
49278
|
context.flags ^= 16777216 /* InInitialEntityName */;
|
|
49243
49279
|
} else {
|
|
49244
49280
|
if (parent && getExportsOfSymbol(parent)) {
|
|
49245
|
-
const
|
|
49246
|
-
forEachEntry(
|
|
49281
|
+
const exports2 = getExportsOfSymbol(parent);
|
|
49282
|
+
forEachEntry(exports2, (ex, name) => {
|
|
49247
49283
|
if (getSymbolIfSameReference(ex, symbol2) && !isLateBoundName(name) && name !== "export=" /* ExportEquals */) {
|
|
49248
49284
|
symbolName2 = unescapeLeadingUnderscores(name);
|
|
49249
49285
|
return true;
|
|
@@ -49823,7 +49859,7 @@ function createTypeChecker(host) {
|
|
|
49823
49859
|
const nsIndex = findIndex(statements, isModuleDeclaration);
|
|
49824
49860
|
let ns = nsIndex !== -1 ? statements[nsIndex] : void 0;
|
|
49825
49861
|
if (ns && exportAssignment && exportAssignment.isExportEquals && isIdentifier(exportAssignment.expression) && isIdentifier(ns.name) && idText(ns.name) === idText(exportAssignment.expression) && ns.body && isModuleBlock(ns.body)) {
|
|
49826
|
-
const excessExports = filter(statements, (s) => !!(getEffectiveModifierFlags(s) &
|
|
49862
|
+
const excessExports = filter(statements, (s) => !!(getEffectiveModifierFlags(s) & 32 /* Export */));
|
|
49827
49863
|
const name = ns.name;
|
|
49828
49864
|
let body = ns.body;
|
|
49829
49865
|
if (length(excessExports)) {
|
|
@@ -49857,9 +49893,9 @@ function createTypeChecker(host) {
|
|
|
49857
49893
|
}
|
|
49858
49894
|
if (!find(statements, (s) => s !== ns && nodeHasName(s, name))) {
|
|
49859
49895
|
results = [];
|
|
49860
|
-
const mixinExportFlag = !some(body.statements, (s) => hasSyntacticModifier(s,
|
|
49896
|
+
const mixinExportFlag = !some(body.statements, (s) => hasSyntacticModifier(s, 32 /* Export */) || isExportAssignment(s) || isExportDeclaration(s));
|
|
49861
49897
|
forEach(body.statements, (s) => {
|
|
49862
|
-
addResult(s, mixinExportFlag ?
|
|
49898
|
+
addResult(s, mixinExportFlag ? 32 /* Export */ : 0 /* None */);
|
|
49863
49899
|
});
|
|
49864
49900
|
statements = [...filter(statements, (s) => s !== ns && s !== exportAssignment), ...results];
|
|
49865
49901
|
}
|
|
@@ -49867,8 +49903,8 @@ function createTypeChecker(host) {
|
|
|
49867
49903
|
return statements;
|
|
49868
49904
|
}
|
|
49869
49905
|
function mergeExportDeclarations(statements) {
|
|
49870
|
-
const
|
|
49871
|
-
if (length(
|
|
49906
|
+
const exports2 = filter(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !!d.exportClause && isNamedExports(d.exportClause));
|
|
49907
|
+
if (length(exports2) > 1) {
|
|
49872
49908
|
const nonExports = filter(statements, (d) => !isExportDeclaration(d) || !!d.moduleSpecifier || !d.exportClause);
|
|
49873
49909
|
statements = [
|
|
49874
49910
|
...nonExports,
|
|
@@ -49877,7 +49913,7 @@ function createTypeChecker(host) {
|
|
|
49877
49913
|
void 0,
|
|
49878
49914
|
/*isTypeOnly*/
|
|
49879
49915
|
false,
|
|
49880
|
-
factory.createNamedExports(flatMap(
|
|
49916
|
+
factory.createNamedExports(flatMap(exports2, (e) => cast(e.exportClause, isNamedExports).elements)),
|
|
49881
49917
|
/*moduleSpecifier*/
|
|
49882
49918
|
void 0
|
|
49883
49919
|
)
|
|
@@ -49951,11 +49987,11 @@ function createTypeChecker(host) {
|
|
|
49951
49987
|
return statements;
|
|
49952
49988
|
}
|
|
49953
49989
|
function addExportModifier(node) {
|
|
49954
|
-
const flags = (getEffectiveModifierFlags(node) |
|
|
49990
|
+
const flags = (getEffectiveModifierFlags(node) | 32 /* Export */) & ~128 /* Ambient */;
|
|
49955
49991
|
return factory.replaceModifiers(node, flags);
|
|
49956
49992
|
}
|
|
49957
49993
|
function removeExportModifier(node) {
|
|
49958
|
-
const flags = getEffectiveModifierFlags(node) & ~
|
|
49994
|
+
const flags = getEffectiveModifierFlags(node) & ~32 /* Export */;
|
|
49959
49995
|
return factory.replaceModifiers(node, flags);
|
|
49960
49996
|
}
|
|
49961
49997
|
function visitSymbolTable(symbolTable2, suppressNewPrivateContext, propertyAsAlias) {
|
|
@@ -49996,6 +50032,12 @@ function createTypeChecker(host) {
|
|
|
49996
50032
|
if (context.reportedDiagnostic) {
|
|
49997
50033
|
oldcontext.reportedDiagnostic = context.reportedDiagnostic;
|
|
49998
50034
|
}
|
|
50035
|
+
if (context.trackedSymbols) {
|
|
50036
|
+
if (!oldContext.trackedSymbols)
|
|
50037
|
+
oldContext.trackedSymbols = context.trackedSymbols;
|
|
50038
|
+
else
|
|
50039
|
+
Debug.assert(context.trackedSymbols === oldContext.trackedSymbols);
|
|
50040
|
+
}
|
|
49999
50041
|
context = oldContext;
|
|
50000
50042
|
}
|
|
50001
50043
|
}
|
|
@@ -50012,7 +50054,7 @@ function createTypeChecker(host) {
|
|
|
50012
50054
|
if (needsPostExportDefault || needsExportDeclaration) {
|
|
50013
50055
|
isPrivate = true;
|
|
50014
50056
|
}
|
|
50015
|
-
const modifierFlags = (!isPrivate ?
|
|
50057
|
+
const modifierFlags = (!isPrivate ? 32 /* Export */ : 0) | (isDefault && !needsPostExportDefault ? 2048 /* Default */ : 0);
|
|
50016
50058
|
const isConstMergedWithNS = symbol.flags & 1536 /* Module */ && symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && escapedSymbolName !== "export=" /* ExportEquals */;
|
|
50017
50059
|
const isConstMergedWithNSPrintableAsSignatureMerge = isConstMergedWithNS && isTypeRepresentableAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol);
|
|
50018
50060
|
if (symbol.flags & (16 /* Function */ | 8192 /* Method */) || isConstMergedWithNSPrintableAsSignatureMerge) {
|
|
@@ -50082,7 +50124,7 @@ function createTypeChecker(host) {
|
|
|
50082
50124
|
),
|
|
50083
50125
|
textRange
|
|
50084
50126
|
);
|
|
50085
|
-
addResult(statement, name !== localName ? modifierFlags & ~
|
|
50127
|
+
addResult(statement, name !== localName ? modifierFlags & ~32 /* Export */ : modifierFlags);
|
|
50086
50128
|
if (name !== localName && !isPrivate) {
|
|
50087
50129
|
addResult(
|
|
50088
50130
|
factory.createExportDeclaration(
|
|
@@ -50187,14 +50229,14 @@ function createTypeChecker(host) {
|
|
|
50187
50229
|
if (canHaveModifiers(node)) {
|
|
50188
50230
|
let newModifierFlags = 0 /* None */;
|
|
50189
50231
|
const enclosingDeclaration2 = context.enclosingDeclaration && (isJSDocTypeAlias(context.enclosingDeclaration) ? getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration);
|
|
50190
|
-
if (additionalModifierFlags &
|
|
50191
|
-
newModifierFlags |=
|
|
50232
|
+
if (additionalModifierFlags & 32 /* Export */ && enclosingDeclaration2 && (isExportingScope(enclosingDeclaration2) || isModuleDeclaration(enclosingDeclaration2)) && canHaveExportModifier(node)) {
|
|
50233
|
+
newModifierFlags |= 32 /* Export */;
|
|
50192
50234
|
}
|
|
50193
|
-
if (addingDeclare && !(newModifierFlags &
|
|
50194
|
-
newModifierFlags |=
|
|
50235
|
+
if (addingDeclare && !(newModifierFlags & 32 /* Export */) && (!enclosingDeclaration2 || !(enclosingDeclaration2.flags & 33554432 /* Ambient */)) && (isEnumDeclaration(node) || isVariableStatement(node) || isFunctionDeclaration(node) || isClassDeclaration(node) || isModuleDeclaration(node))) {
|
|
50236
|
+
newModifierFlags |= 128 /* Ambient */;
|
|
50195
50237
|
}
|
|
50196
|
-
if (additionalModifierFlags &
|
|
50197
|
-
newModifierFlags |=
|
|
50238
|
+
if (additionalModifierFlags & 2048 /* Default */ && (isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionDeclaration(node))) {
|
|
50239
|
+
newModifierFlags |= 2048 /* Default */;
|
|
50198
50240
|
}
|
|
50199
50241
|
if (newModifierFlags) {
|
|
50200
50242
|
node = factory.replaceModifiers(node, newModifierFlags | getEffectiveModifierFlags(node));
|
|
@@ -50254,8 +50296,8 @@ function createTypeChecker(host) {
|
|
|
50254
50296
|
);
|
|
50255
50297
|
}
|
|
50256
50298
|
function getNamespaceMembersForSerialization(symbol) {
|
|
50257
|
-
const
|
|
50258
|
-
return !
|
|
50299
|
+
const exports2 = getExportsOfSymbol(symbol);
|
|
50300
|
+
return !exports2 ? [] : filter(arrayFrom(exports2.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
50259
50301
|
}
|
|
50260
50302
|
function isTypeOnlyNamespace(symbol) {
|
|
50261
50303
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -50316,7 +50358,7 @@ function createTypeChecker(host) {
|
|
|
50316
50358
|
function serializeEnum(symbol, symbolName2, modifierFlags) {
|
|
50317
50359
|
addResult(
|
|
50318
50360
|
factory.createEnumDeclaration(
|
|
50319
|
-
factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ?
|
|
50361
|
+
factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 4096 /* Const */ : 0),
|
|
50320
50362
|
getInternalSymbolName(symbol, symbolName2),
|
|
50321
50363
|
map(filter(getPropertiesOfType(getTypeOfSymbol(symbol)), (p) => !!(p.flags & 8 /* EnumMember */)), (p) => {
|
|
50322
50364
|
const initializedValue = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? getConstantValue2(p.declarations[0]) : void 0;
|
|
@@ -50400,7 +50442,7 @@ function createTypeChecker(host) {
|
|
|
50400
50442
|
factory.createIdentifier("default" /* Default */)
|
|
50401
50443
|
)])
|
|
50402
50444
|
) : d);
|
|
50403
|
-
const exportModifierStripped = every(defaultReplaced, (d) => hasSyntacticModifier(d,
|
|
50445
|
+
const exportModifierStripped = every(defaultReplaced, (d) => hasSyntacticModifier(d, 32 /* Export */)) ? map(defaultReplaced, removeExportModifier) : defaultReplaced;
|
|
50404
50446
|
fakespace = factory.updateModuleDeclaration(
|
|
50405
50447
|
fakespace,
|
|
50406
50448
|
fakespace.modifiers,
|
|
@@ -50503,7 +50545,7 @@ function createTypeChecker(host) {
|
|
|
50503
50545
|
);
|
|
50504
50546
|
const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */));
|
|
50505
50547
|
const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(
|
|
50506
|
-
factory.createModifiersFromModifierFlags(
|
|
50548
|
+
factory.createModifiersFromModifierFlags(2 /* Private */),
|
|
50507
50549
|
[],
|
|
50508
50550
|
/*body*/
|
|
50509
50551
|
void 0
|
|
@@ -50856,7 +50898,7 @@ function createTypeChecker(host) {
|
|
|
50856
50898
|
const varName = getUnusedName(name, symbol);
|
|
50857
50899
|
const typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol)));
|
|
50858
50900
|
if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) {
|
|
50859
|
-
serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ :
|
|
50901
|
+
serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 32 /* Export */);
|
|
50860
50902
|
} else {
|
|
50861
50903
|
const flags = ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 267 /* ModuleDeclaration */ && (!(symbol.flags & 98304 /* Accessor */) || symbol.flags & 65536 /* SetAccessor */) ? 1 /* Let */ : 2 /* Const */;
|
|
50862
50904
|
const statement = factory.createVariableStatement(
|
|
@@ -50873,7 +50915,7 @@ function createTypeChecker(host) {
|
|
|
50873
50915
|
);
|
|
50874
50916
|
addResult(
|
|
50875
50917
|
statement,
|
|
50876
|
-
target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ?
|
|
50918
|
+
target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ? 128 /* Ambient */ : name === varName ? 32 /* Export */ : 0 /* None */
|
|
50877
50919
|
);
|
|
50878
50920
|
}
|
|
50879
50921
|
if (isExportAssignmentCompatibleSymbolName) {
|
|
@@ -50909,14 +50951,14 @@ function createTypeChecker(host) {
|
|
|
50909
50951
|
return function serializePropertySymbol(p, isStatic2, baseType) {
|
|
50910
50952
|
var _a2, _b, _c, _d, _e;
|
|
50911
50953
|
const modifierFlags = getDeclarationModifierFlagsFromSymbol(p);
|
|
50912
|
-
const isPrivate = !!(modifierFlags &
|
|
50954
|
+
const isPrivate = !!(modifierFlags & 2 /* Private */);
|
|
50913
50955
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
50914
50956
|
return [];
|
|
50915
50957
|
}
|
|
50916
50958
|
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))) {
|
|
50917
50959
|
return [];
|
|
50918
50960
|
}
|
|
50919
|
-
const flag = modifierFlags & ~
|
|
50961
|
+
const flag = modifierFlags & ~1024 /* Async */ | (isStatic2 ? 256 /* Static */ : 0);
|
|
50920
50962
|
const name = getPropertyNameNodeForSymbol(p, context);
|
|
50921
50963
|
const firstPropertyLikeDecl = (_a2 = p.declarations) == null ? void 0 : _a2.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression));
|
|
50922
50964
|
if (p.flags & 98304 /* Accessor */ && useAccessors) {
|
|
@@ -50958,7 +51000,7 @@ function createTypeChecker(host) {
|
|
|
50958
51000
|
));
|
|
50959
51001
|
}
|
|
50960
51002
|
if (p.flags & 32768 /* GetAccessor */) {
|
|
50961
|
-
const isPrivate2 = modifierFlags &
|
|
51003
|
+
const isPrivate2 = modifierFlags & 2 /* Private */;
|
|
50962
51004
|
result.push(setTextRange(
|
|
50963
51005
|
factory.createGetAccessorDeclaration(
|
|
50964
51006
|
factory.createModifiersFromModifierFlags(flag),
|
|
@@ -50975,7 +51017,7 @@ function createTypeChecker(host) {
|
|
|
50975
51017
|
} else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) {
|
|
50976
51018
|
return setTextRange(
|
|
50977
51019
|
createProperty2(
|
|
50978
|
-
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ?
|
|
51020
|
+
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag),
|
|
50979
51021
|
name,
|
|
50980
51022
|
p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
50981
51023
|
isPrivate ? void 0 : serializeTypeForDeclaration(context, getWriteTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled),
|
|
@@ -50990,10 +51032,10 @@ function createTypeChecker(host) {
|
|
|
50990
51032
|
if (p.flags & (8192 /* Method */ | 16 /* Function */)) {
|
|
50991
51033
|
const type = getTypeOfSymbol(p);
|
|
50992
51034
|
const signatures = getSignaturesOfType(type, 0 /* Call */);
|
|
50993
|
-
if (flag &
|
|
51035
|
+
if (flag & 2 /* Private */) {
|
|
50994
51036
|
return setTextRange(
|
|
50995
51037
|
createProperty2(
|
|
50996
|
-
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ?
|
|
51038
|
+
factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag),
|
|
50997
51039
|
name,
|
|
50998
51040
|
p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
50999
51041
|
/*type*/
|
|
@@ -51069,7 +51111,7 @@ function createTypeChecker(host) {
|
|
|
51069
51111
|
let privateProtected = 0;
|
|
51070
51112
|
for (const s of signatures) {
|
|
51071
51113
|
if (s.declaration) {
|
|
51072
|
-
privateProtected |= getSelectedEffectiveModifierFlags(s.declaration,
|
|
51114
|
+
privateProtected |= getSelectedEffectiveModifierFlags(s.declaration, 2 /* Private */ | 4 /* Protected */);
|
|
51073
51115
|
}
|
|
51074
51116
|
}
|
|
51075
51117
|
if (privateProtected) {
|
|
@@ -51262,10 +51304,10 @@ function createTypeChecker(host) {
|
|
|
51262
51304
|
return result || types;
|
|
51263
51305
|
}
|
|
51264
51306
|
function visibilityToString(flags) {
|
|
51265
|
-
if (flags ===
|
|
51307
|
+
if (flags === 2 /* Private */) {
|
|
51266
51308
|
return "private";
|
|
51267
51309
|
}
|
|
51268
|
-
if (flags ===
|
|
51310
|
+
if (flags === 4 /* Protected */) {
|
|
51269
51311
|
return "protected";
|
|
51270
51312
|
}
|
|
51271
51313
|
return "public";
|
|
@@ -51383,7 +51425,7 @@ function createTypeChecker(host) {
|
|
|
51383
51425
|
return true;
|
|
51384
51426
|
}
|
|
51385
51427
|
const parent = getDeclarationContainer(node);
|
|
51386
|
-
if (!(getCombinedModifierFlagsCached(node) &
|
|
51428
|
+
if (!(getCombinedModifierFlagsCached(node) & 32 /* Export */) && !(node.kind !== 271 /* ImportEqualsDeclaration */ && parent.kind !== 312 /* SourceFile */ && parent.flags & 33554432 /* Ambient */)) {
|
|
51387
51429
|
return isGlobalSourceFile(parent);
|
|
51388
51430
|
}
|
|
51389
51431
|
return isDeclarationVisible(parent);
|
|
@@ -51393,7 +51435,7 @@ function createTypeChecker(host) {
|
|
|
51393
51435
|
case 178 /* SetAccessor */:
|
|
51394
51436
|
case 174 /* MethodDeclaration */:
|
|
51395
51437
|
case 173 /* MethodSignature */:
|
|
51396
|
-
if (hasEffectiveModifier(node,
|
|
51438
|
+
if (hasEffectiveModifier(node, 2 /* Private */ | 4 /* Protected */)) {
|
|
51397
51439
|
return false;
|
|
51398
51440
|
}
|
|
51399
51441
|
case 176 /* Constructor */:
|
|
@@ -51612,7 +51654,7 @@ function createTypeChecker(host) {
|
|
|
51612
51654
|
const unspreadableToRestKeys = [];
|
|
51613
51655
|
for (const prop of getPropertiesOfType(source)) {
|
|
51614
51656
|
const literalTypeFromProperty = getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */);
|
|
51615
|
-
if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType) && !(getDeclarationModifierFlagsFromSymbol(prop) & (
|
|
51657
|
+
if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType) && !(getDeclarationModifierFlagsFromSymbol(prop) & (2 /* Private */ | 4 /* Protected */)) && isSpreadableProperty(prop)) {
|
|
51616
51658
|
spreadableProperties.push(prop);
|
|
51617
51659
|
} else {
|
|
51618
51660
|
unspreadableToRestKeys.push(literalTypeFromProperty);
|
|
@@ -51818,7 +51860,7 @@ function createTypeChecker(host) {
|
|
|
51818
51860
|
if (declaredType) {
|
|
51819
51861
|
return addOptionality(declaredType, isProperty, isOptional);
|
|
51820
51862
|
}
|
|
51821
|
-
if ((noImplicitAny || isInJSFile(declaration)) && isVariableDeclaration(declaration) && !isBindingPattern(declaration.name) && !(getCombinedModifierFlagsCached(declaration) &
|
|
51863
|
+
if ((noImplicitAny || isInJSFile(declaration)) && isVariableDeclaration(declaration) && !isBindingPattern(declaration.name) && !(getCombinedModifierFlagsCached(declaration) & 32 /* Export */) && !(declaration.flags & 33554432 /* Ambient */)) {
|
|
51822
51864
|
if (!(getCombinedNodeFlagsCached(declaration) & 6 /* Constant */) && (!declaration.initializer || isNullOrUndefined2(declaration.initializer))) {
|
|
51823
51865
|
return autoType;
|
|
51824
51866
|
}
|
|
@@ -51866,7 +51908,7 @@ function createTypeChecker(host) {
|
|
|
51866
51908
|
if (isPropertyDeclaration(declaration) && (noImplicitAny || isInJSFile(declaration))) {
|
|
51867
51909
|
if (!hasStaticModifier(declaration)) {
|
|
51868
51910
|
const constructor = findConstructorDeclaration(declaration.parent);
|
|
51869
|
-
const type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : getEffectiveModifierFlags(declaration) &
|
|
51911
|
+
const type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : getEffectiveModifierFlags(declaration) & 128 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0;
|
|
51870
51912
|
return type && addOptionality(
|
|
51871
51913
|
type,
|
|
51872
51914
|
/*isProperty*/
|
|
@@ -51875,7 +51917,7 @@ function createTypeChecker(host) {
|
|
|
51875
51917
|
);
|
|
51876
51918
|
} else {
|
|
51877
51919
|
const staticBlocks = filter(declaration.parent.members, isClassStaticBlockDeclaration);
|
|
51878
|
-
const type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) : getEffectiveModifierFlags(declaration) &
|
|
51920
|
+
const type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) : getEffectiveModifierFlags(declaration) & 128 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0;
|
|
51879
51921
|
return type && addOptionality(
|
|
51880
51922
|
type,
|
|
51881
51923
|
/*isProperty*/
|
|
@@ -51979,7 +52021,7 @@ function createTypeChecker(host) {
|
|
|
51979
52021
|
return everyType(flowType, isNullableType) ? void 0 : convertAutoToAny(flowType);
|
|
51980
52022
|
}
|
|
51981
52023
|
function getFlowTypeOfProperty(reference, prop) {
|
|
51982
|
-
const initialType = (prop == null ? void 0 : prop.valueDeclaration) && (!isAutoTypedProperty(prop) || getEffectiveModifierFlags(prop.valueDeclaration) &
|
|
52024
|
+
const initialType = (prop == null ? void 0 : prop.valueDeclaration) && (!isAutoTypedProperty(prop) || getEffectiveModifierFlags(prop.valueDeclaration) & 128 /* Ambient */) && getTypeOfPropertyInBaseClass(prop) || undefinedType;
|
|
51983
52025
|
return getFlowTypeOfReference(reference, autoType, initialType);
|
|
51984
52026
|
}
|
|
51985
52027
|
function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) {
|
|
@@ -52057,19 +52099,19 @@ function createTypeChecker(host) {
|
|
|
52057
52099
|
if (!isInJSFile(decl) || !init || !isObjectLiteralExpression(init) || init.properties.length) {
|
|
52058
52100
|
return void 0;
|
|
52059
52101
|
}
|
|
52060
|
-
const
|
|
52102
|
+
const exports2 = createSymbolTable();
|
|
52061
52103
|
while (isBinaryExpression(decl) || isPropertyAccessExpression(decl)) {
|
|
52062
52104
|
const s2 = getSymbolOfNode(decl);
|
|
52063
52105
|
if ((_a = s2 == null ? void 0 : s2.exports) == null ? void 0 : _a.size) {
|
|
52064
|
-
mergeSymbolTable(
|
|
52106
|
+
mergeSymbolTable(exports2, s2.exports);
|
|
52065
52107
|
}
|
|
52066
52108
|
decl = isBinaryExpression(decl) ? decl.parent : decl.parent.parent;
|
|
52067
52109
|
}
|
|
52068
52110
|
const s = getSymbolOfNode(decl);
|
|
52069
52111
|
if ((_b = s == null ? void 0 : s.exports) == null ? void 0 : _b.size) {
|
|
52070
|
-
mergeSymbolTable(
|
|
52112
|
+
mergeSymbolTable(exports2, s.exports);
|
|
52071
52113
|
}
|
|
52072
|
-
const type = createAnonymousType(symbol,
|
|
52114
|
+
const type = createAnonymousType(symbol, exports2, emptyArray, emptyArray, emptyArray);
|
|
52073
52115
|
type.objectFlags |= 4096 /* JSLiteral */;
|
|
52074
52116
|
return type;
|
|
52075
52117
|
}
|
|
@@ -53632,7 +53674,7 @@ function createTypeChecker(host) {
|
|
|
53632
53674
|
const baseConstructorType = getBaseConstructorTypeOfClass(classType);
|
|
53633
53675
|
const baseSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */);
|
|
53634
53676
|
const declaration = getClassLikeDeclarationOfSymbol(classType.symbol);
|
|
53635
|
-
const isAbstract = !!declaration && hasSyntacticModifier(declaration,
|
|
53677
|
+
const isAbstract = !!declaration && hasSyntacticModifier(declaration, 64 /* Abstract */);
|
|
53636
53678
|
if (baseSignatures.length === 0) {
|
|
53637
53679
|
return [createSignature(
|
|
53638
53680
|
/*declaration*/
|
|
@@ -54408,7 +54450,7 @@ function createTypeChecker(host) {
|
|
|
54408
54450
|
}
|
|
54409
54451
|
function isConstTypeVariable(type, depth = 0) {
|
|
54410
54452
|
var _a;
|
|
54411
|
-
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d,
|
|
54453
|
+
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));
|
|
54412
54454
|
}
|
|
54413
54455
|
function getConstraintOfIndexedAccess(type) {
|
|
54414
54456
|
return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0;
|
|
@@ -54734,7 +54776,7 @@ function createTypeChecker(host) {
|
|
|
54734
54776
|
} else if (!isUnion && !isReadonlySymbol(prop)) {
|
|
54735
54777
|
checkFlags &= ~8 /* Readonly */;
|
|
54736
54778
|
}
|
|
54737
|
-
checkFlags |= (!(modifiers &
|
|
54779
|
+
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);
|
|
54738
54780
|
if (!isPrototypeProperty(prop)) {
|
|
54739
54781
|
syntheticFlag = 2 /* SyntheticProperty */;
|
|
54740
54782
|
}
|
|
@@ -55186,7 +55228,7 @@ function createTypeChecker(host) {
|
|
|
55186
55228
|
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
|
|
55187
55229
|
flags |= 1 /* HasRestParameter */;
|
|
55188
55230
|
}
|
|
55189
|
-
if (isConstructorTypeNode(declaration) && hasSyntacticModifier(declaration,
|
|
55231
|
+
if (isConstructorTypeNode(declaration) && hasSyntacticModifier(declaration, 64 /* Abstract */) || isConstructorDeclaration(declaration) && hasSyntacticModifier(declaration.parent, 64 /* Abstract */)) {
|
|
55190
55232
|
flags |= 4 /* Abstract */;
|
|
55191
55233
|
}
|
|
55192
55234
|
links.resolvedSignature = createSignature(
|
|
@@ -55556,7 +55598,7 @@ function createTypeChecker(host) {
|
|
|
55556
55598
|
if (parameter.type) {
|
|
55557
55599
|
forEachType(getTypeFromTypeNode(parameter.type), (keyType) => {
|
|
55558
55600
|
if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) {
|
|
55559
|
-
indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration,
|
|
55601
|
+
indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 8 /* Readonly */), declaration));
|
|
55560
55602
|
}
|
|
55561
55603
|
});
|
|
55562
55604
|
}
|
|
@@ -57381,7 +57423,7 @@ function createTypeChecker(host) {
|
|
|
57381
57423
|
return neverType;
|
|
57382
57424
|
}
|
|
57383
57425
|
function getLiteralTypeFromProperty(prop, include, includeNonPublic) {
|
|
57384
|
-
if (includeNonPublic || !(getDeclarationModifierFlagsFromSymbol(prop) &
|
|
57426
|
+
if (includeNonPublic || !(getDeclarationModifierFlagsFromSymbol(prop) & 6 /* NonPublicAccessibilityModifier */)) {
|
|
57385
57427
|
let type = getSymbolLinks(getLateBoundSymbol(prop)).nameType;
|
|
57386
57428
|
if (!type) {
|
|
57387
57429
|
const name = getNameOfDeclaration(prop.valueDeclaration);
|
|
@@ -58326,7 +58368,7 @@ function createTypeChecker(host) {
|
|
|
58326
58368
|
function getAnonymousPartialType(type2) {
|
|
58327
58369
|
const members = createSymbolTable();
|
|
58328
58370
|
for (const prop of getPropertiesOfType(type2)) {
|
|
58329
|
-
if (getDeclarationModifierFlagsFromSymbol(prop) & (
|
|
58371
|
+
if (getDeclarationModifierFlagsFromSymbol(prop) & (2 /* Private */ | 4 /* Protected */)) {
|
|
58330
58372
|
} else if (isSpreadableProperty(prop)) {
|
|
58331
58373
|
const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
|
|
58332
58374
|
const flags = 4 /* Property */ | 16777216 /* Optional */;
|
|
@@ -58388,7 +58430,7 @@ function createTypeChecker(host) {
|
|
|
58388
58430
|
const skippedPrivateMembers = /* @__PURE__ */ new Set();
|
|
58389
58431
|
const indexInfos = left === emptyObjectType ? getIndexInfosOfType(right) : getUnionIndexInfos([left, right]);
|
|
58390
58432
|
for (const rightProp of getPropertiesOfType(right)) {
|
|
58391
|
-
if (getDeclarationModifierFlagsFromSymbol(rightProp) & (
|
|
58433
|
+
if (getDeclarationModifierFlagsFromSymbol(rightProp) & (2 /* Private */ | 4 /* Protected */)) {
|
|
58392
58434
|
skippedPrivateMembers.add(rightProp.escapedName);
|
|
58393
58435
|
} else if (isSpreadableProperty(rightProp)) {
|
|
58394
58436
|
members.set(rightProp.escapedName, getSpreadSymbol(rightProp, readonly));
|
|
@@ -61955,25 +61997,25 @@ function createTypeChecker(host) {
|
|
|
61955
61997
|
function propertyRelatedTo(source2, target2, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState, skipOptional) {
|
|
61956
61998
|
const sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp);
|
|
61957
61999
|
const targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp);
|
|
61958
|
-
if (sourcePropFlags &
|
|
62000
|
+
if (sourcePropFlags & 2 /* Private */ || targetPropFlags & 2 /* Private */) {
|
|
61959
62001
|
if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) {
|
|
61960
62002
|
if (reportErrors2) {
|
|
61961
|
-
if (sourcePropFlags &
|
|
62003
|
+
if (sourcePropFlags & 2 /* Private */ && targetPropFlags & 2 /* Private */) {
|
|
61962
62004
|
reportError(Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp));
|
|
61963
62005
|
} else {
|
|
61964
|
-
reportError(Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourcePropFlags &
|
|
62006
|
+
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));
|
|
61965
62007
|
}
|
|
61966
62008
|
}
|
|
61967
62009
|
return 0 /* False */;
|
|
61968
62010
|
}
|
|
61969
|
-
} else if (targetPropFlags &
|
|
62011
|
+
} else if (targetPropFlags & 4 /* Protected */) {
|
|
61970
62012
|
if (!isValidOverrideOf(sourceProp, targetProp)) {
|
|
61971
62013
|
if (reportErrors2) {
|
|
61972
62014
|
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));
|
|
61973
62015
|
}
|
|
61974
62016
|
return 0 /* False */;
|
|
61975
62017
|
}
|
|
61976
|
-
} else if (sourcePropFlags &
|
|
62018
|
+
} else if (sourcePropFlags & 4 /* Protected */) {
|
|
61977
62019
|
if (reportErrors2) {
|
|
61978
62020
|
reportError(Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source2), typeToString(target2));
|
|
61979
62021
|
}
|
|
@@ -62503,15 +62545,15 @@ function createTypeChecker(host) {
|
|
|
62503
62545
|
if (!sourceSignature.declaration || !targetSignature.declaration) {
|
|
62504
62546
|
return true;
|
|
62505
62547
|
}
|
|
62506
|
-
const sourceAccessibility = getSelectedEffectiveModifierFlags(sourceSignature.declaration,
|
|
62507
|
-
const targetAccessibility = getSelectedEffectiveModifierFlags(targetSignature.declaration,
|
|
62508
|
-
if (targetAccessibility ===
|
|
62548
|
+
const sourceAccessibility = getSelectedEffectiveModifierFlags(sourceSignature.declaration, 6 /* NonPublicAccessibilityModifier */);
|
|
62549
|
+
const targetAccessibility = getSelectedEffectiveModifierFlags(targetSignature.declaration, 6 /* NonPublicAccessibilityModifier */);
|
|
62550
|
+
if (targetAccessibility === 2 /* Private */) {
|
|
62509
62551
|
return true;
|
|
62510
62552
|
}
|
|
62511
|
-
if (targetAccessibility ===
|
|
62553
|
+
if (targetAccessibility === 4 /* Protected */ && sourceAccessibility !== 2 /* Private */) {
|
|
62512
62554
|
return true;
|
|
62513
62555
|
}
|
|
62514
|
-
if (targetAccessibility !==
|
|
62556
|
+
if (targetAccessibility !== 4 /* Protected */ && !sourceAccessibility) {
|
|
62515
62557
|
return true;
|
|
62516
62558
|
}
|
|
62517
62559
|
if (reportErrors2) {
|
|
@@ -62611,7 +62653,7 @@ function createTypeChecker(host) {
|
|
|
62611
62653
|
const variances = [];
|
|
62612
62654
|
for (const tp of typeParameters) {
|
|
62613
62655
|
const modifiers = getTypeParameterModifiers(tp);
|
|
62614
|
-
let variance = modifiers &
|
|
62656
|
+
let variance = modifiers & 16384 /* Out */ ? modifiers & 8192 /* In */ ? 0 /* Invariant */ : 1 /* Covariant */ : modifiers & 8192 /* In */ ? 2 /* Contravariant */ : void 0;
|
|
62615
62657
|
if (variance === void 0) {
|
|
62616
62658
|
let unmeasurable = false;
|
|
62617
62659
|
let unreliable = false;
|
|
@@ -62659,7 +62701,7 @@ function createTypeChecker(host) {
|
|
|
62659
62701
|
}
|
|
62660
62702
|
function getTypeParameterModifiers(tp) {
|
|
62661
62703
|
var _a;
|
|
62662
|
-
return reduceLeft((_a = tp.symbol) == null ? void 0 : _a.declarations, (modifiers, d) => modifiers | getEffectiveModifierFlags(d), 0 /* None */) & (
|
|
62704
|
+
return reduceLeft((_a = tp.symbol) == null ? void 0 : _a.declarations, (modifiers, d) => modifiers | getEffectiveModifierFlags(d), 0 /* None */) & (8192 /* In */ | 16384 /* Out */ | 4096 /* Const */);
|
|
62663
62705
|
}
|
|
62664
62706
|
function hasCovariantVoidArgument(typeArguments, variances) {
|
|
62665
62707
|
for (let i = 0; i < variances.length; i++) {
|
|
@@ -62744,10 +62786,10 @@ function createTypeChecker(host) {
|
|
|
62744
62786
|
});
|
|
62745
62787
|
}
|
|
62746
62788
|
function isValidOverrideOf(sourceProp, targetProp) {
|
|
62747
|
-
return !forEachProperty(targetProp, (tp) => getDeclarationModifierFlagsFromSymbol(tp) &
|
|
62789
|
+
return !forEachProperty(targetProp, (tp) => getDeclarationModifierFlagsFromSymbol(tp) & 4 /* Protected */ ? !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false);
|
|
62748
62790
|
}
|
|
62749
62791
|
function isClassDerivedFromDeclaringClasses(checkClass, prop, writing) {
|
|
62750
|
-
return forEachProperty(prop, (p) => getDeclarationModifierFlagsFromSymbol(p, writing) &
|
|
62792
|
+
return forEachProperty(prop, (p) => getDeclarationModifierFlagsFromSymbol(p, writing) & 4 /* Protected */ ? !hasBaseType(checkClass, getDeclaringClass(p)) : false) ? void 0 : checkClass;
|
|
62751
62793
|
}
|
|
62752
62794
|
function isDeeplyNestedType(type, stack, depth, maxDepth = 3) {
|
|
62753
62795
|
if (depth >= maxDepth) {
|
|
@@ -62824,8 +62866,8 @@ function createTypeChecker(host) {
|
|
|
62824
62866
|
if (sourceProp === targetProp) {
|
|
62825
62867
|
return -1 /* True */;
|
|
62826
62868
|
}
|
|
62827
|
-
const sourcePropAccessibility = getDeclarationModifierFlagsFromSymbol(sourceProp) &
|
|
62828
|
-
const targetPropAccessibility = getDeclarationModifierFlagsFromSymbol(targetProp) &
|
|
62869
|
+
const sourcePropAccessibility = getDeclarationModifierFlagsFromSymbol(sourceProp) & 6 /* NonPublicAccessibilityModifier */;
|
|
62870
|
+
const targetPropAccessibility = getDeclarationModifierFlagsFromSymbol(targetProp) & 6 /* NonPublicAccessibilityModifier */;
|
|
62829
62871
|
if (sourcePropAccessibility !== targetPropAccessibility) {
|
|
62830
62872
|
return 0 /* False */;
|
|
62831
62873
|
}
|
|
@@ -66819,7 +66861,7 @@ function createTypeChecker(host) {
|
|
|
66819
66861
|
if (languageVersion < 2 /* ES2015 */) {
|
|
66820
66862
|
if (container.kind === 219 /* ArrowFunction */) {
|
|
66821
66863
|
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
|
|
66822
|
-
} else if (hasSyntacticModifier(container,
|
|
66864
|
+
} else if (hasSyntacticModifier(container, 1024 /* Async */)) {
|
|
66823
66865
|
error(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);
|
|
66824
66866
|
}
|
|
66825
66867
|
}
|
|
@@ -67232,7 +67274,7 @@ function createTypeChecker(host) {
|
|
|
67232
67274
|
let inAsyncFunction = false;
|
|
67233
67275
|
if (!isCallExpression2) {
|
|
67234
67276
|
while (container && container.kind === 219 /* ArrowFunction */) {
|
|
67235
|
-
if (hasSyntacticModifier(container,
|
|
67277
|
+
if (hasSyntacticModifier(container, 1024 /* Async */))
|
|
67236
67278
|
inAsyncFunction = true;
|
|
67237
67279
|
container = getSuperContainer(
|
|
67238
67280
|
container,
|
|
@@ -67241,7 +67283,7 @@ function createTypeChecker(host) {
|
|
|
67241
67283
|
);
|
|
67242
67284
|
needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */;
|
|
67243
67285
|
}
|
|
67244
|
-
if (container && hasSyntacticModifier(container,
|
|
67286
|
+
if (container && hasSyntacticModifier(container, 1024 /* Async */))
|
|
67245
67287
|
inAsyncFunction = true;
|
|
67246
67288
|
}
|
|
67247
67289
|
let nodeCheckFlag = 0;
|
|
@@ -69034,8 +69076,8 @@ function createTypeChecker(host) {
|
|
|
69034
69076
|
}
|
|
69035
69077
|
function getJsxType(name, location) {
|
|
69036
69078
|
const namespace = getJsxNamespaceAt(location);
|
|
69037
|
-
const
|
|
69038
|
-
const typeSymbol =
|
|
69079
|
+
const exports2 = namespace && getExportsOfSymbol(namespace);
|
|
69080
|
+
const typeSymbol = exports2 && getSymbol(exports2, name, 788968 /* Type */);
|
|
69039
69081
|
return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType;
|
|
69040
69082
|
}
|
|
69041
69083
|
function getIntrinsicTagSymbol(node) {
|
|
@@ -69429,20 +69471,20 @@ function createTypeChecker(host) {
|
|
|
69429
69471
|
return false;
|
|
69430
69472
|
}
|
|
69431
69473
|
}
|
|
69432
|
-
if (flags &
|
|
69474
|
+
if (flags & 64 /* Abstract */) {
|
|
69433
69475
|
if (errorNode) {
|
|
69434
69476
|
error(errorNode, Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop)));
|
|
69435
69477
|
}
|
|
69436
69478
|
return false;
|
|
69437
69479
|
}
|
|
69438
|
-
if (!(flags &
|
|
69480
|
+
if (!(flags & 256 /* Static */) && ((_a = prop.declarations) == null ? void 0 : _a.some(isClassInstanceProperty))) {
|
|
69439
69481
|
if (errorNode) {
|
|
69440
69482
|
error(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString(prop));
|
|
69441
69483
|
}
|
|
69442
69484
|
return false;
|
|
69443
69485
|
}
|
|
69444
69486
|
}
|
|
69445
|
-
if (flags &
|
|
69487
|
+
if (flags & 64 /* Abstract */ && symbolHasNonMethodDeclaration(prop) && (isThisProperty(location) || isThisInitializedObjectBindingExpression(location) || isObjectBindingPattern(location.parent) && isThisInitializedDeclaration(location.parent.parent))) {
|
|
69446
69488
|
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
|
|
69447
69489
|
if (declaringClassDeclaration && isNodeUsedDuringClassInitialization(location)) {
|
|
69448
69490
|
if (errorNode) {
|
|
@@ -69451,10 +69493,10 @@ function createTypeChecker(host) {
|
|
|
69451
69493
|
return false;
|
|
69452
69494
|
}
|
|
69453
69495
|
}
|
|
69454
|
-
if (!(flags &
|
|
69496
|
+
if (!(flags & 6 /* NonPublicAccessibilityModifier */)) {
|
|
69455
69497
|
return true;
|
|
69456
69498
|
}
|
|
69457
|
-
if (flags &
|
|
69499
|
+
if (flags & 2 /* Private */) {
|
|
69458
69500
|
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
|
|
69459
69501
|
if (!isNodeWithinClass(location, declaringClassDeclaration)) {
|
|
69460
69502
|
if (errorNode) {
|
|
@@ -69474,14 +69516,14 @@ function createTypeChecker(host) {
|
|
|
69474
69516
|
if (!enclosingClass) {
|
|
69475
69517
|
enclosingClass = getEnclosingClassFromThisParameter(location);
|
|
69476
69518
|
enclosingClass = enclosingClass && isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing);
|
|
69477
|
-
if (flags &
|
|
69519
|
+
if (flags & 256 /* Static */ || !enclosingClass) {
|
|
69478
69520
|
if (errorNode) {
|
|
69479
69521
|
error(errorNode, Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || containingType));
|
|
69480
69522
|
}
|
|
69481
69523
|
return false;
|
|
69482
69524
|
}
|
|
69483
69525
|
}
|
|
69484
|
-
if (flags &
|
|
69526
|
+
if (flags & 256 /* Static */) {
|
|
69485
69527
|
return true;
|
|
69486
69528
|
}
|
|
69487
69529
|
if (containingType.flags & 262144 /* TypeParameter */) {
|
|
@@ -69901,7 +69943,7 @@ function createTypeChecker(host) {
|
|
|
69901
69943
|
}
|
|
69902
69944
|
let diagnosticMessage;
|
|
69903
69945
|
const declarationName = idText(right);
|
|
69904
|
-
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) &
|
|
69946
|
+
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 256 /* Static */) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) {
|
|
69905
69947
|
diagnosticMessage = error(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
|
|
69906
69948
|
} else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
|
|
69907
69949
|
diagnosticMessage = error(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
@@ -70155,7 +70197,7 @@ function createTypeChecker(host) {
|
|
|
70155
70197
|
if (!valueDeclaration) {
|
|
70156
70198
|
return;
|
|
70157
70199
|
}
|
|
70158
|
-
const hasPrivateModifier = hasEffectiveModifier(valueDeclaration,
|
|
70200
|
+
const hasPrivateModifier = hasEffectiveModifier(valueDeclaration, 2 /* Private */);
|
|
70159
70201
|
const hasPrivateIdentifier = prop.valueDeclaration && isNamedDeclaration(prop.valueDeclaration) && isPrivateIdentifier(prop.valueDeclaration.name);
|
|
70160
70202
|
if (!hasPrivateModifier && !hasPrivateIdentifier) {
|
|
70161
70203
|
return;
|
|
@@ -71600,7 +71642,7 @@ function createTypeChecker(host) {
|
|
|
71600
71642
|
return resolveErrorCall(node);
|
|
71601
71643
|
}
|
|
71602
71644
|
const valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol);
|
|
71603
|
-
if (valueDecl && hasSyntacticModifier(valueDecl,
|
|
71645
|
+
if (valueDecl && hasSyntacticModifier(valueDecl, 64 /* Abstract */)) {
|
|
71604
71646
|
error(node, Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
|
|
71605
71647
|
return resolveErrorCall(node);
|
|
71606
71648
|
}
|
|
@@ -71663,7 +71705,7 @@ function createTypeChecker(host) {
|
|
|
71663
71705
|
return true;
|
|
71664
71706
|
}
|
|
71665
71707
|
const declaration = signature.declaration;
|
|
71666
|
-
const modifiers = getSelectedEffectiveModifierFlags(declaration,
|
|
71708
|
+
const modifiers = getSelectedEffectiveModifierFlags(declaration, 6 /* NonPublicAccessibilityModifier */);
|
|
71667
71709
|
if (!modifiers || declaration.kind !== 176 /* Constructor */) {
|
|
71668
71710
|
return true;
|
|
71669
71711
|
}
|
|
@@ -71671,16 +71713,16 @@ function createTypeChecker(host) {
|
|
|
71671
71713
|
const declaringClass = getDeclaredTypeOfSymbol(declaration.parent.symbol);
|
|
71672
71714
|
if (!isNodeWithinClass(node, declaringClassDeclaration)) {
|
|
71673
71715
|
const containingClass = getContainingClass(node);
|
|
71674
|
-
if (containingClass && modifiers &
|
|
71716
|
+
if (containingClass && modifiers & 4 /* Protected */) {
|
|
71675
71717
|
const containingType = getTypeOfNode(containingClass);
|
|
71676
71718
|
if (typeHasProtectedAccessibleBase(declaration.parent.symbol, containingType)) {
|
|
71677
71719
|
return true;
|
|
71678
71720
|
}
|
|
71679
71721
|
}
|
|
71680
|
-
if (modifiers &
|
|
71722
|
+
if (modifiers & 2 /* Private */) {
|
|
71681
71723
|
error(node, Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration, typeToString(declaringClass));
|
|
71682
71724
|
}
|
|
71683
|
-
if (modifiers &
|
|
71725
|
+
if (modifiers & 4 /* Protected */) {
|
|
71684
71726
|
error(node, Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration, typeToString(declaringClass));
|
|
71685
71727
|
}
|
|
71686
71728
|
return false;
|
|
@@ -71859,8 +71901,8 @@ function createTypeChecker(host) {
|
|
|
71859
71901
|
}
|
|
71860
71902
|
function createSignatureForJSXIntrinsic(node, result) {
|
|
71861
71903
|
const namespace = getJsxNamespaceAt(node);
|
|
71862
|
-
const
|
|
71863
|
-
const typeSymbol =
|
|
71904
|
+
const exports2 = namespace && getExportsOfSymbol(namespace);
|
|
71905
|
+
const typeSymbol = exports2 && getSymbol(exports2, JsxNames.Element, 788968 /* Type */);
|
|
71864
71906
|
const returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 788968 /* Type */, node);
|
|
71865
71907
|
const declaration = factory.createFunctionTypeNode(
|
|
71866
71908
|
/*typeParameters*/
|
|
@@ -73657,7 +73699,7 @@ function createTypeChecker(host) {
|
|
|
73657
73699
|
return !setProp;
|
|
73658
73700
|
}
|
|
73659
73701
|
function isReadonlySymbol(symbol) {
|
|
73660
|
-
return !!(getCheckFlags(symbol) & 8 /* Readonly */ || symbol.flags & 4 /* Property */ && getDeclarationModifierFlagsFromSymbol(symbol) &
|
|
73702
|
+
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));
|
|
73661
73703
|
}
|
|
73662
73704
|
function isAssignmentToReadonlyEntity(expr, symbol, assignmentKind) {
|
|
73663
73705
|
var _a, _b;
|
|
@@ -75395,15 +75437,15 @@ function createTypeChecker(host) {
|
|
|
75395
75437
|
var _a, _b;
|
|
75396
75438
|
if (isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent)) {
|
|
75397
75439
|
const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node));
|
|
75398
|
-
const modifiers = getTypeParameterModifiers(typeParameter) & (
|
|
75440
|
+
const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
|
|
75399
75441
|
if (modifiers) {
|
|
75400
75442
|
const symbol = getSymbolOfDeclaration(node.parent);
|
|
75401
75443
|
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
75402
75444
|
error(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
75403
|
-
} else if (modifiers ===
|
|
75445
|
+
} else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
|
|
75404
75446
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|
|
75405
|
-
const source = createMarkerType(symbol, typeParameter, modifiers ===
|
|
75406
|
-
const target = createMarkerType(symbol, typeParameter, modifiers ===
|
|
75447
|
+
const source = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSubTypeForCheck : markerSuperTypeForCheck);
|
|
75448
|
+
const target = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSuperTypeForCheck : markerSubTypeForCheck);
|
|
75407
75449
|
const saveVarianceTypeParameter = typeParameter;
|
|
75408
75450
|
varianceTypeParameter = typeParameter;
|
|
75409
75451
|
checkTypeAssignableTo(source, target, node, Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation);
|
|
@@ -75417,7 +75459,7 @@ function createTypeChecker(host) {
|
|
|
75417
75459
|
checkGrammarModifiers(node);
|
|
75418
75460
|
checkVariableLikeDeclaration(node);
|
|
75419
75461
|
const func = getContainingFunction(node);
|
|
75420
|
-
if (hasSyntacticModifier(node,
|
|
75462
|
+
if (hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) {
|
|
75421
75463
|
if (!(func.kind === 176 /* Constructor */ && nodeIsPresent(func.body))) {
|
|
75422
75464
|
error(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
|
|
75423
75465
|
}
|
|
@@ -75749,7 +75791,7 @@ function createTypeChecker(host) {
|
|
|
75749
75791
|
checkGrammarComputedPropertyName(node.name);
|
|
75750
75792
|
checkVariableLikeDeclaration(node);
|
|
75751
75793
|
setNodeLinksForPrivateIdentifierScope(node);
|
|
75752
|
-
if (hasSyntacticModifier(node,
|
|
75794
|
+
if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 172 /* PropertyDeclaration */ && node.initializer) {
|
|
75753
75795
|
error(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name));
|
|
75754
75796
|
}
|
|
75755
75797
|
}
|
|
@@ -75766,7 +75808,7 @@ function createTypeChecker(host) {
|
|
|
75766
75808
|
error(node.name, Diagnostics.Class_constructor_may_not_be_a_generator);
|
|
75767
75809
|
}
|
|
75768
75810
|
checkFunctionOrMethodDeclaration(node);
|
|
75769
|
-
if (hasSyntacticModifier(node,
|
|
75811
|
+
if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 174 /* MethodDeclaration */ && node.body) {
|
|
75770
75812
|
error(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name));
|
|
75771
75813
|
}
|
|
75772
75814
|
if (isPrivateIdentifier(node.name) && !getContainingClass(node)) {
|
|
@@ -75823,7 +75865,7 @@ function createTypeChecker(host) {
|
|
|
75823
75865
|
if (classExtendsNull) {
|
|
75824
75866
|
error(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
|
|
75825
75867
|
}
|
|
75826
|
-
const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p,
|
|
75868
|
+
const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 31 /* ParameterPropertyModifier */)));
|
|
75827
75869
|
if (superCallShouldBeRootLevel) {
|
|
75828
75870
|
if (!superCallIsRootLevelInConstructor(superCall, node.body)) {
|
|
75829
75871
|
error(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);
|
|
@@ -75892,11 +75934,11 @@ function createTypeChecker(host) {
|
|
|
75892
75934
|
getNodeLinks(getter).flags |= 1 /* TypeChecked */;
|
|
75893
75935
|
const getterFlags = getEffectiveModifierFlags(getter);
|
|
75894
75936
|
const setterFlags = getEffectiveModifierFlags(setter);
|
|
75895
|
-
if ((getterFlags &
|
|
75937
|
+
if ((getterFlags & 64 /* Abstract */) !== (setterFlags & 64 /* Abstract */)) {
|
|
75896
75938
|
error(getter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract);
|
|
75897
75939
|
error(setter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract);
|
|
75898
75940
|
}
|
|
75899
|
-
if (getterFlags &
|
|
75941
|
+
if (getterFlags & 4 /* Protected */ && !(setterFlags & (4 /* Protected */ | 2 /* Private */)) || getterFlags & 2 /* Private */ && !(setterFlags & 2 /* Private */)) {
|
|
75900
75942
|
error(getter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter);
|
|
75901
75943
|
error(setter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter);
|
|
75902
75944
|
}
|
|
@@ -76076,7 +76118,7 @@ function createTypeChecker(host) {
|
|
|
76076
76118
|
const propertyName = getPropertyNameFromIndex(indexType, accessNode);
|
|
76077
76119
|
if (propertyName) {
|
|
76078
76120
|
const propertySymbol = forEachType(apparentObjectType, (t) => getPropertyOfType(t, propertyName));
|
|
76079
|
-
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) &
|
|
76121
|
+
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6 /* NonPublicAccessibilityModifier */) {
|
|
76080
76122
|
error(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, unescapeLeadingUnderscores(propertyName));
|
|
76081
76123
|
return errorType;
|
|
76082
76124
|
}
|
|
@@ -76174,16 +76216,16 @@ function createTypeChecker(host) {
|
|
|
76174
76216
|
getTypeFromTypeNode(node);
|
|
76175
76217
|
}
|
|
76176
76218
|
function isPrivateWithinAmbient(node) {
|
|
76177
|
-
return (hasEffectiveModifier(node,
|
|
76219
|
+
return (hasEffectiveModifier(node, 2 /* Private */) || isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags & 33554432 /* Ambient */);
|
|
76178
76220
|
}
|
|
76179
76221
|
function getEffectiveDeclarationFlags(n, flagsToCheck) {
|
|
76180
76222
|
let flags = getCombinedModifierFlagsCached(n);
|
|
76181
76223
|
if (n.parent.kind !== 264 /* InterfaceDeclaration */ && n.parent.kind !== 263 /* ClassDeclaration */ && n.parent.kind !== 231 /* ClassExpression */ && n.flags & 33554432 /* Ambient */) {
|
|
76182
76224
|
const container = getEnclosingContainer(n);
|
|
76183
|
-
if (container && container.flags & 128 /* ExportContext */ && !(flags &
|
|
76184
|
-
flags |=
|
|
76225
|
+
if (container && container.flags & 128 /* ExportContext */ && !(flags & 128 /* Ambient */) && !(isModuleBlock(n.parent) && isModuleDeclaration(n.parent.parent) && isGlobalScopeAugmentation(n.parent.parent))) {
|
|
76226
|
+
flags |= 32 /* Export */;
|
|
76185
76227
|
}
|
|
76186
|
-
flags |=
|
|
76228
|
+
flags |= 128 /* Ambient */;
|
|
76187
76229
|
}
|
|
76188
76230
|
return flags & flagsToCheck;
|
|
76189
76231
|
}
|
|
@@ -76201,13 +76243,13 @@ function createTypeChecker(host) {
|
|
|
76201
76243
|
const canonicalFlags = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck2);
|
|
76202
76244
|
forEach(overloads, (o) => {
|
|
76203
76245
|
const deviation = getEffectiveDeclarationFlags(o, flagsToCheck2) ^ canonicalFlags;
|
|
76204
|
-
if (deviation &
|
|
76246
|
+
if (deviation & 32 /* Export */) {
|
|
76205
76247
|
error(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported);
|
|
76206
|
-
} else if (deviation &
|
|
76248
|
+
} else if (deviation & 128 /* Ambient */) {
|
|
76207
76249
|
error(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient);
|
|
76208
|
-
} else if (deviation & (
|
|
76250
|
+
} else if (deviation & (2 /* Private */ | 4 /* Protected */)) {
|
|
76209
76251
|
error(getNameOfDeclaration(o) || o, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected);
|
|
76210
|
-
} else if (deviation &
|
|
76252
|
+
} else if (deviation & 64 /* Abstract */) {
|
|
76211
76253
|
error(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract);
|
|
76212
76254
|
}
|
|
76213
76255
|
});
|
|
@@ -76224,7 +76266,7 @@ function createTypeChecker(host) {
|
|
|
76224
76266
|
});
|
|
76225
76267
|
}
|
|
76226
76268
|
}
|
|
76227
|
-
const flagsToCheck =
|
|
76269
|
+
const flagsToCheck = 32 /* Export */ | 128 /* Ambient */ | 2 /* Private */ | 4 /* Protected */ | 64 /* Abstract */;
|
|
76228
76270
|
let someNodeFlags = 0 /* None */;
|
|
76229
76271
|
let allNodeFlags = flagsToCheck;
|
|
76230
76272
|
let someHaveQuestionToken = false;
|
|
@@ -76272,7 +76314,7 @@ function createTypeChecker(host) {
|
|
|
76272
76314
|
if (isConstructor) {
|
|
76273
76315
|
error(errorNode, Diagnostics.Constructor_implementation_is_missing);
|
|
76274
76316
|
} else {
|
|
76275
|
-
if (hasSyntacticModifier(node,
|
|
76317
|
+
if (hasSyntacticModifier(node, 64 /* Abstract */)) {
|
|
76276
76318
|
error(errorNode, Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive);
|
|
76277
76319
|
} else {
|
|
76278
76320
|
error(errorNode, Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration);
|
|
@@ -76358,7 +76400,7 @@ function createTypeChecker(host) {
|
|
|
76358
76400
|
}
|
|
76359
76401
|
});
|
|
76360
76402
|
}
|
|
76361
|
-
if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && !hasSyntacticModifier(lastSeenNonAmbientDeclaration,
|
|
76403
|
+
if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && !hasSyntacticModifier(lastSeenNonAmbientDeclaration, 64 /* Abstract */) && !lastSeenNonAmbientDeclaration.questionToken) {
|
|
76362
76404
|
reportImplementationExpectedError(lastSeenNonAmbientDeclaration);
|
|
76363
76405
|
}
|
|
76364
76406
|
if (hasOverloads) {
|
|
@@ -76401,9 +76443,9 @@ function createTypeChecker(host) {
|
|
|
76401
76443
|
let defaultExportedDeclarationSpaces = 0 /* None */;
|
|
76402
76444
|
for (const d of symbol.declarations) {
|
|
76403
76445
|
const declarationSpaces = getDeclarationSpaces(d);
|
|
76404
|
-
const effectiveDeclarationFlags = getEffectiveDeclarationFlags(d,
|
|
76405
|
-
if (effectiveDeclarationFlags &
|
|
76406
|
-
if (effectiveDeclarationFlags &
|
|
76446
|
+
const effectiveDeclarationFlags = getEffectiveDeclarationFlags(d, 32 /* Export */ | 2048 /* Default */);
|
|
76447
|
+
if (effectiveDeclarationFlags & 32 /* Export */) {
|
|
76448
|
+
if (effectiveDeclarationFlags & 2048 /* Default */) {
|
|
76407
76449
|
defaultExportedDeclarationSpaces |= declarationSpaces;
|
|
76408
76450
|
} else {
|
|
76409
76451
|
exportedDeclarationSpaces |= declarationSpaces;
|
|
@@ -77044,6 +77086,12 @@ function createTypeChecker(host) {
|
|
|
77044
77086
|
}
|
|
77045
77087
|
}
|
|
77046
77088
|
}
|
|
77089
|
+
function checkJSDocThisTag(node) {
|
|
77090
|
+
const host2 = getEffectiveJSDocHost(node);
|
|
77091
|
+
if (host2 && isArrowFunction(host2)) {
|
|
77092
|
+
error(node.tagName, Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
|
|
77093
|
+
}
|
|
77094
|
+
}
|
|
77047
77095
|
function checkJSDocImplementsTag(node) {
|
|
77048
77096
|
const classLike = getEffectiveJSDocHost(node);
|
|
77049
77097
|
if (!classLike || !isClassDeclaration(classLike) && !isClassExpression(classLike)) {
|
|
@@ -77206,13 +77254,13 @@ function createTypeChecker(host) {
|
|
|
77206
77254
|
break;
|
|
77207
77255
|
}
|
|
77208
77256
|
const symbol = getSymbolOfDeclaration(member);
|
|
77209
|
-
if (!symbol.isReferenced && (hasEffectiveModifier(member,
|
|
77257
|
+
if (!symbol.isReferenced && (hasEffectiveModifier(member, 2 /* Private */) || isNamedDeclaration(member) && isPrivateIdentifier(member.name)) && !(member.flags & 33554432 /* Ambient */)) {
|
|
77210
77258
|
addDiagnostic(member, 0 /* Local */, createDiagnosticForNode(member.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
|
|
77211
77259
|
}
|
|
77212
77260
|
break;
|
|
77213
77261
|
case 176 /* Constructor */:
|
|
77214
77262
|
for (const parameter of member.parameters) {
|
|
77215
|
-
if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter,
|
|
77263
|
+
if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter, 2 /* Private */)) {
|
|
77216
77264
|
addDiagnostic(parameter, 0 /* Local */, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol)));
|
|
77217
77265
|
}
|
|
77218
77266
|
}
|
|
@@ -77788,7 +77836,7 @@ function createTypeChecker(host) {
|
|
|
77788
77836
|
if (hasQuestionToken(left) !== hasQuestionToken(right)) {
|
|
77789
77837
|
return false;
|
|
77790
77838
|
}
|
|
77791
|
-
const interestingFlags =
|
|
77839
|
+
const interestingFlags = 2 /* Private */ | 4 /* Protected */ | 1024 /* Async */ | 64 /* Abstract */ | 8 /* Readonly */ | 256 /* Static */;
|
|
77792
77840
|
return getSelectedEffectiveModifierFlags(left, interestingFlags) === getSelectedEffectiveModifierFlags(right, interestingFlags);
|
|
77793
77841
|
}
|
|
77794
77842
|
function checkVariableDeclaration(node) {
|
|
@@ -79116,7 +79164,7 @@ function createTypeChecker(host) {
|
|
|
79116
79164
|
if (legacyDecorators && firstDecorator && some(node.members, (p) => hasStaticModifier(p) && isPrivateIdentifierClassElementDeclaration(p))) {
|
|
79117
79165
|
grammarErrorOnNode(firstDecorator, Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator);
|
|
79118
79166
|
}
|
|
79119
|
-
if (!node.name && !hasSyntacticModifier(node,
|
|
79167
|
+
if (!node.name && !hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
79120
79168
|
grammarErrorOnFirstToken(node, Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name);
|
|
79121
79169
|
}
|
|
79122
79170
|
checkClassLikeDeclaration(node);
|
|
@@ -79182,7 +79230,7 @@ function createTypeChecker(host) {
|
|
|
79182
79230
|
error(node.name || node, Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any);
|
|
79183
79231
|
} else {
|
|
79184
79232
|
const constructSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */);
|
|
79185
|
-
if (constructSignatures.some((signature) => signature.flags & 4 /* Abstract */) && !hasSyntacticModifier(node,
|
|
79233
|
+
if (constructSignatures.some((signature) => signature.flags & 4 /* Abstract */) && !hasSyntacticModifier(node, 64 /* Abstract */)) {
|
|
79186
79234
|
error(node.name || node, Diagnostics.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract);
|
|
79187
79235
|
}
|
|
79188
79236
|
}
|
|
@@ -79396,7 +79444,7 @@ function createTypeChecker(host) {
|
|
|
79396
79444
|
const signatures = getSignaturesOfType(type, 1 /* Construct */);
|
|
79397
79445
|
if (signatures.length) {
|
|
79398
79446
|
const declaration = signatures[0].declaration;
|
|
79399
|
-
if (declaration && hasEffectiveModifier(declaration,
|
|
79447
|
+
if (declaration && hasEffectiveModifier(declaration, 2 /* Private */)) {
|
|
79400
79448
|
const typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol);
|
|
79401
79449
|
if (!isNodeWithinClass(node, typeClassDeclaration)) {
|
|
79402
79450
|
error(node, Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol));
|
|
@@ -79416,7 +79464,7 @@ function createTypeChecker(host) {
|
|
|
79416
79464
|
const baseTypes = baseTypeNode && getBaseTypes(type);
|
|
79417
79465
|
const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0;
|
|
79418
79466
|
const baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
79419
|
-
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member,
|
|
79467
|
+
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16 /* Override */);
|
|
79420
79468
|
return checkMemberForOverrideModifier(
|
|
79421
79469
|
node,
|
|
79422
79470
|
staticType,
|
|
@@ -79457,7 +79505,7 @@ function createTypeChecker(host) {
|
|
|
79457
79505
|
Debug.assert(!!derived, "derived should point to something, even if it is the base class' declaration.");
|
|
79458
79506
|
if (derived === base) {
|
|
79459
79507
|
const derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol);
|
|
79460
|
-
if (baseDeclarationFlags &
|
|
79508
|
+
if (baseDeclarationFlags & 64 /* Abstract */ && (!derivedClassDecl || !hasSyntacticModifier(derivedClassDecl, 64 /* Abstract */))) {
|
|
79461
79509
|
for (const otherBaseType of getBaseTypes(type)) {
|
|
79462
79510
|
if (otherBaseType === baseType)
|
|
79463
79511
|
continue;
|
|
@@ -79500,7 +79548,7 @@ function createTypeChecker(host) {
|
|
|
79500
79548
|
}
|
|
79501
79549
|
} else {
|
|
79502
79550
|
const derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived);
|
|
79503
|
-
if (baseDeclarationFlags &
|
|
79551
|
+
if (baseDeclarationFlags & 2 /* Private */ || derivedDeclarationFlags & 2 /* Private */) {
|
|
79504
79552
|
continue;
|
|
79505
79553
|
}
|
|
79506
79554
|
let errorMessage;
|
|
@@ -79517,7 +79565,7 @@ function createTypeChecker(host) {
|
|
|
79517
79565
|
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
79518
79566
|
} else if (useDefineForClassFields) {
|
|
79519
79567
|
const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer);
|
|
79520
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags &
|
|
79568
|
+
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 */)))) {
|
|
79521
79569
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
79522
79570
|
const propName = uninitialized.name;
|
|
79523
79571
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -79544,7 +79592,7 @@ function createTypeChecker(host) {
|
|
|
79544
79592
|
}
|
|
79545
79593
|
}
|
|
79546
79594
|
function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
|
|
79547
|
-
return baseDeclarationFlags &
|
|
79595
|
+
return baseDeclarationFlags & 64 /* Abstract */ && (!isPropertyDeclaration(declaration) || !declaration.initializer) || isInterfaceDeclaration(declaration.parent);
|
|
79548
79596
|
}
|
|
79549
79597
|
function getNonInheritedProperties(type, baseTypes, properties) {
|
|
79550
79598
|
if (!length(baseTypes)) {
|
|
@@ -79609,7 +79657,7 @@ function createTypeChecker(host) {
|
|
|
79609
79657
|
}
|
|
79610
79658
|
const constructor = findConstructorDeclaration(node);
|
|
79611
79659
|
for (const member of node.members) {
|
|
79612
|
-
if (getEffectiveModifierFlags(member) &
|
|
79660
|
+
if (getEffectiveModifierFlags(member) & 128 /* Ambient */) {
|
|
79613
79661
|
continue;
|
|
79614
79662
|
}
|
|
79615
79663
|
if (!isStatic(member) && isPropertyWithoutInitializer(member)) {
|
|
@@ -80196,7 +80244,7 @@ function createTypeChecker(host) {
|
|
|
80196
80244
|
name
|
|
80197
80245
|
);
|
|
80198
80246
|
}
|
|
80199
|
-
if (isType && node.kind === 271 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node,
|
|
80247
|
+
if (isType && node.kind === 271 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 32 /* Export */)) {
|
|
80200
80248
|
error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, isolatedModulesLikeFlagName);
|
|
80201
80249
|
}
|
|
80202
80250
|
break;
|
|
@@ -80318,7 +80366,7 @@ function createTypeChecker(host) {
|
|
|
80318
80366
|
checkGrammarModifiers(node);
|
|
80319
80367
|
if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
|
|
80320
80368
|
checkImportBinding(node);
|
|
80321
|
-
if (hasSyntacticModifier(node,
|
|
80369
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
80322
80370
|
markExportAsReferenced(node);
|
|
80323
80371
|
}
|
|
80324
80372
|
if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
|
|
@@ -80567,9 +80615,9 @@ function createTypeChecker(host) {
|
|
|
80567
80615
|
error(declaration, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);
|
|
80568
80616
|
}
|
|
80569
80617
|
}
|
|
80570
|
-
const
|
|
80571
|
-
if (
|
|
80572
|
-
|
|
80618
|
+
const exports2 = getExportsOfModule(moduleSymbol);
|
|
80619
|
+
if (exports2) {
|
|
80620
|
+
exports2.forEach(({ declarations, flags }, id) => {
|
|
80573
80621
|
if (id === "__export") {
|
|
80574
80622
|
return;
|
|
80575
80623
|
}
|
|
@@ -80730,6 +80778,8 @@ function createTypeChecker(host) {
|
|
|
80730
80778
|
return checkJSDocAccessibilityModifiers(node);
|
|
80731
80779
|
case 357 /* JSDocSatisfiesTag */:
|
|
80732
80780
|
return checkJSDocSatisfiesTag(node);
|
|
80781
|
+
case 350 /* JSDocThisTag */:
|
|
80782
|
+
return checkJSDocThisTag(node);
|
|
80733
80783
|
case 199 /* IndexedAccessType */:
|
|
80734
80784
|
return checkIndexedAccessType(node);
|
|
80735
80785
|
case 200 /* MappedType */:
|
|
@@ -81956,7 +82006,7 @@ function createTypeChecker(host) {
|
|
|
81956
82006
|
return true;
|
|
81957
82007
|
}
|
|
81958
82008
|
const target = getSymbolLinks(symbol).aliasTarget;
|
|
81959
|
-
if (target && getEffectiveModifierFlags(node) &
|
|
82009
|
+
if (target && getEffectiveModifierFlags(node) & 32 /* Export */ && getSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
|
|
81960
82010
|
return true;
|
|
81961
82011
|
}
|
|
81962
82012
|
}
|
|
@@ -81981,10 +82031,10 @@ function createTypeChecker(host) {
|
|
|
81981
82031
|
return false;
|
|
81982
82032
|
}
|
|
81983
82033
|
function isRequiredInitializedParameter(parameter) {
|
|
81984
|
-
return !!strictNullChecks && !isOptionalParameter(parameter) && !isJSDocParameterTag(parameter) && !!parameter.initializer && !hasSyntacticModifier(parameter,
|
|
82034
|
+
return !!strictNullChecks && !isOptionalParameter(parameter) && !isJSDocParameterTag(parameter) && !!parameter.initializer && !hasSyntacticModifier(parameter, 31 /* ParameterPropertyModifier */);
|
|
81985
82035
|
}
|
|
81986
82036
|
function isOptionalUninitializedParameterProperty(parameter) {
|
|
81987
|
-
return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && hasSyntacticModifier(parameter,
|
|
82037
|
+
return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && hasSyntacticModifier(parameter, 31 /* ParameterPropertyModifier */);
|
|
81988
82038
|
}
|
|
81989
82039
|
function isExpandoFunctionDeclaration(node) {
|
|
81990
82040
|
const declaration = getParseTreeNode(node, isFunctionDeclaration);
|
|
@@ -82425,8 +82475,8 @@ function createTypeChecker(host) {
|
|
|
82425
82475
|
return false;
|
|
82426
82476
|
if (importTarget === file)
|
|
82427
82477
|
return false;
|
|
82428
|
-
const
|
|
82429
|
-
for (const s of arrayFrom(
|
|
82478
|
+
const exports2 = getExportsOfModule(file.symbol);
|
|
82479
|
+
for (const s of arrayFrom(exports2.values())) {
|
|
82430
82480
|
if (s.mergeId) {
|
|
82431
82481
|
const merged = getMergedSymbol(s);
|
|
82432
82482
|
if (merged.declarations) {
|
|
@@ -82838,10 +82888,10 @@ function createTypeChecker(host) {
|
|
|
82838
82888
|
return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
|
|
82839
82889
|
}
|
|
82840
82890
|
}
|
|
82841
|
-
if (flags & ~(
|
|
82891
|
+
if (flags & ~(2080 /* ExportDefault */ | 32768 /* Decorator */)) {
|
|
82842
82892
|
return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here);
|
|
82843
82893
|
}
|
|
82844
|
-
if (hasLeadingDecorators && flags &
|
|
82894
|
+
if (hasLeadingDecorators && flags & 98303 /* Modifier */) {
|
|
82845
82895
|
Debug.assertIsDefined(firstDecorator);
|
|
82846
82896
|
const sourceFile = getSourceFileOfNode(modifier);
|
|
82847
82897
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
@@ -82853,10 +82903,10 @@ function createTypeChecker(host) {
|
|
|
82853
82903
|
}
|
|
82854
82904
|
return false;
|
|
82855
82905
|
}
|
|
82856
|
-
flags |=
|
|
82857
|
-
if (!(flags &
|
|
82906
|
+
flags |= 32768 /* Decorator */;
|
|
82907
|
+
if (!(flags & 98303 /* Modifier */)) {
|
|
82858
82908
|
hasLeadingDecorators = true;
|
|
82859
|
-
} else if (flags &
|
|
82909
|
+
} else if (flags & 32 /* Export */) {
|
|
82860
82910
|
sawExportBeforeDecorators = true;
|
|
82861
82911
|
}
|
|
82862
82912
|
firstDecorator ?? (firstDecorator = modifier);
|
|
@@ -82885,39 +82935,39 @@ function createTypeChecker(host) {
|
|
|
82885
82935
|
}
|
|
82886
82936
|
break;
|
|
82887
82937
|
case 164 /* OverrideKeyword */:
|
|
82888
|
-
if (flags &
|
|
82938
|
+
if (flags & 16 /* Override */) {
|
|
82889
82939
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override");
|
|
82890
|
-
} else if (flags &
|
|
82940
|
+
} else if (flags & 128 /* Ambient */) {
|
|
82891
82941
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare");
|
|
82892
|
-
} else if (flags &
|
|
82942
|
+
} else if (flags & 8 /* Readonly */) {
|
|
82893
82943
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly");
|
|
82894
|
-
} else if (flags &
|
|
82944
|
+
} else if (flags & 512 /* Accessor */) {
|
|
82895
82945
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor");
|
|
82896
|
-
} else if (flags &
|
|
82946
|
+
} else if (flags & 1024 /* Async */) {
|
|
82897
82947
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async");
|
|
82898
82948
|
}
|
|
82899
|
-
flags |=
|
|
82949
|
+
flags |= 16 /* Override */;
|
|
82900
82950
|
lastOverride = modifier;
|
|
82901
82951
|
break;
|
|
82902
82952
|
case 125 /* PublicKeyword */:
|
|
82903
82953
|
case 124 /* ProtectedKeyword */:
|
|
82904
82954
|
case 123 /* PrivateKeyword */:
|
|
82905
82955
|
const text = visibilityToString(modifierToFlag(modifier.kind));
|
|
82906
|
-
if (flags &
|
|
82956
|
+
if (flags & 7 /* AccessibilityModifier */) {
|
|
82907
82957
|
return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen);
|
|
82908
|
-
} else if (flags &
|
|
82958
|
+
} else if (flags & 16 /* Override */) {
|
|
82909
82959
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override");
|
|
82910
|
-
} else if (flags &
|
|
82960
|
+
} else if (flags & 256 /* Static */) {
|
|
82911
82961
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static");
|
|
82912
|
-
} else if (flags &
|
|
82962
|
+
} else if (flags & 512 /* Accessor */) {
|
|
82913
82963
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor");
|
|
82914
|
-
} else if (flags &
|
|
82964
|
+
} else if (flags & 8 /* Readonly */) {
|
|
82915
82965
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly");
|
|
82916
|
-
} else if (flags &
|
|
82966
|
+
} else if (flags & 1024 /* Async */) {
|
|
82917
82967
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
|
|
82918
82968
|
} else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 312 /* SourceFile */) {
|
|
82919
82969
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
|
|
82920
|
-
} else if (flags &
|
|
82970
|
+
} else if (flags & 64 /* Abstract */) {
|
|
82921
82971
|
if (modifier.kind === 123 /* PrivateKeyword */) {
|
|
82922
82972
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract");
|
|
82923
82973
|
} else {
|
|
@@ -82929,60 +82979,60 @@ function createTypeChecker(host) {
|
|
|
82929
82979
|
flags |= modifierToFlag(modifier.kind);
|
|
82930
82980
|
break;
|
|
82931
82981
|
case 126 /* StaticKeyword */:
|
|
82932
|
-
if (flags &
|
|
82982
|
+
if (flags & 256 /* Static */) {
|
|
82933
82983
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static");
|
|
82934
|
-
} else if (flags &
|
|
82984
|
+
} else if (flags & 8 /* Readonly */) {
|
|
82935
82985
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly");
|
|
82936
|
-
} else if (flags &
|
|
82986
|
+
} else if (flags & 1024 /* Async */) {
|
|
82937
82987
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
|
|
82938
|
-
} else if (flags &
|
|
82988
|
+
} else if (flags & 512 /* Accessor */) {
|
|
82939
82989
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor");
|
|
82940
82990
|
} else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 312 /* SourceFile */) {
|
|
82941
82991
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
|
|
82942
82992
|
} else if (node.kind === 169 /* Parameter */) {
|
|
82943
82993
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
|
|
82944
|
-
} else if (flags &
|
|
82994
|
+
} else if (flags & 64 /* Abstract */) {
|
|
82945
82995
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
|
|
82946
|
-
} else if (flags &
|
|
82996
|
+
} else if (flags & 16 /* Override */) {
|
|
82947
82997
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override");
|
|
82948
82998
|
}
|
|
82949
|
-
flags |=
|
|
82999
|
+
flags |= 256 /* Static */;
|
|
82950
83000
|
lastStatic = modifier;
|
|
82951
83001
|
break;
|
|
82952
83002
|
case 129 /* AccessorKeyword */:
|
|
82953
|
-
if (flags &
|
|
83003
|
+
if (flags & 512 /* Accessor */) {
|
|
82954
83004
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor");
|
|
82955
|
-
} else if (flags &
|
|
83005
|
+
} else if (flags & 8 /* Readonly */) {
|
|
82956
83006
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly");
|
|
82957
|
-
} else if (flags &
|
|
83007
|
+
} else if (flags & 128 /* Ambient */) {
|
|
82958
83008
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare");
|
|
82959
83009
|
} else if (node.kind !== 172 /* PropertyDeclaration */) {
|
|
82960
83010
|
return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration);
|
|
82961
83011
|
}
|
|
82962
|
-
flags |=
|
|
83012
|
+
flags |= 512 /* Accessor */;
|
|
82963
83013
|
break;
|
|
82964
83014
|
case 148 /* ReadonlyKeyword */:
|
|
82965
|
-
if (flags &
|
|
83015
|
+
if (flags & 8 /* Readonly */) {
|
|
82966
83016
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly");
|
|
82967
83017
|
} else if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 181 /* IndexSignature */ && node.kind !== 169 /* Parameter */) {
|
|
82968
83018
|
return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
|
|
82969
|
-
} else if (flags &
|
|
83019
|
+
} else if (flags & 512 /* Accessor */) {
|
|
82970
83020
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor");
|
|
82971
83021
|
}
|
|
82972
|
-
flags |=
|
|
83022
|
+
flags |= 8 /* Readonly */;
|
|
82973
83023
|
break;
|
|
82974
83024
|
case 95 /* ExportKeyword */:
|
|
82975
83025
|
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
|
|
82976
83026
|
node.kind !== 267 /* ModuleDeclaration */ && node.parent.kind === 312 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
|
|
82977
83027
|
return grammarErrorOnNode(modifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
|
|
82978
83028
|
}
|
|
82979
|
-
if (flags &
|
|
83029
|
+
if (flags & 32 /* Export */) {
|
|
82980
83030
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export");
|
|
82981
|
-
} else if (flags &
|
|
83031
|
+
} else if (flags & 128 /* Ambient */) {
|
|
82982
83032
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare");
|
|
82983
|
-
} else if (flags &
|
|
83033
|
+
} else if (flags & 64 /* Abstract */) {
|
|
82984
83034
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract");
|
|
82985
|
-
} else if (flags &
|
|
83035
|
+
} else if (flags & 1024 /* Async */) {
|
|
82986
83036
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
|
|
82987
83037
|
} else if (isClassLike(node.parent)) {
|
|
82988
83038
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export");
|
|
@@ -82993,7 +83043,7 @@ function createTypeChecker(host) {
|
|
|
82993
83043
|
} else if (blockScopeKind === 6 /* AwaitUsing */) {
|
|
82994
83044
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "export");
|
|
82995
83045
|
}
|
|
82996
|
-
flags |=
|
|
83046
|
+
flags |= 32 /* Export */;
|
|
82997
83047
|
break;
|
|
82998
83048
|
case 90 /* DefaultKeyword */:
|
|
82999
83049
|
const container = node.parent.kind === 312 /* SourceFile */ ? node.parent : node.parent.parent;
|
|
@@ -83003,19 +83053,19 @@ function createTypeChecker(host) {
|
|
|
83003
83053
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "default");
|
|
83004
83054
|
} else if (blockScopeKind === 6 /* AwaitUsing */) {
|
|
83005
83055
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "default");
|
|
83006
|
-
} else if (!(flags &
|
|
83056
|
+
} else if (!(flags & 32 /* Export */)) {
|
|
83007
83057
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default");
|
|
83008
83058
|
} else if (sawExportBeforeDecorators) {
|
|
83009
83059
|
return grammarErrorOnNode(firstDecorator, Diagnostics.Decorators_are_not_valid_here);
|
|
83010
83060
|
}
|
|
83011
|
-
flags |=
|
|
83061
|
+
flags |= 2048 /* Default */;
|
|
83012
83062
|
break;
|
|
83013
83063
|
case 138 /* DeclareKeyword */:
|
|
83014
|
-
if (flags &
|
|
83064
|
+
if (flags & 128 /* Ambient */) {
|
|
83015
83065
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare");
|
|
83016
|
-
} else if (flags &
|
|
83066
|
+
} else if (flags & 1024 /* Async */) {
|
|
83017
83067
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
|
|
83018
|
-
} else if (flags &
|
|
83068
|
+
} else if (flags & 16 /* Override */) {
|
|
83019
83069
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override");
|
|
83020
83070
|
} else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) {
|
|
83021
83071
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare");
|
|
@@ -83029,62 +83079,62 @@ function createTypeChecker(host) {
|
|
|
83029
83079
|
return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
|
|
83030
83080
|
} else if (isPrivateIdentifierClassElementDeclaration(node)) {
|
|
83031
83081
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
|
|
83032
|
-
} else if (flags &
|
|
83082
|
+
} else if (flags & 512 /* Accessor */) {
|
|
83033
83083
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor");
|
|
83034
83084
|
}
|
|
83035
|
-
flags |=
|
|
83085
|
+
flags |= 128 /* Ambient */;
|
|
83036
83086
|
lastDeclare = modifier;
|
|
83037
83087
|
break;
|
|
83038
83088
|
case 128 /* AbstractKeyword */:
|
|
83039
|
-
if (flags &
|
|
83089
|
+
if (flags & 64 /* Abstract */) {
|
|
83040
83090
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract");
|
|
83041
83091
|
}
|
|
83042
83092
|
if (node.kind !== 263 /* ClassDeclaration */ && node.kind !== 185 /* ConstructorType */) {
|
|
83043
83093
|
if (node.kind !== 174 /* MethodDeclaration */ && node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 177 /* GetAccessor */ && node.kind !== 178 /* SetAccessor */) {
|
|
83044
83094
|
return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
|
|
83045
83095
|
}
|
|
83046
|
-
if (!(node.parent.kind === 263 /* ClassDeclaration */ && hasSyntacticModifier(node.parent,
|
|
83096
|
+
if (!(node.parent.kind === 263 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 64 /* Abstract */))) {
|
|
83047
83097
|
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;
|
|
83048
83098
|
return grammarErrorOnNode(modifier, message);
|
|
83049
83099
|
}
|
|
83050
|
-
if (flags &
|
|
83100
|
+
if (flags & 256 /* Static */) {
|
|
83051
83101
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
|
|
83052
83102
|
}
|
|
83053
|
-
if (flags &
|
|
83103
|
+
if (flags & 2 /* Private */) {
|
|
83054
83104
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract");
|
|
83055
83105
|
}
|
|
83056
|
-
if (flags &
|
|
83106
|
+
if (flags & 1024 /* Async */ && lastAsync) {
|
|
83057
83107
|
return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract");
|
|
83058
83108
|
}
|
|
83059
|
-
if (flags &
|
|
83109
|
+
if (flags & 16 /* Override */) {
|
|
83060
83110
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override");
|
|
83061
83111
|
}
|
|
83062
|
-
if (flags &
|
|
83112
|
+
if (flags & 512 /* Accessor */) {
|
|
83063
83113
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor");
|
|
83064
83114
|
}
|
|
83065
83115
|
}
|
|
83066
83116
|
if (isNamedDeclaration(node) && node.name.kind === 81 /* PrivateIdentifier */) {
|
|
83067
83117
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract");
|
|
83068
83118
|
}
|
|
83069
|
-
flags |=
|
|
83119
|
+
flags |= 64 /* Abstract */;
|
|
83070
83120
|
break;
|
|
83071
83121
|
case 134 /* AsyncKeyword */:
|
|
83072
|
-
if (flags &
|
|
83122
|
+
if (flags & 1024 /* Async */) {
|
|
83073
83123
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async");
|
|
83074
|
-
} else if (flags &
|
|
83124
|
+
} else if (flags & 128 /* Ambient */ || node.parent.flags & 33554432 /* Ambient */) {
|
|
83075
83125
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
|
|
83076
83126
|
} else if (node.kind === 169 /* Parameter */) {
|
|
83077
83127
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
|
|
83078
83128
|
}
|
|
83079
|
-
if (flags &
|
|
83129
|
+
if (flags & 64 /* Abstract */) {
|
|
83080
83130
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract");
|
|
83081
83131
|
}
|
|
83082
|
-
flags |=
|
|
83132
|
+
flags |= 1024 /* Async */;
|
|
83083
83133
|
lastAsync = modifier;
|
|
83084
83134
|
break;
|
|
83085
83135
|
case 103 /* InKeyword */:
|
|
83086
83136
|
case 147 /* OutKeyword */:
|
|
83087
|
-
const inOutFlag = modifier.kind === 103 /* InKeyword */ ?
|
|
83137
|
+
const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */;
|
|
83088
83138
|
const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out";
|
|
83089
83139
|
if (node.kind !== 168 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
|
|
83090
83140
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
|
|
@@ -83092,7 +83142,7 @@ function createTypeChecker(host) {
|
|
|
83092
83142
|
if (flags & inOutFlag) {
|
|
83093
83143
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText);
|
|
83094
83144
|
}
|
|
83095
|
-
if (inOutFlag &
|
|
83145
|
+
if (inOutFlag & 8192 /* In */ && flags & 16384 /* Out */) {
|
|
83096
83146
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out");
|
|
83097
83147
|
}
|
|
83098
83148
|
flags |= inOutFlag;
|
|
@@ -83101,24 +83151,24 @@ function createTypeChecker(host) {
|
|
|
83101
83151
|
}
|
|
83102
83152
|
}
|
|
83103
83153
|
if (node.kind === 176 /* Constructor */) {
|
|
83104
|
-
if (flags &
|
|
83154
|
+
if (flags & 256 /* Static */) {
|
|
83105
83155
|
return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
|
|
83106
83156
|
}
|
|
83107
|
-
if (flags &
|
|
83157
|
+
if (flags & 16 /* Override */) {
|
|
83108
83158
|
return grammarErrorOnNode(lastOverride, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "override");
|
|
83109
83159
|
}
|
|
83110
|
-
if (flags &
|
|
83160
|
+
if (flags & 1024 /* Async */) {
|
|
83111
83161
|
return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async");
|
|
83112
83162
|
}
|
|
83113
83163
|
return false;
|
|
83114
|
-
} else if ((node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */) && flags &
|
|
83164
|
+
} else if ((node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */) && flags & 128 /* Ambient */) {
|
|
83115
83165
|
return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
|
|
83116
|
-
} else if (node.kind === 169 /* Parameter */ && flags &
|
|
83166
|
+
} else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) {
|
|
83117
83167
|
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);
|
|
83118
|
-
} else if (node.kind === 169 /* Parameter */ && flags &
|
|
83168
|
+
} else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && node.dotDotDotToken) {
|
|
83119
83169
|
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
|
|
83120
83170
|
}
|
|
83121
|
-
if (flags &
|
|
83171
|
+
if (flags & 1024 /* Async */) {
|
|
83122
83172
|
return checkGrammarAsyncModifier(node, lastAsync);
|
|
83123
83173
|
}
|
|
83124
83174
|
return false;
|
|
@@ -83638,12 +83688,12 @@ function createTypeChecker(host) {
|
|
|
83638
83688
|
if (languageVersion < 2 /* ES2015 */ && isPrivateIdentifier(accessor.name)) {
|
|
83639
83689
|
return grammarErrorOnNode(accessor.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
|
|
83640
83690
|
}
|
|
83641
|
-
if (accessor.body === void 0 && !hasSyntacticModifier(accessor,
|
|
83691
|
+
if (accessor.body === void 0 && !hasSyntacticModifier(accessor, 64 /* Abstract */)) {
|
|
83642
83692
|
return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, Diagnostics._0_expected, "{");
|
|
83643
83693
|
}
|
|
83644
83694
|
}
|
|
83645
83695
|
if (accessor.body) {
|
|
83646
|
-
if (hasSyntacticModifier(accessor,
|
|
83696
|
+
if (hasSyntacticModifier(accessor, 64 /* Abstract */)) {
|
|
83647
83697
|
return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation);
|
|
83648
83698
|
}
|
|
83649
83699
|
if (accessor.parent.kind === 187 /* TypeLiteral */ || accessor.parent.kind === 264 /* InterfaceDeclaration */) {
|
|
@@ -83715,7 +83765,7 @@ function createTypeChecker(host) {
|
|
|
83715
83765
|
}
|
|
83716
83766
|
break;
|
|
83717
83767
|
case 171 /* PropertySignature */:
|
|
83718
|
-
if (!hasSyntacticModifier(parent,
|
|
83768
|
+
if (!hasSyntacticModifier(parent, 8 /* Readonly */)) {
|
|
83719
83769
|
return grammarErrorOnNode(parent.name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);
|
|
83720
83770
|
}
|
|
83721
83771
|
break;
|
|
@@ -83885,7 +83935,7 @@ function createTypeChecker(host) {
|
|
|
83885
83935
|
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;
|
|
83886
83936
|
return grammarErrorOnNode(node.exclamationToken, message);
|
|
83887
83937
|
}
|
|
83888
|
-
if ((moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && moduleKind !== 4 /* System */ && !(node.parent.parent.flags & 33554432 /* Ambient */) && hasSyntacticModifier(node.parent.parent,
|
|
83938
|
+
if ((moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && moduleKind !== 4 /* System */ && !(node.parent.parent.flags & 33554432 /* Ambient */) && hasSyntacticModifier(node.parent.parent, 32 /* Export */)) {
|
|
83889
83939
|
checkESModuleMarker(node.name);
|
|
83890
83940
|
}
|
|
83891
83941
|
return !!blockScopeKind && checkGrammarNameInLetOrConstDeclarations(node.name);
|
|
@@ -84075,7 +84125,7 @@ function createTypeChecker(host) {
|
|
|
84075
84125
|
}
|
|
84076
84126
|
}
|
|
84077
84127
|
function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {
|
|
84078
|
-
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,
|
|
84128
|
+
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 */)) {
|
|
84079
84129
|
return false;
|
|
84080
84130
|
}
|
|
84081
84131
|
return grammarErrorOnFirstToken(node, Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier);
|
|
@@ -84390,12 +84440,14 @@ var SymbolTrackerImpl = class _SymbolTrackerImpl {
|
|
|
84390
84440
|
this.canTrackSymbol = !!((_a = this.inner) == null ? void 0 : _a.trackSymbol);
|
|
84391
84441
|
}
|
|
84392
84442
|
trackSymbol(symbol, enclosingDeclaration, meaning) {
|
|
84393
|
-
var _a;
|
|
84443
|
+
var _a, _b;
|
|
84394
84444
|
if (((_a = this.inner) == null ? void 0 : _a.trackSymbol) && !this.disableTrackSymbol) {
|
|
84395
84445
|
if (this.inner.trackSymbol(symbol, enclosingDeclaration, meaning)) {
|
|
84396
84446
|
this.onDiagnosticReported();
|
|
84397
84447
|
return true;
|
|
84398
84448
|
}
|
|
84449
|
+
if (!(symbol.flags & 262144 /* TypeParameter */))
|
|
84450
|
+
((_b = this.context).trackedSymbols ?? (_b.trackedSymbols = [])).push([symbol, enclosingDeclaration, meaning]);
|
|
84399
84451
|
}
|
|
84400
84452
|
return false;
|
|
84401
84453
|
}
|
|
@@ -86280,15 +86332,15 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
86280
86332
|
}
|
|
86281
86333
|
break;
|
|
86282
86334
|
case 243 /* VariableStatement */:
|
|
86283
|
-
if (hasSyntacticModifier(node,
|
|
86335
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
86284
86336
|
for (const decl of node.declarationList.declarations) {
|
|
86285
86337
|
exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings);
|
|
86286
86338
|
}
|
|
86287
86339
|
}
|
|
86288
86340
|
break;
|
|
86289
86341
|
case 262 /* FunctionDeclaration */:
|
|
86290
|
-
if (hasSyntacticModifier(node,
|
|
86291
|
-
if (hasSyntacticModifier(node,
|
|
86342
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
86343
|
+
if (hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
86292
86344
|
if (!hasExportDefault) {
|
|
86293
86345
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));
|
|
86294
86346
|
hasExportDefault = true;
|
|
@@ -86304,8 +86356,8 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
86304
86356
|
}
|
|
86305
86357
|
break;
|
|
86306
86358
|
case 263 /* ClassDeclaration */:
|
|
86307
|
-
if (hasSyntacticModifier(node,
|
|
86308
|
-
if (hasSyntacticModifier(node,
|
|
86359
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
86360
|
+
if (hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
86309
86361
|
if (!hasExportDefault) {
|
|
86310
86362
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));
|
|
86311
86363
|
hasExportDefault = true;
|
|
@@ -87170,7 +87222,7 @@ function injectClassThisAssignmentIfMissing(factory2, node, classThis, thisExpre
|
|
|
87170
87222
|
// src/compiler/transformers/namedEvaluation.ts
|
|
87171
87223
|
function getAssignedNameOfIdentifier(factory2, name, expression) {
|
|
87172
87224
|
const original = getOriginalNode(skipOuterExpressions(expression));
|
|
87173
|
-
if ((isClassDeclaration(original) || isFunctionDeclaration(original)) && !original.name && hasSyntacticModifier(original,
|
|
87225
|
+
if ((isClassDeclaration(original) || isFunctionDeclaration(original)) && !original.name && hasSyntacticModifier(original, 2048 /* Default */)) {
|
|
87174
87226
|
return factory2.createStringLiteral("default");
|
|
87175
87227
|
}
|
|
87176
87228
|
return factory2.createStringLiteralFromNode(name);
|
|
@@ -87524,13 +87576,13 @@ function transformTypeScript(context) {
|
|
|
87524
87576
|
break;
|
|
87525
87577
|
case 263 /* ClassDeclaration */:
|
|
87526
87578
|
case 262 /* FunctionDeclaration */:
|
|
87527
|
-
if (hasSyntacticModifier(node,
|
|
87579
|
+
if (hasSyntacticModifier(node, 128 /* Ambient */)) {
|
|
87528
87580
|
break;
|
|
87529
87581
|
}
|
|
87530
87582
|
if (node.name) {
|
|
87531
87583
|
recordEmittedDeclarationInScope(node);
|
|
87532
87584
|
} else {
|
|
87533
|
-
Debug.assert(node.kind === 263 /* ClassDeclaration */ || hasSyntacticModifier(node,
|
|
87585
|
+
Debug.assert(node.kind === 263 /* ClassDeclaration */ || hasSyntacticModifier(node, 2048 /* Default */));
|
|
87534
87586
|
}
|
|
87535
87587
|
break;
|
|
87536
87588
|
}
|
|
@@ -87585,7 +87637,7 @@ function transformTypeScript(context) {
|
|
|
87585
87637
|
function namespaceElementVisitorWorker(node) {
|
|
87586
87638
|
if (node.kind === 278 /* ExportDeclaration */ || node.kind === 272 /* ImportDeclaration */ || node.kind === 273 /* ImportClause */ || node.kind === 271 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 283 /* ExternalModuleReference */) {
|
|
87587
87639
|
return void 0;
|
|
87588
|
-
} else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node,
|
|
87640
|
+
} else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node, 32 /* Export */)) {
|
|
87589
87641
|
return visitTypeScript(node);
|
|
87590
87642
|
}
|
|
87591
87643
|
return node;
|
|
@@ -87643,7 +87695,7 @@ function transformTypeScript(context) {
|
|
|
87643
87695
|
function modifierVisitor(node) {
|
|
87644
87696
|
if (isDecorator(node))
|
|
87645
87697
|
return void 0;
|
|
87646
|
-
if (modifierToFlag(node.kind) &
|
|
87698
|
+
if (modifierToFlag(node.kind) & 28895 /* TypeScriptModifier */) {
|
|
87647
87699
|
return void 0;
|
|
87648
87700
|
} else if (currentNamespace && node.kind === 95 /* ExportKeyword */) {
|
|
87649
87701
|
return void 0;
|
|
@@ -87651,7 +87703,7 @@ function transformTypeScript(context) {
|
|
|
87651
87703
|
return node;
|
|
87652
87704
|
}
|
|
87653
87705
|
function visitTypeScript(node) {
|
|
87654
|
-
if (isStatement(node) && hasSyntacticModifier(node,
|
|
87706
|
+
if (isStatement(node) && hasSyntacticModifier(node, 128 /* Ambient */)) {
|
|
87655
87707
|
return factory2.createNotEmittedStatement(node);
|
|
87656
87708
|
}
|
|
87657
87709
|
switch (node.kind) {
|
|
@@ -88141,7 +88193,7 @@ function transformTypeScript(context) {
|
|
|
88141
88193
|
return !nodeIsMissing(node.body);
|
|
88142
88194
|
}
|
|
88143
88195
|
function visitPropertyDeclaration(node, parent) {
|
|
88144
|
-
const isAmbient = node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node,
|
|
88196
|
+
const isAmbient = node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node, 64 /* Abstract */);
|
|
88145
88197
|
if (isAmbient && !(legacyDecorators && hasDecorators(node))) {
|
|
88146
88198
|
return void 0;
|
|
88147
88199
|
}
|
|
@@ -88150,7 +88202,7 @@ function transformTypeScript(context) {
|
|
|
88150
88202
|
if (isAmbient) {
|
|
88151
88203
|
return factory2.updatePropertyDeclaration(
|
|
88152
88204
|
node,
|
|
88153
|
-
concatenate(modifiers, factory2.createModifiersFromModifierFlags(
|
|
88205
|
+
concatenate(modifiers, factory2.createModifiersFromModifierFlags(128 /* Ambient */)),
|
|
88154
88206
|
Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)),
|
|
88155
88207
|
/*questionOrExclamationToken*/
|
|
88156
88208
|
void 0,
|
|
@@ -88313,7 +88365,7 @@ function transformTypeScript(context) {
|
|
|
88313
88365
|
);
|
|
88314
88366
|
}
|
|
88315
88367
|
function shouldEmitAccessorDeclaration(node) {
|
|
88316
|
-
return !(nodeIsMissing(node.body) && hasSyntacticModifier(node,
|
|
88368
|
+
return !(nodeIsMissing(node.body) && hasSyntacticModifier(node, 64 /* Abstract */));
|
|
88317
88369
|
}
|
|
88318
88370
|
function visitGetAccessor(node, parent) {
|
|
88319
88371
|
if (!(node.transformFlags & 1 /* ContainsTypeScript */)) {
|
|
@@ -89046,16 +89098,16 @@ function transformTypeScript(context) {
|
|
|
89046
89098
|
}
|
|
89047
89099
|
}
|
|
89048
89100
|
function isExportOfNamespace(node) {
|
|
89049
|
-
return currentNamespace !== void 0 && hasSyntacticModifier(node,
|
|
89101
|
+
return currentNamespace !== void 0 && hasSyntacticModifier(node, 32 /* Export */);
|
|
89050
89102
|
}
|
|
89051
89103
|
function isExternalModuleExport(node) {
|
|
89052
|
-
return currentNamespace === void 0 && hasSyntacticModifier(node,
|
|
89104
|
+
return currentNamespace === void 0 && hasSyntacticModifier(node, 32 /* Export */);
|
|
89053
89105
|
}
|
|
89054
89106
|
function isNamedExternalModuleExport(node) {
|
|
89055
|
-
return isExternalModuleExport(node) && !hasSyntacticModifier(node,
|
|
89107
|
+
return isExternalModuleExport(node) && !hasSyntacticModifier(node, 2048 /* Default */);
|
|
89056
89108
|
}
|
|
89057
89109
|
function isDefaultExternalModuleExport(node) {
|
|
89058
|
-
return isExternalModuleExport(node) && hasSyntacticModifier(node,
|
|
89110
|
+
return isExternalModuleExport(node) && hasSyntacticModifier(node, 2048 /* Default */);
|
|
89059
89111
|
}
|
|
89060
89112
|
function createExportMemberAssignmentStatement(node) {
|
|
89061
89113
|
const expression = factory2.createAssignment(
|
|
@@ -90388,8 +90440,8 @@ function transformClassFields(context) {
|
|
|
90388
90440
|
getClassLexicalEnvironment().classThis = node.emitNode.classThis;
|
|
90389
90441
|
}
|
|
90390
90442
|
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */;
|
|
90391
|
-
const isExport = hasSyntacticModifier(node,
|
|
90392
|
-
const isDefault = hasSyntacticModifier(node,
|
|
90443
|
+
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
90444
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
90393
90445
|
let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
|
|
90394
90446
|
const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause);
|
|
90395
90447
|
const { members, prologue } = transformClassMembers(node);
|
|
@@ -90935,7 +90987,7 @@ function transformClassFields(context) {
|
|
|
90935
90987
|
return void 0;
|
|
90936
90988
|
}
|
|
90937
90989
|
const propertyOriginalNode = getOriginalNode(property);
|
|
90938
|
-
if (hasSyntacticModifier(propertyOriginalNode,
|
|
90990
|
+
if (hasSyntacticModifier(propertyOriginalNode, 64 /* Abstract */)) {
|
|
90939
90991
|
return void 0;
|
|
90940
90992
|
}
|
|
90941
90993
|
let initializer = visitNode(property.initializer, visitor, isExpression);
|
|
@@ -91971,8 +92023,8 @@ function transformLegacyDecorators(context) {
|
|
|
91971
92023
|
return addRange([updated], decorationStatements);
|
|
91972
92024
|
}
|
|
91973
92025
|
function transformClassDeclarationWithClassDecorators(node, name) {
|
|
91974
|
-
const isExport = hasSyntacticModifier(node,
|
|
91975
|
-
const isDefault = hasSyntacticModifier(node,
|
|
92026
|
+
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
92027
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
91976
92028
|
const modifiers = visitNodes2(node.modifiers, (node2) => isExportOrDefaultModifier(node2) || isDecorator(node2) ? void 0 : node2, isModifierLike);
|
|
91977
92029
|
const location = moveRangePastModifiers(node);
|
|
91978
92030
|
const classAlias = getClassAliasIfNeeded(node);
|
|
@@ -91993,7 +92045,7 @@ function transformLegacyDecorators(context) {
|
|
|
91993
92045
|
let members = visitNodes2(node.members, visitor, isClassElement);
|
|
91994
92046
|
let decorationStatements = [];
|
|
91995
92047
|
({ members, decorationStatements } = transformDecoratorsOfClassElements(node, members));
|
|
91996
|
-
const assignClassAliasInStaticBlock = languageVersion >= 9 /* ES2022 */ && !!classAlias && some(members, (member) => isPropertyDeclaration(member) && hasSyntacticModifier(member,
|
|
92048
|
+
const assignClassAliasInStaticBlock = languageVersion >= 9 /* ES2022 */ && !!classAlias && some(members, (member) => isPropertyDeclaration(member) && hasSyntacticModifier(member, 256 /* Static */) || isClassStaticBlockDeclaration(member));
|
|
91997
92049
|
if (assignClassAliasInStaticBlock) {
|
|
91998
92050
|
members = setTextRange(
|
|
91999
92051
|
factory2.createNodeArray([
|
|
@@ -92124,7 +92176,7 @@ function transformLegacyDecorators(context) {
|
|
|
92124
92176
|
);
|
|
92125
92177
|
}
|
|
92126
92178
|
function visitPropertyDeclaration(node) {
|
|
92127
|
-
if (node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node,
|
|
92179
|
+
if (node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node, 128 /* Ambient */)) {
|
|
92128
92180
|
return void 0;
|
|
92129
92181
|
}
|
|
92130
92182
|
return finishClassElement(
|
|
@@ -92212,7 +92264,7 @@ function transformLegacyDecorators(context) {
|
|
|
92212
92264
|
const memberName = getExpressionForPropertyName(
|
|
92213
92265
|
member,
|
|
92214
92266
|
/*generateNameForComputedPropertyName*/
|
|
92215
|
-
!hasSyntacticModifier(member,
|
|
92267
|
+
!hasSyntacticModifier(member, 128 /* Ambient */)
|
|
92216
92268
|
);
|
|
92217
92269
|
const descriptor = languageVersion > 0 /* ES3 */ ? isPropertyDeclaration(member) && !hasAccessorModifier(member) ? factory2.createVoidZero() : factory2.createNull() : void 0;
|
|
92218
92270
|
const helper = emitHelpers().createDecorateHelper(
|
|
@@ -92995,8 +93047,8 @@ function transformESDecorators(context) {
|
|
|
92995
93047
|
const statements = [];
|
|
92996
93048
|
const originalClass = getOriginalNode(node, isClassLike) ?? node;
|
|
92997
93049
|
const className = originalClass.name ? factory2.createStringLiteralFromNode(originalClass.name) : factory2.createStringLiteral("default");
|
|
92998
|
-
const isExport = hasSyntacticModifier(node,
|
|
92999
|
-
const isDefault = hasSyntacticModifier(node,
|
|
93050
|
+
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
93051
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
93000
93052
|
if (!node.name) {
|
|
93001
93053
|
node = injectClassNamedEvaluationHelperBlockIfMissing(context, node, className);
|
|
93002
93054
|
}
|
|
@@ -95307,7 +95359,7 @@ function transformES2018(context) {
|
|
|
95307
95359
|
return visitEachChild(node, visitor, context);
|
|
95308
95360
|
}
|
|
95309
95361
|
function visitVariableStatement(node) {
|
|
95310
|
-
if (hasSyntacticModifier(node,
|
|
95362
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
95311
95363
|
const savedExportedVariableStatement = exportedVariableStatement;
|
|
95312
95364
|
exportedVariableStatement = true;
|
|
95313
95365
|
const visited = visitEachChild(node, visitor, context);
|
|
@@ -96519,7 +96571,7 @@ function transformESNext(context) {
|
|
|
96519
96571
|
addRange(topLevelStatements, endLexicalEnvironment());
|
|
96520
96572
|
if (exportVars.length) {
|
|
96521
96573
|
topLevelStatements.push(factory2.createVariableStatement(
|
|
96522
|
-
factory2.createModifiersFromModifierFlags(
|
|
96574
|
+
factory2.createModifiersFromModifierFlags(32 /* Export */),
|
|
96523
96575
|
factory2.createVariableDeclarationList(
|
|
96524
96576
|
exportVars,
|
|
96525
96577
|
1 /* Let */
|
|
@@ -96816,8 +96868,8 @@ function transformESNext(context) {
|
|
|
96816
96868
|
if (!node.name && defaultExportBinding) {
|
|
96817
96869
|
return node;
|
|
96818
96870
|
}
|
|
96819
|
-
const isExported = hasSyntacticModifier(node,
|
|
96820
|
-
const isDefault = hasSyntacticModifier(node,
|
|
96871
|
+
const isExported = hasSyntacticModifier(node, 32 /* Export */);
|
|
96872
|
+
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
96821
96873
|
let expression = factory2.converters.convertToClassExpression(node);
|
|
96822
96874
|
if (node.name) {
|
|
96823
96875
|
hoistBindingIdentifier(
|
|
@@ -96865,7 +96917,7 @@ function transformESNext(context) {
|
|
|
96865
96917
|
}
|
|
96866
96918
|
function hoistVariableStatement(node) {
|
|
96867
96919
|
let expressions;
|
|
96868
|
-
const isExported = hasSyntacticModifier(node,
|
|
96920
|
+
const isExported = hasSyntacticModifier(node, 32 /* Export */);
|
|
96869
96921
|
for (const variable of node.declarationList.declarations) {
|
|
96870
96922
|
hoistBindingElement(variable, isExported, variable);
|
|
96871
96923
|
if (variable.initializer) {
|
|
@@ -98397,8 +98449,8 @@ function transformES2015(context) {
|
|
|
98397
98449
|
setTextRange(statement, node);
|
|
98398
98450
|
startOnNewLine(statement);
|
|
98399
98451
|
statements.push(statement);
|
|
98400
|
-
if (hasSyntacticModifier(node,
|
|
98401
|
-
const exportStatement = hasSyntacticModifier(node,
|
|
98452
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
98453
|
+
const exportStatement = hasSyntacticModifier(node, 2048 /* Default */) ? factory2.createExportDefault(factory2.getLocalName(node)) : factory2.createExternalModuleExport(factory2.getLocalName(node));
|
|
98402
98454
|
setOriginalNode(exportStatement, statement);
|
|
98403
98455
|
statements.push(exportStatement);
|
|
98404
98456
|
}
|
|
@@ -99590,7 +99642,7 @@ function transformES2015(context) {
|
|
|
99590
99642
|
return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getInternalEmitFlags(node.declarationList.declarations[0].initializer) & 1 /* TypeScriptClassWrapper */);
|
|
99591
99643
|
}
|
|
99592
99644
|
function visitVariableStatement(node) {
|
|
99593
|
-
const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node,
|
|
99645
|
+
const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node, 32 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */);
|
|
99594
99646
|
let updated;
|
|
99595
99647
|
if (convertedLoopState && (node.declarationList.flags & 7 /* BlockScoped */) === 0 && !isVariableStatementOfTypeScriptClassWrapper(node)) {
|
|
99596
99648
|
let assignments;
|
|
@@ -104539,7 +104591,7 @@ function transformModule(context) {
|
|
|
104539
104591
|
Debug.assert(isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer.");
|
|
104540
104592
|
let statements;
|
|
104541
104593
|
if (moduleKind !== 2 /* AMD */) {
|
|
104542
|
-
if (hasSyntacticModifier(node,
|
|
104594
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
104543
104595
|
statements = append(
|
|
104544
104596
|
statements,
|
|
104545
104597
|
setOriginalNode(
|
|
@@ -104585,7 +104637,7 @@ function transformModule(context) {
|
|
|
104585
104637
|
);
|
|
104586
104638
|
}
|
|
104587
104639
|
} else {
|
|
104588
|
-
if (hasSyntacticModifier(node,
|
|
104640
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
104589
104641
|
statements = append(
|
|
104590
104642
|
statements,
|
|
104591
104643
|
setOriginalNode(
|
|
@@ -104723,7 +104775,7 @@ function transformModule(context) {
|
|
|
104723
104775
|
}
|
|
104724
104776
|
function visitFunctionDeclaration(node) {
|
|
104725
104777
|
let statements;
|
|
104726
|
-
if (hasSyntacticModifier(node,
|
|
104778
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
104727
104779
|
statements = append(
|
|
104728
104780
|
statements,
|
|
104729
104781
|
setOriginalNode(
|
|
@@ -104760,7 +104812,7 @@ function transformModule(context) {
|
|
|
104760
104812
|
}
|
|
104761
104813
|
function visitClassDeclaration(node) {
|
|
104762
104814
|
let statements;
|
|
104763
|
-
if (hasSyntacticModifier(node,
|
|
104815
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
104764
104816
|
statements = append(
|
|
104765
104817
|
statements,
|
|
104766
104818
|
setOriginalNode(
|
|
@@ -104794,7 +104846,7 @@ function transformModule(context) {
|
|
|
104794
104846
|
let statements;
|
|
104795
104847
|
let variables;
|
|
104796
104848
|
let expressions;
|
|
104797
|
-
if (hasSyntacticModifier(node,
|
|
104849
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
104798
104850
|
let modifiers;
|
|
104799
104851
|
let removeCommentsOnExpressions = false;
|
|
104800
104852
|
for (const variable of node.declarationList.declarations) {
|
|
@@ -104980,8 +105032,8 @@ function transformModule(context) {
|
|
|
104980
105032
|
return statements;
|
|
104981
105033
|
}
|
|
104982
105034
|
const seen = new IdentifierNameMap();
|
|
104983
|
-
if (hasSyntacticModifier(decl,
|
|
104984
|
-
const exportName = hasSyntacticModifier(decl,
|
|
105035
|
+
if (hasSyntacticModifier(decl, 32 /* Export */)) {
|
|
105036
|
+
const exportName = hasSyntacticModifier(decl, 2048 /* Default */) ? factory2.createIdentifier("default") : factory2.getDeclarationName(decl);
|
|
104985
105037
|
statements = appendExportStatement(
|
|
104986
105038
|
statements,
|
|
104987
105039
|
seen,
|
|
@@ -105468,7 +105520,7 @@ function transformSystemModule(context) {
|
|
|
105468
105520
|
addRange(statements, hoistedStatements);
|
|
105469
105521
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
105470
105522
|
const exportStarFunction = addExportStarIfNeeded(statements);
|
|
105471
|
-
const modifiers = node.transformFlags & 2097152 /* ContainsAwait */ ? factory2.createModifiersFromModifierFlags(
|
|
105523
|
+
const modifiers = node.transformFlags & 2097152 /* ContainsAwait */ ? factory2.createModifiersFromModifierFlags(1024 /* Async */) : void 0;
|
|
105472
105524
|
const moduleObject = factory2.createObjectLiteralExpression(
|
|
105473
105525
|
[
|
|
105474
105526
|
factory2.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)),
|
|
@@ -105568,7 +105620,7 @@ function transformSystemModule(context) {
|
|
|
105568
105620
|
const exportStarFunction = factory2.createUniqueName("exportStar");
|
|
105569
105621
|
const m = factory2.createIdentifier("m");
|
|
105570
105622
|
const n = factory2.createIdentifier("n");
|
|
105571
|
-
const
|
|
105623
|
+
const exports2 = factory2.createIdentifier("exports");
|
|
105572
105624
|
let condition = factory2.createStrictInequality(n, factory2.createStringLiteral("default"));
|
|
105573
105625
|
if (localNames) {
|
|
105574
105626
|
condition = factory2.createLogicalAnd(
|
|
@@ -105607,7 +105659,7 @@ function transformSystemModule(context) {
|
|
|
105607
105659
|
void 0,
|
|
105608
105660
|
factory2.createVariableDeclarationList([
|
|
105609
105661
|
factory2.createVariableDeclaration(
|
|
105610
|
-
|
|
105662
|
+
exports2,
|
|
105611
105663
|
/*exclamationToken*/
|
|
105612
105664
|
void 0,
|
|
105613
105665
|
/*type*/
|
|
@@ -105627,7 +105679,7 @@ function transformSystemModule(context) {
|
|
|
105627
105679
|
condition,
|
|
105628
105680
|
factory2.createExpressionStatement(
|
|
105629
105681
|
factory2.createAssignment(
|
|
105630
|
-
factory2.createElementAccessExpression(
|
|
105682
|
+
factory2.createElementAccessExpression(exports2, n),
|
|
105631
105683
|
factory2.createElementAccessExpression(m, n)
|
|
105632
105684
|
)
|
|
105633
105685
|
)
|
|
@@ -105641,7 +105693,7 @@ function transformSystemModule(context) {
|
|
|
105641
105693
|
exportFunction,
|
|
105642
105694
|
/*typeArguments*/
|
|
105643
105695
|
void 0,
|
|
105644
|
-
[
|
|
105696
|
+
[exports2]
|
|
105645
105697
|
)
|
|
105646
105698
|
)
|
|
105647
105699
|
],
|
|
@@ -105670,7 +105722,7 @@ function transformSystemModule(context) {
|
|
|
105670
105722
|
factory2.createAssignment(importVariableName, parameterName)
|
|
105671
105723
|
)
|
|
105672
105724
|
);
|
|
105673
|
-
if (hasSyntacticModifier(entry,
|
|
105725
|
+
if (hasSyntacticModifier(entry, 32 /* Export */)) {
|
|
105674
105726
|
statements.push(
|
|
105675
105727
|
factory2.createExpressionStatement(
|
|
105676
105728
|
factory2.createCallExpression(
|
|
@@ -105823,7 +105875,7 @@ function transformSystemModule(context) {
|
|
|
105823
105875
|
);
|
|
105824
105876
|
}
|
|
105825
105877
|
function visitFunctionDeclaration(node) {
|
|
105826
|
-
if (hasSyntacticModifier(node,
|
|
105878
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
105827
105879
|
hoistedStatements = append(
|
|
105828
105880
|
hoistedStatements,
|
|
105829
105881
|
factory2.updateFunctionDeclaration(
|
|
@@ -105910,7 +105962,7 @@ function transformSystemModule(context) {
|
|
|
105910
105962
|
statements = append(statements, factory2.updateVariableStatement(node, modifiers, declarationList));
|
|
105911
105963
|
} else {
|
|
105912
105964
|
let expressions;
|
|
105913
|
-
const isExportedDeclaration = hasSyntacticModifier(node,
|
|
105965
|
+
const isExportedDeclaration = hasSyntacticModifier(node, 32 /* Export */);
|
|
105914
105966
|
for (const variable of node.declarationList.declarations) {
|
|
105915
105967
|
if (variable.initializer) {
|
|
105916
105968
|
expressions = append(expressions, transformInitializedVariable(variable, isExportedDeclaration));
|
|
@@ -106046,8 +106098,8 @@ function transformSystemModule(context) {
|
|
|
106046
106098
|
return statements;
|
|
106047
106099
|
}
|
|
106048
106100
|
let excludeName;
|
|
106049
|
-
if (hasSyntacticModifier(decl,
|
|
106050
|
-
const exportName = hasSyntacticModifier(decl,
|
|
106101
|
+
if (hasSyntacticModifier(decl, 32 /* Export */)) {
|
|
106102
|
+
const exportName = hasSyntacticModifier(decl, 2048 /* Default */) ? factory2.createStringLiteral("default") : decl.name;
|
|
106051
106103
|
statements = appendExportStatement(statements, exportName, factory2.getLocalName(decl));
|
|
106052
106104
|
excludeName = getTextOfIdentifierOrLiteral(exportName);
|
|
106053
106105
|
}
|
|
@@ -106792,7 +106844,7 @@ function transformECMAScriptModule(context) {
|
|
|
106792
106844
|
return singleOrMany(statements);
|
|
106793
106845
|
}
|
|
106794
106846
|
function appendExportsOfImportEqualsDeclaration(statements, node) {
|
|
106795
|
-
if (hasSyntacticModifier(node,
|
|
106847
|
+
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
106796
106848
|
statements = append(
|
|
106797
106849
|
statements,
|
|
106798
106850
|
factory2.createExportDeclaration(
|
|
@@ -107002,7 +107054,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
107002
107054
|
} else if (isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isIndexSignatureDeclaration(node)) {
|
|
107003
107055
|
return getReturnTypeVisibilityError;
|
|
107004
107056
|
} else if (isParameter(node)) {
|
|
107005
|
-
if (isParameterPropertyDeclaration(node, node.parent) && hasSyntacticModifier(node.parent,
|
|
107057
|
+
if (isParameterPropertyDeclaration(node, node.parent) && hasSyntacticModifier(node.parent, 2 /* Private */)) {
|
|
107006
107058
|
return getVariableDeclarationTypeVisibilityError;
|
|
107007
107059
|
}
|
|
107008
107060
|
return getParameterDeclarationTypeVisibilityError;
|
|
@@ -107020,7 +107072,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
107020
107072
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
107021
107073
|
if (node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
|
|
107022
107074
|
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;
|
|
107023
|
-
} 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,
|
|
107075
|
+
} 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 */)) {
|
|
107024
107076
|
if (isStatic(node)) {
|
|
107025
107077
|
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;
|
|
107026
107078
|
} else if (node.parent.kind === 263 /* ClassDeclaration */ || node.kind === 169 /* Parameter */) {
|
|
@@ -107741,7 +107793,7 @@ function transformDeclarations(context) {
|
|
|
107741
107793
|
return void 0;
|
|
107742
107794
|
}
|
|
107743
107795
|
function ensureType(node, type, ignorePrivate) {
|
|
107744
|
-
if (!ignorePrivate && hasEffectiveModifier(node,
|
|
107796
|
+
if (!ignorePrivate && hasEffectiveModifier(node, 2 /* Private */)) {
|
|
107745
107797
|
return;
|
|
107746
107798
|
}
|
|
107747
107799
|
if (shouldPrintWithInitializer(node)) {
|
|
@@ -107821,7 +107873,7 @@ function transformDeclarations(context) {
|
|
|
107821
107873
|
}
|
|
107822
107874
|
}
|
|
107823
107875
|
function updateParamsList(node, params, modifierMask) {
|
|
107824
|
-
if (hasEffectiveModifier(node,
|
|
107876
|
+
if (hasEffectiveModifier(node, 2 /* Private */)) {
|
|
107825
107877
|
return factory2.createNodeArray();
|
|
107826
107878
|
}
|
|
107827
107879
|
const newParams = map(params, (p) => ensureParameter(p, modifierMask));
|
|
@@ -107866,7 +107918,7 @@ function transformDeclarations(context) {
|
|
|
107866
107918
|
return factory2.createNodeArray(newParams || emptyArray);
|
|
107867
107919
|
}
|
|
107868
107920
|
function ensureTypeParams(node, params) {
|
|
107869
|
-
return hasEffectiveModifier(node,
|
|
107921
|
+
return hasEffectiveModifier(node, 2 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree, isTypeParameterDeclaration);
|
|
107870
107922
|
}
|
|
107871
107923
|
function isEnclosingDeclaration(node) {
|
|
107872
107924
|
return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node);
|
|
@@ -108052,7 +108104,7 @@ function transformDeclarations(context) {
|
|
|
108052
108104
|
const oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
|
|
108053
108105
|
let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 187 /* TypeLiteral */ || input.kind === 200 /* MappedType */) && input.parent.kind !== 265 /* TypeAliasDeclaration */;
|
|
108054
108106
|
if (isMethodDeclaration(input) || isMethodSignature(input)) {
|
|
108055
|
-
if (hasEffectiveModifier(input,
|
|
108107
|
+
if (hasEffectiveModifier(input, 2 /* Private */)) {
|
|
108056
108108
|
if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input)
|
|
108057
108109
|
return;
|
|
108058
108110
|
return cleanup(factory2.createPropertyDeclaration(
|
|
@@ -108140,7 +108192,7 @@ function transformDeclarations(context) {
|
|
|
108140
108192
|
input,
|
|
108141
108193
|
ensureModifiers(input),
|
|
108142
108194
|
input.name,
|
|
108143
|
-
updateAccessorParamsList(input, hasEffectiveModifier(input,
|
|
108195
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
108144
108196
|
ensureType(input, accessorType),
|
|
108145
108197
|
/*body*/
|
|
108146
108198
|
void 0
|
|
@@ -108157,7 +108209,7 @@ function transformDeclarations(context) {
|
|
|
108157
108209
|
input,
|
|
108158
108210
|
ensureModifiers(input),
|
|
108159
108211
|
input.name,
|
|
108160
|
-
updateAccessorParamsList(input, hasEffectiveModifier(input,
|
|
108212
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
108161
108213
|
/*body*/
|
|
108162
108214
|
void 0
|
|
108163
108215
|
));
|
|
@@ -108314,7 +108366,7 @@ function transformDeclarations(context) {
|
|
|
108314
108366
|
}
|
|
108315
108367
|
}
|
|
108316
108368
|
function isPrivateMethodTypeParameter(node) {
|
|
108317
|
-
return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent,
|
|
108369
|
+
return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 2 /* Private */);
|
|
108318
108370
|
}
|
|
108319
108371
|
function visitDeclarationStatements(input) {
|
|
108320
108372
|
if (!isPreservedDeclarationStatement(input)) {
|
|
@@ -108373,10 +108425,10 @@ function transformDeclarations(context) {
|
|
|
108373
108425
|
return input;
|
|
108374
108426
|
}
|
|
108375
108427
|
function stripExportModifiers(statement) {
|
|
108376
|
-
if (isImportEqualsDeclaration(statement) || hasEffectiveModifier(statement,
|
|
108428
|
+
if (isImportEqualsDeclaration(statement) || hasEffectiveModifier(statement, 2048 /* Default */) || !canHaveModifiers(statement)) {
|
|
108377
108429
|
return statement;
|
|
108378
108430
|
}
|
|
108379
|
-
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (
|
|
108431
|
+
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (131071 /* All */ ^ 32 /* Export */));
|
|
108380
108432
|
return factory2.replaceModifiers(statement, modifiers);
|
|
108381
108433
|
}
|
|
108382
108434
|
function updateModuleDeclarationAndKeyword(node, modifiers, name, body) {
|
|
@@ -108526,10 +108578,10 @@ function transformDeclarations(context) {
|
|
|
108526
108578
|
));
|
|
108527
108579
|
}
|
|
108528
108580
|
const namespaceDecl = factory2.createModuleDeclaration(ensureModifiers(input), input.name, factory2.createModuleBlock(declarations), 32 /* Namespace */);
|
|
108529
|
-
if (!hasEffectiveModifier(clean2,
|
|
108581
|
+
if (!hasEffectiveModifier(clean2, 2048 /* Default */)) {
|
|
108530
108582
|
return [clean2, namespaceDecl];
|
|
108531
108583
|
}
|
|
108532
|
-
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(clean2) & ~
|
|
108584
|
+
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(clean2) & ~2080 /* ExportDefault */ | 128 /* Ambient */);
|
|
108533
108585
|
const cleanDeclaration = factory2.updateFunctionDeclaration(
|
|
108534
108586
|
clean2,
|
|
108535
108587
|
modifiers,
|
|
@@ -108621,7 +108673,7 @@ function transformDeclarations(context) {
|
|
|
108621
108673
|
if (ctor) {
|
|
108622
108674
|
const oldDiag2 = getSymbolAccessibilityDiagnostic;
|
|
108623
108675
|
parameterProperties = compact(flatMap(ctor.parameters, (param) => {
|
|
108624
|
-
if (!hasSyntacticModifier(param,
|
|
108676
|
+
if (!hasSyntacticModifier(param, 31 /* ParameterPropertyModifier */) || shouldStripInternal(param))
|
|
108625
108677
|
return;
|
|
108626
108678
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(param);
|
|
108627
108679
|
if (param.name.kind === 80 /* Identifier */) {
|
|
@@ -108850,11 +108902,11 @@ function transformDeclarations(context) {
|
|
|
108850
108902
|
return factory2.createModifiersFromModifierFlags(newFlags);
|
|
108851
108903
|
}
|
|
108852
108904
|
function ensureModifierFlags(node) {
|
|
108853
|
-
let mask =
|
|
108854
|
-
let additions = needsDeclare && !isAlwaysType(node) ?
|
|
108905
|
+
let mask = 131071 /* All */ ^ (1 /* Public */ | 1024 /* Async */ | 16 /* Override */);
|
|
108906
|
+
let additions = needsDeclare && !isAlwaysType(node) ? 128 /* Ambient */ : 0 /* None */;
|
|
108855
108907
|
const parentIsFile = node.parent.kind === 312 /* SourceFile */;
|
|
108856
108908
|
if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) {
|
|
108857
|
-
mask ^=
|
|
108909
|
+
mask ^= 128 /* Ambient */;
|
|
108858
108910
|
additions = 0 /* None */;
|
|
108859
108911
|
}
|
|
108860
108912
|
return maskModifierFlags(node, mask, additions);
|
|
@@ -108896,13 +108948,13 @@ function isAlwaysType(node) {
|
|
|
108896
108948
|
function maskModifiers(factory2, node, modifierMask, modifierAdditions) {
|
|
108897
108949
|
return factory2.createModifiersFromModifierFlags(maskModifierFlags(node, modifierMask, modifierAdditions));
|
|
108898
108950
|
}
|
|
108899
|
-
function maskModifierFlags(node, modifierMask =
|
|
108951
|
+
function maskModifierFlags(node, modifierMask = 131071 /* All */ ^ 1 /* Public */, modifierAdditions = 0 /* None */) {
|
|
108900
108952
|
let flags = getEffectiveModifierFlags(node) & modifierMask | modifierAdditions;
|
|
108901
|
-
if (flags &
|
|
108902
|
-
flags ^=
|
|
108953
|
+
if (flags & 2048 /* Default */ && !(flags & 32 /* Export */)) {
|
|
108954
|
+
flags ^= 32 /* Export */;
|
|
108903
108955
|
}
|
|
108904
|
-
if (flags &
|
|
108905
|
-
flags ^=
|
|
108956
|
+
if (flags & 2048 /* Default */ && flags & 128 /* Ambient */) {
|
|
108957
|
+
flags ^= 128 /* Ambient */;
|
|
108906
108958
|
}
|
|
108907
108959
|
return flags;
|
|
108908
108960
|
}
|
|
@@ -108915,7 +108967,7 @@ function canHaveLiteralInitializer(node) {
|
|
|
108915
108967
|
switch (node.kind) {
|
|
108916
108968
|
case 172 /* PropertyDeclaration */:
|
|
108917
108969
|
case 171 /* PropertySignature */:
|
|
108918
|
-
return !hasEffectiveModifier(node,
|
|
108970
|
+
return !hasEffectiveModifier(node, 2 /* Private */);
|
|
108919
108971
|
case 169 /* Parameter */:
|
|
108920
108972
|
case 260 /* VariableDeclaration */:
|
|
108921
108973
|
return true;
|
|
@@ -117674,7 +117726,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117674
117726
|
}
|
|
117675
117727
|
}
|
|
117676
117728
|
} else if (isModuleDeclaration(node)) {
|
|
117677
|
-
if (isAmbientModule(node) && (inAmbientModule || hasSyntacticModifier(node,
|
|
117729
|
+
if (isAmbientModule(node) && (inAmbientModule || hasSyntacticModifier(node, 128 /* Ambient */) || file.isDeclarationFile)) {
|
|
117678
117730
|
node.name.parent = node;
|
|
117679
117731
|
const nameText = getTextOfIdentifierOrLiteral(node.name);
|
|
117680
117732
|
if (isExternalModuleFile || inAmbientModule && !isExternalModuleNameRelative(nameText)) {
|