loadstring
Definition
-- @/=[C]:-1
function loadstring(...)
Callers
@/lua/ge/extensions/editor/api/core.lua
elseif type.type == varTypes.LuaVar then
local f = loadstring(type.name .. " = " .. tostring(on))
f()
elseif type.type == varTypes.LuaVar then
local f = loadstring("return " .. type.name)
return f()
@/lua/common/utils.lua
if s == nil then return nil end
return loadstring("return " .. s)()
end
@/lua/common/libs/LuLPeg/lulpeg.lua
if type (ld) == 'string' then
fun = loadstring (ld)
else
@/lua/vehicle/extensions/scenario/functionFreezer.lua
for _,funcString in pairs(functionNames) do
if loadstring("return "..funcString.."_freeze_backup")() == nil then
loadstring(funcString.."_freeze_backup = "..funcString)() -- backup the original function code
if loadstring("return "..funcString.."_freeze_backup")() == nil then
loadstring(funcString.."_freeze_backup = "..funcString)() -- backup the original function code
loadstring(funcString.." = nop")() -- now replace function with no operation
loadstring(funcString.."_freeze_backup = "..funcString)() -- backup the original function code
loadstring(funcString.." = nop")() -- now replace function with no operation
else
for _,funcString in pairs(functionNames) do
if loadstring("return "..funcString.."_freeze_backup")() == nil then
log("E", "functionFreezer", "Attempted to unfreeze a function that was never frozen. Ignoring... "..dumps(funcString))
else
loadstring(funcString.." = "..funcString.."_freeze_backup")() -- restore backup code back to its original place
loadstring(funcString.."_freeze_backup".. " = nil")() -- mark as unfrozen
loadstring(funcString.." = "..funcString.."_freeze_backup")() -- restore backup code back to its original place
loadstring(funcString.."_freeze_backup".. " = nil")() -- mark as unfrozen
end
for _,functionString in ipairs(data) do
local func = loadstring("return "..functionString)() -- func is only used for sanitization checks
if func then
@/lua/ge/ge_utils.lua
-- Compile and return the module
return loadstring(content, filename)
end
@/lua/ge/extensions/util/wsTest.lua
local function exec(cmd)
local func, err = loadstring("return " .. cmd)
if func then
@/lua/ge/extensions/core/windowsConsole.lua
local function tryRunCommand(cmd)
local f = loadstring(cmd)
if not f then f = loadstring('return ' .. cmd) end
local f = loadstring(cmd)
if not f then f = loadstring('return ' .. cmd) end
if f then
@/lua/ge/extensions/editor/api/gui.lua
local eval = function(expression)
local func, err = loadstring("return " .. expression)
if func then
@/lua/ge/extensions/flowgraph/nodes/scene/customLuaCommand.lua
if self.pinIn.func.value then
local functionToExecute = loadstring(self.pinIn.func.value)
local status, ret = pcall(functionToExecute)
@/lua/common/particles.lua
local function particleLoadStr(str, name)
local f, err = loadstring("return function (arg) " .. str .. " end", name or str)
if f then return f() else return f, err end
@/lua/common/lpack.lua
if s == nil then return nil end
return loadstring("return " .. s)()
end
@/lua/ge/extensions/ui/missionInfo.lua
if button.action == actionName then
loadstring(button.cmd)()
return
@/lua/common/libs/resty/template.lua
loadchunk = function(view)
local func = assert(loadstring(view))
setfenv(func, setmetatable({ template = template }, context))
@/lua/common/utils/interactiveShell.lua
local function exec(cmd)
local func, err = loadstring(cmd)
if func then
@/lua/ge/extensions/gameplay/rally/notebook/pacenote.lua
-- Attempt to load the condition as Lua code
local func, err = loadstring("return " .. condition)
if func then