My GSoC mentor recommended I get the TraceMonkey code, so that I could refer to the existing es5 features in TraceMonkey as we implement them in Rhino. Here’s the low-down on what I needed to do to get TraceMonkey going on a Mac.
I got most of my info from here.
Install the pre-requisites
First make sure you have all the build prerequisites.
Get the source
Download the source with:
$ hg clone http://hg.mozilla.org/tracemonkey/
I’d actually already done this a while ago, so I could do a
pull instead of a
$ hg pull
$ hg update
Build the source
I had more than one gcc installed, so I needed to do
$ sudo gcc_select gcc40
$ cd js/src $ autoconf213 $ ./configure $ make $ echo 'print("sweet, it works!")' | js
Test the source
(This step requires perl)
So, a quick test of the ecmascript 5 (previously called ecmascript 3.1) functionality implemented so far.
$ cd ../test $ ./jsDriver.pl -l ecma_3_1 -k -e smopt -s ../src/shell/js
Boom! It looks like regex's are not currently fully unicode-enabled yet. Okay.
Use the source (Luke)
I set up a symlink to keep the TraceMonkey shell nice and handy (as
tm) on my travels around other parts of the file system.
$ cd ../src $ ln -s `pwd`/shell/js ~/bin/tm
Well actually we're using the binary rather than the source here, but it didn't have quite the same ring to it...