Opened 5 years ago

Closed 10 months ago

#14116 closed enhancement (wontfix)

dojo.replaceClass arguments are un-intuitive replace(new, old) vs replace(old, new)

Reported by: ktiedt Owned by: elazutkin
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 5 years ago by bill

  • Component changed from Core to HTML
  • Owner set to elazutkin

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

comment:2 Changed 5 years ago by bill

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

comment:3 Changed 5 years ago by elazutkin

  • Priority changed from high to undecided
  • Type changed from defect to enhancement

comment:4 Changed 4 years ago by bill

  • Milestone changed from tbd to 2.0

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

comment:5 Changed 10 months ago by dylan

  • Milestone changed from 2.0 to 1.11
  • Resolution set to wontfix
  • Status changed from new to closed

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.