浏览代码

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

Nicolas Cannasse 18 年之前
父节点
当前提交
1057c441cb
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 1 0
      doc/CHANGES.txt
  2. 2 1
      genneko.ml

+ 1 - 0
doc/CHANGES.txt

@@ -17,6 +17,7 @@
 	added Type.enumEq
 	added Type.enumEq
 	local function parameters are now inferred in several cases
 	local function parameters are now inferred in several cases
 	optional RTTI for Spod Object
 	optional RTTI for Spod Object
+	bugfix related to callback in neko code generator
 
 
 2007-01-01: 1.10
 2007-01-01: 1.10
 	fix in haxe.remoting.SocketConnection.readAnswer
 	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 ->
 	| TField (e,f) , el ->
 		call p (field p (gen_expr ctx e) f) (List.map (gen_expr ctx) 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 =
 and gen_closure p t e f =
 	match follow t with
 	match follow t with