Implemented as Std.is ? cast : null as per php, don't know if there's something better that could be used.
@@ -24,6 +24,10 @@
return untyped __global__.__instanceof(v,t);
}
+ public static function instance<T>( v : { }, c : Class<T> ) : T {
+ return Std.is(v, c) ? cast v : null;
+ }
+
public static function string( s : Dynamic ) : String {
return untyped s==null ? "null" : s.toString();