1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-25 22:53:22 +00:00

Fixed load() not accepting function arguments

This commit is contained in:
Daniel Ratcliffe 2017-08-27 13:34:33 +01:00 committed by GitHub
parent 0de3a42808
commit 2f829a1413

View File

@ -6,8 +6,8 @@ if _VERSION == "Lua 5.1" then
local nativeloadstring = loadstring
local nativesetfenv = setfenv
function load( x, name, mode, env )
if type( x ) ~= "string" then
error( "bad argument #1 (expected string, got " .. type( x ) .. ")", 2 )
if type( x ) ~= "string" and type( x ) ~= "function" then
error( "bad argument #1 (expected string or function, got " .. type( x ) .. ")", 2 )
end
if name ~= nil and type( name ) ~= "string" then
error( "bad argument #2 (expected string, got " .. type( name ) .. ")", 2 )