Compare commits
No commits in common. "c0d65f7f381f3e73c14170dd1294aac18a143d8a" and "4c2e732607482a31b4fb55b9238504b3e3217f7f" have entirely different histories.
c0d65f7f38
...
4c2e732607
@ -28,19 +28,14 @@ end
|
|||||||
local function debugREPL(onResult, debugArgs)
|
local function debugREPL(onResult, debugArgs)
|
||||||
local globalEnv = copyObject(_ENV)
|
local globalEnv = copyObject(_ENV)
|
||||||
globalEnv._debug = debugArgs
|
globalEnv._debug = debugArgs
|
||||||
local shouldExit = false
|
|
||||||
globalEnv.exit = function()
|
|
||||||
shouldExit = true
|
|
||||||
end
|
|
||||||
local result, retval
|
local result, retval
|
||||||
repeat
|
repeat
|
||||||
result, retval = execDebug(globalEnv)
|
result, retval = execDebug(globalEnv)
|
||||||
if result and type(onResult) == "function" then
|
if result and type(onResult) == "function" then
|
||||||
onResult(retval)
|
onResult(retval)
|
||||||
end
|
end
|
||||||
until shouldExit or not result
|
until not result
|
||||||
local success = result and shouldExit
|
return retval
|
||||||
return success, (not success and retval) or nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return { debugREPL = debugREPL, execDebug = execDebug }
|
return { debugREPL = debugREPL, execDebug = execDebug }
|
@ -8,15 +8,12 @@ local ItemStack = Sentinel:tag({}, Sentinel.ITEMSTACK)
|
|||||||
ItemStack.__index = ItemStack
|
ItemStack.__index = ItemStack
|
||||||
|
|
||||||
local function hookDebugger(context)
|
local function hookDebugger(context)
|
||||||
local result, retval
|
while true do
|
||||||
repeat
|
local errorCond = Debugger.debugREPL(function(retval)
|
||||||
result, retval = Debugger.debugREPL(function(r)
|
Logger:error("->", retval)
|
||||||
Logger:error("->", r)
|
|
||||||
end, context)
|
end, context)
|
||||||
if not result then
|
Logger:error("x>", errorCond)
|
||||||
Logger:error("x>", retval)
|
end
|
||||||
end
|
|
||||||
until result
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ItemStack:fromDetail(inv, detail, slot)
|
function ItemStack:fromDetail(inv, detail, slot)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user