typescript 4.8.1-rc → 4.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +125 -145
- package/lib/tsserver.js +132 -150
- package/lib/tsserverlibrary.d.ts +61 -117
- package/lib/tsserverlibrary.js +132 -150
- package/lib/typescript.d.ts +61 -117
- package/lib/typescript.js +132 -150
- package/lib/typescriptServices.d.ts +61 -117
- package/lib/typescriptServices.js +132 -150
- package/lib/typingsInstaller.js +127 -145
- package/package.json +1 -1
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 = "4.8.
|
|
112
|
+
ts.version = "4.8.2";
|
|
113
113
|
/* @internal */
|
|
114
114
|
var Comparison;
|
|
115
115
|
(function (Comparison) {
|
|
@@ -2489,6 +2489,7 @@ var ts;
|
|
|
2489
2489
|
var currentAssertionLevel = 0 /* AssertionLevel.None */;
|
|
2490
2490
|
Debug.currentLogLevel = LogLevel.Warning;
|
|
2491
2491
|
Debug.isDebugging = false;
|
|
2492
|
+
Debug.enableDeprecationWarnings = true;
|
|
2492
2493
|
function getTypeScriptVersion() {
|
|
2493
2494
|
return typeScriptVersion !== null && typeScriptVersion !== void 0 ? typeScriptVersion : (typeScriptVersion = new ts.Version(ts.version));
|
|
2494
2495
|
}
|
|
@@ -3112,7 +3113,7 @@ var ts;
|
|
|
3112
3113
|
function createWarningDeprecation(name, errorAfter, since, message) {
|
|
3113
3114
|
var hasWrittenDeprecation = false;
|
|
3114
3115
|
return function () {
|
|
3115
|
-
if (!hasWrittenDeprecation) {
|
|
3116
|
+
if (Debug.enableDeprecationWarnings && !hasWrittenDeprecation) {
|
|
3116
3117
|
log.warn(formatDeprecationMessage(name, /*error*/ false, errorAfter, since, message));
|
|
3117
3118
|
hasWrittenDeprecation = true;
|
|
3118
3119
|
}
|
|
@@ -7000,7 +7001,6 @@ var ts;
|
|
|
7000
7001
|
// not actually work.
|
|
7001
7002
|
var byteOrderMarkIndicator = "\uFEFF";
|
|
7002
7003
|
function getNodeSystem() {
|
|
7003
|
-
var _a;
|
|
7004
7004
|
var nativePattern = /^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/;
|
|
7005
7005
|
var _fs = require("fs");
|
|
7006
7006
|
var _path = require("path");
|
|
@@ -7010,7 +7010,7 @@ var ts;
|
|
|
7010
7010
|
try {
|
|
7011
7011
|
_crypto = require("crypto");
|
|
7012
7012
|
}
|
|
7013
|
-
catch (
|
|
7013
|
+
catch (_a) {
|
|
7014
7014
|
_crypto = undefined;
|
|
7015
7015
|
}
|
|
7016
7016
|
var activeSession;
|
|
@@ -7021,10 +7021,10 @@ var ts;
|
|
|
7021
7021
|
var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
7022
7022
|
var platform = _os.platform();
|
|
7023
7023
|
var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
|
7024
|
-
var
|
|
7024
|
+
var fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
|
7025
7025
|
var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
|
|
7026
7026
|
var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
|
|
7027
|
-
var
|
|
7027
|
+
var _b = createSystemWatchFunctions({
|
|
7028
7028
|
pollingWatchFile: createSingleFileWatcherPerName(fsWatchFileWorker, useCaseSensitiveFileNames),
|
|
7029
7029
|
getModifiedTime: getModifiedTime,
|
|
7030
7030
|
setTimeout: setTimeout,
|
|
@@ -7044,7 +7044,7 @@ var ts;
|
|
|
7044
7044
|
defaultWatchFileKind: function () { var _a, _b; return (_b = (_a = sys).defaultWatchFileKind) === null || _b === void 0 ? void 0 : _b.call(_a); },
|
|
7045
7045
|
inodeWatching: isLinuxOrMacOs,
|
|
7046
7046
|
sysLog: sysLog,
|
|
7047
|
-
}), watchFile =
|
|
7047
|
+
}), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory;
|
|
7048
7048
|
var nodeSystem = {
|
|
7049
7049
|
args: process.argv.slice(2),
|
|
7050
7050
|
newLine: _os.EOL,
|
|
@@ -7437,9 +7437,12 @@ var ts;
|
|
|
7437
7437
|
function getDirectories(path) {
|
|
7438
7438
|
return getAccessibleFileSystemEntries(path).directories.slice();
|
|
7439
7439
|
}
|
|
7440
|
+
function fsRealPathHandlingLongPath(path) {
|
|
7441
|
+
return path.length < 260 ? _fs.realpathSync.native(path) : _fs.realpathSync(path);
|
|
7442
|
+
}
|
|
7440
7443
|
function realpath(path) {
|
|
7441
7444
|
try {
|
|
7442
|
-
return
|
|
7445
|
+
return fsRealpath(path);
|
|
7443
7446
|
}
|
|
7444
7447
|
catch (_a) {
|
|
7445
7448
|
return path;
|
|
@@ -21367,7 +21370,7 @@ var ts;
|
|
|
21367
21370
|
case 165 /* SyntaxKind.Decorator */: {
|
|
21368
21371
|
var parent_2 = node.parent;
|
|
21369
21372
|
return ts.canHaveDecorators(parent_2) ? parent_2.modifiers :
|
|
21370
|
-
ts.canHaveIllegalDecorators(parent_2) ? parent_2.
|
|
21373
|
+
ts.canHaveIllegalDecorators(parent_2) ? parent_2.illegalDecorators :
|
|
21371
21374
|
undefined;
|
|
21372
21375
|
}
|
|
21373
21376
|
case 291 /* SyntaxKind.HeritageClause */:
|
|
@@ -23444,7 +23447,7 @@ var ts;
|
|
|
23444
23447
|
node.body = body;
|
|
23445
23448
|
node.transformFlags = propagateChildFlags(body) | 16777216 /* TransformFlags.ContainsClassFields */;
|
|
23446
23449
|
// The following properties are used only to report grammar errors
|
|
23447
|
-
node.
|
|
23450
|
+
node.illegalDecorators = undefined;
|
|
23448
23451
|
node.modifiers = undefined;
|
|
23449
23452
|
return node;
|
|
23450
23453
|
}
|
|
@@ -23456,7 +23459,7 @@ var ts;
|
|
|
23456
23459
|
}
|
|
23457
23460
|
function finishUpdateClassStaticBlockDeclaration(updated, original) {
|
|
23458
23461
|
if (updated !== original) {
|
|
23459
|
-
updated.
|
|
23462
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
23460
23463
|
updated.modifiers = original.modifiers;
|
|
23461
23464
|
}
|
|
23462
23465
|
return update(updated, original);
|
|
@@ -23469,7 +23472,7 @@ var ts;
|
|
|
23469
23472
|
/*type*/ undefined, body);
|
|
23470
23473
|
node.transformFlags |= 1024 /* TransformFlags.ContainsES2015 */;
|
|
23471
23474
|
// The following properties are used only to report grammar errors
|
|
23472
|
-
node.
|
|
23475
|
+
node.illegalDecorators = undefined;
|
|
23473
23476
|
node.typeParameters = undefined;
|
|
23474
23477
|
node.type = undefined;
|
|
23475
23478
|
return node;
|
|
@@ -23484,7 +23487,7 @@ var ts;
|
|
|
23484
23487
|
}
|
|
23485
23488
|
function finishUpdateConstructorDeclaration(updated, original) {
|
|
23486
23489
|
if (updated !== original) {
|
|
23487
|
-
updated.
|
|
23490
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
23488
23491
|
updated.typeParameters = original.typeParameters;
|
|
23489
23492
|
updated.type = original.type;
|
|
23490
23493
|
}
|
|
@@ -25232,7 +25235,7 @@ var ts;
|
|
|
25232
25235
|
}
|
|
25233
25236
|
}
|
|
25234
25237
|
// The following properties are used only to report grammar errors
|
|
25235
|
-
node.
|
|
25238
|
+
node.illegalDecorators = undefined;
|
|
25236
25239
|
return node;
|
|
25237
25240
|
}
|
|
25238
25241
|
// @api
|
|
@@ -25250,7 +25253,7 @@ var ts;
|
|
|
25250
25253
|
function finishUpdateFunctionDeclaration(updated, original) {
|
|
25251
25254
|
if (updated !== original) {
|
|
25252
25255
|
// copy children used only for error reporting
|
|
25253
|
-
updated.
|
|
25256
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25254
25257
|
}
|
|
25255
25258
|
return finishUpdateBaseSignatureDeclaration(updated, original);
|
|
25256
25259
|
}
|
|
@@ -25284,7 +25287,7 @@ var ts;
|
|
|
25284
25287
|
node.members = createNodeArray(members);
|
|
25285
25288
|
node.transformFlags = 1 /* TransformFlags.ContainsTypeScript */;
|
|
25286
25289
|
// The following properties are used only to report grammar errors
|
|
25287
|
-
node.
|
|
25290
|
+
node.illegalDecorators = undefined;
|
|
25288
25291
|
return node;
|
|
25289
25292
|
}
|
|
25290
25293
|
// @api
|
|
@@ -25299,7 +25302,7 @@ var ts;
|
|
|
25299
25302
|
}
|
|
25300
25303
|
function finishUpdateInterfaceDeclaration(updated, original) {
|
|
25301
25304
|
if (updated !== original) {
|
|
25302
|
-
updated.
|
|
25305
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25303
25306
|
}
|
|
25304
25307
|
return update(updated, original);
|
|
25305
25308
|
}
|
|
@@ -25309,7 +25312,7 @@ var ts;
|
|
|
25309
25312
|
node.type = type;
|
|
25310
25313
|
node.transformFlags = 1 /* TransformFlags.ContainsTypeScript */;
|
|
25311
25314
|
// The following properties are used only to report grammar errors
|
|
25312
|
-
node.
|
|
25315
|
+
node.illegalDecorators = undefined;
|
|
25313
25316
|
return node;
|
|
25314
25317
|
}
|
|
25315
25318
|
// @api
|
|
@@ -25323,7 +25326,7 @@ var ts;
|
|
|
25323
25326
|
}
|
|
25324
25327
|
function finishUpdateTypeAliasDeclaration(updated, original) {
|
|
25325
25328
|
if (updated !== original) {
|
|
25326
|
-
updated.
|
|
25329
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25327
25330
|
}
|
|
25328
25331
|
return update(updated, original);
|
|
25329
25332
|
}
|
|
@@ -25336,7 +25339,7 @@ var ts;
|
|
|
25336
25339
|
1 /* TransformFlags.ContainsTypeScript */;
|
|
25337
25340
|
node.transformFlags &= ~67108864 /* TransformFlags.ContainsPossibleTopLevelAwait */; // Enum declarations cannot contain `await`
|
|
25338
25341
|
// The following properties are used only to report grammar errors
|
|
25339
|
-
node.
|
|
25342
|
+
node.illegalDecorators = undefined;
|
|
25340
25343
|
return node;
|
|
25341
25344
|
}
|
|
25342
25345
|
// @api
|
|
@@ -25349,7 +25352,7 @@ var ts;
|
|
|
25349
25352
|
}
|
|
25350
25353
|
function finishUpdateEnumDeclaration(updated, original) {
|
|
25351
25354
|
if (updated !== original) {
|
|
25352
|
-
updated.
|
|
25355
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25353
25356
|
}
|
|
25354
25357
|
return update(updated, original);
|
|
25355
25358
|
}
|
|
@@ -25373,7 +25376,7 @@ var ts;
|
|
|
25373
25376
|
}
|
|
25374
25377
|
node.transformFlags &= ~67108864 /* TransformFlags.ContainsPossibleTopLevelAwait */; // Module declarations cannot contain `await`.
|
|
25375
25378
|
// The following properties are used only to report grammar errors
|
|
25376
|
-
node.
|
|
25379
|
+
node.illegalDecorators = undefined;
|
|
25377
25380
|
return node;
|
|
25378
25381
|
}
|
|
25379
25382
|
// @api
|
|
@@ -25386,7 +25389,7 @@ var ts;
|
|
|
25386
25389
|
}
|
|
25387
25390
|
function finishUpdateModuleDeclaration(updated, original) {
|
|
25388
25391
|
if (updated !== original) {
|
|
25389
|
-
updated.
|
|
25392
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25390
25393
|
}
|
|
25391
25394
|
return update(updated, original);
|
|
25392
25395
|
}
|
|
@@ -25422,7 +25425,7 @@ var ts;
|
|
|
25422
25425
|
/*modifiers*/ undefined, name);
|
|
25423
25426
|
node.transformFlags = 1 /* TransformFlags.ContainsTypeScript */;
|
|
25424
25427
|
// The following properties are used only to report grammar errors
|
|
25425
|
-
node.
|
|
25428
|
+
node.illegalDecorators = undefined;
|
|
25426
25429
|
node.modifiers = undefined;
|
|
25427
25430
|
return node;
|
|
25428
25431
|
}
|
|
@@ -25434,7 +25437,7 @@ var ts;
|
|
|
25434
25437
|
}
|
|
25435
25438
|
function finishUpdateNamespaceExportDeclaration(updated, original) {
|
|
25436
25439
|
if (updated !== original) {
|
|
25437
|
-
updated.
|
|
25440
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25438
25441
|
updated.modifiers = original.modifiers;
|
|
25439
25442
|
}
|
|
25440
25443
|
return update(updated, original);
|
|
@@ -25449,7 +25452,7 @@ var ts;
|
|
|
25449
25452
|
node.transformFlags |= 1 /* TransformFlags.ContainsTypeScript */;
|
|
25450
25453
|
node.transformFlags &= ~67108864 /* TransformFlags.ContainsPossibleTopLevelAwait */; // Import= declaration is always parsed in an Await context
|
|
25451
25454
|
// The following properties are used only to report grammar errors
|
|
25452
|
-
node.
|
|
25455
|
+
node.illegalDecorators = undefined;
|
|
25453
25456
|
return node;
|
|
25454
25457
|
}
|
|
25455
25458
|
// @api
|
|
@@ -25463,7 +25466,7 @@ var ts;
|
|
|
25463
25466
|
}
|
|
25464
25467
|
function finishUpdateImportEqualsDeclaration(updated, original) {
|
|
25465
25468
|
if (updated !== original) {
|
|
25466
|
-
updated.
|
|
25469
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25467
25470
|
}
|
|
25468
25471
|
return update(updated, original);
|
|
25469
25472
|
}
|
|
@@ -25479,7 +25482,7 @@ var ts;
|
|
|
25479
25482
|
propagateChildFlags(node.moduleSpecifier);
|
|
25480
25483
|
node.transformFlags &= ~67108864 /* TransformFlags.ContainsPossibleTopLevelAwait */; // always parsed in an Await context
|
|
25481
25484
|
// The following properties are used only to report grammar errors
|
|
25482
|
-
node.
|
|
25485
|
+
node.illegalDecorators = undefined;
|
|
25483
25486
|
return node;
|
|
25484
25487
|
}
|
|
25485
25488
|
// @api
|
|
@@ -25493,7 +25496,7 @@ var ts;
|
|
|
25493
25496
|
}
|
|
25494
25497
|
function finishUpdateImportDeclaration(updated, original) {
|
|
25495
25498
|
if (updated !== original) {
|
|
25496
|
-
updated.
|
|
25499
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25497
25500
|
}
|
|
25498
25501
|
return update(updated, original);
|
|
25499
25502
|
}
|
|
@@ -25639,7 +25642,7 @@ var ts;
|
|
|
25639
25642
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression);
|
|
25640
25643
|
node.transformFlags &= ~67108864 /* TransformFlags.ContainsPossibleTopLevelAwait */; // always parsed in an Await context
|
|
25641
25644
|
// The following properties are used only to report grammar errors
|
|
25642
|
-
node.
|
|
25645
|
+
node.illegalDecorators = undefined;
|
|
25643
25646
|
return node;
|
|
25644
25647
|
}
|
|
25645
25648
|
// @api
|
|
@@ -25651,7 +25654,7 @@ var ts;
|
|
|
25651
25654
|
}
|
|
25652
25655
|
function finishUpdateExportAssignment(updated, original) {
|
|
25653
25656
|
if (updated !== original) {
|
|
25654
|
-
updated.
|
|
25657
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25655
25658
|
}
|
|
25656
25659
|
return update(updated, original);
|
|
25657
25660
|
}
|
|
@@ -25669,7 +25672,7 @@ var ts;
|
|
|
25669
25672
|
propagateChildFlags(node.moduleSpecifier);
|
|
25670
25673
|
node.transformFlags &= ~67108864 /* TransformFlags.ContainsPossibleTopLevelAwait */; // always parsed in an Await context
|
|
25671
25674
|
// The following properties are used only to report grammar errors
|
|
25672
|
-
node.
|
|
25675
|
+
node.illegalDecorators = undefined;
|
|
25673
25676
|
return node;
|
|
25674
25677
|
}
|
|
25675
25678
|
// @api
|
|
@@ -25684,7 +25687,7 @@ var ts;
|
|
|
25684
25687
|
}
|
|
25685
25688
|
function finishUpdateExportDeclaration(updated, original) {
|
|
25686
25689
|
if (updated !== original) {
|
|
25687
|
-
updated.
|
|
25690
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
25688
25691
|
}
|
|
25689
25692
|
return update(updated, original);
|
|
25690
25693
|
}
|
|
@@ -26448,7 +26451,7 @@ var ts;
|
|
|
26448
26451
|
propagateChildFlags(node.name) |
|
|
26449
26452
|
propagateChildFlags(node.initializer);
|
|
26450
26453
|
// The following properties are used only to report grammar errors
|
|
26451
|
-
node.
|
|
26454
|
+
node.illegalDecorators = undefined;
|
|
26452
26455
|
node.modifiers = undefined;
|
|
26453
26456
|
node.questionToken = undefined;
|
|
26454
26457
|
node.exclamationToken = undefined;
|
|
@@ -26464,7 +26467,7 @@ var ts;
|
|
|
26464
26467
|
function finishUpdatePropertyAssignment(updated, original) {
|
|
26465
26468
|
// copy children used only for error reporting
|
|
26466
26469
|
if (updated !== original) {
|
|
26467
|
-
updated.
|
|
26470
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
26468
26471
|
updated.modifiers = original.modifiers;
|
|
26469
26472
|
updated.questionToken = original.questionToken;
|
|
26470
26473
|
updated.exclamationToken = original.exclamationToken;
|
|
@@ -26481,7 +26484,7 @@ var ts;
|
|
|
26481
26484
|
1024 /* TransformFlags.ContainsES2015 */;
|
|
26482
26485
|
// The following properties are used only to report grammar errors
|
|
26483
26486
|
node.equalsToken = undefined;
|
|
26484
|
-
node.
|
|
26487
|
+
node.illegalDecorators = undefined;
|
|
26485
26488
|
node.modifiers = undefined;
|
|
26486
26489
|
node.questionToken = undefined;
|
|
26487
26490
|
node.exclamationToken = undefined;
|
|
@@ -26498,7 +26501,7 @@ var ts;
|
|
|
26498
26501
|
if (updated !== original) {
|
|
26499
26502
|
// copy children used only for error reporting
|
|
26500
26503
|
updated.equalsToken = original.equalsToken;
|
|
26501
|
-
updated.
|
|
26504
|
+
updated.illegalDecorators = original.illegalDecorators;
|
|
26502
26505
|
updated.modifiers = original.modifiers;
|
|
26503
26506
|
updated.questionToken = original.questionToken;
|
|
26504
26507
|
updated.exclamationToken = original.exclamationToken;
|
|
@@ -30509,17 +30512,6 @@ var ts;
|
|
|
30509
30512
|
|| kind === 173 /* SyntaxKind.SetAccessor */;
|
|
30510
30513
|
}
|
|
30511
30514
|
ts.canHaveIllegalTypeParameters = canHaveIllegalTypeParameters;
|
|
30512
|
-
function canHaveDecorators(node) {
|
|
30513
|
-
var kind = node.kind;
|
|
30514
|
-
return kind === 164 /* SyntaxKind.Parameter */
|
|
30515
|
-
|| kind === 167 /* SyntaxKind.PropertyDeclaration */
|
|
30516
|
-
|| kind === 169 /* SyntaxKind.MethodDeclaration */
|
|
30517
|
-
|| kind === 172 /* SyntaxKind.GetAccessor */
|
|
30518
|
-
|| kind === 173 /* SyntaxKind.SetAccessor */
|
|
30519
|
-
|| kind === 226 /* SyntaxKind.ClassExpression */
|
|
30520
|
-
|| kind === 257 /* SyntaxKind.ClassDeclaration */;
|
|
30521
|
-
}
|
|
30522
|
-
ts.canHaveDecorators = canHaveDecorators;
|
|
30523
30515
|
function canHaveIllegalDecorators(node) {
|
|
30524
30516
|
var kind = node.kind;
|
|
30525
30517
|
return kind === 296 /* SyntaxKind.PropertyAssignment */
|
|
@@ -30541,35 +30533,6 @@ var ts;
|
|
|
30541
30533
|
|| kind === 271 /* SyntaxKind.ExportAssignment */;
|
|
30542
30534
|
}
|
|
30543
30535
|
ts.canHaveIllegalDecorators = canHaveIllegalDecorators;
|
|
30544
|
-
function canHaveModifiers(node) {
|
|
30545
|
-
var kind = node.kind;
|
|
30546
|
-
return kind === 163 /* SyntaxKind.TypeParameter */
|
|
30547
|
-
|| kind === 164 /* SyntaxKind.Parameter */
|
|
30548
|
-
|| kind === 166 /* SyntaxKind.PropertySignature */
|
|
30549
|
-
|| kind === 167 /* SyntaxKind.PropertyDeclaration */
|
|
30550
|
-
|| kind === 168 /* SyntaxKind.MethodSignature */
|
|
30551
|
-
|| kind === 169 /* SyntaxKind.MethodDeclaration */
|
|
30552
|
-
|| kind === 171 /* SyntaxKind.Constructor */
|
|
30553
|
-
|| kind === 172 /* SyntaxKind.GetAccessor */
|
|
30554
|
-
|| kind === 173 /* SyntaxKind.SetAccessor */
|
|
30555
|
-
|| kind === 176 /* SyntaxKind.IndexSignature */
|
|
30556
|
-
|| kind === 180 /* SyntaxKind.ConstructorType */
|
|
30557
|
-
|| kind === 213 /* SyntaxKind.FunctionExpression */
|
|
30558
|
-
|| kind === 214 /* SyntaxKind.ArrowFunction */
|
|
30559
|
-
|| kind === 226 /* SyntaxKind.ClassExpression */
|
|
30560
|
-
|| kind === 237 /* SyntaxKind.VariableStatement */
|
|
30561
|
-
|| kind === 256 /* SyntaxKind.FunctionDeclaration */
|
|
30562
|
-
|| kind === 257 /* SyntaxKind.ClassDeclaration */
|
|
30563
|
-
|| kind === 258 /* SyntaxKind.InterfaceDeclaration */
|
|
30564
|
-
|| kind === 259 /* SyntaxKind.TypeAliasDeclaration */
|
|
30565
|
-
|| kind === 260 /* SyntaxKind.EnumDeclaration */
|
|
30566
|
-
|| kind === 261 /* SyntaxKind.ModuleDeclaration */
|
|
30567
|
-
|| kind === 265 /* SyntaxKind.ImportEqualsDeclaration */
|
|
30568
|
-
|| kind === 266 /* SyntaxKind.ImportDeclaration */
|
|
30569
|
-
|| kind === 271 /* SyntaxKind.ExportAssignment */
|
|
30570
|
-
|| kind === 272 /* SyntaxKind.ExportDeclaration */;
|
|
30571
|
-
}
|
|
30572
|
-
ts.canHaveModifiers = canHaveModifiers;
|
|
30573
30536
|
function canHaveIllegalModifiers(node) {
|
|
30574
30537
|
var kind = node.kind;
|
|
30575
30538
|
return kind === 170 /* SyntaxKind.ClassStaticBlockDeclaration */
|
|
@@ -30858,6 +30821,46 @@ var ts;
|
|
|
30858
30821
|
return location ? ts.setTextRangePosEnd(range, location.pos, location.end) : range;
|
|
30859
30822
|
}
|
|
30860
30823
|
ts.setTextRange = setTextRange;
|
|
30824
|
+
function canHaveModifiers(node) {
|
|
30825
|
+
var kind = node.kind;
|
|
30826
|
+
return kind === 163 /* SyntaxKind.TypeParameter */
|
|
30827
|
+
|| kind === 164 /* SyntaxKind.Parameter */
|
|
30828
|
+
|| kind === 166 /* SyntaxKind.PropertySignature */
|
|
30829
|
+
|| kind === 167 /* SyntaxKind.PropertyDeclaration */
|
|
30830
|
+
|| kind === 168 /* SyntaxKind.MethodSignature */
|
|
30831
|
+
|| kind === 169 /* SyntaxKind.MethodDeclaration */
|
|
30832
|
+
|| kind === 171 /* SyntaxKind.Constructor */
|
|
30833
|
+
|| kind === 172 /* SyntaxKind.GetAccessor */
|
|
30834
|
+
|| kind === 173 /* SyntaxKind.SetAccessor */
|
|
30835
|
+
|| kind === 176 /* SyntaxKind.IndexSignature */
|
|
30836
|
+
|| kind === 180 /* SyntaxKind.ConstructorType */
|
|
30837
|
+
|| kind === 213 /* SyntaxKind.FunctionExpression */
|
|
30838
|
+
|| kind === 214 /* SyntaxKind.ArrowFunction */
|
|
30839
|
+
|| kind === 226 /* SyntaxKind.ClassExpression */
|
|
30840
|
+
|| kind === 237 /* SyntaxKind.VariableStatement */
|
|
30841
|
+
|| kind === 256 /* SyntaxKind.FunctionDeclaration */
|
|
30842
|
+
|| kind === 257 /* SyntaxKind.ClassDeclaration */
|
|
30843
|
+
|| kind === 258 /* SyntaxKind.InterfaceDeclaration */
|
|
30844
|
+
|| kind === 259 /* SyntaxKind.TypeAliasDeclaration */
|
|
30845
|
+
|| kind === 260 /* SyntaxKind.EnumDeclaration */
|
|
30846
|
+
|| kind === 261 /* SyntaxKind.ModuleDeclaration */
|
|
30847
|
+
|| kind === 265 /* SyntaxKind.ImportEqualsDeclaration */
|
|
30848
|
+
|| kind === 266 /* SyntaxKind.ImportDeclaration */
|
|
30849
|
+
|| kind === 271 /* SyntaxKind.ExportAssignment */
|
|
30850
|
+
|| kind === 272 /* SyntaxKind.ExportDeclaration */;
|
|
30851
|
+
}
|
|
30852
|
+
ts.canHaveModifiers = canHaveModifiers;
|
|
30853
|
+
function canHaveDecorators(node) {
|
|
30854
|
+
var kind = node.kind;
|
|
30855
|
+
return kind === 164 /* SyntaxKind.Parameter */
|
|
30856
|
+
|| kind === 167 /* SyntaxKind.PropertyDeclaration */
|
|
30857
|
+
|| kind === 169 /* SyntaxKind.MethodDeclaration */
|
|
30858
|
+
|| kind === 172 /* SyntaxKind.GetAccessor */
|
|
30859
|
+
|| kind === 173 /* SyntaxKind.SetAccessor */
|
|
30860
|
+
|| kind === 226 /* SyntaxKind.ClassExpression */
|
|
30861
|
+
|| kind === 257 /* SyntaxKind.ClassDeclaration */;
|
|
30862
|
+
}
|
|
30863
|
+
ts.canHaveDecorators = canHaveDecorators;
|
|
30861
30864
|
})(ts || (ts = {}));
|
|
30862
30865
|
var ts;
|
|
30863
30866
|
(function (ts) {
|
|
@@ -30976,7 +30979,7 @@ var ts;
|
|
|
30976
30979
|
visitNode(cbNode, node.default) ||
|
|
30977
30980
|
visitNode(cbNode, node.expression);
|
|
30978
30981
|
case 297 /* SyntaxKind.ShorthandPropertyAssignment */:
|
|
30979
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
30982
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
30980
30983
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
30981
30984
|
visitNode(cbNode, node.name) ||
|
|
30982
30985
|
visitNode(cbNode, node.questionToken) ||
|
|
@@ -31006,7 +31009,7 @@ var ts;
|
|
|
31006
31009
|
visitNode(cbNode, node.type) ||
|
|
31007
31010
|
visitNode(cbNode, node.initializer);
|
|
31008
31011
|
case 296 /* SyntaxKind.PropertyAssignment */:
|
|
31009
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31012
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31010
31013
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31011
31014
|
visitNode(cbNode, node.name) ||
|
|
31012
31015
|
visitNode(cbNode, node.questionToken) ||
|
|
@@ -31023,7 +31026,7 @@ var ts;
|
|
|
31023
31026
|
visitNode(cbNode, node.name) ||
|
|
31024
31027
|
visitNode(cbNode, node.initializer);
|
|
31025
31028
|
case 176 /* SyntaxKind.IndexSignature */:
|
|
31026
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31029
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31027
31030
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31028
31031
|
visitNodes(cbNode, cbNodes, node.typeParameters) ||
|
|
31029
31032
|
visitNodes(cbNode, cbNodes, node.parameters) ||
|
|
@@ -31061,7 +31064,7 @@ var ts;
|
|
|
31061
31064
|
visitNodes(cbNode, cbNodes, node.parameters) ||
|
|
31062
31065
|
visitNode(cbNode, node.type);
|
|
31063
31066
|
case 171 /* SyntaxKind.Constructor */:
|
|
31064
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31067
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31065
31068
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31066
31069
|
visitNode(cbNode, node.name) ||
|
|
31067
31070
|
visitNodes(cbNode, cbNodes, node.typeParameters) ||
|
|
@@ -31083,7 +31086,7 @@ var ts;
|
|
|
31083
31086
|
visitNode(cbNode, node.type) ||
|
|
31084
31087
|
visitNode(cbNode, node.body);
|
|
31085
31088
|
case 256 /* SyntaxKind.FunctionDeclaration */:
|
|
31086
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31089
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31087
31090
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31088
31091
|
visitNode(cbNode, node.asteriskToken) ||
|
|
31089
31092
|
visitNode(cbNode, node.name) ||
|
|
@@ -31107,7 +31110,7 @@ var ts;
|
|
|
31107
31110
|
visitNode(cbNode, node.equalsGreaterThanToken) ||
|
|
31108
31111
|
visitNode(cbNode, node.body);
|
|
31109
31112
|
case 170 /* SyntaxKind.ClassStaticBlockDeclaration */:
|
|
31110
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31113
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31111
31114
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31112
31115
|
visitNode(cbNode, node.body);
|
|
31113
31116
|
case 178 /* SyntaxKind.TypeReference */:
|
|
@@ -31235,7 +31238,7 @@ var ts;
|
|
|
31235
31238
|
return visitNodes(cbNode, cbNodes, node.statements) ||
|
|
31236
31239
|
visitNode(cbNode, node.endOfFileToken);
|
|
31237
31240
|
case 237 /* SyntaxKind.VariableStatement */:
|
|
31238
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31241
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31239
31242
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31240
31243
|
visitNode(cbNode, node.declarationList);
|
|
31241
31244
|
case 255 /* SyntaxKind.VariableDeclarationList */:
|
|
@@ -31306,20 +31309,20 @@ var ts;
|
|
|
31306
31309
|
visitNodes(cbNode, cbNodes, node.heritageClauses) ||
|
|
31307
31310
|
visitNodes(cbNode, cbNodes, node.members);
|
|
31308
31311
|
case 258 /* SyntaxKind.InterfaceDeclaration */:
|
|
31309
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31312
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31310
31313
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31311
31314
|
visitNode(cbNode, node.name) ||
|
|
31312
31315
|
visitNodes(cbNode, cbNodes, node.typeParameters) ||
|
|
31313
31316
|
visitNodes(cbNode, cbNodes, node.heritageClauses) ||
|
|
31314
31317
|
visitNodes(cbNode, cbNodes, node.members);
|
|
31315
31318
|
case 259 /* SyntaxKind.TypeAliasDeclaration */:
|
|
31316
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31319
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31317
31320
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31318
31321
|
visitNode(cbNode, node.name) ||
|
|
31319
31322
|
visitNodes(cbNode, cbNodes, node.typeParameters) ||
|
|
31320
31323
|
visitNode(cbNode, node.type);
|
|
31321
31324
|
case 260 /* SyntaxKind.EnumDeclaration */:
|
|
31322
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31325
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31323
31326
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31324
31327
|
visitNode(cbNode, node.name) ||
|
|
31325
31328
|
visitNodes(cbNode, cbNodes, node.members);
|
|
@@ -31327,17 +31330,17 @@ var ts;
|
|
|
31327
31330
|
return visitNode(cbNode, node.name) ||
|
|
31328
31331
|
visitNode(cbNode, node.initializer);
|
|
31329
31332
|
case 261 /* SyntaxKind.ModuleDeclaration */:
|
|
31330
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31333
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31331
31334
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31332
31335
|
visitNode(cbNode, node.name) ||
|
|
31333
31336
|
visitNode(cbNode, node.body);
|
|
31334
31337
|
case 265 /* SyntaxKind.ImportEqualsDeclaration */:
|
|
31335
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31338
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31336
31339
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31337
31340
|
visitNode(cbNode, node.name) ||
|
|
31338
31341
|
visitNode(cbNode, node.moduleReference);
|
|
31339
31342
|
case 266 /* SyntaxKind.ImportDeclaration */:
|
|
31340
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31343
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31341
31344
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31342
31345
|
visitNode(cbNode, node.importClause) ||
|
|
31343
31346
|
visitNode(cbNode, node.moduleSpecifier) ||
|
|
@@ -31351,7 +31354,7 @@ var ts;
|
|
|
31351
31354
|
return visitNode(cbNode, node.name) ||
|
|
31352
31355
|
visitNode(cbNode, node.value);
|
|
31353
31356
|
case 264 /* SyntaxKind.NamespaceExportDeclaration */:
|
|
31354
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31357
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31355
31358
|
visitNode(cbNode, node.name);
|
|
31356
31359
|
case 268 /* SyntaxKind.NamespaceImport */:
|
|
31357
31360
|
return visitNode(cbNode, node.name);
|
|
@@ -31361,7 +31364,7 @@ var ts;
|
|
|
31361
31364
|
case 273 /* SyntaxKind.NamedExports */:
|
|
31362
31365
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
31363
31366
|
case 272 /* SyntaxKind.ExportDeclaration */:
|
|
31364
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31367
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31365
31368
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31366
31369
|
visitNode(cbNode, node.exportClause) ||
|
|
31367
31370
|
visitNode(cbNode, node.moduleSpecifier) ||
|
|
@@ -31371,7 +31374,7 @@ var ts;
|
|
|
31371
31374
|
return visitNode(cbNode, node.propertyName) ||
|
|
31372
31375
|
visitNode(cbNode, node.name);
|
|
31373
31376
|
case 271 /* SyntaxKind.ExportAssignment */:
|
|
31374
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31377
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31375
31378
|
visitNodes(cbNode, cbNodes, node.modifiers) ||
|
|
31376
31379
|
visitNode(cbNode, node.expression);
|
|
31377
31380
|
case 223 /* SyntaxKind.TemplateExpression */:
|
|
@@ -31396,7 +31399,7 @@ var ts;
|
|
|
31396
31399
|
case 277 /* SyntaxKind.ExternalModuleReference */:
|
|
31397
31400
|
return visitNode(cbNode, node.expression);
|
|
31398
31401
|
case 276 /* SyntaxKind.MissingDeclaration */:
|
|
31399
|
-
return visitNodes(cbNode, cbNodes, node.
|
|
31402
|
+
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
|
|
31400
31403
|
visitNodes(cbNode, cbNodes, node.modifiers);
|
|
31401
31404
|
case 351 /* SyntaxKind.CommaListExpression */:
|
|
31402
31405
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
@@ -33947,7 +33950,7 @@ var ts;
|
|
|
33947
33950
|
var type = parseTypeAnnotation();
|
|
33948
33951
|
parseTypeMemberSemicolon();
|
|
33949
33952
|
var node = factory.createIndexSignature(modifiers, parameters, type);
|
|
33950
|
-
node.
|
|
33953
|
+
node.illegalDecorators = decorators;
|
|
33951
33954
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
33952
33955
|
}
|
|
33953
33956
|
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
|
|
@@ -36107,7 +36110,7 @@ var ts;
|
|
|
36107
36110
|
node = factory.createPropertyAssignment(name, initializer);
|
|
36108
36111
|
}
|
|
36109
36112
|
// Decorators, Modifiers, questionToken, and exclamationToken are not supported by property assignments and are reported in the grammar checker
|
|
36110
|
-
node.
|
|
36113
|
+
node.illegalDecorators = decorators;
|
|
36111
36114
|
node.modifiers = modifiers;
|
|
36112
36115
|
node.questionToken = questionToken;
|
|
36113
36116
|
node.exclamationToken = exclamationToken;
|
|
@@ -36755,7 +36758,7 @@ var ts;
|
|
|
36755
36758
|
// would follow. For recovery and error reporting purposes, return an incomplete declaration.
|
|
36756
36759
|
var missing = createMissingNode(276 /* SyntaxKind.MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected);
|
|
36757
36760
|
ts.setTextRangePos(missing, pos);
|
|
36758
|
-
missing.
|
|
36761
|
+
missing.illegalDecorators = decorators;
|
|
36759
36762
|
missing.modifiers = modifiers;
|
|
36760
36763
|
return missing;
|
|
36761
36764
|
}
|
|
@@ -36898,7 +36901,7 @@ var ts;
|
|
|
36898
36901
|
parseSemicolon();
|
|
36899
36902
|
var node = factory.createVariableStatement(modifiers, declarationList);
|
|
36900
36903
|
// Decorators are not allowed on a variable statement, so we keep track of them to report them in the grammar checker.
|
|
36901
|
-
node.
|
|
36904
|
+
node.illegalDecorators = decorators;
|
|
36902
36905
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36903
36906
|
}
|
|
36904
36907
|
function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -36918,7 +36921,7 @@ var ts;
|
|
|
36918
36921
|
var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, ts.Diagnostics.or_expected);
|
|
36919
36922
|
setAwaitContext(savedAwaitContext);
|
|
36920
36923
|
var node = factory.createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body);
|
|
36921
|
-
node.
|
|
36924
|
+
node.illegalDecorators = decorators;
|
|
36922
36925
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36923
36926
|
}
|
|
36924
36927
|
function parseConstructorName() {
|
|
@@ -36941,7 +36944,7 @@ var ts;
|
|
|
36941
36944
|
var body = parseFunctionBlockOrSemicolon(0 /* SignatureFlags.None */, ts.Diagnostics.or_expected);
|
|
36942
36945
|
var node = factory.createConstructorDeclaration(modifiers, parameters, body);
|
|
36943
36946
|
// Attach invalid nodes if they exist so that we can report them in the grammar checker.
|
|
36944
|
-
node.
|
|
36947
|
+
node.illegalDecorators = decorators;
|
|
36945
36948
|
node.typeParameters = typeParameters;
|
|
36946
36949
|
node.type = type;
|
|
36947
36950
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
@@ -37057,7 +37060,7 @@ var ts;
|
|
|
37057
37060
|
parseExpectedToken(124 /* SyntaxKind.StaticKeyword */);
|
|
37058
37061
|
var body = parseClassStaticBlockBody();
|
|
37059
37062
|
var node = withJSDoc(finishNode(factory.createClassStaticBlockDeclaration(body), pos), hasJSDoc);
|
|
37060
|
-
node.
|
|
37063
|
+
node.illegalDecorators = decorators;
|
|
37061
37064
|
node.modifiers = modifiers;
|
|
37062
37065
|
return node;
|
|
37063
37066
|
}
|
|
@@ -37298,7 +37301,7 @@ var ts;
|
|
|
37298
37301
|
var heritageClauses = parseHeritageClauses();
|
|
37299
37302
|
var members = parseObjectTypeMembers();
|
|
37300
37303
|
var node = factory.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members);
|
|
37301
|
-
node.
|
|
37304
|
+
node.illegalDecorators = decorators;
|
|
37302
37305
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37303
37306
|
}
|
|
37304
37307
|
function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -37309,7 +37312,7 @@ var ts;
|
|
|
37309
37312
|
var type = token() === 138 /* SyntaxKind.IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType();
|
|
37310
37313
|
parseSemicolon();
|
|
37311
37314
|
var node = factory.createTypeAliasDeclaration(modifiers, name, typeParameters, type);
|
|
37312
|
-
node.
|
|
37315
|
+
node.illegalDecorators = decorators;
|
|
37313
37316
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37314
37317
|
}
|
|
37315
37318
|
// In an ambient declaration, the grammar only allows integer literals as initializers.
|
|
@@ -37335,7 +37338,7 @@ var ts;
|
|
|
37335
37338
|
members = createMissingList();
|
|
37336
37339
|
}
|
|
37337
37340
|
var node = factory.createEnumDeclaration(modifiers, name, members);
|
|
37338
|
-
node.
|
|
37341
|
+
node.illegalDecorators = decorators;
|
|
37339
37342
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37340
37343
|
}
|
|
37341
37344
|
function parseModuleBlock() {
|
|
@@ -37359,7 +37362,7 @@ var ts;
|
|
|
37359
37362
|
? parseModuleOrNamespaceDeclaration(getNodePos(), /*hasJSDoc*/ false, /*decorators*/ undefined, /*modifiers*/ undefined, 4 /* NodeFlags.NestedNamespace */ | namespaceFlag)
|
|
37360
37363
|
: parseModuleBlock();
|
|
37361
37364
|
var node = factory.createModuleDeclaration(modifiers, name, body, flags);
|
|
37362
|
-
node.
|
|
37365
|
+
node.illegalDecorators = decorators;
|
|
37363
37366
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37364
37367
|
}
|
|
37365
37368
|
function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -37382,7 +37385,7 @@ var ts;
|
|
|
37382
37385
|
parseSemicolon();
|
|
37383
37386
|
}
|
|
37384
37387
|
var node = factory.createModuleDeclaration(modifiers, name, body, flags);
|
|
37385
|
-
node.
|
|
37388
|
+
node.illegalDecorators = decorators;
|
|
37386
37389
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37387
37390
|
}
|
|
37388
37391
|
function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -37422,7 +37425,7 @@ var ts;
|
|
|
37422
37425
|
parseSemicolon();
|
|
37423
37426
|
var node = factory.createNamespaceExportDeclaration(name);
|
|
37424
37427
|
// NamespaceExportDeclaration nodes cannot have decorators or modifiers, so we attach them here so we can report them in the grammar checker
|
|
37425
|
-
node.
|
|
37428
|
+
node.illegalDecorators = decorators;
|
|
37426
37429
|
node.modifiers = modifiers;
|
|
37427
37430
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37428
37431
|
}
|
|
@@ -37462,7 +37465,7 @@ var ts;
|
|
|
37462
37465
|
}
|
|
37463
37466
|
parseSemicolon();
|
|
37464
37467
|
var node = factory.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause);
|
|
37465
|
-
node.
|
|
37468
|
+
node.illegalDecorators = decorators;
|
|
37466
37469
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37467
37470
|
}
|
|
37468
37471
|
function parseAssertEntry() {
|
|
@@ -37507,7 +37510,7 @@ var ts;
|
|
|
37507
37510
|
var moduleReference = parseModuleReference();
|
|
37508
37511
|
parseSemicolon();
|
|
37509
37512
|
var node = factory.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference);
|
|
37510
|
-
node.
|
|
37513
|
+
node.illegalDecorators = decorators;
|
|
37511
37514
|
var finished = withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37512
37515
|
return finished;
|
|
37513
37516
|
}
|
|
@@ -37697,7 +37700,7 @@ var ts;
|
|
|
37697
37700
|
parseSemicolon();
|
|
37698
37701
|
setAwaitContext(savedAwaitContext);
|
|
37699
37702
|
var node = factory.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause);
|
|
37700
|
-
node.
|
|
37703
|
+
node.illegalDecorators = decorators;
|
|
37701
37704
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37702
37705
|
}
|
|
37703
37706
|
function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) {
|
|
@@ -37714,7 +37717,7 @@ var ts;
|
|
|
37714
37717
|
parseSemicolon();
|
|
37715
37718
|
setAwaitContext(savedAwaitContext);
|
|
37716
37719
|
var node = factory.createExportAssignment(modifiers, isExportEquals, expression);
|
|
37717
|
-
node.
|
|
37720
|
+
node.illegalDecorators = decorators;
|
|
37718
37721
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
37719
37722
|
}
|
|
37720
37723
|
var ParsingContext;
|
|
@@ -43078,10 +43081,12 @@ var ts;
|
|
|
43078
43081
|
if (resolved) {
|
|
43079
43082
|
var fileName = resolved.fileName, packageId = resolved.packageId;
|
|
43080
43083
|
var resolvedFileName = options.preserveSymlinks ? fileName : realPath(fileName, host, traceEnabled);
|
|
43084
|
+
var pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host);
|
|
43081
43085
|
resolvedTypeReferenceDirective = {
|
|
43082
43086
|
primary: primary,
|
|
43083
|
-
|
|
43084
|
-
|
|
43087
|
+
// If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames
|
|
43088
|
+
resolvedFileName: pathsAreEqual ? fileName : resolvedFileName,
|
|
43089
|
+
originalPath: pathsAreEqual ? undefined : fileName,
|
|
43085
43090
|
packageId: packageId,
|
|
43086
43091
|
isExternalLibraryImport: pathContainsNodeModules(fileName),
|
|
43087
43092
|
};
|
|
@@ -43866,8 +43871,10 @@ var ts;
|
|
|
43866
43871
|
var resolvedValue = resolved_1.value;
|
|
43867
43872
|
if (!compilerOptions.preserveSymlinks && resolvedValue && !resolvedValue.originalPath) {
|
|
43868
43873
|
var path = realPath(resolvedValue.path, host, traceEnabled);
|
|
43869
|
-
var
|
|
43870
|
-
|
|
43874
|
+
var pathsAreEqual = arePathsEqual(path, resolvedValue.path, host);
|
|
43875
|
+
var originalPath = pathsAreEqual ? undefined : resolvedValue.path;
|
|
43876
|
+
// If the path and realpath are differing only in casing prefer path so that we can issue correct errors for casing under forceConsistentCasingInFileNames
|
|
43877
|
+
resolvedValue = __assign(__assign({}, resolvedValue), { path: pathsAreEqual ? resolvedValue.path : path, originalPath: originalPath });
|
|
43871
43878
|
}
|
|
43872
43879
|
// For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files.
|
|
43873
43880
|
return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } };
|
|
@@ -73520,25 +73527,7 @@ var ts;
|
|
|
73520
73527
|
}
|
|
73521
73528
|
function getTypeOfPropertyOfContextualType(type, name, nameType) {
|
|
73522
73529
|
return mapType(type, function (t) {
|
|
73523
|
-
|
|
73524
|
-
var intersection = t;
|
|
73525
|
-
var newTypes = ts.mapDefined(intersection.types, getTypeOfConcretePropertyOfContextualType);
|
|
73526
|
-
if (newTypes.length > 0) {
|
|
73527
|
-
return getIntersectionType(newTypes);
|
|
73528
|
-
}
|
|
73529
|
-
newTypes = ts.mapDefined(intersection.types, getTypeOfApplicableIndexInfoOfContextualType);
|
|
73530
|
-
if (newTypes.length > 0) {
|
|
73531
|
-
return getIntersectionType(newTypes);
|
|
73532
|
-
}
|
|
73533
|
-
return undefined;
|
|
73534
|
-
}
|
|
73535
|
-
var concretePropertyType = getTypeOfConcretePropertyOfContextualType(t);
|
|
73536
|
-
if (concretePropertyType) {
|
|
73537
|
-
return concretePropertyType;
|
|
73538
|
-
}
|
|
73539
|
-
return getTypeOfApplicableIndexInfoOfContextualType(t);
|
|
73540
|
-
}, /*noReductions*/ true);
|
|
73541
|
-
function getTypeOfConcretePropertyOfContextualType(t) {
|
|
73530
|
+
var _a;
|
|
73542
73531
|
if (isGenericMappedType(t) && !t.declaration.nameType) {
|
|
73543
73532
|
var constraint = getConstraintTypeFromMappedType(t);
|
|
73544
73533
|
var constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
@@ -73546,9 +73535,8 @@ var ts;
|
|
|
73546
73535
|
if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
|
|
73547
73536
|
return substituteIndexedMappedType(t, propertyNameType);
|
|
73548
73537
|
}
|
|
73549
|
-
return undefined;
|
|
73550
73538
|
}
|
|
73551
|
-
if (t.flags & 3670016 /* TypeFlags.StructuredType */) {
|
|
73539
|
+
else if (t.flags & 3670016 /* TypeFlags.StructuredType */) {
|
|
73552
73540
|
var prop = getPropertyOfType(t, name);
|
|
73553
73541
|
if (prop) {
|
|
73554
73542
|
return isCircularMappedProperty(prop) ? undefined : getTypeOfSymbol(prop);
|
|
@@ -73559,16 +73547,10 @@ var ts;
|
|
|
73559
73547
|
return restType;
|
|
73560
73548
|
}
|
|
73561
73549
|
}
|
|
73550
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(ts.unescapeLeadingUnderscores(name)))) === null || _a === void 0 ? void 0 : _a.type;
|
|
73562
73551
|
}
|
|
73563
73552
|
return undefined;
|
|
73564
|
-
}
|
|
73565
|
-
function getTypeOfApplicableIndexInfoOfContextualType(t) {
|
|
73566
|
-
var _a;
|
|
73567
|
-
if (!(t.flags & 3670016 /* TypeFlags.StructuredType */)) {
|
|
73568
|
-
return undefined;
|
|
73569
|
-
}
|
|
73570
|
-
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(ts.unescapeLeadingUnderscores(name)))) === null || _a === void 0 ? void 0 : _a.type;
|
|
73571
|
-
}
|
|
73553
|
+
}, /*noReductions*/ true);
|
|
73572
73554
|
}
|
|
73573
73555
|
// In an object literal contextually typed by a type T, the contextual type of a property assignment is the type of
|
|
73574
73556
|
// the matching property in T, if one exists. Otherwise, it is the type of the numeric index signature in T, if one
|
|
@@ -88698,7 +88680,7 @@ var ts;
|
|
|
88698
88680
|
return checkGrammarDecorators(node) || checkGrammarModifiers(node);
|
|
88699
88681
|
}
|
|
88700
88682
|
function checkGrammarDecorators(node) {
|
|
88701
|
-
if (ts.canHaveIllegalDecorators(node) && ts.some(node.
|
|
88683
|
+
if (ts.canHaveIllegalDecorators(node) && ts.some(node.illegalDecorators)) {
|
|
88702
88684
|
return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here);
|
|
88703
88685
|
}
|
|
88704
88686
|
if (!ts.canHaveDecorators(node) || !ts.hasDecorators(node)) {
|
|
@@ -182513,9 +182495,9 @@ var ts;
|
|
|
182513
182495
|
// - error: 5.0
|
|
182514
182496
|
var ts;
|
|
182515
182497
|
(function (ts) {
|
|
182516
|
-
var MUST_MERGE = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators have been combined with modifiers. Callers should switch to an overload
|
|
182517
|
-
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
|
|
182518
|
-
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
|
|
182498
|
+
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." };
|
|
182499
|
+
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." };
|
|
182500
|
+
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." };
|
|
182519
182501
|
function patchNodeFactory(factory) {
|
|
182520
182502
|
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;
|
|
182521
182503
|
factory.createParameterDeclaration = ts.buildOverload("createParameterDeclaration")
|
|
@@ -182742,7 +182724,7 @@ var ts;
|
|
|
182742
182724
|
return (decorators === undefined || !ts.some(decorators, ts.isModifier)) &&
|
|
182743
182725
|
(modifiers === undefined || !ts.some(modifiers, ts.isParameter)) &&
|
|
182744
182726
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
182745
|
-
(body === undefined ||
|
|
182727
|
+
(body === undefined || ts.isBlock(body));
|
|
182746
182728
|
},
|
|
182747
182729
|
})
|
|
182748
182730
|
.deprecate({
|
|
@@ -182771,7 +182753,7 @@ var ts;
|
|
|
182771
182753
|
return (decorators === undefined || !ts.some(decorators, ts.isModifier)) &&
|
|
182772
182754
|
(modifiers === undefined || !ts.some(modifiers, ts.isParameter)) &&
|
|
182773
182755
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
182774
|
-
(body === undefined ||
|
|
182756
|
+
(body === undefined || ts.isBlock(body));
|
|
182775
182757
|
},
|
|
182776
182758
|
})
|
|
182777
182759
|
.deprecate({
|