ruby-changes:49379
From: nobu <ko1@a...>
Date: Wed, 27 Dec 2017 12:00:34 +0900 (JST)
Subject: [ruby-changes:49379] nobu:r61494 (trunk): vm_eval.c: expanded eval_string
nobu 2017-12-27 12:00:30 +0900 (Wed, 27 Dec 2017) New Revision: 61494 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61494 Log: vm_eval.c: expanded eval_string Modified files: trunk/vm_eval.c Index: vm_eval.c =================================================================== --- vm_eval.c (revision 61493) +++ vm_eval.c (revision 61494) @@ -1341,15 +1341,6 @@ eval_string_with_scope(VALUE scope, VALU https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1341 return vm_exec(ec); } -static VALUE -eval_string(VALUE self, VALUE src, VALUE scope, VALUE file, int line) -{ - if (NIL_P(scope)) - return eval_string_with_cref(self, src, NULL, file, line); - else - return eval_string_with_scope(scope, src, file, line); -} - /* * call-seq: * eval(string [, binding [, filename [,lineno]]]) -> obj @@ -1386,7 +1377,11 @@ rb_f_eval(int argc, const VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1377 if (!NIL_P(vfile)) file = vfile; - return eval_string(self, src, scope, file, line); + + if (NIL_P(scope)) + return eval_string_with_cref(self, src, NULL, file, line); + else + return eval_string_with_scope(scope, src, file, line); } /** @note This function name is not stable. */ @@ -1394,7 +1389,7 @@ VALUE https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1389 ruby_eval_string_from_file(const char *str, const char *filename) { VALUE file = filename ? rb_str_new_cstr(filename) : 0; - return eval_string(rb_vm_top_self(), rb_str_new2(str), Qnil, file, 1); + return eval_string_with_cref(rb_vm_top_self(), rb_str_new2(str), NULL, file, 1); } struct eval_string_from_file_arg { @@ -1406,7 +1401,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1401 eval_string_from_file_helper(VALUE data) { const struct eval_string_from_file_arg *const arg = (struct eval_string_from_file_arg*)data; - return eval_string(rb_vm_top_self(), arg->str, Qnil, arg->filename, 1); + return eval_string_with_cref(rb_vm_top_self(), arg->str, NULL, arg->filename, 1); } VALUE @@ -1510,7 +1505,7 @@ rb_eval_cmd(VALUE cmd, VALUE arg, int le https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1505 RARRAY_CONST_PTR(arg)); } else { - val = eval_string(rb_vm_top_self(), cmd, Qnil, 0, 0); + val = eval_string_with_cref(rb_vm_top_self(), cmd, NULL, 0, 0); } } EC_POP_TAG(); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/