kripken/emscripten — pull request #1196 by inolen (2013-05-20 02:46:22+00:00)
Title: Disable preRun from autorunning when noInitialRun is true

This patch disables preRun from running automatically when noInitialRun is true. It exports a single `load(callback)` function that is responsible for both for calling preRun, and triggering the supplied callback once everything is ready.

I keep my application's memory init file on a CDN and needed to be able to set a base path for the AJAX requests before preRun() was called. In addition, I needed the ability to know when preRun was over so that I could safely call run().

In the end, I'm able to startup the application like so:

module.load(function () {
module.run(['arg1', 'arg2']);
});

This should only change the behavior for cases where noInitialRun has been set to true. If it is false, the functionality should remain the same.