Getting SpiderMonkey source code 编辑

You can get the SpiderMonkey source code in gzipped form or directly from the Mercurial repository.

Downloading gzipped SpiderMonkey source code

You can download gzipped SpiderMonkey source code from the following URLs:

http://ftp.mozilla.org/pub/spidermonkey/releases/
http://ftp.mozilla.org/pub/spidermonkey/prereleases/

Here is a command-line example of downloading and unzipping SpiderMonkey source code version 59.0:

mkdir mozilla
cd mozilla
wget http://ftp.mozilla.org/pub/spidermonkey/prereleases/59/pre1/mozjs-59.0a1.0.tar.bz2
tar xvf mozjs-59.0a1.0.tar.bz2

These commands should work on most platforms including Windows, as long as on Windows you are using the MozillaBuild bash shell.

Getting the latest SpiderMonkey source code from Mercurial

The Mercurial repository at https://hg.mozilla.org/mozilla-central/ hosts the latest SpiderMonkey sources. Mercurial is also known as hg.

The following command line downloads the entire Mozilla repository, including the full change history and a lot of Gecko and Firefox source code that isn't part of SpiderMonkey. It also changes to the SpiderMonkey directory (js/src).

hg clone https://hg.mozilla.org/mozilla-central/
cd js/src

To avoid getting the full change history, click the zip or gz links at https://hg.mozilla.org/index.cgi/mozilla-central/file/tip. This fetches a snapshot of the current Mozilla tree.

If you have problems with the instructions above, you can read the full details of using Mercurial to get Mozilla code here. That page also contains links to several bundles, which can be useful if you have a poor network connection.

Getting the latest SpiderMonkey source code from Git

The following command line downloads the entire Mozilla repository, including the full change history and a lot of Gecko and Firefox source code that isn't part of SpiderMonkey. It also changes to the SpiderMonkey directory (js/src).

git clone https://github.com/mozilla/gecko-dev.git
cd gecko-dev/js/src

If you want a faster (about 5 times as of January 2015) download, try doing a shallow clone (no version control history).

git clone --depth 1 https://github.com/mozilla/gecko-dev.git

If you have any problems check the https://wiki.mozilla.org/Github page.

Getting older SpiderMonkey sources from CVS

Note: You will need to explicitly fetch the JavaScript shell sources even if you currently build another Mozilla project, as there are files specific to the shell that are not normally found in a Mozilla source tree.

Just like when you're fetching any other Mozilla project from CVS, you need to log into the CVS server first. To do this, cd into the base directory you'd like to check out the code into, then enter the following command at your command line:

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot login

When prompted, enter the password anonymous.

Once you've logged in, cd into the root of your CVS tree and enter the following command:

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -l mozilla/js/src mozilla/js/src/config mozilla/js/src/editline mozilla/js/src/fdlibm

This checks out all the files needed in order to build the JavaScript shell.

If you also want the regression tests, add this command:

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/js/tests

Getting older branch versions of SpiderMonkey

If you want to experiment with a specific branch's version of SpiderMonkey, you need to check out js/src from branch but check out editline and config from trunk:

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -l -r BRANCH_NAME mozilla/js/src mozilla/js/src/fdlibm
cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -l mozilla/js/src/config mozilla/js/src/editline

Change BRANCH_NAME to the name of the branch you want to check out. You can use a JavaScript branch name (e.g. JS_1_7_ALPHA_BRANCH) or a Mozilla branch name (e.g. MOZILLA_1_8_BRANCH).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:205 次

字数:6325

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文