lua-users home
lua-l archive

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


> > =debug.traceback()
> stack traceback:
> 	stdin:1: in main chunk
> 	[C]: ?
> 
> ...works as expected. But this:
> 
> > =debug.traceback(nil, "foo", 1)
> 1
> 
> ...doesn't. [...]

The first argument cannot be nil. Because the first argument is an
optional thread, and nil is not a thread, the function gets confused
about what is what. The call without the nil gives a correct answer.

The call with nil probably should give an error; 5.2 does:

> =debug.traceback(nil, "foo", 1)
stdin:1: bad argument #2 to 'traceback' (number expected, got string)
stack traceback:
	[C]: in function 'traceback'
	stdin:1: in main chunk
	[C]: in ?


-- Roberto