Skip to content
Browse files

Merge branch 'rewatch2'

  • Loading branch information...
2 parents 4944fba + e5f3750 commit 21a499c726191edb93c6809fe1e05e52aba4c816 @TrevorBurnham TrevorBurnham committed Dec 22, 2011
Showing with 14 additions and 21 deletions.
  1. +8 −12 lib/coffee-script/command.js
  2. +6 −9 src/command.coffee
View
20 lib/coffee-script/command.js
@@ -195,23 +195,19 @@
};
watch = function(source, base) {
- var compile, compileTimeout, prevStats, rewatch, rewatchTimeout, watchErr, watcher;
+ var compile, compileTimeout, prevStats, rewatch, watchErr, watcher;
prevStats = null;
compileTimeout = null;
- rewatchTimeout = null;
watchErr = function(e) {
if (e.code === 'ENOENT') {
if (sources.indexOf(source) === -1) return;
- clearTimeout(rewatchTimeout);
- return rewatchTimeout = wait(25, function() {
- try {
- rewatch();
- return compile();
- } catch (e) {
- removeSource(source, base, true);
- return compileJoin();
- }
- });
+ try {
+ rewatch();
+ return compile();
+ } catch (e) {
+ removeSource(source, base, true);
+ return compileJoin();
+ }
} else {
throw e;
}
View
15 src/command.coffee
@@ -174,19 +174,16 @@ watch = (source, base) ->
prevStats = null
compileTimeout = null
- rewatchTimeout = null
watchErr = (e) ->
if e.code is 'ENOENT'
return if sources.indexOf(source) is -1
- clearTimeout rewatchTimeout
- rewatchTimeout = wait 25, ->
- try
- rewatch()
- compile()
- catch e
- removeSource source, base, yes
- compileJoin()
+ try
+ rewatch()
+ compile()
+ catch e
+ removeSource source, base, yes
+ compileJoin()
else throw e
rewatch = ->

0 comments on commit 21a499c

Please sign in to comment.
Something went wrong with that request. Please try again.