It seems that Node.js (version v0.10.13) returns the command wrapped between (
and \n)
, here's a minimal example:
require('repl').start({
'eval': function (cmd, context, filename, callback) {
callback(null, cmd);
}
});
The behavior is the following:
$ node repl.js
> asd
'(asd\n)'
>
Why is that? If this feature is documented then I was not able to find it.
Also, if this is the intended behavior, is there a better solution than doing cmd = cmd.slice(1, -2);
?
The issue is already fixed (see commit 9ef9a9de from Aug 2013). Now only JSON expression is wrapped into parens.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With