Commit 84ef0b2
authored
fix Math.atan2 emitting math.atan2 instead of math.atan for Lua 5.4+ (#1700)
* fix Math.atan2 emitting math.atan2 instead of math.atan for Lua 5.4+
math.atan2 was removed in Lua 5.3 (replaced by two-arg math.atan).
The codegen only special-cased 5.3 but not 5.4 or 5.5, which also
lack math.atan2 (5.4 has it behind a compat flag, 5.5 drops it).
* invert atan2 condition to default future Lua targets to math.atan
Enumerate the older targets that need math.atan2 instead of the newer
ones that need math.atan, so any future Lua target (5.6+) defaults to
the modern behavior rather than silently regressing.1 parent ec26bdf commit 84ef0b2
File tree
2 files changed
+10
-4
lines changed- src/transformation/builtins
- test/unit/builtins
2 files changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
| 98 | + | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
0 commit comments