Browse Source

fixed Std.is(null,Dynamic) == false for #7532

Nicolas Cannasse 7 years ago
parent
commit
fc895aaf18
2 changed files with 2 additions and 2 deletions
  1. 1 1
      std/hl/_std/Std.hx
  2. 1 1
      std/neko/Boot.hx

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

@@ -45,7 +45,7 @@ class Std {
 		if( t == null ) return false;
 		if( t == null ) return false;
 		switch( t.__type__.kind ) {
 		switch( t.__type__.kind ) {
 		case HDyn:
 		case HDyn:
-			return true;
+			return v != null;
 		case HF64:
 		case HF64:
 			switch( hl.Type.getDynamic(v).kind ) {
 			switch( hl.Type.getDynamic(v).kind ) {
 			case HUI8, HUI16, HI32:
 			case HUI8, HUI16, HI32:

+ 1 - 1
std/neko/Boot.hx

@@ -70,7 +70,7 @@ class Boot {
 	private static function __instanceof(o:Dynamic, cl:Dynamic) {
 	private static function __instanceof(o:Dynamic, cl:Dynamic) {
 		untyped {
 		untyped {
 			if( cl == Dynamic )
 			if( cl == Dynamic )
-				return true;
+				return o != null;
 			switch( __dollar__typeof(o) ) {
 			switch( __dollar__typeof(o) ) {
 			case 1: return (cl == Int || cl == Float);
 			case 1: return (cl == Int || cl == Float);
 			case 2: return cl == Float || (cl == Int && __dollar__int(o) == o);
 			case 2: return cl == Float || (cl == Int && __dollar__int(o) == o);