diff --git a/ElvUI/Libraries/Ace3/AceAddon-3.0/AceAddon-3.0.lua b/ElvUI/Libraries/Ace3/AceAddon-3.0/AceAddon-3.0.lua index 3dbaa1c..00e4e48 100644 --- a/ElvUI/Libraries/Ace3/AceAddon-3.0/AceAddon-3.0.lua +++ b/ElvUI/Libraries/Ace3/AceAddon-3.0/AceAddon-3.0.lua @@ -30,7 +30,7 @@ -- @name AceAddon-3.0.lua -- @release $Id$ -local MAJOR, MINOR = "AceAddon-3.0", 12 +local MAJOR, MINOR = "AceAddon-3.0", 13 local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not AceAddon then return end -- No Upgrade needed. @@ -49,10 +49,6 @@ local select, pairs, next, type, unpack = select, pairs, next, type, unpack local loadstring, assert, error = loadstring, assert, error local setmetatable, getmetatable, rawset, rawget = setmetatable, getmetatable, rawset, rawget --- Global vars/functions that we don't upvalue since they might get hooked, or upgraded --- List them here for Mikk's FindGlobals script --- GLOBALS: LibStub, IsLoggedIn, geterrorhandler - --[[ xpcall safecall implementation ]] @@ -62,43 +58,12 @@ local function errorhandler(err) return geterrorhandler()(err) end -local function CreateDispatcher(argCount) - local code = [[ - local xpcall, eh = ... - local method, ARGS - local function call() return method(ARGS) end - - local function dispatch(func, ...) - method = func - if not method then return end - ARGS = ... - return xpcall(call, eh) - end - - return dispatch - ]] - - local ARGS = {} - for i = 1, argCount do ARGS[i] = "arg"..i end - code = code:gsub("ARGS", tconcat(ARGS, ", ")) - return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler) -end - -local Dispatchers = setmetatable({}, {__index=function(self, argCount) - local dispatcher = CreateDispatcher(argCount) - rawset(self, argCount, dispatcher) - return dispatcher -end}) -Dispatchers[0] = function(func) - return xpcall(func, errorhandler) -end - local function safecall(func, ...) -- we check to see if the func is passed is actually a function here and don't error when it isn't -- this safecall is used for optional functions like OnInitialize OnEnable etc. When they are not -- present execution should continue without hinderance if type(func) == "function" then - return Dispatchers[select('#', ...)](func, ...) + return xpcall(func, errorhandler, ...) end end @@ -632,10 +597,20 @@ function AceAddon:IterateAddonStatus() return pairs(self.statuses) end function AceAddon:IterateEmbedsOnAddon(addon) return pairs(self.embeds[addon]) end function AceAddon:IterateModulesOfAddon(addon) return pairs(addon.modules) end +-- Blizzard AddOns which can load very early in the loading process and mess with Ace3 addon loading +local BlizzardEarlyLoadAddons = { + Blizzard_DebugTools = true, + Blizzard_TimeManager = true, + Blizzard_BattlefieldMap = true, + Blizzard_MapCanvas = true, + Blizzard_SharedMapDataProviders = true, + Blizzard_CombatLog = true, +} + -- Event Handling local function onEvent(this, event, arg1) - -- 2011-08-17 nevcairiel - ignore the load event of Blizzard_DebugTools, so a potential startup error isn't swallowed up - if (event == "ADDON_LOADED" and arg1 ~= "Blizzard_DebugTools") or event == "PLAYER_LOGIN" then + -- 2020-08-28 nevcairiel - ignore the load event of Blizzard addons which occur early in the loading process + if (event == "ADDON_LOADED" and (arg1 == nil or not BlizzardEarlyLoadAddons[arg1])) or event == "PLAYER_LOGIN" then -- if a addon loads another addon, recursion could happen here, so we need to validate the table on every iteration while(#AceAddon.initializequeue > 0) do local addon = tremove(AceAddon.initializequeue, 1) diff --git a/ElvUI/Libraries/Ace3/AceBucket-3.0/AceBucket-3.0.lua b/ElvUI/Libraries/Ace3/AceBucket-3.0/AceBucket-3.0.lua index c074b5c..d89dcee 100644 --- a/ElvUI/Libraries/Ace3/AceBucket-3.0/AceBucket-3.0.lua +++ b/ElvUI/Libraries/Ace3/AceBucket-3.0/AceBucket-3.0.lua @@ -34,7 +34,7 @@ -- end -- @class file -- @name AceBucket-3.0.lua --- @release $Id: AceBucket-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $ +-- @release $Id$ local MAJOR, MINOR = "AceBucket-3.0", 4 local AceBucket, oldminor = LibStub:NewLibrary(MAJOR, MINOR) @@ -53,16 +53,12 @@ local type, next, pairs, select = type, next, pairs, select local tonumber, tostring, rawset = tonumber, tostring, rawset local assert, loadstring, error = assert, loadstring, error --- Global vars/functions that we don't upvalue since they might get hooked, or upgraded --- List them here for Mikk's FindGlobals script --- GLOBALS: LibStub, geterrorhandler - local bucketCache = setmetatable({}, {__mode='k'}) --[[ - pcall safecall implementation + xpcall safecall implementation ]] -local pcall = pcall +local xpcall = xpcall local function errorhandler(err) return geterrorhandler()(err) @@ -70,13 +66,7 @@ end local function safecall(func, ...) if func then - local ok, err = pcall(func, ...) - if ok then - return true - else - errorhandler(err) - return false - end + return xpcall(func, errorhandler, ...) end end diff --git a/ElvUI/Libraries/Ace3/AceBucket-3.0/AceBucket-3.0.xml b/ElvUI/Libraries/Ace3/AceBucket-3.0/AceBucket-3.0.xml index 06ab712..43c6bee 100644 --- a/ElvUI/Libraries/Ace3/AceBucket-3.0/AceBucket-3.0.xml +++ b/ElvUI/Libraries/Ace3/AceBucket-3.0/AceBucket-3.0.xml @@ -1,4 +1,4 @@