aboutsummaryrefslogtreecommitdiff
path: root/testes/db.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-05-20 17:36:05 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-05-20 17:36:05 -0300
commitbe05c444818989463dc307eed283503d391f93eb (patch)
tree16e08bf2e0256a1aeffcd848379af98577aec602 /testes/db.lua
parent6d53701c7a0dc4736d824fd891ee6f22265d0d68 (diff)
downloadlua-be05c444818989463dc307eed283503d391f93eb.tar.gz
lua-be05c444818989463dc307eed283503d391f93eb.tar.bz2
lua-be05c444818989463dc307eed283503d391f93eb.zip
New way to control preambular declaration
Validity of the preambular global declaration in controled together with all declarations, when checking variable names.
Diffstat (limited to 'testes/db.lua')
-rw-r--r--testes/db.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/testes/db.lua b/testes/db.lua
index ae204c41..0f174f17 100644
--- a/testes/db.lua
+++ b/testes/db.lua
@@ -349,9 +349,11 @@ end, "crl")
349 349
350 350
351function f(a,b) 351function f(a,b)
352 global collectgarbage, assert, g, string 352 -- declare some globals to check that they don't interfere with 'getlocal'
353 global collectgarbage
353 collectgarbage() 354 collectgarbage()
354 local _, x = debug.getlocal(1, 1) 355 local _, x = debug.getlocal(1, 1)
356 global assert, g, string
355 local _, y = debug.getlocal(1, 2) 357 local _, y = debug.getlocal(1, 2)
356 assert(x == a and y == b) 358 assert(x == a and y == b)
357 assert(debug.setlocal(2, 3, "pera") == "AA".."AA") 359 assert(debug.setlocal(2, 3, "pera") == "AA".."AA")
@@ -387,7 +389,9 @@ function g (...)
387 f(AAAA,B) 389 f(AAAA,B)
388 assert(AAAA == "pera" and B == "manga") 390 assert(AAAA == "pera" and B == "manga")
389 do 391 do
392 global *
390 local B = 13 393 local B = 13
394 global<const> assert
391 local x,y = debug.getlocal(1,5) 395 local x,y = debug.getlocal(1,5)
392 assert(x == 'B' and y == 13) 396 assert(x == 'B' and y == 13)
393 end 397 end