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

[js] simplify Reflect.field by hand to avoid creating unnecessary closure because analyzer will ignore it now (because of untyped)

Dan Korostelev 10 жил өмнө
parent
commit
8355f6fbe7

+ 2 - 2
std/js/_std/Reflect.hx

@@ -25,8 +25,8 @@
 		return untyped __js__('Object').prototype.hasOwnProperty.call(o, field);
 	}
 
-	public static function field( o : Dynamic, field : String ) : Dynamic untyped {
-		return try o[field] catch( e : Dynamic ) null;
+	public static function field( o : Dynamic, field : String ) : Dynamic {
+		try return untyped o[field] catch( e : Dynamic ) return null;
 	}
 
 	public inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {