I use TypeScriptToLua with the Minecraft mod ComputerCraft, which runs on a version of Lua 5.1 with various 5.2/5.3 library features backported. I noticed that TSTL 1.1.0 removes support for try/catch inside async/await functions on Lua 5.1, which makes sense because of the fact that pcall can't yield; however, both ComputerCraft, which uses the Cobalt VM (based on LuaJ) in Java, and my emulator CraftOS-PC, which uses a heavily patched version of Lua 5.1, do not suffer from this issue.
Would it be possible to add some sort of override inside tsconfig.json to allow exception handling inside async functions on 5.1? I do agree that the default behavior should be to disallow it, since standard Lua 5.1 is not compatible, but there are multiple 5.1 implementations that do support it, so it would be handy to be able to override that without having to switch to another version (which would then break switch) or edit the compiler manually.
I use TypeScriptToLua with the Minecraft mod ComputerCraft, which runs on a version of Lua 5.1 with various 5.2/5.3 library features backported. I noticed that TSTL 1.1.0 removes support for
try/catchinsideasync/awaitfunctions on Lua 5.1, which makes sense because of the fact thatpcallcan't yield; however, both ComputerCraft, which uses the Cobalt VM (based on LuaJ) in Java, and my emulator CraftOS-PC, which uses a heavily patched version of Lua 5.1, do not suffer from this issue.Would it be possible to add some sort of override inside
tsconfig.jsonto allow exception handling insideasyncfunctions on 5.1? I do agree that the default behavior should be to disallow it, since standard Lua 5.1 is not compatible, but there are multiple 5.1 implementations that do support it, so it would be handy to be able to override that without having to switch to another version (which would then breakswitch) or edit the compiler manually.