浏览代码

fix(lua): _hx_field_arr result and idx variables should be local (#10882)

Daniel Rodríguez Rivero 2 年之前
父节点
当前提交
8983b514bc
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      std/lua/_lua/_hx_anon.lua

+ 2 - 2
std/lua/_lua/_hx_anon.lua

@@ -33,8 +33,8 @@ local function _hx_new(prototype)
 end
 end
 
 
 function _hx_field_arr(obj)
 function _hx_field_arr(obj)
-    res = {}
-    idx = 0
+    local res = {}
+    local idx = 0
     if obj.__fields__ ~= nil then
     if obj.__fields__ ~= nil then
         obj = obj.__fields__
         obj = obj.__fields__
     end
     end