I have been looking though an addon called
BlackList, which the author seems to have abandoned.
The following is all working code... I just have no idea how it is possible:
In the TOC the only saved variable is BlackListConfig:
Code:
(7) ## SavedVariables: BlackListConfig
After VARIABLES_LOADED fires, this runs:
Code:
(54) if ( not BlackListConfig ) then
(55) BlackListConfig = {};
(56) end
(57)
(58) if ( not BlackListConfig[REALM] ) then
(59) BlackListConfig[REALM] = {};
(60) end
(61)
(62) if ( not BlackListConfig[REALM].blackList ) then
(63) BlackListConfig[REALM].blackList = {};
(64) end
(65)
(66) _blackList = BlackListConfig[REALM].blackList;
After this point there is no significant reference to "BlackListConfig[REALM].blackList". All changes and additions to the database use "_blackList". Yet all the changes that are made to _blackList are saved and loaded between sessions.
Is there anything special about the naming convention that allows this to happen? There is no direct code copying the contents of _blackList back to BlackListConfig[REALM].blackList at any time.