aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/compat.lua13
-rw-r--r--core/init.lua4
2 files changed, 3 insertions, 14 deletions
diff --git a/core/compat.lua b/core/compat.lua
deleted file mode 100644
index 98b536db..00000000
--- a/core/compat.lua
+++ /dev/null
@@ -1,13 +0,0 @@
--- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
-
--- When using LuaJIT try to retain backwards compatibility (Lua 5.1).
--- LuaJIT is compiled with LUAJIT_ENABLE_LUA52COMPAT for some Lua 5.2 features.
-
--- In Lua 5.1, `module` exists.
-_G.module = nil -- use _G prefix so LuaDoc does not get confused
-
--- In Lua 5.1, `package.loaders` is `package.searchers`
-package.searchers = package.loaders
-
--- In LuaJIT, `bit` is used instead of `bit32`
-bit32 = bit
diff --git a/core/init.lua b/core/init.lua
index ea7efb81..7cb91798 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -4,7 +4,6 @@ _RELEASE = "Textadept 6.5"
package.path = _HOME..'/core/?.lua;'..package.path
-if jit then require 'compat' end -- compatibility for LuaJIT
_SCINTILLA = require 'iface'
args = require 'args'
_L = require 'locale'
@@ -20,6 +19,9 @@ gui.set_theme()
_M = {} -- modules table
+-- LuaJIT compatibility.
+if jit then module, package.searchers, bit32 = nil, package.loaders, bit end
+
--[[ This comment is for LuaDoc.
---
-- Extends Lua's _G table to provide extra functions and fields for Textadept.