Skip to content

Commit 523529c

Browse files
committed
Use isWatchSet to test for options.watch
1 parent f1f6317 commit 523529c

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ namespace ts {
658658
const start = new Date().getTime();
659659
ensureDirectoriesExist(getDirectoryPath(normalizePath(fileName)));
660660

661-
if (options.watch && sys.createHash && sys.getModifiedTime) {
661+
if (isWatchSet(options) && sys.createHash && sys.getModifiedTime) {
662662
writeFileIfUpdated(fileName, data, writeByteOrderMark);
663663
}
664664
else {

src/compiler/tsc.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,6 @@ namespace ts {
240240
return typeof JSON === "object" && typeof JSON.parse === "function";
241241
}
242242

243-
function isWatchSet(options: CompilerOptions) {
244-
// Firefox has Object.prototype.watch
245-
return options.watch && options.hasOwnProperty("watch");
246-
}
247-
248243
export function executeCommandLine(args: string[]): void {
249244
const commandLine = parseCommandLine(args);
250245
let configFileName: string; // Configuration file name (if any)

src/compiler/utilities.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,6 +2642,11 @@ namespace ts {
26422642
}
26432643
return carriageReturnLineFeed;
26442644
}
2645+
2646+
export function isWatchSet(options: CompilerOptions) {
2647+
// Firefox has Object.prototype.watch
2648+
return options.watch && options.hasOwnProperty("watch");
2649+
}
26452650
}
26462651

26472652
namespace ts {

0 commit comments

Comments
 (0)