Nicolas Cannasse před 9 roky
rodič
revize
2962610417
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. 3 2
      std/hl/_std/Reflect.hx

+ 3 - 2
std/hl/_std/Reflect.hx

@@ -63,10 +63,11 @@ class Reflect {
 		if( ft.kind != HFun )
 			throw "Invalid function " + func;
 		var need = ft.getArgsCount();
-		if( o != null && hl.types.Api.getClosureValue(func) == null && count == need )
+		var isClosure = hl.types.Api.getClosureValue(func) != null;
+		if( o != null && !isClosure && count == need )
 			o = null;
-		if( o != null ) need++;
 		var nargs = o == null ? count : count + 1;
+		if( isClosure ) need++;
 		if( nargs < need ) nargs = need;
 		var a = new hl.types.NativeArray<Dynamic>(nargs);
 		if( o == null ) {