Don't use _fs.realpathSync.native on windows, a semi-revert of #41292 (#43348)

We're planning a real fix for TS 4.3, but port the workaround from 4.2
so the beta doesn't have this bug.

(cherry picked from commit e462dfa347)
This commit is contained in:
Orta Therox
2021-03-25 16:16:37 -07:00
committed by Andrew Casey
parent 3db6d803d5
commit d12ae0fb2e
+2 -1
View File
@@ -1265,7 +1265,6 @@ namespace ts {
let activeSession: import("inspector").Session | "stopping" | undefined;
let profilePath = "./profile.cpuprofile";
const realpathSync = _fs.realpathSync.native ?? _fs.realpathSync;
const Buffer: {
new (input: string, encoding?: string): any;
@@ -1278,6 +1277,8 @@ namespace ts {
const platform: string = _os.platform();
const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
const realpathSync = useCaseSensitiveFileNames ? _fs.realpathSync : (_fs.realpathSync.native ?? _fs.realpathSync);
const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
const getCurrentDirectory = memoize(() => process.cwd());
const { watchFile, watchDirectory } = createSystemWatchFunctions({