Skip to content

Commit

Permalink
Port realpath workaround from release-4.2 (#43384)
Browse files Browse the repository at this point in the history
* 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 e462dfa)

* Un-reverse condition

Co-authored-by: Orta Therox <ortam@microsoft.com>
  • Loading branch information
amcasey and Orta Therox committed Mar 26, 2021
1 parent 3db6d80 commit 6066eae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compiler/sys.ts
Expand Up @@ -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;
Expand All @@ -1278,6 +1277,8 @@ namespace ts {

const platform: string = _os.platform();
const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
const realpathSync = useCaseSensitiveFileNames ? (_fs.realpathSync.native ?? _fs.realpathSync) : _fs.realpathSync;

const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
const getCurrentDirectory = memoize(() => process.cwd());
const { watchFile, watchDirectory } = createSystemWatchFunctions({
Expand Down

0 comments on commit 6066eae

Please sign in to comment.