[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: debug.traceback() oddity
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 9 Nov 2009 13:49:08 -0200
> > =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