Forráskód Böngészése

more Std.is(null,Dynamic) == false support (#7532)

Nicolas Cannasse 6 éve
szülő
commit
ad443a5fc8
7 módosított fájl, 7 hozzáadás és 7 törlés
  1. 1 1
      std/cs/_std/Std.hx
  2. 1 1
      std/flash/Boot.hx
  3. 1 1
      std/java/_std/Std.hx
  4. 1 1
      std/js/Boot.hx
  5. 1 1
      std/lua/Boot.hx
  6. 1 1
      std/php/Boot.hx
  7. 1 1
      std/python/_std/Std.hx

+ 1 - 1
std/cs/_std/Std.hx

@@ -43,7 +43,7 @@ import cs.internal.Exceptions;
 			case "System.Boolean":
 				return untyped __cs__('{0} is bool', v);
 			case "System.Object":
-				return true;
+				return v != null;
 		}
 
 		var vt = cs.Lib.getNativeType(v);

+ 1 - 1
std/flash/Boot.hx

@@ -99,7 +99,7 @@ class Boot extends flash.display.MovieClip {
 	public static function __instanceof( v : Dynamic, t : Dynamic ) {
 		try {
 			if( t == Dynamic )
-				return true;
+				return v != null;
 			return untyped __is__(v,t);
 		} catch( e : Dynamic ) {
 		}

+ 1 - 1
std/java/_std/Std.hx

@@ -45,7 +45,7 @@ import java.internal.Exceptions;
 			case "boolean", "java.lang.Boolean":
 				return untyped __java__('v instanceof java.lang.Boolean');
 			case "java.lang.Object":
-				return true;
+				return v != null;
 		}
 
 		var clv:java.lang.Class<Dynamic> = untyped __java__('v.getClass()');

+ 1 - 1
std/js/Boot.hx

@@ -186,7 +186,7 @@ class Boot {
 		case Array:
 			return js.Syntax.instanceof(o, Array) && o.__enum__ == null;
 		case Dynamic:
-			return true;
+			return o != null;
 		default:
 			if( o != null ) {
 				// Check if o is an instance of a Haxe class or a native JS object

+ 1 - 1
std/lua/Boot.hx

@@ -99,7 +99,7 @@ class Boot {
 			case Table:
 				return Lua.type(o) == "table";
 			case Dynamic:
-				return true;
+				return o != null;
 			default: {
 				if ( o!= null &&  Lua.type(o)  == "table" && Lua.type(cl) == "table"){
 					if (extendsOrImplements(getClass(o), cl)) return true;

+ 1 - 1
std/php/Boot.hx

@@ -410,7 +410,7 @@ class Boot {
 		var phpType = type.phpClassName;
 		switch (phpType) {
 			case 'Dynamic':
-				return true;
+				return value != null;
 			case 'Int':
 				return (
 						value.is_int()

+ 1 - 1
std/python/_std/Std.hx

@@ -56,7 +56,7 @@ import python.Syntax;
 			return false;
 		}
 		if (isMetaType(t,Dynamic)) {
-			return true;
+			return v != null;
 		}
 		var isBool = UBuiltins.isinstance(v, UBuiltins.bool);