mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 10:41:56 -05:00
Use isWatchSet to test for options.watch
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user