mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-22 14:14:36 +00:00
lint: Fix accessing undefined append_inplace
Fix crash when using append_inplace without batteries:export(). If you don't export batteries into the global namespace to stomp table, then append_inplace would access a nil function because it's using table instead of tablex. We still use table inside init, but that's after we export to global namespace.
This commit is contained in:
parent
a5ebc1e501
commit
9083ee74ca
@ -1,7 +1,6 @@
|
||||
return {
|
||||
std = "lua51+love",
|
||||
ignore = {
|
||||
"143", -- Accessing an undefined field of a global variable.
|
||||
"211", -- Unused local variable.
|
||||
"212", -- Unused argument.
|
||||
"212/self", -- Unused argument self.
|
||||
@ -25,6 +24,7 @@ return {
|
||||
ignore = {
|
||||
"111", -- Setting an undefined global variable. (batteries and ripairs)
|
||||
"121", -- Setting a read-only global variable. (we clobber assert)
|
||||
"143", -- Accessing an undefined field of a global variable. (we use tablex as table)
|
||||
},
|
||||
},
|
||||
["sort.lua"] = {
|
||||
|
@ -282,7 +282,7 @@ function tablex.append_inplace(t1, t2, ...)
|
||||
table.insert(t1, v)
|
||||
end
|
||||
if ... then
|
||||
return table.append_inplace(t1, ...)
|
||||
return tablex.append_inplace(t1, ...)
|
||||
end
|
||||
return t1
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user