diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-12-29 13:15:54 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-12-29 13:15:54 -0300 |
commit | 4bd10b6fe81c0a56eb9e01e24fba10e655966870 (patch) | |
tree | ff21703d9f06a0dd4ca4f3317dd0cb7b048c9b8d /testes/db.lua | |
parent | 59e565d9555c07e82808d8c1db8f4f4d159b5e5c (diff) | |
download | lua-4bd10b6fe81c0a56eb9e01e24fba10e655966870.tar.gz lua-4bd10b6fe81c0a56eb9e01e24fba10e655966870.tar.bz2 lua-4bd10b6fe81c0a56eb9e01e24fba10e655966870.zip |
Better error messages for calling non-callable objects
When available, use the calling code to find a suitable name for what
was being called; this is particularly useful for errors of non-callable
metamethods. This commit also improved the debug information for
order metamethods.
Diffstat (limited to 'testes/db.lua')
-rw-r--r-- | testes/db.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/testes/db.lua b/testes/db.lua index fdb0da4a..ce559ad9 100644 --- a/testes/db.lua +++ b/testes/db.lua | |||
@@ -823,8 +823,10 @@ assert(a + 30000 == "add" and a - 3.0 == "sub" and a * 3.0 == "mul" and | |||
823 | -a == "unm" and #a == "len" and a & 3 == "band") | 823 | -a == "unm" and #a == "len" and a & 3 == "band") |
824 | assert(a|3 == "bor" and 3~a == "bxor" and a<<3 == "shl" and a>>1 == "shr") | 824 | assert(a|3 == "bor" and 3~a == "bxor" and a<<3 == "shl" and a>>1 == "shr") |
825 | assert (a==b and a.op == "eq") | 825 | assert (a==b and a.op == "eq") |
826 | assert (a>=b and a.op == "order") | 826 | assert (a>=b and a.op == "le") |
827 | assert (a>b and a.op == "order") | 827 | assert ("x">=a and a.op == "le") |
828 | assert (a>b and a.op == "lt") | ||
829 | assert (a>10 and a.op == "lt") | ||
828 | assert(~a == "bnot") | 830 | assert(~a == "bnot") |
829 | 831 | ||
830 | do -- testing for-iterator name | 832 | do -- testing for-iterator name |