# HG changeset patch # User jbe # Date 1426985151 -3600 # Node ID 851452af0c3661e8bf1335af736404e3865abda3 # Parent 81711c529eb2deddacd1bdc8c27a3726fe7a9f0e Fixed documentation for JSON library: __len and __index metamethods are used instead of __ipairs diff -r 81711c529eb2 -r 851452af0c36 libraries/json/json.autodoc.lua --- a/libraries/json/json.autodoc.lua Sun Mar 22 00:58:14 2015 +0100 +++ b/libraries/json/json.autodoc.lua Sun Mar 22 01:45:51 2015 +0100 @@ -35,7 +35,7 @@ ... } -Converts a Lua table (or any other value with an __ipairs metamethod) to a JSON array. The argument is never modified. May also be called without arguments to create an empty JSON array. All JSON arrays support iteration using ipairs(...). When accessing or iterating over JSON arrays, null values will read as nil. To set a value to null, it needs to be set to the special value of json.null though. Setting a value to nil will delete the entry. The length operator (#) returns meaningful results if and only if the set of positive integer keys which have a value assigned (including the special value of null) is equal to the set of all numbers from 1 to some integer n (i.e. the array contains no gaps, but intermediate null values are allowed). +Converts a Lua table (or any other value with __len and __index metamethods) to a JSON array. The argument is never modified. May also be called without arguments to create an empty JSON array. All JSON arrays support iteration using ipairs(...). When accessing or iterating over JSON arrays, null values will read as nil. To set a value to null, it needs to be set to the special value of json.null though. Setting a value to nil will delete the entry. The length operator (#) returns meaningful results if and only if the set of positive integer keys which have a value assigned (including the special value of null) is equal to the set of all numbers from 1 to some integer n (i.e. the array contains no gaps, but intermediate null values are allowed). --]]-- -- implemented in json.c as