Use isWatchSet to test for options.watch

This commit is contained in:
Mohamed Hegazy
2016-04-04 14:51:16 -07:00
parent f1f6317a59
commit 523529cc55
3 changed files with 6 additions and 6 deletions

View File

@@ -658,7 +658,7 @@ namespace ts {
const start = new Date().getTime();
ensureDirectoriesExist(getDirectoryPath(normalizePath(fileName)));
if (options.watch && sys.createHash && sys.getModifiedTime) {
if (isWatchSet(options) && sys.createHash && sys.getModifiedTime) {
writeFileIfUpdated(fileName, data, writeByteOrderMark);
}
else {

View File

@@ -240,11 +240,6 @@ namespace ts {
return typeof JSON === "object" && typeof JSON.parse === "function";
}
function isWatchSet(options: CompilerOptions) {
// Firefox has Object.prototype.watch
return options.watch && options.hasOwnProperty("watch");
}
export function executeCommandLine(args: string[]): void {
const commandLine = parseCommandLine(args);
let configFileName: string; // Configuration file name (if any)

View File

@@ -2642,6 +2642,11 @@ namespace ts {
}
return carriageReturnLineFeed;
}
export function isWatchSet(options: CompilerOptions) {
// Firefox has Object.prototype.watch
return options.watch && options.hasOwnProperty("watch");
}
}
namespace ts {