Disabling javascript would have prevented the exploit. The Tor browser bundle contains NoScript, but has it set to allow javascript by default. I think this is because it makes it more accessible to non-technical users.
Before this issue they even advised _not_ to disable javascript, since that would make you stand out more amongst Tor users.