diff --git a/lib/tsc.js b/lib/tsc.js index 322dbf45aff..4b1b071249c 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -1044,9 +1044,6 @@ var ts; readFile: readFile, writeFile: writeFile, watchFile: function (fileName, callback) { - if (isNode4OrLater()) { - return _fs.watch(fileName, function (eventName, relativeFileName) { return callback(fileName); }); - } var watchedFile = watchedFileSet.addFile(fileName, callback); return { close: function () { return watchedFileSet.removeFile(watchedFile); } diff --git a/lib/tsserver.js b/lib/tsserver.js index d744b47c9ce..54aecc8f058 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -1044,9 +1044,6 @@ var ts; readFile: readFile, writeFile: writeFile, watchFile: function (fileName, callback) { - if (isNode4OrLater()) { - return _fs.watch(fileName, function (eventName, relativeFileName) { return callback(fileName); }); - } var watchedFile = watchedFileSet.addFile(fileName, callback); return { close: function () { return watchedFileSet.removeFile(watchedFile); } diff --git a/lib/typescript.js b/lib/typescript.js index ad673013824..80502f322ff 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -1947,10 +1947,6 @@ var ts; // and is more efficient than `fs.watchFile` (ref: https://github.com/nodejs/node/pull/2649 // and https://github.com/Microsoft/TypeScript/issues/4643), therefore // if the current node.js version is newer than 4, use `fs.watch` instead. - if (isNode4OrLater()) { - // Note: in node the callback of fs.watch is given only the relative file name as a parameter - return _fs.watch(fileName, function (eventName, relativeFileName) { return callback(fileName); }); - } var watchedFile = watchedFileSet.addFile(fileName, callback); return { close: function () { return watchedFileSet.removeFile(watchedFile); } diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index ad673013824..80502f322ff 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -1947,10 +1947,6 @@ var ts; // and is more efficient than `fs.watchFile` (ref: https://github.com/nodejs/node/pull/2649 // and https://github.com/Microsoft/TypeScript/issues/4643), therefore // if the current node.js version is newer than 4, use `fs.watch` instead. - if (isNode4OrLater()) { - // Note: in node the callback of fs.watch is given only the relative file name as a parameter - return _fs.watch(fileName, function (eventName, relativeFileName) { return callback(fileName); }); - } var watchedFile = watchedFileSet.addFile(fileName, callback); return { close: function () { return watchedFileSet.removeFile(watchedFile); }