Hello,
I've observed some inconsistencies in Lua 5.4 Reference Manual.
1. string.byte() can return nil
Lua 5.4 Reference Manual describes the following possible values
returned by the function string.byte():
> Returns the internal numeric codes of the characters s[i], s[i+1], ..., s[j].
However, string.byte does not check bounds of i and j and when i and j are less than zero
of greater that length of the "s" the nil is returned:
lua5.4 -e "print(string.byte('A', 2, 3))" -- nil
The same behavior is in Lua 5.1. I suppose i and j should be checked, or this behavior should be described in the Manual.
2. Some possible values of `namewhat` in activation record are missed in Reference Manual
Lua 5.4 Reference Manual describes the following possible values for `namewhat` field:
> namewhat: explains the name field. The value of namewhat can be "global",
> "local", "method", "field", "upvalue", or "" (the empty string),
> according to how the function was called. (Lua uses the empty string
> when no other option seems to apply.)
However, these values are also possible: "hook", "metamethod", "method", "for iterator" and nil. I suppose these values should be described in the Manual.
https://www.lua.org/manual/5.4/manual.html#lua_Debug
Sergey