Skip to content

Commit

Permalink
Fixed incompatible loadstring() implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvishJerricco committed Nov 4, 2014
1 parent 1dc1005 commit 6791992
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions LuaLua/load.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ for i,v in ipairs({"lcode.lua", "ldump.lua", "llex.lua", "lopcodes.lua", "lparse
end

function _G.loadstring(str, source)
source = source or ""
assert(type(source) == "string", "Expected string, got " .. type(source), 2)
local header = 0
if #str > 12 then -- header size is 12
for i = 1, 4 do
Expand Down

0 comments on commit 6791992

Please sign in to comment.