mathjax/MathJax — pull request #812 by jmeas (2014-05-09 22:55:43+00:00)
Title: Adds wrapper

- Wraps Mathjax in an IIFE
- Throws an error when the browser isn't supported

#### Why?

This change gets rid of [this line](https://github.com/mathjax/MathJax/blob/master/unpacked/MathJax.js#L3107), which are two closing brackets that require users to go **to the top of the file** to see where they begin. Yikes. By wrapping things in an IIFE we can keep those two 'checks' where the belong – self-contained at the top of the file. It makes the code a bit more readable, I think.

On the error: emitting the error when the browser isn't supported is being more communicative than just silently failing. I think this is important enough of a failure to be error-worthy, but maybe you disagree and prefer the silent failure. Nbd either way.

Why an IIFE? For this PR it might not seem that necessary. It does let us return from the IIFE on the second conditional at the top, which is super nice, though. What's more important is the direction this can take the library. It's a small step toward supporting a UMD implementation, which could come next.

I admit I didn't test this. It's really just a PR to see if you guys are interested in these sorts of changes toward the broader goal of cleaning up the lib.