Opened 10 years ago

Closed 6 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:


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 10 years ago by bill

Component: CoreHTML
Owner: set to Eugene Lazutkin

This throws me off too, although we couldn't change it before 2.0.

comment:2 Changed 10 years ago by bill

PS: In support of the current API, the native browser replaceChild() call puts new first.

comment:3 Changed 10 years ago by Eugene Lazutkin

Priority: highundecided
Type: defectenhancement

comment:4 Changed 10 years ago by bill

Milestone: tbd2.0

As I said above, if we did change this it would be for 2.0.

comment:5 Changed 6 years ago by dylan

Milestone: 2.01.11
Resolution: wontfix
Status: newclosed

Cannot change for Dojo 1. Dojo 2 does not currently have a replaceClass method, though I've opened a ticket at to consider adding one.

Note: See TracTickets for help on using tickets.