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) {