Skip to content

Add the "loadstring" function to Lua

Sparkette requested to merge flarn2006/SRB2:loadstring into next

I found this quite useful for implementing a sort of LUA REPL in the console. But it would be nice if people using official builds could make use of my script, and other scripts which may benefit from this functionality. I heard it was left out intentionally by JTE back when he was on the devteam, but I don't think he gave any specific reason, and I think this ought to be reconsidered. The only security implications I can see this having would be if a script loads and runs untrusted code, but then that would be a problem with that script, not with loadstring. And code executed via loadstring still only has access to what Lua normally can access, so there wouldn't be any concerns with mods installing malware or anything of that nature.

Merge request reports