aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2012-11-10 18:21:13 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2012-11-10 18:21:17 +0100
commitb6e989759bfcfdc00d9d4b5a3b32d31ea29838c0 (patch)
treeaa120795f3bb257e5310a4e6b83681afcec43ee4 /lib
parent13c5db977190f926a213fc8ad7204e1febe36009 (diff)
downloadandroid-node-v8-b6e989759bfcfdc00d9d4b5a3b32d31ea29838c0.tar.gz
android-node-v8-b6e989759bfcfdc00d9d4b5a3b32d31ea29838c0.tar.bz2
android-node-v8-b6e989759bfcfdc00d9d4b5a3b32d31ea29838c0.zip
repl: don't interpret floating point numbers
Don't interpret floating point numbers, e.g. ".1234", as REPL commands. Fixes #4268.
Diffstat (limited to 'lib')
-rw-r--r--lib/repl.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/repl.js b/lib/repl.js
index 624a09c182..55df83f970 100644
--- a/lib/repl.js
+++ b/lib/repl.js
@@ -206,7 +206,7 @@ function REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined) {
// 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];