Justinfront преди 12 години
родител
ревизия
406a09d7cb
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      std/java/_std/Std.hx

+ 5 - 1
std/java/_std/Std.hx

@@ -237,7 +237,11 @@ import java.internal.Exceptions;
 	public static function parseFloat( x : String ) : Float {
 		return 0.0;
 	}
-
+	
+	public static function instance<T>( v : { }, c : Class<T> ) : T {
+		return Std.is(v, c) ? cast v : null;
+	}
+	
 	public static function random( x : Int ) : Int {
 		if (x <= 0) return 0;
 		return Std.int(Math.random() * x);