mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c, vm_insnhelper.c: fix cref in instance_eval
and cvar_base search protocol. * bootstraptest/test_knownbug.rb, test_eval.rb: move soleved test and add new tests. * test/ruby/test_eval.rb: fix tests for spec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e07663ec1f
commit
d457fdad2d
6 changed files with 105 additions and 52 deletions
|
|
@ -236,3 +236,49 @@ assert_equal 'ok', %q{
|
|||
:ok
|
||||
end
|
||||
}
|
||||
|
||||
assert_equal 'ok', %q{
|
||||
begin
|
||||
0.instance_eval { def m() :m end }
|
||||
1.m
|
||||
:ng
|
||||
rescue Exception
|
||||
:ok
|
||||
end
|
||||
}, '[ruby-dev:34579]'
|
||||
|
||||
assert_equal 'ok', %q{
|
||||
begin
|
||||
12.instance_eval { @@a }
|
||||
rescue NameError
|
||||
:ok
|
||||
end
|
||||
}, '[ruby-core:16794]'
|
||||
|
||||
assert_equal 'ok', %q{
|
||||
begin
|
||||
12.instance_exec { @@a }
|
||||
rescue NameError
|
||||
:ok
|
||||
end
|
||||
}, '[ruby-core:16794]'
|
||||
|
||||
assert_equal 'ok', %q{
|
||||
begin
|
||||
nil.instance_eval {
|
||||
def a() :a end
|
||||
}
|
||||
rescue => TypeError
|
||||
:ok
|
||||
end
|
||||
}, '[ruby-core:16796]'
|
||||
|
||||
assert_equal 'ok', %q{
|
||||
begin
|
||||
nil.instance_exec {
|
||||
def a() :a end
|
||||
}
|
||||
rescue => TypeError
|
||||
:ok
|
||||
end
|
||||
}, '[ruby-core:16796]'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue