* vm_eval.c (eval_string_with_cref): Use file path even if scope is
given. Related to [ruby-core:56099] [Bug #8662] and r42103. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9d1279b8e0
commit
55a9667de3
@ -1,3 +1,8 @@
|
|||||||
|
Tue Mar 18 22:03:41 2014 Shota Fukumori <her@sorah.jp>
|
||||||
|
|
||||||
|
* vm_eval.c (eval_string_with_cref): Use file path even if scope is
|
||||||
|
given. Related to [ruby-core:56099] [Bug #8662] and r42103.
|
||||||
|
|
||||||
Mon Mar 17 13:17:47 2014 Koichi Sasada <ko1@atdot.net>
|
Mon Mar 17 13:17:47 2014 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* enumerator.c (enumerator_block_call): use RARRAY_CONST_PTR()
|
* enumerator.c (enumerator_block_call): use RARRAY_CONST_PTR()
|
||||||
|
@ -660,6 +660,7 @@ class TestMethod < Test::Unit::TestCase
|
|||||||
assert_equal(__dir__, eval("__dir__", binding), bug8436)
|
assert_equal(__dir__, eval("__dir__", binding), bug8436)
|
||||||
bug8662 = '[ruby-core:56099] [Bug #8662]'
|
bug8662 = '[ruby-core:56099] [Bug #8662]'
|
||||||
assert_equal("arbitrary", eval("__dir__", binding, "arbitrary/file.rb"), bug8662)
|
assert_equal("arbitrary", eval("__dir__", binding, "arbitrary/file.rb"), bug8662)
|
||||||
|
assert_equal("arbitrary", Object.new.instance_eval("__dir__", "arbitrary/file.rb"), bug8662)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_alias_owner
|
def test_alias_owner
|
||||||
|
@ -1215,14 +1215,15 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *const cref_arg,
|
|||||||
VALUE absolute_path = Qnil;
|
VALUE absolute_path = Qnil;
|
||||||
VALUE fname;
|
VALUE fname;
|
||||||
|
|
||||||
|
if (file != Qundef) {
|
||||||
|
absolute_path = file;
|
||||||
|
}
|
||||||
|
|
||||||
if (scope != Qnil) {
|
if (scope != Qnil) {
|
||||||
bind = Check_TypedStruct(scope, &ruby_binding_data_type);
|
bind = Check_TypedStruct(scope, &ruby_binding_data_type);
|
||||||
{
|
{
|
||||||
envval = bind->env;
|
envval = bind->env;
|
||||||
if (file != Qundef) {
|
if (absolute_path == Qnil && !NIL_P(bind->path)) {
|
||||||
absolute_path = file;
|
|
||||||
}
|
|
||||||
else if (!NIL_P(bind->path)) {
|
|
||||||
file = bind->path;
|
file = bind->path;
|
||||||
line = bind->first_lineno;
|
line = bind->first_lineno;
|
||||||
absolute_path = rb_current_realfilepath();
|
absolute_path = rb_current_realfilepath();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user