Skip to content

Commit

Permalink
allow to use a lua without debug library
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed Jun 9, 2021
1 parent 54606a9 commit 917b94d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion http/bit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This means we can ignore the differences between bit libraries.
if _VERSION ~= "Lua 5.1" then
-- Lua 5.3+ has built-in bit operators, wrap them in a function.
-- Use debug.getinfo to get correct file+line numbers for loaded snippet
local info = debug.getinfo(1, "Sl")
local info = debug and debug.getinfo(1, "Sl") or { currentline = -1 }
local has_bitwise, bitwise = pcall(load(("\n"):rep(info.currentline+1)..[[return {
band = function(a, b) return a & b end;
bor = function(a, b) return a | b end;
Expand Down
2 changes: 1 addition & 1 deletion http/h2_error.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function http_error_methods:new_traceback(message, stream_error, lvl)
message = message;
stream_error = stream_error;
}
if lvl ~= 0 then
if lvl ~= 0 and debug then
-- COMPAT: should be passing `nil` message (not the empty string)
-- see https://github.com/keplerproject/lua-compat-5.3/issues/16
e.traceback = debug.traceback("", lvl)
Expand Down

0 comments on commit 917b94d

Please sign in to comment.