Class: V8::StackFrame

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

Instance Method Summary collapse

Constructor Details

#initialize(native, context) ⇒ StackFrame

Returns a new instance of StackFrame.



34
35
36
37
# File 'lib/v8/stack.rb', line 34

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

Instance Method Details

#columnObject



57
58
59
60
61
# File 'lib/v8/stack.rb', line 57

def column
  @context.enter do
    @native.GetColumn()
  end
end

#constructor?Boolean

Returns:

  • (Boolean)


69
70
71
72
73
# File 'lib/v8/stack.rb', line 69

def constructor?
  @context.enter do
    @native.IsConstructor()
  end
end

#eval?Boolean

Returns:

  • (Boolean)


63
64
65
66
67
# File 'lib/v8/stack.rb', line 63

def eval?
  @context.enter do
    @native.IsEval()
  end
end

#function_nameObject



45
46
47
48
49
# File 'lib/v8/stack.rb', line 45

def function_name
  @context.enter do
    @context.to_ruby(@native.GetFunctionName())
  end
end

#line_numberObject



51
52
53
54
55
# File 'lib/v8/stack.rb', line 51

def line_number
  @context.enter do
    @native.GetLineNumber()
  end
end

#script_nameObject



39
40
41
42
43
# File 'lib/v8/stack.rb', line 39

def script_name
  @context.enter do
    @context.to_ruby(@native.GetScriptName())
  end
end

#to_sObject



75
76
77
78
79
80
81
82
83
# File 'lib/v8/stack.rb', line 75

def to_s
  @context.enter do
    "at " + if !function_name.empty?
      "#{function_name} (#{script_name}:#{line_number}:#{column})"
    else
      "#{script_name}:#{line_number}:#{column}"
    end
  end
end