summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/util.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-01-08 15:56:35 +0100
committerJo-Philipp Wich <jow@openwrt.org>2015-01-08 16:26:20 +0100
commitfa84ca05d59b26d918f0730cc16680688c639139 (patch)
treecceab87b88a465c8dc3d57e161a1784df7505915 /modules/luci-base/luasrc/util.lua
parent1bb4822dca6113f73e3bc89e2acf15935e6f8e92 (diff)
luci-base: luci.util: rewrite threadlocal code to not confuse minifier
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'modules/luci-base/luasrc/util.lua')
-rw-r--r--modules/luci-base/luasrc/util.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/luci-base/luasrc/util.lua b/modules/luci-base/luasrc/util.lua
index da761e219..060e45f95 100644
--- a/modules/luci-base/luasrc/util.lua
+++ b/modules/luci-base/luasrc/util.lua
@@ -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
}