Class: V8::StackTrace
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(native) ⇒ StackTrace
constructor
A new instance of StackTrace.
- #length ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(native) ⇒ StackTrace
Returns a new instance of StackTrace.
7 8 9 10 |
# File 'lib/v8/stack.rb', line 7 def initialize(native) @context = V8::Context.current @native = native end |
Instance Method Details
#each ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/v8/stack.rb', line 18 def each return unless @native @context.enter do for i in 0..length - 1 yield V8::StackFrame.new(@native.GetFrame(i), @context) end end end |
#length ⇒ Object
12 13 14 15 16 |
# File 'lib/v8/stack.rb', line 12 def length @context.enter do @native ? @native.GetFrameCount() : 0 end end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/v8/stack.rb', line 27 def to_s @native ? map(&:to_s).join("\n") : "" end |