Sfoglia il codice sorgente

Std.is(*,null) = false

Nicolas Cannasse 19 anni fa
parent
commit
3c4add5265
4 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 1 0
      doc/CHANGES.txt
  2. 2 0
      std/flash/Boot.hx
  3. 2 0
      std/js/Boot.hx
  4. 2 0
      std/neko/Boot.hx

+ 1 - 0
doc/CHANGES.txt

@@ -9,6 +9,7 @@
 	fixed bug in bounded type parameters
 	fixed scope bug in try/catch with Flash9
 	added remoting over XMLSocket and LocalConnection for Flash9
+	fixed Std.is(*,null) = false
 	(TODO) -debug support for both Flash and JS
 	(TODO) resources in Flash9
 

+ 2 - 0
std/flash/Boot.hx

@@ -123,6 +123,8 @@ class Boot {
 
 	private static function __instanceof(o,cl) {
 		untyped {
+			if( !cl )
+				return false;
 			if( __instanceof__(o,cl) ) {
 				if( cl == Array )
 					return ( o[__unprotect__("__enum__")] == null );

+ 2 - 0
std/js/Boot.hx

@@ -159,6 +159,8 @@ class Boot {
 				if( __interfLoop(o.__class__,cl) )
 					return true;
 			} catch( e : Dynamic ) {
+				if( cl == null )
+					return false;
 			}
 			switch( cl ) {
 			case Int:

+ 2 - 0
std/neko/Boot.hx

@@ -77,6 +77,8 @@ class Boot {
 			case __dollar__tfloat: return cl == Float;
 			case __dollar__tbool: return cl == Bool;
 			case __dollar__tobject:
+				if( cl == null )
+					return false;
 				return __interfLoop(o.__class__,cl) || ( o.__enum__ == cl );
 			default:
 				return false;