diff options
| author | Roberto I <roberto@inf.puc-rio.br> | 2025-11-26 11:18:29 -0300 |
|---|---|---|
| committer | Roberto I <roberto@inf.puc-rio.br> | 2025-11-26 11:18:29 -0300 |
| commit | f33cc4ddec886ea499d7d41dd60cac5ddc5687db (patch) | |
| tree | 917dccdbb60f984b21f5f7e1c0c3aa4f4f758ddc /testes/coroutine.lua | |
| parent | d94f7ba3040eb06895d7305014e88157d3bfd1a1 (diff) | |
| download | lua-f33cc4ddec886ea499d7d41dd60cac5ddc5687db.tar.gz lua-f33cc4ddec886ea499d7d41dd60cac5ddc5687db.tar.bz2 lua-f33cc4ddec886ea499d7d41dd60cac5ddc5687db.zip | |
New conceptual model for vararg
Conceptually, all functions get their vararg arguments in a vararg
table. The storing of vararg arguments in the stack is always treated
as an optimization.
Diffstat (limited to 'testes/coroutine.lua')
| -rw-r--r-- | testes/coroutine.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/testes/coroutine.lua b/testes/coroutine.lua index 4881d964..ba394e0c 100644 --- a/testes/coroutine.lua +++ b/testes/coroutine.lua | |||
| @@ -702,7 +702,9 @@ else | |||
| 702 | assert(t.currentline == t.linedefined + 2) | 702 | assert(t.currentline == t.linedefined + 2) |
| 703 | assert(not debug.getinfo(c, 1)) -- no other level | 703 | assert(not debug.getinfo(c, 1)) -- no other level |
| 704 | assert(coroutine.resume(c)) -- run next line | 704 | assert(coroutine.resume(c)) -- run next line |
| 705 | local n,v = debug.getlocal(c, 0, 2) -- check next local | 705 | local n,v = debug.getlocal(c, 0, 2) -- check vararg table |
| 706 | assert(n == "(vararg table)" and v == nil) | ||
| 707 | local n,v = debug.getlocal(c, 0, 3) -- check next local | ||
| 706 | assert(n == "b" and v == 10) | 708 | assert(n == "b" and v == 10) |
| 707 | v = {coroutine.resume(c)} -- finish coroutine | 709 | v = {coroutine.resume(c)} -- finish coroutine |
| 708 | assert(v[1] == true and v[2] == 2 and v[3] == 3 and v[4] == undef) | 710 | assert(v[1] == true and v[2] == 2 and v[3] == 3 and v[4] == undef) |
