summaryrefslogtreecommitdiffhomepage
path: root/libs/luci-lib-json
diff options
context:
space:
mode:
Diffstat (limited to 'libs/luci-lib-json')
-rw-r--r--libs/luci-lib-json/luasrc/json.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/luci-lib-json/luasrc/json.lua b/libs/luci-lib-json/luasrc/json.lua
index f7b57f916..6d4d752b1 100644
--- a/libs/luci-lib-json/luasrc/json.lua
+++ b/libs/luci-lib-json/luasrc/json.lua
@@ -181,13 +181,18 @@ function Encoder.parse_iter(self, obj)
end
end
+function Encoder.parse_udata(self, obj)
+ return self:parse_string(tostring(obj))
+end
+
Encoder.parsers = {
['nil'] = Encoder.parse_nil,
['table'] = Encoder.parse_iter,
['number'] = Encoder.parse_number,
['string'] = Encoder.parse_string,
['boolean'] = Encoder.parse_bool,
- ['function'] = Encoder.parse_iter
+ ['function'] = Encoder.parse_iter,
+ ['userdata'] = Encoder.parse_udata,
}