What Javascript needs is a way to deterministically (re)run it, so that errors can be traced.
Of course, I want to run my server in the same way.
So perhaps this is better done inside some "deterministic virtual machine", where the browser and server are run deterministically hand-in-hand.
Second, you can actually execute browser and node code deterministically if you like, by providing alternative implementations of setTimeout, setInterval, setImmediate, etc. that serialize execution of the callbacks in the order of your choice.