diff --git a/src/main/resources/assets/computercraft/lua/bios.lua b/src/main/resources/assets/computercraft/lua/bios.lua index 60b1eaf18b..14a91aa816 100644 --- a/src/main/resources/assets/computercraft/lua/bios.lua +++ b/src/main/resources/assets/computercraft/lua/bios.lua @@ -132,39 +132,6 @@ if _VERSION == "Lua 5.3" then ]] )() end -if string.find( _HOST, "ComputerCraft" ) == 1 then - -- Prevent access to metatables or environments of strings, as these are global between all computers - local nativegetmetatable = getmetatable - local nativeerror = error - local nativetype = type - local string_metatable = nativegetmetatable("") - function getmetatable( t ) - local mt = nativegetmetatable( t ) - if mt == string_metatable then - nativeerror( "Attempt to access string metatable", 2 ) - else - return mt - end - end - if _VERSION == "Lua 5.1" and not _CC_DISABLE_LUA51_FEATURES then - local string_env = nativegetfenv(("").gsub) - function getfenv( env ) - if env == nil then - env = 2 - elseif nativetype( env ) == "number" and env > 0 then - env = env + 1 - end - local fenv = nativegetfenv(env) - if fenv == string_env then - --nativeerror( "Attempt to access string metatable", 2 ) - return nativegetfenv( 0 ) - else - return fenv - end - end - end -end - -- Install lua parts of the os api function os.version() return "CraftOS 1.8"