From a81daa68337f3aab6c616e7a377bf71bcbfb8cc3 Mon Sep 17 00:00:00 2001 From: yugui Date: Sun, 16 May 2010 03:07:45 +0000 Subject: merges r27716 from trunk into ruby_1_9_2. -- * vm_eval.c (eval_string_with_cref): propagative filename and line_no of binding. [ruby-dev:38767] [ruby-core:28307] * vm_core.h (rb_binding_t), proc.c: add filename and line_no fields to preserve them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_eval.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vm_eval.c') diff --git a/vm_eval.c b/vm_eval.c index e7b64de7a3..7a8fffedb9 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -966,6 +966,10 @@ 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) { + file = RSTRING_PTR(bind->filename); + line = bind->line_no; + } } else { rb_raise(rb_eTypeError, -- cgit v1.2.3