浏览代码

[php] fixed false detection of `catch` vars in anon functions
as captured from outer scope

Aleksandr Kuzmenko 5 年之前
父节点
当前提交
3455b817fd
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/generators/genphp7.ml

+ 1 - 0
src/generators/genphp7.ml

@@ -1885,6 +1885,7 @@ class code_writer (ctx:php_generator_context) hx_type_path php_name =
 				| [] -> ()
 				| (v,body) :: rest ->
 					self#write (" catch(" ^ (self#use_t v.v_type) ^ " $" ^ v.v_name ^ ") ");
+					vars#declared v.v_name;
 					self#write_as_block body;
 					traverse rest
 			in