diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-07-08 13:33:57 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-07-08 13:33:57 -0300 |
| commit | 942c10a5e33811a08a290ec15031c950a6d17c99 (patch) | |
| tree | 114395a69857609bdd6c220f85476812f0fd5fb1 /testes/calls.lua | |
| parent | 848568790826b7e201f84682185b5b605c473016 (diff) | |
| download | lua-942c10a5e33811a08a290ec15031c950a6d17c99.tar.gz lua-942c10a5e33811a08a290ec15031c950a6d17c99.tar.bz2 lua-942c10a5e33811a08a290ec15031c950a6d17c99.zip | |
Optional initialization for global declarations
Diffstat (limited to 'testes/calls.lua')
| -rw-r--r-- | testes/calls.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testes/calls.lua b/testes/calls.lua index 21441701..0dacb85a 100644 --- a/testes/calls.lua +++ b/testes/calls.lua | |||
| @@ -24,7 +24,7 @@ assert(not pcall(type)) | |||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | -- testing local-function recursion | 26 | -- testing local-function recursion |
| 27 | global fact; fact = false | 27 | global fact = false |
| 28 | do | 28 | do |
| 29 | local res = 1 | 29 | local res = 1 |
| 30 | local function fact (n) | 30 | local function fact (n) |
| @@ -65,7 +65,7 @@ a.b.c:f2('k', 12); assert(a.b.c.k == 12) | |||
| 65 | 65 | ||
| 66 | print('+') | 66 | print('+') |
| 67 | 67 | ||
| 68 | global t; t = nil -- 'declare' t | 68 | global t = nil -- 'declare' t |
| 69 | function f(a,b,c) local d = 'a'; t={a,b,c,d} end | 69 | function f(a,b,c) local d = 'a'; t={a,b,c,d} end |
| 70 | 70 | ||
| 71 | f( -- this line change must be valid | 71 | f( -- this line change must be valid |
