X Tutup
Skip to content

Add parentheses to ternary conditional#715

Merged
Perryvw merged 2 commits intoTypeScriptToLua:masterfrom
TheLartians:master
Sep 3, 2019
Merged

Add parentheses to ternary conditional#715
Perryvw merged 2 commits intoTypeScriptToLua:masterfrom
TheLartians:master

Conversation

@TheLartians
Copy link
Contributor

Fixes a bug when nesting logical or statements in the ternary conditional.

Example

const v = true || true ? "a" : "b"; // -> "a"

❌ Current lua

local v = true or true and "a" or "b" --> true

✅ Lua after PR

local v = (true or true) and "a" or "b" --> "a"

@Perryvw Perryvw merged commit 20a5d92 into TypeScriptToLua:master Sep 3, 2019
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.

3 participants

X Tutup