First Patch of the Summer

Freedom at last! I took the final exam of the semester last Friday, and so summer break has officially begun. The coding period for Summer of Code began Monday, and the first patch to come out of it has been attached to Bug 501689. It’s still a work in progress, but several of the callback functions have been converted to the more modern promises. Like callback functions, promises help guarantee that a function has the data that it needs before it continues, but code written using promises instead is cleaner and much easier to follow. And, as I’ve discovered a couple times while working on this patch, promises have the additional benefit of pretty informative error messages when one fails.

The next step is to convert some of the helper functions to use Task.jsm, which returns a promise when completed, and makes the code a lot simpler and easier to read. One of the main difficulties in completely eliminating callbacks is that many of the IDL interfaces require several callbacks as arguments. There isn’t an easy way around this, and one of the goals is to limit the use of callbacks to that instance.

One of the things that has been made pretty clear to me already is just how large the Mozilla project is. It’s a pretty daunting mountain of code, but we’ve made some slow progress already. Hopefully as the summer goes on, I’ll continue to become more familiar and we can get things really moving.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s