From 11eb87013653ba6d2321ecf4db07fb052fe19a98 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 7 May 2014 02:25:43 +0000 Subject: vm_eval.c: exclude hidden variables * vm_eval.c (rb_f_local_variables): exclude variables hidden by shadowing. [ruby-core:60501] [Bug #9486] * vm.c (collect_local_variables_in_iseq): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_variable.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/ruby/test_variable.rb') diff --git a/test/ruby/test_variable.rb b/test/ruby/test_variable.rb index e6730f858f..1c9b60183d 100644 --- a/test/ruby/test_variable.rb +++ b/test/ruby/test_variable.rb @@ -86,13 +86,13 @@ class TestVariable < Test::Unit::TestCase def test_shadowing_local_variables bug9486 = '[ruby-core:60501] [Bug #9486]' x = tap {|x| break local_variables} - assert_equal([:x, :bug9486, :x], x) + assert_equal([:x, :bug9486], x) end def test_shadowing_block_local_variables bug9486 = '[ruby-core:60501] [Bug #9486]' x = tap {|;x| break local_variables} - assert_equal([:x, :bug9486, :x], x) + assert_equal([:x, :bug9486], x) end def local_variables_of(bind) -- cgit v1.2.3