Skip to content

Commit 16a8abd

Browse files
committed
Remove old references to Node v4
1 parent d681520 commit 16a8abd

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/compiler/sys.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,8 +1492,6 @@ export let sys: System = (() => {
14921492
from?(input: string, encoding?: string): any;
14931493
} = require("buffer").Buffer;
14941494

1495-
const nodeVersion = getNodeMajorVersion();
1496-
const isNode4OrLater = nodeVersion! >= 4;
14971495
const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
14981496

14991497
const platform: string = _os.platform();
@@ -1507,7 +1505,7 @@ export let sys: System = (() => {
15071505
// Note that if we ever emit as files like cjs/mjs, this check will be wrong.
15081506
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
15091507

1510-
const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
1508+
const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
15111509
const getCurrentDirectory = memoize(() => process.cwd());
15121510
const { watchFile, watchDirectory } = createSystemWatchFunctions({
15131511
pollingWatchFileWorker: fsWatchFileWorker,

src/tsserver/nodeServer.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
DirectoryWatcherCallback,
1212
FileWatcher,
1313
getDirectoryPath,
14-
getNodeMajorVersion,
1514
getRootLength,
1615
JsTyping,
1716
LanguageServiceMode,
@@ -299,9 +298,7 @@ export function initializeNodeSystem(): StartInput {
299298

300299
const libDirectory = getDirectoryPath(normalizePath(sys.getExecutingFilePath()));
301300

302-
const nodeVersion = getNodeMajorVersion();
303-
// use watchGuard process on Windows when node version is 4 or later
304-
const useWatchGuard = process.platform === "win32" && nodeVersion! >= 4;
301+
const useWatchGuard = process.platform === "win32";
305302
const originalWatchDirectory: ServerHost["watchDirectory"] = sys.watchDirectory.bind(sys);
306303
const logger = createLogger();
307304

0 commit comments

Comments
 (0)