aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV1K1NGbg <victor@ilchev.com>2024-08-04 15:45:58 +0300
committerV1K1NGbg <victor@ilchev.com>2024-08-05 20:51:31 +0300
commita1fca499e15229968d46f15c024db5ff707284a6 (patch)
treeca9862b0d108a83a720e0b1dd0f82e6e282c3863
parentf8661038f4e5c7fc53e83b5104f7becb3f61026a (diff)
downloadluarocks-a1fca499e15229968d46f15c024db5ff707284a6.tar.gz
luarocks-a1fca499e15229968d46f15c024db5ff707284a6.tar.bz2
luarocks-a1fca499e15229968d46f15c024db5ff707284a6.zip
type_check
-rw-r--r--src/luarocks/type_check.lua6
-rw-r--r--src/luarocks/type_check.tl8
2 files changed, 13 insertions, 1 deletions
diff --git a/src/luarocks/type_check.lua b/src/luarocks/type_check.lua
index ead47bf2..c77119d2 100644
--- a/src/luarocks/type_check.lua
+++ b/src/luarocks/type_check.lua
@@ -30,6 +30,7 @@ type_check.MAGIC_PLATFORMS = {}
30 30
31do 31do
32 local function fill_in_version(tbl, version) 32 local function fill_in_version(tbl, version)
33
33 if not tbl.fields then 34 if not tbl.fields then
34 return 35 return
35 end 36 end
@@ -203,6 +204,11 @@ function type_check.type_check_table(version, tbl, typetbl, context)
203 end 204 end
204 end 205 end
205 end 206 end
207
208 if not tbl.fields then
209 return
210 end
211
206 for k, v in pairs(typetbl.fields) do 212 for k, v in pairs(typetbl.fields) do
207 if k:sub(1, 1) ~= "_" and v._mandatory then 213 if k:sub(1, 1) ~= "_" and v._mandatory then
208 if not tbl[k] then 214 if not tbl[k] then
diff --git a/src/luarocks/type_check.tl b/src/luarocks/type_check.tl
index a42533e1..6a26b87f 100644
--- a/src/luarocks/type_check.tl
+++ b/src/luarocks/type_check.tl
@@ -30,7 +30,8 @@ type_check.MAGIC_PLATFORMS = {}
30 30
31do 31do
32 local function fill_in_version(tbl: TableSchema, version?: string) 32 local function fill_in_version(tbl: TableSchema, version?: string)
33 if not tbl.fields then 33
34 if not tbl.fields then --! validation
34 return 35 return
35 end 36 end
36 37
@@ -203,6 +204,11 @@ function type_check.type_check_table(version: string, tbl: {any: any}, typetbl:
203 end 204 end
204 end 205 end
205 end 206 end
207
208 if not tbl.fields then --! validation
209 return
210 end
211
206 for k, v in pairs(typetbl.fields) do 212 for k, v in pairs(typetbl.fields) do
207 if k:sub(1,1) ~= "_" and v._mandatory then 213 if k:sub(1,1) ~= "_" and v._mandatory then
208 if not tbl[k] then 214 if not tbl[k] then