mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 17:43:59 +02:00
merges r21079 from trunk into ruby_1_9_1.
* vm.c (Init_VM): create and define TOPLEVEL_BINDING at first. * vm.c (vm_set_main_stack, rb_iseq_eval_main): added. * parse.y (rb_parser_compile_file): fix to check parse_in_eval flag. * eval.c (ruby_exec_node): use rb_iseq_eval_main() instead of rb_iseq_eval(). * iseq.c (rb_iseq_new_main), vm_core.h: added. main script (specified by -e or script name) should be run under TOPLEVEL_BINDING using Kernel#eval. Above changes simulate Kernel#eval behaviour. [ruby-dev:37240] * compile.c (make_name_for_block): skip iseq except block type. this fix is needed for [ruby-dev:37240], and also fixes [ruby-dev:35392]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
63e21a7195
commit
846ca98acf
9 changed files with 120 additions and 16 deletions
|
@ -286,3 +286,16 @@ assert_equal 'ok', %q{
|
|||
assert_normal_exit %q{
|
||||
eval("", method(:proc).call {}.binding)
|
||||
}
|
||||
|
||||
assert_equal "(eval):1:in `block in <main>': ", %q{
|
||||
b = binding
|
||||
10.times{
|
||||
eval('', b)
|
||||
}
|
||||
begin
|
||||
eval('1.times{raise}', b)
|
||||
rescue => e
|
||||
e.message
|
||||
end
|
||||
}, ' [ruby-dev:35392]'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue