@@ -9,7 +9,7 @@ local lang = require 'language'
99
1010--- @param object vm.node.object
1111--- @return string ?
12- local function getNodeName (object )
12+ function vm . getNodeName (object )
1313 if object .type == ' global' and object .cate == ' type' then
1414 --- @cast object vm.global
1515 return object .name
@@ -90,14 +90,14 @@ local function checkParentEnum(parentName, child, uri, mark, errs)
9090 return false
9191 else
9292 --- @cast child parser.object
93- local childName = getNodeName (child )
93+ local childName = vm . getNodeName (child )
9494 if childName == ' number'
9595 or childName == ' integer'
9696 or childName == ' boolean'
9797 or childName == ' string' then
9898 for _ , enum in ipairs (enums ) do
9999 for nd in vm .compileNode (enum ):eachObject () do
100- if childName == getNodeName (nd ) and nd [1 ] == child [1 ] then
100+ if childName == vm . getNodeName (nd ) and nd [1 ] == child [1 ] then
101101 return true
102102 end
103103 end
@@ -284,7 +284,7 @@ function vm.isSubType(uri, child, parent, mark, errs)
284284 if config .get (uri , ' Lua.type.weakUnionCheck' ) then
285285 local hasKnownType = 0
286286 for n in child :eachObject () do
287- if getNodeName (n ) then
287+ if vm . getNodeName (n ) then
288288 hasKnownType = hasKnownType + 1
289289 if vm .isSubType (uri , n , parent , mark , errs ) == true then
290290 return true
@@ -303,7 +303,7 @@ function vm.isSubType(uri, child, parent, mark, errs)
303303 else
304304 local weakNil = config .get (uri , ' Lua.type.weakNilCheck' )
305305 for n in child :eachObject () do
306- local nodeName = getNodeName (n )
306+ local nodeName = vm . getNodeName (n )
307307 if nodeName
308308 and not (nodeName == ' nil' and weakNil )
309309 and vm .isSubType (uri , n , parent , mark , errs ) == false then
@@ -329,7 +329,7 @@ function vm.isSubType(uri, child, parent, mark, errs)
329329 end
330330
331331 --- @cast child vm.node.object
332- local childName = getNodeName (child )
332+ local childName = vm . getNodeName (child )
333333 if childName == ' any'
334334 or childName == ' unknown' then
335335 return true
@@ -349,7 +349,7 @@ function vm.isSubType(uri, child, parent, mark, errs)
349349 elseif parent .type == ' vm.node' then
350350 local hasKnownType = 0
351351 for n in parent :eachObject () do
352- if getNodeName (n ) then
352+ if vm . getNodeName (n ) then
353353 hasKnownType = hasKnownType + 1
354354 if vm .isSubType (uri , child , n , mark , errs ) == true then
355355 return true
@@ -377,7 +377,7 @@ function vm.isSubType(uri, child, parent, mark, errs)
377377
378378 --- @cast parent vm.node.object
379379
380- local parentName = getNodeName (parent )
380+ local parentName = vm . getNodeName (parent )
381381 if parentName == ' any'
382382 or parentName == ' unknown' then
383383 return true
0 commit comments