Opened 14 years ago

Last modified 13 years ago

#2414 closed defect

[patch][cla] Reduce dojo.lang.reduce — at Version 1

Reported by: Adam Peller Owned by: alex
Priority: high Milestone:
Component: General Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Adam Peller)

The attached patch (and test) clears up several problems with dojo.lang.reduce:

  • the "lenght" typo
  • the fact that the arr.shift() is destructive on the argument passed in
  • removes bloat to check for an invalid call of arg length = 1
  • arg length 3 and the default case seem to be redundant
  • reorders the arg list to be more sane and reduce the code and api complexity (we can get away with it in 0.9)

I don't understand the history here so I'm assigning to Alex for review.

Thanks to Josh Staiger, IBM (CCLA)

Change History (3)

Changed 14 years ago by Adam Peller

Attachment: reduce.patch added

new code for dojo.lang.reduce

Changed 14 years ago by Adam Peller

Attachment: reduce-test.patch added

unit tests

comment:1 Changed 14 years ago by Adam Peller

Description: modified (diff)
Note: See TracTickets for help on using tickets.