[安裝] Debian 已經有套件 - spidermonkey-bin
$ sudo apt-get install spidermonkey-bin
$ dpkg -L spidermonkey-bin
$ smjs
js> help()
JavaScript-C 1.8.0 pre-release 1 2007-10-03
Command Description
======= ===========
version([number]) Get or set JavaScript version number
options([option ...]) Get or toggle JavaScript options
load(['foo.js' ...]) Load files named by string arguments
readline() Read a single line from stdin
print([exp ...]) Evaluate and print expressions
help([name ...]) Display usage and help messages
quit() Quit the shell
gc() Run the garbage collector
gcparam(name, value)
Wrapper for JS_SetGCParameter. The name must be either 'maxBytes' or
'maxMallocBytes' and the value must be convertable to a positive uint32
countHeap([start[, kind]])
Count the number of live GC things in the heap or things reachable from
start when it is given and is not null. kind is either 'all' (default) to
count all things or one of 'object', 'double', 'string', 'function',
'qname', 'namespace', 'xml' to count only things of that kind
trap([fun, [pc,]] exp) Trap bytecode execution
untrap(fun[, pc]) Remove a trap
line2pc([fun,] line) Map line number to PC
pc2line(fun[, pc]) Map PC to line number
stackQuota([number]) Query/set script stack quota
stringsAreUTF8() Check if strings are UTF-8 encoded
testUTF8(mode) Perform UTF-8 tests (modes are 1 to 4)
throwError() Throw an error from JS_ReportError
build() Show build date and time
clear([obj]) Clear properties of object
intern(str) Internalize str in the atom table
clone(fun[, scope]) Clone function object
seal(obj[, deep]) Seal object, or object graph if deep
getpda(obj) Get the property descriptors for obj
getslx(obj) Get script line extent
toint32(n) Testing hook for JS_ValueToInt32
evalcx(s[, o])
Evaluate s in optional sandbox object o
if (s == '' && !o) return new o with eager standard classes
if (s == 'lazy' && !o) return new o with lazy standard classes
sleep(dt) Sleep for dt seconds
scatter(fns) Call functions concurrently (ignoring errors)
js>