Browse Source

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

Aleksandr Kuzmenko 5 years ago
parent
commit
5d5d3e5d8f
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/generators/genphp7.ml

+ 1 - 0
src/generators/genphp7.ml

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