Commit 15c716d
feat: flip binary operator check if failed
if vm.runOperator fails try again with flipped arguments
this emulates how lua checks the binary metaevents in which
if there is no corresponding binary metaevent for the left
operand it checks the right operand instead. This also works
when both operands are tables.
This change affects:
- __add
- __sub
- __mul
- __div
- __idiv
- __mod
- __pow
- __concat
- __band
- __bor
- __bxor
- __shl
- __shr1 parent 1dbe571 commit 15c716d
1 file changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
264 | 267 | | |
265 | 268 | | |
266 | 269 | | |
| |||
300 | 303 | | |
301 | 304 | | |
302 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
303 | 309 | | |
304 | 310 | | |
305 | 311 | | |
| |||
396 | 402 | | |
397 | 403 | | |
398 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
399 | 408 | | |
400 | 409 | | |
401 | 410 | | |
| |||
0 commit comments