Files
mruby-mruby/test
Kouhei Sutou 8cb40fcda7 Fix ensure with yield context on break and return
How to reproduce:

    class A
      def x
        yield
      ensure
        y
      end

      def y
      end
    end

    # Work
    A.new.x do
    end

    # Not work
    # trace:
    # 	[2] /tmp/a.rb:5:in A.x
    # 	[0] /tmp/a.rb:15
    # /tmp/a.rb:5: undefined method 'y' for main (NoMethodError)
    A.new.x do
      break
    end

    # trace:
    # 	[2] /tmp/a.rb:5:in A.call
    # 	[0] /tmp/a.rb:19
    # /tmp/a.rb:5: undefined method 'y' for main (NoMethodError)
    lambda do
      A.new.x do
        return
      end
    end.call

`self` in ensure is broken when yield and break/return are used.
2015-02-05 22:40:25 +09:00
..
2015-01-03 17:53:32 +08:00
2014-03-03 16:53:26 +09:00
2012-09-06 07:49:14 -05:00
2012-11-05 15:50:46 +09:00

Running Tests

To run the tests, execute the following from the project's root directory.

$ make test