# HG changeset patch # User Lucas Thompson # Date 1472044688 -3600 # Node ID 65c802d88e23e0f71f18652cfcdf6467f6a47b52 # Parent 8db9271524972098cb1fa93de63bb104192d6739 Force Emscripten to emit the static memory init code inside the JS file. - Emscripten emits it into a separate .mem file for optimised builds, as of 1.12.1 - The file is loaded asyncronously, so occasionally the runtime hadn't initialised before trying to call functions (happened in Chrome, similar to what we've seen before) - This is the easiest fix, without changing the JS for this simple example. diff -r 8db927152497 -r 65c802d88e23 Makefile.example.emscripten --- a/Makefile.example.emscripten Wed Aug 24 10:50:40 2016 +0100 +++ b/Makefile.example.emscripten Wed Aug 24 14:18:08 2016 +0100 @@ -30,6 +30,7 @@ ../json/json11/json11.cpp EMFLAGS := \ + --memory-init-file 0 \ -s NO_FILESYSTEM=1 \ -s MODULARIZE=1 \ -s ERROR_ON_UNDEFINED_SYMBOLS=1 \