2
0
Эх сурвалжийг харах

Remove useless functions

This prints some weird unnamed, even unused functions in BLOCKS, so
they are never assigned nor called.
I don’t know wtf, but I researched before that we can remove them.
Probably @Simn can shine a light :)
This generated from `func = function(a,b,c):Int return throw "error»;`
"TestType.hx", lineNumber = 283:
Looks like `fund` never used, so Haxe generates un-assigned-to-var anon
function.

```
local cb = tmp16;
	 --[[ Parenthesis --]] (function(a10,b8,c14)
		 --[[ Throw --]] error("error");
	end);
	 --[[ Call --]]
```
PeyTy 10 жил өмнө
parent
commit
14c9e5b9e1
1 өөрчлөгдсөн 1 нэмэгдсэн , 2 устгасан
  1. 1 2
      genlua.ml

+ 1 - 2
genlua.ml

@@ -787,8 +787,7 @@ and gen_block_element ?(after=false) ctx e =
 			| [] -> ()
 			| [e] -> gen_block_element ~after ctx e
 			| _ -> assert false)
-	| TFunction _ ->
-		gen_block_element ~after ctx (mk (TParenthesis e) e.etype e.epos)
+	| TFunction _ -> ()
 	| TObjectDecl fl ->
 		List.iter (fun (_,e) -> gen_block_element ~after ctx e) fl
 	| TVar (v,eo) ->