Need help with emscripten port

Added the test changes from your old PR here: https://github.com/rust-lang/rust/pull/35574