You should be able to test with
git clone git://github.com/smparkes/johnson.git
cd johnson
git submodule update --init
rake
That will build and run the tests.
You can also install it as a gem off gemcutter as smparkes.johnson
(RIP github gems ...)
To run the CLI, just use "johnson" as you normally would. That will
give you spidermonkey.
To get tracemonkey, I use "ruby -Ilib -rjohnson/tracemonkey bin/
johnson" from the build directory.
I thought "ruby -rrubygems -rjohnson/tracemonkey -S johnson" should
work, but it doesn't. Evidently -r is handled where rubygems can't
touch it?
In a script, all you have to do is require 'johnson/tracemonkey'
before creating a runtime and it will create a TM runtime.
I checked a configure script into vendor/tracemonkey, so you don't
need to have autconf to do the build. If you want to test with
autoconf, remove configure (and Makefile, if you ran configure) in
vendor/tracemonkey.
It pulls tracemonkey from my gh repo. This is a slightly modified
version of moz's hg. The code is the same (and available on another
branch in my gh repo) but the layout and build stuff have been tweaked
a bit so that the build actually works (at least for me). I took all
the changes from the 1.9.2 and central moz repos, so these changes are
backports (and are only build artifacts, the code is straight
Gecko1.9.1/FF3.5).
I've tested on x86_64-pc-linux-gnu, x86_64-apple-darwin10, and i686-
apple-darwin9. In each case, I tested three times: with the supplied
configure, running autoconf myself, and by installing the gem. It
handles the names for autoconf that my systems use.
For those that care about the AST, there aren't many changes. A few
tests got updated because TM does some constant folding that SM
doesn't, so I made the tests allow either the literal or folded case.
Name nodes have a special case that's now understood.
The biggest change on the moz side that I came across is that
functions have a few different ways they're represented, apparently
depending on the arg list. The tests hit at least one of these cases,
and I worked through getting the body list from where it gets stuck.
But I ignore the args that show up there ... I'm not really sure what
they represent. The tests pass w/o them, so either they're an internal
artifact, or the tests don't cover the corner case where they show up.
At this point, I let it ride ...
cheers