feature: applied Jiale Zhi's patch to add the new config function enc…
…ode_empty_table_as_object so that we can encode empty Lua tables into empty JSON arrays.
bugfix: the Makefile had a bug that overwrites existing cjson.so file…
… in place which could cause already running nginx workers to crash. thanks ywsample for the report.
Makefile: removed the slash (/) after $(DESTDIR) so as to support emp…
…ty DESTDIR and relative path values in the following variable.
fixed the warning "inline function ‘fpconv_init’ declared but never d…
…efined" from gcc.
feature: now we allow up to 16 decimal places in JSON number encoding…
… via cjson.encode_number_precision(). thanks lordnynex for the patch in #4. Test cases for changing precision
Merge pull request #5 from thibaultCha/fix/16-digit-precision
fix 16 decimal number encoding assertion
feat: cjson.as_array metamethod to enforce empty array encoding
A proposed improved patch of openresty#1 (a patch commonly proposed to lua-cjson and its forks), taking into considerations comments from the original PR. - use a lightuserdata key to store the metatable in the Lua Registry (more efficient and avoiding conflicts) - provide a lightuserdata resulting in empty arrays as well - tests cases moved to t/agentzh.t, where cases for 'encode_empty_table_as_object' are already written. It seems like a better place for tests specific to the OpenResty fork's additions. - a more complex test case
it does not sense to test rpmbuild that way, it should be either rewritten or removed
Merge pull request #8 from chipitsine/master
cpcheck added, rpmbuild test removed
Merge pull request #10 from chipitsine/master
travis-ci: move package management to "apt" plugin
Merge pull request #13 from chipitsine/master
travis-ci: bugfix, now we fail on either test
bugfix: fixed compilation errors from the Microsoft C compiler.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
chore: ignored the generated test_case.lua file.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
bugfix: preserve 'empty_array_mt' behavior upon multiple loadings of …
…the module. Prior to this fix, when the module would be loaded several times (by-passing `package.loaded`), the `lua_cjson_new` function would override the `empty_array_mt` table in the registry with a new one. Comparison for equality between those tables would then fail, and the behavior would be broken. This was discovered after loading `cjson` *and* `cjson.safe` in the same application, resulting in two calls to `lua_cjson_new`. Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
feature: supports MS C compiler older than VC2012.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
bugfix: conditionally build luaL_setfuncs() function as the latest Lu…
…aJIT v2.1 already includes it. fixes #21.
bugfix: fixed a -Wsign-compare compiler warning.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
travis-ci: run LuaJIT tests against openresty/luajit2 -b v2.1-agentzh.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
feature: added new cjson.array_mt metatable to allow enforcing JSON a…
…rray encoding. Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
feature: set cjson.array_mt on decoded JSON arrays.
this can be turned on via cjson.decode_array_with_array_mt(true). off by default. Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
bugfix: fixed the C compiler warning "SO C90 forbids mixed declaratio…
…ns and code" on older operating systems.
optimize: improved forward-compatibility with older versions of Lua/L…
…uaJIT. Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
luarocks: bumped version to 2.1.0.6.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
feature: ported to the ARM64 platform by masking off the bits higher …
…than 47-bit in the lightud. Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
bugfix: we now only apply the lightuserdata mask on platforms that ar…
…e at least 64bits.
feature: add option to disable forward slash escaping
Thanks @spacewander for optimization and documentation.