DOMException.code is deprecated per DOM4 spec.
Created attachment 613190 [details] [diff] [review] patch Adding a deprecation warning.
Are we planning to remove support? It seems not too useful to warn for things that aren't broken, and won't be.
If an existing IndexedDB/File API code uses .code to identify the error, it will be surely broken. Also, we used to removed many non-broken things (taintEnabled, xmlVersion, isSameNode, etc.) That said, I have no plan to remove .code at the moment (then what the DOM4 deprecation means?).
I'm a little bit worried about warning here. I agree that for code that uses IndexedDB or FileAPI exceptions, we are going to break people that are using DOMException.code. However I'd expect it to be much much more common to use DOMException.code in code that uses older DOM APIs, such as normal Node manipulation etc. For those people, warning them doesn't do a lot of good. They likely need their code to work on older browsers where .name isn't available or doesn't have the new standardized names, and writing different code paths for Gecko is likely just a pain with no real gain. So basically I'm worried that we're going to stick a warning in people's developer console, with no good alternative for what they should used instead. So I'm worried people are just going to ignore this warning which lessens the value of warnings in general. So basically I think we should wait with checking this patch in until in a year or two when it would make more sense for developers to use .name for all exceptions.
Created attachment 613428 [details] [diff] [review] Warn use of DOMException.code only when the code was changed (IndexedDB or File API) or is useless (zero) Then what about this? This patch relies on patches of bug 730161.
Comment on attachment 613428 [details] [diff] [review] Warn use of DOMException.code only when the code was changed (IndexedDB or File API) or is useless (zero) SOLD to the awesome Kimura-san!
(In reply to Ryan VanderMeulen from comment #7) > https://hg.mozilla.org/integration/mozilla-inbound/rev/4b667b134bc7 Backed out whole merge for bustage per Yoric (Bug 743574): https://hg.mozilla.org/integration/mozilla-inbound/rev/12e42fb8e321
Disregard that; PEBKAC. Did not get backed out. I misread TBPL.
(In reply to Ehsan Akhgari [:ehsan] from comment #11) > Backed out: https://hg.mozilla.org/mozilla-central/rev/af7263971ad4 This bug is cursed.
(In reply to Ehsan Akhgari [:ehsan] from comment #11) > Backed out: https://hg.mozilla.org/mozilla-central/rev/af7263971ad4 Ehsan, that changeset doesn't appear to have anything to do with this bug. Furthermore, per comment 9, this was never actually backed out AFAIK.
Closing again because this is not really backed out.
Mentioned on https://developer.mozilla.org/en/Firefox_14_for_developers#DOM https://developer.mozilla.org/en/DOM/DOMException