Skip to content

Add new option to bypass 5.1 try/catch in async/await precaution#1247

Merged
Perryvw merged 3 commits intoTypeScriptToLua:masterfrom
hazzard993:feature/51-try-catch-bypass
Apr 2, 2022
Merged

Add new option to bypass 5.1 try/catch in async/await precaution#1247
Perryvw merged 3 commits intoTypeScriptToLua:masterfrom
hazzard993:feature/51-try-catch-bypass

Conversation

@hazzard993
Copy link
Copy Markdown
Contributor

Closes #1158

Adds a very specific option to allow TSTL to proceed with transforming try/catch in async/await functions

lua51AllowTryCatchInAsyncAwait (boolean) (false by default)

I figured lua51 in the name to come first because this only has an effect on Lua 5.1 and isn't needed in any other targets

I can add more to this PR if needed just wanted to get an idea if this is the kind of solution expected 🤔

Also planning to add some more details to the wiki about what specifically in the language we're looking for so that someone can figure out if this is a switch they should enable

@Perryvw
Copy link
Copy Markdown
Member

Perryvw commented Apr 2, 2022

Looks fine to me

@Perryvw Perryvw merged commit 39480bb into TypeScriptToLua:master Apr 2, 2022
@hazzard993 hazzard993 deleted the feature/51-try-catch-bypass branch April 3, 2022 07:35
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

Successfully merging this pull request may close these issues.

Ability to re-enable try/catch in async/await for Lua 5.1 as a config setting?

2 participants