luci-base: luci.util: rewrite threadlocal code to not confuse minifier

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
Jo-Philipp Wich 2015-01-08 15:56:35 +01:00
parent 1bb4822dca
commit fa84ca05d5

View file

@ -125,10 +125,11 @@ local tl_meta = {
__newindex = function(self, key, value)
local c = coxpt[coroutine.running()] or coroutine.running() or 0
if not rawget(self, c) then
local r = rawget(self, c)
if not r then
rawset(self, c, { [key] = value })
else
rawget(self, c)[key] = value
r[key] = value
end
end
}