diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-02-10 20:11:40 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-02-10 20:11:40 +0900 |
| commit | 5735d7c2fd18c7d92bfe7a7d1d68547e5765c60d (patch) | |
| tree | 4c605fa48cf54c5cd3ab0e08f6e779fa74d00034 /mrbgems/mruby-catch/mrblib/catch.rb | |
| parent | 20342714ea2d01687909aea3dbd2d43877e5a571 (diff) | |
| parent | c7809ca025b3b81dd6fb695f27bd5d0dfa3174af (diff) | |
| download | mruby-5735d7c2fd18c7d92bfe7a7d1d68547e5765c60d.tar.gz mruby-5735d7c2fd18c7d92bfe7a7d1d68547e5765c60d.zip | |
Merge branch 'dearblue-mruby-catch'
Diffstat (limited to 'mrbgems/mruby-catch/mrblib/catch.rb')
| -rw-r--r-- | mrbgems/mruby-catch/mrblib/catch.rb | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/mrbgems/mruby-catch/mrblib/catch.rb b/mrbgems/mruby-catch/mrblib/catch.rb index 68b165c8d..8e5f59023 100644 --- a/mrbgems/mruby-catch/mrblib/catch.rb +++ b/mrbgems/mruby-catch/mrblib/catch.rb @@ -1,4 +1,4 @@ -class ThrowCatchJump < Exception +class UncaughtThrowError < ArgumentError attr_reader :_tag, :_val def initialize(tag, val) @_tag = tag @@ -6,17 +6,3 @@ class ThrowCatchJump < Exception super("uncaught throw #{tag.inspect}") end end - -module Kernel - def catch(tag=Object.new, &block) - block.call(tag) - rescue ThrowCatchJump => e - unless e._tag.equal?(tag) - raise e - end - return e._val - end - def throw(tag, val=nil) - raise ThrowCatchJump.new(tag, val) - end -end |
