mirror of https://github.com/nodejs/node.git
repl: fix passing an empty line inserting "undefined" into the buffer
There was a possiblity of insering the string "undefined" into the repl's command buffer, which would cause interesting results while evaluating.pull/24503/head
parent
6a11f3edf4
commit
9126dd2d90
|
@ -883,6 +883,7 @@ function trimWhitespace(cmd) {
|
|||
if (matches && matches.length === 2) {
|
||||
return matches[1];
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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 }' }
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue