Skip to content

Commit 8d528e0

Browse files
committed
allow to use a lua without debug library
1 parent 54606a9 commit 8d528e0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

http/bit.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This means we can ignore the differences between bit libraries.
1111
if _VERSION ~= "Lua 5.1" then
1212
-- Lua 5.3+ has built-in bit operators, wrap them in a function.
1313
-- Use debug.getinfo to get correct file+line numbers for loaded snippet
14-
local info = debug.getinfo(1, "Sl")
14+
local info = debug and debug.getinfo(1, "Sl") or { currentline = 14 }
1515
local has_bitwise, bitwise = pcall(load(("\n"):rep(info.currentline+1)..[[return {
1616
band = function(a, b) return a & b end;
1717
bor = function(a, b) return a | b end;

http/h2_error.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function http_error_methods:new_traceback(message, stream_error, lvl)
5252
if lvl ~= 0 then
5353
-- COMPAT: should be passing `nil` message (not the empty string)
5454
-- see https://github.com/keplerproject/lua-compat-5.3/issues/16
55-
e.traceback = debug.traceback("", lvl)
55+
e.traceback = debug and debug.traceback("", lvl) or "no debug.traceback"
5656
end
5757

5858
return self:new(e)

0 commit comments

Comments
 (0)