We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47b6894 commit a3c0955Copy full SHA for a3c0955
1 file changed
test/ruby/test_iseq.rb
@@ -861,13 +861,21 @@ def test_unreachable_next_in_block
861
862
def test_serialize_anonymous_outer_variables
863
iseq = RubyVM::InstructionSequence.compile(<<~'RUBY')
864
- [1].each do
865
- rescue => e
866
- puts it
+ object = Object.new
+ def object.test
+ [1].each do
867
+ raise
868
+ rescue
869
+ return it
870
+ end
871
end
872
+ object
873
RUBY
874
- iseq.to_binary # [Bug # 21370]
875
+ binary_iseq = iseq.to_binary # [Bug # 21370]
876
+ roundtrip_iseq = RubyVM::InstructionSequence.load_from_binary(binary_iseq)
877
+ object = roundtrip_iseq.eval
878
+ assert_equal 1, object.test
879
880
881
def test_loading_kwargs_memory_leak
0 commit comments