summaryrefslogtreecommitdiffstats
path: root/bootstraptest
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-27 01:15:56 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-27 01:15:56 +0000
commit3a67d33091fee43747ead2b7aa157337a05700bb (patch)
tree48abc9258dc50b91ca614b16aec5f20c8acd483b /bootstraptest
parent218f2869dffe0ad035b696a7f39e008f6a6f5b58 (diff)
downloadruby-3a67d33091fee43747ead2b7aa157337a05700bb.tar.gz
ruby-3a67d33091fee43747ead2b7aa157337a05700bb.tar.xz
ruby-3a67d33091fee43747ead2b7aa157337a05700bb.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@21079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_eval.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb
index 8b99c7968..6dc23468c 100644
--- a/bootstraptest/test_eval.rb
+++ b/bootstraptest/test_eval.rb
@@ -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]'
+