Skip to content

Commit 9d1cc31

Browse files
committed
Merge pull request microsoft#6074 from Microsoft/supportChakra
make ChakraHost more generally usefull
2 parents 7e5b83c + 2749373 commit 9d1cc31

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 () {
@@ -469,9 +473,9 @@ namespace ts {
469473
function getChakraSystem(): System {
470474

471475
return {
472-
newLine: "\r\n",
476+
newLine: ChakraHost.newLine || "\r\n",
473477
args: ChakraHost.args,
474-
useCaseSensitiveFileNames: false,
478+
useCaseSensitiveFileNames: !!ChakraHost.useCaseSensitiveFileNames,
475479
write: ChakraHost.echo,
476480
readFile(path: string, encoding?: string) {
477481
// encoding is automatically handled by the implementation in ChakraHost

0 commit comments

Comments
 (0)