Class: V8::StackTrace

Inherits:
Object show all
Includes:
Enumerable
Defined in:
lib/v8/stack.rb

Instance Method Summary collapse

Constructor Details

#initialize(to, native) ⇒ StackTrace

Returns a new instance of StackTrace.



7
8
9
10
# File 'lib/v8/stack.rb', line 7

def initialize(to, native)
  @to = to
  @native = native
end

Instance Method Details

#eachObject



16
17
18
19
20
# File 'lib/v8/stack.rb', line 16

def each
  for i in 0..length - 1
    yield V8::StackFrame.new(@to, @native.GetFrame(i))
  end
end

#lengthObject



12
13
14
# File 'lib/v8/stack.rb', line 12

def length
  @native.GetFrameCount()
end

#to_sObject



22
23
24
# File 'lib/v8/stack.rb', line 22

def to_s
  map {|f|"at #{f}"}.join("\n")
end