summaryrefslogtreecommitdiff
path: root/xmake/core/base/table.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-09-18 10:07:53 +0800
committerruki <[email protected]>2021-09-18 10:07:53 +0800
commit1b231d9a73299528f1e336d4038c120d5a4fd183 (patch)
tree7e32b70efaae948c63c4139e3b465f4a07f696d1 /xmake/core/base/table.lua
parent6f0f25b64487a32989cb718aa50d9bc729f46d66 (diff)
add xmake.luajit
Diffstat (limited to 'xmake/core/base/table.lua')
-rw-r--r--xmake/core/base/table.lua27
1 files changed, 24 insertions, 3 deletions
diff --git a/xmake/core/base/table.lua b/xmake/core/base/table.lua
index 01a6a4692..6709ada3a 100644
--- a/xmake/core/base/table.lua
+++ b/xmake/core/base/table.lua
@@ -21,9 +21,30 @@
-- define module: table
local table = table or {}
--- import jit function
-table.clear = require("table.clear")
-table.new = require("table.new")
+-- clear table
+if not table.clear then
+ if xmake._LUAJIT then
+ table.clear = require("table.clear")
+ else
+ function table.clear(t)
+ for k, v in pairs(t) do
+ t[k] = nil
+ end
+ end
+ end
+end
+
+-- new table
+if not table.new then
+ if xmake._LUAJIT then
+ table.new = require("table.new")
+ else
+ function table.new(narray, nhash)
+ -- TODO
+ return {}
+ end
+ end
+end
-- move values of table(a1) to table(a2)
--