Permalink
Browse files

Don't eval in the REPL twice when an Error is thrown.

  • Loading branch information...
1 parent 84cf0c5 commit 6ffac27700802ab6fac1a1dd6b33fc0ee04b89fb @TooTallNate committed Sep 1, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/repl.js
View
6 lib/repl.js
@@ -160,7 +160,11 @@ function REPLServer(prompt, stream) {
'repl');
if (typeof ret !== 'function') success = true;
} catch (e) {
- success = false;
+ if (!(e && e.constructor && e.constructor.name === 'SyntaxError')) {
@bnoordhuis
bnoordhuis Sep 1, 2011

Why not just e instanceof SyntaxError?

+ throw e;
+ } else {
+ success = false;
+ }
}
if (!success) {

0 comments on commit 6ffac27

Please sign in to comment.