I would like to share the experience I've learned so far about diagnosing and debugging the JavaScript/ECMAScript engine of Firefox. I would like to demo how to start the patching project, and the general method I used to trace a bug. In the end, we should be able to add a customised built-in function in the engine.
And since I would like to help you to accomplish the goal step-by-step, please follow this MDN document to clone and build the engine first:
Note: the repo is about 15GB after cloning. So please clone it when you have a high-speed network and preserve enough disk space for it. I recommend at least 30GB for the disk space.
If you have any trouble when building the environment, contact me in the reply. And I would have some presentation and live-demo, so it's okay to come without the engine built.