Use lua's math.atan2 for Math.atan2#765
Merged
Perryvw merged 13 commits intoTypeScriptToLua:masterfrom Dec 18, 2019
Merged
Conversation
Member
|
In case the target is Lua 5.3, we should use |
ark120202
reviewed
Dec 8, 2019
Perryvw
reviewed
Dec 8, 2019
src/transformation/builtins/math.ts
Outdated
|
|
||
| const expressionName = expression.name.text; | ||
|
|
||
| if (context.options.luaTarget === LuaTarget.Lua53 && expressionName === "atan2") { |
Member
There was a problem hiding this comment.
I'd prefer if you handle all atan2 cases in the same place (probably in its switch case)
Perryvw
reviewed
Dec 14, 2019
src/transformation/builtins/math.ts
Outdated
| case "atan": | ||
| case "atan2": | ||
| case "atan2": { | ||
| if (expressionName === "atan2" && context.options.luaTarget === LuaTarget.Lua53) { |
Member
There was a problem hiding this comment.
expressionName === "atan2" is already checked by the switch, it's not required here
Member
There was a problem hiding this comment.
Oh I see why it's here now, it's still trange to me, you can move atan2 up to be the first case or something
ark120202
reviewed
Dec 14, 2019
Co-Authored-By: Perry van Wesel <Perryvw@users.noreply.github.com>
ark120202
reviewed
Dec 16, 2019
Co-Authored-By: ark120202 <ark120202@gmail.com>
Co-Authored-By: ark120202 <ark120202@gmail.com>
ark120202
approved these changes
Dec 17, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #746
Math.atan2->math.atan2for all Lua targetsEdit: Except for Lua 5.3 which uses
math.atan(y, x)