diff --git a/lib/repl.js b/lib/repl.js index 29c6d0eb491..3e5f33a4718 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -883,6 +883,7 @@ function trimWhitespace(cmd) { if (matches && matches.length === 2) { return matches[1]; } + return ''; } diff --git a/test/simple/test-repl.js b/test/simple/test-repl.js index dccff9cf5db..6cf2aaaac30 100644 --- a/test/simple/test-repl.js +++ b/test/simple/test-repl.js @@ -152,7 +152,9 @@ function error_test() { { client: client_unix, send: 'npm install foobar', expect: expect_npm }, { client: client_unix, send: '(function () {\n\nreturn 1;\n})()', - expect: '1' } + expect: '1' }, + { client: client_unix, send: '{\n\na: 1\n}', + expect: '{ a: 1 }' } ]); }