Patch emar for be compatible with Emscripten