Răsfoiți Sursa

[lua] fix bind behavior for inlined constructors

Justin Donaldson 9 ani în urmă
părinte
comite
f5fd1dc929
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      src/generators/genlua.ml

+ 2 - 2
src/generators/genlua.ml

@@ -468,9 +468,9 @@ and gen_expr ?(local=true) ctx e = begin
 			gen_value ctx x;
 			print ctx "%s)" (field f.cf_name)
 		| _ ->
-			print ctx "(__=";
+			print ctx "(function() local __=";
 			gen_value ctx x;
-			print ctx ",_hx_bind(__,__%s))" (field f.cf_name))
+			print ctx "; return _hx_bind(__,__%s) end)()" (field f.cf_name))
 	| TEnumParameter (x,_,i) ->
 		gen_value ctx x;
 		print ctx "[%i]" (i + 2)