`)(` is accepted as valid input to the REPL
khankul opened this issue ยท 1 comments
Minecraft Version
1.20.x
Version
1.105.0
Details
- Launch a Lua shell
- Input
print)(
and hit Enter
1
It also works with functions like exit
and term.clear
.
For comparison,
PUC 5.4.4: syntax error near ')'
LuaJIT 2.1.0-beta3: '=' expected near ')'
I thought it might be a Cobalt issue, so I wrote a simple test (the same print statement) for it, but it crashes with CompileException: '=' expected near ')'
so it has to be CC related.
This issue is caused by lua
prompt logic itself and not Cobalt related.
This is lines that cause it:
This is side effect of
lua
prompt trying to echo a value that user entered if they just enter for example a string without any execution. In this case loaded string becomes return _echo(print)();
which cause _echo just returns all its arguments becomes valid print()
call.