Opened 9 years ago
Closed 5 years ago
#14116 closed enhancement (wontfix)
dojo.replaceClass arguments are un-intuitive replace(new, old) vs replace(old, new)
Reported by: | Karl Tiedt | Owned by: | Eugene Lazutkin |
---|---|---|---|
Priority: | undecided | Milestone: | 1.11 |
Component: | HTML | Version: | 1.7.0b1 |
Keywords: | dojo.replaceClass | Cc: | |
Blocked By: | Blocking: |
Description
Since there was 0 response on the contrib list, opening a formal ticket
Since we are finally updating internally to 1.6 based code we came across dojo.replaceClass and were a bit confused by the argument orders that were chosen...
dojo.replaceClass(node, new, old) completely disregards decades of already learned API in almost every language out there (including Javascripts own replace routines).
Typical replace functions *always* replace(old, new)... I am curious why suddenly this method diverged from that...
Change History (5)
comment:1 Changed 9 years ago by
Component: | Core → HTML |
---|---|
Owner: | set to Eugene Lazutkin |
comment:2 Changed 9 years ago by
PS: In support of the current API, the native browser replaceChild() call puts new first.
comment:3 Changed 9 years ago by
Priority: | high → undecided |
---|---|
Type: | defect → enhancement |
comment:4 Changed 9 years ago by
Milestone: | tbd → 2.0 |
---|
As I said above, if we did change this it would be for 2.0.
comment:5 Changed 5 years ago by
Milestone: | 2.0 → 1.11 |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Cannot change for Dojo 1. Dojo 2 does not currently have a replaceClass method, though I've opened a ticket at https://github.com/dojo/dom/issues/30 to consider adding one.
This throws me off too, although we couldn't change it before 2.0.