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

Evaluating chunks via the eval command may swallow (some types of) errors #438

Open
Duckwhale opened this issue Jan 18, 2024 · 0 comments
Open

Comments

@Duckwhale
Copy link
Member

Example:

evo eval "print(56976*/3*4)"  -- Should raise an error, but doesn't

In LuaJIT:

luajit -e "print(56976*/3*4)"
luajit: (command line):1: unexpected symbol near '/'

However, something like this will indeed raise the error (as expected):

> evo eval "error(42)"
[string "error(42)"]:1: 42
stack traceback:
        [C]: in function 'error'
        [string "error(42)"]:1: in function 'chunk'
        Runtime/evo.lua:300: in function <Runtime/evo.lua:288>
        [C]: in function 'lua_pcall'
        Runtime/LuaVirtualMachine.cpp:135: in function 'RunCompiledChunk'
        Runtime/LuaVirtualMachine.cpp:110: in function 'DoString'
        Runtime/main.cpp:72: in function 'main'
> luajit -e "error(42)"
luajit: (command line):1: 42
stack traceback:
        [C]: in function 'error'
        (command line):1: in main chunk
        [C]: at 0x55625749c1d0

This should be easy to fix, but needs some additional test cases to avoid regressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Soon™
Development

No branches or pull requests

1 participant