summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-catch/mrblib
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-catch/mrblib')
-rw-r--r--mrbgems/mruby-catch/mrblib/catch.rb16
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