1
0
Fork 0
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:
Joshua Peek 2015-03-05 11:07:33 -08:00
parent 53f8bf9292
commit 65a55b6d29

View file

@ -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