chiark / gitweb /
Change our method of calling main() in emccpre.js.
authorSimon Tatham <anakin@pobox.com>
Sun, 20 Apr 2014 08:47:27 +0000 (08:47 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 20 Apr 2014 08:47:27 +0000 (08:47 +0000)
I've just upgraded to emcc 1.16.0, in which something fiddly has
happened to the semantics of Module.run() vs noInitialRun - now
setting the latter seems to cause the former to do everything except
calling main(), and then refuse to ever do anything again. So now I
have to use Module.callMain() in place of Module.run() when I finally
do get round to wanting to call main().

[originally from svn r10180]

emccpre.js

index 5231d04e6dbd857a54b4555775b810d3f92d0234..fef83c1e2832c7213fe7c6f4c7874ba519363a45 100644 (file)
@@ -352,8 +352,7 @@ function initPuzzle() {
     // Run the C setup function, passing argv[1] as the fragment
     // identifier (so that permalinks of the form puzzle.html#game-id
     // can launch the specified id).
-    Module.arguments = [location.hash];
-    Module.run();
+    Module.callMain([location.hash]);
 
     // And if we get here with everything having gone smoothly, i.e.
     // we haven't crashed for one reason or another during setup, then