From cb69c8a717820c9873170e55108dab77f8a086bf Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 14 Mar 2023 21:26:18 +0000 Subject: [PATCH] Update LKG --- lib/tsc.js | 18 +----------------- lib/tsserver.js | 26 +++----------------------- lib/tsserverlibrary.d.ts | 1 - lib/tsserverlibrary.js | 20 +------------------- lib/typescript.d.ts | 1 - lib/typescript.js | 19 +------------------ lib/typingsInstaller.js | 18 +----------------- 7 files changed, 7 insertions(+), 96 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index 455e89ea50e..4cc491cdfb3 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -4915,20 +4915,6 @@ function patchWriteFileEnsuringDirectory(sys2) { (path2) => sys2.directoryExists(path2) ); } -function getNodeMajorVersion() { - if (typeof process === "undefined") { - return void 0; - } - const version2 = process.version; - if (!version2) { - return void 0; - } - const dot = version2.indexOf("."); - if (dot === -1) { - return void 0; - } - return parseInt(version2.substring(1, dot)); -} var sys = (() => { const byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { @@ -4945,14 +4931,12 @@ var sys = (() => { let activeSession; let profilePath = "./profile.cpuprofile"; const Buffer2 = require("buffer").Buffer; - const nodeVersion = getNodeMajorVersion(); - const isNode4OrLater = nodeVersion >= 4; const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; const platform = _os.platform(); const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; - const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin"; const getCurrentDirectory = memoize(() => process.cwd()); const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({ pollingWatchFileWorker: fsWatchFileWorker, diff --git a/lib/tsserver.js b/lib/tsserver.js index 95cf3dfd186..6727606fbd6 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -884,7 +884,6 @@ __export(server_exports, { getNodeForGeneratedName: () => getNodeForGeneratedName, getNodeId: () => getNodeId, getNodeKind: () => getNodeKind, - getNodeMajorVersion: () => getNodeMajorVersion, getNodeModifiers: () => getNodeModifiers, getNodeModulePathParts: () => getNodeModulePathParts, getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, @@ -8356,20 +8355,6 @@ function patchWriteFileEnsuringDirectory(sys2) { (path2) => sys2.directoryExists(path2) ); } -function getNodeMajorVersion() { - if (typeof process === "undefined") { - return void 0; - } - const version2 = process.version; - if (!version2) { - return void 0; - } - const dot = version2.indexOf("."); - if (dot === -1) { - return void 0; - } - return parseInt(version2.substring(1, dot)); -} var sys = (() => { const byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { @@ -8386,14 +8371,12 @@ var sys = (() => { let activeSession; let profilePath = "./profile.cpuprofile"; const Buffer2 = require("buffer").Buffer; - const nodeVersion = getNodeMajorVersion(); - const isNode4OrLater = nodeVersion >= 4; const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; const platform = _os.platform(); const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; - const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin"; const getCurrentDirectory = memoize(() => process.cwd()); const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({ pollingWatchFileWorker: fsWatchFileWorker, @@ -168595,7 +168578,6 @@ __export(ts_exports3, { getNodeForGeneratedName: () => getNodeForGeneratedName, getNodeId: () => getNodeId, getNodeKind: () => getNodeKind, - getNodeMajorVersion: () => getNodeMajorVersion, getNodeModifiers: () => getNodeModifiers, getNodeModulePathParts: () => getNodeModulePathParts, getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, @@ -181109,8 +181091,7 @@ function initializeNodeSystem() { } } const libDirectory = getDirectoryPath(normalizePath(sys2.getExecutingFilePath())); - const nodeVersion = getNodeMajorVersion(); - const useWatchGuard = process.platform === "win32" && nodeVersion >= 4; + const useWatchGuard = process.platform === "win32"; const originalWatchDirectory = sys2.watchDirectory.bind(sys2); const logger = createLogger(); Debug.loggingHost = { @@ -181665,7 +181646,7 @@ function start({ args, logger, cancellationToken, serverMode, unknownServerMode, logger.info(`Starting TS Server`); logger.info(`Version: ${version}`); logger.info(`Arguments: ${args.join(" ")}`); - logger.info(`Platform: ${platform} NodeVersion: ${getNodeMajorVersion()} CaseSensitive: ${sys.useCaseSensitiveFileNames}`); + logger.info(`Platform: ${platform} NodeVersion: ${process.version} CaseSensitive: ${sys.useCaseSensitiveFileNames}`); logger.info(`ServerMode: ${serverMode} hasUnknownServerMode: ${unknownServerMode}`); setStackTraceLimit(); if (Debug.isDebugging) { @@ -182544,7 +182525,6 @@ start(initializeNodeSystem(), require("os").platform()); getNodeForGeneratedName, getNodeId, getNodeKind, - getNodeMajorVersion, getNodeModifiers, getNodeModulePathParts, getNonAssignedNameOfDeclaration, diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index f23fc06fcc2..c77ba617e36 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -8286,7 +8286,6 @@ declare namespace ts { negative: boolean; base10Value: string; } - function getNodeMajorVersion(): number | undefined; enum FileWatcherEventKind { Created = 0, Changed = 1, diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 6ee07994a3c..8bc15d4f5b8 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -6137,20 +6137,6 @@ ${lanes.join("\n")} (path2) => sys2.directoryExists(path2) ); } - function getNodeMajorVersion() { - if (typeof process === "undefined") { - return void 0; - } - const version2 = process.version; - if (!version2) { - return void 0; - } - const dot = version2.indexOf("."); - if (dot === -1) { - return void 0; - } - return parseInt(version2.substring(1, dot)); - } function setSys(s) { sys = s; } @@ -6198,14 +6184,12 @@ ${lanes.join("\n")} let activeSession; let profilePath = "./profile.cpuprofile"; const Buffer2 = require("buffer").Buffer; - const nodeVersion = getNodeMajorVersion(); - const isNode4OrLater = nodeVersion >= 4; const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; const platform = _os.platform(); const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; - const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin"; const getCurrentDirectory = memoize(() => process.cwd()); const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({ pollingWatchFileWorker: fsWatchFileWorker, @@ -179181,7 +179165,6 @@ ${e.message}`; getNodeForGeneratedName: () => getNodeForGeneratedName, getNodeId: () => getNodeId, getNodeKind: () => getNodeKind, - getNodeMajorVersion: () => getNodeMajorVersion, getNodeModifiers: () => getNodeModifiers, getNodeModulePathParts: () => getNodeModulePathParts, getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, @@ -181540,7 +181523,6 @@ ${e.message}`; getNodeForGeneratedName: () => getNodeForGeneratedName, getNodeId: () => getNodeId, getNodeKind: () => getNodeKind, - getNodeMajorVersion: () => getNodeMajorVersion, getNodeModifiers: () => getNodeModifiers, getNodeModulePathParts: () => getNodeModulePathParts, getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 4b06d971712..374e65ab49e 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -4311,7 +4311,6 @@ declare namespace ts { negative: boolean; base10Value: string; } - function getNodeMajorVersion(): number | undefined; enum FileWatcherEventKind { Created = 0, Changed = 1, diff --git a/lib/typescript.js b/lib/typescript.js index 463d1822326..c74ab926d76 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -6137,20 +6137,6 @@ ${lanes.join("\n")} (path2) => sys2.directoryExists(path2) ); } - function getNodeMajorVersion() { - if (typeof process === "undefined") { - return void 0; - } - const version2 = process.version; - if (!version2) { - return void 0; - } - const dot = version2.indexOf("."); - if (dot === -1) { - return void 0; - } - return parseInt(version2.substring(1, dot)); - } function setSys(s) { sys = s; } @@ -6198,14 +6184,12 @@ ${lanes.join("\n")} let activeSession; let profilePath = "./profile.cpuprofile"; const Buffer2 = require("buffer").Buffer; - const nodeVersion = getNodeMajorVersion(); - const isNode4OrLater = nodeVersion >= 4; const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; const platform = _os.platform(); const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; - const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin"; const getCurrentDirectory = memoize(() => process.cwd()); const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({ pollingWatchFileWorker: fsWatchFileWorker, @@ -168362,7 +168346,6 @@ ${options.prefix}` : "\n" : options.prefix getNodeForGeneratedName: () => getNodeForGeneratedName, getNodeId: () => getNodeId, getNodeKind: () => getNodeKind, - getNodeMajorVersion: () => getNodeMajorVersion, getNodeModifiers: () => getNodeModifiers, getNodeModulePathParts: () => getNodeModulePathParts, getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index c2e6ea1276b..1f8713008fa 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -4349,20 +4349,6 @@ function patchWriteFileEnsuringDirectory(sys2) { (path3) => sys2.directoryExists(path3) ); } -function getNodeMajorVersion() { - if (typeof process === "undefined") { - return void 0; - } - const version2 = process.version; - if (!version2) { - return void 0; - } - const dot = version2.indexOf("."); - if (dot === -1) { - return void 0; - } - return parseInt(version2.substring(1, dot)); -} var sys = (() => { const byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { @@ -4379,14 +4365,12 @@ var sys = (() => { let activeSession; let profilePath = "./profile.cpuprofile"; const Buffer2 = require("buffer").Buffer; - const nodeVersion = getNodeMajorVersion(); - const isNode4OrLater = nodeVersion >= 4; const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; const platform = _os.platform(); const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; - const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin"; const getCurrentDirectory = memoize(() => process.cwd()); const { watchFile, watchDirectory } = createSystemWatchFunctions({ pollingWatchFileWorker: fsWatchFileWorker,