summaryrefslogtreecommitdiff
path: root/bootstraptest/test_eval.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-06 15:31:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-06 15:31:13 +0000
commit28827e61d153e39ad3fe1e6fecbf27c09140fe75 (patch)
tree898387ecb8856fbaa33e2345b1fa4292f7522d61 /bootstraptest/test_eval.rb
parent353833c466f30accbc96c5121d2b9487db411e2a (diff)
method in instance_eval
* class.c (rb_special_singleton_class_of): utility function. * vm_eval.c (eval_under): special deal for class variable scope with instance_eval. * vm_eval.c (rb_obj_instance_eval, rb_obj_instance_exec): allow method definition in instance_eval of special constants. [ruby-core:28324] [Bug #2788] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest/test_eval.rb')
-rw-r--r--bootstraptest/test_eval.rb26
1 files changed, 10 insertions, 16 deletions
diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb
index aab1a7b..bf74780 100644
--- a/bootstraptest/test_eval.rb
+++ b/bootstraptest/test_eval.rb
@@ -264,24 +264,18 @@ assert_equal 'ok', %q{
}, '[ruby-core:16794]'
assert_equal 'ok', %q{
- begin
- nil.instance_eval {
- def a() :a end
- }
- rescue TypeError
- :ok
- end
-}, '[ruby-core:16796]'
+ nil.instance_eval {
+ def defd_using_instance_eval() :ok end
+ }
+ nil.defd_using_instance_eval
+}, '[ruby-core:28324]'
assert_equal 'ok', %q{
- begin
- nil.instance_exec {
- def a() :a end
- }
- rescue TypeError
- :ok
- end
-}, '[ruby-core:16796]'
+ nil.instance_exec {
+ def defd_using_instance_exec() :ok end
+ }
+ nil.defd_using_instance_exec
+}, '[ruby-core:28324]'
assert_normal_exit %q{
eval("", method(:proc).call {}.binding)