@typescript-deploys/pr-build 4.5.0-pr-45991-2 → 4.5.0-pr-45974-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -4555,6 +4555,7 @@ var ts;
4555
4555
  }
4556
4556
  var activeSession;
4557
4557
  var profilePath = "./profile.cpuprofile";
4558
+ var hitSystemWatcherLimit = false;
4558
4559
  var Buffer = require("buffer").Buffer;
4559
4560
  var nodeVersion = getNodeMajorVersion();
4560
4561
  var isNode4OrLater = nodeVersion >= 4;
@@ -4837,6 +4838,10 @@ var ts;
4837
4838
  options = { persistent: true };
4838
4839
  }
4839
4840
  }
4841
+ if (hitSystemWatcherLimit) {
4842
+ ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
4843
+ return watchPresentFileSystemEntryWithFsWatchFile();
4844
+ }
4840
4845
  try {
4841
4846
  var presentWatcher = _fs.watch(fileOrDirectory, options, isLinuxOrMacOs ?
4842
4847
  callbackChangingToMissingFileSystemEntry :
@@ -4845,6 +4850,8 @@ var ts;
4845
4850
  return presentWatcher;
4846
4851
  }
4847
4852
  catch (e) {
4853
+ hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
4854
+ ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
4848
4855
  return watchPresentFileSystemEntryWithFsWatchFile();
4849
4856
  }
4850
4857
  }
@@ -4858,7 +4865,6 @@ var ts;
4858
4865
  callback(event, relativeName);
4859
4866
  }
4860
4867
  function watchPresentFileSystemEntryWithFsWatchFile() {
4861
- ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
4862
4868
  return watchFile(fileOrDirectory, createFileWatcherCallback(callback), fallbackPollingInterval, fallbackOptions);
4863
4869
  }
4864
4870
  function watchMissingFileSystemEntry() {
@@ -4961,7 +4967,7 @@ var ts;
4961
4967
  }
4962
4968
  }
4963
4969
  function readDirectory(path, extensions, excludes, includes, depth) {
4964
- return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
4970
+ return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath, directoryExists);
4965
4971
  }
4966
4972
  function fileSystemEntryExists(path, entryKind) {
4967
4973
  var originalStackTraceLimit = Error.stackTraceLimit;
@@ -15778,7 +15784,7 @@ var ts;
15778
15784
  return new RegExp(pattern, useCaseSensitiveFileNames ? "" : "i");
15779
15785
  }
15780
15786
  ts.getRegexFromPattern = getRegexFromPattern;
15781
- function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) {
15787
+ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath, directoryExists) {
15782
15788
  path = ts.normalizePath(path);
15783
15789
  currentDirectory = ts.normalizePath(currentDirectory);
15784
15790
  var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
@@ -15790,7 +15796,9 @@ var ts;
15790
15796
  var toCanonical = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
15791
15797
  for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
15792
15798
  var basePath = _a[_i];
15793
- visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
15799
+ if (directoryExists(basePath)) {
15800
+ visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
15801
+ }
15794
15802
  }
15795
15803
  return ts.flatten(results);
15796
15804
  function visitDirectory(path, absolutePath, depth) {
@@ -35214,7 +35222,7 @@ var ts;
35214
35222
  return ts.isDottedName(expr)
35215
35223
  || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
35216
35224
  || ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 && isNarrowableReference(expr.right)
35217
- || ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
35225
+ || ts.isElementAccessExpression(expr) && (ts.isStringOrNumericLiteralLike(expr.argumentExpression) || ts.isIdentifier(expr.argumentExpression)) && isNarrowableReference(expr.expression)
35218
35226
  || ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
35219
35227
  }
35220
35228
  function containsNarrowableReference(expr) {
@@ -55305,11 +55313,28 @@ var ts;
55305
55313
  return undefined;
55306
55314
  }
55307
55315
  function getAccessedPropertyName(access) {
55308
- var propertyName;
55309
- return access.kind === 205 ? access.name.escapedText :
55310
- access.kind === 206 && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
55311
- access.kind === 202 && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
55312
- undefined;
55316
+ if (ts.isPropertyAccessExpression(access)) {
55317
+ return access.name.escapedText;
55318
+ }
55319
+ if (ts.isElementAccessExpression(access)) {
55320
+ if (ts.isStringOrNumericLiteralLike(access.argumentExpression)) {
55321
+ return ts.escapeLeadingUnderscores(access.argumentExpression.text);
55322
+ }
55323
+ if (ts.isIdentifier(access.argumentExpression)) {
55324
+ var symbol = getResolvedSymbol(access.argumentExpression);
55325
+ var type = getSymbolLinks(symbol).type;
55326
+ if (type === undefined)
55327
+ return undefined;
55328
+ return type.flags & 8192 ? type.escapedName :
55329
+ type.flags & 384 ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
55330
+ }
55331
+ return undefined;
55332
+ }
55333
+ if (ts.isBindingElement(access)) {
55334
+ var name = getDestructuringPropertyName(access);
55335
+ return name ? ts.escapeLeadingUnderscores(name) : undefined;
55336
+ }
55337
+ return undefined;
55313
55338
  }
55314
55339
  function containsMatchingReference(source, target) {
55315
55340
  while (ts.isAccessExpression(source)) {
@@ -67729,7 +67754,7 @@ var ts;
67729
67754
  }
67730
67755
  if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
67731
67756
  var propName = member.name;
67732
- if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
67757
+ if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
67733
67758
  var type = getTypeOfSymbol(getSymbolOfNode(member));
67734
67759
  if (!(type.flags & 3 || getFalsyFlags(type) & 32768)) {
67735
67760
  if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
@@ -67763,7 +67788,9 @@ var ts;
67763
67788
  return false;
67764
67789
  }
67765
67790
  function isPropertyInitializedInConstructor(propName, propType, constructor) {
67766
- var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
67791
+ var reference = ts.isComputedPropertyName(propName)
67792
+ ? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
67793
+ : ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
67767
67794
  ts.setParent(reference.expression, reference);
67768
67795
  ts.setParent(reference, constructor);
67769
67796
  reference.flowNode = constructor.returnFlowNode;
@@ -91399,7 +91426,7 @@ var ts;
91399
91426
  var rootResult = tryReadDirectory(rootDir, rootDirPath);
91400
91427
  var rootSymLinkResult;
91401
91428
  if (rootResult !== undefined) {
91402
- return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath);
91429
+ return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath, directoryExists);
91403
91430
  }
91404
91431
  return host.readDirectory(rootDir, extensions, excludes, includes, depth);
91405
91432
  function getFileSystemEntries(dir) {
package/lib/tsserver.js CHANGED
@@ -7236,6 +7236,7 @@ var ts;
7236
7236
  }
7237
7237
  var activeSession;
7238
7238
  var profilePath = "./profile.cpuprofile";
7239
+ var hitSystemWatcherLimit = false;
7239
7240
  var Buffer = require("buffer").Buffer;
7240
7241
  var nodeVersion = getNodeMajorVersion();
7241
7242
  var isNode4OrLater = nodeVersion >= 4;
@@ -7564,6 +7565,10 @@ var ts;
7564
7565
  options = { persistent: true };
7565
7566
  }
7566
7567
  }
7568
+ if (hitSystemWatcherLimit) {
7569
+ ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
7570
+ return watchPresentFileSystemEntryWithFsWatchFile();
7571
+ }
7567
7572
  try {
7568
7573
  var presentWatcher = _fs.watch(fileOrDirectory, options, isLinuxOrMacOs ?
7569
7574
  callbackChangingToMissingFileSystemEntry :
@@ -7576,6 +7581,8 @@ var ts;
7576
7581
  // Catch the exception and use polling instead
7577
7582
  // Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
7578
7583
  // so instead of throwing error, use fs.watchFile
7584
+ hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
7585
+ ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
7579
7586
  return watchPresentFileSystemEntryWithFsWatchFile();
7580
7587
  }
7581
7588
  }
@@ -7595,7 +7602,6 @@ var ts;
7595
7602
  * Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
7596
7603
  */
7597
7604
  function watchPresentFileSystemEntryWithFsWatchFile() {
7598
- ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
7599
7605
  return watchFile(fileOrDirectory, createFileWatcherCallback(callback), fallbackPollingInterval, fallbackOptions);
7600
7606
  }
7601
7607
  /**
@@ -7714,7 +7720,7 @@ var ts;
7714
7720
  }
7715
7721
  }
7716
7722
  function readDirectory(path, extensions, excludes, includes, depth) {
7717
- return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
7723
+ return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath, directoryExists);
7718
7724
  }
7719
7725
  function fileSystemEntryExists(path, entryKind) {
7720
7726
  // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve
@@ -19909,7 +19915,7 @@ var ts;
19909
19915
  }
19910
19916
  ts.getRegexFromPattern = getRegexFromPattern;
19911
19917
  /** @param path directory of the tsconfig.json */
19912
- function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) {
19918
+ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath, directoryExists) {
19913
19919
  path = ts.normalizePath(path);
19914
19920
  currentDirectory = ts.normalizePath(currentDirectory);
19915
19921
  var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
@@ -19923,7 +19929,9 @@ var ts;
19923
19929
  var toCanonical = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
19924
19930
  for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
19925
19931
  var basePath = _a[_i];
19926
- visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
19932
+ if (directoryExists(basePath)) {
19933
+ visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
19934
+ }
19927
19935
  }
19928
19936
  return ts.flatten(results);
19929
19937
  function visitDirectory(path, absolutePath, depth) {
@@ -43155,7 +43163,7 @@ var ts;
43155
43163
  return ts.isDottedName(expr)
43156
43164
  || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
43157
43165
  || ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
43158
- || ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
43166
+ || ts.isElementAccessExpression(expr) && (ts.isStringOrNumericLiteralLike(expr.argumentExpression) || ts.isIdentifier(expr.argumentExpression)) && isNarrowableReference(expr.expression)
43159
43167
  || ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
43160
43168
  }
43161
43169
  function containsNarrowableReference(expr) {
@@ -66341,11 +66349,28 @@ var ts;
66341
66349
  return undefined;
66342
66350
  }
66343
66351
  function getAccessedPropertyName(access) {
66344
- var propertyName;
66345
- return access.kind === 205 /* PropertyAccessExpression */ ? access.name.escapedText :
66346
- access.kind === 206 /* ElementAccessExpression */ && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
66347
- access.kind === 202 /* BindingElement */ && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
66348
- undefined;
66352
+ if (ts.isPropertyAccessExpression(access)) {
66353
+ return access.name.escapedText;
66354
+ }
66355
+ if (ts.isElementAccessExpression(access)) {
66356
+ if (ts.isStringOrNumericLiteralLike(access.argumentExpression)) {
66357
+ return ts.escapeLeadingUnderscores(access.argumentExpression.text);
66358
+ }
66359
+ if (ts.isIdentifier(access.argumentExpression)) {
66360
+ var symbol = getResolvedSymbol(access.argumentExpression);
66361
+ var type = getSymbolLinks(symbol).type;
66362
+ if (type === undefined)
66363
+ return undefined;
66364
+ return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName :
66365
+ type.flags & 384 /* StringOrNumberLiteral */ ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
66366
+ }
66367
+ return undefined;
66368
+ }
66369
+ if (ts.isBindingElement(access)) {
66370
+ var name = getDestructuringPropertyName(access);
66371
+ return name ? ts.escapeLeadingUnderscores(name) : undefined;
66372
+ }
66373
+ return undefined;
66349
66374
  }
66350
66375
  function containsMatchingReference(source, target) {
66351
66376
  while (ts.isAccessExpression(source)) {
@@ -80925,7 +80950,7 @@ var ts;
80925
80950
  }
80926
80951
  if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
80927
80952
  var propName = member.name;
80928
- if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
80953
+ if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
80929
80954
  var type = getTypeOfSymbol(getSymbolOfNode(member));
80930
80955
  if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
80931
80956
  if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
@@ -80960,7 +80985,9 @@ var ts;
80960
80985
  return false;
80961
80986
  }
80962
80987
  function isPropertyInitializedInConstructor(propName, propType, constructor) {
80963
- var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
80988
+ var reference = ts.isComputedPropertyName(propName)
80989
+ ? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
80990
+ : ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
80964
80991
  ts.setParent(reference.expression, reference);
80965
80992
  ts.setParent(reference, constructor);
80966
80993
  reference.flowNode = constructor.returnFlowNode;
@@ -111024,7 +111051,7 @@ var ts;
111024
111051
  var rootResult = tryReadDirectory(rootDir, rootDirPath);
111025
111052
  var rootSymLinkResult;
111026
111053
  if (rootResult !== undefined) {
111027
- return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath);
111054
+ return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath, directoryExists);
111028
111055
  }
111029
111056
  return host.readDirectory(rootDir, extensions, excludes, includes, depth);
111030
111057
  function getFileSystemEntries(dir) {
@@ -7430,6 +7430,7 @@ var ts;
7430
7430
  }
7431
7431
  var activeSession;
7432
7432
  var profilePath = "./profile.cpuprofile";
7433
+ var hitSystemWatcherLimit = false;
7433
7434
  var Buffer = require("buffer").Buffer;
7434
7435
  var nodeVersion = getNodeMajorVersion();
7435
7436
  var isNode4OrLater = nodeVersion >= 4;
@@ -7758,6 +7759,10 @@ var ts;
7758
7759
  options = { persistent: true };
7759
7760
  }
7760
7761
  }
7762
+ if (hitSystemWatcherLimit) {
7763
+ ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
7764
+ return watchPresentFileSystemEntryWithFsWatchFile();
7765
+ }
7761
7766
  try {
7762
7767
  var presentWatcher = _fs.watch(fileOrDirectory, options, isLinuxOrMacOs ?
7763
7768
  callbackChangingToMissingFileSystemEntry :
@@ -7770,6 +7775,8 @@ var ts;
7770
7775
  // Catch the exception and use polling instead
7771
7776
  // Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
7772
7777
  // so instead of throwing error, use fs.watchFile
7778
+ hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
7779
+ ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
7773
7780
  return watchPresentFileSystemEntryWithFsWatchFile();
7774
7781
  }
7775
7782
  }
@@ -7789,7 +7796,6 @@ var ts;
7789
7796
  * Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
7790
7797
  */
7791
7798
  function watchPresentFileSystemEntryWithFsWatchFile() {
7792
- ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
7793
7799
  return watchFile(fileOrDirectory, createFileWatcherCallback(callback), fallbackPollingInterval, fallbackOptions);
7794
7800
  }
7795
7801
  /**
@@ -7908,7 +7914,7 @@ var ts;
7908
7914
  }
7909
7915
  }
7910
7916
  function readDirectory(path, extensions, excludes, includes, depth) {
7911
- return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
7917
+ return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath, directoryExists);
7912
7918
  }
7913
7919
  function fileSystemEntryExists(path, entryKind) {
7914
7920
  // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve
@@ -20103,7 +20109,7 @@ var ts;
20103
20109
  }
20104
20110
  ts.getRegexFromPattern = getRegexFromPattern;
20105
20111
  /** @param path directory of the tsconfig.json */
20106
- function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) {
20112
+ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath, directoryExists) {
20107
20113
  path = ts.normalizePath(path);
20108
20114
  currentDirectory = ts.normalizePath(currentDirectory);
20109
20115
  var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
@@ -20117,7 +20123,9 @@ var ts;
20117
20123
  var toCanonical = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
20118
20124
  for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
20119
20125
  var basePath = _a[_i];
20120
- visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
20126
+ if (directoryExists(basePath)) {
20127
+ visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
20128
+ }
20121
20129
  }
20122
20130
  return ts.flatten(results);
20123
20131
  function visitDirectory(path, absolutePath, depth) {
@@ -43349,7 +43357,7 @@ var ts;
43349
43357
  return ts.isDottedName(expr)
43350
43358
  || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
43351
43359
  || ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
43352
- || ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
43360
+ || ts.isElementAccessExpression(expr) && (ts.isStringOrNumericLiteralLike(expr.argumentExpression) || ts.isIdentifier(expr.argumentExpression)) && isNarrowableReference(expr.expression)
43353
43361
  || ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
43354
43362
  }
43355
43363
  function containsNarrowableReference(expr) {
@@ -66535,11 +66543,28 @@ var ts;
66535
66543
  return undefined;
66536
66544
  }
66537
66545
  function getAccessedPropertyName(access) {
66538
- var propertyName;
66539
- return access.kind === 205 /* PropertyAccessExpression */ ? access.name.escapedText :
66540
- access.kind === 206 /* ElementAccessExpression */ && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
66541
- access.kind === 202 /* BindingElement */ && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
66542
- undefined;
66546
+ if (ts.isPropertyAccessExpression(access)) {
66547
+ return access.name.escapedText;
66548
+ }
66549
+ if (ts.isElementAccessExpression(access)) {
66550
+ if (ts.isStringOrNumericLiteralLike(access.argumentExpression)) {
66551
+ return ts.escapeLeadingUnderscores(access.argumentExpression.text);
66552
+ }
66553
+ if (ts.isIdentifier(access.argumentExpression)) {
66554
+ var symbol = getResolvedSymbol(access.argumentExpression);
66555
+ var type = getSymbolLinks(symbol).type;
66556
+ if (type === undefined)
66557
+ return undefined;
66558
+ return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName :
66559
+ type.flags & 384 /* StringOrNumberLiteral */ ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
66560
+ }
66561
+ return undefined;
66562
+ }
66563
+ if (ts.isBindingElement(access)) {
66564
+ var name = getDestructuringPropertyName(access);
66565
+ return name ? ts.escapeLeadingUnderscores(name) : undefined;
66566
+ }
66567
+ return undefined;
66543
66568
  }
66544
66569
  function containsMatchingReference(source, target) {
66545
66570
  while (ts.isAccessExpression(source)) {
@@ -81119,7 +81144,7 @@ var ts;
81119
81144
  }
81120
81145
  if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
81121
81146
  var propName = member.name;
81122
- if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
81147
+ if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
81123
81148
  var type = getTypeOfSymbol(getSymbolOfNode(member));
81124
81149
  if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
81125
81150
  if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
@@ -81154,7 +81179,9 @@ var ts;
81154
81179
  return false;
81155
81180
  }
81156
81181
  function isPropertyInitializedInConstructor(propName, propType, constructor) {
81157
- var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
81182
+ var reference = ts.isComputedPropertyName(propName)
81183
+ ? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
81184
+ : ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
81158
81185
  ts.setParent(reference.expression, reference);
81159
81186
  ts.setParent(reference, constructor);
81160
81187
  reference.flowNode = constructor.returnFlowNode;
@@ -111218,7 +111245,7 @@ var ts;
111218
111245
  var rootResult = tryReadDirectory(rootDir, rootDirPath);
111219
111246
  var rootSymLinkResult;
111220
111247
  if (rootResult !== undefined) {
111221
- return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath);
111248
+ return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath, directoryExists);
111222
111249
  }
111223
111250
  return host.readDirectory(rootDir, extensions, excludes, includes, depth);
111224
111251
  function getFileSystemEntries(dir) {
package/lib/typescript.js CHANGED
@@ -7430,6 +7430,7 @@ var ts;
7430
7430
  }
7431
7431
  var activeSession;
7432
7432
  var profilePath = "./profile.cpuprofile";
7433
+ var hitSystemWatcherLimit = false;
7433
7434
  var Buffer = require("buffer").Buffer;
7434
7435
  var nodeVersion = getNodeMajorVersion();
7435
7436
  var isNode4OrLater = nodeVersion >= 4;
@@ -7758,6 +7759,10 @@ var ts;
7758
7759
  options = { persistent: true };
7759
7760
  }
7760
7761
  }
7762
+ if (hitSystemWatcherLimit) {
7763
+ ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
7764
+ return watchPresentFileSystemEntryWithFsWatchFile();
7765
+ }
7761
7766
  try {
7762
7767
  var presentWatcher = _fs.watch(fileOrDirectory, options, isLinuxOrMacOs ?
7763
7768
  callbackChangingToMissingFileSystemEntry :
@@ -7770,6 +7775,8 @@ var ts;
7770
7775
  // Catch the exception and use polling instead
7771
7776
  // Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
7772
7777
  // so instead of throwing error, use fs.watchFile
7778
+ hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
7779
+ ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
7773
7780
  return watchPresentFileSystemEntryWithFsWatchFile();
7774
7781
  }
7775
7782
  }
@@ -7789,7 +7796,6 @@ var ts;
7789
7796
  * Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
7790
7797
  */
7791
7798
  function watchPresentFileSystemEntryWithFsWatchFile() {
7792
- ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
7793
7799
  return watchFile(fileOrDirectory, createFileWatcherCallback(callback), fallbackPollingInterval, fallbackOptions);
7794
7800
  }
7795
7801
  /**
@@ -7908,7 +7914,7 @@ var ts;
7908
7914
  }
7909
7915
  }
7910
7916
  function readDirectory(path, extensions, excludes, includes, depth) {
7911
- return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
7917
+ return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath, directoryExists);
7912
7918
  }
7913
7919
  function fileSystemEntryExists(path, entryKind) {
7914
7920
  // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve
@@ -20103,7 +20109,7 @@ var ts;
20103
20109
  }
20104
20110
  ts.getRegexFromPattern = getRegexFromPattern;
20105
20111
  /** @param path directory of the tsconfig.json */
20106
- function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) {
20112
+ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath, directoryExists) {
20107
20113
  path = ts.normalizePath(path);
20108
20114
  currentDirectory = ts.normalizePath(currentDirectory);
20109
20115
  var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
@@ -20117,7 +20123,9 @@ var ts;
20117
20123
  var toCanonical = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
20118
20124
  for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
20119
20125
  var basePath = _a[_i];
20120
- visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
20126
+ if (directoryExists(basePath)) {
20127
+ visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
20128
+ }
20121
20129
  }
20122
20130
  return ts.flatten(results);
20123
20131
  function visitDirectory(path, absolutePath, depth) {
@@ -43349,7 +43357,7 @@ var ts;
43349
43357
  return ts.isDottedName(expr)
43350
43358
  || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
43351
43359
  || ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
43352
- || ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
43360
+ || ts.isElementAccessExpression(expr) && (ts.isStringOrNumericLiteralLike(expr.argumentExpression) || ts.isIdentifier(expr.argumentExpression)) && isNarrowableReference(expr.expression)
43353
43361
  || ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
43354
43362
  }
43355
43363
  function containsNarrowableReference(expr) {
@@ -66535,11 +66543,28 @@ var ts;
66535
66543
  return undefined;
66536
66544
  }
66537
66545
  function getAccessedPropertyName(access) {
66538
- var propertyName;
66539
- return access.kind === 205 /* PropertyAccessExpression */ ? access.name.escapedText :
66540
- access.kind === 206 /* ElementAccessExpression */ && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
66541
- access.kind === 202 /* BindingElement */ && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
66542
- undefined;
66546
+ if (ts.isPropertyAccessExpression(access)) {
66547
+ return access.name.escapedText;
66548
+ }
66549
+ if (ts.isElementAccessExpression(access)) {
66550
+ if (ts.isStringOrNumericLiteralLike(access.argumentExpression)) {
66551
+ return ts.escapeLeadingUnderscores(access.argumentExpression.text);
66552
+ }
66553
+ if (ts.isIdentifier(access.argumentExpression)) {
66554
+ var symbol = getResolvedSymbol(access.argumentExpression);
66555
+ var type = getSymbolLinks(symbol).type;
66556
+ if (type === undefined)
66557
+ return undefined;
66558
+ return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName :
66559
+ type.flags & 384 /* StringOrNumberLiteral */ ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
66560
+ }
66561
+ return undefined;
66562
+ }
66563
+ if (ts.isBindingElement(access)) {
66564
+ var name = getDestructuringPropertyName(access);
66565
+ return name ? ts.escapeLeadingUnderscores(name) : undefined;
66566
+ }
66567
+ return undefined;
66543
66568
  }
66544
66569
  function containsMatchingReference(source, target) {
66545
66570
  while (ts.isAccessExpression(source)) {
@@ -81119,7 +81144,7 @@ var ts;
81119
81144
  }
81120
81145
  if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
81121
81146
  var propName = member.name;
81122
- if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
81147
+ if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
81123
81148
  var type = getTypeOfSymbol(getSymbolOfNode(member));
81124
81149
  if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
81125
81150
  if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
@@ -81154,7 +81179,9 @@ var ts;
81154
81179
  return false;
81155
81180
  }
81156
81181
  function isPropertyInitializedInConstructor(propName, propType, constructor) {
81157
- var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
81182
+ var reference = ts.isComputedPropertyName(propName)
81183
+ ? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
81184
+ : ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
81158
81185
  ts.setParent(reference.expression, reference);
81159
81186
  ts.setParent(reference, constructor);
81160
81187
  reference.flowNode = constructor.returnFlowNode;
@@ -111218,7 +111245,7 @@ var ts;
111218
111245
  var rootResult = tryReadDirectory(rootDir, rootDirPath);
111219
111246
  var rootSymLinkResult;
111220
111247
  if (rootResult !== undefined) {
111221
- return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath);
111248
+ return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath, directoryExists);
111222
111249
  }
111223
111250
  return host.readDirectory(rootDir, extensions, excludes, includes, depth);
111224
111251
  function getFileSystemEntries(dir) {
@@ -7430,6 +7430,7 @@ var ts;
7430
7430
  }
7431
7431
  var activeSession;
7432
7432
  var profilePath = "./profile.cpuprofile";
7433
+ var hitSystemWatcherLimit = false;
7433
7434
  var Buffer = require("buffer").Buffer;
7434
7435
  var nodeVersion = getNodeMajorVersion();
7435
7436
  var isNode4OrLater = nodeVersion >= 4;
@@ -7758,6 +7759,10 @@ var ts;
7758
7759
  options = { persistent: true };
7759
7760
  }
7760
7761
  }
7762
+ if (hitSystemWatcherLimit) {
7763
+ ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
7764
+ return watchPresentFileSystemEntryWithFsWatchFile();
7765
+ }
7761
7766
  try {
7762
7767
  var presentWatcher = _fs.watch(fileOrDirectory, options, isLinuxOrMacOs ?
7763
7768
  callbackChangingToMissingFileSystemEntry :
@@ -7770,6 +7775,8 @@ var ts;
7770
7775
  // Catch the exception and use polling instead
7771
7776
  // Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
7772
7777
  // so instead of throwing error, use fs.watchFile
7778
+ hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
7779
+ ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
7773
7780
  return watchPresentFileSystemEntryWithFsWatchFile();
7774
7781
  }
7775
7782
  }
@@ -7789,7 +7796,6 @@ var ts;
7789
7796
  * Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
7790
7797
  */
7791
7798
  function watchPresentFileSystemEntryWithFsWatchFile() {
7792
- ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
7793
7799
  return watchFile(fileOrDirectory, createFileWatcherCallback(callback), fallbackPollingInterval, fallbackOptions);
7794
7800
  }
7795
7801
  /**
@@ -7908,7 +7914,7 @@ var ts;
7908
7914
  }
7909
7915
  }
7910
7916
  function readDirectory(path, extensions, excludes, includes, depth) {
7911
- return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
7917
+ return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath, directoryExists);
7912
7918
  }
7913
7919
  function fileSystemEntryExists(path, entryKind) {
7914
7920
  // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve
@@ -20103,7 +20109,7 @@ var ts;
20103
20109
  }
20104
20110
  ts.getRegexFromPattern = getRegexFromPattern;
20105
20111
  /** @param path directory of the tsconfig.json */
20106
- function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) {
20112
+ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath, directoryExists) {
20107
20113
  path = ts.normalizePath(path);
20108
20114
  currentDirectory = ts.normalizePath(currentDirectory);
20109
20115
  var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
@@ -20117,7 +20123,9 @@ var ts;
20117
20123
  var toCanonical = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
20118
20124
  for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
20119
20125
  var basePath = _a[_i];
20120
- visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
20126
+ if (directoryExists(basePath)) {
20127
+ visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
20128
+ }
20121
20129
  }
20122
20130
  return ts.flatten(results);
20123
20131
  function visitDirectory(path, absolutePath, depth) {
@@ -43349,7 +43357,7 @@ var ts;
43349
43357
  return ts.isDottedName(expr)
43350
43358
  || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
43351
43359
  || ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
43352
- || ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
43360
+ || ts.isElementAccessExpression(expr) && (ts.isStringOrNumericLiteralLike(expr.argumentExpression) || ts.isIdentifier(expr.argumentExpression)) && isNarrowableReference(expr.expression)
43353
43361
  || ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
43354
43362
  }
43355
43363
  function containsNarrowableReference(expr) {
@@ -66535,11 +66543,28 @@ var ts;
66535
66543
  return undefined;
66536
66544
  }
66537
66545
  function getAccessedPropertyName(access) {
66538
- var propertyName;
66539
- return access.kind === 205 /* PropertyAccessExpression */ ? access.name.escapedText :
66540
- access.kind === 206 /* ElementAccessExpression */ && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
66541
- access.kind === 202 /* BindingElement */ && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
66542
- undefined;
66546
+ if (ts.isPropertyAccessExpression(access)) {
66547
+ return access.name.escapedText;
66548
+ }
66549
+ if (ts.isElementAccessExpression(access)) {
66550
+ if (ts.isStringOrNumericLiteralLike(access.argumentExpression)) {
66551
+ return ts.escapeLeadingUnderscores(access.argumentExpression.text);
66552
+ }
66553
+ if (ts.isIdentifier(access.argumentExpression)) {
66554
+ var symbol = getResolvedSymbol(access.argumentExpression);
66555
+ var type = getSymbolLinks(symbol).type;
66556
+ if (type === undefined)
66557
+ return undefined;
66558
+ return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName :
66559
+ type.flags & 384 /* StringOrNumberLiteral */ ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
66560
+ }
66561
+ return undefined;
66562
+ }
66563
+ if (ts.isBindingElement(access)) {
66564
+ var name = getDestructuringPropertyName(access);
66565
+ return name ? ts.escapeLeadingUnderscores(name) : undefined;
66566
+ }
66567
+ return undefined;
66543
66568
  }
66544
66569
  function containsMatchingReference(source, target) {
66545
66570
  while (ts.isAccessExpression(source)) {
@@ -81119,7 +81144,7 @@ var ts;
81119
81144
  }
81120
81145
  if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
81121
81146
  var propName = member.name;
81122
- if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
81147
+ if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
81123
81148
  var type = getTypeOfSymbol(getSymbolOfNode(member));
81124
81149
  if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
81125
81150
  if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
@@ -81154,7 +81179,9 @@ var ts;
81154
81179
  return false;
81155
81180
  }
81156
81181
  function isPropertyInitializedInConstructor(propName, propType, constructor) {
81157
- var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
81182
+ var reference = ts.isComputedPropertyName(propName)
81183
+ ? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
81184
+ : ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
81158
81185
  ts.setParent(reference.expression, reference);
81159
81186
  ts.setParent(reference, constructor);
81160
81187
  reference.flowNode = constructor.returnFlowNode;
@@ -111218,7 +111245,7 @@ var ts;
111218
111245
  var rootResult = tryReadDirectory(rootDir, rootDirPath);
111219
111246
  var rootSymLinkResult;
111220
111247
  if (rootResult !== undefined) {
111221
- return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath);
111248
+ return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath, directoryExists);
111222
111249
  }
111223
111250
  return host.readDirectory(rootDir, extensions, excludes, includes, depth);
111224
111251
  function getFileSystemEntries(dir) {
@@ -7225,6 +7225,7 @@ var ts;
7225
7225
  }
7226
7226
  var activeSession;
7227
7227
  var profilePath = "./profile.cpuprofile";
7228
+ var hitSystemWatcherLimit = false;
7228
7229
  var Buffer = require("buffer").Buffer;
7229
7230
  var nodeVersion = getNodeMajorVersion();
7230
7231
  var isNode4OrLater = nodeVersion >= 4;
@@ -7553,6 +7554,10 @@ var ts;
7553
7554
  options = { persistent: true };
7554
7555
  }
7555
7556
  }
7557
+ if (hitSystemWatcherLimit) {
7558
+ ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
7559
+ return watchPresentFileSystemEntryWithFsWatchFile();
7560
+ }
7556
7561
  try {
7557
7562
  var presentWatcher = _fs.watch(fileOrDirectory, options, isLinuxOrMacOs ?
7558
7563
  callbackChangingToMissingFileSystemEntry :
@@ -7565,6 +7570,8 @@ var ts;
7565
7570
  // Catch the exception and use polling instead
7566
7571
  // Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
7567
7572
  // so instead of throwing error, use fs.watchFile
7573
+ hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
7574
+ ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
7568
7575
  return watchPresentFileSystemEntryWithFsWatchFile();
7569
7576
  }
7570
7577
  }
@@ -7584,7 +7591,6 @@ var ts;
7584
7591
  * Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
7585
7592
  */
7586
7593
  function watchPresentFileSystemEntryWithFsWatchFile() {
7587
- ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
7588
7594
  return watchFile(fileOrDirectory, createFileWatcherCallback(callback), fallbackPollingInterval, fallbackOptions);
7589
7595
  }
7590
7596
  /**
@@ -7703,7 +7709,7 @@ var ts;
7703
7709
  }
7704
7710
  }
7705
7711
  function readDirectory(path, extensions, excludes, includes, depth) {
7706
- return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
7712
+ return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath, directoryExists);
7707
7713
  }
7708
7714
  function fileSystemEntryExists(path, entryKind) {
7709
7715
  // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve
@@ -19898,7 +19904,7 @@ var ts;
19898
19904
  }
19899
19905
  ts.getRegexFromPattern = getRegexFromPattern;
19900
19906
  /** @param path directory of the tsconfig.json */
19901
- function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) {
19907
+ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath, directoryExists) {
19902
19908
  path = ts.normalizePath(path);
19903
19909
  currentDirectory = ts.normalizePath(currentDirectory);
19904
19910
  var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
@@ -19912,7 +19918,9 @@ var ts;
19912
19918
  var toCanonical = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
19913
19919
  for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
19914
19920
  var basePath = _a[_i];
19915
- visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
19921
+ if (directoryExists(basePath)) {
19922
+ visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
19923
+ }
19916
19924
  }
19917
19925
  return ts.flatten(results);
19918
19926
  function visitDirectory(path, absolutePath, depth) {
@@ -43144,7 +43152,7 @@ var ts;
43144
43152
  return ts.isDottedName(expr)
43145
43153
  || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
43146
43154
  || ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
43147
- || ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
43155
+ || ts.isElementAccessExpression(expr) && (ts.isStringOrNumericLiteralLike(expr.argumentExpression) || ts.isIdentifier(expr.argumentExpression)) && isNarrowableReference(expr.expression)
43148
43156
  || ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
43149
43157
  }
43150
43158
  function containsNarrowableReference(expr) {
@@ -66330,11 +66338,28 @@ var ts;
66330
66338
  return undefined;
66331
66339
  }
66332
66340
  function getAccessedPropertyName(access) {
66333
- var propertyName;
66334
- return access.kind === 205 /* PropertyAccessExpression */ ? access.name.escapedText :
66335
- access.kind === 206 /* ElementAccessExpression */ && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
66336
- access.kind === 202 /* BindingElement */ && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
66337
- undefined;
66341
+ if (ts.isPropertyAccessExpression(access)) {
66342
+ return access.name.escapedText;
66343
+ }
66344
+ if (ts.isElementAccessExpression(access)) {
66345
+ if (ts.isStringOrNumericLiteralLike(access.argumentExpression)) {
66346
+ return ts.escapeLeadingUnderscores(access.argumentExpression.text);
66347
+ }
66348
+ if (ts.isIdentifier(access.argumentExpression)) {
66349
+ var symbol = getResolvedSymbol(access.argumentExpression);
66350
+ var type = getSymbolLinks(symbol).type;
66351
+ if (type === undefined)
66352
+ return undefined;
66353
+ return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName :
66354
+ type.flags & 384 /* StringOrNumberLiteral */ ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
66355
+ }
66356
+ return undefined;
66357
+ }
66358
+ if (ts.isBindingElement(access)) {
66359
+ var name = getDestructuringPropertyName(access);
66360
+ return name ? ts.escapeLeadingUnderscores(name) : undefined;
66361
+ }
66362
+ return undefined;
66338
66363
  }
66339
66364
  function containsMatchingReference(source, target) {
66340
66365
  while (ts.isAccessExpression(source)) {
@@ -80914,7 +80939,7 @@ var ts;
80914
80939
  }
80915
80940
  if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
80916
80941
  var propName = member.name;
80917
- if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
80942
+ if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
80918
80943
  var type = getTypeOfSymbol(getSymbolOfNode(member));
80919
80944
  if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
80920
80945
  if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
@@ -80949,7 +80974,9 @@ var ts;
80949
80974
  return false;
80950
80975
  }
80951
80976
  function isPropertyInitializedInConstructor(propName, propType, constructor) {
80952
- var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
80977
+ var reference = ts.isComputedPropertyName(propName)
80978
+ ? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
80979
+ : ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
80953
80980
  ts.setParent(reference.expression, reference);
80954
80981
  ts.setParent(reference, constructor);
80955
80982
  reference.flowNode = constructor.returnFlowNode;
@@ -111013,7 +111040,7 @@ var ts;
111013
111040
  var rootResult = tryReadDirectory(rootDir, rootDirPath);
111014
111041
  var rootSymLinkResult;
111015
111042
  if (rootResult !== undefined) {
111016
- return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath);
111043
+ return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath, directoryExists);
111017
111044
  }
111018
111045
  return host.readDirectory(rootDir, extensions, excludes, includes, depth);
111019
111046
  function getFileSystemEntries(dir) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.5.0-pr-45991-2",
5
+ "version": "4.5.0-pr-45974-3",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [