mozilla-b2g/gaia — pull request #18773 by jrburke (2014-04-29 06:19:51+00:00)
Title: Bug 1002932 - [email] cookie cache no longer working with GAIA_OPTIMIZE=1

Switch to using a global, HTML_COOKIE_CACHE_VERSION, set up in html_cache_restore.js, and only modify that one global in that one file.

I have a strong aversion to globals, but since this value is used before we have a module system available, and because we want the value to be the same there as well as in the html_cache.js file, the global makes sense. This also avoids issues with minification trying to rename it, and means we only need to stamp one file in make_gaia_shared.js.

How I verified the fix:

make install-gaia GAIA_OPTIMIZE=1 APP=email

then in build_stage/email, I make sure that js/mail_app.js still has a HTML_COOKIE_CACHE_VERSION reference in the 'html_cache' module (so it survived minification) and that in js/html_cache_restore.js, the HTML_COOKIE_CACHE_VERSION value is stamped with the digest generated from the source files.

It also worked on the device. :)

If you want to test this locally, you will want to get the l10n.js fix that is in [bug 1002920](https://bugzilla.mozilla.org/show_bug.cgi?id=1002920). This bug is not dependent on that fix, however, to see that the constant survives minification, that fix is necessary for mail_app.js to be minified on master at the moment.