lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Joe Andresen wrote:
> anyone else get this using the source?
> 
> bad argument #1 to '?' (number expected, got no value)
> 
> line 22 of the test file:
> 
> if pcall(f) or pcall(f, "z") or pcall(f, true) then
> 
> where f is the function "tobit"

This shouldn't happen. This test is checking proper error
handling. So it does throw an error, but pcall ought to catch it
silently.

Try the following test:

  pcall(error, "test")

This should give no error and no output. Similarly:

  local bit = require("bit")
  pcall(bit.tobit)

This should give no error and no output, too.

If any of the two tests fail, then your Lua VM has broken error
handling. Have you compiled Lua yourself or where have you
obtained a binary of it? Which version of Lua? Compiled with which
compiler version and running on which operating system?

--Mike