It's not obvious, but this is a refactoring. There should be no behavior changes.
JOLUCIT6HFXFKYQ6PNGSNBF4GBYDA6ATVOITT2SYGJH7HBURTDDAC
LYIV4YOLU6KYRCBU64M4YXS57CZ23YQHJ4WPVDNAZL4TMDGYV7MQC
LSWOBVHDI5Z63IR2GEJF56RZ65CBFXPP6GGA3VA3XBQCGE4DWIQQC
FFFJ54GJ3A2HNKZEHO7RHUZ2YWT67EK4B3Y2YJVYCEUANGY6BQQAC
LRDM35CEK3OHXOTB7TEFJRL7P6PQWO5ZG3F2BVA7DIDFHBPJQ7KAC
FFMMA7L2JRNIHG53TGHX5JDMPKUWL3ILB4FQ47R27JR3BSPYXQUQC
3BRGOF7NV52C3CY6HLGH53TDW2OHRQYQHWBEA3P6BKCUTN5DVHQQC
K7YGVRXHXCOE4WHURFIZ4H7MH2YE3SPMHT6M2FPUHQ5P226FM2TAC
IMEJA43L3OX7S5KIYLZJ4F3ITACLAA5SZBHSCIJMULCPRSW7LXBAC
JNJ4R56X3HVU4IGKZZ2IV73PALEXSYOIOAIVXZTV43BG7PEY6AOQC
3QNOKBFMKBGXBVJIRHR2444JRRMBTABHE4674NR3DT67RRM2X6GAC
AVTNUQYRBW7IX2YQ3KDLVQ23RGW3BAKTAE7P73ASBYNKOHMQMH5AC
D5J7IZADWXMHCCNFOROFEBUOSE34VDLN4K3TUIZEEC4YT4IB5EVAC
3QMTXKWN7RME7ZJ62BIY2PSG733DEZS52QTRR5745IPLYUX542CQC
5ZCQGZP5VK6RIXOFQ7L4OGXFRRBPWWJNQYTWVUKJRCO7UTBPA3IAC
CZQ3NJ4NQYNXUV5GLD4RI5ISNDDWTUZIL5UA366M6WBHL6SA2EUAC
love.graphics.setFont(current_font)
live.restore_all_globals(globals)
end
end
function live.shallow_copy_all_globals()
local result = {}
for k,v in pairs(_G) do
result[k] = v
end
return result
end
function live.restore_all_globals(x)
-- delete extra bindings
for k,v in pairs(_G) do
if x[k] == nil then
_G[k] = nil
end
end
-- restore previous bindings
for k,v in pairs(x) do
_G[k] = v
App.initialize_for_test()
xpcall(test, function(err) record_error_fn('', err) end)
App = saved_app
local saved_font = love.graphics.getFont()
love.graphics.setFont(Love_snapshot.initial_font)
App.initialize_for_test()
xpcall(test, function(err) record_error_fn('', err) end)
love.graphics.setFont(saved_font)
-- restore all global state except Test_errors
local test_errors = Test_errors
App.restore_all_globals(globals)
Test_errors = test_errors
end
function App.shallow_copy_all_globals()
local result = {}
for k,v in pairs(_G) do
result[k] = v
end
return result
end
function App.restore_all_globals(x)
-- delete extra bindings
for k,v in pairs(_G) do
if x[k] == nil then
_G[k] = nil
end
end
-- restore previous bindings
for k,v in pairs(x) do
_G[k] = v
end