|
@@ -201,7 +201,7 @@ class Boot {
|
|
|
Check if provided value is an anonymous object
|
|
|
**/
|
|
|
public static inline function isAnon(v:Any):Bool {
|
|
|
- return Std.is(v, HxAnon);
|
|
|
+ return Std.isOfType(v, HxAnon);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -342,7 +342,7 @@ class Boot {
|
|
|
return value;
|
|
|
}
|
|
|
case _:
|
|
|
- if (value.is_object() && Std.is(value, cast hxClass)) {
|
|
|
+ if (value.is_object() && Std.isOfType(value, cast hxClass)) {
|
|
|
return value;
|
|
|
}
|
|
|
}
|
|
@@ -376,10 +376,10 @@ class Boot {
|
|
|
return '[' + Global.implode(', ', strings) + ']';
|
|
|
}
|
|
|
if (value.is_object()) {
|
|
|
- if (Std.is(value, Array)) {
|
|
|
+ if (Std.isOfType(value, Array)) {
|
|
|
return inline stringifyNativeIndexedArray(value.arr, maxRecursion - 1);
|
|
|
}
|
|
|
- if (Std.is(value, HxEnum)) {
|
|
|
+ if (Std.isOfType(value, HxEnum)) {
|
|
|
var e:HxEnum = value;
|
|
|
var result = e.tag;
|
|
|
if (Global.count(e.params) > 0) {
|
|
@@ -394,7 +394,7 @@ class Boot {
|
|
|
if (value.method_exists('__toString')) {
|
|
|
return value.__toString();
|
|
|
}
|
|
|
- if (Std.is(value, StdClass)) {
|
|
|
+ if (Std.isOfType(value, StdClass)) {
|
|
|
if (Global.isset(Syntax.field(value, 'toString')) && value.toString.is_callable()) {
|
|
|
return value.toString();
|
|
|
}
|
|
@@ -408,7 +408,7 @@ class Boot {
|
|
|
if (isFunction(value)) {
|
|
|
return '<function>';
|
|
|
}
|
|
|
- if (Std.is(value, HxClass)) {
|
|
|
+ if (Std.isOfType(value, HxClass)) {
|
|
|
return '[class ' + getClassName((value : HxClass).phpClassName) + ']';
|
|
|
} else {
|
|
|
return '[object ' + getClassName(Global.get_class(value)) + ']';
|
|
@@ -436,7 +436,7 @@ class Boot {
|
|
|
if (isNumber(left) && isNumber(right)) {
|
|
|
return Syntax.equal(left, right);
|
|
|
}
|
|
|
- if (Std.is(left, HxClosure) && Std.is(right, HxClosure)) {
|
|
|
+ if (Std.isOfType(left, HxClosure) && Std.isOfType(right, HxClosure)) {
|
|
|
return (left : HxClosure).equals(right);
|
|
|
}
|
|
|
return Syntax.strictEqual(left, right);
|
|
@@ -453,10 +453,15 @@ class Boot {
|
|
|
return Syntax.add(left, right);
|
|
|
}
|
|
|
|
|
|
+ @:deprecated('php.Boot.is() is deprecated. Use php.Boot.isOfType() instead')
|
|
|
+ public static inline function is(value:Dynamic, type:HxClass):Bool {
|
|
|
+ return isOfType(value, type);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
- `Std.is()` implementation
|
|
|
+ `Std.isOfType()` implementation
|
|
|
**/
|
|
|
- public static function is(value:Dynamic, type:HxClass):Bool {
|
|
|
+ public static function isOfType(value:Dynamic, type:HxClass):Bool {
|
|
|
if (type == null)
|
|
|
return false;
|
|
|
|
|
@@ -483,7 +488,7 @@ class Boot {
|
|
|
case 'php\\NativeArray', 'php\\_NativeArray\\NativeArray_Impl_':
|
|
|
return value.is_array();
|
|
|
case 'Enum' | 'Class':
|
|
|
- if (Std.is(value, HxClass)) {
|
|
|
+ if (Std.isOfType(value, HxClass)) {
|
|
|
var valuePhpClass = (cast value : HxClass).phpClassName;
|
|
|
var enumPhpClass = (cast HxEnum : HxClass).phpClassName;
|
|
|
var isEnumType = Global.is_subclass_of(valuePhpClass, enumPhpClass);
|
|
@@ -502,28 +507,28 @@ class Boot {
|
|
|
Check if `value` is a `Class<T>`
|
|
|
**/
|
|
|
public static inline function isClass(value:Dynamic):Bool {
|
|
|
- return Std.is(value, HxClass);
|
|
|
+ return Std.isOfType(value, HxClass);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
Check if `value` is an enum constructor instance
|
|
|
**/
|
|
|
public static inline function isEnumValue(value:Dynamic):Bool {
|
|
|
- return Std.is(value, HxEnum);
|
|
|
+ return Std.isOfType(value, HxEnum);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
Check if `value` is a function
|
|
|
**/
|
|
|
public static inline function isFunction(value:Dynamic):Bool {
|
|
|
- return Std.is(value, Closure) || Std.is(value, HxClosure);
|
|
|
+ return Std.isOfType(value, Closure) || Std.isOfType(value, HxClosure);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
Check if `value` is an instance of `HxClosure`
|
|
|
**/
|
|
|
public static inline function isHxClosure(value:Dynamic):Bool {
|
|
|
- return Std.is(value, HxClosure);
|
|
|
+ return Std.isOfType(value, HxClosure);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -972,7 +977,7 @@ private class HxClosure {
|
|
|
if (target.is_null()) {
|
|
|
throw "Unable to create closure on `null`";
|
|
|
}
|
|
|
- callable = Std.is(target, HxAnon) ? Syntax.field(target, func) : Syntax.arrayDecl(target, func);
|
|
|
+ callable = Std.isOfType(target, HxAnon) ? Syntax.field(target, func) : Syntax.arrayDecl(target, func);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -990,7 +995,7 @@ private class HxClosure {
|
|
|
if (eThis == null) {
|
|
|
eThis = target;
|
|
|
}
|
|
|
- if (Std.is(eThis, HxAnon)) {
|
|
|
+ if (Std.isOfType(eThis, HxAnon)) {
|
|
|
return Syntax.field(eThis, func);
|
|
|
}
|
|
|
return Syntax.arrayDecl(eThis, func);
|