mruby/mruby — pull request #898 by masamitsu-murase (2013-02-26 18:46:24+00:00)
Title: Modify return value

This patch modifies the following points:
* Return `nil` if no argument is specified to `return` and `next`.
According to ISO spec, `return` and `next` with no argument should return `nil`.
* Adjust stack position of `NODE_RETURN`.

The second modification reduces stack size consumption.
Therefore, I also modified infinite recursion test in `exception.rb` to pass it.

Here are the error cases.
```ruby
def test(arg)
a = if (arg == 1)
1
elsif (arg == 2)
2
else
return
end
p a
# => main (not 1)
end
test(1)

def test2
a = 1
return
end
p test2
# => 1 (not nil)

def test3
a = 1
b = if (a == 1)
2
else
return
3
end
b
end
p test3
# => 1 (not 2)

test_proc = Proc.new do
a = 3
next
end
p test_proc.call
# => 3 (not nil)
```