1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Remove e2mmap dependency

This commit is contained in:
aycabta 2019-11-25 05:38:09 +09:00
parent efbca15116
commit 51ea1abb5f
11 changed files with 157 additions and 67 deletions

View file

@ -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