Skip to content

Commit 0c365da

Browse files
author
Paul van Brenk
committed
make ChakraHost more generally usefull
1 parent dfb32c5 commit 0c365da

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/compiler/sys.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ namespace ts {
5151
args: string[];
5252
currentDirectory: string;
5353
executingFile: string;
54+
newLine?: string;
55+
useCaseSensitiveFileNames?: boolean;
5456
echo(s: string): void;
5557
quit(exitCode?: number): void;
5658
fileExists(path: string): boolean;
@@ -60,6 +62,8 @@ namespace ts {
6062
readFile(path: string): string;
6163
writeFile(path: string, contents: string): void;
6264
readDirectory(path: string, extension?: string, exclude?: string[]): string[];
65+
watchFile?(path: string, callback: (path: string, removed?: boolean) => void): FileWatcher;
66+
watchDirectory?(path: string, callback: (path: string) => void, recursive?: boolean): FileWatcher;
6367
};
6468

6569
export var sys: System = (function () {
@@ -474,9 +478,9 @@ namespace ts {
474478
function getChakraSystem(): System {
475479

476480
return {
477-
newLine: "\r\n",
481+
newLine: ChakraHost.newLine || "\r\n",
478482
args: ChakraHost.args,
479-
useCaseSensitiveFileNames: false,
483+
useCaseSensitiveFileNames: !!ChakraHost.useCaseSensitiveFileNames,
480484
write: ChakraHost.echo,
481485
readFile(path: string, encoding?: string) {
482486
// encoding is automatically handled by the implementation in ChakraHost

0 commit comments

Comments
 (0)