From e00d066f7a7cb1ffd8df94d90e16565c3dedeec7 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 14 Jul 2013 10:01:25 +0200 Subject: sync with Context as of 2013-07-14 --- lualibs-util-tab.lua | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lualibs-util-tab.lua') diff --git a/lualibs-util-tab.lua b/lualibs-util-tab.lua index b7db4fa..f18c719 100644 --- a/lualibs-util-tab.lua +++ b/lualibs-util-tab.lua @@ -293,13 +293,12 @@ function tables.encapsulate(core,capsule,protect) end end --- we no longer have %q in keys as for this kind of tables we can --- assume sane keys +-- best keep [%q] keys (as we have some in older applications i.e. saving user data -local f_hashed_string = formatters["[%s]=%q,"] -local f_hashed_number = formatters["[%s]=%s,"] -local f_hashed_boolean = formatters["[%s]=%l,"] -local f_hashed_table = formatters["[%s]="] +local f_hashed_string = formatters["[%q]=%q,"] +local f_hashed_number = formatters["[%q]=%s,"] +local f_hashed_boolean = formatters["[%q]=%l,"] +local f_hashed_table = formatters["[%q]="] local f_indexed_string = formatters["%q,"] local f_indexed_number = formatters["%s,"] @@ -521,7 +520,7 @@ local serialize = table.serialize -- the extensive one, the one we started with function table.serialize(root,name,specification) - if specification then + if type(specification) == "table" then return serialize(root,name,specification) -- the original one end -- cgit v1.2.3