2
0
Эх сурвалжийг харах

[php] changed _hx_cast() to use _hx_instancof() instead of Std.is() to avoid handling php-prefix (fixes #6083)

Alexander Kuzmenko 8 жил өмнө
parent
commit
3b4c33024c

+ 1 - 1
std/php/Boot.hx

@@ -267,7 +267,7 @@ function _hx_array_assign($a, $i, $v) { return $a[$i] = $v; }
 class _hx_break_exception extends Exception {}
 class _hx_break_exception extends Exception {}
 
 
 function _hx_cast($v, $type) {
 function _hx_cast($v, $type) {
-	if(Std::is($v, $type)) {
+	if(_hx_instanceof($v, $type)) {
 		return $v;
 		return $v;
 	} else {
 	} else {
 		throw new HException('Class cast error');
 		throw new HException('Class cast error');

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

@@ -22,7 +22,7 @@
 @:coreApi class Std {
 @:coreApi class Std {
 
 
 	public static function is( v : Dynamic, t : Dynamic ) : Bool {
 	public static function is( v : Dynamic, t : Dynamic ) : Bool {
-		return untyped untyped __call__("_hx_instanceof", v,t);
+		return untyped __call__("_hx_instanceof", v,t);
 	}
 	}
 
 
 	public static function instance<T:{},S:T>( value : T, c : Class<S> ) : S {
 	public static function instance<T:{},S:T>( value : T, c : Class<S> ) : S {