Bläddra i källkod

fixed instanceOf

Nicolas Cannasse 19 år sedan
förälder
incheckning
fc2cb1370c
1 ändrade filer med 7 tillägg och 2 borttagningar
  1. 7 2
      std/js/Boot.hx

+ 7 - 2
std/js/Boot.hx

@@ -152,8 +152,13 @@ class Boot {
 
 	private static function __instanceof(o,cl) {
 		untyped {
-			if( __interfLoop(o.__class__,cl) )
-				return true;
+			try {
+				if( __js__("o instanceof cl") )
+					return true;
+				if( __interfLoop(o.__class__,cl) )
+					return true;
+			} catch( e : Dynamic ) {
+			}
 			switch( cl ) {
 			case Int:
 				return (Math.ceil(o) === o) && isFinite(o);