Menu

#51 differences in test\lua\tablelib.lua Luaj vs original Lua

v3.0-beta1
open
nobody
None
5
2016-07-16
2016-07-16
eugen
No

I've used the Luaj tests to check my Lua 5.3.3 build. Because in the original PUC-source http://www.lua.org/download.html there are no tests. I've noticed some different results. For example this.

See test\lua\tablelib.lua line 16:

local t = { "one", "two", "three", a='aaa', b='bbb', c='ccc' }

table.insert(t,'six');
table.insert(t,1,'seven');
table.insert(t,4,'eight');
table.insert(t,7,'nine');
table.insert(t,10,'ten');  

At table.insert(t,10,'ten') I get in original Lua the exception
bad argument #2 to 'insert' (position out of bounds)
Not so in Luaj.

What is the right behavior?

Discussion


Log in to post a comment.

MongoDB Logo MongoDB