mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-07-07 12:32:54 +00:00
Fixed load() not accepting function arguments
This commit is contained in:
parent
0de3a42808
commit
2f829a1413
@ -6,8 +6,8 @@ if _VERSION == "Lua 5.1" then
|
|||||||
local nativeloadstring = loadstring
|
local nativeloadstring = loadstring
|
||||||
local nativesetfenv = setfenv
|
local nativesetfenv = setfenv
|
||||||
function load( x, name, mode, env )
|
function load( x, name, mode, env )
|
||||||
if type( x ) ~= "string" then
|
if type( x ) ~= "string" and type( x ) ~= "function" then
|
||||||
error( "bad argument #1 (expected string, got " .. type( x ) .. ")", 2 )
|
error( "bad argument #1 (expected string or function, got " .. type( x ) .. ")", 2 )
|
||||||
end
|
end
|
||||||
if name ~= nil and type( name ) ~= "string" then
|
if name ~= nil and type( name ) ~= "string" then
|
||||||
error( "bad argument #2 (expected string, got " .. type( name ) .. ")", 2 )
|
error( "bad argument #2 (expected string, got " .. type( name ) .. ")", 2 )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user