@@ -373,7 +373,12 @@ function vm.isSubType(uri, child, parent, mark, errs)
373373 elseif child .type == ' vm.node' then
374374 if config .get (uri , ' Lua.type.weakUnionCheck' ) then
375375 local hasKnownType = 0
376+ local i = 0
376377 for n in child :eachObject () do
378+ i = i + 1
379+ if i > 100 then
380+ break
381+ end
377382 if vm .getNodeName (n ) then
378383 local res = vm .isSubType (uri , n , parent , mark , errs )
379384 if res == true then
@@ -397,7 +402,12 @@ function vm.isSubType(uri, child, parent, mark, errs)
397402 else
398403 local weakNil = config .get (uri , ' Lua.type.weakNilCheck' )
399404 local skipTable
405+ local i = 0
400406 for n in child :eachObject () do
407+ i = i + 1
408+ if i > 100 then
409+ break
410+ end
401411 if skipTable == nil and n .type == " table" and parent .type == " vm.node" then -- skip table type check if child has class
402412 --- @cast parent vm.node
403413 for _ , c in ipairs (child ) do
@@ -462,7 +472,12 @@ function vm.isSubType(uri, child, parent, mark, errs)
462472 parent = global
463473 elseif parent .type == ' vm.node' then
464474 local hasKnownType = 0
475+ local i = 0
465476 for n in parent :eachObject () do
477+ i = i + 1
478+ if i > 100 then
479+ break
480+ end
466481 if vm .getNodeName (n ) then
467482 local res = vm .isSubType (uri , child , n , mark , errs )
468483 if res == true then
0 commit comments