aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Force binary file mode in util.luaMark Pulford2012-03-041-2/+2
| | | | | Force binary file mode in util.lua to fix the utf8.dat test under Windows.
* Reduce length of CMake option descriptionsMark Pulford2012-03-041-3/+2
|
* Ignore DISABLE_INVALID_NUMBERS with builtin fpconvMark Pulford2012-03-042-13/+16
|
* Rename USE_INTERNAL_DTOA to USE_INTERNAL_FPCONVMark Pulford2012-03-044-7/+7
|
* Support building packages with version tags >1.xMark Pulford2012-03-041-2/+2
|
* Convert perf results to HTML and update for 2.0.0Mark Pulford2012-03-044-53/+74
|
* Add MULTIPLE_THREADS to Makefile #define listMark Pulford2012-03-041-1/+3
|
* Bump version to 2.0develMark Pulford2012-03-048-14/+14
| | | | | Bump version to 2.0devel due to significant changes and updated API (runtime config not fully backwards compatible).
* Simplify string.format() callsMark Pulford2012-03-043-15/+14
| | | | Simply string.format() calls with OO method notation.
* Fix runtests.sh after API change and file movesMark Pulford2012-03-041-5/+5
| | | | | | Fix runtests.sh after: - "util" module moved to lua/cjson - "version" removed
* Create separate tests for numbers w/leading zerosMark Pulford2012-03-041-3/+8
| | | | | | Create separate tests for numbers with leading zeros. This allows the earlier "normal" number test to pass. Also update hexadecimal test to use the "p" exponent format.
* Fix string length returned by g_fmt.c for |x|<1Mark Pulford2012-03-041-0/+1
| | | | | Fix string length returned by built in fpconv_g_fmt() so it doesn't include the trailing null when converting numbers |x|<1.
* Reserve stack slot for luaL_error() during encodeMark Pulford2012-03-041-4/+11
| | | | | | | | | | Unlike "decode", encoding leaves both the key/value on the stack before descending. This leaves no spare room for luaL_error() in case the depth check or lua_checkstack() fails. Allocate an extra stack slot to ensure there is always room for luaL_error() in json_check_encode_depth(). Note: this would not have caused a crash or fault due to the EXTRA_STACK slot reserve, but it was a misuse of the Lua C API.
* Add an RPM %preun script to remove utf8.datMark Pulford2012-03-041-0/+4
| | | | | | Add an RPM %preun script to remove utf8.dat. Otherwise the user generated test file will cause RPM to leave behind the cjson/tests module directories.
* Remove deprecated "refuse_invalid_numbers"Mark Pulford2012-03-042-40/+2
| | | | | | Remove deprecated "refuse_invalid_numbers" since the version number will be bumped to 1.1.0. Also remove "version" variable since it has been replaced by _VERSION.
* Bump development version to 1.1develMark Pulford2012-03-047-13/+13
|
* Disable registration of cjson global variableMark Pulford2012-03-045-14/+9
| | | | | | | Disable registration of cjson module table global variable in the default build. Automatically creating a variable in the global namespace can cause issues for other software and is no longer recommended with Lua.
* Return boolean values from configuration functionsMark Pulford2012-03-042-16/+19
| | | | | | Return boolean values from configuration functions to simplify usage in the common case. Eg,: if not cjson.encode_invalid_numbers() then .. end
* Add CMake option to toggle DISABLE_CJSON_GLOBALMark Pulford2012-03-041-0/+5
|
* Add depth/index to decode depth error messageMark Pulford2012-03-042-4/+8
| | | | | | | | | Include depth and character index when throwing decode nesting errors. Pre-emptively add a test decoding a massively nested JSON array. Lua stack overflow faults are unlikely to occur on simple data structures. Valgrind can highlight stack allocation bugs with complicated JSON even if the test succeeds.
* Fix Lua C function stack overflow during encodingMark Pulford2012-03-042-7/+21
| | | | | | | | | Ensure there are enough Lua stack slots available before descending into another table during encoding. This fixes a segfault when encoding deeply nested tables. This bug wasn't noticed earlier due to the previous limit of 20 nested tables.
* Update archive download URLMark Pulford2012-03-042-2/+2
|
* Recommend genutf8.pl when utf8.dat is missingMark Pulford2012-03-041-1/+1
|
* Add "throw error" to test descriptionsMark Pulford2012-03-041-41/+41
| | | | | Add "throw error" to descriptions for tests which are intended to generate errors.
* Test config API errors and setting configurationMark Pulford2012-03-041-28/+66
| | | | | | | - Update comments - Use enumerated return values - Test various configuration API errors - Test resetting configuration to default
* Tidy tests and improve coverageMark Pulford2012-03-042-85/+113
| | | | | | | | | | | | - Rearrange test sections to keep more related tests together. - Test configuration functions for errors Add tests for more parts of the Lua CJSON API: - _NAME, _VERSION, version - encode_keep_buffer - encode_number_precision - decode_invalid_numbers - decode_max_depth
* Place nested data structure inline with testsMark Pulford2012-03-041-4/+2
| | | | | Make the tests more explicit, the nested data structure doesn't need to be generated in advance.
* Gather all test data into a tableMark Pulford2012-03-041-20/+32
| | | | Move all test data into a single data to tidy the main namespace.
* Add descriptions to all testsMark Pulford2012-03-042-160/+204
| | | | Rewrite test framework and add descriptions for all tests.
* Simplify configuration function codeMark Pulford2012-03-041-60/+47
| | | | | | | Simplify configuration functions by adding an argument position parameter to json_enum_option() and json_integer_option(). Create json_arg_init() to check the number of arguments and return the config data.
* Merge lua_json_decode() into json_decode()Mark Pulford2012-03-041-28/+14
| | | | Also ensure cjson.decode() only receives a single argument.
* Add tests for decode_max_depth()Mark Pulford2012-03-041-5/+13
|
* Use Lua CJSON instead of CJSON in documentationMark Pulford2012-03-041-3/+3
|
* Update copyright date range to include 2012Mark Pulford2012-03-045-6/+30
|
* Change default nesting limits to 1000Mark Pulford2012-03-042-5/+5
| | | | | Increase the default nesting limits to reduce the chance of accidently throwing an error on valid JSON out of the box.
* Improve benchmark stabilityMark Pulford2012-03-041-7/+36
| | | | | | | | | Update benchmark script to average the best half (round up) of the result set. Ensure the initial call rate is calculated from a run of at least 1ms. Remove garbage collection control since any variations due to garbage collection are better handled by averaging multiple results.
* Use static strtod() buffer where possibleMark Pulford2012-03-041-5/+13
| | | | | Use static strtod() buffer where possible to improve performance 5-10% under locales with a comma decimal point.
* Add option to encode invalid numbers as "null"Mark Pulford2012-03-043-111/+180
| | | | | Deprecate and replace refuse_invalid_numbers() with encode_invalid_numbers() and decode_invalid_numbers().
* Add configurable decode nesting limitMark Pulford2012-03-042-35/+89
| | | | | | | | | | | Lua 5.2 is able to extend the Lua stack much further than earlier versions. Recent testing shows it is possible for Lua CJSON to hit the process stack limit and segfault. Add a configurable JSON object/array nesting limit to prevent running out of process stack space. The current limit is 20 (same as encode). Add decode_max_depth() configuration function.
* Update rockspec to install lua2json/json2luaMark Pulford2012-03-041-0/+9
|
* Update RPM to install extra scripts via makeMark Pulford2012-03-041-2/+8
|
* Add make target for cjson.util and scriptsMark Pulford2012-03-041-5/+27
| | | | | | | Add install-extra make target to install cjson.util module, extra scripts and tests. Use "cp" / "chmod" instead of "install" since they are more portable.
* Rename "cjson-misc" module to "cjson.util"Mark Pulford2012-03-045-24/+24
|
* Move cjson-misc and scripts to "lua" directoryMark Pulford2012-03-043-0/+0
|
* Use DISABLE_INVALID_NUMBERS on WIN32 CMake buildsMark Pulford2012-03-041-7/+7
|
* Fix typo in manualMark Pulford2012-03-041-2/+2
|
* Update cjson-misc.lua file descriptionMark Pulford2012-03-041-1/+1
|
* Improve performance by tracking decode ptrMark Pulford2012-03-041-46/+49
| | | | | | | | | Track pointer to the current location in the JSON string, instead of an index to the string array. Improves decode performance 1-10%. json_next_token(): - Clean up white space handling and leave "ch" containing the current non-whitespace character.
* Update bench.lua to support different JSON modulesMark Pulford2012-03-043-41/+62
| | | | | | - Select via JSON_MODULE environment variable (default "cjson") - Custom runtime configuration can be stored in bench-MODNAME.lua - Add run_script() to cjson-misc and update lua2cjson.lua
* Add support to USE_INTERNAL_DTOA to CMake buildMark Pulford2012-03-041-7/+41
| | | | | - Provide build options for USE_INTERNAL_DTOA and MULTIPLE_THREADS - Link module with Lua library under Windows