Browse Source

bugfix : allow immediate calling of neko functions (body should not eat parameters).

Nicolas Cannasse 18 năm trước cách đây
mục cha
commit
1057c441cb
2 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 1 0
      doc/CHANGES.txt
  2. 2 1
      genneko.ml

+ 1 - 0
doc/CHANGES.txt

@@ -17,6 +17,7 @@
 	added Type.enumEq
 	local function parameters are now inferred in several cases
 	optional RTTI for Spod Object
+	bugfix related to callback in neko code generator
 
 2007-01-01: 1.10
 	fix in haxe.remoting.SocketConnection.readAnswer

+ 2 - 1
genneko.ml

@@ -233,7 +233,8 @@ and gen_call ctx p e el =
 	| TField (e,f) , el ->
 		call p (field p (gen_expr ctx e) f) (List.map (gen_expr ctx) el)
 	| _ , _ ->
-		call p (gen_expr ctx e) (List.map (gen_expr ctx) el)
+		let e = (match gen_expr ctx e with EFunction _, _ as e -> (EBlock [e],p) | e -> e) in
+		call p e (List.map (gen_expr ctx) el)
 
 and gen_closure p t e f =
 	match follow t with