aboutsummaryrefslogtreecommitdiff
path: root/testes/db.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-12-29 13:15:54 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-12-29 13:15:54 -0300
commit4bd10b6fe81c0a56eb9e01e24fba10e655966870 (patch)
treeff21703d9f06a0dd4ca4f3317dd0cb7b048c9b8d /testes/db.lua
parent59e565d9555c07e82808d8c1db8f4f4d159b5e5c (diff)
downloadlua-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.lua6
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")
824assert(a|3 == "bor" and 3~a == "bxor" and a<<3 == "shl" and a>>1 == "shr") 824assert(a|3 == "bor" and 3~a == "bxor" and a<<3 == "shl" and a>>1 == "shr")
825assert (a==b and a.op == "eq") 825assert (a==b and a.op == "eq")
826assert (a>=b and a.op == "order") 826assert (a>=b and a.op == "le")
827assert (a>b and a.op == "order") 827assert ("x">=a and a.op == "le")
828assert (a>b and a.op == "lt")
829assert (a>10 and a.op == "lt")
828assert(~a == "bnot") 830assert(~a == "bnot")
829 831
830do -- testing for-iterator name 832do -- testing for-iterator name