From d00dfe1afcf6366a13cb4372b2328d80a8e8b3e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 18 Dec 2018 18:14:49 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=BE=80=5FG=E9=87=8C=E5=A1=9E?= =?UTF-8?q?=E5=80=BC=E4=BC=9A=E5=AF=BC=E8=87=B4=E6=9C=AA=E5=A3=B0=E6=98=8E?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E5=8F=98=E9=87=8F=E5=88=A4=E6=96=AD=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/matcher/diagnostics.lua | 17 +++++++++-------- server/test/diagnostics/init.lua | 5 +++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/server/src/matcher/diagnostics.lua b/server/src/matcher/diagnostics.lua index 07076b08..e7dfb533 100644 --- a/server/src/matcher/diagnostics.lua +++ b/server/src/matcher/diagnostics.lua @@ -27,14 +27,15 @@ local function searchUndefinedGlobal(results, callback) if field.value.lib then goto NEXT_VAR end - if type(index) == 'string' then - local lIndex = index:lower() - if lIndex == 'log' or lIndex == 'arg' then - goto NEXT_VAR - end - if not index:find '%l' then - goto NEXT_VAR - end + if type(index) ~= 'string' then + goto NEXT_VAR + end + local lIndex = index:lower() + if lIndex == 'log' or lIndex == 'arg' then + goto NEXT_VAR + end + if not index:find '%l' then + goto NEXT_VAR end if #field >= 3 then goto NEXT_VAR diff --git a/server/test/diagnostics/init.lua b/server/test/diagnostics/init.lua index 83725a33..8cfbe4f2 100644 --- a/server/test/diagnostics/init.lua +++ b/server/test/diagnostics/init.lua @@ -126,3 +126,8 @@ local function x(a, b) end x(1, 2, ) ]] + +TEST [[ +instanceName = 1 +instance = _G[instanceName] +]] -- cgit debian/1.2.3+git2.25.1-1-2-gaceb0