@typescript-deploys/pr-build 4.9.0-pr-50366-2 → 4.9.0-pr-50241-4

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.
@@ -2478,6 +2478,7 @@ var ts;
2478
2478
  var currentAssertionLevel = 0 /* None */;
2479
2479
  Debug.currentLogLevel = LogLevel.Warning;
2480
2480
  Debug.isDebugging = false;
2481
+ Debug.enableDeprecationWarnings = true;
2481
2482
  function getTypeScriptVersion() {
2482
2483
  return typeScriptVersion !== null && typeScriptVersion !== void 0 ? typeScriptVersion : (typeScriptVersion = new ts.Version(ts.version));
2483
2484
  }
@@ -3101,7 +3102,7 @@ var ts;
3101
3102
  function createWarningDeprecation(name, errorAfter, since, message) {
3102
3103
  var hasWrittenDeprecation = false;
3103
3104
  return function () {
3104
- if (!hasWrittenDeprecation) {
3105
+ if (Debug.enableDeprecationWarnings && !hasWrittenDeprecation) {
3105
3106
  log.warn(formatDeprecationMessage(name, /*error*/ false, errorAfter, since, message));
3106
3107
  hasWrittenDeprecation = true;
3107
3108
  }
@@ -6121,6 +6122,7 @@ var ts;
6121
6122
  var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels);
6122
6123
  /* @internal */
6123
6124
  ts.unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels);
6125
+ /* @internal */
6124
6126
  function setCustomPollingValues(system) {
6125
6127
  if (!system.getEnvironmentVariable) {
6126
6128
  return;
@@ -6163,6 +6165,7 @@ var ts;
6163
6165
  createPollingIntervalBasedLevels(customLevels ? __assign(__assign({}, defaultLevels), customLevels) : defaultLevels);
6164
6166
  }
6165
6167
  }
6168
+ ts.setCustomPollingValues = setCustomPollingValues;
6166
6169
  function pollWatchedFileQueue(host, queue, pollIndex, chunkSize, callbackOnWatchFileStat) {
6167
6170
  var definedValueCopyToIndex = pollIndex;
6168
6171
  // Max visit would be all elements of the queue
@@ -6208,6 +6211,7 @@ var ts;
6208
6211
  }
6209
6212
  }
6210
6213
  }
6214
+ /* @internal */
6211
6215
  function createDynamicPriorityPollingWatchFile(host) {
6212
6216
  var watchedFiles = [];
6213
6217
  var changedFilesInLastPoll = [];
@@ -6316,6 +6320,7 @@ var ts;
6316
6320
  pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === PollingInterval.Low ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingIntervalQueue(pollingInterval));
6317
6321
  }
6318
6322
  }
6323
+ ts.createDynamicPriorityPollingWatchFile = createDynamicPriorityPollingWatchFile;
6319
6324
  function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) {
6320
6325
  // One file can have multiple watchers
6321
6326
  var fileWatcherCallbacks = ts.createMultiMap();
@@ -6394,36 +6399,42 @@ var ts;
6394
6399
  pollScheduled = host.setTimeout(pollQueue, PollingInterval.High);
6395
6400
  }
6396
6401
  }
6397
- function createSingleWatcherPerName(cache, useCaseSensitiveFileNames, name, callback, createWatcher) {
6402
+ /* @internal */
6403
+ function createSingleFileWatcherPerName(watchFile, useCaseSensitiveFileNames) {
6404
+ var cache = new ts.Map();
6405
+ var callbacksCache = ts.createMultiMap();
6398
6406
  var toCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
6399
- var path = toCanonicalFileName(name);
6400
- var existing = cache.get(path);
6401
- if (existing) {
6402
- existing.callbacks.push(callback);
6403
- }
6404
- else {
6405
- cache.set(path, {
6406
- watcher: createWatcher((
6407
- // Cant infer types correctly so lets satisfy checker
6408
- function (param1, param2, param3) { var _a; return (_a = cache.get(path)) === null || _a === void 0 ? void 0 : _a.callbacks.slice().forEach(function (cb) { return cb(param1, param2, param3); }); })),
6409
- callbacks: [callback]
6410
- });
6411
- }
6412
- return {
6413
- close: function () {
6414
- var watcher = cache.get(path);
6415
- if (!watcher)
6416
- return;
6417
- if (!ts.orderedRemoveItem(watcher.callbacks, callback) || watcher.callbacks.length)
6418
- return;
6419
- cache.delete(path);
6420
- ts.closeFileWatcherOf(watcher);
6407
+ return function (fileName, callback, pollingInterval, options) {
6408
+ var path = toCanonicalFileName(fileName);
6409
+ var existing = cache.get(path);
6410
+ if (existing) {
6411
+ existing.refCount++;
6421
6412
  }
6413
+ else {
6414
+ cache.set(path, {
6415
+ watcher: watchFile(fileName, function (fileName, eventKind, modifiedTime) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind, modifiedTime); }); }, pollingInterval, options),
6416
+ refCount: 1
6417
+ });
6418
+ }
6419
+ callbacksCache.add(path, callback);
6420
+ return {
6421
+ close: function () {
6422
+ var watcher = ts.Debug.checkDefined(cache.get(path));
6423
+ callbacksCache.remove(path, callback);
6424
+ watcher.refCount--;
6425
+ if (watcher.refCount)
6426
+ return;
6427
+ cache.delete(path);
6428
+ ts.closeFileWatcherOf(watcher);
6429
+ }
6430
+ };
6422
6431
  };
6423
6432
  }
6433
+ ts.createSingleFileWatcherPerName = createSingleFileWatcherPerName;
6424
6434
  /**
6425
6435
  * Returns true if file status changed
6426
6436
  */
6437
+ /*@internal*/
6427
6438
  function onWatchedFileStat(watchedFile, modifiedTime) {
6428
6439
  var oldTime = watchedFile.mtime.getTime();
6429
6440
  var newTime = modifiedTime.getTime();
@@ -6435,6 +6446,7 @@ var ts;
6435
6446
  }
6436
6447
  return false;
6437
6448
  }
6449
+ ts.onWatchedFileStat = onWatchedFileStat;
6438
6450
  /*@internal*/
6439
6451
  function getFileWatcherEventKind(oldTime, newTime) {
6440
6452
  return oldTime === 0
@@ -6462,6 +6474,7 @@ var ts;
6462
6474
  * that means if this is recursive watcher, watch the children directories as well
6463
6475
  * (eg on OS that dont support recursive watch using fs.watch use fs.watchFile)
6464
6476
  */
6477
+ /*@internal*/
6465
6478
  function createDirectoryWatcherSupportingRecursive(_a) {
6466
6479
  var watchDirectory = _a.watchDirectory, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, fileSystemEntryExists = _a.fileSystemEntryExists, realpath = _a.realpath, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout;
6467
6480
  var cache = new ts.Map();
@@ -6670,15 +6683,18 @@ var ts;
6670
6683
  return ts.stringContains(toCanonicalFilePath(path), searchPath);
6671
6684
  }
6672
6685
  }
6686
+ ts.createDirectoryWatcherSupportingRecursive = createDirectoryWatcherSupportingRecursive;
6673
6687
  /*@internal*/
6674
6688
  var FileSystemEntryKind;
6675
6689
  (function (FileSystemEntryKind) {
6676
6690
  FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File";
6677
6691
  FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory";
6678
6692
  })(FileSystemEntryKind = ts.FileSystemEntryKind || (ts.FileSystemEntryKind = {}));
6693
+ /*@internal*/
6679
6694
  function createFileWatcherCallback(callback) {
6680
6695
  return function (_fileName, eventKind, modifiedTime) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); };
6681
6696
  }
6697
+ ts.createFileWatcherCallback = createFileWatcherCallback;
6682
6698
  function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime) {
6683
6699
  return function (eventName, _relativeFileName, modifiedTime) {
6684
6700
  if (eventName === "rename") {
@@ -6712,10 +6728,7 @@ var ts;
6712
6728
  }
6713
6729
  /*@internal*/
6714
6730
  function createSystemWatchFunctions(_a) {
6715
- var pollingWatchFileWorker = _a.pollingWatchFileWorker, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatchWorker = _a.fsWatchWorker, fileSystemEntryExists = _a.fileSystemEntryExists, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory, defaultWatchFileKind = _a.defaultWatchFileKind, inodeWatching = _a.inodeWatching, sysLog = _a.sysLog;
6716
- var pollingWatches = new ts.Map();
6717
- var fsWatches = new ts.Map();
6718
- var fsWatchesRecursive = new ts.Map();
6731
+ var pollingWatchFile = _a.pollingWatchFile, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatchWorker = _a.fsWatchWorker, fileSystemEntryExists = _a.fileSystemEntryExists, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory, defaultWatchFileKind = _a.defaultWatchFileKind, inodeWatching = _a.inodeWatching, sysLog = _a.sysLog;
6719
6732
  var dynamicPollingWatchFile;
6720
6733
  var fixedChunkSizePollingWatchFile;
6721
6734
  var nonPollingWatchFile;
@@ -6779,7 +6792,7 @@ var ts;
6779
6792
  // Use notifications from FS to watch with falling back to fs.watchFile
6780
6793
  generateWatchFileOptions(ts.WatchFileKind.UseFsEventsOnParentDirectory, ts.PollingWatchKind.PriorityInterval, options) :
6781
6794
  // Default to do not use fixed polling interval
6782
- { watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.UseFsEvents };
6795
+ { watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.FixedPollingInterval };
6783
6796
  }
6784
6797
  }
6785
6798
  function generateWatchFileOptions(watchFile, fallbackPolling, options) {
@@ -6850,13 +6863,7 @@ var ts;
6850
6863
  };
6851
6864
  }
6852
6865
  }
6853
- function pollingWatchFile(fileName, callback, pollingInterval, options) {
6854
- return createSingleWatcherPerName(pollingWatches, useCaseSensitiveFileNames, fileName, callback, function (cb) { return pollingWatchFileWorker(fileName, cb, pollingInterval, options); });
6855
- }
6856
6866
  function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
6857
- return createSingleWatcherPerName(recursive ? fsWatchesRecursive : fsWatches, useCaseSensitiveFileNames, fileOrDirectory, callback, function (cb) { return fsWatchHandlingPresence(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions); });
6858
- }
6859
- function fsWatchHandlingPresence(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
6860
6867
  var lastDirectoryPartWithDirectorySeparator;
6861
6868
  var lastDirectoryPart;
6862
6869
  if (inodeWatching) {
@@ -7035,7 +7042,7 @@ var ts;
7035
7042
  var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
7036
7043
  var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
7037
7044
  var _b = createSystemWatchFunctions({
7038
- pollingWatchFileWorker: fsWatchFileWorker,
7045
+ pollingWatchFile: createSingleFileWatcherPerName(fsWatchFileWorker, useCaseSensitiveFileNames),
7039
7046
  getModifiedTime: getModifiedTime,
7040
7047
  setTimeout: setTimeout,
7041
7048
  clearTimeout: clearTimeout,
@@ -21374,7 +21381,7 @@ var ts;
21374
21381
  case 165 /* Decorator */: {
21375
21382
  var parent_2 = node.parent;
21376
21383
  return ts.canHaveDecorators(parent_2) ? parent_2.modifiers :
21377
- ts.canHaveIllegalDecorators(parent_2) ? parent_2.decorators :
21384
+ ts.canHaveIllegalDecorators(parent_2) ? parent_2.illegalDecorators :
21378
21385
  undefined;
21379
21386
  }
21380
21387
  case 291 /* HeritageClause */:
@@ -23451,7 +23458,7 @@ var ts;
23451
23458
  node.body = body;
23452
23459
  node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */;
23453
23460
  // The following properties are used only to report grammar errors
23454
- node.decorators = undefined;
23461
+ node.illegalDecorators = undefined;
23455
23462
  node.modifiers = undefined;
23456
23463
  return node;
23457
23464
  }
@@ -23463,7 +23470,7 @@ var ts;
23463
23470
  }
23464
23471
  function finishUpdateClassStaticBlockDeclaration(updated, original) {
23465
23472
  if (updated !== original) {
23466
- updated.decorators = original.decorators;
23473
+ updated.illegalDecorators = original.illegalDecorators;
23467
23474
  updated.modifiers = original.modifiers;
23468
23475
  }
23469
23476
  return update(updated, original);
@@ -23476,7 +23483,7 @@ var ts;
23476
23483
  /*type*/ undefined, body);
23477
23484
  node.transformFlags |= 1024 /* ContainsES2015 */;
23478
23485
  // The following properties are used only to report grammar errors
23479
- node.decorators = undefined;
23486
+ node.illegalDecorators = undefined;
23480
23487
  node.typeParameters = undefined;
23481
23488
  node.type = undefined;
23482
23489
  return node;
@@ -23491,7 +23498,7 @@ var ts;
23491
23498
  }
23492
23499
  function finishUpdateConstructorDeclaration(updated, original) {
23493
23500
  if (updated !== original) {
23494
- updated.decorators = original.decorators;
23501
+ updated.illegalDecorators = original.illegalDecorators;
23495
23502
  updated.typeParameters = original.typeParameters;
23496
23503
  updated.type = original.type;
23497
23504
  }
@@ -25239,7 +25246,7 @@ var ts;
25239
25246
  }
25240
25247
  }
25241
25248
  // The following properties are used only to report grammar errors
25242
- node.decorators = undefined;
25249
+ node.illegalDecorators = undefined;
25243
25250
  return node;
25244
25251
  }
25245
25252
  // @api
@@ -25257,7 +25264,7 @@ var ts;
25257
25264
  function finishUpdateFunctionDeclaration(updated, original) {
25258
25265
  if (updated !== original) {
25259
25266
  // copy children used only for error reporting
25260
- updated.decorators = original.decorators;
25267
+ updated.illegalDecorators = original.illegalDecorators;
25261
25268
  }
25262
25269
  return finishUpdateBaseSignatureDeclaration(updated, original);
25263
25270
  }
@@ -25291,7 +25298,7 @@ var ts;
25291
25298
  node.members = createNodeArray(members);
25292
25299
  node.transformFlags = 1 /* ContainsTypeScript */;
25293
25300
  // The following properties are used only to report grammar errors
25294
- node.decorators = undefined;
25301
+ node.illegalDecorators = undefined;
25295
25302
  return node;
25296
25303
  }
25297
25304
  // @api
@@ -25306,7 +25313,7 @@ var ts;
25306
25313
  }
25307
25314
  function finishUpdateInterfaceDeclaration(updated, original) {
25308
25315
  if (updated !== original) {
25309
- updated.decorators = original.decorators;
25316
+ updated.illegalDecorators = original.illegalDecorators;
25310
25317
  }
25311
25318
  return update(updated, original);
25312
25319
  }
@@ -25316,7 +25323,7 @@ var ts;
25316
25323
  node.type = type;
25317
25324
  node.transformFlags = 1 /* ContainsTypeScript */;
25318
25325
  // The following properties are used only to report grammar errors
25319
- node.decorators = undefined;
25326
+ node.illegalDecorators = undefined;
25320
25327
  return node;
25321
25328
  }
25322
25329
  // @api
@@ -25330,7 +25337,7 @@ var ts;
25330
25337
  }
25331
25338
  function finishUpdateTypeAliasDeclaration(updated, original) {
25332
25339
  if (updated !== original) {
25333
- updated.decorators = original.decorators;
25340
+ updated.illegalDecorators = original.illegalDecorators;
25334
25341
  }
25335
25342
  return update(updated, original);
25336
25343
  }
@@ -25343,7 +25350,7 @@ var ts;
25343
25350
  1 /* ContainsTypeScript */;
25344
25351
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // Enum declarations cannot contain `await`
25345
25352
  // The following properties are used only to report grammar errors
25346
- node.decorators = undefined;
25353
+ node.illegalDecorators = undefined;
25347
25354
  return node;
25348
25355
  }
25349
25356
  // @api
@@ -25356,7 +25363,7 @@ var ts;
25356
25363
  }
25357
25364
  function finishUpdateEnumDeclaration(updated, original) {
25358
25365
  if (updated !== original) {
25359
- updated.decorators = original.decorators;
25366
+ updated.illegalDecorators = original.illegalDecorators;
25360
25367
  }
25361
25368
  return update(updated, original);
25362
25369
  }
@@ -25380,7 +25387,7 @@ var ts;
25380
25387
  }
25381
25388
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // Module declarations cannot contain `await`.
25382
25389
  // The following properties are used only to report grammar errors
25383
- node.decorators = undefined;
25390
+ node.illegalDecorators = undefined;
25384
25391
  return node;
25385
25392
  }
25386
25393
  // @api
@@ -25393,7 +25400,7 @@ var ts;
25393
25400
  }
25394
25401
  function finishUpdateModuleDeclaration(updated, original) {
25395
25402
  if (updated !== original) {
25396
- updated.decorators = original.decorators;
25403
+ updated.illegalDecorators = original.illegalDecorators;
25397
25404
  }
25398
25405
  return update(updated, original);
25399
25406
  }
@@ -25429,7 +25436,7 @@ var ts;
25429
25436
  /*modifiers*/ undefined, name);
25430
25437
  node.transformFlags = 1 /* ContainsTypeScript */;
25431
25438
  // The following properties are used only to report grammar errors
25432
- node.decorators = undefined;
25439
+ node.illegalDecorators = undefined;
25433
25440
  node.modifiers = undefined;
25434
25441
  return node;
25435
25442
  }
@@ -25441,7 +25448,7 @@ var ts;
25441
25448
  }
25442
25449
  function finishUpdateNamespaceExportDeclaration(updated, original) {
25443
25450
  if (updated !== original) {
25444
- updated.decorators = original.decorators;
25451
+ updated.illegalDecorators = original.illegalDecorators;
25445
25452
  updated.modifiers = original.modifiers;
25446
25453
  }
25447
25454
  return update(updated, original);
@@ -25456,7 +25463,7 @@ var ts;
25456
25463
  node.transformFlags |= 1 /* ContainsTypeScript */;
25457
25464
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // Import= declaration is always parsed in an Await context
25458
25465
  // The following properties are used only to report grammar errors
25459
- node.decorators = undefined;
25466
+ node.illegalDecorators = undefined;
25460
25467
  return node;
25461
25468
  }
25462
25469
  // @api
@@ -25470,7 +25477,7 @@ var ts;
25470
25477
  }
25471
25478
  function finishUpdateImportEqualsDeclaration(updated, original) {
25472
25479
  if (updated !== original) {
25473
- updated.decorators = original.decorators;
25480
+ updated.illegalDecorators = original.illegalDecorators;
25474
25481
  }
25475
25482
  return update(updated, original);
25476
25483
  }
@@ -25486,7 +25493,7 @@ var ts;
25486
25493
  propagateChildFlags(node.moduleSpecifier);
25487
25494
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
25488
25495
  // The following properties are used only to report grammar errors
25489
- node.decorators = undefined;
25496
+ node.illegalDecorators = undefined;
25490
25497
  return node;
25491
25498
  }
25492
25499
  // @api
@@ -25500,7 +25507,7 @@ var ts;
25500
25507
  }
25501
25508
  function finishUpdateImportDeclaration(updated, original) {
25502
25509
  if (updated !== original) {
25503
- updated.decorators = original.decorators;
25510
+ updated.illegalDecorators = original.illegalDecorators;
25504
25511
  }
25505
25512
  return update(updated, original);
25506
25513
  }
@@ -25646,7 +25653,7 @@ var ts;
25646
25653
  node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression);
25647
25654
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
25648
25655
  // The following properties are used only to report grammar errors
25649
- node.decorators = undefined;
25656
+ node.illegalDecorators = undefined;
25650
25657
  return node;
25651
25658
  }
25652
25659
  // @api
@@ -25658,7 +25665,7 @@ var ts;
25658
25665
  }
25659
25666
  function finishUpdateExportAssignment(updated, original) {
25660
25667
  if (updated !== original) {
25661
- updated.decorators = original.decorators;
25668
+ updated.illegalDecorators = original.illegalDecorators;
25662
25669
  }
25663
25670
  return update(updated, original);
25664
25671
  }
@@ -25676,7 +25683,7 @@ var ts;
25676
25683
  propagateChildFlags(node.moduleSpecifier);
25677
25684
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
25678
25685
  // The following properties are used only to report grammar errors
25679
- node.decorators = undefined;
25686
+ node.illegalDecorators = undefined;
25680
25687
  return node;
25681
25688
  }
25682
25689
  // @api
@@ -25691,7 +25698,7 @@ var ts;
25691
25698
  }
25692
25699
  function finishUpdateExportDeclaration(updated, original) {
25693
25700
  if (updated !== original) {
25694
- updated.decorators = original.decorators;
25701
+ updated.illegalDecorators = original.illegalDecorators;
25695
25702
  }
25696
25703
  return update(updated, original);
25697
25704
  }
@@ -26455,7 +26462,7 @@ var ts;
26455
26462
  propagateChildFlags(node.name) |
26456
26463
  propagateChildFlags(node.initializer);
26457
26464
  // The following properties are used only to report grammar errors
26458
- node.decorators = undefined;
26465
+ node.illegalDecorators = undefined;
26459
26466
  node.modifiers = undefined;
26460
26467
  node.questionToken = undefined;
26461
26468
  node.exclamationToken = undefined;
@@ -26471,7 +26478,7 @@ var ts;
26471
26478
  function finishUpdatePropertyAssignment(updated, original) {
26472
26479
  // copy children used only for error reporting
26473
26480
  if (updated !== original) {
26474
- updated.decorators = original.decorators;
26481
+ updated.illegalDecorators = original.illegalDecorators;
26475
26482
  updated.modifiers = original.modifiers;
26476
26483
  updated.questionToken = original.questionToken;
26477
26484
  updated.exclamationToken = original.exclamationToken;
@@ -26488,7 +26495,7 @@ var ts;
26488
26495
  1024 /* ContainsES2015 */;
26489
26496
  // The following properties are used only to report grammar errors
26490
26497
  node.equalsToken = undefined;
26491
- node.decorators = undefined;
26498
+ node.illegalDecorators = undefined;
26492
26499
  node.modifiers = undefined;
26493
26500
  node.questionToken = undefined;
26494
26501
  node.exclamationToken = undefined;
@@ -26505,7 +26512,7 @@ var ts;
26505
26512
  if (updated !== original) {
26506
26513
  // copy children used only for error reporting
26507
26514
  updated.equalsToken = original.equalsToken;
26508
- updated.decorators = original.decorators;
26515
+ updated.illegalDecorators = original.illegalDecorators;
26509
26516
  updated.modifiers = original.modifiers;
26510
26517
  updated.questionToken = original.questionToken;
26511
26518
  updated.exclamationToken = original.exclamationToken;
@@ -30984,7 +30991,7 @@ var ts;
30984
30991
  visitNode(cbNode, node.default) ||
30985
30992
  visitNode(cbNode, node.expression);
30986
30993
  case 297 /* ShorthandPropertyAssignment */:
30987
- return visitNodes(cbNode, cbNodes, node.decorators) ||
30994
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
30988
30995
  visitNodes(cbNode, cbNodes, node.modifiers) ||
30989
30996
  visitNode(cbNode, node.name) ||
30990
30997
  visitNode(cbNode, node.questionToken) ||
@@ -31014,7 +31021,7 @@ var ts;
31014
31021
  visitNode(cbNode, node.type) ||
31015
31022
  visitNode(cbNode, node.initializer);
31016
31023
  case 296 /* PropertyAssignment */:
31017
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31024
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31018
31025
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31019
31026
  visitNode(cbNode, node.name) ||
31020
31027
  visitNode(cbNode, node.questionToken) ||
@@ -31031,7 +31038,7 @@ var ts;
31031
31038
  visitNode(cbNode, node.name) ||
31032
31039
  visitNode(cbNode, node.initializer);
31033
31040
  case 176 /* IndexSignature */:
31034
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31041
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31035
31042
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31036
31043
  visitNodes(cbNode, cbNodes, node.typeParameters) ||
31037
31044
  visitNodes(cbNode, cbNodes, node.parameters) ||
@@ -31069,7 +31076,7 @@ var ts;
31069
31076
  visitNodes(cbNode, cbNodes, node.parameters) ||
31070
31077
  visitNode(cbNode, node.type);
31071
31078
  case 171 /* Constructor */:
31072
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31079
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31073
31080
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31074
31081
  visitNode(cbNode, node.name) ||
31075
31082
  visitNodes(cbNode, cbNodes, node.typeParameters) ||
@@ -31091,7 +31098,7 @@ var ts;
31091
31098
  visitNode(cbNode, node.type) ||
31092
31099
  visitNode(cbNode, node.body);
31093
31100
  case 256 /* FunctionDeclaration */:
31094
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31101
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31095
31102
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31096
31103
  visitNode(cbNode, node.asteriskToken) ||
31097
31104
  visitNode(cbNode, node.name) ||
@@ -31115,7 +31122,7 @@ var ts;
31115
31122
  visitNode(cbNode, node.equalsGreaterThanToken) ||
31116
31123
  visitNode(cbNode, node.body);
31117
31124
  case 170 /* ClassStaticBlockDeclaration */:
31118
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31125
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31119
31126
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31120
31127
  visitNode(cbNode, node.body);
31121
31128
  case 178 /* TypeReference */:
@@ -31243,7 +31250,7 @@ var ts;
31243
31250
  return visitNodes(cbNode, cbNodes, node.statements) ||
31244
31251
  visitNode(cbNode, node.endOfFileToken);
31245
31252
  case 237 /* VariableStatement */:
31246
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31253
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31247
31254
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31248
31255
  visitNode(cbNode, node.declarationList);
31249
31256
  case 255 /* VariableDeclarationList */:
@@ -31314,20 +31321,20 @@ var ts;
31314
31321
  visitNodes(cbNode, cbNodes, node.heritageClauses) ||
31315
31322
  visitNodes(cbNode, cbNodes, node.members);
31316
31323
  case 258 /* InterfaceDeclaration */:
31317
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31324
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31318
31325
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31319
31326
  visitNode(cbNode, node.name) ||
31320
31327
  visitNodes(cbNode, cbNodes, node.typeParameters) ||
31321
31328
  visitNodes(cbNode, cbNodes, node.heritageClauses) ||
31322
31329
  visitNodes(cbNode, cbNodes, node.members);
31323
31330
  case 259 /* TypeAliasDeclaration */:
31324
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31331
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31325
31332
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31326
31333
  visitNode(cbNode, node.name) ||
31327
31334
  visitNodes(cbNode, cbNodes, node.typeParameters) ||
31328
31335
  visitNode(cbNode, node.type);
31329
31336
  case 260 /* EnumDeclaration */:
31330
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31337
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31331
31338
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31332
31339
  visitNode(cbNode, node.name) ||
31333
31340
  visitNodes(cbNode, cbNodes, node.members);
@@ -31335,17 +31342,17 @@ var ts;
31335
31342
  return visitNode(cbNode, node.name) ||
31336
31343
  visitNode(cbNode, node.initializer);
31337
31344
  case 261 /* ModuleDeclaration */:
31338
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31345
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31339
31346
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31340
31347
  visitNode(cbNode, node.name) ||
31341
31348
  visitNode(cbNode, node.body);
31342
31349
  case 265 /* ImportEqualsDeclaration */:
31343
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31350
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31344
31351
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31345
31352
  visitNode(cbNode, node.name) ||
31346
31353
  visitNode(cbNode, node.moduleReference);
31347
31354
  case 266 /* ImportDeclaration */:
31348
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31355
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31349
31356
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31350
31357
  visitNode(cbNode, node.importClause) ||
31351
31358
  visitNode(cbNode, node.moduleSpecifier) ||
@@ -31359,7 +31366,7 @@ var ts;
31359
31366
  return visitNode(cbNode, node.name) ||
31360
31367
  visitNode(cbNode, node.value);
31361
31368
  case 264 /* NamespaceExportDeclaration */:
31362
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31369
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31363
31370
  visitNode(cbNode, node.name);
31364
31371
  case 268 /* NamespaceImport */:
31365
31372
  return visitNode(cbNode, node.name);
@@ -31369,7 +31376,7 @@ var ts;
31369
31376
  case 273 /* NamedExports */:
31370
31377
  return visitNodes(cbNode, cbNodes, node.elements);
31371
31378
  case 272 /* ExportDeclaration */:
31372
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31379
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31373
31380
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31374
31381
  visitNode(cbNode, node.exportClause) ||
31375
31382
  visitNode(cbNode, node.moduleSpecifier) ||
@@ -31379,7 +31386,7 @@ var ts;
31379
31386
  return visitNode(cbNode, node.propertyName) ||
31380
31387
  visitNode(cbNode, node.name);
31381
31388
  case 271 /* ExportAssignment */:
31382
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31389
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31383
31390
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31384
31391
  visitNode(cbNode, node.expression);
31385
31392
  case 223 /* TemplateExpression */:
@@ -31404,7 +31411,7 @@ var ts;
31404
31411
  case 277 /* ExternalModuleReference */:
31405
31412
  return visitNode(cbNode, node.expression);
31406
31413
  case 276 /* MissingDeclaration */:
31407
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31414
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31408
31415
  visitNodes(cbNode, cbNodes, node.modifiers);
31409
31416
  case 351 /* CommaListExpression */:
31410
31417
  return visitNodes(cbNode, cbNodes, node.elements);
@@ -33955,7 +33962,7 @@ var ts;
33955
33962
  var type = parseTypeAnnotation();
33956
33963
  parseTypeMemberSemicolon();
33957
33964
  var node = factory.createIndexSignature(modifiers, parameters, type);
33958
- node.decorators = decorators;
33965
+ node.illegalDecorators = decorators;
33959
33966
  return withJSDoc(finishNode(node, pos), hasJSDoc);
33960
33967
  }
33961
33968
  function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
@@ -36115,7 +36122,7 @@ var ts;
36115
36122
  node = factory.createPropertyAssignment(name, initializer);
36116
36123
  }
36117
36124
  // Decorators, Modifiers, questionToken, and exclamationToken are not supported by property assignments and are reported in the grammar checker
36118
- node.decorators = decorators;
36125
+ node.illegalDecorators = decorators;
36119
36126
  node.modifiers = modifiers;
36120
36127
  node.questionToken = questionToken;
36121
36128
  node.exclamationToken = exclamationToken;
@@ -36763,7 +36770,7 @@ var ts;
36763
36770
  // would follow. For recovery and error reporting purposes, return an incomplete declaration.
36764
36771
  var missing = createMissingNode(276 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected);
36765
36772
  ts.setTextRangePos(missing, pos);
36766
- missing.decorators = decorators;
36773
+ missing.illegalDecorators = decorators;
36767
36774
  missing.modifiers = modifiers;
36768
36775
  return missing;
36769
36776
  }
@@ -36906,7 +36913,7 @@ var ts;
36906
36913
  parseSemicolon();
36907
36914
  var node = factory.createVariableStatement(modifiers, declarationList);
36908
36915
  // Decorators are not allowed on a variable statement, so we keep track of them to report them in the grammar checker.
36909
- node.decorators = decorators;
36916
+ node.illegalDecorators = decorators;
36910
36917
  return withJSDoc(finishNode(node, pos), hasJSDoc);
36911
36918
  }
36912
36919
  function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) {
@@ -36926,7 +36933,7 @@ var ts;
36926
36933
  var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, ts.Diagnostics.or_expected);
36927
36934
  setAwaitContext(savedAwaitContext);
36928
36935
  var node = factory.createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body);
36929
- node.decorators = decorators;
36936
+ node.illegalDecorators = decorators;
36930
36937
  return withJSDoc(finishNode(node, pos), hasJSDoc);
36931
36938
  }
36932
36939
  function parseConstructorName() {
@@ -36949,7 +36956,7 @@ var ts;
36949
36956
  var body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected);
36950
36957
  var node = factory.createConstructorDeclaration(modifiers, parameters, body);
36951
36958
  // Attach invalid nodes if they exist so that we can report them in the grammar checker.
36952
- node.decorators = decorators;
36959
+ node.illegalDecorators = decorators;
36953
36960
  node.typeParameters = typeParameters;
36954
36961
  node.type = type;
36955
36962
  return withJSDoc(finishNode(node, pos), hasJSDoc);
@@ -37065,7 +37072,7 @@ var ts;
37065
37072
  parseExpectedToken(124 /* StaticKeyword */);
37066
37073
  var body = parseClassStaticBlockBody();
37067
37074
  var node = withJSDoc(finishNode(factory.createClassStaticBlockDeclaration(body), pos), hasJSDoc);
37068
- node.decorators = decorators;
37075
+ node.illegalDecorators = decorators;
37069
37076
  node.modifiers = modifiers;
37070
37077
  return node;
37071
37078
  }
@@ -37306,7 +37313,7 @@ var ts;
37306
37313
  var heritageClauses = parseHeritageClauses();
37307
37314
  var members = parseObjectTypeMembers();
37308
37315
  var node = factory.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members);
37309
- node.decorators = decorators;
37316
+ node.illegalDecorators = decorators;
37310
37317
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37311
37318
  }
37312
37319
  function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) {
@@ -37317,7 +37324,7 @@ var ts;
37317
37324
  var type = token() === 138 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType();
37318
37325
  parseSemicolon();
37319
37326
  var node = factory.createTypeAliasDeclaration(modifiers, name, typeParameters, type);
37320
- node.decorators = decorators;
37327
+ node.illegalDecorators = decorators;
37321
37328
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37322
37329
  }
37323
37330
  // In an ambient declaration, the grammar only allows integer literals as initializers.
@@ -37343,7 +37350,7 @@ var ts;
37343
37350
  members = createMissingList();
37344
37351
  }
37345
37352
  var node = factory.createEnumDeclaration(modifiers, name, members);
37346
- node.decorators = decorators;
37353
+ node.illegalDecorators = decorators;
37347
37354
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37348
37355
  }
37349
37356
  function parseModuleBlock() {
@@ -37367,7 +37374,7 @@ var ts;
37367
37374
  ? parseModuleOrNamespaceDeclaration(getNodePos(), /*hasJSDoc*/ false, /*decorators*/ undefined, /*modifiers*/ undefined, 4 /* NestedNamespace */ | namespaceFlag)
37368
37375
  : parseModuleBlock();
37369
37376
  var node = factory.createModuleDeclaration(modifiers, name, body, flags);
37370
- node.decorators = decorators;
37377
+ node.illegalDecorators = decorators;
37371
37378
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37372
37379
  }
37373
37380
  function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {
@@ -37390,7 +37397,7 @@ var ts;
37390
37397
  parseSemicolon();
37391
37398
  }
37392
37399
  var node = factory.createModuleDeclaration(modifiers, name, body, flags);
37393
- node.decorators = decorators;
37400
+ node.illegalDecorators = decorators;
37394
37401
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37395
37402
  }
37396
37403
  function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {
@@ -37430,7 +37437,7 @@ var ts;
37430
37437
  parseSemicolon();
37431
37438
  var node = factory.createNamespaceExportDeclaration(name);
37432
37439
  // NamespaceExportDeclaration nodes cannot have decorators or modifiers, so we attach them here so we can report them in the grammar checker
37433
- node.decorators = decorators;
37440
+ node.illegalDecorators = decorators;
37434
37441
  node.modifiers = modifiers;
37435
37442
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37436
37443
  }
@@ -37470,7 +37477,7 @@ var ts;
37470
37477
  }
37471
37478
  parseSemicolon();
37472
37479
  var node = factory.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause);
37473
- node.decorators = decorators;
37480
+ node.illegalDecorators = decorators;
37474
37481
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37475
37482
  }
37476
37483
  function parseAssertEntry() {
@@ -37515,7 +37522,7 @@ var ts;
37515
37522
  var moduleReference = parseModuleReference();
37516
37523
  parseSemicolon();
37517
37524
  var node = factory.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference);
37518
- node.decorators = decorators;
37525
+ node.illegalDecorators = decorators;
37519
37526
  var finished = withJSDoc(finishNode(node, pos), hasJSDoc);
37520
37527
  return finished;
37521
37528
  }
@@ -37705,7 +37712,7 @@ var ts;
37705
37712
  parseSemicolon();
37706
37713
  setAwaitContext(savedAwaitContext);
37707
37714
  var node = factory.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause);
37708
- node.decorators = decorators;
37715
+ node.illegalDecorators = decorators;
37709
37716
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37710
37717
  }
37711
37718
  function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) {
@@ -37722,7 +37729,7 @@ var ts;
37722
37729
  parseSemicolon();
37723
37730
  setAwaitContext(savedAwaitContext);
37724
37731
  var node = factory.createExportAssignment(modifiers, isExportEquals, expression);
37725
- node.decorators = decorators;
37732
+ node.illegalDecorators = decorators;
37726
37733
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37727
37734
  }
37728
37735
  var ParsingContext;
@@ -51020,41 +51027,61 @@ var ts;
51020
51027
  return typeof file.externalModuleIndicator !== "object" && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), /*sourceNode*/ undefined, dontResolveAlias);
51021
51028
  }
51022
51029
  function getTargetOfImportClause(node, dontResolveAlias) {
51023
- var _a;
51024
51030
  var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
51025
51031
  if (moduleSymbol) {
51026
- var exportDefaultSymbol = void 0;
51027
- if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
51028
- exportDefaultSymbol = moduleSymbol;
51029
- }
51030
- else {
51031
- exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias);
51032
- }
51033
- var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
51034
- var hasDefaultOnly = isOnlyImportedAsDefault(node.parent.moduleSpecifier);
51035
- var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, node.parent.moduleSpecifier);
51036
- if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
51037
- if (hasExportAssignmentSymbol(moduleSymbol)) {
51038
- var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
51039
- var exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */);
51040
- var exportAssignment = exportEqualsSymbol.valueDeclaration;
51041
- var err = error(node.name, ts.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName);
51042
- if (exportAssignment) {
51043
- 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));
51044
- }
51045
- }
51046
- else {
51047
- reportNonDefaultExport(moduleSymbol, node);
51032
+ return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
51033
+ }
51034
+ }
51035
+ function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) {
51036
+ var _a;
51037
+ var exportDefaultSymbol;
51038
+ if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
51039
+ exportDefaultSymbol = moduleSymbol;
51040
+ }
51041
+ else {
51042
+ exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias);
51043
+ }
51044
+ var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
51045
+ var specifier = getModuleSpecifierForImportOrExport(node);
51046
+ if (!specifier) {
51047
+ return exportDefaultSymbol;
51048
+ }
51049
+ var hasDefaultOnly = isOnlyImportedAsDefault(specifier);
51050
+ var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier);
51051
+ if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
51052
+ if (hasExportAssignmentSymbol(moduleSymbol)) {
51053
+ var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
51054
+ var exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */);
51055
+ var exportAssignment = exportEqualsSymbol.valueDeclaration;
51056
+ var err = error(node.name, ts.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName);
51057
+ if (exportAssignment) {
51058
+ 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));
51048
51059
  }
51049
51060
  }
51050
- else if (hasSyntheticDefault || hasDefaultOnly) {
51051
- // per emit behavior, a synthetic default overrides a "real" .default member if `__esModule` is not present
51052
- var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
51053
- markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, /*overwriteTypeOnly*/ false);
51054
- return resolved;
51061
+ else if (ts.isImportClause(node)) {
51062
+ reportNonDefaultExport(moduleSymbol, node);
51055
51063
  }
51056
- markSymbolOfAliasDeclarationIfTypeOnly(node, exportDefaultSymbol, /*finalTarget*/ undefined, /*overwriteTypeOnly*/ false);
51057
- return exportDefaultSymbol;
51064
+ else {
51065
+ errorNoModuleMemberSymbol(moduleSymbol, moduleSymbol, node, ts.isImportOrExportSpecifier(node) && node.propertyName || node.name);
51066
+ }
51067
+ }
51068
+ else if (hasSyntheticDefault || hasDefaultOnly) {
51069
+ // per emit behavior, a synthetic default overrides a "real" .default member if `__esModule` is not present
51070
+ var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
51071
+ markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, /*overwriteTypeOnly*/ false);
51072
+ return resolved;
51073
+ }
51074
+ markSymbolOfAliasDeclarationIfTypeOnly(node, exportDefaultSymbol, /*finalTarget*/ undefined, /*overwriteTypeOnly*/ false);
51075
+ return exportDefaultSymbol;
51076
+ }
51077
+ function getModuleSpecifierForImportOrExport(node) {
51078
+ switch (node.kind) {
51079
+ case 267 /* ImportClause */: return node.parent.moduleSpecifier;
51080
+ case 265 /* ImportEqualsDeclaration */: return ts.isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : undefined;
51081
+ case 268 /* NamespaceImport */: return node.parent.parent.moduleSpecifier;
51082
+ case 270 /* ImportSpecifier */: return node.parent.parent.parent.moduleSpecifier;
51083
+ case 275 /* ExportSpecifier */: return node.parent.parent.moduleSpecifier;
51084
+ default: return ts.Debug.assertNever(node);
51058
51085
  }
51059
51086
  }
51060
51087
  function reportNonDefaultExport(moduleSymbol, node) {
@@ -51144,7 +51171,7 @@ var ts;
51144
51171
  }
51145
51172
  }
51146
51173
  function getExternalModuleMember(node, specifier, dontResolveAlias) {
51147
- var _a, _b;
51174
+ var _a;
51148
51175
  if (dontResolveAlias === void 0) { dontResolveAlias = false; }
51149
51176
  var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier;
51150
51177
  var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); // TODO: GH#18217
@@ -51180,29 +51207,33 @@ var ts;
51180
51207
  combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) :
51181
51208
  symbolFromModule || symbolFromVariable;
51182
51209
  if (!symbol) {
51183
- var moduleName = getFullyQualifiedName(moduleSymbol, node);
51184
- var declarationName = ts.declarationNameToString(name);
51185
- var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
51186
- if (suggestion !== undefined) {
51187
- var suggestionName = symbolToString(suggestion);
51188
- var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
51189
- if (suggestion.valueDeclaration) {
51190
- ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
51191
- }
51192
- }
51193
- else {
51194
- if ((_b = moduleSymbol.exports) === null || _b === void 0 ? void 0 : _b.has("default" /* Default */)) {
51195
- error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);
51196
- }
51197
- else {
51198
- reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName);
51199
- }
51200
- }
51210
+ errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name);
51201
51211
  }
51202
51212
  return symbol;
51203
51213
  }
51204
51214
  }
51205
51215
  }
51216
+ function errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name) {
51217
+ var _a;
51218
+ var moduleName = getFullyQualifiedName(moduleSymbol, node);
51219
+ var declarationName = ts.declarationNameToString(name);
51220
+ var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
51221
+ if (suggestion !== undefined) {
51222
+ var suggestionName = symbolToString(suggestion);
51223
+ var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
51224
+ if (suggestion.valueDeclaration) {
51225
+ ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
51226
+ }
51227
+ }
51228
+ else {
51229
+ if ((_a = moduleSymbol.exports) === null || _a === void 0 ? void 0 : _a.has("default" /* Default */)) {
51230
+ error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);
51231
+ }
51232
+ else {
51233
+ reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName);
51234
+ }
51235
+ }
51236
+ }
51206
51237
  function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
51207
51238
  var _a, _b;
51208
51239
  var localSymbol = (_b = (_a = moduleSymbol.valueDeclaration) === null || _a === void 0 ? void 0 : _a.locals) === null || _b === void 0 ? void 0 : _b.get(name.escapedText);
@@ -51248,6 +51279,13 @@ var ts;
51248
51279
  }
51249
51280
  }
51250
51281
  function getTargetOfImportSpecifier(node, dontResolveAlias) {
51282
+ if (ts.isImportSpecifier(node) && ts.idText(node.propertyName || node.name) === "default" /* Default */) {
51283
+ var specifier = getModuleSpecifierForImportOrExport(node);
51284
+ var moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
51285
+ if (moduleSymbol) {
51286
+ return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
51287
+ }
51288
+ }
51251
51289
  var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent;
51252
51290
  var commonJSPropertyAccess = getCommonJSPropertyAccess(root);
51253
51291
  var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
@@ -51269,6 +51307,13 @@ var ts;
51269
51307
  return resolved;
51270
51308
  }
51271
51309
  function getTargetOfExportSpecifier(node, meaning, dontResolveAlias) {
51310
+ if (ts.idText(node.propertyName || node.name) === "default" /* Default */) {
51311
+ var specifier = getModuleSpecifierForImportOrExport(node);
51312
+ var moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
51313
+ if (moduleSymbol) {
51314
+ return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias);
51315
+ }
51316
+ }
51272
51317
  var resolved = node.parent.parent.moduleSpecifier ?
51273
51318
  getExternalModuleMember(node.parent.parent, node, dontResolveAlias) :
51274
51319
  resolveEntityName(node.propertyName || node.name, meaning, /*ignoreErrors*/ false, dontResolveAlias);
@@ -55717,7 +55762,7 @@ var ts;
55717
55762
  // This is an else/if as accessors and properties can't merge in TS, but might in JS
55718
55763
  // If this happens, we assume the accessor takes priority, as it imposes more constraints
55719
55764
  else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) {
55720
- 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, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled),
55765
+ 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),
55721
55766
  // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357
55722
55767
  // interface members can't have initializers, however class members _can_
55723
55768
  /*initializer*/ undefined), ((_d = p.declarations) === null || _d === void 0 ? void 0 : _d.find(ts.or(ts.isPropertyDeclaration, ts.isVariableDeclaration))) || firstPropertyLikeDecl);
@@ -56969,8 +57014,32 @@ var ts;
56969
57014
  // The type implied by a binding pattern is independent of context, so we check the initializer with no
56970
57015
  // contextual type or, if the element itself is a binding pattern, with the type implied by that binding
56971
57016
  // pattern.
56972
- var contextualType = ts.isBindingPattern(element.name) ? getTypeFromBindingPattern(element.name, /*includePatternInType*/ true, /*reportErrors*/ false) : unknownType;
56973
- return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0 /* Normal */, contextualType)));
57017
+ if (ts.isBindingPattern(element.name)) {
57018
+ var contextualType = getTypeFromBindingPattern(element.name, /*includePatternInType*/ true, /*reportErrors*/ false);
57019
+ return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0 /* Normal */, contextualType)));
57020
+ }
57021
+ // (#49989)
57022
+ // In cases where the intitializer is an identifier referencing a sibling symbol (i.e., one that is
57023
+ // defined in the same declaration) a false circular relationship will be concluded. For example, take
57024
+ // the declarations below:
57025
+ //
57026
+ // const [a, b = a] = [1];
57027
+ // const {a, b = a} = {a: 1};
57028
+ //
57029
+ // Here, when the `element` is the second binding element (i.e., `b = a`) the initializer is `a` which
57030
+ // itself is defined within the same binding pattern.
57031
+ //
57032
+ // So, we check the initializer expression for any references to sibling symbols and if any, then we'd
57033
+ // conclude the binding element type as `unknownType` and thus skip further circulations in type
57034
+ // checking.
57035
+ var siblings_1 = ts.mapDefined(element.parent.elements, function (x) { return x !== element && ts.isBindingElement(x) && ts.isIdentifier(x.name) ? x : undefined; });
57036
+ var checkIsSiblingInvolved = function (node) {
57037
+ var declaration = ts.isIdentifier(node) && getReferencedValueDeclaration(node);
57038
+ return declaration && ts.isBindingElement(declaration) && siblings_1.includes(declaration);
57039
+ };
57040
+ var isSiblingElementInvolded = checkIsSiblingInvolved(element.initializer) || ts.forEachChildRecursively(element.initializer, checkIsSiblingInvolved);
57041
+ return isSiblingElementInvolded ? anyType
57042
+ : addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0 /* Normal */, unknownType)));
56974
57043
  }
56975
57044
  if (ts.isBindingPattern(element.name)) {
56976
57045
  return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors);
@@ -68416,19 +68485,19 @@ var ts;
68416
68485
  }
68417
68486
  function getSiblingsOfContext(context) {
68418
68487
  if (!context.siblings) {
68419
- var siblings_1 = [];
68488
+ var siblings_2 = [];
68420
68489
  for (var _i = 0, _a = getSiblingsOfContext(context.parent); _i < _a.length; _i++) {
68421
68490
  var type = _a[_i];
68422
68491
  if (isObjectLiteralType(type)) {
68423
68492
  var prop = getPropertyOfObjectType(type, context.propertyName);
68424
68493
  if (prop) {
68425
68494
  forEachType(getTypeOfSymbol(prop), function (t) {
68426
- siblings_1.push(t);
68495
+ siblings_2.push(t);
68427
68496
  });
68428
68497
  }
68429
68498
  }
68430
68499
  }
68431
- context.siblings = siblings_1;
68500
+ context.siblings = siblings_2;
68432
68501
  }
68433
68502
  return context.siblings;
68434
68503
  }
@@ -88741,7 +88810,7 @@ var ts;
88741
88810
  return checkGrammarDecorators(node) || checkGrammarModifiers(node);
88742
88811
  }
88743
88812
  function checkGrammarDecorators(node) {
88744
- if (ts.canHaveIllegalDecorators(node) && ts.some(node.decorators)) {
88813
+ if (ts.canHaveIllegalDecorators(node) && ts.some(node.illegalDecorators)) {
88745
88814
  return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here);
88746
88815
  }
88747
88816
  if (!ts.canHaveDecorators(node) || !ts.hasDecorators(node)) {