mirror of
https://github.com/neovim/neovim.git
synced 2026-05-24 05:40:08 +00:00
fix(lua): avoid __index when deciding if a table is a list #39556
Problem: When a table has `__index`, `vim.islist` is unreliable. Solution: Index using `rawget`.
This commit is contained in:
@@ -960,7 +960,7 @@ function vim.islist(t)
|
||||
for _ in
|
||||
pairs(t--[[@as table<any,any>]])
|
||||
do
|
||||
if t[j] == nil then
|
||||
if rawget(t, j) == nil then
|
||||
return false
|
||||
end
|
||||
j = j + 1
|
||||
|
||||
Reference in New Issue
Block a user