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

Changeset 4942

Show
Ignore:
Timestamp:
09/03/06 22:26:50 (2 years ago)
Author:
madrobby
Message:

Prototype: Fix issues with Enumerable.any, ObjectRange.toArray, added unit tests, fixes #4419 [miyamuko, Thomas Fuchs]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spinoffs/prototype/CHANGELOG

    r4941 r4942  
    11*SVN* 
     2 
     3* Fix issues with Enumerable.any, ObjectRange.toArray, added unit tests, fixes #4419 [miyamuko, Thomas Fuchs] 
    24 
    35* Fix two instances of unneccesarily redeclared variables, fixes #5229 [Thomas Fuchs] 
  • spinoffs/prototype/Rakefile

    r4861 r4942  
    4242   
    4343  t.run("/test/unit/enumerable.html") 
     44  t.run("/test/unit/range.html") 
    4445  t.run("/test/unit/string.html") 
    4546  t.run("/test/unit/dom.html") 
  • spinoffs/prototype/src/enumerable.js

    r4181 r4942  
    2828   
    2929  any: function(iterator) { 
    30     var result = true; 
     30    var result = false; 
    3131    this.each(function(value, index) { 
    3232      if (result = !!(iterator || Prototype.K)(value, index))  
  • spinoffs/prototype/src/range.js

    r3362 r4942  
    1010  _each: function(iterator) { 
    1111    var value = this.start; 
    12     do
     12    while (this.include(value))
    1313      iterator(value); 
    1414      value = value.succ(); 
    15     } while (this.include(value)); 
     15    } 
    1616  }, 
    1717   
  • spinoffs/prototype/test/unit/enumerable.html

    r4181 r4942  
    7676 
    7777    testAny: function() {with(this) { 
     78      assert(!([].any())); 
     79       
    7880      assert([true, true, true].any()); 
    7981      assert([true, false, false].any()); 
     
    8991     
    9092    testAll: function() {with(this) { 
     93      assert([].all()); 
     94       
    9195      assert([true, true, true].all()); 
    9296      assert(![true, false, false].all());