Browse Source

repl: don't eval twice when an Error is thrown

Nathan Rajlich 14 years ago
committed by Ben Noordhuis
parent
commit
cf24f561a3
  1. 4
      lib/repl.js

4
lib/repl.js

@ -160,8 +160,12 @@ function REPLServer(prompt, stream) {
'repl');
if (typeof ret !== 'function') success = true;
} catch (e) {
if (!(e && e.constructor && e.constructor.name === 'SyntaxError')) {
throw e;
} else {
success = false;
}
}
if (!success) {
// Now as statement without parens.

Loading…
Cancel
Save