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/tsserver.js
CHANGED
|
@@ -109,7 +109,7 @@ var ts;
|
|
|
109
109
|
// The following is baselined as a literal template type without intervention
|
|
110
110
|
/** The version of the TypeScript compiler release */
|
|
111
111
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
112
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
112
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220820";
|
|
113
113
|
/* @internal */
|
|
114
114
|
var Comparison;
|
|
115
115
|
(function (Comparison) {
|
|
@@ -2498,6 +2498,7 @@ var ts;
|
|
|
2498
2498
|
var currentAssertionLevel = 0 /* None */;
|
|
2499
2499
|
Debug.currentLogLevel = LogLevel.Warning;
|
|
2500
2500
|
Debug.isDebugging = false;
|
|
2501
|
+
Debug.enableDeprecationWarnings = true;
|
|
2501
2502
|
function getTypeScriptVersion() {
|
|
2502
2503
|
return typeScriptVersion !== null && typeScriptVersion !== void 0 ? typeScriptVersion : (typeScriptVersion = new ts.Version(ts.version));
|
|
2503
2504
|
}
|
|
@@ -3121,7 +3122,7 @@ var ts;
|
|
|
3121
3122
|
function createWarningDeprecation(name, errorAfter, since, message) {
|
|
3122
3123
|
var hasWrittenDeprecation = false;
|
|
3123
3124
|
return function () {
|
|
3124
|
-
if (!hasWrittenDeprecation) {
|
|
3125
|
+
if (Debug.enableDeprecationWarnings && !hasWrittenDeprecation) {
|
|
3125
3126
|
log.warn(formatDeprecationMessage(name, /*error*/ false, errorAfter, since, message));
|
|
3126
3127
|
hasWrittenDeprecation = true;
|
|
3127
3128
|
}
|
|
@@ -21400,7 +21401,7 @@ var ts;
|
|
|
21400
21401
|
case 165 /* Decorator */: {
|
|
21401
21402
|
var parent_2 = node.parent;
|
|
21402
21403
|
return ts.canHaveDecorators(parent_2) ? parent_2.modifiers :
|
|
21403
|
-
ts.canHaveIllegalDecorators(parent_2) ? parent_2.
|
|
21404
|
+
ts.canHaveIllegalDecorators(parent_2) ? parent_2.illegalDecorators :
|
|
21404
21405
|
undefined;
|
|
21405
21406
|
}
|
|
21406
21407
|
case 291 /* HeritageClause */:
|
|
@@ -23477,7 +23478,7 @@ var ts;
|
|
|
23477
23478
|
node.body = body;
|
|
23478
23479
|
node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */;
|
|
23479
23480
|
// The following properties are used only to report grammar errors
|
|
23480
|
-
node.
|
|
23481
|
+
node.illegalDecorators = undefined;
|
|
23481
23482
|
node.modifiers = undefined;
|
|
23482
23483
|
return node;
|
|
23483
23484
|
}
|
|
@@ -23489,7 +23490,7 @@ var ts;
|
|
|
23489
23490
|
}
|
|
23490
23491
|
function finishUpdateClassStaticBlockDeclaration(updated, original) {
|
|
23491
23492
|
if (updated !== original) {
|
|
23492
|
-
updated.
|
|
23493
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
23493
23494
|
updated.modifiers = original.modifiers;
|
|
23494
23495
|
}
|
|
23495
23496
|
return update(updated, original);
|
|
@@ -23502,7 +23503,7 @@ var ts;
|
|
|
23502
23503
|
/*type*/ undefined, body);
|
|
23503
23504
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
23504
23505
|
// The following properties are used only to report grammar errors
|
|
23505
|
-
node.
|
|
23506
|
+
node.illegalDecorators = undefined;
|
|
23506
23507
|
node.typeParameters = undefined;
|
|
23507
23508
|
node.type = undefined;
|
|
23508
23509
|
return node;
|
|
@@ -23517,7 +23518,7 @@ var ts;
|
|
|
23517
23518
|
}
|
|
23518
23519
|
function finishUpdateConstructorDeclaration(updated, original) {
|
|
23519
23520
|
if (updated !== original) {
|
|
23520
|
-
updated.
|
|
23521
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
23521
23522
|
updated.typeParameters = original.typeParameters;
|
|
23522
23523
|
updated.type = original.type;
|
|
23523
23524
|
}
|
|
@@ -25265,7 +25266,7 @@ var ts;
|
|
|
25265
25266
|
}
|
|
25266
25267
|
}
|
|
25267
25268
|
// The following properties are used only to report grammar errors
|
|
25268
|
-
node.
|
|
25269
|
+
node.illegalDecorators = undefined;
|
|
25269
25270
|
return node;
|
|
25270
25271
|
}
|
|
25271
25272
|
// @api
|
|
@@ -25283,7 +25284,7 @@ var ts;
|
|
|
25283
25284
|
function finishUpdateFunctionDeclaration(updated, original) {
|
|
25284
25285
|
if (updated !== original) {
|
|
25285
25286
|
// copy children used only for error reporting
|
|
25286
|
-
updated.
|
|
25287
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25287
25288
|
}
|
|
25288
25289
|
return finishUpdateBaseSignatureDeclaration(updated, original);
|
|
25289
25290
|
}
|
|
@@ -25317,7 +25318,7 @@ var ts;
|
|
|
25317
25318
|
node.members = createNodeArray(members);
|
|
25318
25319
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
25319
25320
|
// The following properties are used only to report grammar errors
|
|
25320
|
-
node.
|
|
25321
|
+
node.illegalDecorators = undefined;
|
|
25321
25322
|
return node;
|
|
25322
25323
|
}
|
|
25323
25324
|
// @api
|
|
@@ -25332,7 +25333,7 @@ var ts;
|
|
|
25332
25333
|
}
|
|
25333
25334
|
function finishUpdateInterfaceDeclaration(updated, original) {
|
|
25334
25335
|
if (updated !== original) {
|
|
25335
|
-
updated.
|
|
25336
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25336
25337
|
}
|
|
25337
25338
|
return update(updated, original);
|
|
25338
25339
|
}
|
|
@@ -25342,7 +25343,7 @@ var ts;
|
|
|
25342
25343
|
node.type = type;
|
|
25343
25344
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
25344
25345
|
// The following properties are used only to report grammar errors
|
|
25345
|
-
node.
|
|
25346
|
+
node.illegalDecorators = undefined;
|
|
25346
25347
|
return node;
|
|
25347
25348
|
}
|
|
25348
25349
|
// @api
|
|
@@ -25356,7 +25357,7 @@ var ts;
|
|
|
25356
25357
|
}
|
|
25357
25358
|
function finishUpdateTypeAliasDeclaration(updated, original) {
|
|
25358
25359
|
if (updated !== original) {
|
|
25359
|
-
updated.
|
|
25360
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25360
25361
|
}
|
|
25361
25362
|
return update(updated, original);
|
|
25362
25363
|
}
|
|
@@ -25369,7 +25370,7 @@ var ts;
|
|
|
25369
25370
|
1 /* ContainsTypeScript */;
|
|
25370
25371
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // Enum declarations cannot contain `await`
|
|
25371
25372
|
// The following properties are used only to report grammar errors
|
|
25372
|
-
node.
|
|
25373
|
+
node.illegalDecorators = undefined;
|
|
25373
25374
|
return node;
|
|
25374
25375
|
}
|
|
25375
25376
|
// @api
|
|
@@ -25382,7 +25383,7 @@ var ts;
|
|
|
25382
25383
|
}
|
|
25383
25384
|
function finishUpdateEnumDeclaration(updated, original) {
|
|
25384
25385
|
if (updated !== original) {
|
|
25385
|
-
updated.
|
|
25386
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25386
25387
|
}
|
|
25387
25388
|
return update(updated, original);
|
|
25388
25389
|
}
|
|
@@ -25406,7 +25407,7 @@ var ts;
|
|
|
25406
25407
|
}
|
|
25407
25408
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // Module declarations cannot contain `await`.
|
|
25408
25409
|
// The following properties are used only to report grammar errors
|
|
25409
|
-
node.
|
|
25410
|
+
node.illegalDecorators = undefined;
|
|
25410
25411
|
return node;
|
|
25411
25412
|
}
|
|
25412
25413
|
// @api
|
|
@@ -25419,7 +25420,7 @@ var ts;
|
|
|
25419
25420
|
}
|
|
25420
25421
|
function finishUpdateModuleDeclaration(updated, original) {
|
|
25421
25422
|
if (updated !== original) {
|
|
25422
|
-
updated.
|
|
25423
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25423
25424
|
}
|
|
25424
25425
|
return update(updated, original);
|
|
25425
25426
|
}
|
|
@@ -25455,7 +25456,7 @@ var ts;
|
|
|
25455
25456
|
/*modifiers*/ undefined, name);
|
|
25456
25457
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
25457
25458
|
// The following properties are used only to report grammar errors
|
|
25458
|
-
node.
|
|
25459
|
+
node.illegalDecorators = undefined;
|
|
25459
25460
|
node.modifiers = undefined;
|
|
25460
25461
|
return node;
|
|
25461
25462
|
}
|
|
@@ -25467,7 +25468,7 @@ var ts;
|
|
|
25467
25468
|
}
|
|
25468
25469
|
function finishUpdateNamespaceExportDeclaration(updated, original) {
|
|
25469
25470
|
if (updated !== original) {
|
|
25470
|
-
updated.
|
|
25471
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25471
25472
|
updated.modifiers = original.modifiers;
|
|
25472
25473
|
}
|
|
25473
25474
|
return update(updated, original);
|
|
@@ -25482,7 +25483,7 @@ var ts;
|
|
|
25482
25483
|
node.transformFlags |= 1 /* ContainsTypeScript */;
|
|
25483
25484
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // Import= declaration is always parsed in an Await context
|
|
25484
25485
|
// The following properties are used only to report grammar errors
|
|
25485
|
-
node.
|
|
25486
|
+
node.illegalDecorators = undefined;
|
|
25486
25487
|
return node;
|
|
25487
25488
|
}
|
|
25488
25489
|
// @api
|
|
@@ -25496,7 +25497,7 @@ var ts;
|
|
|
25496
25497
|
}
|
|
25497
25498
|
function finishUpdateImportEqualsDeclaration(updated, original) {
|
|
25498
25499
|
if (updated !== original) {
|
|
25499
|
-
updated.
|
|
25500
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25500
25501
|
}
|
|
25501
25502
|
return update(updated, original);
|
|
25502
25503
|
}
|
|
@@ -25512,7 +25513,7 @@ var ts;
|
|
|
25512
25513
|
propagateChildFlags(node.moduleSpecifier);
|
|
25513
25514
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
|
|
25514
25515
|
// The following properties are used only to report grammar errors
|
|
25515
|
-
node.
|
|
25516
|
+
node.illegalDecorators = undefined;
|
|
25516
25517
|
return node;
|
|
25517
25518
|
}
|
|
25518
25519
|
// @api
|
|
@@ -25526,7 +25527,7 @@ var ts;
|
|
|
25526
25527
|
}
|
|
25527
25528
|
function finishUpdateImportDeclaration(updated, original) {
|
|
25528
25529
|
if (updated !== original) {
|
|
25529
|
-
updated.
|
|
25530
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25530
25531
|
}
|
|
25531
25532
|
return update(updated, original);
|
|
25532
25533
|
}
|
|
@@ -25672,7 +25673,7 @@ var ts;
|
|
|
25672
25673
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression);
|
|
25673
25674
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
|
|
25674
25675
|
// The following properties are used only to report grammar errors
|
|
25675
|
-
node.
|
|
25676
|
+
node.illegalDecorators = undefined;
|
|
25676
25677
|
return node;
|
|
25677
25678
|
}
|
|
25678
25679
|
// @api
|
|
@@ -25684,7 +25685,7 @@ var ts;
|
|
|
25684
25685
|
}
|
|
25685
25686
|
function finishUpdateExportAssignment(updated, original) {
|
|
25686
25687
|
if (updated !== original) {
|
|
25687
|
-
updated.
|
|
25688
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25688
25689
|
}
|
|
25689
25690
|
return update(updated, original);
|
|
25690
25691
|
}
|
|
@@ -25702,7 +25703,7 @@ var ts;
|
|
|
25702
25703
|
propagateChildFlags(node.moduleSpecifier);
|
|
25703
25704
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
|
|
25704
25705
|
// The following properties are used only to report grammar errors
|
|
25705
|
-
node.
|
|
25706
|
+
node.illegalDecorators = undefined;
|
|
25706
25707
|
return node;
|
|
25707
25708
|
}
|
|
25708
25709
|
// @api
|
|
@@ -25717,7 +25718,7 @@ var ts;
|
|
|
25717
25718
|
}
|
|
25718
25719
|
function finishUpdateExportDeclaration(updated, original) {
|
|
25719
25720
|
if (updated !== original) {
|
|
25720
|
-
updated.
|
|
25721
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25721
25722
|
}
|
|
25722
25723
|
return update(updated, original);
|
|
25723
25724
|
}
|
|
@@ -26481,7 +26482,7 @@ var ts;
|
|
|
26481
26482
|
propagateChildFlags(node.name) |
|
|
26482
26483
|
propagateChildFlags(node.initializer);
|
|
26483
26484
|
// The following properties are used only to report grammar errors
|
|
26484
|
-
node.
|
|
26485
|
+
node.illegalDecorators = undefined;
|
|
26485
26486
|
node.modifiers = undefined;
|
|
26486
26487
|
node.questionToken = undefined;
|
|
26487
26488
|
node.exclamationToken = undefined;
|
|
@@ -26497,7 +26498,7 @@ var ts;
|
|
|
26497
26498
|
function finishUpdatePropertyAssignment(updated, original) {
|
|
26498
26499
|
// copy children used only for error reporting
|
|
26499
26500
|
if (updated !== original) {
|
|
26500
|
-
updated.
|
|
26501
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
26501
26502
|
updated.modifiers = original.modifiers;
|
|
26502
26503
|
updated.questionToken = original.questionToken;
|
|
26503
26504
|
updated.exclamationToken = original.exclamationToken;
|
|
@@ -26514,7 +26515,7 @@ var ts;
|
|
|
26514
26515
|
1024 /* ContainsES2015 */;
|
|
26515
26516
|
// The following properties are used only to report grammar errors
|
|
26516
26517
|
node.equalsToken = undefined;
|
|
26517
|
-
node.
|
|
26518
|
+
node.illegalDecorators = undefined;
|
|
26518
26519
|
node.modifiers = undefined;
|
|
26519
26520
|
node.questionToken = undefined;
|
|
26520
26521
|
node.exclamationToken = undefined;
|
|
@@ -26531,7 +26532,7 @@ var ts;
|
|
|
26531
26532
|
if (updated !== original) {
|
|
26532
26533
|
// copy children used only for error reporting
|
|
26533
26534
|
updated.equalsToken = original.equalsToken;
|
|
26534
|
-
updated.
|
|
26535
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
26535
26536
|
updated.modifiers = original.modifiers;
|
|
26536
26537
|
updated.questionToken = original.questionToken;
|
|
26537
26538
|
updated.exclamationToken = original.exclamationToken;
|
|
@@ -31010,7 +31011,7 @@ var ts;
|
|
|
31010
31011
|
visitNode(cbNode, node.default) ||
|
|
31011
31012
|
visitNode(cbNode, node.expression);
|
|
31012
31013
|
case 297 /* ShorthandPropertyAssignment */:
|
|
31013
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31014
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31014
31015
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31015
31016
|
visitNode(cbNode, node.name) ||
|
|
31016
31017
|
visitNode(cbNode, node.questionToken) ||
|
|
@@ -31040,7 +31041,7 @@ var ts;
|
|
|
31040
31041
|
visitNode(cbNode, node.type) ||
|
|
31041
31042
|
visitNode(cbNode, node.initializer);
|
|
31042
31043
|
case 296 /* PropertyAssignment */:
|
|
31043
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31044
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31044
31045
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31045
31046
|
visitNode(cbNode, node.name) ||
|
|
31046
31047
|
visitNode(cbNode, node.questionToken) ||
|
|
@@ -31057,7 +31058,7 @@ var ts;
|
|
|
31057
31058
|
visitNode(cbNode, node.name) ||
|
|
31058
31059
|
visitNode(cbNode, node.initializer);
|
|
31059
31060
|
case 176 /* IndexSignature */:
|
|
31060
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31061
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31061
31062
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31062
31063
|
visitNodes(cbNode, cbNodes, node.typeParameters) ||
|
|
31063
31064
|
visitNodes(cbNode, cbNodes, node.parameters) ||
|
|
@@ -31095,7 +31096,7 @@ var ts;
|
|
|
31095
31096
|
visitNodes(cbNode, cbNodes, node.parameters) ||
|
|
31096
31097
|
visitNode(cbNode, node.type);
|
|
31097
31098
|
case 171 /* Constructor */:
|
|
31098
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31099
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31099
31100
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31100
31101
|
visitNode(cbNode, node.name) ||
|
|
31101
31102
|
visitNodes(cbNode, cbNodes, node.typeParameters) ||
|
|
@@ -31117,7 +31118,7 @@ var ts;
|
|
|
31117
31118
|
visitNode(cbNode, node.type) ||
|
|
31118
31119
|
visitNode(cbNode, node.body);
|
|
31119
31120
|
case 256 /* FunctionDeclaration */:
|
|
31120
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31121
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31121
31122
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31122
31123
|
visitNode(cbNode, node.asteriskToken) ||
|
|
31123
31124
|
visitNode(cbNode, node.name) ||
|
|
@@ -31141,7 +31142,7 @@ var ts;
|
|
|
31141
31142
|
visitNode(cbNode, node.equalsGreaterThanToken) ||
|
|
31142
31143
|
visitNode(cbNode, node.body);
|
|
31143
31144
|
case 170 /* ClassStaticBlockDeclaration */:
|
|
31144
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31145
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31145
31146
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31146
31147
|
visitNode(cbNode, node.body);
|
|
31147
31148
|
case 178 /* TypeReference */:
|
|
@@ -31269,7 +31270,7 @@ var ts;
|
|
|
31269
31270
|
return visitNodes(cbNode, cbNodes, node.statements) ||
|
|
31270
31271
|
visitNode(cbNode, node.endOfFileToken);
|
|
31271
31272
|
case 237 /* VariableStatement */:
|
|
31272
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31273
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31273
31274
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31274
31275
|
visitNode(cbNode, node.declarationList);
|
|
31275
31276
|
case 255 /* VariableDeclarationList */:
|
|
@@ -31340,20 +31341,20 @@ var ts;
|
|
|
31340
31341
|
visitNodes(cbNode, cbNodes, node.heritageClauses) ||
|
|
31341
31342
|
visitNodes(cbNode, cbNodes, node.members);
|
|
31342
31343
|
case 258 /* InterfaceDeclaration */:
|
|
31343
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31344
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31344
31345
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31345
31346
|
visitNode(cbNode, node.name) ||
|
|
31346
31347
|
visitNodes(cbNode, cbNodes, node.typeParameters) ||
|
|
31347
31348
|
visitNodes(cbNode, cbNodes, node.heritageClauses) ||
|
|
31348
31349
|
visitNodes(cbNode, cbNodes, node.members);
|
|
31349
31350
|
case 259 /* TypeAliasDeclaration */:
|
|
31350
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31351
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31351
31352
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31352
31353
|
visitNode(cbNode, node.name) ||
|
|
31353
31354
|
visitNodes(cbNode, cbNodes, node.typeParameters) ||
|
|
31354
31355
|
visitNode(cbNode, node.type);
|
|
31355
31356
|
case 260 /* EnumDeclaration */:
|
|
31356
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31357
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31357
31358
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31358
31359
|
visitNode(cbNode, node.name) ||
|
|
31359
31360
|
visitNodes(cbNode, cbNodes, node.members);
|
|
@@ -31361,17 +31362,17 @@ var ts;
|
|
|
31361
31362
|
return visitNode(cbNode, node.name) ||
|
|
31362
31363
|
visitNode(cbNode, node.initializer);
|
|
31363
31364
|
case 261 /* ModuleDeclaration */:
|
|
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.name) ||
|
|
31367
31368
|
visitNode(cbNode, node.body);
|
|
31368
31369
|
case 265 /* ImportEqualsDeclaration */:
|
|
31369
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31370
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31370
31371
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31371
31372
|
visitNode(cbNode, node.name) ||
|
|
31372
31373
|
visitNode(cbNode, node.moduleReference);
|
|
31373
31374
|
case 266 /* ImportDeclaration */:
|
|
31374
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31375
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31375
31376
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31376
31377
|
visitNode(cbNode, node.importClause) ||
|
|
31377
31378
|
visitNode(cbNode, node.moduleSpecifier) ||
|
|
@@ -31385,7 +31386,7 @@ var ts;
|
|
|
31385
31386
|
return visitNode(cbNode, node.name) ||
|
|
31386
31387
|
visitNode(cbNode, node.value);
|
|
31387
31388
|
case 264 /* NamespaceExportDeclaration */:
|
|
31388
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31389
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31389
31390
|
visitNode(cbNode, node.name);
|
|
31390
31391
|
case 268 /* NamespaceImport */:
|
|
31391
31392
|
return visitNode(cbNode, node.name);
|
|
@@ -31395,7 +31396,7 @@ var ts;
|
|
|
31395
31396
|
case 273 /* NamedExports */:
|
|
31396
31397
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
31397
31398
|
case 272 /* ExportDeclaration */:
|
|
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.exportClause) ||
|
|
31401
31402
|
visitNode(cbNode, node.moduleSpecifier) ||
|
|
@@ -31405,7 +31406,7 @@ var ts;
|
|
|
31405
31406
|
return visitNode(cbNode, node.propertyName) ||
|
|
31406
31407
|
visitNode(cbNode, node.name);
|
|
31407
31408
|
case 271 /* ExportAssignment */:
|
|
31408
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31409
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31409
31410
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31410
31411
|
visitNode(cbNode, node.expression);
|
|
31411
31412
|
case 223 /* TemplateExpression */:
|
|
@@ -31430,7 +31431,7 @@ var ts;
|
|
|
31430
31431
|
case 277 /* ExternalModuleReference */:
|
|
31431
31432
|
return visitNode(cbNode, node.expression);
|
|
31432
31433
|
case 276 /* MissingDeclaration */:
|
|
31433
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31434
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31434
31435
|
visitNodes(cbNode, cbNodes, node.modifiers);
|
|
31435
31436
|
case 351 /* CommaListExpression */:
|
|
31436
31437
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
@@ -33981,7 +33982,7 @@ var ts;
|
|
|
33981
33982
|
var type = parseTypeAnnotation();
|
|
33982
33983
|
parseTypeMemberSemicolon();
|
|
33983
33984
|
var node = factory.createIndexSignature(modifiers, parameters, type);
|
|
33984
|
-
node.
|
|
33985
|
+
node.illegalDecorators = decorators;
|
|
33985
33986
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
33986
33987
|
}
|
|
33987
33988
|
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
|
|
@@ -36141,7 +36142,7 @@ var ts;
|
|
|
36141
36142
|
node = factory.createPropertyAssignment(name, initializer);
|
|
36142
36143
|
}
|
|
36143
36144
|
// Decorators, Modifiers, questionToken, and exclamationToken are not supported by property assignments and are reported in the grammar checker
|
|
36144
|
-
node.
|
|
36145
|
+
node.illegalDecorators = decorators;
|
|
36145
36146
|
node.modifiers = modifiers;
|
|
36146
36147
|
node.questionToken = questionToken;
|
|
36147
36148
|
node.exclamationToken = exclamationToken;
|
|
@@ -36789,7 +36790,7 @@ var ts;
|
|
|
36789
36790
|
// would follow. For recovery and error reporting purposes, return an incomplete declaration.
|
|
36790
36791
|
var missing = createMissingNode(276 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected);
|
|
36791
36792
|
ts.setTextRangePos(missing, pos);
|
|
36792
|
-
missing.
|
|
36793
|
+
missing.illegalDecorators = decorators;
|
|
36793
36794
|
missing.modifiers = modifiers;
|
|
36794
36795
|
return missing;
|
|
36795
36796
|
}
|
|
@@ -36932,7 +36933,7 @@ var ts;
|
|
|
36932
36933
|
parseSemicolon();
|
|
36933
36934
|
var node = factory.createVariableStatement(modifiers, declarationList);
|
|
36934
36935
|
// Decorators are not allowed on a variable statement, so we keep track of them to report them in the grammar checker.
|
|
36935
|
-
node.
|
|
36936
|
+
node.illegalDecorators = decorators;
|
|
36936
36937
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36937
36938
|
}
|
|
36938
36939
|
function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -36952,7 +36953,7 @@ var ts;
|
|
|
36952
36953
|
var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, ts.Diagnostics.or_expected);
|
|
36953
36954
|
setAwaitContext(savedAwaitContext);
|
|
36954
36955
|
var node = factory.createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body);
|
|
36955
|
-
node.
|
|
36956
|
+
node.illegalDecorators = decorators;
|
|
36956
36957
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36957
36958
|
}
|
|
36958
36959
|
function parseConstructorName() {
|
|
@@ -36975,7 +36976,7 @@ var ts;
|
|
|
36975
36976
|
var body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected);
|
|
36976
36977
|
var node = factory.createConstructorDeclaration(modifiers, parameters, body);
|
|
36977
36978
|
// Attach invalid nodes if they exist so that we can report them in the grammar checker.
|
|
36978
|
-
node.
|
|
36979
|
+
node.illegalDecorators = decorators;
|
|
36979
36980
|
node.typeParameters = typeParameters;
|
|
36980
36981
|
node.type = type;
|
|
36981
36982
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
@@ -37091,7 +37092,7 @@ var ts;
|
|
|
37091
37092
|
parseExpectedToken(124 /* StaticKeyword */);
|
|
37092
37093
|
var body = parseClassStaticBlockBody();
|
|
37093
37094
|
var node = withJSDoc(finishNode(factory.createClassStaticBlockDeclaration(body), pos), hasJSDoc);
|
|
37094
|
-
node.
|
|
37095
|
+
node.illegalDecorators = decorators;
|
|
37095
37096
|
node.modifiers = modifiers;
|
|
37096
37097
|
return node;
|
|
37097
37098
|
}
|
|
@@ -37332,7 +37333,7 @@ var ts;
|
|
|
37332
37333
|
var heritageClauses = parseHeritageClauses();
|
|
37333
37334
|
var members = parseObjectTypeMembers();
|
|
37334
37335
|
var node = factory.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members);
|
|
37335
|
-
node.
|
|
37336
|
+
node.illegalDecorators = decorators;
|
|
37336
37337
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37337
37338
|
}
|
|
37338
37339
|
function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -37343,7 +37344,7 @@ var ts;
|
|
|
37343
37344
|
var type = token() === 138 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType();
|
|
37344
37345
|
parseSemicolon();
|
|
37345
37346
|
var node = factory.createTypeAliasDeclaration(modifiers, name, typeParameters, type);
|
|
37346
|
-
node.
|
|
37347
|
+
node.illegalDecorators = decorators;
|
|
37347
37348
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37348
37349
|
}
|
|
37349
37350
|
// In an ambient declaration, the grammar only allows integer literals as initializers.
|
|
@@ -37369,7 +37370,7 @@ var ts;
|
|
|
37369
37370
|
members = createMissingList();
|
|
37370
37371
|
}
|
|
37371
37372
|
var node = factory.createEnumDeclaration(modifiers, name, members);
|
|
37372
|
-
node.
|
|
37373
|
+
node.illegalDecorators = decorators;
|
|
37373
37374
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37374
37375
|
}
|
|
37375
37376
|
function parseModuleBlock() {
|
|
@@ -37393,7 +37394,7 @@ var ts;
|
|
|
37393
37394
|
? parseModuleOrNamespaceDeclaration(getNodePos(), /*hasJSDoc*/ false, /*decorators*/ undefined, /*modifiers*/ undefined, 4 /* NestedNamespace */ | namespaceFlag)
|
|
37394
37395
|
: parseModuleBlock();
|
|
37395
37396
|
var node = factory.createModuleDeclaration(modifiers, name, body, flags);
|
|
37396
|
-
node.
|
|
37397
|
+
node.illegalDecorators = decorators;
|
|
37397
37398
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37398
37399
|
}
|
|
37399
37400
|
function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -37416,7 +37417,7 @@ var ts;
|
|
|
37416
37417
|
parseSemicolon();
|
|
37417
37418
|
}
|
|
37418
37419
|
var node = factory.createModuleDeclaration(modifiers, name, body, flags);
|
|
37419
|
-
node.
|
|
37420
|
+
node.illegalDecorators = decorators;
|
|
37420
37421
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37421
37422
|
}
|
|
37422
37423
|
function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -37456,7 +37457,7 @@ var ts;
|
|
|
37456
37457
|
parseSemicolon();
|
|
37457
37458
|
var node = factory.createNamespaceExportDeclaration(name);
|
|
37458
37459
|
// NamespaceExportDeclaration nodes cannot have decorators or modifiers, so we attach them here so we can report them in the grammar checker
|
|
37459
|
-
node.
|
|
37460
|
+
node.illegalDecorators = decorators;
|
|
37460
37461
|
node.modifiers = modifiers;
|
|
37461
37462
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37462
37463
|
}
|
|
@@ -37496,7 +37497,7 @@ var ts;
|
|
|
37496
37497
|
}
|
|
37497
37498
|
parseSemicolon();
|
|
37498
37499
|
var node = factory.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause);
|
|
37499
|
-
node.
|
|
37500
|
+
node.illegalDecorators = decorators;
|
|
37500
37501
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37501
37502
|
}
|
|
37502
37503
|
function parseAssertEntry() {
|
|
@@ -37541,7 +37542,7 @@ var ts;
|
|
|
37541
37542
|
var moduleReference = parseModuleReference();
|
|
37542
37543
|
parseSemicolon();
|
|
37543
37544
|
var node = factory.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference);
|
|
37544
|
-
node.
|
|
37545
|
+
node.illegalDecorators = decorators;
|
|
37545
37546
|
var finished = withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37546
37547
|
return finished;
|
|
37547
37548
|
}
|
|
@@ -37731,7 +37732,7 @@ var ts;
|
|
|
37731
37732
|
parseSemicolon();
|
|
37732
37733
|
setAwaitContext(savedAwaitContext);
|
|
37733
37734
|
var node = factory.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause);
|
|
37734
|
-
node.
|
|
37735
|
+
node.illegalDecorators = decorators;
|
|
37735
37736
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37736
37737
|
}
|
|
37737
37738
|
function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -37748,7 +37749,7 @@ var ts;
|
|
|
37748
37749
|
parseSemicolon();
|
|
37749
37750
|
setAwaitContext(savedAwaitContext);
|
|
37750
37751
|
var node = factory.createExportAssignment(modifiers, isExportEquals, expression);
|
|
37751
|
-
node.
|
|
37752
|
+
node.illegalDecorators = decorators;
|
|
37752
37753
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37753
37754
|
}
|
|
37754
37755
|
var ParsingContext;
|
|
@@ -51046,41 +51047,61 @@ var ts;
|
|
|
51046
51047
|
return typeof file.externalModuleIndicator !== "object" && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), /*sourceNode*/ undefined, dontResolveAlias);
|
|
51047
51048
|
}
|
|
51048
51049
|
function getTargetOfImportClause(node, dontResolveAlias) {
|
|
51049
|
-
var _a;
|
|
51050
51050
|
var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
|
|
51051
51051
|
if (moduleSymbol) {
|
|
51052
|
-
|
|
51053
|
-
|
|
51054
|
-
|
|
51055
|
-
|
|
51056
|
-
|
|
51057
|
-
|
|
51058
|
-
|
|
51059
|
-
|
|
51060
|
-
|
|
51061
|
-
|
|
51062
|
-
|
|
51063
|
-
|
|
51064
|
-
|
|
51065
|
-
|
|
51066
|
-
|
|
51067
|
-
|
|
51068
|
-
|
|
51069
|
-
|
|
51070
|
-
|
|
51071
|
-
|
|
51072
|
-
|
|
51073
|
-
|
|
51052
|
+
return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
|
|
51053
|
+
}
|
|
51054
|
+
}
|
|
51055
|
+
function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) {
|
|
51056
|
+
var _a;
|
|
51057
|
+
var exportDefaultSymbol;
|
|
51058
|
+
if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
|
|
51059
|
+
exportDefaultSymbol = moduleSymbol;
|
|
51060
|
+
}
|
|
51061
|
+
else {
|
|
51062
|
+
exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias);
|
|
51063
|
+
}
|
|
51064
|
+
var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
51065
|
+
var specifier = getModuleSpecifierForImportOrExport(node);
|
|
51066
|
+
if (!specifier) {
|
|
51067
|
+
return exportDefaultSymbol;
|
|
51068
|
+
}
|
|
51069
|
+
var hasDefaultOnly = isOnlyImportedAsDefault(specifier);
|
|
51070
|
+
var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier);
|
|
51071
|
+
if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
|
|
51072
|
+
if (hasExportAssignmentSymbol(moduleSymbol)) {
|
|
51073
|
+
var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
|
|
51074
|
+
var exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */);
|
|
51075
|
+
var exportAssignment = exportEqualsSymbol.valueDeclaration;
|
|
51076
|
+
var err = error(node.name, ts.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName);
|
|
51077
|
+
if (exportAssignment) {
|
|
51078
|
+
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));
|
|
51074
51079
|
}
|
|
51075
51080
|
}
|
|
51076
|
-
else if (
|
|
51077
|
-
|
|
51078
|
-
|
|
51079
|
-
|
|
51080
|
-
|
|
51081
|
+
else if (ts.isImportClause(node)) {
|
|
51082
|
+
reportNonDefaultExport(moduleSymbol, node);
|
|
51083
|
+
}
|
|
51084
|
+
else {
|
|
51085
|
+
errorNoModuleMemberSymbol(moduleSymbol, moduleSymbol, node, ts.isImportOrExportSpecifier(node) && node.propertyName || node.name);
|
|
51081
51086
|
}
|
|
51082
|
-
|
|
51083
|
-
|
|
51087
|
+
}
|
|
51088
|
+
else if (hasSyntheticDefault || hasDefaultOnly) {
|
|
51089
|
+
// per emit behavior, a synthetic default overrides a "real" .default member if `__esModule` is not present
|
|
51090
|
+
var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
51091
|
+
markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, /*overwriteTypeOnly*/ false);
|
|
51092
|
+
return resolved;
|
|
51093
|
+
}
|
|
51094
|
+
markSymbolOfAliasDeclarationIfTypeOnly(node, exportDefaultSymbol, /*finalTarget*/ undefined, /*overwriteTypeOnly*/ false);
|
|
51095
|
+
return exportDefaultSymbol;
|
|
51096
|
+
}
|
|
51097
|
+
function getModuleSpecifierForImportOrExport(node) {
|
|
51098
|
+
switch (node.kind) {
|
|
51099
|
+
case 267 /* ImportClause */: return node.parent.moduleSpecifier;
|
|
51100
|
+
case 265 /* ImportEqualsDeclaration */: return ts.isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : undefined;
|
|
51101
|
+
case 268 /* NamespaceImport */: return node.parent.parent.moduleSpecifier;
|
|
51102
|
+
case 270 /* ImportSpecifier */: return node.parent.parent.parent.moduleSpecifier;
|
|
51103
|
+
case 275 /* ExportSpecifier */: return node.parent.parent.moduleSpecifier;
|
|
51104
|
+
default: return ts.Debug.assertNever(node);
|
|
51084
51105
|
}
|
|
51085
51106
|
}
|
|
51086
51107
|
function reportNonDefaultExport(moduleSymbol, node) {
|
|
@@ -51170,7 +51191,7 @@ var ts;
|
|
|
51170
51191
|
}
|
|
51171
51192
|
}
|
|
51172
51193
|
function getExternalModuleMember(node, specifier, dontResolveAlias) {
|
|
51173
|
-
var _a
|
|
51194
|
+
var _a;
|
|
51174
51195
|
if (dontResolveAlias === void 0) { dontResolveAlias = false; }
|
|
51175
51196
|
var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier;
|
|
51176
51197
|
var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); // TODO: GH#18217
|
|
@@ -51206,29 +51227,33 @@ var ts;
|
|
|
51206
51227
|
combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) :
|
|
51207
51228
|
symbolFromModule || symbolFromVariable;
|
|
51208
51229
|
if (!symbol) {
|
|
51209
|
-
|
|
51210
|
-
var declarationName = ts.declarationNameToString(name);
|
|
51211
|
-
var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
|
|
51212
|
-
if (suggestion !== undefined) {
|
|
51213
|
-
var suggestionName = symbolToString(suggestion);
|
|
51214
|
-
var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
|
|
51215
|
-
if (suggestion.valueDeclaration) {
|
|
51216
|
-
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
|
|
51217
|
-
}
|
|
51218
|
-
}
|
|
51219
|
-
else {
|
|
51220
|
-
if ((_b = moduleSymbol.exports) === null || _b === void 0 ? void 0 : _b.has("default" /* Default */)) {
|
|
51221
|
-
error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);
|
|
51222
|
-
}
|
|
51223
|
-
else {
|
|
51224
|
-
reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName);
|
|
51225
|
-
}
|
|
51226
|
-
}
|
|
51230
|
+
errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name);
|
|
51227
51231
|
}
|
|
51228
51232
|
return symbol;
|
|
51229
51233
|
}
|
|
51230
51234
|
}
|
|
51231
51235
|
}
|
|
51236
|
+
function errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name) {
|
|
51237
|
+
var _a;
|
|
51238
|
+
var moduleName = getFullyQualifiedName(moduleSymbol, node);
|
|
51239
|
+
var declarationName = ts.declarationNameToString(name);
|
|
51240
|
+
var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
|
|
51241
|
+
if (suggestion !== undefined) {
|
|
51242
|
+
var suggestionName = symbolToString(suggestion);
|
|
51243
|
+
var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
|
|
51244
|
+
if (suggestion.valueDeclaration) {
|
|
51245
|
+
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
|
|
51246
|
+
}
|
|
51247
|
+
}
|
|
51248
|
+
else {
|
|
51249
|
+
if ((_a = moduleSymbol.exports) === null || _a === void 0 ? void 0 : _a.has("default" /* Default */)) {
|
|
51250
|
+
error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);
|
|
51251
|
+
}
|
|
51252
|
+
else {
|
|
51253
|
+
reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName);
|
|
51254
|
+
}
|
|
51255
|
+
}
|
|
51256
|
+
}
|
|
51232
51257
|
function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
|
|
51233
51258
|
var _a, _b;
|
|
51234
51259
|
var localSymbol = (_b = (_a = moduleSymbol.valueDeclaration) === null || _a === void 0 ? void 0 : _a.locals) === null || _b === void 0 ? void 0 : _b.get(name.escapedText);
|
|
@@ -51274,6 +51299,13 @@ var ts;
|
|
|
51274
51299
|
}
|
|
51275
51300
|
}
|
|
51276
51301
|
function getTargetOfImportSpecifier(node, dontResolveAlias) {
|
|
51302
|
+
if (ts.isImportSpecifier(node) && ts.idText(node.propertyName || node.name) === "default" /* Default */) {
|
|
51303
|
+
var specifier = getModuleSpecifierForImportOrExport(node);
|
|
51304
|
+
var moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
|
|
51305
|
+
if (moduleSymbol) {
|
|
51306
|
+
return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
|
|
51307
|
+
}
|
|
51308
|
+
}
|
|
51277
51309
|
var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent;
|
|
51278
51310
|
var commonJSPropertyAccess = getCommonJSPropertyAccess(root);
|
|
51279
51311
|
var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
|
|
@@ -51295,6 +51327,13 @@ var ts;
|
|
|
51295
51327
|
return resolved;
|
|
51296
51328
|
}
|
|
51297
51329
|
function getTargetOfExportSpecifier(node, meaning, dontResolveAlias) {
|
|
51330
|
+
if (ts.idText(node.propertyName || node.name) === "default" /* Default */) {
|
|
51331
|
+
var specifier = getModuleSpecifierForImportOrExport(node);
|
|
51332
|
+
var moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
|
|
51333
|
+
if (moduleSymbol) {
|
|
51334
|
+
return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias);
|
|
51335
|
+
}
|
|
51336
|
+
}
|
|
51298
51337
|
var resolved = node.parent.parent.moduleSpecifier ?
|
|
51299
51338
|
getExternalModuleMember(node.parent.parent, node, dontResolveAlias) :
|
|
51300
51339
|
resolveEntityName(node.propertyName || node.name, meaning, /*ignoreErrors*/ false, dontResolveAlias);
|
|
@@ -55743,7 +55782,7 @@ var ts;
|
|
|
55743
55782
|
// This is an else/if as accessors and properties can't merge in TS, but might in JS
|
|
55744
55783
|
// If this happens, we assume the accessor takes priority, as it imposes more constraints
|
|
55745
55784
|
else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) {
|
|
55746
|
-
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,
|
|
55785
|
+
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),
|
|
55747
55786
|
// TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357
|
|
55748
55787
|
// interface members can't have initializers, however class members _can_
|
|
55749
55788
|
/*initializer*/ undefined), ((_d = p.declarations) === null || _d === void 0 ? void 0 : _d.find(ts.or(ts.isPropertyDeclaration, ts.isVariableDeclaration))) || firstPropertyLikeDecl);
|
|
@@ -88767,7 +88806,7 @@ var ts;
|
|
|
88767
88806
|
return checkGrammarDecorators(node) || checkGrammarModifiers(node);
|
|
88768
88807
|
}
|
|
88769
88808
|
function checkGrammarDecorators(node) {
|
|
88770
|
-
if (ts.canHaveIllegalDecorators(node) && ts.some(node.
|
|
88809
|
+
if (ts.canHaveIllegalDecorators(node) && ts.some(node.illegalDecorators)) {
|
|
88771
88810
|
return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here);
|
|
88772
88811
|
}
|
|
88773
88812
|
if (!ts.canHaveDecorators(node) || !ts.hasDecorators(node)) {
|
|
@@ -182699,9 +182738,9 @@ var ts;
|
|
|
182699
182738
|
// - error: 5.0
|
|
182700
182739
|
var ts;
|
|
182701
182740
|
(function (ts) {
|
|
182702
|
-
var MUST_MERGE = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators have been combined with modifiers. Callers should switch to an overload
|
|
182703
|
-
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
|
|
182704
|
-
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
|
|
182741
|
+
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." };
|
|
182742
|
+
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." };
|
|
182743
|
+
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." };
|
|
182705
182744
|
function patchNodeFactory(factory) {
|
|
182706
182745
|
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;
|
|
182707
182746
|
factory.createParameterDeclaration = ts.buildOverload("createParameterDeclaration")
|
|
@@ -182928,7 +182967,7 @@ var ts;
|
|
|
182928
182967
|
return (decorators === undefined || !ts.some(decorators, ts.isModifier)) &&
|
|
182929
182968
|
(modifiers === undefined || !ts.some(modifiers, ts.isParameter)) &&
|
|
182930
182969
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
182931
|
-
(body === undefined ||
|
|
182970
|
+
(body === undefined || ts.isBlock(body));
|
|
182932
182971
|
},
|
|
182933
182972
|
})
|
|
182934
182973
|
.deprecate({
|
|
@@ -182957,7 +182996,7 @@ var ts;
|
|
|
182957
182996
|
return (decorators === undefined || !ts.some(decorators, ts.isModifier)) &&
|
|
182958
182997
|
(modifiers === undefined || !ts.some(modifiers, ts.isParameter)) &&
|
|
182959
182998
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
182960
|
-
(body === undefined ||
|
|
182999
|
+
(body === undefined || ts.isBlock(body));
|
|
182961
183000
|
},
|
|
182962
183001
|
})
|
|
182963
183002
|
.deprecate({
|