mirror of
https://github.com/rails/execjs
synced 2023-03-27 23:21:20 -04:00
Fix when no output
This commit is contained in:
parent
53f8bf9292
commit
65a55b6d29
1 changed files with 3 additions and 1 deletions
|
@ -213,7 +213,9 @@ module ExecJS
|
|||
|
||||
def exec_runtime_error(output)
|
||||
error = RuntimeError.new(output)
|
||||
lineno = output.split("\n")[0][/:(\d+)$/, 1] || 1
|
||||
lines = output.split("\n")
|
||||
lineno = lines[0][/:(\d+)$/, 1] if lines[0]
|
||||
lineno ||= 1
|
||||
error.set_backtrace(["(execjs):#{lineno}"] + caller)
|
||||
error
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue