Closed ggcrunchy closed 11 years ago
Nice catch on the assert issue, I've committed a fix.
I misread the documentation for select()
, I thought it used the arguments from the function calling select()
, which is pretty difficult to recreate in Javascript, but also not how the actual function behaves. I've committed an implementation of select()
. Thanks for noticing.
According to the Lua documentation, nil is not a valid index for rawset.
rawset (table, index, value) Sets the real value of table[index] to value, without invoking any metamethod. table must be a table, index any value different from nil, and value any Lua value. This function returns table.
Try opening a lua console and typing a = {}; rawset(a, nil, 1)
.
Whoops, sorry, I meant rawget()
You are indeed correct, I've updated lua_rawget()
and rawget()
to return nil/null instead of throwing an error when a nil/null index is used. Thanks!
Hi. A couple things that tripped me up.
In the parser, "assert" returns value, where it should return [value]. This was a bit puzzling for a while. :smile:
According to the manual, "rawset" (and lua_rawset()) take "any value" for index, which would include nil. (This is sometimes handy.)
Not so much an issue, but I'm using this for "select"... so far so good: