소스 검색

[lua] fix bind behavior for inlined constructors

Justin Donaldson 9 년 전
부모
커밋
f5fd1dc929
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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)