bill wrote:
Is there a nice interactive JavaScript interpreter, analogous to
Python's or Perl's (perldb)? I'm looking for something for Linux,
and that supports readline. I want to be able to try out small
snippets of JavaScript code without having to rely on a browser.
If you download a Mozilla zip build from
http://www.mozilla.org/ you get
the XPCOM shell (xpcshell) I think (I have it here under Windows, hope
they build on LINUX too), it is interactive and allows you to run
scripts using Spidermonkey, the JavaScript engine of Mozilla. Example:
js> var a = ["Kibology", "for", "all"];
js> a.join(" ")
Kibology for all
js>
I don't think however it has any readline.
You can also get the source of Spidermonkey from
http://www.mozilla.org/
and build it, it also has a shell I think.
But of course you need to be aware that most scripting you do in a HTML
page in a browser depends on host objects like window, document,
HTMLElement etc. that are not implemented in the script engine and are
therefore not available in the shell.
--
Martin Honnen
http://JavaScript.FAQTs.com/