| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
cjson.encode_number_precision().
thanks lordnynex for the patch in #4.
Test cases for changing precision
|
| |
|
|
|
|
| |
defined" from gcc.
|
|
|
|
| |
DESTDIR and relative path values in the following variable.
|
|
|
|
| |
place which could cause already running nginx workers to crash. thanks ywsample for the report.
|
| |
|
|
|
|
| |
encode_empty_table_as_object so that we can encode empty Lua tables into empty JSON arrays.
|
| |
|
|
|
|
|
| |
Add a commented PREFIX to the Solaris build section since Lua is
usually installed outside of the default include/link directories.
|
|
|
|
|
| |
Use Javascript compatible values for Infinity/NaN when encoding invalid
numbers.
|
| |
|
| |
|
|
|
|
|
| |
Remove ?= and := assignment operators from the Makefile since
they are not supported by Solaris make.
|
|
|
|
|
|
| |
Work around Solaris awk limitations:
- Limit line lengths to 2500 bytes
- Use "count > 0" instead of "count" for test expression
|
|
|
|
| |
Add cjson.safe module to suppress exceptions during JSON conversions.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Remove ENABLE_CJSON_GLOBAL option since it is not recommended or
necessary and doesn't need to be discussed in the manual.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Force binary file mode in util.lua to fix the utf8.dat test under
Windows.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Bump version to 2.0devel due to significant changes and updated API
(runtime config not fully backwards compatible).
|
|
|
|
| |
Simply string.format() calls with OO method notation.
|
|
|
|
|
|
| |
Fix runtests.sh after:
- "util" module moved to lua/cjson
- "version" removed
|
|
|
|
|
|
| |
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 built in fpconv_g_fmt() so it doesn't
include the trailing null when converting numbers |x|<1.
|
|
|
|
|
|
|
|
|
|
| |
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.dat. Otherwise the user
generated test file will cause RPM to leave behind the cjson/tests
module directories.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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 functions to simplify usage in
the common case. Eg,:
if not cjson.encode_invalid_numbers() then .. end
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
Add "throw error" to descriptions for tests which are intended to
generate errors.
|
|
|
|
|
|
|
| |
- Update comments
- Use enumerated return values
- Test various configuration API errors
- Test resetting configuration to default
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
| |
Make the tests more explicit, the nested data structure doesn't need to
be generated in advance.
|