diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-31 09:07:42 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-31 09:07:42 +0000 |
commit | 7487298584145058f2340dc7a6e4da8d21fe5248 (patch) | |
tree | f26be82f903d8f870d42fd0641175e2220719d3d /test | |
parent | 4273aa8e722c88b04ff0828b6a3c9e6b25988231 (diff) | |
download | ruby-7487298584145058f2340dc7a6e4da8d21fe5248.tar.gz |
* vm_insnhelper.c (vm_get_ev_const): should ignore crefs with
the NODE_FL_CREF_PUSHED_BY_EVAL flag.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_module.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 6d28616d86..10b2708804 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1049,4 +1049,23 @@ class TestModule < Test::Unit::TestCase INPUT assert_in_out_err([], src, ["uninitialized constant A"], []) end + + def test_constant_lookup_in_module_in_class_eval + src = <<-INPUT + class A + B = 42 + end + + A.class_eval do + module C + begin + B + rescue NameError + puts "NameError" + end + end + end + INPUT + assert_in_out_err([], src, ["NameError"], []) + end end |