* proc.c (proc_binding): don't propagative filename and line_no of
binding that is created from C level. [ruby-dev:41322] * vm_eval.c (eval_string_with_cref): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6c05f91b3b
commit
7e7420cc85
@ -1,3 +1,10 @@
|
||||
Sun May 16 17:16:09 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* proc.c (proc_binding): don't propagative filename and line_no of
|
||||
binding that is created from C level. [ruby-dev:41322]
|
||||
|
||||
* vm_eval.c (eval_string_with_cref): ditto.
|
||||
|
||||
Sun May 16 15:09:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* dln.c (rb_w32_check_imported): check if extension library to be
|
||||
|
6
proc.c
6
proc.c
@ -1897,8 +1897,14 @@ proc_binding(VALUE self)
|
||||
bindval = binding_alloc(rb_cBinding);
|
||||
GetBindingPtr(bindval, bind);
|
||||
bind->env = proc->envval;
|
||||
if (RUBY_VM_NORMAL_ISEQ_P(proc->block.iseq)) {
|
||||
bind->filename = proc->block.iseq->filename;
|
||||
bind->line_no = rb_iseq_first_lineno(proc->block.iseq);
|
||||
}
|
||||
else {
|
||||
bind->filename = Qnil;
|
||||
bind->line_no = 0;
|
||||
}
|
||||
return bindval;
|
||||
}
|
||||
|
||||
|
@ -966,7 +966,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
|
||||
if (rb_obj_is_kind_of(scope, rb_cBinding)) {
|
||||
GetBindingPtr(scope, bind);
|
||||
envval = bind->env;
|
||||
if (strcmp(file, "(eval)") == 0) {
|
||||
if (strcmp(file, "(eval)") == 0 && bind->filename != Qnil) {
|
||||
file = RSTRING_PTR(bind->filename);
|
||||
line = bind->line_no;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user