small opal fix

the return didn’t work
but couldn’t reproduce in opal try
This commit is contained in:
Torsten Ruger 2015-10-27 12:44:53 +02:00
parent 49b25ad971
commit fdc7f8b39c

View File

@ -163,12 +163,12 @@ module Parfait
# Lists start from index 1 # Lists start from index 1
define_method :get do | index| define_method :get do | index|
raise "Only positive indexes, #{index}" if index <= 0 raise "Only positive indexes, #{index}" if index <= 0
if index > self.get_length ret = nil
return nil if(index <= self.get_length)
else
# start one higher than offset, which is where the length is # start one higher than offset, which is where the length is
return internal_object_get(index + offset + 1) ret = internal_object_get(index + offset + 1)
end end
ret
end end
define_method :grow_to do | len| define_method :grow_to do | len|