Skip to content

Commit

Permalink
Object#instance_eval yields a reciver object to the block
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Jun 22, 2012
1 parent 25480ea commit 1274d86
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,3 @@
fails:Kernel#instance_eval doesn't pass the object to the block fails:Kernel#instance_eval doesn't pass the object to the block
fails:Kernel#instance_eval treats block-local variables as local to the block fails:Kernel#instance_eval treats block-local variables as local to the block
fails:Kernel#instance_eval yields the object to the block
fails:Kernel#instance_eval returns nil fails:Kernel#instance_eval returns nil
2 changes: 1 addition & 1 deletion vm_eval.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ specific_eval(int argc, VALUE *argv, VALUE klass, VALUE self)
argc); argc);
} }
rb_vm_set_current_scope(klass, SCOPE_PUBLIC); rb_vm_set_current_scope(klass, SCOPE_PUBLIC);
retval = rb_vm_yield_under(klass, self, 0, NULL); retval = rb_vm_yield_under(klass, self, 1, &self);
} }
else { else {
const char *file = "(eval)"; const char *file = "(eval)";
Expand Down

0 comments on commit 1274d86

Please sign in to comment.