repl: don't eval twice when an Error is thrown
This commit is contained in:
parent
84cf0c5280
commit
cf24f561a3
@ -160,8 +160,12 @@ function REPLServer(prompt, stream) {
|
|||||||
'repl');
|
'repl');
|
||||||
if (typeof ret !== 'function') success = true;
|
if (typeof ret !== 'function') success = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
if (!(e && e.constructor && e.constructor.name === 'SyntaxError')) {
|
||||||
|
throw e;
|
||||||
|
} else {
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
// Now as statement without parens.
|
// Now as statement without parens.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user