diff options
author | Mark Pulford <mark@kyne.com.au> | 2011-12-30 17:48:12 +1030 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2011-12-30 17:48:12 +1030 |
commit | 85bf3b798f6d52c374c35f7fbe47df132891d3b2 (patch) | |
tree | 39b0da8e6d6536cdd90038547a985559102962de /tests/bench.lua | |
parent | 2416b145073211b840781da6abf4b6d97f4657a6 (diff) | |
download | lua-cjson-85bf3b798f6d52c374c35f7fbe47df132891d3b2.tar.gz lua-cjson-85bf3b798f6d52c374c35f7fbe47df132891d3b2.tar.bz2 lua-cjson-85bf3b798f6d52c374c35f7fbe47df132891d3b2.zip |
Add support for Lua 5.2 and cjson.new
Update all Lua scripts to use new module init style everywhere:
local json = require "cjson"
Lua CJSON does not register a global table under Lua 5.2. The global
table can be disabled under Lua 5.1 with DISABLE_CJSON_GLOBAL.
Other changes:
- Store CJSON configuration as an upvalue for each function.
- Add "cjson.new" function to create another module table with a
separate configuration.
- Add _NAME and _VERSION variables.
Diffstat (limited to '')
-rwxr-xr-x | tests/bench.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/bench.lua b/tests/bench.lua index fdd0bb0..c81213d 100755 --- a/tests/bench.lua +++ b/tests/bench.lua | |||
@@ -72,7 +72,7 @@ function bench_file(filename) | |||
72 | return benchmark(tests, 0.1, 5) | 72 | return benchmark(tests, 0.1, 5) |
73 | end | 73 | end |
74 | 74 | ||
75 | cjson.encode_keep_buffer(true) | 75 | json.encode_keep_buffer(true) |
76 | 76 | ||
77 | for i = 1, #arg do | 77 | for i = 1, #arg do |
78 | local results = bench_file(arg[i]) | 78 | local results = bench_file(arg[i]) |