From 99691a901cc26bc44720ced49729d436a09129ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 20 Jun 2022 15:54:56 +0800 Subject: update --- script/service/telemetry.lua | 1 + script/vm/doc.lua | 12 ++++++------ script/vm/type.lua | 3 +++ script/vm/value.lua | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) (limited to 'script') diff --git a/script/service/telemetry.lua b/script/service/telemetry.lua index 2e52def2..211dff0e 100644 --- a/script/service/telemetry.lua +++ b/script/service/telemetry.lua @@ -90,6 +90,7 @@ local function pushErrorLog(link) )) end +---@type boolean? local isValid = false timer.wait(5, function () diff --git a/script/vm/doc.lua b/script/vm/doc.lua index 6ee00192..31d7f0ff 100644 --- a/script/vm/doc.lua +++ b/script/vm/doc.lua @@ -90,10 +90,10 @@ end ---@return parser.object? local function getDeprecated(value) if not value.bindDocs then - return false + return nil end if value._deprecated ~= nil then - return value._deprecated + return value._deprecated or nil end for _, doc in ipairs(value.bindDocs) do if doc.type == 'doc.deprecated' then @@ -108,7 +108,7 @@ local function getDeprecated(value) end end value._deprecated = false - return false + return nil end ---@return parser.object? @@ -116,9 +116,9 @@ function vm.getDeprecated(value, deep) if deep then local defs = vm.getDefs(value) if #defs == 0 then - return false + return nil end - local deprecated = false + local deprecated for _, def in ipairs(defs) do if def.type == 'setglobal' or def.type == 'setfield' @@ -128,7 +128,7 @@ function vm.getDeprecated(value, deep) or def.type == 'tableindex' then deprecated = getDeprecated(def) if not deprecated then - return false + return nil end end end diff --git a/script/vm/type.lua b/script/vm/type.lua index 15c94dfc..fd4c1a17 100644 --- a/script/vm/type.lua +++ b/script/vm/type.lua @@ -29,6 +29,9 @@ local function getNodeName(object) if object.type == 'doc.type.table' then return 'table' end + if object.type == 'doc.type.array' then + return 'table' + end return nil end diff --git a/script/vm/value.lua b/script/vm/value.lua index d29ca9d0..13e27e59 100644 --- a/script/vm/value.lua +++ b/script/vm/value.lua @@ -141,7 +141,7 @@ function vm.getInteger(v) end ---@param v vm.object? ----@return integer? +---@return string? function vm.getString(v) if not v then return nil -- cgit v1.2.3