There's a lot of FUD in this thread. First of all, JavaScript runs inside the browser and can't bypass proxy settings, so it can't "reveal your IP" in the same way as a plugin (Java, Flash). There are ways that JavaScript can deanonymize you, especially when Torbutton states are toggled, but you shouldn't be toggling Torbutton off in the browser bundle these days, and Torbutton blocks this malicious activity anyway. Here's what the Tor Project has to say about it:
Javascript can do things like wait until you have disabled Tor before trying to contact its source site, thus revealing your IP address. As such, Torbutton must disable Javascript, Meta-Refresh tags, and certain CSS behavior when Tor state changes from the state that was used to load a given page. These features are re-enabled when Torbutton goes back into the state that was used to load the page, but in some cases (particularly with Javascript and CSS) it is sometimes not possible to fully recover from the resulting errors, and the page is broken. Unfortunately, the only thing you can do (and still remain safe from having your IP address leak) is to reload the page when you toggle Tor, or just ensure you do all your work in a page before switching tor state.
https://www.torproject.org/torbutton/torbutton-faq.html.en
Also, the web sockets bug was fixed a long time ago.
https://blog.torproject.org/blog/firefox-security-bug-proxy-bypass-current-tbbs
https://trac.torproject.org/projects/tor/ticket/5741
The main threat to deanonymization is plugins, especially Flash and Java. Don't use them.