It is all bound to make JS kernel programing a Pilar of OS Stability.
You're confusing JS with wasm and undefined behavior with confusing behavior. JS and wasm are strongly defined and the specifications consider undefined behavior a bug.
None of that applies to web assembly, as I'm sure you know.