from retail

This commit is contained in:
NoM0Re
2025-01-09 17:17:53 +01:00
parent 55709443ae
commit aee89075c9
8 changed files with 67 additions and 45 deletions
+11 -2
View File
@@ -450,7 +450,8 @@ local FakeWeakAurasMixin = {
Private.AuraWarnings.UpdateWarning(current_uid, "FakeWeakAurasGetData", "warning",
L["This aura calls GetData a lot, which is a slow function."])
end
return CopyTable(WeakAuras.GetData(id))
local data = WeakAuras.GetData(id)
return data and CopyTable(data) or nil
end,
clones = MakeDeprecated(Private.clones, "clones",
L["Using WeakAuras.clones is deprecated. Use WeakAuras.GetRegion(id, cloneId) instead."]),
@@ -561,13 +562,21 @@ function env_getglobal_builtin(k)
return exec_env_builtin[k]
end
local function firstLine(string)
local lineBreak = string:find('\n', 1, true)
if lineBreak then
return string:sub(1, lineBreak - 1)
end
return string
end
local function CreateFunctionCache(exec_env)
local cache = {}
cache.Load = function(self, string)
if self[string] then
return self[string]
else
local loadedFunction, errorString = loadstring(string)
local loadedFunction, errorString = loadstring(string, firstLine(string))
if errorString then
print(errorString)
else