Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/ModUtil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ local rawinsert = table.rawinsert
---@type fun( list, pos, value?: any )
---@diagnostic disable-next-line: duplicate-set-field
function table.insert( list, pos, value )
if type(list) ~= "table" then
error( "bad argument #1 to '" .. getname( ) .. "' (table expected, got " .. type(list) ..")", 2 )
end
local last = #list
if value == nil then
value = pos
Expand All @@ -199,6 +202,9 @@ table.rawremove = table.remove
---@type fun( list, pos ): any
---@diagnostic disable-next-line: duplicate-set-field
function table.remove( list, pos )
if type(list) ~= "table" then
error( "bad argument #1 to '" .. getname( ) .. "' (table expected, got " .. type(list) ..")", 2 )
end
local last = #list
if pos == nil then
pos = last
Expand Down