Don't interpret floating point numbers, e.g. ".1234", as REPL commands.
Fixes #4268.
// Check to see if a REPL keyword was used. If it returns true,
// display next prompt and return.
- if (cmd && cmd.charAt(0) === '.') {
+ if (cmd && cmd.charAt(0) === '.' && cmd != parseFloat(cmd)) {
var matches = cmd.match(/^(\.[^\s]+)\s*(.*)$/);
var keyword = matches && matches[1];
var rest = matches && matches[2];
// You can recover with the .break command
{ client: client_unix, send: '.break',
expect: prompt_unix },
+ // Floating point numbers are not interpreted as REPL commands.
+ { client: client_unix, send: '.1234',
+ expect: '0.1234' },
// Can parse valid JSON
{ client: client_unix, send: 'JSON.parse(\'{"valid": "json"}\');',
expect: '{ valid: \'json\' }'},