See bug 965898 comment 25. We need to do this at some point, but it might require various refactorings, so I'm splitting this out of that bug.
So the big problem is that these exceptions are thrown from Proxy.cpp, which has no knowledge of DOMException, right? If we could just move these into Gecko code, this would be trivial. Most simply, could we push the throwing down into the actual handler involved, which I assume is in Gecko code?
I think we should make the error reporting operate with a virtual trap on BaseProxyHandler with a default implementation that does what the Proxy.cpp stuff does now. We can then override that in CrossOriginXrayWrapper to give ourselves proper DOM semantics. We could also optionally override it in FilteringWrapper and XrayWrapper if we wanted that to be exposed to the other (non-Web) cases as well.
You need to log in before you can comment on or make changes to this bug.