Browse Source

added inheritance for instanceof.

Nicolas Cannasse 19 years ago
parent
commit
b3b0b0a417
1 changed files with 8 additions and 2 deletions
  1. 8 2
      std/js/Boot.hx

+ 8 - 2
std/js/Boot.hx

@@ -114,14 +114,20 @@ class Boot {
 			try {
 			try {
 				if( __js__("o instanceof cl") )
 				if( __js__("o instanceof cl") )
 					return true;
 					return true;
-				var il = o.__class__.__interfaces__;
+			} catch( e : Dynamic ) {
+			}
+			var c = o.__class__;
+			while( c != null ) {
+				if( c == cl )
+					return true;
+				var il = c.__interfaces__;
 				var i = 0;
 				var i = 0;
 				while( i < il.length ) {
 				while( i < il.length ) {
 					if( il[i] == cl )
 					if( il[i] == cl )
 						return true;
 						return true;
 					i++;
 					i++;
 				}
 				}
-			} catch( e : Dynamic ) {
+				c = c.__super__;
 			}
 			}
 			switch( cl ) {
 			switch( cl ) {
 			case Int:
 			case Int: