From 4e9f8c16ed240d949cf06aa3bdd9736bdff7e737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 29 Oct 2020 21:43:43 +0800 Subject: =?UTF-8?q?=E6=9E=84=E5=BB=BA=20table=20=E5=85=88=E5=86=99?= =?UTF-8?q?=E4=B8=AA=20TODO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/vm/getClass.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'script-beta/vm/getClass.lua') diff --git a/script-beta/vm/getClass.lua b/script-beta/vm/getClass.lua index ec86e0cf..2a507b12 100644 --- a/script-beta/vm/getClass.lua +++ b/script-beta/vm/getClass.lua @@ -11,8 +11,8 @@ local function lookUpDocClass(source) end end -local function getClass(source, classes, deep, simple) - local lib = vm.getLibrary(source, simple) +local function getClass(source, classes, depth, deep) + local lib = vm.getLibrary(source, deep) if lib then if lib.value.type == 'table' then classes[#classes+1] = lib.value.name @@ -26,11 +26,11 @@ local function getClass(source, classes, deep, simple) classes[#classes+1] = docClass return end - if deep > 3 then + if depth > 3 then return end local value = guide.getObjectValue(source) or source - if simple and value == source then + if deep and value == source then if value and value.type == 'string' then classes[#classes+1] = value[1] end @@ -56,13 +56,13 @@ local function getClass(source, classes, deep, simple) return end vm.eachMeta(source, function (mt) - getClass(mt, classes, deep + 1, simple) + getClass(mt, classes, depth + 1, deep) end) end -function vm.getClass(source, simple) +function vm.getClass(source, deep) local classes = {} - getClass(source, classes, 1, simple) + getClass(source, classes, 1, deep) if #classes == 0 then return nil end -- cgit v1.2.3