Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nullary error() behavior different from stock lua #4

Closed
ferronn-dev opened this issue Sep 12, 2022 · 1 comment
Closed

nullary error() behavior different from stock lua #4

ferronn-dev opened this issue Sep 12, 2022 · 1 comment

Comments

@ferronn-dev
Copy link
Contributor

$ lua -e 'print(1); error(); print(2)'
1
$ elune/build/linux/bin/Release/lua5.1 -e 'print(1); error(); print(2)'
1
elune/build/linux/bin/Release/lua5.1: (error object is a nil value)
stack traceback:
        [C]: in function 'error'
        (command line):1: in main chunk
        [C]: in ?

Found through the busted Lua unittest framework, which uses error() on exit.

@Meorawr
Copy link
Owner

Meorawr commented Sep 12, 2022

What busted is doing is weird and isn't even supported in newer Lua versions anyway; 5.3 onwards all raise this same error. Not going to fix this unless there's an extremely compelling reason since this has a impact on how the default global error handler will process nil errors and breaks other invariants elsewhere.

@Meorawr Meorawr closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2022
Meorawr added a commit that referenced this issue Sep 15, 2022
Fixes #4; this is an undocumented feature of the stock Lua interpreter
that doesn't exist in versions beyond Lua 5.2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants