typescript 4.6.0-dev.20220119 → 4.6.0-dev.20220120
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/lib.dom.d.ts +1 -1
- package/lib/tsc.js +58 -28
- package/lib/tsserver.js +77 -41
- package/lib/tsserverlibrary.js +77 -41
- package/lib/typescript.js +77 -41
- package/lib/typescriptServices.js +77 -41
- package/lib/typingsInstaller.js +63 -28
- package/package.json +1 -1
package/lib/lib.dom.d.ts
CHANGED
|
@@ -1905,7 +1905,7 @@ interface AbortSignal extends EventTarget {
|
|
|
1905
1905
|
declare var AbortSignal: {
|
|
1906
1906
|
prototype: AbortSignal;
|
|
1907
1907
|
new(): AbortSignal;
|
|
1908
|
-
abort(
|
|
1908
|
+
// abort(): AbortSignal; - To be re-added in the future
|
|
1909
1909
|
};
|
|
1910
1910
|
|
|
1911
1911
|
interface AbstractRange {
|
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.6";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220120";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -4171,9 +4171,13 @@ var ts;
|
|
|
4171
4171
|
}
|
|
4172
4172
|
ts.getFileWatcherEventKind = getFileWatcherEventKind;
|
|
4173
4173
|
ts.ignoredPaths = ["/node_modules/.", "/.git", "/.#"];
|
|
4174
|
-
|
|
4174
|
+
var curSysLog = ts.noop;
|
|
4175
|
+
function sysLog(s) {
|
|
4176
|
+
return curSysLog(s);
|
|
4177
|
+
}
|
|
4178
|
+
ts.sysLog = sysLog;
|
|
4175
4179
|
function setSysLog(logger) {
|
|
4176
|
-
|
|
4180
|
+
curSysLog = logger;
|
|
4177
4181
|
}
|
|
4178
4182
|
ts.setSysLog = setSysLog;
|
|
4179
4183
|
function createDirectoryWatcherSupportingRecursive(_a) {
|
|
@@ -4293,7 +4297,7 @@ var ts;
|
|
|
4293
4297
|
}
|
|
4294
4298
|
function onTimerToUpdateChildWatches() {
|
|
4295
4299
|
timerToUpdateChildWatches = undefined;
|
|
4296
|
-
|
|
4300
|
+
sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
|
|
4297
4301
|
var start = ts.timestamp();
|
|
4298
4302
|
var invokeMap = new ts.Map();
|
|
4299
4303
|
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
|
|
@@ -4304,7 +4308,7 @@ var ts;
|
|
|
4304
4308
|
var hasChanges = updateChildWatches(dirName, dirPath, options);
|
|
4305
4309
|
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
|
|
4306
4310
|
}
|
|
4307
|
-
|
|
4311
|
+
sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
|
|
4308
4312
|
callbackCache.forEach(function (callbacks, rootDirName) {
|
|
4309
4313
|
var existing = invokeMap.get(rootDirName);
|
|
4310
4314
|
if (existing) {
|
|
@@ -4320,7 +4324,7 @@ var ts;
|
|
|
4320
4324
|
}
|
|
4321
4325
|
});
|
|
4322
4326
|
var elapsed = ts.timestamp() - start;
|
|
4323
|
-
|
|
4327
|
+
sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
|
|
4324
4328
|
}
|
|
4325
4329
|
function removeChildWatches(parentWatcher) {
|
|
4326
4330
|
if (!parentWatcher)
|
|
@@ -4822,7 +4826,7 @@ var ts;
|
|
|
4822
4826
|
}
|
|
4823
4827
|
};
|
|
4824
4828
|
function invokeCallbackAndUpdateWatcher(createWatcher) {
|
|
4825
|
-
|
|
4829
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
|
|
4826
4830
|
callback("rename", "");
|
|
4827
4831
|
if (watcher) {
|
|
4828
4832
|
watcher.close();
|
|
@@ -4839,7 +4843,7 @@ var ts;
|
|
|
4839
4843
|
}
|
|
4840
4844
|
}
|
|
4841
4845
|
if (hitSystemWatcherLimit) {
|
|
4842
|
-
|
|
4846
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
|
|
4843
4847
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
4844
4848
|
}
|
|
4845
4849
|
try {
|
|
@@ -4851,7 +4855,7 @@ var ts;
|
|
|
4851
4855
|
}
|
|
4852
4856
|
catch (e) {
|
|
4853
4857
|
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
|
|
4854
|
-
|
|
4858
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
|
|
4855
4859
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
4856
4860
|
}
|
|
4857
4861
|
}
|
|
@@ -5419,6 +5423,7 @@ var ts;
|
|
|
5419
5423
|
Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
|
|
5420
5424
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
5421
5425
|
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),
|
|
5426
|
+
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
5422
5427
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
5423
5428
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
5424
5429
|
Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", undefined, true),
|
|
@@ -6299,7 +6304,7 @@ var ts;
|
|
|
6299
6304
|
Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
|
|
6300
6305
|
_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
|
|
6301
6306
|
Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
|
|
6302
|
-
|
|
6307
|
+
Found_0_errors_in_the_same_file_starting_at_Colon_1: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_the_same_file_starting_at_Colon_1_6260", "Found {0} errors in the same file, starting at: {1}"),
|
|
6303
6308
|
Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
|
|
6304
6309
|
Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
|
|
6305
6310
|
Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
|
|
@@ -12277,7 +12282,7 @@ var ts;
|
|
|
12277
12282
|
}
|
|
12278
12283
|
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
|
|
12279
12284
|
function getExternalModuleRequireArgument(node) {
|
|
12280
|
-
return
|
|
12285
|
+
return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
|
|
12281
12286
|
}
|
|
12282
12287
|
ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument;
|
|
12283
12288
|
function isInternalModuleImportEqualsDeclaration(node) {
|
|
@@ -12331,17 +12336,26 @@ var ts;
|
|
|
12331
12336
|
return !requireStringLiteralLikeArgument || ts.isStringLiteralLike(arg);
|
|
12332
12337
|
}
|
|
12333
12338
|
ts.isRequireCall = isRequireCall;
|
|
12334
|
-
function
|
|
12339
|
+
function isVariableDeclarationInitializedToRequire(node) {
|
|
12340
|
+
return isVariableDeclarationInitializedWithRequireHelper(node, false);
|
|
12341
|
+
}
|
|
12342
|
+
ts.isVariableDeclarationInitializedToRequire = isVariableDeclarationInitializedToRequire;
|
|
12343
|
+
function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
|
|
12344
|
+
return isVariableDeclarationInitializedWithRequireHelper(node, true);
|
|
12345
|
+
}
|
|
12346
|
+
ts.isVariableDeclarationInitializedToBareOrAccessedRequire = isVariableDeclarationInitializedToBareOrAccessedRequire;
|
|
12347
|
+
function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
|
|
12335
12348
|
if (node.kind === 202) {
|
|
12336
12349
|
node = node.parent.parent;
|
|
12337
12350
|
}
|
|
12338
|
-
return ts.isVariableDeclaration(node) &&
|
|
12351
|
+
return ts.isVariableDeclaration(node) &&
|
|
12352
|
+
!!node.initializer &&
|
|
12353
|
+
isRequireCall(allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, true);
|
|
12339
12354
|
}
|
|
12340
|
-
ts.isRequireVariableDeclaration = isRequireVariableDeclaration;
|
|
12341
12355
|
function isRequireVariableStatement(node) {
|
|
12342
12356
|
return ts.isVariableStatement(node)
|
|
12343
12357
|
&& node.declarationList.declarations.length > 0
|
|
12344
|
-
&& ts.every(node.declarationList.declarations, function (decl) { return
|
|
12358
|
+
&& ts.every(node.declarationList.declarations, function (decl) { return isVariableDeclarationInitializedToRequire(decl); });
|
|
12345
12359
|
}
|
|
12346
12360
|
ts.isRequireVariableStatement = isRequireVariableStatement;
|
|
12347
12361
|
function isSingleOrDoubleQuote(charCode) {
|
|
@@ -15301,7 +15315,7 @@ var ts;
|
|
|
15301
15315
|
getSourceMapSourceConstructor: function () { return SourceMapSource; },
|
|
15302
15316
|
};
|
|
15303
15317
|
function setObjectAllocator(alloc) {
|
|
15304
|
-
ts.objectAllocator
|
|
15318
|
+
Object.assign(ts.objectAllocator, alloc);
|
|
15305
15319
|
}
|
|
15306
15320
|
ts.setObjectAllocator = setObjectAllocator;
|
|
15307
15321
|
function formatStringFromArgs(text, args, baseIndex) {
|
|
@@ -15309,12 +15323,19 @@ var ts;
|
|
|
15309
15323
|
return text.replace(/{(\d+)}/g, function (_match, index) { return "" + ts.Debug.checkDefined(args[+index + baseIndex]); });
|
|
15310
15324
|
}
|
|
15311
15325
|
ts.formatStringFromArgs = formatStringFromArgs;
|
|
15326
|
+
var localizedDiagnosticMessages;
|
|
15312
15327
|
function setLocalizedDiagnosticMessages(messages) {
|
|
15313
|
-
|
|
15328
|
+
localizedDiagnosticMessages = messages;
|
|
15314
15329
|
}
|
|
15315
15330
|
ts.setLocalizedDiagnosticMessages = setLocalizedDiagnosticMessages;
|
|
15331
|
+
function maybeSetLocalizedDiagnosticMessages(getMessages) {
|
|
15332
|
+
if (!localizedDiagnosticMessages && getMessages) {
|
|
15333
|
+
localizedDiagnosticMessages = getMessages();
|
|
15334
|
+
}
|
|
15335
|
+
}
|
|
15336
|
+
ts.maybeSetLocalizedDiagnosticMessages = maybeSetLocalizedDiagnosticMessages;
|
|
15316
15337
|
function getLocaleSpecificMessage(message) {
|
|
15317
|
-
return
|
|
15338
|
+
return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message;
|
|
15318
15339
|
}
|
|
15319
15340
|
ts.getLocaleSpecificMessage = getLocaleSpecificMessage;
|
|
15320
15341
|
function createDetachedDiagnostic(fileName, start, length, message) {
|
|
@@ -28164,7 +28185,7 @@ var ts;
|
|
|
28164
28185
|
var catchClause = token() === 83 ? parseCatchClause() : undefined;
|
|
28165
28186
|
var finallyBlock;
|
|
28166
28187
|
if (!catchClause || token() === 96) {
|
|
28167
|
-
parseExpected(96);
|
|
28188
|
+
parseExpected(96, ts.Diagnostics.catch_or_finally_expected);
|
|
28168
28189
|
finallyBlock = parseBlock(false);
|
|
28169
28190
|
}
|
|
28170
28191
|
return withJSDoc(finishNode(factory.createTryStatement(tryBlock, catchClause, finallyBlock), pos), hasJSDoc);
|
|
@@ -37932,7 +37953,7 @@ var ts;
|
|
|
37932
37953
|
checkStrictModeEvalOrArguments(node, node.name);
|
|
37933
37954
|
}
|
|
37934
37955
|
if (!ts.isBindingPattern(node.name)) {
|
|
37935
|
-
if (ts.isInJSFile(node) && ts.
|
|
37956
|
+
if (ts.isInJSFile(node) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node) && !ts.getJSDocTypeTag(node)) {
|
|
37936
37957
|
declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
|
|
37937
37958
|
}
|
|
37938
37959
|
else if (ts.isBlockOrCatchScoped(node)) {
|
|
@@ -40210,7 +40231,7 @@ var ts;
|
|
|
40210
40231
|
&& isAliasableOrJsExpression(node.parent.right)
|
|
40211
40232
|
|| node.kind === 295
|
|
40212
40233
|
|| node.kind === 294 && isAliasableOrJsExpression(node.initializer)
|
|
40213
|
-
|| ts.
|
|
40234
|
+
|| ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node);
|
|
40214
40235
|
}
|
|
40215
40236
|
function isAliasableOrJsExpression(e) {
|
|
40216
40237
|
return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);
|
|
@@ -67514,7 +67535,7 @@ var ts;
|
|
|
67514
67535
|
return;
|
|
67515
67536
|
}
|
|
67516
67537
|
var symbol = getSymbolOfNode(node);
|
|
67517
|
-
if (symbol.flags & 2097152 && ts.
|
|
67538
|
+
if (symbol.flags & 2097152 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
|
|
67518
67539
|
checkAliasSymbol(node);
|
|
67519
67540
|
return;
|
|
67520
67541
|
}
|
|
@@ -99397,22 +99418,31 @@ var ts;
|
|
|
99397
99418
|
ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
|
|
99398
99419
|
}
|
|
99399
99420
|
ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
|
|
99421
|
+
function prettyPathForFileError(error, cwd) {
|
|
99422
|
+
var line = ts.formatColorAndReset(":" + error.line, ts.ForegroundColorEscapeSequences.Grey);
|
|
99423
|
+
if (ts.pathIsAbsolute(error.fileName) && ts.pathIsAbsolute(cwd)) {
|
|
99424
|
+
return ts.getRelativePathFromDirectory(cwd, error.fileName, false) + line;
|
|
99425
|
+
}
|
|
99426
|
+
return error.fileName + line;
|
|
99427
|
+
}
|
|
99400
99428
|
function getErrorSummaryText(errorCount, filesInError, newLine, host) {
|
|
99401
99429
|
if (errorCount === 0)
|
|
99402
99430
|
return "";
|
|
99403
99431
|
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
99404
99432
|
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
|
|
99405
99433
|
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
99434
|
+
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
|
|
99406
99435
|
var d = errorCount === 1 ?
|
|
99407
99436
|
ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
|
|
99408
99437
|
ts.Diagnostics.Found_1_error_in_1 :
|
|
99409
|
-
ts.Diagnostics.Found_1_error, errorCount,
|
|
99438
|
+
ts.Diagnostics.Found_1_error, errorCount, firstFileReference) :
|
|
99410
99439
|
ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
|
|
99411
99440
|
ts.Diagnostics.Found_0_errors :
|
|
99412
99441
|
distinctFileNamesWithLines.length === 1 ?
|
|
99413
|
-
ts.Diagnostics.
|
|
99414
|
-
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
|
|
99415
|
-
|
|
99442
|
+
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
|
|
99443
|
+
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
|
|
99444
|
+
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
|
|
99445
|
+
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
|
|
99416
99446
|
}
|
|
99417
99447
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
99418
99448
|
function createTabularErrorsDisplay(filesInError, host) {
|
|
@@ -99434,8 +99464,8 @@ var ts;
|
|
|
99434
99464
|
var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
|
|
99435
99465
|
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
99436
99466
|
: "";
|
|
99437
|
-
var
|
|
99438
|
-
tabularData += "" + leftPadding + errorCount + " " +
|
|
99467
|
+
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
|
|
99468
|
+
tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
|
|
99439
99469
|
});
|
|
99440
99470
|
return tabularData;
|
|
99441
99471
|
}
|
package/lib/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220120";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -6810,11 +6810,15 @@ var ts;
|
|
|
6810
6810
|
ts.getFileWatcherEventKind = getFileWatcherEventKind;
|
|
6811
6811
|
/*@internal*/
|
|
6812
6812
|
ts.ignoredPaths = ["/node_modules/.", "/.git", "/.#"];
|
|
6813
|
+
var curSysLog = ts.noop; // eslint-disable-line prefer-const
|
|
6813
6814
|
/*@internal*/
|
|
6814
|
-
|
|
6815
|
+
function sysLog(s) {
|
|
6816
|
+
return curSysLog(s);
|
|
6817
|
+
}
|
|
6818
|
+
ts.sysLog = sysLog;
|
|
6815
6819
|
/*@internal*/
|
|
6816
6820
|
function setSysLog(logger) {
|
|
6817
|
-
|
|
6821
|
+
curSysLog = logger;
|
|
6818
6822
|
}
|
|
6819
6823
|
ts.setSysLog = setSysLog;
|
|
6820
6824
|
/**
|
|
@@ -6949,7 +6953,7 @@ var ts;
|
|
|
6949
6953
|
}
|
|
6950
6954
|
function onTimerToUpdateChildWatches() {
|
|
6951
6955
|
timerToUpdateChildWatches = undefined;
|
|
6952
|
-
|
|
6956
|
+
sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
|
|
6953
6957
|
var start = ts.timestamp();
|
|
6954
6958
|
var invokeMap = new ts.Map();
|
|
6955
6959
|
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
|
|
@@ -6962,7 +6966,7 @@ var ts;
|
|
|
6962
6966
|
var hasChanges = updateChildWatches(dirName, dirPath, options);
|
|
6963
6967
|
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
|
|
6964
6968
|
}
|
|
6965
|
-
|
|
6969
|
+
sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
|
|
6966
6970
|
callbackCache.forEach(function (callbacks, rootDirName) {
|
|
6967
6971
|
var existing = invokeMap.get(rootDirName);
|
|
6968
6972
|
if (existing) {
|
|
@@ -6978,7 +6982,7 @@ var ts;
|
|
|
6978
6982
|
}
|
|
6979
6983
|
});
|
|
6980
6984
|
var elapsed = ts.timestamp() - start;
|
|
6981
|
-
|
|
6985
|
+
sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
|
|
6982
6986
|
}
|
|
6983
6987
|
function removeChildWatches(parentWatcher) {
|
|
6984
6988
|
if (!parentWatcher)
|
|
@@ -7565,7 +7569,7 @@ var ts;
|
|
|
7565
7569
|
* @param createWatcher
|
|
7566
7570
|
*/
|
|
7567
7571
|
function invokeCallbackAndUpdateWatcher(createWatcher) {
|
|
7568
|
-
|
|
7572
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
|
|
7569
7573
|
// Call the callback for current directory
|
|
7570
7574
|
callback("rename", "");
|
|
7571
7575
|
// If watcher is not closed, update it
|
|
@@ -7590,7 +7594,7 @@ var ts;
|
|
|
7590
7594
|
}
|
|
7591
7595
|
}
|
|
7592
7596
|
if (hitSystemWatcherLimit) {
|
|
7593
|
-
|
|
7597
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
|
|
7594
7598
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
7595
7599
|
}
|
|
7596
7600
|
try {
|
|
@@ -7606,7 +7610,7 @@ var ts;
|
|
|
7606
7610
|
// 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
|
|
7607
7611
|
// so instead of throwing error, use fs.watchFile
|
|
7608
7612
|
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
|
|
7609
|
-
|
|
7613
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
|
|
7610
7614
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
7611
7615
|
}
|
|
7612
7616
|
}
|
|
@@ -8205,6 +8209,7 @@ var ts;
|
|
|
8205
8209
|
Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
|
|
8206
8210
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
8207
8211
|
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),
|
|
8212
|
+
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
8208
8213
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
8209
8214
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
8210
8215
|
Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
|
|
@@ -9085,7 +9090,7 @@ var ts;
|
|
|
9085
9090
|
Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
|
|
9086
9091
|
_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
|
|
9087
9092
|
Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
|
|
9088
|
-
|
|
9093
|
+
Found_0_errors_in_the_same_file_starting_at_Colon_1: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_the_same_file_starting_at_Colon_1_6260", "Found {0} errors in the same file, starting at: {1}"),
|
|
9089
9094
|
Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
|
|
9090
9095
|
Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
|
|
9091
9096
|
Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
|
|
@@ -15858,7 +15863,7 @@ var ts;
|
|
|
15858
15863
|
}
|
|
15859
15864
|
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
|
|
15860
15865
|
function getExternalModuleRequireArgument(node) {
|
|
15861
|
-
return
|
|
15866
|
+
return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
|
|
15862
15867
|
}
|
|
15863
15868
|
ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument;
|
|
15864
15869
|
function isInternalModuleImportEqualsDeclaration(node) {
|
|
@@ -15916,17 +15921,29 @@ var ts;
|
|
|
15916
15921
|
* Returns true if the node is a VariableDeclaration initialized to a require call (see `isRequireCall`).
|
|
15917
15922
|
* This function does not test if the node is in a JavaScript file or not.
|
|
15918
15923
|
*/
|
|
15919
|
-
function
|
|
15924
|
+
function isVariableDeclarationInitializedToRequire(node) {
|
|
15925
|
+
return isVariableDeclarationInitializedWithRequireHelper(node, /*allowAccessedRequire*/ false);
|
|
15926
|
+
}
|
|
15927
|
+
ts.isVariableDeclarationInitializedToRequire = isVariableDeclarationInitializedToRequire;
|
|
15928
|
+
/**
|
|
15929
|
+
* Like {@link isVariableDeclarationInitializedToRequire} but allows things like `require("...").foo.bar` or `require("...")["baz"]`.
|
|
15930
|
+
*/
|
|
15931
|
+
function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
|
|
15932
|
+
return isVariableDeclarationInitializedWithRequireHelper(node, /*allowAccessedRequire*/ true);
|
|
15933
|
+
}
|
|
15934
|
+
ts.isVariableDeclarationInitializedToBareOrAccessedRequire = isVariableDeclarationInitializedToBareOrAccessedRequire;
|
|
15935
|
+
function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
|
|
15920
15936
|
if (node.kind === 202 /* BindingElement */) {
|
|
15921
15937
|
node = node.parent.parent;
|
|
15922
15938
|
}
|
|
15923
|
-
return ts.isVariableDeclaration(node) &&
|
|
15939
|
+
return ts.isVariableDeclaration(node) &&
|
|
15940
|
+
!!node.initializer &&
|
|
15941
|
+
isRequireCall(allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, /*requireStringLiteralLikeArgument*/ true);
|
|
15924
15942
|
}
|
|
15925
|
-
ts.isRequireVariableDeclaration = isRequireVariableDeclaration;
|
|
15926
15943
|
function isRequireVariableStatement(node) {
|
|
15927
15944
|
return ts.isVariableStatement(node)
|
|
15928
15945
|
&& node.declarationList.declarations.length > 0
|
|
15929
|
-
&& ts.every(node.declarationList.declarations, function (decl) { return
|
|
15946
|
+
&& ts.every(node.declarationList.declarations, function (decl) { return isVariableDeclarationInitializedToRequire(decl); });
|
|
15930
15947
|
}
|
|
15931
15948
|
ts.isRequireVariableStatement = isRequireVariableStatement;
|
|
15932
15949
|
function isSingleOrDoubleQuote(charCode) {
|
|
@@ -19413,7 +19430,7 @@ var ts;
|
|
|
19413
19430
|
getSourceMapSourceConstructor: function () { return SourceMapSource; },
|
|
19414
19431
|
};
|
|
19415
19432
|
function setObjectAllocator(alloc) {
|
|
19416
|
-
ts.objectAllocator
|
|
19433
|
+
Object.assign(ts.objectAllocator, alloc);
|
|
19417
19434
|
}
|
|
19418
19435
|
ts.setObjectAllocator = setObjectAllocator;
|
|
19419
19436
|
function formatStringFromArgs(text, args, baseIndex) {
|
|
@@ -19421,13 +19438,22 @@ var ts;
|
|
|
19421
19438
|
return text.replace(/{(\d+)}/g, function (_match, index) { return "" + ts.Debug.checkDefined(args[+index + baseIndex]); });
|
|
19422
19439
|
}
|
|
19423
19440
|
ts.formatStringFromArgs = formatStringFromArgs;
|
|
19441
|
+
var localizedDiagnosticMessages;
|
|
19424
19442
|
/* @internal */
|
|
19425
19443
|
function setLocalizedDiagnosticMessages(messages) {
|
|
19426
|
-
|
|
19444
|
+
localizedDiagnosticMessages = messages;
|
|
19427
19445
|
}
|
|
19428
19446
|
ts.setLocalizedDiagnosticMessages = setLocalizedDiagnosticMessages;
|
|
19447
|
+
/* @internal */
|
|
19448
|
+
// If the localized messages json is unset, and if given function use it to set the json
|
|
19449
|
+
function maybeSetLocalizedDiagnosticMessages(getMessages) {
|
|
19450
|
+
if (!localizedDiagnosticMessages && getMessages) {
|
|
19451
|
+
localizedDiagnosticMessages = getMessages();
|
|
19452
|
+
}
|
|
19453
|
+
}
|
|
19454
|
+
ts.maybeSetLocalizedDiagnosticMessages = maybeSetLocalizedDiagnosticMessages;
|
|
19429
19455
|
function getLocaleSpecificMessage(message) {
|
|
19430
|
-
return
|
|
19456
|
+
return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message;
|
|
19431
19457
|
}
|
|
19432
19458
|
ts.getLocaleSpecificMessage = getLocaleSpecificMessage;
|
|
19433
19459
|
function createDetachedDiagnostic(fileName, start, length, message) {
|
|
@@ -35036,7 +35062,7 @@ var ts;
|
|
|
35036
35062
|
// one out no matter what.
|
|
35037
35063
|
var finallyBlock;
|
|
35038
35064
|
if (!catchClause || token() === 96 /* FinallyKeyword */) {
|
|
35039
|
-
parseExpected(96 /* FinallyKeyword
|
|
35065
|
+
parseExpected(96 /* FinallyKeyword */, ts.Diagnostics.catch_or_finally_expected);
|
|
35040
35066
|
finallyBlock = parseBlock(/*ignoreMissingOpenBrace*/ false);
|
|
35041
35067
|
}
|
|
35042
35068
|
return withJSDoc(finishNode(factory.createTryStatement(tryBlock, catchClause, finallyBlock), pos), hasJSDoc);
|
|
@@ -46248,7 +46274,7 @@ var ts;
|
|
|
46248
46274
|
checkStrictModeEvalOrArguments(node, node.name);
|
|
46249
46275
|
}
|
|
46250
46276
|
if (!ts.isBindingPattern(node.name)) {
|
|
46251
|
-
if (ts.isInJSFile(node) && ts.
|
|
46277
|
+
if (ts.isInJSFile(node) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node) && !ts.getJSDocTypeTag(node)) {
|
|
46252
46278
|
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
|
|
46253
46279
|
}
|
|
46254
46280
|
else if (ts.isBlockOrCatchScoped(node)) {
|
|
@@ -49031,7 +49057,7 @@ var ts;
|
|
|
49031
49057
|
&& isAliasableOrJsExpression(node.parent.right)
|
|
49032
49058
|
|| node.kind === 295 /* ShorthandPropertyAssignment */
|
|
49033
49059
|
|| node.kind === 294 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer)
|
|
49034
|
-
|| ts.
|
|
49060
|
+
|| ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node);
|
|
49035
49061
|
}
|
|
49036
49062
|
function isAliasableOrJsExpression(e) {
|
|
49037
49063
|
return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);
|
|
@@ -80590,7 +80616,7 @@ var ts;
|
|
|
80590
80616
|
}
|
|
80591
80617
|
// For a commonjs `const x = require`, validate the alias and exit
|
|
80592
80618
|
var symbol = getSymbolOfNode(node);
|
|
80593
|
-
if (symbol.flags & 2097152 /* Alias */ && ts.
|
|
80619
|
+
if (symbol.flags & 2097152 /* Alias */ && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
|
|
80594
80620
|
checkAliasSymbol(node);
|
|
80595
80621
|
return;
|
|
80596
80622
|
}
|
|
@@ -120283,22 +120309,31 @@ var ts;
|
|
|
120283
120309
|
ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
|
|
120284
120310
|
}
|
|
120285
120311
|
ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
|
|
120312
|
+
function prettyPathForFileError(error, cwd) {
|
|
120313
|
+
var line = ts.formatColorAndReset(":" + error.line, ts.ForegroundColorEscapeSequences.Grey);
|
|
120314
|
+
if (ts.pathIsAbsolute(error.fileName) && ts.pathIsAbsolute(cwd)) {
|
|
120315
|
+
return ts.getRelativePathFromDirectory(cwd, error.fileName, /* ignoreCase */ false) + line;
|
|
120316
|
+
}
|
|
120317
|
+
return error.fileName + line;
|
|
120318
|
+
}
|
|
120286
120319
|
function getErrorSummaryText(errorCount, filesInError, newLine, host) {
|
|
120287
120320
|
if (errorCount === 0)
|
|
120288
120321
|
return "";
|
|
120289
120322
|
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
120290
120323
|
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
|
|
120291
120324
|
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
120325
|
+
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
|
|
120292
120326
|
var d = errorCount === 1 ?
|
|
120293
120327
|
ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
|
|
120294
120328
|
ts.Diagnostics.Found_1_error_in_1 :
|
|
120295
|
-
ts.Diagnostics.Found_1_error, errorCount,
|
|
120329
|
+
ts.Diagnostics.Found_1_error, errorCount, firstFileReference) :
|
|
120296
120330
|
ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
|
|
120297
120331
|
ts.Diagnostics.Found_0_errors :
|
|
120298
120332
|
distinctFileNamesWithLines.length === 1 ?
|
|
120299
|
-
ts.Diagnostics.
|
|
120300
|
-
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
|
|
120301
|
-
|
|
120333
|
+
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
|
|
120334
|
+
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
|
|
120335
|
+
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
|
|
120336
|
+
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
|
|
120302
120337
|
}
|
|
120303
120338
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
120304
120339
|
function createTabularErrorsDisplay(filesInError, host) {
|
|
@@ -120320,8 +120355,8 @@ var ts;
|
|
|
120320
120355
|
var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
|
|
120321
120356
|
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
120322
120357
|
: "";
|
|
120323
|
-
var
|
|
120324
|
-
tabularData += "" + leftPadding + errorCount + " " +
|
|
120358
|
+
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
|
|
120359
|
+
tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
|
|
120325
120360
|
});
|
|
120326
120361
|
return tabularData;
|
|
120327
120362
|
}
|
|
@@ -124634,7 +124669,7 @@ var ts;
|
|
|
124634
124669
|
isWhiteSpaceOnlyJsxText(child);
|
|
124635
124670
|
if (lookInPreviousChild) {
|
|
124636
124671
|
// actual start of the node is past the position - previous token should be at the end of previous child
|
|
124637
|
-
var candidate_1 = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i, sourceFile);
|
|
124672
|
+
var candidate_1 = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i, sourceFile, n.kind);
|
|
124638
124673
|
return candidate_1 && findRightmostToken(candidate_1, sourceFile);
|
|
124639
124674
|
}
|
|
124640
124675
|
else {
|
|
@@ -124648,7 +124683,7 @@ var ts;
|
|
|
124648
124683
|
// the only known case is when position is at the end of the file.
|
|
124649
124684
|
// Try to find the rightmost token in the file without filtering.
|
|
124650
124685
|
// Namely we are skipping the check: 'position < node.end'
|
|
124651
|
-
var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length, sourceFile);
|
|
124686
|
+
var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length, sourceFile, n.kind);
|
|
124652
124687
|
return candidate && findRightmostToken(candidate, sourceFile);
|
|
124653
124688
|
}
|
|
124654
124689
|
}
|
|
@@ -124664,17 +124699,19 @@ var ts;
|
|
|
124664
124699
|
if (children.length === 0) {
|
|
124665
124700
|
return n;
|
|
124666
124701
|
}
|
|
124667
|
-
var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length, sourceFile);
|
|
124702
|
+
var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length, sourceFile, n.kind);
|
|
124668
124703
|
return candidate && findRightmostToken(candidate, sourceFile);
|
|
124669
124704
|
}
|
|
124670
124705
|
/**
|
|
124671
124706
|
* Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens.
|
|
124672
124707
|
*/
|
|
124673
|
-
function findRightmostChildNodeWithTokens(children, exclusiveStartPosition, sourceFile) {
|
|
124708
|
+
function findRightmostChildNodeWithTokens(children, exclusiveStartPosition, sourceFile, parentKind) {
|
|
124674
124709
|
for (var i = exclusiveStartPosition - 1; i >= 0; i--) {
|
|
124675
124710
|
var child = children[i];
|
|
124676
124711
|
if (isWhiteSpaceOnlyJsxText(child)) {
|
|
124677
|
-
|
|
124712
|
+
if (i === 0 && (parentKind === 11 /* JsxText */ || parentKind === 278 /* JsxSelfClosingElement */)) {
|
|
124713
|
+
ts.Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");
|
|
124714
|
+
}
|
|
124678
124715
|
}
|
|
124679
124716
|
else if (nodeHasTokens(children[i], sourceFile)) {
|
|
124680
124717
|
return children[i];
|
|
@@ -133221,7 +133258,7 @@ var ts;
|
|
|
133221
133258
|
ts.Debug.assert(parent.name === node);
|
|
133222
133259
|
return true;
|
|
133223
133260
|
case 202 /* BindingElement */:
|
|
133224
|
-
return ts.isInJSFile(node) && ts.
|
|
133261
|
+
return ts.isInJSFile(node) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(parent);
|
|
133225
133262
|
default:
|
|
133226
133263
|
return false;
|
|
133227
133264
|
}
|
|
@@ -134621,7 +134658,7 @@ var ts;
|
|
|
134621
134658
|
// Use the parent symbol if the location is commonjs require syntax on javascript files only.
|
|
134622
134659
|
if (ts.isInJSFile(referenceLocation)
|
|
134623
134660
|
&& referenceLocation.parent.kind === 202 /* BindingElement */
|
|
134624
|
-
&& ts.
|
|
134661
|
+
&& ts.isVariableDeclarationInitializedToBareOrAccessedRequire(referenceLocation.parent)) {
|
|
134625
134662
|
referenceSymbol = referenceLocation.parent.symbol;
|
|
134626
134663
|
// The parent will not have a symbol if it's an ObjectBindingPattern (when destructuring is used). In
|
|
134627
134664
|
// this case, just skip it, since the bound identifiers are not an alias of the import.
|
|
@@ -136332,7 +136369,7 @@ var ts;
|
|
|
136332
136369
|
return declaration.parent.kind === 268 /* NamedImports */;
|
|
136333
136370
|
case 202 /* BindingElement */:
|
|
136334
136371
|
case 253 /* VariableDeclaration */:
|
|
136335
|
-
return ts.isInJSFile(declaration) && ts.
|
|
136372
|
+
return ts.isInJSFile(declaration) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(declaration);
|
|
136336
136373
|
default:
|
|
136337
136374
|
return false;
|
|
136338
136375
|
}
|
|
@@ -149423,7 +149460,7 @@ var ts;
|
|
|
149423
149460
|
var importKind = getImportKind(importingFile, exportKind, compilerOptions);
|
|
149424
149461
|
return ts.mapDefined(importingFile.imports, function (moduleSpecifier) {
|
|
149425
149462
|
var i = ts.importFromModuleSpecifier(moduleSpecifier);
|
|
149426
|
-
if (ts.
|
|
149463
|
+
if (ts.isVariableDeclarationInitializedToRequire(i.parent)) {
|
|
149427
149464
|
return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind, symbol: symbol, targetFlags: targetFlags } : undefined;
|
|
149428
149465
|
}
|
|
149429
149466
|
if (i.kind === 265 /* ImportDeclaration */ || i.kind === 264 /* ImportEqualsDeclaration */) {
|
|
@@ -160608,6 +160645,7 @@ var ts;
|
|
|
160608
160645
|
], false);
|
|
160609
160646
|
function createLanguageService(host, documentRegistry, syntaxOnlyOrLanguageServiceMode) {
|
|
160610
160647
|
var _a;
|
|
160648
|
+
var _b;
|
|
160611
160649
|
if (documentRegistry === void 0) { documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); }
|
|
160612
160650
|
var languageServiceMode;
|
|
160613
160651
|
if (syntaxOnlyOrLanguageServiceMode === undefined) {
|
|
@@ -160628,10 +160666,8 @@ var ts;
|
|
|
160628
160666
|
? new CancellationTokenObject(host.getCancellationToken())
|
|
160629
160667
|
: NoopCancellationToken;
|
|
160630
160668
|
var currentDirectory = host.getCurrentDirectory();
|
|
160631
|
-
//
|
|
160632
|
-
|
|
160633
|
-
ts.setLocalizedDiagnosticMessages(host.getLocalizedDiagnosticMessages());
|
|
160634
|
-
}
|
|
160669
|
+
// Checks if the localized messages json is set, and if not, query the host for it
|
|
160670
|
+
ts.maybeSetLocalizedDiagnosticMessages((_b = host.getLocalizedDiagnosticMessages) === null || _b === void 0 ? void 0 : _b.bind(host));
|
|
160635
160671
|
function log(message) {
|
|
160636
160672
|
if (host.log) {
|
|
160637
160673
|
host.log(message);
|