Exception: MiniRacer::RuntimeError

Inherits:
EvalError show all
Defined in:
lib/mini_racer.rb

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ RuntimeError

Returns a new instance of RuntimeError.


27
28
29
30
31
32
33
34
35
36
# File 'lib/mini_racer.rb', line 27

def initialize(message)
  message, js_backtrace = message.split("\n", 2)
  if js_backtrace && !js_backtrace.empty?
    @js_backtrace = js_backtrace.split("\n")
    @js_backtrace.map!{|f| "JavaScript #{f.strip}"}
  else
    @js_backtrace = nil
  end
  super(message)
end

Instance Method Details

#backtraceObject


38
39
40
41
42
43
44
45
46
# File 'lib/mini_racer.rb', line 38

def backtrace
  val = super
  return unless val
  if @js_backtrace
    @js_backtrace + val
  else
    val
  end
end