@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.
package/lib/typescript.js CHANGED
@@ -2488,6 +2488,7 @@ var ts;
2488
2488
  var currentAssertionLevel = 0 /* None */;
2489
2489
  Debug.currentLogLevel = LogLevel.Warning;
2490
2490
  Debug.isDebugging = false;
2491
+ Debug.enableDeprecationWarnings = true;
2491
2492
  function getTypeScriptVersion() {
2492
2493
  return typeScriptVersion !== null && typeScriptVersion !== void 0 ? typeScriptVersion : (typeScriptVersion = new ts.Version(ts.version));
2493
2494
  }
@@ -3111,7 +3112,7 @@ var ts;
3111
3112
  function createWarningDeprecation(name, errorAfter, since, message) {
3112
3113
  var hasWrittenDeprecation = false;
3113
3114
  return function () {
3114
- if (!hasWrittenDeprecation) {
3115
+ if (Debug.enableDeprecationWarnings && !hasWrittenDeprecation) {
3115
3116
  log.warn(formatDeprecationMessage(name, /*error*/ false, errorAfter, since, message));
3116
3117
  hasWrittenDeprecation = true;
3117
3118
  }
@@ -6131,6 +6132,7 @@ var ts;
6131
6132
  var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels);
6132
6133
  /* @internal */
6133
6134
  ts.unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels);
6135
+ /* @internal */
6134
6136
  function setCustomPollingValues(system) {
6135
6137
  if (!system.getEnvironmentVariable) {
6136
6138
  return;
@@ -6173,6 +6175,7 @@ var ts;
6173
6175
  createPollingIntervalBasedLevels(customLevels ? __assign(__assign({}, defaultLevels), customLevels) : defaultLevels);
6174
6176
  }
6175
6177
  }
6178
+ ts.setCustomPollingValues = setCustomPollingValues;
6176
6179
  function pollWatchedFileQueue(host, queue, pollIndex, chunkSize, callbackOnWatchFileStat) {
6177
6180
  var definedValueCopyToIndex = pollIndex;
6178
6181
  // Max visit would be all elements of the queue
@@ -6218,6 +6221,7 @@ var ts;
6218
6221
  }
6219
6222
  }
6220
6223
  }
6224
+ /* @internal */
6221
6225
  function createDynamicPriorityPollingWatchFile(host) {
6222
6226
  var watchedFiles = [];
6223
6227
  var changedFilesInLastPoll = [];
@@ -6326,6 +6330,7 @@ var ts;
6326
6330
  pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === PollingInterval.Low ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingIntervalQueue(pollingInterval));
6327
6331
  }
6328
6332
  }
6333
+ ts.createDynamicPriorityPollingWatchFile = createDynamicPriorityPollingWatchFile;
6329
6334
  function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) {
6330
6335
  // One file can have multiple watchers
6331
6336
  var fileWatcherCallbacks = ts.createMultiMap();
@@ -6404,36 +6409,42 @@ var ts;
6404
6409
  pollScheduled = host.setTimeout(pollQueue, PollingInterval.High);
6405
6410
  }
6406
6411
  }
6407
- function createSingleWatcherPerName(cache, useCaseSensitiveFileNames, name, callback, createWatcher) {
6412
+ /* @internal */
6413
+ function createSingleFileWatcherPerName(watchFile, useCaseSensitiveFileNames) {
6414
+ var cache = new ts.Map();
6415
+ var callbacksCache = ts.createMultiMap();
6408
6416
  var toCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
6409
- var path = toCanonicalFileName(name);
6410
- var existing = cache.get(path);
6411
- if (existing) {
6412
- existing.callbacks.push(callback);
6413
- }
6414
- else {
6415
- cache.set(path, {
6416
- watcher: createWatcher((
6417
- // Cant infer types correctly so lets satisfy checker
6418
- 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); }); })),
6419
- callbacks: [callback]
6420
- });
6421
- }
6422
- return {
6423
- close: function () {
6424
- var watcher = cache.get(path);
6425
- if (!watcher)
6426
- return;
6427
- if (!ts.orderedRemoveItem(watcher.callbacks, callback) || watcher.callbacks.length)
6428
- return;
6429
- cache.delete(path);
6430
- ts.closeFileWatcherOf(watcher);
6417
+ return function (fileName, callback, pollingInterval, options) {
6418
+ var path = toCanonicalFileName(fileName);
6419
+ var existing = cache.get(path);
6420
+ if (existing) {
6421
+ existing.refCount++;
6422
+ }
6423
+ else {
6424
+ cache.set(path, {
6425
+ watcher: watchFile(fileName, function (fileName, eventKind, modifiedTime) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind, modifiedTime); }); }, pollingInterval, options),
6426
+ refCount: 1
6427
+ });
6431
6428
  }
6429
+ callbacksCache.add(path, callback);
6430
+ return {
6431
+ close: function () {
6432
+ var watcher = ts.Debug.checkDefined(cache.get(path));
6433
+ callbacksCache.remove(path, callback);
6434
+ watcher.refCount--;
6435
+ if (watcher.refCount)
6436
+ return;
6437
+ cache.delete(path);
6438
+ ts.closeFileWatcherOf(watcher);
6439
+ }
6440
+ };
6432
6441
  };
6433
6442
  }
6443
+ ts.createSingleFileWatcherPerName = createSingleFileWatcherPerName;
6434
6444
  /**
6435
6445
  * Returns true if file status changed
6436
6446
  */
6447
+ /*@internal*/
6437
6448
  function onWatchedFileStat(watchedFile, modifiedTime) {
6438
6449
  var oldTime = watchedFile.mtime.getTime();
6439
6450
  var newTime = modifiedTime.getTime();
@@ -6445,6 +6456,7 @@ var ts;
6445
6456
  }
6446
6457
  return false;
6447
6458
  }
6459
+ ts.onWatchedFileStat = onWatchedFileStat;
6448
6460
  /*@internal*/
6449
6461
  function getFileWatcherEventKind(oldTime, newTime) {
6450
6462
  return oldTime === 0
@@ -6472,6 +6484,7 @@ var ts;
6472
6484
  * that means if this is recursive watcher, watch the children directories as well
6473
6485
  * (eg on OS that dont support recursive watch using fs.watch use fs.watchFile)
6474
6486
  */
6487
+ /*@internal*/
6475
6488
  function createDirectoryWatcherSupportingRecursive(_a) {
6476
6489
  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;
6477
6490
  var cache = new ts.Map();
@@ -6680,15 +6693,18 @@ var ts;
6680
6693
  return ts.stringContains(toCanonicalFilePath(path), searchPath);
6681
6694
  }
6682
6695
  }
6696
+ ts.createDirectoryWatcherSupportingRecursive = createDirectoryWatcherSupportingRecursive;
6683
6697
  /*@internal*/
6684
6698
  var FileSystemEntryKind;
6685
6699
  (function (FileSystemEntryKind) {
6686
6700
  FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File";
6687
6701
  FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory";
6688
6702
  })(FileSystemEntryKind = ts.FileSystemEntryKind || (ts.FileSystemEntryKind = {}));
6703
+ /*@internal*/
6689
6704
  function createFileWatcherCallback(callback) {
6690
6705
  return function (_fileName, eventKind, modifiedTime) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); };
6691
6706
  }
6707
+ ts.createFileWatcherCallback = createFileWatcherCallback;
6692
6708
  function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime) {
6693
6709
  return function (eventName, _relativeFileName, modifiedTime) {
6694
6710
  if (eventName === "rename") {
@@ -6722,10 +6738,7 @@ var ts;
6722
6738
  }
6723
6739
  /*@internal*/
6724
6740
  function createSystemWatchFunctions(_a) {
6725
- 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;
6726
- var pollingWatches = new ts.Map();
6727
- var fsWatches = new ts.Map();
6728
- var fsWatchesRecursive = new ts.Map();
6741
+ 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;
6729
6742
  var dynamicPollingWatchFile;
6730
6743
  var fixedChunkSizePollingWatchFile;
6731
6744
  var nonPollingWatchFile;
@@ -6789,7 +6802,7 @@ var ts;
6789
6802
  // Use notifications from FS to watch with falling back to fs.watchFile
6790
6803
  generateWatchFileOptions(ts.WatchFileKind.UseFsEventsOnParentDirectory, ts.PollingWatchKind.PriorityInterval, options) :
6791
6804
  // Default to do not use fixed polling interval
6792
- { watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.UseFsEvents };
6805
+ { watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.FixedPollingInterval };
6793
6806
  }
6794
6807
  }
6795
6808
  function generateWatchFileOptions(watchFile, fallbackPolling, options) {
@@ -6860,13 +6873,7 @@ var ts;
6860
6873
  };
6861
6874
  }
6862
6875
  }
6863
- function pollingWatchFile(fileName, callback, pollingInterval, options) {
6864
- return createSingleWatcherPerName(pollingWatches, useCaseSensitiveFileNames, fileName, callback, function (cb) { return pollingWatchFileWorker(fileName, cb, pollingInterval, options); });
6865
- }
6866
6876
  function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
6867
- return createSingleWatcherPerName(recursive ? fsWatchesRecursive : fsWatches, useCaseSensitiveFileNames, fileOrDirectory, callback, function (cb) { return fsWatchHandlingPresence(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions); });
6868
- }
6869
- function fsWatchHandlingPresence(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
6870
6877
  var lastDirectoryPartWithDirectorySeparator;
6871
6878
  var lastDirectoryPart;
6872
6879
  if (inodeWatching) {
@@ -7045,7 +7052,7 @@ var ts;
7045
7052
  var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
7046
7053
  var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
7047
7054
  var _b = createSystemWatchFunctions({
7048
- pollingWatchFileWorker: fsWatchFileWorker,
7055
+ pollingWatchFile: createSingleFileWatcherPerName(fsWatchFileWorker, useCaseSensitiveFileNames),
7049
7056
  getModifiedTime: getModifiedTime,
7050
7057
  setTimeout: setTimeout,
7051
7058
  clearTimeout: clearTimeout,
@@ -21384,7 +21391,7 @@ var ts;
21384
21391
  case 165 /* Decorator */: {
21385
21392
  var parent_2 = node.parent;
21386
21393
  return ts.canHaveDecorators(parent_2) ? parent_2.modifiers :
21387
- ts.canHaveIllegalDecorators(parent_2) ? parent_2.decorators :
21394
+ ts.canHaveIllegalDecorators(parent_2) ? parent_2.illegalDecorators :
21388
21395
  undefined;
21389
21396
  }
21390
21397
  case 291 /* HeritageClause */:
@@ -23461,7 +23468,7 @@ var ts;
23461
23468
  node.body = body;
23462
23469
  node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */;
23463
23470
  // The following properties are used only to report grammar errors
23464
- node.decorators = undefined;
23471
+ node.illegalDecorators = undefined;
23465
23472
  node.modifiers = undefined;
23466
23473
  return node;
23467
23474
  }
@@ -23473,7 +23480,7 @@ var ts;
23473
23480
  }
23474
23481
  function finishUpdateClassStaticBlockDeclaration(updated, original) {
23475
23482
  if (updated !== original) {
23476
- updated.decorators = original.decorators;
23483
+ updated.illegalDecorators = original.illegalDecorators;
23477
23484
  updated.modifiers = original.modifiers;
23478
23485
  }
23479
23486
  return update(updated, original);
@@ -23486,7 +23493,7 @@ var ts;
23486
23493
  /*type*/ undefined, body);
23487
23494
  node.transformFlags |= 1024 /* ContainsES2015 */;
23488
23495
  // The following properties are used only to report grammar errors
23489
- node.decorators = undefined;
23496
+ node.illegalDecorators = undefined;
23490
23497
  node.typeParameters = undefined;
23491
23498
  node.type = undefined;
23492
23499
  return node;
@@ -23501,7 +23508,7 @@ var ts;
23501
23508
  }
23502
23509
  function finishUpdateConstructorDeclaration(updated, original) {
23503
23510
  if (updated !== original) {
23504
- updated.decorators = original.decorators;
23511
+ updated.illegalDecorators = original.illegalDecorators;
23505
23512
  updated.typeParameters = original.typeParameters;
23506
23513
  updated.type = original.type;
23507
23514
  }
@@ -25249,7 +25256,7 @@ var ts;
25249
25256
  }
25250
25257
  }
25251
25258
  // The following properties are used only to report grammar errors
25252
- node.decorators = undefined;
25259
+ node.illegalDecorators = undefined;
25253
25260
  return node;
25254
25261
  }
25255
25262
  // @api
@@ -25267,7 +25274,7 @@ var ts;
25267
25274
  function finishUpdateFunctionDeclaration(updated, original) {
25268
25275
  if (updated !== original) {
25269
25276
  // copy children used only for error reporting
25270
- updated.decorators = original.decorators;
25277
+ updated.illegalDecorators = original.illegalDecorators;
25271
25278
  }
25272
25279
  return finishUpdateBaseSignatureDeclaration(updated, original);
25273
25280
  }
@@ -25301,7 +25308,7 @@ var ts;
25301
25308
  node.members = createNodeArray(members);
25302
25309
  node.transformFlags = 1 /* ContainsTypeScript */;
25303
25310
  // The following properties are used only to report grammar errors
25304
- node.decorators = undefined;
25311
+ node.illegalDecorators = undefined;
25305
25312
  return node;
25306
25313
  }
25307
25314
  // @api
@@ -25316,7 +25323,7 @@ var ts;
25316
25323
  }
25317
25324
  function finishUpdateInterfaceDeclaration(updated, original) {
25318
25325
  if (updated !== original) {
25319
- updated.decorators = original.decorators;
25326
+ updated.illegalDecorators = original.illegalDecorators;
25320
25327
  }
25321
25328
  return update(updated, original);
25322
25329
  }
@@ -25326,7 +25333,7 @@ var ts;
25326
25333
  node.type = type;
25327
25334
  node.transformFlags = 1 /* ContainsTypeScript */;
25328
25335
  // The following properties are used only to report grammar errors
25329
- node.decorators = undefined;
25336
+ node.illegalDecorators = undefined;
25330
25337
  return node;
25331
25338
  }
25332
25339
  // @api
@@ -25340,7 +25347,7 @@ var ts;
25340
25347
  }
25341
25348
  function finishUpdateTypeAliasDeclaration(updated, original) {
25342
25349
  if (updated !== original) {
25343
- updated.decorators = original.decorators;
25350
+ updated.illegalDecorators = original.illegalDecorators;
25344
25351
  }
25345
25352
  return update(updated, original);
25346
25353
  }
@@ -25353,7 +25360,7 @@ var ts;
25353
25360
  1 /* ContainsTypeScript */;
25354
25361
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // Enum declarations cannot contain `await`
25355
25362
  // The following properties are used only to report grammar errors
25356
- node.decorators = undefined;
25363
+ node.illegalDecorators = undefined;
25357
25364
  return node;
25358
25365
  }
25359
25366
  // @api
@@ -25366,7 +25373,7 @@ var ts;
25366
25373
  }
25367
25374
  function finishUpdateEnumDeclaration(updated, original) {
25368
25375
  if (updated !== original) {
25369
- updated.decorators = original.decorators;
25376
+ updated.illegalDecorators = original.illegalDecorators;
25370
25377
  }
25371
25378
  return update(updated, original);
25372
25379
  }
@@ -25390,7 +25397,7 @@ var ts;
25390
25397
  }
25391
25398
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // Module declarations cannot contain `await`.
25392
25399
  // The following properties are used only to report grammar errors
25393
- node.decorators = undefined;
25400
+ node.illegalDecorators = undefined;
25394
25401
  return node;
25395
25402
  }
25396
25403
  // @api
@@ -25403,7 +25410,7 @@ var ts;
25403
25410
  }
25404
25411
  function finishUpdateModuleDeclaration(updated, original) {
25405
25412
  if (updated !== original) {
25406
- updated.decorators = original.decorators;
25413
+ updated.illegalDecorators = original.illegalDecorators;
25407
25414
  }
25408
25415
  return update(updated, original);
25409
25416
  }
@@ -25439,7 +25446,7 @@ var ts;
25439
25446
  /*modifiers*/ undefined, name);
25440
25447
  node.transformFlags = 1 /* ContainsTypeScript */;
25441
25448
  // The following properties are used only to report grammar errors
25442
- node.decorators = undefined;
25449
+ node.illegalDecorators = undefined;
25443
25450
  node.modifiers = undefined;
25444
25451
  return node;
25445
25452
  }
@@ -25451,7 +25458,7 @@ var ts;
25451
25458
  }
25452
25459
  function finishUpdateNamespaceExportDeclaration(updated, original) {
25453
25460
  if (updated !== original) {
25454
- updated.decorators = original.decorators;
25461
+ updated.illegalDecorators = original.illegalDecorators;
25455
25462
  updated.modifiers = original.modifiers;
25456
25463
  }
25457
25464
  return update(updated, original);
@@ -25466,7 +25473,7 @@ var ts;
25466
25473
  node.transformFlags |= 1 /* ContainsTypeScript */;
25467
25474
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // Import= declaration is always parsed in an Await context
25468
25475
  // The following properties are used only to report grammar errors
25469
- node.decorators = undefined;
25476
+ node.illegalDecorators = undefined;
25470
25477
  return node;
25471
25478
  }
25472
25479
  // @api
@@ -25480,7 +25487,7 @@ var ts;
25480
25487
  }
25481
25488
  function finishUpdateImportEqualsDeclaration(updated, original) {
25482
25489
  if (updated !== original) {
25483
- updated.decorators = original.decorators;
25490
+ updated.illegalDecorators = original.illegalDecorators;
25484
25491
  }
25485
25492
  return update(updated, original);
25486
25493
  }
@@ -25496,7 +25503,7 @@ var ts;
25496
25503
  propagateChildFlags(node.moduleSpecifier);
25497
25504
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
25498
25505
  // The following properties are used only to report grammar errors
25499
- node.decorators = undefined;
25506
+ node.illegalDecorators = undefined;
25500
25507
  return node;
25501
25508
  }
25502
25509
  // @api
@@ -25510,7 +25517,7 @@ var ts;
25510
25517
  }
25511
25518
  function finishUpdateImportDeclaration(updated, original) {
25512
25519
  if (updated !== original) {
25513
- updated.decorators = original.decorators;
25520
+ updated.illegalDecorators = original.illegalDecorators;
25514
25521
  }
25515
25522
  return update(updated, original);
25516
25523
  }
@@ -25656,7 +25663,7 @@ var ts;
25656
25663
  node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression);
25657
25664
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
25658
25665
  // The following properties are used only to report grammar errors
25659
- node.decorators = undefined;
25666
+ node.illegalDecorators = undefined;
25660
25667
  return node;
25661
25668
  }
25662
25669
  // @api
@@ -25668,7 +25675,7 @@ var ts;
25668
25675
  }
25669
25676
  function finishUpdateExportAssignment(updated, original) {
25670
25677
  if (updated !== original) {
25671
- updated.decorators = original.decorators;
25678
+ updated.illegalDecorators = original.illegalDecorators;
25672
25679
  }
25673
25680
  return update(updated, original);
25674
25681
  }
@@ -25686,7 +25693,7 @@ var ts;
25686
25693
  propagateChildFlags(node.moduleSpecifier);
25687
25694
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context
25688
25695
  // The following properties are used only to report grammar errors
25689
- node.decorators = undefined;
25696
+ node.illegalDecorators = undefined;
25690
25697
  return node;
25691
25698
  }
25692
25699
  // @api
@@ -25701,7 +25708,7 @@ var ts;
25701
25708
  }
25702
25709
  function finishUpdateExportDeclaration(updated, original) {
25703
25710
  if (updated !== original) {
25704
- updated.decorators = original.decorators;
25711
+ updated.illegalDecorators = original.illegalDecorators;
25705
25712
  }
25706
25713
  return update(updated, original);
25707
25714
  }
@@ -26465,7 +26472,7 @@ var ts;
26465
26472
  propagateChildFlags(node.name) |
26466
26473
  propagateChildFlags(node.initializer);
26467
26474
  // The following properties are used only to report grammar errors
26468
- node.decorators = undefined;
26475
+ node.illegalDecorators = undefined;
26469
26476
  node.modifiers = undefined;
26470
26477
  node.questionToken = undefined;
26471
26478
  node.exclamationToken = undefined;
@@ -26481,7 +26488,7 @@ var ts;
26481
26488
  function finishUpdatePropertyAssignment(updated, original) {
26482
26489
  // copy children used only for error reporting
26483
26490
  if (updated !== original) {
26484
- updated.decorators = original.decorators;
26491
+ updated.illegalDecorators = original.illegalDecorators;
26485
26492
  updated.modifiers = original.modifiers;
26486
26493
  updated.questionToken = original.questionToken;
26487
26494
  updated.exclamationToken = original.exclamationToken;
@@ -26498,7 +26505,7 @@ var ts;
26498
26505
  1024 /* ContainsES2015 */;
26499
26506
  // The following properties are used only to report grammar errors
26500
26507
  node.equalsToken = undefined;
26501
- node.decorators = undefined;
26508
+ node.illegalDecorators = undefined;
26502
26509
  node.modifiers = undefined;
26503
26510
  node.questionToken = undefined;
26504
26511
  node.exclamationToken = undefined;
@@ -26515,7 +26522,7 @@ var ts;
26515
26522
  if (updated !== original) {
26516
26523
  // copy children used only for error reporting
26517
26524
  updated.equalsToken = original.equalsToken;
26518
- updated.decorators = original.decorators;
26525
+ updated.illegalDecorators = original.illegalDecorators;
26519
26526
  updated.modifiers = original.modifiers;
26520
26527
  updated.questionToken = original.questionToken;
26521
26528
  updated.exclamationToken = original.exclamationToken;
@@ -30994,7 +31001,7 @@ var ts;
30994
31001
  visitNode(cbNode, node.default) ||
30995
31002
  visitNode(cbNode, node.expression);
30996
31003
  case 297 /* ShorthandPropertyAssignment */:
30997
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31004
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
30998
31005
  visitNodes(cbNode, cbNodes, node.modifiers) ||
30999
31006
  visitNode(cbNode, node.name) ||
31000
31007
  visitNode(cbNode, node.questionToken) ||
@@ -31024,7 +31031,7 @@ var ts;
31024
31031
  visitNode(cbNode, node.type) ||
31025
31032
  visitNode(cbNode, node.initializer);
31026
31033
  case 296 /* PropertyAssignment */:
31027
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31034
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31028
31035
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31029
31036
  visitNode(cbNode, node.name) ||
31030
31037
  visitNode(cbNode, node.questionToken) ||
@@ -31041,7 +31048,7 @@ var ts;
31041
31048
  visitNode(cbNode, node.name) ||
31042
31049
  visitNode(cbNode, node.initializer);
31043
31050
  case 176 /* IndexSignature */:
31044
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31051
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31045
31052
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31046
31053
  visitNodes(cbNode, cbNodes, node.typeParameters) ||
31047
31054
  visitNodes(cbNode, cbNodes, node.parameters) ||
@@ -31079,7 +31086,7 @@ var ts;
31079
31086
  visitNodes(cbNode, cbNodes, node.parameters) ||
31080
31087
  visitNode(cbNode, node.type);
31081
31088
  case 171 /* Constructor */:
31082
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31089
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31083
31090
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31084
31091
  visitNode(cbNode, node.name) ||
31085
31092
  visitNodes(cbNode, cbNodes, node.typeParameters) ||
@@ -31101,7 +31108,7 @@ var ts;
31101
31108
  visitNode(cbNode, node.type) ||
31102
31109
  visitNode(cbNode, node.body);
31103
31110
  case 256 /* FunctionDeclaration */:
31104
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31111
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31105
31112
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31106
31113
  visitNode(cbNode, node.asteriskToken) ||
31107
31114
  visitNode(cbNode, node.name) ||
@@ -31125,7 +31132,7 @@ var ts;
31125
31132
  visitNode(cbNode, node.equalsGreaterThanToken) ||
31126
31133
  visitNode(cbNode, node.body);
31127
31134
  case 170 /* ClassStaticBlockDeclaration */:
31128
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31135
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31129
31136
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31130
31137
  visitNode(cbNode, node.body);
31131
31138
  case 178 /* TypeReference */:
@@ -31253,7 +31260,7 @@ var ts;
31253
31260
  return visitNodes(cbNode, cbNodes, node.statements) ||
31254
31261
  visitNode(cbNode, node.endOfFileToken);
31255
31262
  case 237 /* VariableStatement */:
31256
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31263
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31257
31264
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31258
31265
  visitNode(cbNode, node.declarationList);
31259
31266
  case 255 /* VariableDeclarationList */:
@@ -31324,20 +31331,20 @@ var ts;
31324
31331
  visitNodes(cbNode, cbNodes, node.heritageClauses) ||
31325
31332
  visitNodes(cbNode, cbNodes, node.members);
31326
31333
  case 258 /* InterfaceDeclaration */:
31327
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31334
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31328
31335
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31329
31336
  visitNode(cbNode, node.name) ||
31330
31337
  visitNodes(cbNode, cbNodes, node.typeParameters) ||
31331
31338
  visitNodes(cbNode, cbNodes, node.heritageClauses) ||
31332
31339
  visitNodes(cbNode, cbNodes, node.members);
31333
31340
  case 259 /* TypeAliasDeclaration */:
31334
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31341
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31335
31342
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31336
31343
  visitNode(cbNode, node.name) ||
31337
31344
  visitNodes(cbNode, cbNodes, node.typeParameters) ||
31338
31345
  visitNode(cbNode, node.type);
31339
31346
  case 260 /* EnumDeclaration */:
31340
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31347
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31341
31348
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31342
31349
  visitNode(cbNode, node.name) ||
31343
31350
  visitNodes(cbNode, cbNodes, node.members);
@@ -31345,17 +31352,17 @@ var ts;
31345
31352
  return visitNode(cbNode, node.name) ||
31346
31353
  visitNode(cbNode, node.initializer);
31347
31354
  case 261 /* ModuleDeclaration */:
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.name) ||
31351
31358
  visitNode(cbNode, node.body);
31352
31359
  case 265 /* ImportEqualsDeclaration */:
31353
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31360
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31354
31361
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31355
31362
  visitNode(cbNode, node.name) ||
31356
31363
  visitNode(cbNode, node.moduleReference);
31357
31364
  case 266 /* ImportDeclaration */:
31358
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31365
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31359
31366
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31360
31367
  visitNode(cbNode, node.importClause) ||
31361
31368
  visitNode(cbNode, node.moduleSpecifier) ||
@@ -31369,7 +31376,7 @@ var ts;
31369
31376
  return visitNode(cbNode, node.name) ||
31370
31377
  visitNode(cbNode, node.value);
31371
31378
  case 264 /* NamespaceExportDeclaration */:
31372
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31379
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31373
31380
  visitNode(cbNode, node.name);
31374
31381
  case 268 /* NamespaceImport */:
31375
31382
  return visitNode(cbNode, node.name);
@@ -31379,7 +31386,7 @@ var ts;
31379
31386
  case 273 /* NamedExports */:
31380
31387
  return visitNodes(cbNode, cbNodes, node.elements);
31381
31388
  case 272 /* ExportDeclaration */:
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.exportClause) ||
31385
31392
  visitNode(cbNode, node.moduleSpecifier) ||
@@ -31389,7 +31396,7 @@ var ts;
31389
31396
  return visitNode(cbNode, node.propertyName) ||
31390
31397
  visitNode(cbNode, node.name);
31391
31398
  case 271 /* ExportAssignment */:
31392
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31399
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31393
31400
  visitNodes(cbNode, cbNodes, node.modifiers) ||
31394
31401
  visitNode(cbNode, node.expression);
31395
31402
  case 223 /* TemplateExpression */:
@@ -31414,7 +31421,7 @@ var ts;
31414
31421
  case 277 /* ExternalModuleReference */:
31415
31422
  return visitNode(cbNode, node.expression);
31416
31423
  case 276 /* MissingDeclaration */:
31417
- return visitNodes(cbNode, cbNodes, node.decorators) ||
31424
+ return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
31418
31425
  visitNodes(cbNode, cbNodes, node.modifiers);
31419
31426
  case 351 /* CommaListExpression */:
31420
31427
  return visitNodes(cbNode, cbNodes, node.elements);
@@ -33965,7 +33972,7 @@ var ts;
33965
33972
  var type = parseTypeAnnotation();
33966
33973
  parseTypeMemberSemicolon();
33967
33974
  var node = factory.createIndexSignature(modifiers, parameters, type);
33968
- node.decorators = decorators;
33975
+ node.illegalDecorators = decorators;
33969
33976
  return withJSDoc(finishNode(node, pos), hasJSDoc);
33970
33977
  }
33971
33978
  function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
@@ -36125,7 +36132,7 @@ var ts;
36125
36132
  node = factory.createPropertyAssignment(name, initializer);
36126
36133
  }
36127
36134
  // Decorators, Modifiers, questionToken, and exclamationToken are not supported by property assignments and are reported in the grammar checker
36128
- node.decorators = decorators;
36135
+ node.illegalDecorators = decorators;
36129
36136
  node.modifiers = modifiers;
36130
36137
  node.questionToken = questionToken;
36131
36138
  node.exclamationToken = exclamationToken;
@@ -36773,7 +36780,7 @@ var ts;
36773
36780
  // would follow. For recovery and error reporting purposes, return an incomplete declaration.
36774
36781
  var missing = createMissingNode(276 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected);
36775
36782
  ts.setTextRangePos(missing, pos);
36776
- missing.decorators = decorators;
36783
+ missing.illegalDecorators = decorators;
36777
36784
  missing.modifiers = modifiers;
36778
36785
  return missing;
36779
36786
  }
@@ -36916,7 +36923,7 @@ var ts;
36916
36923
  parseSemicolon();
36917
36924
  var node = factory.createVariableStatement(modifiers, declarationList);
36918
36925
  // Decorators are not allowed on a variable statement, so we keep track of them to report them in the grammar checker.
36919
- node.decorators = decorators;
36926
+ node.illegalDecorators = decorators;
36920
36927
  return withJSDoc(finishNode(node, pos), hasJSDoc);
36921
36928
  }
36922
36929
  function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) {
@@ -36936,7 +36943,7 @@ var ts;
36936
36943
  var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, ts.Diagnostics.or_expected);
36937
36944
  setAwaitContext(savedAwaitContext);
36938
36945
  var node = factory.createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body);
36939
- node.decorators = decorators;
36946
+ node.illegalDecorators = decorators;
36940
36947
  return withJSDoc(finishNode(node, pos), hasJSDoc);
36941
36948
  }
36942
36949
  function parseConstructorName() {
@@ -36959,7 +36966,7 @@ var ts;
36959
36966
  var body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected);
36960
36967
  var node = factory.createConstructorDeclaration(modifiers, parameters, body);
36961
36968
  // Attach invalid nodes if they exist so that we can report them in the grammar checker.
36962
- node.decorators = decorators;
36969
+ node.illegalDecorators = decorators;
36963
36970
  node.typeParameters = typeParameters;
36964
36971
  node.type = type;
36965
36972
  return withJSDoc(finishNode(node, pos), hasJSDoc);
@@ -37075,7 +37082,7 @@ var ts;
37075
37082
  parseExpectedToken(124 /* StaticKeyword */);
37076
37083
  var body = parseClassStaticBlockBody();
37077
37084
  var node = withJSDoc(finishNode(factory.createClassStaticBlockDeclaration(body), pos), hasJSDoc);
37078
- node.decorators = decorators;
37085
+ node.illegalDecorators = decorators;
37079
37086
  node.modifiers = modifiers;
37080
37087
  return node;
37081
37088
  }
@@ -37316,7 +37323,7 @@ var ts;
37316
37323
  var heritageClauses = parseHeritageClauses();
37317
37324
  var members = parseObjectTypeMembers();
37318
37325
  var node = factory.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members);
37319
- node.decorators = decorators;
37326
+ node.illegalDecorators = decorators;
37320
37327
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37321
37328
  }
37322
37329
  function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) {
@@ -37327,7 +37334,7 @@ var ts;
37327
37334
  var type = token() === 138 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType();
37328
37335
  parseSemicolon();
37329
37336
  var node = factory.createTypeAliasDeclaration(modifiers, name, typeParameters, type);
37330
- node.decorators = decorators;
37337
+ node.illegalDecorators = decorators;
37331
37338
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37332
37339
  }
37333
37340
  // In an ambient declaration, the grammar only allows integer literals as initializers.
@@ -37353,7 +37360,7 @@ var ts;
37353
37360
  members = createMissingList();
37354
37361
  }
37355
37362
  var node = factory.createEnumDeclaration(modifiers, name, members);
37356
- node.decorators = decorators;
37363
+ node.illegalDecorators = decorators;
37357
37364
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37358
37365
  }
37359
37366
  function parseModuleBlock() {
@@ -37377,7 +37384,7 @@ var ts;
37377
37384
  ? parseModuleOrNamespaceDeclaration(getNodePos(), /*hasJSDoc*/ false, /*decorators*/ undefined, /*modifiers*/ undefined, 4 /* NestedNamespace */ | namespaceFlag)
37378
37385
  : parseModuleBlock();
37379
37386
  var node = factory.createModuleDeclaration(modifiers, name, body, flags);
37380
- node.decorators = decorators;
37387
+ node.illegalDecorators = decorators;
37381
37388
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37382
37389
  }
37383
37390
  function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {
@@ -37400,7 +37407,7 @@ var ts;
37400
37407
  parseSemicolon();
37401
37408
  }
37402
37409
  var node = factory.createModuleDeclaration(modifiers, name, body, flags);
37403
- node.decorators = decorators;
37410
+ node.illegalDecorators = decorators;
37404
37411
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37405
37412
  }
37406
37413
  function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {
@@ -37440,7 +37447,7 @@ var ts;
37440
37447
  parseSemicolon();
37441
37448
  var node = factory.createNamespaceExportDeclaration(name);
37442
37449
  // NamespaceExportDeclaration nodes cannot have decorators or modifiers, so we attach them here so we can report them in the grammar checker
37443
- node.decorators = decorators;
37450
+ node.illegalDecorators = decorators;
37444
37451
  node.modifiers = modifiers;
37445
37452
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37446
37453
  }
@@ -37480,7 +37487,7 @@ var ts;
37480
37487
  }
37481
37488
  parseSemicolon();
37482
37489
  var node = factory.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause);
37483
- node.decorators = decorators;
37490
+ node.illegalDecorators = decorators;
37484
37491
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37485
37492
  }
37486
37493
  function parseAssertEntry() {
@@ -37525,7 +37532,7 @@ var ts;
37525
37532
  var moduleReference = parseModuleReference();
37526
37533
  parseSemicolon();
37527
37534
  var node = factory.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference);
37528
- node.decorators = decorators;
37535
+ node.illegalDecorators = decorators;
37529
37536
  var finished = withJSDoc(finishNode(node, pos), hasJSDoc);
37530
37537
  return finished;
37531
37538
  }
@@ -37715,7 +37722,7 @@ var ts;
37715
37722
  parseSemicolon();
37716
37723
  setAwaitContext(savedAwaitContext);
37717
37724
  var node = factory.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause);
37718
- node.decorators = decorators;
37725
+ node.illegalDecorators = decorators;
37719
37726
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37720
37727
  }
37721
37728
  function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) {
@@ -37732,7 +37739,7 @@ var ts;
37732
37739
  parseSemicolon();
37733
37740
  setAwaitContext(savedAwaitContext);
37734
37741
  var node = factory.createExportAssignment(modifiers, isExportEquals, expression);
37735
- node.decorators = decorators;
37742
+ node.illegalDecorators = decorators;
37736
37743
  return withJSDoc(finishNode(node, pos), hasJSDoc);
37737
37744
  }
37738
37745
  var ParsingContext;
@@ -51030,41 +51037,61 @@ var ts;
51030
51037
  return typeof file.externalModuleIndicator !== "object" && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), /*sourceNode*/ undefined, dontResolveAlias);
51031
51038
  }
51032
51039
  function getTargetOfImportClause(node, dontResolveAlias) {
51033
- var _a;
51034
51040
  var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
51035
51041
  if (moduleSymbol) {
51036
- var exportDefaultSymbol = void 0;
51037
- if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
51038
- exportDefaultSymbol = moduleSymbol;
51039
- }
51040
- else {
51041
- exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias);
51042
- }
51043
- var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
51044
- var hasDefaultOnly = isOnlyImportedAsDefault(node.parent.moduleSpecifier);
51045
- var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, node.parent.moduleSpecifier);
51046
- if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
51047
- if (hasExportAssignmentSymbol(moduleSymbol)) {
51048
- var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
51049
- var exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */);
51050
- var exportAssignment = exportEqualsSymbol.valueDeclaration;
51051
- var err = error(node.name, ts.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName);
51052
- if (exportAssignment) {
51053
- 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));
51054
- }
51055
- }
51056
- else {
51057
- reportNonDefaultExport(moduleSymbol, node);
51042
+ return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
51043
+ }
51044
+ }
51045
+ function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) {
51046
+ var _a;
51047
+ var exportDefaultSymbol;
51048
+ if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
51049
+ exportDefaultSymbol = moduleSymbol;
51050
+ }
51051
+ else {
51052
+ exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias);
51053
+ }
51054
+ var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
51055
+ var specifier = getModuleSpecifierForImportOrExport(node);
51056
+ if (!specifier) {
51057
+ return exportDefaultSymbol;
51058
+ }
51059
+ var hasDefaultOnly = isOnlyImportedAsDefault(specifier);
51060
+ var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier);
51061
+ if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
51062
+ if (hasExportAssignmentSymbol(moduleSymbol)) {
51063
+ var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
51064
+ var exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */);
51065
+ var exportAssignment = exportEqualsSymbol.valueDeclaration;
51066
+ var err = error(node.name, ts.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName);
51067
+ if (exportAssignment) {
51068
+ ts.addRelatedInfo(err, ts.createDiagnosticForNode(exportAssignment, ts.Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, compilerOptionName));
51058
51069
  }
51059
51070
  }
51060
- else if (hasSyntheticDefault || hasDefaultOnly) {
51061
- // per emit behavior, a synthetic default overrides a "real" .default member if `__esModule` is not present
51062
- var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
51063
- markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, /*overwriteTypeOnly*/ false);
51064
- return resolved;
51071
+ else if (ts.isImportClause(node)) {
51072
+ reportNonDefaultExport(moduleSymbol, node);
51065
51073
  }
51066
- markSymbolOfAliasDeclarationIfTypeOnly(node, exportDefaultSymbol, /*finalTarget*/ undefined, /*overwriteTypeOnly*/ false);
51067
- return exportDefaultSymbol;
51074
+ else {
51075
+ errorNoModuleMemberSymbol(moduleSymbol, moduleSymbol, node, ts.isImportOrExportSpecifier(node) && node.propertyName || node.name);
51076
+ }
51077
+ }
51078
+ else if (hasSyntheticDefault || hasDefaultOnly) {
51079
+ // per emit behavior, a synthetic default overrides a "real" .default member if `__esModule` is not present
51080
+ var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
51081
+ markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, /*overwriteTypeOnly*/ false);
51082
+ return resolved;
51083
+ }
51084
+ markSymbolOfAliasDeclarationIfTypeOnly(node, exportDefaultSymbol, /*finalTarget*/ undefined, /*overwriteTypeOnly*/ false);
51085
+ return exportDefaultSymbol;
51086
+ }
51087
+ function getModuleSpecifierForImportOrExport(node) {
51088
+ switch (node.kind) {
51089
+ case 267 /* ImportClause */: return node.parent.moduleSpecifier;
51090
+ case 265 /* ImportEqualsDeclaration */: return ts.isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : undefined;
51091
+ case 268 /* NamespaceImport */: return node.parent.parent.moduleSpecifier;
51092
+ case 270 /* ImportSpecifier */: return node.parent.parent.parent.moduleSpecifier;
51093
+ case 275 /* ExportSpecifier */: return node.parent.parent.moduleSpecifier;
51094
+ default: return ts.Debug.assertNever(node);
51068
51095
  }
51069
51096
  }
51070
51097
  function reportNonDefaultExport(moduleSymbol, node) {
@@ -51154,7 +51181,7 @@ var ts;
51154
51181
  }
51155
51182
  }
51156
51183
  function getExternalModuleMember(node, specifier, dontResolveAlias) {
51157
- var _a, _b;
51184
+ var _a;
51158
51185
  if (dontResolveAlias === void 0) { dontResolveAlias = false; }
51159
51186
  var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier;
51160
51187
  var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); // TODO: GH#18217
@@ -51190,29 +51217,33 @@ var ts;
51190
51217
  combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) :
51191
51218
  symbolFromModule || symbolFromVariable;
51192
51219
  if (!symbol) {
51193
- var moduleName = getFullyQualifiedName(moduleSymbol, node);
51194
- var declarationName = ts.declarationNameToString(name);
51195
- var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
51196
- if (suggestion !== undefined) {
51197
- var suggestionName = symbolToString(suggestion);
51198
- var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
51199
- if (suggestion.valueDeclaration) {
51200
- ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
51201
- }
51202
- }
51203
- else {
51204
- if ((_b = moduleSymbol.exports) === null || _b === void 0 ? void 0 : _b.has("default" /* Default */)) {
51205
- error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);
51206
- }
51207
- else {
51208
- reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName);
51209
- }
51210
- }
51220
+ errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name);
51211
51221
  }
51212
51222
  return symbol;
51213
51223
  }
51214
51224
  }
51215
51225
  }
51226
+ function errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name) {
51227
+ var _a;
51228
+ var moduleName = getFullyQualifiedName(moduleSymbol, node);
51229
+ var declarationName = ts.declarationNameToString(name);
51230
+ var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
51231
+ if (suggestion !== undefined) {
51232
+ var suggestionName = symbolToString(suggestion);
51233
+ var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
51234
+ if (suggestion.valueDeclaration) {
51235
+ ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
51236
+ }
51237
+ }
51238
+ else {
51239
+ if ((_a = moduleSymbol.exports) === null || _a === void 0 ? void 0 : _a.has("default" /* Default */)) {
51240
+ error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);
51241
+ }
51242
+ else {
51243
+ reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName);
51244
+ }
51245
+ }
51246
+ }
51216
51247
  function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
51217
51248
  var _a, _b;
51218
51249
  var localSymbol = (_b = (_a = moduleSymbol.valueDeclaration) === null || _a === void 0 ? void 0 : _a.locals) === null || _b === void 0 ? void 0 : _b.get(name.escapedText);
@@ -51258,6 +51289,13 @@ var ts;
51258
51289
  }
51259
51290
  }
51260
51291
  function getTargetOfImportSpecifier(node, dontResolveAlias) {
51292
+ if (ts.isImportSpecifier(node) && ts.idText(node.propertyName || node.name) === "default" /* Default */) {
51293
+ var specifier = getModuleSpecifierForImportOrExport(node);
51294
+ var moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
51295
+ if (moduleSymbol) {
51296
+ return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
51297
+ }
51298
+ }
51261
51299
  var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent;
51262
51300
  var commonJSPropertyAccess = getCommonJSPropertyAccess(root);
51263
51301
  var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
@@ -51279,6 +51317,13 @@ var ts;
51279
51317
  return resolved;
51280
51318
  }
51281
51319
  function getTargetOfExportSpecifier(node, meaning, dontResolveAlias) {
51320
+ if (ts.idText(node.propertyName || node.name) === "default" /* Default */) {
51321
+ var specifier = getModuleSpecifierForImportOrExport(node);
51322
+ var moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
51323
+ if (moduleSymbol) {
51324
+ return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias);
51325
+ }
51326
+ }
51282
51327
  var resolved = node.parent.parent.moduleSpecifier ?
51283
51328
  getExternalModuleMember(node.parent.parent, node, dontResolveAlias) :
51284
51329
  resolveEntityName(node.propertyName || node.name, meaning, /*ignoreErrors*/ false, dontResolveAlias);
@@ -55727,7 +55772,7 @@ var ts;
55727
55772
  // This is an else/if as accessors and properties can't merge in TS, but might in JS
55728
55773
  // If this happens, we assume the accessor takes priority, as it imposes more constraints
55729
55774
  else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) {
55730
- 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),
55775
+ return ts.setTextRange(createProperty(ts.factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined, isPrivate ? undefined : serializeTypeForDeclaration(context, getWriteTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled),
55731
55776
  // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357
55732
55777
  // interface members can't have initializers, however class members _can_
55733
55778
  /*initializer*/ undefined), ((_d = p.declarations) === null || _d === void 0 ? void 0 : _d.find(ts.or(ts.isPropertyDeclaration, ts.isVariableDeclaration))) || firstPropertyLikeDecl);
@@ -56979,8 +57024,32 @@ var ts;
56979
57024
  // The type implied by a binding pattern is independent of context, so we check the initializer with no
56980
57025
  // contextual type or, if the element itself is a binding pattern, with the type implied by that binding
56981
57026
  // pattern.
56982
- var contextualType = ts.isBindingPattern(element.name) ? getTypeFromBindingPattern(element.name, /*includePatternInType*/ true, /*reportErrors*/ false) : unknownType;
56983
- return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0 /* Normal */, contextualType)));
57027
+ if (ts.isBindingPattern(element.name)) {
57028
+ var contextualType = getTypeFromBindingPattern(element.name, /*includePatternInType*/ true, /*reportErrors*/ false);
57029
+ return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0 /* Normal */, contextualType)));
57030
+ }
57031
+ // (#49989)
57032
+ // In cases where the intitializer is an identifier referencing a sibling symbol (i.e., one that is
57033
+ // defined in the same declaration) a false circular relationship will be concluded. For example, take
57034
+ // the declarations below:
57035
+ //
57036
+ // const [a, b = a] = [1];
57037
+ // const {a, b = a} = {a: 1};
57038
+ //
57039
+ // Here, when the `element` is the second binding element (i.e., `b = a`) the initializer is `a` which
57040
+ // itself is defined within the same binding pattern.
57041
+ //
57042
+ // So, we check the initializer expression for any references to sibling symbols and if any, then we'd
57043
+ // conclude the binding element type as `unknownType` and thus skip further circulations in type
57044
+ // checking.
57045
+ var siblings_1 = ts.mapDefined(element.parent.elements, function (x) { return x !== element && ts.isBindingElement(x) && ts.isIdentifier(x.name) ? x : undefined; });
57046
+ var checkIsSiblingInvolved = function (node) {
57047
+ var declaration = ts.isIdentifier(node) && getReferencedValueDeclaration(node);
57048
+ return declaration && ts.isBindingElement(declaration) && siblings_1.includes(declaration);
57049
+ };
57050
+ var isSiblingElementInvolded = checkIsSiblingInvolved(element.initializer) || ts.forEachChildRecursively(element.initializer, checkIsSiblingInvolved);
57051
+ return isSiblingElementInvolded ? anyType
57052
+ : addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0 /* Normal */, unknownType)));
56984
57053
  }
56985
57054
  if (ts.isBindingPattern(element.name)) {
56986
57055
  return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors);
@@ -68426,19 +68495,19 @@ var ts;
68426
68495
  }
68427
68496
  function getSiblingsOfContext(context) {
68428
68497
  if (!context.siblings) {
68429
- var siblings_1 = [];
68498
+ var siblings_2 = [];
68430
68499
  for (var _i = 0, _a = getSiblingsOfContext(context.parent); _i < _a.length; _i++) {
68431
68500
  var type = _a[_i];
68432
68501
  if (isObjectLiteralType(type)) {
68433
68502
  var prop = getPropertyOfObjectType(type, context.propertyName);
68434
68503
  if (prop) {
68435
68504
  forEachType(getTypeOfSymbol(prop), function (t) {
68436
- siblings_1.push(t);
68505
+ siblings_2.push(t);
68437
68506
  });
68438
68507
  }
68439
68508
  }
68440
68509
  }
68441
- context.siblings = siblings_1;
68510
+ context.siblings = siblings_2;
68442
68511
  }
68443
68512
  return context.siblings;
68444
68513
  }
@@ -88751,7 +88820,7 @@ var ts;
88751
88820
  return checkGrammarDecorators(node) || checkGrammarModifiers(node);
88752
88821
  }
88753
88822
  function checkGrammarDecorators(node) {
88754
- if (ts.canHaveIllegalDecorators(node) && ts.some(node.decorators)) {
88823
+ if (ts.canHaveIllegalDecorators(node) && ts.some(node.illegalDecorators)) {
88755
88824
  return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here);
88756
88825
  }
88757
88826
  if (!ts.canHaveDecorators(node) || !ts.hasDecorators(node)) {
@@ -171613,9 +171682,9 @@ var ts;
171613
171682
  // - error: 5.0
171614
171683
  var ts;
171615
171684
  (function (ts) {
171616
- var MUST_MERGE = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators have been combined with modifiers. Callers should switch to an overload without a 'decorators' parameter." };
171617
- 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 without a 'decorators' parameter." };
171618
- 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 without the 'decorators' or 'modifiers' parameters." };
171685
+ 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." };
171686
+ 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." };
171687
+ 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." };
171619
171688
  function patchNodeFactory(factory) {
171620
171689
  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;
171621
171690
  factory.createParameterDeclaration = ts.buildOverload("createParameterDeclaration")
@@ -171842,7 +171911,7 @@ var ts;
171842
171911
  return (decorators === undefined || !ts.some(decorators, ts.isModifier)) &&
171843
171912
  (modifiers === undefined || !ts.some(modifiers, ts.isParameter)) &&
171844
171913
  (parameters === undefined || ts.isArray(parameters)) &&
171845
- (body === undefined || !ts.isBlock(body));
171914
+ (body === undefined || ts.isBlock(body));
171846
171915
  },
171847
171916
  })
171848
171917
  .deprecate({
@@ -171871,7 +171940,7 @@ var ts;
171871
171940
  return (decorators === undefined || !ts.some(decorators, ts.isModifier)) &&
171872
171941
  (modifiers === undefined || !ts.some(modifiers, ts.isParameter)) &&
171873
171942
  (parameters === undefined || ts.isArray(parameters)) &&
171874
- (body === undefined || !ts.isBlock(body));
171943
+ (body === undefined || ts.isBlock(body));
171875
171944
  },
171876
171945
  })
171877
171946
  .deprecate({