Closed Bug 743574 Opened 9 years ago Closed 9 years ago

Deprecate DOMException.code


(Core :: DOM: Core & HTML, defect)

Not set





(Reporter: emk, Assigned: emk)



(Keywords: dev-doc-complete)


(1 file, 1 obsolete file)

DOMException.code is deprecated per DOM4 spec.
Attached patch patch (obsolete) — Splinter Review
Adding a deprecation warning.
Assignee: nobody → VYV03354
Attachment #613190 - Flags: review?(jonas)
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?).
Depends on: 730161
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.
Then what about this? This patch relies on patches of bug 730161.
Attachment #613190 - Attachment is obsolete: true
Attachment #613190 - Flags: review?(jonas)
Attachment #613428 - Flags: review?(jonas)
Attachment #613428 - Attachment description: Deprecate DOMException.code only the code was changed (IndexedDB or File API) or is useless (zero) → Warn use of DOMException.code only when the code was changed (IndexedDB or File API) or is useless (zero)
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!
Attachment #613428 - Flags: review?(jonas) → review+
Flags: in-testsuite-
Keywords: checkin-needed
Target Milestone: --- → mozilla14
(In reply to Ryan VanderMeulen from comment #7)

Backed out whole merge for bustage per Yoric (Bug 743574):
Target Milestone: mozilla14 → ---
Disregard that; PEBKAC. Did not get backed out. I misread TBPL.
Keywords: checkin-needed
Target Milestone: --- → mozilla14
Closed: 9 years ago
Resolution: --- → FIXED
Backed out:
Resolution: FIXED → ---
(In reply to Ehsan Akhgari [:ehsan] from comment #11)
> Backed out:

This bug is cursed.
(In reply to Ehsan Akhgari [:ehsan] from comment #11)
> Backed out:

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.
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.