Browse Source

[js] get rid of untyped in Type.getClass (it only requires @:privateAccess), make it inline, but disable inline of js.Boot.getClass, as it's quite complex and has untyped

Dan Korostelev 10 years ago
parent
commit
a6cc542010
2 changed files with 3 additions and 5 deletions
  1. 1 1
      std/js/Boot.hx
  2. 2 4
      std/js/_std/Type.hx

+ 1 - 1
std/js/Boot.hx

@@ -68,7 +68,7 @@ class Boot {
 		return untyped __define_feature__("js.Boot.isEnum", e.__ename__);
 	}
 
-	static inline function getClass(o:Dynamic) : Dynamic {
+	static function getClass(o:Dynamic) : Dynamic {
 		if (Std.is(o, Array))
 			return Array;
 		else {

+ 2 - 4
std/js/_std/Type.hx

@@ -33,10 +33,8 @@ enum ValueType {
 
 @:coreApi class Type {
 
-	public static function getClass<T>( o : T ) : Class<T> untyped {
-		if( o == null )
-			return null;
-		return js.Boot.getClass(o);
+	public static inline function getClass<T>( o : T ) : Class<T> {
+		return if (o == null) null else @:privateAccess js.Boot.getClass(o);
 	}
 
 	public static function getEnum( o : EnumValue ) : Enum<Dynamic> untyped {