Skip to content

Commit

Permalink
try/catch no longer necessary, syntax-error catches that now
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Aug 2, 2012
1 parent 286cd92 commit 62b7662
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions lib/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,18 @@ function reg (self, w, opts, body, file) {
pending = setTimeout(function () {
pending = null;
// modified
try {
if (w[type][file]) {
w.reload(file);
}
else if (type === 'entries') {
w.addEntry(file);
}
else if (type === 'files') {
w.require(file);
}

w._cache = null;
self.emit('bundle');
if (w[type][file]) {
w.reload(file);
}
catch (e) {
self.emit('syntaxError', e);
if (self.listeners('syntaxError').length === 0) {
console.error(e && e.stack || e);
}
else if (type === 'entries') {
w.addEntry(file);
}
else if (type === 'files') {
w.require(file);
}

w._cache = null;
self.emit('bundle');
}, 100);
}
else if (event === 'rename') {
Expand Down

0 comments on commit 62b7662

Please sign in to comment.