Bug #9651

__dir__ returns nil in instance_eval/module_eval

Added by Tomoyuki Chikanaga about 1 year ago. Updated 11 months ago.

[ruby-dev:48056]
Status:Closed
Priority:Normal
Assignee:Shota Fukumori
ruby -v:2.1.1 Backport:2.0.0: DONE, 2.1: DONE

Description

instance_eval/module_eval 内の __dir__ が常に nil を返します。
evalr42103 で修正済みでしたが instance_eval/module_eval では nil のままだったようです。

trunk では r45360 および r45361 で修正済みです。
Backport 管理用に改めてチケット化しておきます。

Associated revisions

Revision 45473
Added by Tomoyuki Chikanaga 12 months ago

merge revision(s) r42230,r42231: [Backport #9651]

parse.y, vm_eval.c: file encoding in eval

* parse.y (yycompile): store file name as String to keep the encoding.

* parse.y (rb_parser_compile_string_path, rb_parser_compile_file_path):

new functions to pass file name as a String.

* parse.y (gettable_gen): return a copy of the original file name, not

a copy in filesystem encoding.

* vm_eval.c (eval_string_with_cref): use Qundef instead of "(eval)".
* parse.y (yycompile): store file name as String to keep the encoding.

* parse.y (rb_parser_compile_string_path, rb_parser_compile_file_path):
  new functions to pass file name as a String.

* parse.y (gettable_gen): return a copy of the original file name, not
  a copy in filesystem encoding.

* vm_eval.c (eval_string_with_cref): use Qundef instead of "(eval)".

Revision 45474
Added by Tomoyuki Chikanaga 12 months ago

merge revision(s) r45360,r45361: [Backport #9651]

* vm_eval.c (eval_string_with_cref): Use file path even if scope is
  given. Related to  [Bug #8662] and r42103.

* vm_eval.c (eval_string_with_cref): Unify to use NIL_P.

Revision 45927
Added by Tomoyuki Chikanaga 11 months ago

merge revision(s) r45360,r45361: [Backport #9651]

* vm_eval.c (eval_string_with_cref): Use file path even if scope is
  given. Related to  [Bug #8662] and r42103.

* vm_eval.c (eval_string_with_cref): Unify to use NIL_P.

History

#1 Updated by Shota Fukumori about 1 year ago

  • Description updated (diff)

#2 Updated by Tomoyuki Chikanaga 12 months ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: DONE, 2.1: REQUIRED

r42230 and r42231 were backported to ruby_2_0_0 at r45473. These changesets were required for resolv conflict.
And r45360 and r45361 were backported to ruby_2_0_0 at r45474.

#3 Updated by Tomoyuki Chikanaga 11 months ago

  • Backport changed from 2.0.0: DONE, 2.1: REQUIRED to 2.0.0: DONE, 2.1: DONE

r45360 and r45361 were backported to ruby_2_1 branch at r45927.

Also available in: Atom PDF