It's not obvious, but this is a refactoring. There should be no behavior changes.
HJT4MEZBYRGK5YMUK4XH4F75DRZ52QOGQZ4MLDG7RCNGHRJCO3KAC
2P7VQB7QZQCOI5BHR4DTFZJC43PU4C24CGTJGYJSAWKVE2FTSGVAC
VJA42DDC4I47CBTW6GQQ5VOMJL5POK5QSV6TWLAPYMLILCRJPEUAC
D5KRDRYYRE577UK2HETVORW7HQQUI7ZGLDG6N56QLDDOX6GP4O5QC
GMDEH4RHOR6DJABQ5WVGY4GVUU3QPWFTPFUHYUOULTVJZA2FTPAQC
GX7YHAAZ4OWTNADGUDY74NHJFBFCUF4QCR464UCC2YUBZU6WMVQQC
LDIYGOU473O3HPMOY2VDF5VTBDVUMJEB23V427KAEFGD64JGV4BAC
TNZWHTCSS5OQAWLJKUO53UXPT2WHXUWYDVGQPEFSBGCEYOTGMGBQC
IMEJA43L3OX7S5KIYLZJ4F3ITACLAA5SZBHSCIJMULCPRSW7LXBAC
DBPKNKLVQ6KGZLBGRMY6D6ZS3G7K3I5O6UU6EHHBFGR24NXPNZYAC
3QNOKBFMKBGXBVJIRHR2444JRRMBTABHE4674NR3DT67RRM2X6GAC
AVTNUQYRBW7IX2YQ3KDLVQ23RGW3BAKTAE7P73ASBYNKOHMQMH5AC
YCAVZNVY7KRCXTNKISVNIP2A3LOTLCJZEAMG5A2RVUUFFFQXQLTQC
F3JDOBJZBD3UI7ME6XPJZYHCKGQRITNTNLKRGIYXUJRWZCBGGCTAC
QZDCEIJQUFLOLBITHHCJWVGYCZZPIBVSZDRSAGRK2V2GUNJPLF5AC
3SEFLYPZ5FIQBPMKC2SLLWQSHGGN3FKX63YM5XUYFJVDH7Z3E4ZQC
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