Skip to content

Commit 2729bcb

Browse files
committed
fix index value not being passed to ObjectRange.each's iterator function
1 parent 364ab46 commit 2729bcb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/prototype/lang/range.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ var ObjectRange = Class.create(Enumerable, (function() {
108108
}
109109

110110
function _each(iterator, context) {
111-
var value = this.start;
112-
while (this.include(value)) {
113-
iterator.call(context, value);
111+
var value = this.start, i;
112+
for (i = 0; this.include(value); i++) {
113+
iterator.call(context, value, i);
114114
value = value.succ();
115115
}
116116
}

0 commit comments

Comments
 (0)