Some bugs using shell mode

7 views
Skip to first unread message

Nicolas Pelletier

unread,
Jun 22, 2010, 2:03:03 PM6/22/10
to nod...@googlegroups.com
Hello,

I found some bugs when I use node as a shell:
  - const keyword does not works
  - the line wrapper bugs on a multi lines command (+ some bindkeys are missing)

Regards

--
Nicolas Pelletier
Epitech 2011

Isaac Schlueter

unread,
Jun 22, 2010, 4:45:16 PM6/22/10
to nod...@googlegroups.com
Const actually works fine:

node> const foo = "bar"; var foo = "baz"
TypeError: var 'foo' has already been declared
at repl:1:1
at Interface.<anonymous> (repl:74:19)
at Interface.emit (events:25:26)
at Interface._ttyWrite (readline:178:12)
at Interface.write (readline:119:27)
at Stream.<anonymous> (repl:55:9)
at Stream.emit (events:25:26)
at IOWatcher.callback (net:510:16)
at node.js:221:9

If you're running it across multiple commands, then the const-ness
gets lost because each line of repl script is being run in a sandboxed
global.

For the key bindings, I highly recommend using rlwrap instead of
node's readline.js, if you want fancy features.

alias js='NODE_NO_READLINE=1 rlwrap node'

And then you can put whatever you want in your ~/.inputrc

--i

> --
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en.
>

Reply all
Reply to author
Forward
0 new messages