It's more like you won't need to develop for two-three targets, like today with desktop, web and mobile. Instead you will use the same runtime, though there might be some restrictions on each platform you'd need to take into account (like handling permissions properly) and make sure your code would work on any platform that provides the capabilities you require.
Java promised that, but we got write-once, debug anywhere. Those different features, bugs, permissions, etc, mean you'll still have to test the platforms, build up different UIs for each platform, etc. About all you'd end up gaining is a stylesheet-based rendering engine, but you'd get that with something like XAML as well.
WebAssembly is much simpler than Java, and harder to get wrong. The DOM isn't, but I would hope non-web targets for WebAssembly would use different (and simpler) APIs.