kripken/emscripten — pull request #3084 by rharkeadsk (2014-12-17 17:07:10+00:00)
Title: Update embind to work with the Closure Compiler

We discovered that certain parts of embind do not work when the code is run through the Closure Compiler (`--closure 1`). Several names within the embind JavaScript itself need to be guarded from name
mangling in the Closure Compiler.

The existing tests would be sufficient to detect this case, except that they were never being run with the Closure Compiler enabled. This pull request also updates `other.test_embind` to run a pass with the Closure Compiler enabled.

Because the tests were never designed to themselves be Closure'd, I updated the test to manually append the tests and the test adapter to the output JavaScript, instead of using `--post-js`. We considered updating the tests themselves to be Closure'able, but that turned into a minor nightmare- I think this way is better, but if you feel otherwise please let me know. We would be happy to finish that work if it is the preferred road forward.

Small updates were also needed to the test adapter to make it work- it was relying on the `assert` function from Emscripten, and now needs to create its own object rather than appending to it.