mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parse.y: no duplicated names
* parse.y (new_bv_gen): no duplicated names, if already added in shadowing_lvar(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d750b62d66
commit
b5cae3820b
3 changed files with 22 additions and 5 deletions
|
@ -89,6 +89,12 @@ class TestVariable < Test::Unit::TestCase
|
|||
assert_equal([:x, :bug9486, :x], 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)
|
||||
end
|
||||
|
||||
def local_variables_of(bind)
|
||||
this_should_not_be_in_bind = 2
|
||||
bind.local_variables
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue