It can already be imported, so there's no reason not to do it.
Hrm. So maybe we can't do this because of addons. :( There's "const XMLHttpRequest" all over addon code. :( Mostly from "resources/api-utils/lib/self!.js" and "boostrap.js", which I think is addon SDK stuff, so _maybe_ wouldn't be an issue? But there are some other uses too, looks like. This is why we can't have nice things. Once bug 589199 is fixed we can do this.
3 years ago
Bug 589199 seems to have landed
Yeah, need to test that the way that was actually fixed for addons will still work with the "const XMLHttpRequest" stuff... I'm not quite sure how to go about doing that, and this is pretty low-priority for me. If someone wants to do the testing and get the patch in, please feel free to steal.
All add-ons using "const XMLHttpRequest" should have been rewritten due to global lexical scope for let/const. If not, it is already broken.