diff options
author | Malcolm Reynolds <mareynolds@google.com> | 2016-01-29 14:15:53 +0300 |
---|---|---|
committer | Malcolm Reynolds <mareynolds@google.com> | 2016-01-29 14:15:53 +0300 |
commit | 3e84c827f635ee516c17d5374360501626ced13d (patch) | |
tree | 970524ed565443f88e0801e7d477aacf3e2c38bb | |
parent | b43cc8247fc789fed63f86e5aaa91582f1e15450 (diff) |
Change copyNested to error when there are extra keys in output.
-rw-r--r-- | nesting.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nesting.lua b/nesting.lua index e1ddd7b..a58066b 100644 --- a/nesting.lua +++ b/nesting.lua @@ -59,10 +59,10 @@ function nesting.copyNested(output, input) for key, child in pairs(input) do nesting.copyNested(output[key], child) end - -- Extra elements are removed from the output. + -- Extra elements in the output table cause an error. for key, child in pairs(output) do if not input[key] then - output[key] = nil + error('key ' .. key .. ' present in output but not in input') end end end |