7MOX7PIKINJ5JE2HPCY5RGRE553MM4ZAQGT4JFYS2PSDA6XAZDVAC end-- Everything that exists before we start loading the live files is frozen and-- can't be edited live.function app.freeze_all_existing_definitions()app.Frozen_definitions = {on=true} -- special case for version 1local done = {}done[app.Frozen_definitions]=trueapp.freeze_all_existing_definitions_in(_G, {}, done)endfunction app.freeze_all_existing_definitions_in(tab, scopes, done)-- track duplicates to avoid cycles like _G._G, _G._G._G, etc.if done[tab] then return enddone[tab] = truefor name,binding in pairs(tab) dolocal full_name = app.full_name(scopes, name)--? print(full_name)app.Frozen_definitions[full_name] = trueif type(binding) == 'table' and full_name ~= 'package' then -- var 'package' contains copies of all modules, but not the best name; rely on people to not modify package.loaded.io.open, etc.table.insert(scopes, name)app.freeze_all_existing_definitions_in(binding, scopes, done)table.remove(scopes)endendendfunction app.full_name(scopes, name)local ns = table.concat(scopes, '.')if #ns == 0 then return name endreturn ns..'.'..name
end-- Everything that exists before we start loading the live files is frozen and-- can't be edited live.function app.freeze_all_existing_definitions()app.Frozen_definitions = {on=true} -- special case for version 1local done = {}done[app.Frozen_definitions]=trueapp.freeze_all_existing_definitions_in(_G, {}, done)
function app.freeze_all_existing_definitions_in(tab, scopes, done)-- track duplicates to avoid cycles like _G._G, _G._G._G, etc.if done[tab] then return enddone[tab] = truefor name,binding in pairs(tab) dolocal full_name = app.full_name(scopes, name)--? print(full_name)app.Frozen_definitions[full_name] = trueif type(binding) == 'table' and full_name ~= 'package' then -- var 'package' contains copies of all modules, but not the best name; rely on people to not modify package.loaded.io.open, etc.table.insert(scopes, name)app.freeze_all_existing_definitions_in(binding, scopes, done)table.remove(scopes)endendendfunction app.full_name(scopes, name)local ns = table.concat(scopes, '.')if #ns == 0 then return name endreturn ns..'.'..nameend