Ported to Emscripten.