typescript 4.9.0-dev.20220819 → 4.9.0-dev.20220820
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/.eslintcache +1 -1
- package/lib/tsc.js +154 -115
- package/lib/tsserver.js +160 -121
- package/lib/tsserverlibrary.d.ts +59 -117
- package/lib/tsserverlibrary.js +160 -121
- package/lib/typescript.d.ts +59 -117
- package/lib/typescript.js +160 -121
- package/lib/typescriptServices.d.ts +59 -117
- package/lib/typescriptServices.js +160 -121
- package/lib/typingsInstaller.js +155 -116
- package/package.json +12 -18
package/lib/typescript.js
CHANGED
|
@@ -99,7 +99,7 @@ var ts;
|
|
|
99
99
|
// The following is baselined as a literal template type without intervention
|
|
100
100
|
/** The version of the TypeScript compiler release */
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
102
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
102
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220820";
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -2488,6 +2488,7 @@ var ts;
|
|
|
2488
2488
|
var currentAssertionLevel = 0 /* None */;
|
|
2489
2489
|
Debug.currentLogLevel = LogLevel.Warning;
|
|
2490
2490
|
Debug.isDebugging = false;
|
|
2491
|
+
Debug.enableDeprecationWarnings = true;
|
|
2491
2492
|
function getTypeScriptVersion() {
|
|
2492
2493
|
return typeScriptVersion !== null && typeScriptVersion !== void 0 ? typeScriptVersion : (typeScriptVersion = new ts.Version(ts.version));
|
|
2493
2494
|
}
|
|
@@ -3111,7 +3112,7 @@ var ts;
|
|
|
3111
3112
|
function createWarningDeprecation(name, errorAfter, since, message) {
|
|
3112
3113
|
var hasWrittenDeprecation = false;
|
|
3113
3114
|
return function () {
|
|
3114
|
-
if (!hasWrittenDeprecation) {
|
|
3115
|
+
if (Debug.enableDeprecationWarnings && !hasWrittenDeprecation) {
|
|
3115
3116
|
log.warn(formatDeprecationMessage(name, /*error*/ false, errorAfter, since, message));
|
|
3116
3117
|
hasWrittenDeprecation = true;
|
|
3117
3118
|
}
|
|
@@ -21390,7 +21391,7 @@ var ts;
|
|
|
21390
21391
|
case 165 /* Decorator */: {
|
|
21391
21392
|
var parent_2 = node.parent;
|
|
21392
21393
|
return ts.canHaveDecorators(parent_2) ? parent_2.modifiers :
|
|
21393
|
-
ts.canHaveIllegalDecorators(parent_2) ? parent_2.
|
|
21394
|
+
ts.canHaveIllegalDecorators(parent_2) ? parent_2.illegalDecorators :
|
|
21394
21395
|
undefined;
|
|
21395
21396
|
}
|
|
21396
21397
|
case 291 /* HeritageClause */:
|
|
@@ -23467,7 +23468,7 @@ var ts;
|
|
|
23467
23468
|
node.body = body;
|
|
23468
23469
|
node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */;
|
|
23469
23470
|
// The following properties are used only to report grammar errors
|
|
23470
|
-
node.
|
|
23471
|
+
node.illegalDecorators = undefined;
|
|
23471
23472
|
node.modifiers = undefined;
|
|
23472
23473
|
return node;
|
|
23473
23474
|
}
|
|
@@ -23479,7 +23480,7 @@ var ts;
|
|
|
23479
23480
|
}
|
|
23480
23481
|
function finishUpdateClassStaticBlockDeclaration(updated, original) {
|
|
23481
23482
|
if (updated !== original) {
|
|
23482
|
-
updated.
|
|
23483
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
23483
23484
|
updated.modifiers = original.modifiers;
|
|
23484
23485
|
}
|
|
23485
23486
|
return update(updated, original);
|
|
@@ -23492,7 +23493,7 @@ var ts;
|
|
|
23492
23493
|
/*type*/ undefined, body);
|
|
23493
23494
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
23494
23495
|
// The following properties are used only to report grammar errors
|
|
23495
|
-
node.
|
|
23496
|
+
node.illegalDecorators = undefined;
|
|
23496
23497
|
node.typeParameters = undefined;
|
|
23497
23498
|
node.type = undefined;
|
|
23498
23499
|
return node;
|
|
@@ -23507,7 +23508,7 @@ var ts;
|
|
|
23507
23508
|
}
|
|
23508
23509
|
function finishUpdateConstructorDeclaration(updated, original) {
|
|
23509
23510
|
if (updated !== original) {
|
|
23510
|
-
updated.
|
|
23511
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
23511
23512
|
updated.typeParameters = original.typeParameters;
|
|
23512
23513
|
updated.type = original.type;
|
|
23513
23514
|
}
|
|
@@ -25255,7 +25256,7 @@ var ts;
|
|
|
25255
25256
|
}
|
|
25256
25257
|
}
|
|
25257
25258
|
// The following properties are used only to report grammar errors
|
|
25258
|
-
node.
|
|
25259
|
+
node.illegalDecorators = undefined;
|
|
25259
25260
|
return node;
|
|
25260
25261
|
}
|
|
25261
25262
|
// @api
|
|
@@ -25273,7 +25274,7 @@ var ts;
|
|
|
25273
25274
|
function finishUpdateFunctionDeclaration(updated, original) {
|
|
25274
25275
|
if (updated !== original) {
|
|
25275
25276
|
// copy children used only for error reporting
|
|
25276
|
-
updated.
|
|
25277
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25277
25278
|
}
|
|
25278
25279
|
return finishUpdateBaseSignatureDeclaration(updated, original);
|
|
25279
25280
|
}
|
|
@@ -25307,7 +25308,7 @@ var ts;
|
|
|
25307
25308
|
node.members = createNodeArray(members);
|
|
25308
25309
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
25309
25310
|
// The following properties are used only to report grammar errors
|
|
25310
|
-
node.
|
|
25311
|
+
node.illegalDecorators = undefined;
|
|
25311
25312
|
return node;
|
|
25312
25313
|
}
|
|
25313
25314
|
// @api
|
|
@@ -25322,7 +25323,7 @@ var ts;
|
|
|
25322
25323
|
}
|
|
25323
25324
|
function finishUpdateInterfaceDeclaration(updated, original) {
|
|
25324
25325
|
if (updated !== original) {
|
|
25325
|
-
updated.
|
|
25326
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25326
25327
|
}
|
|
25327
25328
|
return update(updated, original);
|
|
25328
25329
|
}
|
|
@@ -25332,7 +25333,7 @@ var ts;
|
|
|
25332
25333
|
node.type = type;
|
|
25333
25334
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
25334
25335
|
// The following properties are used only to report grammar errors
|
|
25335
|
-
node.
|
|
25336
|
+
node.illegalDecorators = undefined;
|
|
25336
25337
|
return node;
|
|
25337
25338
|
}
|
|
25338
25339
|
// @api
|
|
@@ -25346,7 +25347,7 @@ var ts;
|
|
|
25346
25347
|
}
|
|
25347
25348
|
function finishUpdateTypeAliasDeclaration(updated, original) {
|
|
25348
25349
|
if (updated !== original) {
|
|
25349
|
-
updated.
|
|
25350
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25350
25351
|
}
|
|
25351
25352
|
return update(updated, original);
|
|
25352
25353
|
}
|
|
@@ -25359,7 +25360,7 @@ var ts;
|
|
|
25359
25360
|
1 /* ContainsTypeScript */;
|
|
25360
25361
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // Enum declarations cannot contain `await`
|
|
25361
25362
|
// The following properties are used only to report grammar errors
|
|
25362
|
-
node.
|
|
25363
|
+
node.illegalDecorators = undefined;
|
|
25363
25364
|
return node;
|
|
25364
25365
|
}
|
|
25365
25366
|
// @api
|
|
@@ -25372,7 +25373,7 @@ var ts;
|
|
|
25372
25373
|
}
|
|
25373
25374
|
function finishUpdateEnumDeclaration(updated, original) {
|
|
25374
25375
|
if (updated !== original) {
|
|
25375
|
-
updated.
|
|
25376
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25376
25377
|
}
|
|
25377
25378
|
return update(updated, original);
|
|
25378
25379
|
}
|
|
@@ -25396,7 +25397,7 @@ var ts;
|
|
|
25396
25397
|
}
|
|
25397
25398
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // Module declarations cannot contain `await`.
|
|
25398
25399
|
// The following properties are used only to report grammar errors
|
|
25399
|
-
node.
|
|
25400
|
+
node.illegalDecorators = undefined;
|
|
25400
25401
|
return node;
|
|
25401
25402
|
}
|
|
25402
25403
|
// @api
|
|
@@ -25409,7 +25410,7 @@ var ts;
|
|
|
25409
25410
|
}
|
|
25410
25411
|
function finishUpdateModuleDeclaration(updated, original) {
|
|
25411
25412
|
if (updated !== original) {
|
|
25412
|
-
updated.
|
|
25413
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25413
25414
|
}
|
|
25414
25415
|
return update(updated, original);
|
|
25415
25416
|
}
|
|
@@ -25445,7 +25446,7 @@ var ts;
|
|
|
25445
25446
|
/*modifiers*/ undefined, name);
|
|
25446
25447
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
25447
25448
|
// The following properties are used only to report grammar errors
|
|
25448
|
-
node.
|
|
25449
|
+
node.illegalDecorators = undefined;
|
|
25449
25450
|
node.modifiers = undefined;
|
|
25450
25451
|
return node;
|
|
25451
25452
|
}
|
|
@@ -25457,7 +25458,7 @@ var ts;
|
|
|
25457
25458
|
}
|
|
25458
25459
|
function finishUpdateNamespaceExportDeclaration(updated, original) {
|
|
25459
25460
|
if (updated !== original) {
|
|
25460
|
-
updated.
|
|
25461
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25461
25462
|
updated.modifiers = original.modifiers;
|
|
25462
25463
|
}
|
|
25463
25464
|
return update(updated, original);
|
|
@@ -25472,7 +25473,7 @@ var ts;
|
|
|
25472
25473
|
node.transformFlags |= 1 /* ContainsTypeScript */;
|
|
25473
25474
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // Import= declaration is always parsed in an Await context
|
|
25474
25475
|
// The following properties are used only to report grammar errors
|
|
25475
|
-
node.
|
|
25476
|
+
node.illegalDecorators = undefined;
|
|
25476
25477
|
return node;
|
|
25477
25478
|
}
|
|
25478
25479
|
// @api
|
|
@@ -25486,7 +25487,7 @@ var ts;
|
|
|
25486
25487
|
}
|
|
25487
25488
|
function finishUpdateImportEqualsDeclaration(updated, original) {
|
|
25488
25489
|
if (updated !== original) {
|
|
25489
|
-
updated.
|
|
25490
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25490
25491
|
}
|
|
25491
25492
|
return update(updated, original);
|
|
25492
25493
|
}
|
|
@@ -25502,7 +25503,7 @@ var ts;
|
|
|
25502
25503
|
propagateChildFlags(node.moduleSpecifier);
|
|
25503
25504
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
|
|
25504
25505
|
// The following properties are used only to report grammar errors
|
|
25505
|
-
node.
|
|
25506
|
+
node.illegalDecorators = undefined;
|
|
25506
25507
|
return node;
|
|
25507
25508
|
}
|
|
25508
25509
|
// @api
|
|
@@ -25516,7 +25517,7 @@ var ts;
|
|
|
25516
25517
|
}
|
|
25517
25518
|
function finishUpdateImportDeclaration(updated, original) {
|
|
25518
25519
|
if (updated !== original) {
|
|
25519
|
-
updated.
|
|
25520
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25520
25521
|
}
|
|
25521
25522
|
return update(updated, original);
|
|
25522
25523
|
}
|
|
@@ -25662,7 +25663,7 @@ var ts;
|
|
|
25662
25663
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression);
|
|
25663
25664
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
|
|
25664
25665
|
// The following properties are used only to report grammar errors
|
|
25665
|
-
node.
|
|
25666
|
+
node.illegalDecorators = undefined;
|
|
25666
25667
|
return node;
|
|
25667
25668
|
}
|
|
25668
25669
|
// @api
|
|
@@ -25674,7 +25675,7 @@ var ts;
|
|
|
25674
25675
|
}
|
|
25675
25676
|
function finishUpdateExportAssignment(updated, original) {
|
|
25676
25677
|
if (updated !== original) {
|
|
25677
|
-
updated.
|
|
25678
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25678
25679
|
}
|
|
25679
25680
|
return update(updated, original);
|
|
25680
25681
|
}
|
|
@@ -25692,7 +25693,7 @@ var ts;
|
|
|
25692
25693
|
propagateChildFlags(node.moduleSpecifier);
|
|
25693
25694
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
|
|
25694
25695
|
// The following properties are used only to report grammar errors
|
|
25695
|
-
node.
|
|
25696
|
+
node.illegalDecorators = undefined;
|
|
25696
25697
|
return node;
|
|
25697
25698
|
}
|
|
25698
25699
|
// @api
|
|
@@ -25707,7 +25708,7 @@ var ts;
|
|
|
25707
25708
|
}
|
|
25708
25709
|
function finishUpdateExportDeclaration(updated, original) {
|
|
25709
25710
|
if (updated !== original) {
|
|
25710
|
-
updated.
|
|
25711
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25711
25712
|
}
|
|
25712
25713
|
return update(updated, original);
|
|
25713
25714
|
}
|
|
@@ -26471,7 +26472,7 @@ var ts;
|
|
|
26471
26472
|
propagateChildFlags(node.name) |
|
|
26472
26473
|
propagateChildFlags(node.initializer);
|
|
26473
26474
|
// The following properties are used only to report grammar errors
|
|
26474
|
-
node.
|
|
26475
|
+
node.illegalDecorators = undefined;
|
|
26475
26476
|
node.modifiers = undefined;
|
|
26476
26477
|
node.questionToken = undefined;
|
|
26477
26478
|
node.exclamationToken = undefined;
|
|
@@ -26487,7 +26488,7 @@ var ts;
|
|
|
26487
26488
|
function finishUpdatePropertyAssignment(updated, original) {
|
|
26488
26489
|
// copy children used only for error reporting
|
|
26489
26490
|
if (updated !== original) {
|
|
26490
|
-
updated.
|
|
26491
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
26491
26492
|
updated.modifiers = original.modifiers;
|
|
26492
26493
|
updated.questionToken = original.questionToken;
|
|
26493
26494
|
updated.exclamationToken = original.exclamationToken;
|
|
@@ -26504,7 +26505,7 @@ var ts;
|
|
|
26504
26505
|
1024 /* ContainsES2015 */;
|
|
26505
26506
|
// The following properties are used only to report grammar errors
|
|
26506
26507
|
node.equalsToken = undefined;
|
|
26507
|
-
node.
|
|
26508
|
+
node.illegalDecorators = undefined;
|
|
26508
26509
|
node.modifiers = undefined;
|
|
26509
26510
|
node.questionToken = undefined;
|
|
26510
26511
|
node.exclamationToken = undefined;
|
|
@@ -26521,7 +26522,7 @@ var ts;
|
|
|
26521
26522
|
if (updated !== original) {
|
|
26522
26523
|
// copy children used only for error reporting
|
|
26523
26524
|
updated.equalsToken = original.equalsToken;
|
|
26524
|
-
updated.
|
|
26525
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
26525
26526
|
updated.modifiers = original.modifiers;
|
|
26526
26527
|
updated.questionToken = original.questionToken;
|
|
26527
26528
|
updated.exclamationToken = original.exclamationToken;
|
|
@@ -31000,7 +31001,7 @@ var ts;
|
|
|
31000
31001
|
visitNode(cbNode, node.default) ||
|
|
31001
31002
|
visitNode(cbNode, node.expression);
|
|
31002
31003
|
case 297 /* ShorthandPropertyAssignment */:
|
|
31003
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31004
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31004
31005
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31005
31006
|
visitNode(cbNode, node.name) ||
|
|
31006
31007
|
visitNode(cbNode, node.questionToken) ||
|
|
@@ -31030,7 +31031,7 @@ var ts;
|
|
|
31030
31031
|
visitNode(cbNode, node.type) ||
|
|
31031
31032
|
visitNode(cbNode, node.initializer);
|
|
31032
31033
|
case 296 /* PropertyAssignment */:
|
|
31033
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31034
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31034
31035
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31035
31036
|
visitNode(cbNode, node.name) ||
|
|
31036
31037
|
visitNode(cbNode, node.questionToken) ||
|
|
@@ -31047,7 +31048,7 @@ var ts;
|
|
|
31047
31048
|
visitNode(cbNode, node.name) ||
|
|
31048
31049
|
visitNode(cbNode, node.initializer);
|
|
31049
31050
|
case 176 /* IndexSignature */:
|
|
31050
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31051
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31051
31052
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31052
31053
|
visitNodes(cbNode, cbNodes, node.typeParameters) ||
|
|
31053
31054
|
visitNodes(cbNode, cbNodes, node.parameters) ||
|
|
@@ -31085,7 +31086,7 @@ var ts;
|
|
|
31085
31086
|
visitNodes(cbNode, cbNodes, node.parameters) ||
|
|
31086
31087
|
visitNode(cbNode, node.type);
|
|
31087
31088
|
case 171 /* Constructor */:
|
|
31088
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31089
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31089
31090
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31090
31091
|
visitNode(cbNode, node.name) ||
|
|
31091
31092
|
visitNodes(cbNode, cbNodes, node.typeParameters) ||
|
|
@@ -31107,7 +31108,7 @@ var ts;
|
|
|
31107
31108
|
visitNode(cbNode, node.type) ||
|
|
31108
31109
|
visitNode(cbNode, node.body);
|
|
31109
31110
|
case 256 /* FunctionDeclaration */:
|
|
31110
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31111
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31111
31112
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31112
31113
|
visitNode(cbNode, node.asteriskToken) ||
|
|
31113
31114
|
visitNode(cbNode, node.name) ||
|
|
@@ -31131,7 +31132,7 @@ var ts;
|
|
|
31131
31132
|
visitNode(cbNode, node.equalsGreaterThanToken) ||
|
|
31132
31133
|
visitNode(cbNode, node.body);
|
|
31133
31134
|
case 170 /* ClassStaticBlockDeclaration */:
|
|
31134
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31135
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31135
31136
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31136
31137
|
visitNode(cbNode, node.body);
|
|
31137
31138
|
case 178 /* TypeReference */:
|
|
@@ -31259,7 +31260,7 @@ var ts;
|
|
|
31259
31260
|
return visitNodes(cbNode, cbNodes, node.statements) ||
|
|
31260
31261
|
visitNode(cbNode, node.endOfFileToken);
|
|
31261
31262
|
case 237 /* VariableStatement */:
|
|
31262
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31263
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31263
31264
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31264
31265
|
visitNode(cbNode, node.declarationList);
|
|
31265
31266
|
case 255 /* VariableDeclarationList */:
|
|
@@ -31330,20 +31331,20 @@ var ts;
|
|
|
31330
31331
|
visitNodes(cbNode, cbNodes, node.heritageClauses) ||
|
|
31331
31332
|
visitNodes(cbNode, cbNodes, node.members);
|
|
31332
31333
|
case 258 /* InterfaceDeclaration */:
|
|
31333
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31334
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31334
31335
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31335
31336
|
visitNode(cbNode, node.name) ||
|
|
31336
31337
|
visitNodes(cbNode, cbNodes, node.typeParameters) ||
|
|
31337
31338
|
visitNodes(cbNode, cbNodes, node.heritageClauses) ||
|
|
31338
31339
|
visitNodes(cbNode, cbNodes, node.members);
|
|
31339
31340
|
case 259 /* TypeAliasDeclaration */:
|
|
31340
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31341
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31341
31342
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31342
31343
|
visitNode(cbNode, node.name) ||
|
|
31343
31344
|
visitNodes(cbNode, cbNodes, node.typeParameters) ||
|
|
31344
31345
|
visitNode(cbNode, node.type);
|
|
31345
31346
|
case 260 /* EnumDeclaration */:
|
|
31346
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31347
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31347
31348
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31348
31349
|
visitNode(cbNode, node.name) ||
|
|
31349
31350
|
visitNodes(cbNode, cbNodes, node.members);
|
|
@@ -31351,17 +31352,17 @@ var ts;
|
|
|
31351
31352
|
return visitNode(cbNode, node.name) ||
|
|
31352
31353
|
visitNode(cbNode, node.initializer);
|
|
31353
31354
|
case 261 /* ModuleDeclaration */:
|
|
31354
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31355
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31355
31356
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31356
31357
|
visitNode(cbNode, node.name) ||
|
|
31357
31358
|
visitNode(cbNode, node.body);
|
|
31358
31359
|
case 265 /* ImportEqualsDeclaration */:
|
|
31359
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31360
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31360
31361
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31361
31362
|
visitNode(cbNode, node.name) ||
|
|
31362
31363
|
visitNode(cbNode, node.moduleReference);
|
|
31363
31364
|
case 266 /* ImportDeclaration */:
|
|
31364
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31365
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31365
31366
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31366
31367
|
visitNode(cbNode, node.importClause) ||
|
|
31367
31368
|
visitNode(cbNode, node.moduleSpecifier) ||
|
|
@@ -31375,7 +31376,7 @@ var ts;
|
|
|
31375
31376
|
return visitNode(cbNode, node.name) ||
|
|
31376
31377
|
visitNode(cbNode, node.value);
|
|
31377
31378
|
case 264 /* NamespaceExportDeclaration */:
|
|
31378
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31379
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31379
31380
|
visitNode(cbNode, node.name);
|
|
31380
31381
|
case 268 /* NamespaceImport */:
|
|
31381
31382
|
return visitNode(cbNode, node.name);
|
|
@@ -31385,7 +31386,7 @@ var ts;
|
|
|
31385
31386
|
case 273 /* NamedExports */:
|
|
31386
31387
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
31387
31388
|
case 272 /* ExportDeclaration */:
|
|
31388
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31389
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31389
31390
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31390
31391
|
visitNode(cbNode, node.exportClause) ||
|
|
31391
31392
|
visitNode(cbNode, node.moduleSpecifier) ||
|
|
@@ -31395,7 +31396,7 @@ var ts;
|
|
|
31395
31396
|
return visitNode(cbNode, node.propertyName) ||
|
|
31396
31397
|
visitNode(cbNode, node.name);
|
|
31397
31398
|
case 271 /* ExportAssignment */:
|
|
31398
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31399
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31399
31400
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31400
31401
|
visitNode(cbNode, node.expression);
|
|
31401
31402
|
case 223 /* TemplateExpression */:
|
|
@@ -31420,7 +31421,7 @@ var ts;
|
|
|
31420
31421
|
case 277 /* ExternalModuleReference */:
|
|
31421
31422
|
return visitNode(cbNode, node.expression);
|
|
31422
31423
|
case 276 /* MissingDeclaration */:
|
|
31423
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31424
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31424
31425
|
visitNodes(cbNode, cbNodes, node.modifiers);
|
|
31425
31426
|
case 351 /* CommaListExpression */:
|
|
31426
31427
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
@@ -33971,7 +33972,7 @@ var ts;
|
|
|
33971
33972
|
var type = parseTypeAnnotation();
|
|
33972
33973
|
parseTypeMemberSemicolon();
|
|
33973
33974
|
var node = factory.createIndexSignature(modifiers, parameters, type);
|
|
33974
|
-
node.
|
|
33975
|
+
node.illegalDecorators = decorators;
|
|
33975
33976
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
33976
33977
|
}
|
|
33977
33978
|
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
|
|
@@ -36131,7 +36132,7 @@ var ts;
|
|
|
36131
36132
|
node = factory.createPropertyAssignment(name, initializer);
|
|
36132
36133
|
}
|
|
36133
36134
|
// Decorators, Modifiers, questionToken, and exclamationToken are not supported by property assignments and are reported in the grammar checker
|
|
36134
|
-
node.
|
|
36135
|
+
node.illegalDecorators = decorators;
|
|
36135
36136
|
node.modifiers = modifiers;
|
|
36136
36137
|
node.questionToken = questionToken;
|
|
36137
36138
|
node.exclamationToken = exclamationToken;
|
|
@@ -36779,7 +36780,7 @@ var ts;
|
|
|
36779
36780
|
// would follow. For recovery and error reporting purposes, return an incomplete declaration.
|
|
36780
36781
|
var missing = createMissingNode(276 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected);
|
|
36781
36782
|
ts.setTextRangePos(missing, pos);
|
|
36782
|
-
missing.
|
|
36783
|
+
missing.illegalDecorators = decorators;
|
|
36783
36784
|
missing.modifiers = modifiers;
|
|
36784
36785
|
return missing;
|
|
36785
36786
|
}
|
|
@@ -36922,7 +36923,7 @@ var ts;
|
|
|
36922
36923
|
parseSemicolon();
|
|
36923
36924
|
var node = factory.createVariableStatement(modifiers, declarationList);
|
|
36924
36925
|
// Decorators are not allowed on a variable statement, so we keep track of them to report them in the grammar checker.
|
|
36925
|
-
node.
|
|
36926
|
+
node.illegalDecorators = decorators;
|
|
36926
36927
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36927
36928
|
}
|
|
36928
36929
|
function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -36942,7 +36943,7 @@ var ts;
|
|
|
36942
36943
|
var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, ts.Diagnostics.or_expected);
|
|
36943
36944
|
setAwaitContext(savedAwaitContext);
|
|
36944
36945
|
var node = factory.createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body);
|
|
36945
|
-
node.
|
|
36946
|
+
node.illegalDecorators = decorators;
|
|
36946
36947
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36947
36948
|
}
|
|
36948
36949
|
function parseConstructorName() {
|
|
@@ -36965,7 +36966,7 @@ var ts;
|
|
|
36965
36966
|
var body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected);
|
|
36966
36967
|
var node = factory.createConstructorDeclaration(modifiers, parameters, body);
|
|
36967
36968
|
// Attach invalid nodes if they exist so that we can report them in the grammar checker.
|
|
36968
|
-
node.
|
|
36969
|
+
node.illegalDecorators = decorators;
|
|
36969
36970
|
node.typeParameters = typeParameters;
|
|
36970
36971
|
node.type = type;
|
|
36971
36972
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
@@ -37081,7 +37082,7 @@ var ts;
|
|
|
37081
37082
|
parseExpectedToken(124 /* StaticKeyword */);
|
|
37082
37083
|
var body = parseClassStaticBlockBody();
|
|
37083
37084
|
var node = withJSDoc(finishNode(factory.createClassStaticBlockDeclaration(body), pos), hasJSDoc);
|
|
37084
|
-
node.
|
|
37085
|
+
node.illegalDecorators = decorators;
|
|
37085
37086
|
node.modifiers = modifiers;
|
|
37086
37087
|
return node;
|
|
37087
37088
|
}
|
|
@@ -37322,7 +37323,7 @@ var ts;
|
|
|
37322
37323
|
var heritageClauses = parseHeritageClauses();
|
|
37323
37324
|
var members = parseObjectTypeMembers();
|
|
37324
37325
|
var node = factory.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members);
|
|
37325
|
-
node.
|
|
37326
|
+
node.illegalDecorators = decorators;
|
|
37326
37327
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37327
37328
|
}
|
|
37328
37329
|
function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -37333,7 +37334,7 @@ var ts;
|
|
|
37333
37334
|
var type = token() === 138 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType();
|
|
37334
37335
|
parseSemicolon();
|
|
37335
37336
|
var node = factory.createTypeAliasDeclaration(modifiers, name, typeParameters, type);
|
|
37336
|
-
node.
|
|
37337
|
+
node.illegalDecorators = decorators;
|
|
37337
37338
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37338
37339
|
}
|
|
37339
37340
|
// In an ambient declaration, the grammar only allows integer literals as initializers.
|
|
@@ -37359,7 +37360,7 @@ var ts;
|
|
|
37359
37360
|
members = createMissingList();
|
|
37360
37361
|
}
|
|
37361
37362
|
var node = factory.createEnumDeclaration(modifiers, name, members);
|
|
37362
|
-
node.
|
|
37363
|
+
node.illegalDecorators = decorators;
|
|
37363
37364
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37364
37365
|
}
|
|
37365
37366
|
function parseModuleBlock() {
|
|
@@ -37383,7 +37384,7 @@ var ts;
|
|
|
37383
37384
|
? parseModuleOrNamespaceDeclaration(getNodePos(), /*hasJSDoc*/ false, /*decorators*/ undefined, /*modifiers*/ undefined, 4 /* NestedNamespace */ | namespaceFlag)
|
|
37384
37385
|
: parseModuleBlock();
|
|
37385
37386
|
var node = factory.createModuleDeclaration(modifiers, name, body, flags);
|
|
37386
|
-
node.
|
|
37387
|
+
node.illegalDecorators = decorators;
|
|
37387
37388
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37388
37389
|
}
|
|
37389
37390
|
function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -37406,7 +37407,7 @@ var ts;
|
|
|
37406
37407
|
parseSemicolon();
|
|
37407
37408
|
}
|
|
37408
37409
|
var node = factory.createModuleDeclaration(modifiers, name, body, flags);
|
|
37409
|
-
node.
|
|
37410
|
+
node.illegalDecorators = decorators;
|
|
37410
37411
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37411
37412
|
}
|
|
37412
37413
|
function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -37446,7 +37447,7 @@ var ts;
|
|
|
37446
37447
|
parseSemicolon();
|
|
37447
37448
|
var node = factory.createNamespaceExportDeclaration(name);
|
|
37448
37449
|
// NamespaceExportDeclaration nodes cannot have decorators or modifiers, so we attach them here so we can report them in the grammar checker
|
|
37449
|
-
node.
|
|
37450
|
+
node.illegalDecorators = decorators;
|
|
37450
37451
|
node.modifiers = modifiers;
|
|
37451
37452
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37452
37453
|
}
|
|
@@ -37486,7 +37487,7 @@ var ts;
|
|
|
37486
37487
|
}
|
|
37487
37488
|
parseSemicolon();
|
|
37488
37489
|
var node = factory.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause);
|
|
37489
|
-
node.
|
|
37490
|
+
node.illegalDecorators = decorators;
|
|
37490
37491
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37491
37492
|
}
|
|
37492
37493
|
function parseAssertEntry() {
|
|
@@ -37531,7 +37532,7 @@ var ts;
|
|
|
37531
37532
|
var moduleReference = parseModuleReference();
|
|
37532
37533
|
parseSemicolon();
|
|
37533
37534
|
var node = factory.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference);
|
|
37534
|
-
node.
|
|
37535
|
+
node.illegalDecorators = decorators;
|
|
37535
37536
|
var finished = withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37536
37537
|
return finished;
|
|
37537
37538
|
}
|
|
@@ -37721,7 +37722,7 @@ var ts;
|
|
|
37721
37722
|
parseSemicolon();
|
|
37722
37723
|
setAwaitContext(savedAwaitContext);
|
|
37723
37724
|
var node = factory.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause);
|
|
37724
|
-
node.
|
|
37725
|
+
node.illegalDecorators = decorators;
|
|
37725
37726
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37726
37727
|
}
|
|
37727
37728
|
function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -37738,7 +37739,7 @@ var ts;
|
|
|
37738
37739
|
parseSemicolon();
|
|
37739
37740
|
setAwaitContext(savedAwaitContext);
|
|
37740
37741
|
var node = factory.createExportAssignment(modifiers, isExportEquals, expression);
|
|
37741
|
-
node.
|
|
37742
|
+
node.illegalDecorators = decorators;
|
|
37742
37743
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37743
37744
|
}
|
|
37744
37745
|
var ParsingContext;
|
|
@@ -51036,41 +51037,61 @@ var ts;
|
|
|
51036
51037
|
return typeof file.externalModuleIndicator !== "object" && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), /*sourceNode*/ undefined, dontResolveAlias);
|
|
51037
51038
|
}
|
|
51038
51039
|
function getTargetOfImportClause(node, dontResolveAlias) {
|
|
51039
|
-
var _a;
|
|
51040
51040
|
var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
|
|
51041
51041
|
if (moduleSymbol) {
|
|
51042
|
-
|
|
51043
|
-
|
|
51044
|
-
|
|
51045
|
-
|
|
51046
|
-
|
|
51047
|
-
|
|
51048
|
-
|
|
51049
|
-
|
|
51050
|
-
|
|
51051
|
-
|
|
51052
|
-
|
|
51053
|
-
|
|
51054
|
-
|
|
51055
|
-
|
|
51056
|
-
|
|
51057
|
-
|
|
51058
|
-
|
|
51059
|
-
|
|
51060
|
-
|
|
51061
|
-
|
|
51062
|
-
|
|
51063
|
-
|
|
51042
|
+
return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
|
|
51043
|
+
}
|
|
51044
|
+
}
|
|
51045
|
+
function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) {
|
|
51046
|
+
var _a;
|
|
51047
|
+
var exportDefaultSymbol;
|
|
51048
|
+
if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
|
|
51049
|
+
exportDefaultSymbol = moduleSymbol;
|
|
51050
|
+
}
|
|
51051
|
+
else {
|
|
51052
|
+
exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias);
|
|
51053
|
+
}
|
|
51054
|
+
var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
51055
|
+
var specifier = getModuleSpecifierForImportOrExport(node);
|
|
51056
|
+
if (!specifier) {
|
|
51057
|
+
return exportDefaultSymbol;
|
|
51058
|
+
}
|
|
51059
|
+
var hasDefaultOnly = isOnlyImportedAsDefault(specifier);
|
|
51060
|
+
var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier);
|
|
51061
|
+
if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
|
|
51062
|
+
if (hasExportAssignmentSymbol(moduleSymbol)) {
|
|
51063
|
+
var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
|
|
51064
|
+
var exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */);
|
|
51065
|
+
var exportAssignment = exportEqualsSymbol.valueDeclaration;
|
|
51066
|
+
var err = error(node.name, ts.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName);
|
|
51067
|
+
if (exportAssignment) {
|
|
51068
|
+
ts.addRelatedInfo(err, ts.createDiagnosticForNode(exportAssignment, ts.Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, compilerOptionName));
|
|
51064
51069
|
}
|
|
51065
51070
|
}
|
|
51066
|
-
else if (
|
|
51067
|
-
|
|
51068
|
-
|
|
51069
|
-
|
|
51070
|
-
|
|
51071
|
+
else if (ts.isImportClause(node)) {
|
|
51072
|
+
reportNonDefaultExport(moduleSymbol, node);
|
|
51073
|
+
}
|
|
51074
|
+
else {
|
|
51075
|
+
errorNoModuleMemberSymbol(moduleSymbol, moduleSymbol, node, ts.isImportOrExportSpecifier(node) && node.propertyName || node.name);
|
|
51071
51076
|
}
|
|
51072
|
-
|
|
51073
|
-
|
|
51077
|
+
}
|
|
51078
|
+
else if (hasSyntheticDefault || hasDefaultOnly) {
|
|
51079
|
+
// per emit behavior, a synthetic default overrides a "real" .default member if `__esModule` is not present
|
|
51080
|
+
var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
51081
|
+
markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, /*overwriteTypeOnly*/ false);
|
|
51082
|
+
return resolved;
|
|
51083
|
+
}
|
|
51084
|
+
markSymbolOfAliasDeclarationIfTypeOnly(node, exportDefaultSymbol, /*finalTarget*/ undefined, /*overwriteTypeOnly*/ false);
|
|
51085
|
+
return exportDefaultSymbol;
|
|
51086
|
+
}
|
|
51087
|
+
function getModuleSpecifierForImportOrExport(node) {
|
|
51088
|
+
switch (node.kind) {
|
|
51089
|
+
case 267 /* ImportClause */: return node.parent.moduleSpecifier;
|
|
51090
|
+
case 265 /* ImportEqualsDeclaration */: return ts.isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : undefined;
|
|
51091
|
+
case 268 /* NamespaceImport */: return node.parent.parent.moduleSpecifier;
|
|
51092
|
+
case 270 /* ImportSpecifier */: return node.parent.parent.parent.moduleSpecifier;
|
|
51093
|
+
case 275 /* ExportSpecifier */: return node.parent.parent.moduleSpecifier;
|
|
51094
|
+
default: return ts.Debug.assertNever(node);
|
|
51074
51095
|
}
|
|
51075
51096
|
}
|
|
51076
51097
|
function reportNonDefaultExport(moduleSymbol, node) {
|
|
@@ -51160,7 +51181,7 @@ var ts;
|
|
|
51160
51181
|
}
|
|
51161
51182
|
}
|
|
51162
51183
|
function getExternalModuleMember(node, specifier, dontResolveAlias) {
|
|
51163
|
-
var _a
|
|
51184
|
+
var _a;
|
|
51164
51185
|
if (dontResolveAlias === void 0) { dontResolveAlias = false; }
|
|
51165
51186
|
var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier;
|
|
51166
51187
|
var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); // TODO: GH#18217
|
|
@@ -51196,29 +51217,33 @@ var ts;
|
|
|
51196
51217
|
combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) :
|
|
51197
51218
|
symbolFromModule || symbolFromVariable;
|
|
51198
51219
|
if (!symbol) {
|
|
51199
|
-
|
|
51200
|
-
var declarationName = ts.declarationNameToString(name);
|
|
51201
|
-
var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
|
|
51202
|
-
if (suggestion !== undefined) {
|
|
51203
|
-
var suggestionName = symbolToString(suggestion);
|
|
51204
|
-
var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
|
|
51205
|
-
if (suggestion.valueDeclaration) {
|
|
51206
|
-
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
|
|
51207
|
-
}
|
|
51208
|
-
}
|
|
51209
|
-
else {
|
|
51210
|
-
if ((_b = moduleSymbol.exports) === null || _b === void 0 ? void 0 : _b.has("default" /* Default */)) {
|
|
51211
|
-
error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);
|
|
51212
|
-
}
|
|
51213
|
-
else {
|
|
51214
|
-
reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName);
|
|
51215
|
-
}
|
|
51216
|
-
}
|
|
51220
|
+
errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name);
|
|
51217
51221
|
}
|
|
51218
51222
|
return symbol;
|
|
51219
51223
|
}
|
|
51220
51224
|
}
|
|
51221
51225
|
}
|
|
51226
|
+
function errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name) {
|
|
51227
|
+
var _a;
|
|
51228
|
+
var moduleName = getFullyQualifiedName(moduleSymbol, node);
|
|
51229
|
+
var declarationName = ts.declarationNameToString(name);
|
|
51230
|
+
var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
|
|
51231
|
+
if (suggestion !== undefined) {
|
|
51232
|
+
var suggestionName = symbolToString(suggestion);
|
|
51233
|
+
var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
|
|
51234
|
+
if (suggestion.valueDeclaration) {
|
|
51235
|
+
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
|
|
51236
|
+
}
|
|
51237
|
+
}
|
|
51238
|
+
else {
|
|
51239
|
+
if ((_a = moduleSymbol.exports) === null || _a === void 0 ? void 0 : _a.has("default" /* Default */)) {
|
|
51240
|
+
error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);
|
|
51241
|
+
}
|
|
51242
|
+
else {
|
|
51243
|
+
reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName);
|
|
51244
|
+
}
|
|
51245
|
+
}
|
|
51246
|
+
}
|
|
51222
51247
|
function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
|
|
51223
51248
|
var _a, _b;
|
|
51224
51249
|
var localSymbol = (_b = (_a = moduleSymbol.valueDeclaration) === null || _a === void 0 ? void 0 : _a.locals) === null || _b === void 0 ? void 0 : _b.get(name.escapedText);
|
|
@@ -51264,6 +51289,13 @@ var ts;
|
|
|
51264
51289
|
}
|
|
51265
51290
|
}
|
|
51266
51291
|
function getTargetOfImportSpecifier(node, dontResolveAlias) {
|
|
51292
|
+
if (ts.isImportSpecifier(node) && ts.idText(node.propertyName || node.name) === "default" /* Default */) {
|
|
51293
|
+
var specifier = getModuleSpecifierForImportOrExport(node);
|
|
51294
|
+
var moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
|
|
51295
|
+
if (moduleSymbol) {
|
|
51296
|
+
return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
|
|
51297
|
+
}
|
|
51298
|
+
}
|
|
51267
51299
|
var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent;
|
|
51268
51300
|
var commonJSPropertyAccess = getCommonJSPropertyAccess(root);
|
|
51269
51301
|
var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
|
|
@@ -51285,6 +51317,13 @@ var ts;
|
|
|
51285
51317
|
return resolved;
|
|
51286
51318
|
}
|
|
51287
51319
|
function getTargetOfExportSpecifier(node, meaning, dontResolveAlias) {
|
|
51320
|
+
if (ts.idText(node.propertyName || node.name) === "default" /* Default */) {
|
|
51321
|
+
var specifier = getModuleSpecifierForImportOrExport(node);
|
|
51322
|
+
var moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
|
|
51323
|
+
if (moduleSymbol) {
|
|
51324
|
+
return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias);
|
|
51325
|
+
}
|
|
51326
|
+
}
|
|
51288
51327
|
var resolved = node.parent.parent.moduleSpecifier ?
|
|
51289
51328
|
getExternalModuleMember(node.parent.parent, node, dontResolveAlias) :
|
|
51290
51329
|
resolveEntityName(node.propertyName || node.name, meaning, /*ignoreErrors*/ false, dontResolveAlias);
|
|
@@ -55733,7 +55772,7 @@ var ts;
|
|
|
55733
55772
|
// This is an else/if as accessors and properties can't merge in TS, but might in JS
|
|
55734
55773
|
// If this happens, we assume the accessor takes priority, as it imposes more constraints
|
|
55735
55774
|
else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) {
|
|
55736
|
-
return ts.setTextRange(createProperty(ts.factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined, isPrivate ? undefined : serializeTypeForDeclaration(context,
|
|
55775
|
+
return ts.setTextRange(createProperty(ts.factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined, isPrivate ? undefined : serializeTypeForDeclaration(context, getWriteTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled),
|
|
55737
55776
|
// TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357
|
|
55738
55777
|
// interface members can't have initializers, however class members _can_
|
|
55739
55778
|
/*initializer*/ undefined), ((_d = p.declarations) === null || _d === void 0 ? void 0 : _d.find(ts.or(ts.isPropertyDeclaration, ts.isVariableDeclaration))) || firstPropertyLikeDecl);
|
|
@@ -88757,7 +88796,7 @@ var ts;
|
|
|
88757
88796
|
return checkGrammarDecorators(node) || checkGrammarModifiers(node);
|
|
88758
88797
|
}
|
|
88759
88798
|
function checkGrammarDecorators(node) {
|
|
88760
|
-
if (ts.canHaveIllegalDecorators(node) && ts.some(node.
|
|
88799
|
+
if (ts.canHaveIllegalDecorators(node) && ts.some(node.illegalDecorators)) {
|
|
88761
88800
|
return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here);
|
|
88762
88801
|
}
|
|
88763
88802
|
if (!ts.canHaveDecorators(node) || !ts.hasDecorators(node)) {
|
|
@@ -171619,9 +171658,9 @@ var ts;
|
|
|
171619
171658
|
// - error: 5.0
|
|
171620
171659
|
var ts;
|
|
171621
171660
|
(function (ts) {
|
|
171622
|
-
var MUST_MERGE = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators have been combined with modifiers. Callers should switch to an overload
|
|
171623
|
-
var DISALLOW_DECORATORS = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators are no longer supported for this function. Callers should switch to an overload
|
|
171624
|
-
var DISALLOW_DECORATORS_AND_MODIFIERS = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators and modifiers are no longer supported for this function. Callers should switch to an overload
|
|
171661
|
+
var MUST_MERGE = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators have been combined with modifiers. Callers should switch to an overload that does not accept a 'decorators' parameter." };
|
|
171662
|
+
var DISALLOW_DECORATORS = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators are no longer supported for this function. Callers should switch to an overload that does not accept a 'decorators' parameter." };
|
|
171663
|
+
var DISALLOW_DECORATORS_AND_MODIFIERS = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators and modifiers are no longer supported for this function. Callers should switch to an overload that does not accept the 'decorators' and 'modifiers' parameters." };
|
|
171625
171664
|
function patchNodeFactory(factory) {
|
|
171626
171665
|
var createParameterDeclaration = factory.createParameterDeclaration, updateParameterDeclaration = factory.updateParameterDeclaration, createPropertyDeclaration = factory.createPropertyDeclaration, updatePropertyDeclaration = factory.updatePropertyDeclaration, createMethodDeclaration = factory.createMethodDeclaration, updateMethodDeclaration = factory.updateMethodDeclaration, createConstructorDeclaration = factory.createConstructorDeclaration, updateConstructorDeclaration = factory.updateConstructorDeclaration, createGetAccessorDeclaration = factory.createGetAccessorDeclaration, updateGetAccessorDeclaration = factory.updateGetAccessorDeclaration, createSetAccessorDeclaration = factory.createSetAccessorDeclaration, updateSetAccessorDeclaration = factory.updateSetAccessorDeclaration, createIndexSignature = factory.createIndexSignature, updateIndexSignature = factory.updateIndexSignature, createClassStaticBlockDeclaration = factory.createClassStaticBlockDeclaration, updateClassStaticBlockDeclaration = factory.updateClassStaticBlockDeclaration, createClassExpression = factory.createClassExpression, updateClassExpression = factory.updateClassExpression, createFunctionDeclaration = factory.createFunctionDeclaration, updateFunctionDeclaration = factory.updateFunctionDeclaration, createClassDeclaration = factory.createClassDeclaration, updateClassDeclaration = factory.updateClassDeclaration, createInterfaceDeclaration = factory.createInterfaceDeclaration, updateInterfaceDeclaration = factory.updateInterfaceDeclaration, createTypeAliasDeclaration = factory.createTypeAliasDeclaration, updateTypeAliasDeclaration = factory.updateTypeAliasDeclaration, createEnumDeclaration = factory.createEnumDeclaration, updateEnumDeclaration = factory.updateEnumDeclaration, createModuleDeclaration = factory.createModuleDeclaration, updateModuleDeclaration = factory.updateModuleDeclaration, createImportEqualsDeclaration = factory.createImportEqualsDeclaration, updateImportEqualsDeclaration = factory.updateImportEqualsDeclaration, createImportDeclaration = factory.createImportDeclaration, updateImportDeclaration = factory.updateImportDeclaration, createExportAssignment = factory.createExportAssignment, updateExportAssignment = factory.updateExportAssignment, createExportDeclaration = factory.createExportDeclaration, updateExportDeclaration = factory.updateExportDeclaration;
|
|
171627
171666
|
factory.createParameterDeclaration = ts.buildOverload("createParameterDeclaration")
|
|
@@ -171848,7 +171887,7 @@ var ts;
|
|
|
171848
171887
|
return (decorators === undefined || !ts.some(decorators, ts.isModifier)) &&
|
|
171849
171888
|
(modifiers === undefined || !ts.some(modifiers, ts.isParameter)) &&
|
|
171850
171889
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
171851
|
-
(body === undefined ||
|
|
171890
|
+
(body === undefined || ts.isBlock(body));
|
|
171852
171891
|
},
|
|
171853
171892
|
})
|
|
171854
171893
|
.deprecate({
|
|
@@ -171877,7 +171916,7 @@ var ts;
|
|
|
171877
171916
|
return (decorators === undefined || !ts.some(decorators, ts.isModifier)) &&
|
|
171878
171917
|
(modifiers === undefined || !ts.some(modifiers, ts.isParameter)) &&
|
|
171879
171918
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
171880
|
-
(body === undefined ||
|
|
171919
|
+
(body === undefined || ts.isBlock(body));
|
|
171881
171920
|
},
|
|
171882
171921
|
})
|
|
171883
171922
|
.deprecate({
|