summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-19 13:22:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-19 13:22:03 +0000
commit2fe13f62efe400736bb078cafcebba5f5ba7b83b (patch)
tree2d0243f454411a4cc84972d3035d2f8559588bae /test
parentb0e40509c3b60242c6a1b0e67276849eea505977 (diff)
vm.c: pass through thrown objects
* vm.c (rb_vm_jump_tag_but_local_jump): pass through thrown objects. [ruby-dev:46234] [Bug #7185] * vm_eval.c (rb_eval_cmd): if state is non-zero, val should be nil and rb_vm_jump_tag_but_local_jump() just jump tag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_exception.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 17492706ed..a39e2c7723 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -104,7 +104,16 @@ class TestException < Test::Unit::TestCase
end
false
})
+ end
+ def test_catch_throw_in_require
+ bug7185 = '[ruby-dev:46234]'
+ t = Tempfile.open(["dep", ".rb"])
+ t.puts("throw :extdep, 42")
+ t.close
+ assert_equal(42, catch(:extdep) {require t.path}, bug7185)
+ ensure
+ t.close! if t
end
def test_else_no_exception