check if array expands in each block

parent 79d38c49
...@@ -11,7 +11,7 @@ class Array ...@@ -11,7 +11,7 @@ class Array
# ISO 15.2.12.5.10 # ISO 15.2.12.5.10
def each(&block) def each(&block)
idx, length = -1, self.length-1 idx, length = -1, self.length-1
while(idx < length) while idx < length and length < self.length and length = self.length-1
elm = self[idx += 1] elm = self[idx += 1]
unless elm unless elm
if elm == nil and length >= self.length if elm == nil and length >= self.length
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment