mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Update LKG
This commit is contained in:
+13
-11
@@ -18964,13 +18964,7 @@ var ts;
|
||||
case 0:
|
||||
return tryReadFromField("typings") || tryReadFromField("types");
|
||||
case 1:
|
||||
if (typeof jsonContent.main === "string") {
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.No_types_specified_in_package_json_so_returning_main_value_of_0, jsonContent.main);
|
||||
}
|
||||
return ts.normalizePath(ts.combinePaths(baseDirectory, jsonContent.main));
|
||||
}
|
||||
return undefined;
|
||||
return tryReadFromField("main");
|
||||
}
|
||||
function tryReadFromField(fieldName) {
|
||||
if (ts.hasProperty(jsonContent, fieldName)) {
|
||||
@@ -19488,12 +19482,20 @@ var ts;
|
||||
if (resolved_3) {
|
||||
return resolved_3;
|
||||
}
|
||||
trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromExactFile);
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromExactFile);
|
||||
}
|
||||
}
|
||||
var resolved = tryAddingExtensions(mainOrTypesFile, 0, failedLookupLocations, onlyRecordFailures_1, state);
|
||||
if (resolved) {
|
||||
return resolved;
|
||||
}
|
||||
if (extensions === 1) {
|
||||
var resolved_4 = tryAddingExtensions(mainOrTypesFile, 1, failedLookupLocations, onlyRecordFailures_1, state);
|
||||
if (resolved_4) {
|
||||
return resolved_4;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (state.traceEnabled) {
|
||||
@@ -19584,7 +19586,7 @@ var ts;
|
||||
}
|
||||
var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName);
|
||||
if (moduleHasNonRelativeName(moduleName)) {
|
||||
var resolved_4 = forEachAncestorDirectory(containingDirectory, function (directory) {
|
||||
var resolved_5 = forEachAncestorDirectory(containingDirectory, function (directory) {
|
||||
var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host);
|
||||
if (resolutionFromCache) {
|
||||
return resolutionFromCache;
|
||||
@@ -19592,8 +19594,8 @@ var ts;
|
||||
var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName));
|
||||
return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state));
|
||||
});
|
||||
if (resolved_4) {
|
||||
return resolved_4;
|
||||
if (resolved_5) {
|
||||
return resolved_5;
|
||||
}
|
||||
if (extensions === 0) {
|
||||
return loadModuleFromNodeModulesAtTypes(moduleName, containingDirectory, failedLookupLocations, state);
|
||||
|
||||
+13
-11
@@ -6323,13 +6323,7 @@ var ts;
|
||||
case 0:
|
||||
return tryReadFromField("typings") || tryReadFromField("types");
|
||||
case 1:
|
||||
if (typeof jsonContent.main === "string") {
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.No_types_specified_in_package_json_so_returning_main_value_of_0, jsonContent.main);
|
||||
}
|
||||
return ts.normalizePath(ts.combinePaths(baseDirectory, jsonContent.main));
|
||||
}
|
||||
return undefined;
|
||||
return tryReadFromField("main");
|
||||
}
|
||||
function tryReadFromField(fieldName) {
|
||||
if (ts.hasProperty(jsonContent, fieldName)) {
|
||||
@@ -6847,12 +6841,20 @@ var ts;
|
||||
if (resolved_3) {
|
||||
return resolved_3;
|
||||
}
|
||||
trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromExactFile);
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromExactFile);
|
||||
}
|
||||
}
|
||||
var resolved = tryAddingExtensions(mainOrTypesFile, 0, failedLookupLocations, onlyRecordFailures_1, state);
|
||||
if (resolved) {
|
||||
return resolved;
|
||||
}
|
||||
if (extensions === 1) {
|
||||
var resolved_4 = tryAddingExtensions(mainOrTypesFile, 1, failedLookupLocations, onlyRecordFailures_1, state);
|
||||
if (resolved_4) {
|
||||
return resolved_4;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (state.traceEnabled) {
|
||||
@@ -6943,7 +6945,7 @@ var ts;
|
||||
}
|
||||
var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName);
|
||||
if (moduleHasNonRelativeName(moduleName)) {
|
||||
var resolved_4 = forEachAncestorDirectory(containingDirectory, function (directory) {
|
||||
var resolved_5 = forEachAncestorDirectory(containingDirectory, function (directory) {
|
||||
var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host);
|
||||
if (resolutionFromCache) {
|
||||
return resolutionFromCache;
|
||||
@@ -6951,8 +6953,8 @@ var ts;
|
||||
var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName));
|
||||
return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state));
|
||||
});
|
||||
if (resolved_4) {
|
||||
return resolved_4;
|
||||
if (resolved_5) {
|
||||
return resolved_5;
|
||||
}
|
||||
if (extensions === 0) {
|
||||
return loadModuleFromNodeModulesAtTypes(moduleName, containingDirectory, failedLookupLocations, state);
|
||||
|
||||
+13
-11
@@ -6323,13 +6323,7 @@ var ts;
|
||||
case 0:
|
||||
return tryReadFromField("typings") || tryReadFromField("types");
|
||||
case 1:
|
||||
if (typeof jsonContent.main === "string") {
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.No_types_specified_in_package_json_so_returning_main_value_of_0, jsonContent.main);
|
||||
}
|
||||
return ts.normalizePath(ts.combinePaths(baseDirectory, jsonContent.main));
|
||||
}
|
||||
return undefined;
|
||||
return tryReadFromField("main");
|
||||
}
|
||||
function tryReadFromField(fieldName) {
|
||||
if (ts.hasProperty(jsonContent, fieldName)) {
|
||||
@@ -6847,12 +6841,20 @@ var ts;
|
||||
if (resolved_3) {
|
||||
return resolved_3;
|
||||
}
|
||||
trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromExactFile);
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromExactFile);
|
||||
}
|
||||
}
|
||||
var resolved = tryAddingExtensions(mainOrTypesFile, 0, failedLookupLocations, onlyRecordFailures_1, state);
|
||||
if (resolved) {
|
||||
return resolved;
|
||||
}
|
||||
if (extensions === 1) {
|
||||
var resolved_4 = tryAddingExtensions(mainOrTypesFile, 1, failedLookupLocations, onlyRecordFailures_1, state);
|
||||
if (resolved_4) {
|
||||
return resolved_4;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (state.traceEnabled) {
|
||||
@@ -6943,7 +6945,7 @@ var ts;
|
||||
}
|
||||
var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName);
|
||||
if (moduleHasNonRelativeName(moduleName)) {
|
||||
var resolved_4 = forEachAncestorDirectory(containingDirectory, function (directory) {
|
||||
var resolved_5 = forEachAncestorDirectory(containingDirectory, function (directory) {
|
||||
var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host);
|
||||
if (resolutionFromCache) {
|
||||
return resolutionFromCache;
|
||||
@@ -6951,8 +6953,8 @@ var ts;
|
||||
var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName));
|
||||
return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state));
|
||||
});
|
||||
if (resolved_4) {
|
||||
return resolved_4;
|
||||
if (resolved_5) {
|
||||
return resolved_5;
|
||||
}
|
||||
if (extensions === 0) {
|
||||
return loadModuleFromNodeModulesAtTypes(moduleName, containingDirectory, failedLookupLocations, state);
|
||||
|
||||
+16
-11
@@ -23428,13 +23428,7 @@ var ts;
|
||||
case 0 /* TypeScript */:
|
||||
return tryReadFromField("typings") || tryReadFromField("types");
|
||||
case 1 /* JavaScript */:
|
||||
if (typeof jsonContent.main === "string") {
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.No_types_specified_in_package_json_so_returning_main_value_of_0, jsonContent.main);
|
||||
}
|
||||
return ts.normalizePath(ts.combinePaths(baseDirectory, jsonContent.main));
|
||||
}
|
||||
return undefined;
|
||||
return tryReadFromField("main");
|
||||
}
|
||||
function tryReadFromField(fieldName) {
|
||||
if (ts.hasProperty(jsonContent, fieldName)) {
|
||||
@@ -24077,12 +24071,23 @@ var ts;
|
||||
if (resolved_3) {
|
||||
return resolved_3;
|
||||
}
|
||||
trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromExactFile);
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromExactFile);
|
||||
}
|
||||
}
|
||||
var resolved = tryAddingExtensions(mainOrTypesFile, 0 /* TypeScript */, failedLookupLocations, onlyRecordFailures_1, state);
|
||||
if (resolved) {
|
||||
return resolved;
|
||||
}
|
||||
if (extensions === 1 /* JavaScript */) {
|
||||
// A package.json "main" may specify an exact filename, or may choose to omit an extension.
|
||||
// We tried the ts extensions erlier, now try the js extensions.
|
||||
// tryReadPackageJsonMainOrTypes returns main iff extensions is Extensions.JavaScript.
|
||||
var resolved_4 = tryAddingExtensions(mainOrTypesFile, 1 /* JavaScript */, failedLookupLocations, onlyRecordFailures_1, state);
|
||||
if (resolved_4) {
|
||||
return resolved_4;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (state.traceEnabled) {
|
||||
@@ -24179,7 +24184,7 @@ var ts;
|
||||
var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName);
|
||||
if (moduleHasNonRelativeName(moduleName)) {
|
||||
// Climb up parent directories looking for a module.
|
||||
var resolved_4 = forEachAncestorDirectory(containingDirectory, function (directory) {
|
||||
var resolved_5 = forEachAncestorDirectory(containingDirectory, function (directory) {
|
||||
var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host);
|
||||
if (resolutionFromCache) {
|
||||
return resolutionFromCache;
|
||||
@@ -24187,8 +24192,8 @@ var ts;
|
||||
var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName));
|
||||
return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, /*onlyRecordFailures*/ false, state));
|
||||
});
|
||||
if (resolved_4) {
|
||||
return resolved_4;
|
||||
if (resolved_5) {
|
||||
return resolved_5;
|
||||
}
|
||||
if (extensions === 0 /* TypeScript */) {
|
||||
// If we didn't find the file normally, look it up in @types.
|
||||
|
||||
+16
-11
@@ -23428,13 +23428,7 @@ var ts;
|
||||
case 0 /* TypeScript */:
|
||||
return tryReadFromField("typings") || tryReadFromField("types");
|
||||
case 1 /* JavaScript */:
|
||||
if (typeof jsonContent.main === "string") {
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.No_types_specified_in_package_json_so_returning_main_value_of_0, jsonContent.main);
|
||||
}
|
||||
return ts.normalizePath(ts.combinePaths(baseDirectory, jsonContent.main));
|
||||
}
|
||||
return undefined;
|
||||
return tryReadFromField("main");
|
||||
}
|
||||
function tryReadFromField(fieldName) {
|
||||
if (ts.hasProperty(jsonContent, fieldName)) {
|
||||
@@ -24077,12 +24071,23 @@ var ts;
|
||||
if (resolved_3) {
|
||||
return resolved_3;
|
||||
}
|
||||
trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromExactFile);
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromExactFile);
|
||||
}
|
||||
}
|
||||
var resolved = tryAddingExtensions(mainOrTypesFile, 0 /* TypeScript */, failedLookupLocations, onlyRecordFailures_1, state);
|
||||
if (resolved) {
|
||||
return resolved;
|
||||
}
|
||||
if (extensions === 1 /* JavaScript */) {
|
||||
// A package.json "main" may specify an exact filename, or may choose to omit an extension.
|
||||
// We tried the ts extensions erlier, now try the js extensions.
|
||||
// tryReadPackageJsonMainOrTypes returns main iff extensions is Extensions.JavaScript.
|
||||
var resolved_4 = tryAddingExtensions(mainOrTypesFile, 1 /* JavaScript */, failedLookupLocations, onlyRecordFailures_1, state);
|
||||
if (resolved_4) {
|
||||
return resolved_4;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (state.traceEnabled) {
|
||||
@@ -24179,7 +24184,7 @@ var ts;
|
||||
var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName);
|
||||
if (moduleHasNonRelativeName(moduleName)) {
|
||||
// Climb up parent directories looking for a module.
|
||||
var resolved_4 = forEachAncestorDirectory(containingDirectory, function (directory) {
|
||||
var resolved_5 = forEachAncestorDirectory(containingDirectory, function (directory) {
|
||||
var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host);
|
||||
if (resolutionFromCache) {
|
||||
return resolutionFromCache;
|
||||
@@ -24187,8 +24192,8 @@ var ts;
|
||||
var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName));
|
||||
return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, /*onlyRecordFailures*/ false, state));
|
||||
});
|
||||
if (resolved_4) {
|
||||
return resolved_4;
|
||||
if (resolved_5) {
|
||||
return resolved_5;
|
||||
}
|
||||
if (extensions === 0 /* TypeScript */) {
|
||||
// If we didn't find the file normally, look it up in @types.
|
||||
|
||||
+13
-11
@@ -6130,13 +6130,7 @@ var ts;
|
||||
case 0:
|
||||
return tryReadFromField("typings") || tryReadFromField("types");
|
||||
case 1:
|
||||
if (typeof jsonContent.main === "string") {
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.No_types_specified_in_package_json_so_returning_main_value_of_0, jsonContent.main);
|
||||
}
|
||||
return ts.normalizePath(ts.combinePaths(baseDirectory, jsonContent.main));
|
||||
}
|
||||
return undefined;
|
||||
return tryReadFromField("main");
|
||||
}
|
||||
function tryReadFromField(fieldName) {
|
||||
if (ts.hasProperty(jsonContent, fieldName)) {
|
||||
@@ -6654,12 +6648,20 @@ var ts;
|
||||
if (resolved_3) {
|
||||
return resolved_3;
|
||||
}
|
||||
trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromExactFile);
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromExactFile);
|
||||
}
|
||||
}
|
||||
var resolved = tryAddingExtensions(mainOrTypesFile, 0, failedLookupLocations, onlyRecordFailures_1, state);
|
||||
if (resolved) {
|
||||
return resolved;
|
||||
}
|
||||
if (extensions === 1) {
|
||||
var resolved_4 = tryAddingExtensions(mainOrTypesFile, 1, failedLookupLocations, onlyRecordFailures_1, state);
|
||||
if (resolved_4) {
|
||||
return resolved_4;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (state.traceEnabled) {
|
||||
@@ -6750,7 +6752,7 @@ var ts;
|
||||
}
|
||||
var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName);
|
||||
if (moduleHasNonRelativeName(moduleName)) {
|
||||
var resolved_4 = forEachAncestorDirectory(containingDirectory, function (directory) {
|
||||
var resolved_5 = forEachAncestorDirectory(containingDirectory, function (directory) {
|
||||
var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host);
|
||||
if (resolutionFromCache) {
|
||||
return resolutionFromCache;
|
||||
@@ -6758,8 +6760,8 @@ var ts;
|
||||
var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName));
|
||||
return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state));
|
||||
});
|
||||
if (resolved_4) {
|
||||
return resolved_4;
|
||||
if (resolved_5) {
|
||||
return resolved_5;
|
||||
}
|
||||
if (extensions === 0) {
|
||||
return loadModuleFromNodeModulesAtTypes(moduleName, containingDirectory, failedLookupLocations, state);
|
||||
|
||||
Reference in New Issue
Block a user