Skip to content

Commit

Permalink
* eval.c (rb_obj_instance_eval): use class of immediate objects.
Browse files Browse the repository at this point in the history
* test/ruby/test_eval.rb: fix a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
ko1 committed Dec 22, 2007
1 parent b507930 commit 8514319
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Sat Dec 22 11:47:42 2007 Koichi Sasada <[email protected]>

* eval.c (rb_obj_instance_eval): use class of immediate objects.

* test/ruby/test_eval.rb: fix a test.

Sat Dec 22 11:37:06 2007 NAKAMURA Usaku <[email protected]>

* encoding.c (rb_locale_charmap): win32 support.
Expand Down
2 changes: 1 addition & 1 deletion eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,7 @@ rb_obj_instance_eval(int argc, VALUE *argv, VALUE self)
VALUE klass;

if (SPECIAL_CONST_P(self)) {
klass = Qnil;
klass = CLASS_OF(self); //klass = Qnil;
}
else {
klass = rb_singleton_class(self);
Expand Down
2 changes: 1 addition & 1 deletion test/ruby/test_eval.rb
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def test_fixnum_instance_eval_cvar
def test_cvar_scope_with_instance_eval
Fixnum.class_eval "@@test_cvar_scope_with_instance_eval = 1" # depends on [ruby-dev:24229]
@@test_cvar_scope_with_instance_eval = 4
assert_equal(4, 1.instance_eval("@@test_cvar_scope_with_instance_eval"), "[ruby-dev:24223]")
assert_equal(1, 1.instance_eval("@@test_cvar_scope_with_instance_eval"), "[ruby-dev:24223]")
Fixnum.__send__(:remove_class_variable, :@@test_cvar_scope_with_instance_eval)
end

Expand Down

0 comments on commit 8514319

Please sign in to comment.