Skip to content

Commit 0951a94

Browse files
committed
Update LKG
1 parent f93dffd commit 0951a94

14 files changed

+331
-98
lines changed

lib/lib.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18993,7 +18993,7 @@ interface ErrorEventHandler {
1899318993
(message: string, filename?: string, lineno?: number, colno?: number, error?: Error): void;
1899418994
}
1899518995
interface ForEachCallback {
18996-
(keyId: BufferSource, status: MediaKeyStatus): void;
18996+
(keyId: any, status: MediaKeyStatus): void;
1899718997
}
1899818998
interface FrameRequestCallback {
1899918999
(time: number): void;

lib/lib.dom.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14895,7 +14895,7 @@ interface ErrorEventHandler {
1489514895
(message: string, filename?: string, lineno?: number, colno?: number, error?: Error): void;
1489614896
}
1489714897
interface ForEachCallback {
14898-
(keyId: BufferSource, status: MediaKeyStatus): void;
14898+
(keyId: any, status: MediaKeyStatus): void;
1489914899
}
1490014900
interface FrameRequestCallback {
1490114901
(time: number): void;

lib/lib.es2016.full.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14898,7 +14898,7 @@ interface ErrorEventHandler {
1489814898
(message: string, filename?: string, lineno?: number, colno?: number, error?: Error): void;
1489914899
}
1490014900
interface ForEachCallback {
14901-
(keyId: BufferSource, status: MediaKeyStatus): void;
14901+
(keyId: any, status: MediaKeyStatus): void;
1490214902
}
1490314903
interface FrameRequestCallback {
1490414904
(time: number): void;

lib/lib.es2017.full.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14903,7 +14903,7 @@ interface ErrorEventHandler {
1490314903
(message: string, filename?: string, lineno?: number, colno?: number, error?: Error): void;
1490414904
}
1490514905
interface ForEachCallback {
14906-
(keyId: BufferSource, status: MediaKeyStatus): void;
14906+
(keyId: any, status: MediaKeyStatus): void;
1490714907
}
1490814908
interface FrameRequestCallback {
1490914909
(time: number): void;

lib/lib.es2018.full.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14898,7 +14898,7 @@ interface ErrorEventHandler {
1489814898
(message: string, filename?: string, lineno?: number, colno?: number, error?: Error): void;
1489914899
}
1490014900
interface ForEachCallback {
14901-
(keyId: BufferSource, status: MediaKeyStatus): void;
14901+
(keyId: any, status: MediaKeyStatus): void;
1490214902
}
1490314903
interface FrameRequestCallback {
1490414904
(time: number): void;

lib/lib.es6.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20705,7 +20705,7 @@ interface ErrorEventHandler {
2070520705
(message: string, filename?: string, lineno?: number, colno?: number, error?: Error): void;
2070620706
}
2070720707
interface ForEachCallback {
20708-
(keyId: BufferSource, status: MediaKeyStatus): void;
20708+
(keyId: any, status: MediaKeyStatus): void;
2070920709
}
2071020710
interface FrameRequestCallback {
2071120711
(time: number): void;

lib/lib.esnext.full.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14901,7 +14901,7 @@ interface ErrorEventHandler {
1490114901
(message: string, filename?: string, lineno?: number, colno?: number, error?: Error): void;
1490214902
}
1490314903
interface ForEachCallback {
14904-
(keyId: BufferSource, status: MediaKeyStatus): void;
14904+
(keyId: any, status: MediaKeyStatus): void;
1490514905
}
1490614906
interface FrameRequestCallback {
1490714907
(time: number): void;

lib/lib.webworker.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,7 @@ interface ErrorEventHandler {
18931893
(message: string, filename?: string, lineno?: number, colno?: number, error?: Error): void;
18941894
}
18951895
interface ForEachCallback {
1896-
(keyId: BufferSource, status: MediaKeyStatus): void;
1896+
(keyId: any, status: MediaKeyStatus): void;
18971897
}
18981898
interface FunctionStringCallback {
18991899
(data: string): void;

lib/tsc.js

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19194,7 +19194,7 @@ var ts;
1919419194
}
1919519195
var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state);
1919619196
if (resolvedFromFile) {
19197-
var nm = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile.path) : undefined;
19197+
var nm = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile) : undefined;
1919819198
var packageId = nm && getPackageJsonInfo(nm.packageDirectory, nm.subModuleName, failedLookupLocations, false, state).packageId;
1919919199
return withPackageId(packageId, resolvedFromFile);
1920019200
}
@@ -19211,8 +19211,8 @@ var ts;
1921119211
return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson);
1921219212
}
1921319213
var nodeModulesPathPart = "/node_modules/";
19214-
function parseNodeModuleFromPath(path) {
19215-
path = ts.normalizePath(path);
19214+
function parseNodeModuleFromPath(resolved) {
19215+
var path = ts.normalizePath(resolved.path);
1921619216
var idx = path.lastIndexOf(nodeModulesPathPart);
1921719217
if (idx === -1) {
1921819218
return undefined;
@@ -19223,16 +19223,24 @@ var ts;
1922319223
indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName);
1922419224
}
1922519225
var packageDirectory = path.slice(0, indexAfterPackageName);
19226-
var subModuleName = removeExtensionAndIndex(path.slice(indexAfterPackageName + 1));
19226+
var subModuleName = ts.removeExtension(path.slice(indexAfterPackageName + 1), resolved.ext) + ".d.ts";
1922719227
return { packageDirectory: packageDirectory, subModuleName: subModuleName };
1922819228
}
1922919229
function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) {
1923019230
var nextSeparatorIndex = path.indexOf(ts.directorySeparator, prevSeparatorIndex + 1);
1923119231
return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex;
1923219232
}
19233-
function removeExtensionAndIndex(path) {
19234-
var noExtension = ts.removeFileExtension(path);
19235-
return noExtension === "index" ? "" : ts.removeSuffix(noExtension, "/index");
19233+
function addExtensionAndIndex(path) {
19234+
if (path === "") {
19235+
return "index.d.ts";
19236+
}
19237+
if (ts.endsWith(path, ".d.ts")) {
19238+
return path;
19239+
}
19240+
if (ts.endsWith(path, "/index")) {
19241+
return path + ".d.ts";
19242+
}
19243+
return path + "/index.d.ts";
1923619244
}
1923719245
function directoryProbablyExists(directoryName, host) {
1923819246
return !host.directoryExists || host.directoryExists(directoryName);
@@ -19307,12 +19315,30 @@ var ts;
1930719315
var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host);
1930819316
return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state);
1930919317
}
19310-
function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, _a) {
19311-
var host = _a.host, traceEnabled = _a.traceEnabled;
19318+
function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, state) {
19319+
var host = state.host, traceEnabled = state.traceEnabled;
1931219320
var directoryExists = !onlyRecordFailures && directoryProbablyExists(nodeModuleDirectory, host);
1931319321
var packageJsonPath = pathToPackageJson(nodeModuleDirectory);
1931419322
if (directoryExists && host.fileExists(packageJsonPath)) {
1931519323
var packageJsonContent = readJson(packageJsonPath, host);
19324+
if (subModuleName === "") {
19325+
var path = tryReadPackageJsonFields(true, packageJsonContent, nodeModuleDirectory, state);
19326+
if (typeof path === "string") {
19327+
subModuleName = addExtensionAndIndex(path.substring(nodeModuleDirectory.length + 1));
19328+
}
19329+
else {
19330+
var jsPath = tryReadPackageJsonFields(false, packageJsonContent, nodeModuleDirectory, state);
19331+
if (typeof jsPath === "string") {
19332+
subModuleName = ts.removeExtension(ts.removeExtension(jsPath.substring(nodeModuleDirectory.length + 1), ".js"), ".jsx") + ".d.ts";
19333+
}
19334+
else {
19335+
subModuleName = "index.d.ts";
19336+
}
19337+
}
19338+
}
19339+
if (!ts.endsWith(subModuleName, ".d.ts")) {
19340+
subModuleName = addExtensionAndIndex(subModuleName);
19341+
}
1931619342
var packageId = typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string"
1931719343
? { name: packageJsonContent.name, subModuleName: subModuleName, version: packageJsonContent.version }
1931819344
: undefined;
@@ -60678,11 +60704,23 @@ var ts;
6067860704
if (options.noEmit) {
6067960705
return false;
6068060706
}
60681-
return ts.forEachEmittedFile(getEmitHost(), function (_a) {
60682-
var jsFilePath = _a.jsFilePath, declarationFilePath = _a.declarationFilePath;
60683-
return isSameFile(jsFilePath, file) ||
60684-
(declarationFilePath && isSameFile(declarationFilePath, file));
60685-
});
60707+
var filePath = toPath(file);
60708+
if (getSourceFileByPath(filePath)) {
60709+
return false;
60710+
}
60711+
var out = options.outFile || options.out;
60712+
if (out) {
60713+
return isSameFile(filePath, out) || isSameFile(filePath, ts.removeFileExtension(out) + ".d.ts");
60714+
}
60715+
if (options.outDir) {
60716+
return ts.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames());
60717+
}
60718+
if (ts.fileExtensionIsOneOf(filePath, ts.supportedJavascriptExtensions) || ts.fileExtensionIs(filePath, ".d.ts")) {
60719+
var filePathWithoutExtension = ts.removeFileExtension(filePath);
60720+
return !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".ts")) ||
60721+
!!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".tsx"));
60722+
}
60723+
return false;
6068660724
}
6068760725
function isSameFile(file1, file2) {
6068860726
return ts.comparePaths(file1, file2, currentDirectory, !host.useCaseSensitiveFileNames()) === 0;

lib/tsserver.js

Lines changed: 56 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5651,7 +5651,7 @@ var ts;
56515651
}
56525652
var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state);
56535653
if (resolvedFromFile) {
5654-
var nm = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile.path) : undefined;
5654+
var nm = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile) : undefined;
56555655
var packageId = nm && getPackageJsonInfo(nm.packageDirectory, nm.subModuleName, failedLookupLocations, false, state).packageId;
56565656
return withPackageId(packageId, resolvedFromFile);
56575657
}
@@ -5668,8 +5668,8 @@ var ts;
56685668
return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson);
56695669
}
56705670
var nodeModulesPathPart = "/node_modules/";
5671-
function parseNodeModuleFromPath(path) {
5672-
path = ts.normalizePath(path);
5671+
function parseNodeModuleFromPath(resolved) {
5672+
var path = ts.normalizePath(resolved.path);
56735673
var idx = path.lastIndexOf(nodeModulesPathPart);
56745674
if (idx === -1) {
56755675
return undefined;
@@ -5680,16 +5680,24 @@ var ts;
56805680
indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName);
56815681
}
56825682
var packageDirectory = path.slice(0, indexAfterPackageName);
5683-
var subModuleName = removeExtensionAndIndex(path.slice(indexAfterPackageName + 1));
5683+
var subModuleName = ts.removeExtension(path.slice(indexAfterPackageName + 1), resolved.ext) + ".d.ts";
56845684
return { packageDirectory: packageDirectory, subModuleName: subModuleName };
56855685
}
56865686
function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) {
56875687
var nextSeparatorIndex = path.indexOf(ts.directorySeparator, prevSeparatorIndex + 1);
56885688
return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex;
56895689
}
5690-
function removeExtensionAndIndex(path) {
5691-
var noExtension = ts.removeFileExtension(path);
5692-
return noExtension === "index" ? "" : ts.removeSuffix(noExtension, "/index");
5690+
function addExtensionAndIndex(path) {
5691+
if (path === "") {
5692+
return "index.d.ts";
5693+
}
5694+
if (ts.endsWith(path, ".d.ts")) {
5695+
return path;
5696+
}
5697+
if (ts.endsWith(path, "/index")) {
5698+
return path + ".d.ts";
5699+
}
5700+
return path + "/index.d.ts";
56935701
}
56945702
function directoryProbablyExists(directoryName, host) {
56955703
return !host.directoryExists || host.directoryExists(directoryName);
@@ -5764,12 +5772,30 @@ var ts;
57645772
var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host);
57655773
return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state);
57665774
}
5767-
function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, _a) {
5768-
var host = _a.host, traceEnabled = _a.traceEnabled;
5775+
function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, state) {
5776+
var host = state.host, traceEnabled = state.traceEnabled;
57695777
var directoryExists = !onlyRecordFailures && directoryProbablyExists(nodeModuleDirectory, host);
57705778
var packageJsonPath = pathToPackageJson(nodeModuleDirectory);
57715779
if (directoryExists && host.fileExists(packageJsonPath)) {
57725780
var packageJsonContent = readJson(packageJsonPath, host);
5781+
if (subModuleName === "") {
5782+
var path = tryReadPackageJsonFields(true, packageJsonContent, nodeModuleDirectory, state);
5783+
if (typeof path === "string") {
5784+
subModuleName = addExtensionAndIndex(path.substring(nodeModuleDirectory.length + 1));
5785+
}
5786+
else {
5787+
var jsPath = tryReadPackageJsonFields(false, packageJsonContent, nodeModuleDirectory, state);
5788+
if (typeof jsPath === "string") {
5789+
subModuleName = ts.removeExtension(ts.removeExtension(jsPath.substring(nodeModuleDirectory.length + 1), ".js"), ".jsx") + ".d.ts";
5790+
}
5791+
else {
5792+
subModuleName = "index.d.ts";
5793+
}
5794+
}
5795+
}
5796+
if (!ts.endsWith(subModuleName, ".d.ts")) {
5797+
subModuleName = addExtensionAndIndex(subModuleName);
5798+
}
57735799
var packageId = typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string"
57745800
? { name: packageJsonContent.name, subModuleName: subModuleName, version: packageJsonContent.version }
57755801
: undefined;
@@ -61990,11 +62016,23 @@ var ts;
6199062016
if (options.noEmit) {
6199162017
return false;
6199262018
}
61993-
return ts.forEachEmittedFile(getEmitHost(), function (_a) {
61994-
var jsFilePath = _a.jsFilePath, declarationFilePath = _a.declarationFilePath;
61995-
return isSameFile(jsFilePath, file) ||
61996-
(declarationFilePath && isSameFile(declarationFilePath, file));
61997-
});
62019+
var filePath = toPath(file);
62020+
if (getSourceFileByPath(filePath)) {
62021+
return false;
62022+
}
62023+
var out = options.outFile || options.out;
62024+
if (out) {
62025+
return isSameFile(filePath, out) || isSameFile(filePath, ts.removeFileExtension(out) + ".d.ts");
62026+
}
62027+
if (options.outDir) {
62028+
return ts.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames());
62029+
}
62030+
if (ts.fileExtensionIsOneOf(filePath, ts.supportedJavascriptExtensions) || ts.fileExtensionIs(filePath, ".d.ts")) {
62031+
var filePathWithoutExtension = ts.removeFileExtension(filePath);
62032+
return !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".ts")) ||
62033+
!!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".tsx"));
62034+
}
62035+
return false;
6199862036
}
6199962037
function isSameFile(file1, file2) {
6200062038
return ts.comparePaths(file1, file2, currentDirectory, !host.useCaseSensitiveFileNames()) === 0;
@@ -91753,7 +91791,8 @@ var ts;
9175391791
}
9175491792
var logger = createLogger();
9175591793
var sys = ts.sys;
91756-
var useWatchGuard = process.platform === "win32" && ts.getNodeMajorVersion() >= 4;
91794+
var nodeVersion = ts.getNodeMajorVersion();
91795+
var useWatchGuard = process.platform === "win32" && nodeVersion >= 4;
9175791796
var originalWatchDirectory = sys.watchDirectory.bind(sys);
9175891797
var noopWatcher = { close: ts.noop };
9175991798
function watchDirectorySwallowingException(path, callback, recursive) {
@@ -91889,8 +91928,9 @@ var ts;
9188991928
allowLocalPluginLoads: allowLocalPluginLoads
9189091929
};
9189191930
logger.info("Starting TS Server");
91892-
logger.info("Version: " + ts.versionMajorMinor);
91931+
logger.info("Version: " + ts.version);
9189391932
logger.info("Arguments: " + process.argv.join(" "));
91933+
logger.info("Platform: " + os.platform() + " NodeVersion: " + nodeVersion + " CaseSensitive: " + sys.useCaseSensitiveFileNames);
9189491934
var ioSession = new IOSession(options);
9189591935
process.on("uncaughtException", function (err) {
9189691936
ioSession.logError(err, "unknown");

0 commit comments

Comments
 (0)