Opened 4 years ago

Last modified 4 years ago

#14116 new enhancement

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

Reported by: ktiedt Owned by: elazutkin
Priority: undecided Milestone: 2.0
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 (4)

comment:1 Changed 4 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 4 years ago by bill

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

comment:3 Changed 4 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.

Note: See TracTickets for help on using tickets.