Ticket #2414 (closed defect: fixed)

Opened 22 months ago

Last modified 18 months ago

[patch][cla] Reduce dojo.lang.reduce

Reported by: peller Owned by: alex
Priority: normal Milestone:
Component: General Version: 0.4.1
Severity: normal Keywords:
Cc:

Description (last modified by alex) (diff)

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)

Attachments

reduce.patch (2.2 kB) - added by peller 22 months ago.
new code for dojo.lang.reduce
reduce-test.patch (0.8 kB) - added by peller 22 months ago.
unit tests

Change History

Changed 22 months ago by peller

new code for dojo.lang.reduce

Changed 22 months ago by peller

unit tests

Changed 22 months ago by peller

  • description modified (diff)

Changed 21 months ago by alex

  • status changed from new to assigned
  • description modified (diff)

Josh, Adam, great patch.

Changed 21 months ago by alex

  • milestone changed from 0.9 to 0.4.2

Changed 21 months ago by peller

Alex -- just to point out that the patch implies an incompatible API change, recommended for 0.9. For 0.4.2, perhaps we could just fix the lenght typo? That's about as low risk as we can get :)

Changed 21 months ago by alex

(In [7563]) refs #2414

applying the bits of Josh Staiger's patch that can be safely used in 0.4.x code. Will apply the full patch to trunk, but I'll be counting on Josh or Adam to fill in the porting guide for this function

Changed 21 months ago by alex

(In [7564]) refs #2414

Changed 21 months ago by alex

  • status changed from assigned to closed
  • resolution set to fixed

(In [7565]) fixes #2414

Changed 18 months ago by anonymous

  • milestone deleted

Milestone 0.4.2 deleted

Note: See TracTickets for help on using tickets.