aboutsummaryrefslogtreecommitdiffstats
path: root/lib/irb/frame.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-11-25 05:38:09 +0900
committeraycabta <aycabta@gmail.com>2019-11-25 05:38:09 +0900
commit51ea1abb5f2ed70387dda28a5d0d9ee817367d61 (patch)
treef7eb2f57a21436682212399ecc34dcacbb5b91c2 /lib/irb/frame.rb
parentefbca15116d4aea1588c6ba4ef0eb72c3c55c1db (diff)
downloadruby-51ea1abb5f2ed70387dda28a5d0d9ee817367d61.tar.gz
Remove e2mmap dependency
Diffstat (limited to 'lib/irb/frame.rb')
-rw-r--r--lib/irb/frame.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/irb/frame.rb b/lib/irb/frame.rb
index 6073809249..de54a98f1b 100644
--- a/lib/irb/frame.rb
+++ b/lib/irb/frame.rb
@@ -10,13 +10,18 @@
#
#
-require "e2mmap"
-
module IRB
class Frame
- extend Exception2MessageMapper
- def_exception :FrameOverflow, "frame overflow"
- def_exception :FrameUnderflow, "frame underflow"
+ class FrameOverflow < StandardError
+ def initialize
+ super("frame overflow")
+ end
+ end
+ class FrameUnderflow < StandardError
+ def initialize
+ super("frame underflow")
+ end
+ end
# Default number of stack frames
INIT_STACK_TIMES = 3
@@ -44,7 +49,7 @@ module IRB
# Raises FrameUnderflow if there are no frames in the given stack range.
def top(n = 0)
bind = @frames[-(n + CALL_STACK_OFFSET)]
- Fail FrameUnderflow unless bind
+ fail FrameUnderflow unless bind
bind
end
@@ -54,7 +59,7 @@ module IRB
# Raises FrameOverflow if there are no frames in the given stack range.
def bottom(n = 0)
bind = @frames[n]
- Fail FrameOverflow unless bind
+ fail FrameOverflow unless bind
bind
end