IronRuby.Tests.Tests.BlockReturnOptimization2 C# (CSharp) Method

BlockReturnOptimization2() public method

Block return propagates thru multiple library method calls with a block without throwing unwinding exception.
public BlockReturnOptimization2 ( ) : void
return void
        public void BlockReturnOptimization2() {
            StackUnwinder.InstanceCount = 0;
            TestOutput(@"
def foo
  10.times do
    10.times do
      10.times do
        return 123
      end
    end
  end
end

puts foo
", @"
123
");
            Assert(StackUnwinder.InstanceCount == 0);
        }
Tests