From 91023227e49c6757522c826f6a4fbaeb61693252 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 31 Jul 2014 21:58:05 -0700 Subject: [PATCH] Changed watchFile callback behavior. We no longer recompile unless the new last-modified time is more recent. --- src/compiler/sys.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index ce31988b504..03d517476cd 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -199,7 +199,11 @@ var sys: System = (function () { close() { _fs.unwatchFile(fileName, fileChanged); } }; - function fileChanged() { + function fileChanged(curr:any, prev:any) { + if (+curr.mtime <= +prev.mtime) { + return; + } + callback(fileName); }; },