summaryrefslogtreecommitdiffhomepage
path: root/mrblib/array.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-03-14 02:41:22 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-03-14 02:41:22 +0900
commit113ab607846e63c0348758d3e13017e0ea3a45a3 (patch)
tree379aa985de0a4c1a148bc693b2207eaf66d44bc3 /mrblib/array.rb
parent463c5f83c3e5f379d4dd59deb17179915fbaf93b (diff)
downloadmruby-113ab607846e63c0348758d3e13017e0ea3a45a3.tar.gz
mruby-113ab607846e63c0348758d3e13017e0ea3a45a3.zip
mruby-enumerator: move definitions in core_mod.rb to mrblib core
Diffstat (limited to 'mrblib/array.rb')
-rw-r--r--mrblib/array.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/mrblib/array.rb b/mrblib/array.rb
index 1203ea70e..9141146e5 100644
--- a/mrblib/array.rb
+++ b/mrblib/array.rb
@@ -10,6 +10,8 @@ class Array
#
# ISO 15.2.12.5.10
def each(&block)
+ return to_enum :each unless block_given?
+
idx, length = -1, self.length-1
while idx < length and length <= self.length and length = self.length-1
elm = self[idx += 1]