Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9252 (closed enhancement: fixed)

Opened 3 years ago

Last modified 1 year ago

[PATCH] [TEST] Add optional context argument to Number#times

Reported by: rmm5t Assigned to: sam
Priority: normal Milestone: 2.x
Component: Prototype Version: edge
Severity: normal Keywords:
Cc:

Description

Like the newly updated Enumerable methods, Number#times also deserves a context argument to bind to the iterator. Tests included.

Example usage:

  // Goofy Multiplication
  var result = 0;
  (3).times(function() {
    result += this.n; 
  }, { n: 2 });

Attachments

context_argument_for_number_times.diff (1.1 kB) - added by rmm5t on 08/28/07 14:22:44.
context argument added to Number#times. Extra tests for Number#times.

Change History

08/17/07 04:17:38 changed by rmm5t

  • summary changed from [PATCH] Add optional context argument to Number#times to [PATCH] [TEST] Add optional context argument to Number#times.

For consistency sake, I think this deserves to be added before the final 1.6 release.

08/28/07 14:22:44 changed by rmm5t

  • attachment context_argument_for_number_times.diff added.

context argument added to Number#times. Extra tests for Number#times.

09/21/07 17:18:05 changed by chmurph2

+1

09/22/07 03:21:09 changed by kangax

I'm surprised it's not in a source yet... +1

09/25/07 17:16:44 changed by tmass

  • keywords set to verified.

+1

10/13/07 22:58:25 changed by nzkoz

  • keywords deleted.

removing verified as the prototype guys don't use it

10/23/08 04:31:44 changed by jdalton

  • status changed from new to closed.
  • resolution set to fixed.