diff --git a/CHANGELOG b/CHANGELOG index b63fc52..e308866 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ *SVN* +* Make ObjectRange use the new Class.create syntax. [Mislav Marohnić] + +* Fix a failing ClassCreate test case in IE. [Tobie Langel] + * Complete rewrite of the Hash class. !! BACKWARDS COMPATIBILITY CHANGE !! This new version of Hash is NOT backwards compatible with the former Hash class. diff --git a/src/range.js b/src/range.js index f971883..0d750f2 100644 --- a/src/range.js +++ b/src/range.js @@ -1,4 +1,4 @@ -ObjectRange = Class.create({ +var ObjectRange = Class.create(Enumerable, { initialize: function(start, end, exclusive) { this.start = start; this.end = end; @@ -11,19 +11,17 @@ ObjectRange = Class.create({ iterator(value); value = value.succ(); } - } + }, + + include: function(value) { + if (value < this.start) + return false; + if (this.exclusive) + return value < this.end; + return value <= this.end; + } }); -Object.extend(ObjectRange.prototype, Enumerable); - -ObjectRange.prototype.include = function(value) { - if (value < this.start) - return false; - if (this.exclusive) - return value < this.end; - return value <= this.end; -}; - var $R = function(start, end, exclusive) { return new ObjectRange(start, end, exclusive); };