From cf24f561a34a12d527560765e34244ad3cffb22e Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Wed, 31 Aug 2011 17:58:00 -0700 Subject: [PATCH] repl: don't eval twice when an Error is thrown --- lib/repl.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/repl.js b/lib/repl.js index 252d52df091..93b412ea64d 100644 --- a/lib/repl.js +++ b/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')) { + throw e; + } else { + success = false; + } } if (!success) {