Commit ab889f0
committed
Add safety to toNumber and toInteger in Lua 5.1
This makes the behavior of toNumber and toInteger in Lua 5.1 match that
of all other target Lua versions in Ziglua. That is, if the conversion
fails it will return a Zig error rather than returning a 0.
Although this does add an additional internal function call and
condition, this added safety is worth it.1 parent 25ebb59 commit ab889f0
2 files changed
Lines changed: 25 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1911 | 1911 | | |
1912 | 1912 | | |
1913 | 1913 | | |
1914 | | - | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
1915 | 1917 | | |
1916 | 1918 | | |
1917 | 1919 | | |
| |||
1929 | 1931 | | |
1930 | 1932 | | |
1931 | 1933 | | |
1932 | | - | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
1933 | 1937 | | |
1934 | 1938 | | |
1935 | 1939 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
156 | 175 | | |
157 | 176 | | |
158 | 177 | | |
| |||
0 commit comments