Skip to content

Instantly share code, notes, and snippets.

@almet
Last active February 25, 2016 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almet/6f04ed517a9671d180e5 to your computer and use it in GitHub Desktop.
Save almet/6f04ed517a9671d180e5 to your computer and use it in GitHub Desktop.
How to do some JavaScript coding for Firefox

How to do some JavaScript coding for Firefox

I'm going to use mercurial (hg) and patch queues here, but other options exist.

Setting things up

  1. Get the mozilla-central (m-c) repository setup locally
  2. Start hacking on something locally

Hacking on some JavaScript

  1. Add a new patch queue locally with hg qnew bug-number
  2. Hack hack hack

Eventually run the tests if you need to, for instance with the following command

./mach xpcshell-test toolkit/modules/tests/xpcshell/test_jsesc.js

Ready? Submit your patch!

Update your current patch queue with hg qrefresh Once this is done and that your patch is ready, upload it to the bug with:

hg bzexport {{commit_rev}} {{bug_number}}

You can get the commit_rev using hg log -l 2.

Run the tests in the Continuous Integration

If you want to push your changes to the Mozilla CI (named Try), use hg push-to-try, like this (to run only the xpcshell tests):

hg push-to-try -m "try: -b do -p linux,linux64,macosx64,win32,win64 -u xpcshell -t none"

Updating the local mercurial repo

To update the local repository, you need to first ensure that no patch queues are enabled. You can do so with:

hg qpop -a

Once this is done, you can update with:

hg pull -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment