'lua_upvalueid' returns NULL on invalid upvalue index

This commit is contained in:
Roberto Ierusalimschy
2020-10-12 14:51:28 -03:00
parent 9a89fb1c9d
commit 30528049f1
4 changed files with 33 additions and 15 deletions

View File

@@ -242,7 +242,7 @@ end
assert(debug.upvalueid(foo1, 1))
assert(debug.upvalueid(foo1, 2))
assert(not pcall(debug.upvalueid, foo1, 3))
assert(not debug.upvalueid(foo1, 3))
assert(debug.upvalueid(foo1, 1) == debug.upvalueid(foo2, 2))
assert(debug.upvalueid(foo1, 2) == debug.upvalueid(foo2, 1))
assert(debug.upvalueid(foo3, 1))