|
@@ -107,7 +107,7 @@ class Boot {
|
|
Check if specified property has getter
|
|
Check if specified property has getter
|
|
**/
|
|
**/
|
|
public static function hasGetter(phpClassName:String, property:String):Bool {
|
|
public static function hasGetter(phpClassName:String, property:String):Bool {
|
|
- if(!ensureLoaded(phpClassName))
|
|
|
|
|
|
+ if (!ensureLoaded(phpClassName))
|
|
return false;
|
|
return false;
|
|
|
|
|
|
var has = false;
|
|
var has = false;
|
|
@@ -124,7 +124,7 @@ class Boot {
|
|
Check if specified property has setter
|
|
Check if specified property has setter
|
|
**/
|
|
**/
|
|
public static function hasSetter(phpClassName:String, property:String):Bool {
|
|
public static function hasSetter(phpClassName:String, property:String):Bool {
|
|
- if(!ensureLoaded(phpClassName))
|
|
|
|
|
|
+ if (!ensureLoaded(phpClassName))
|
|
return false;
|
|
return false;
|
|
|
|
|
|
var has = false;
|
|
var has = false;
|
|
@@ -148,7 +148,8 @@ class Boot {
|
|
Retrieve metadata for specified class
|
|
Retrieve metadata for specified class
|
|
**/
|
|
**/
|
|
public static function getMeta(phpClassName:String):Null<Dynamic> {
|
|
public static function getMeta(phpClassName:String):Null<Dynamic> {
|
|
- if(!ensureLoaded(phpClassName)) return null;
|
|
|
|
|
|
+ if (!ensureLoaded(phpClassName))
|
|
|
|
+ return null;
|
|
return Global.isset(meta[phpClassName]) ? meta[phpClassName] : null;
|
|
return Global.isset(meta[phpClassName]) ? meta[phpClassName] : null;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -283,7 +284,7 @@ class Boot {
|
|
**/
|
|
**/
|
|
@:pure(false)
|
|
@:pure(false)
|
|
static public function isPhpKeyword(str:String):Bool {
|
|
static public function isPhpKeyword(str:String):Bool {
|
|
- //The body of this method is generated by the compiler
|
|
|
|
|
|
+ // The body of this method is generated by the compiler
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -596,7 +597,7 @@ class Boot {
|
|
if (result != null) {
|
|
if (result != null) {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
- if(!Global.method_exists(obj, methodName) && !Global.isset(Syntax.field(obj, methodName))) {
|
|
|
|
|
|
+ if (!Global.method_exists(obj, methodName) && !Global.isset(Syntax.field(obj, methodName))) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
result = new HxClosure(obj, methodName);
|
|
result = new HxClosure(obj, methodName);
|
|
@@ -769,6 +770,9 @@ private class HxString {
|
|
}
|
|
}
|
|
|
|
|
|
public static function indexOf(str:String, search:String, startIndex:Int = null):Int {
|
|
public static function indexOf(str:String, search:String, startIndex:Int = null):Int {
|
|
|
|
+ if (search.length == 0) {
|
|
|
|
+ return Global.max(0, Global.min(startIndex == null ? 0 : startIndex, str.length));
|
|
|
|
+ }
|
|
if (startIndex == null) {
|
|
if (startIndex == null) {
|
|
startIndex = 0;
|
|
startIndex = 0;
|
|
} else {
|
|
} else {
|
|
@@ -793,9 +797,15 @@ private class HxString {
|
|
}
|
|
}
|
|
|
|
|
|
public static function lastIndexOf(str:String, search:String, startIndex:Int = null):Int {
|
|
public static function lastIndexOf(str:String, search:String, startIndex:Int = null):Int {
|
|
|
|
+ if (search.length == 0) {
|
|
|
|
+ return Global.max(0, Global.min(startIndex == null ? str.length : startIndex, str.length));
|
|
|
|
+ }
|
|
var start = startIndex;
|
|
var start = startIndex;
|
|
if (start == null) {
|
|
if (start == null) {
|
|
start = 0;
|
|
start = 0;
|
|
|
|
+ }
|
|
|
|
+ if (startIndex == null) {
|
|
|
|
+ startIndex = 0;
|
|
} else {
|
|
} else {
|
|
var length = str.length;
|
|
var length = str.length;
|
|
if (start >= 0) {
|
|
if (start >= 0) {
|
|
@@ -809,7 +819,8 @@ private class HxString {
|
|
}
|
|
}
|
|
var index:EitherType<Int, Bool> = if (search == '') {
|
|
var index:EitherType<Int, Bool> = if (search == '') {
|
|
var length = str.length;
|
|
var length = str.length;
|
|
- startIndex == null || startIndex > length ? length : startIndex;
|
|
|
|
|
|
+ startIndex == null
|
|
|
|
+ || startIndex > length ? length : startIndex;
|
|
} else {
|
|
} else {
|
|
Global.mb_strrpos(str, search, start);
|
|
Global.mb_strrpos(str, search, start);
|
|
}
|
|
}
|
|
@@ -942,17 +953,14 @@ private class HxDynamicStr extends HxClosure {
|
|
|
|
|
|
/**
|
|
/**
|
|
Anonymous objects implementation
|
|
Anonymous objects implementation
|
|
-**/
|
|
|
|
-@:keep
|
|
|
|
-@:dox(hide)
|
|
|
|
-private class HxAnon extends StdClass {
|
|
|
|
|
|
+**/ @:keep @:dox(hide) private class HxAnon extends StdClass {
|
|
public function new(fields:NativeArray = null) {
|
|
public function new(fields:NativeArray = null) {
|
|
super();
|
|
super();
|
|
if (fields != null) {
|
|
if (fields != null) {
|
|
Syntax.foreach(fields, function(name, value) Syntax.setField(this, name, value));
|
|
Syntax.foreach(fields, function(name, value) Syntax.setField(this, name, value));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@:phpMagic
|
|
@:phpMagic
|
|
function __get(name:String) {
|
|
function __get(name:String) {
|
|
return null;
|
|
return null;
|
|
@@ -966,10 +974,7 @@ private class HxAnon extends StdClass {
|
|
|
|
|
|
/**
|
|
/**
|
|
Closures implementation
|
|
Closures implementation
|
|
-**/
|
|
|
|
-@:keep
|
|
|
|
-@:dox(hide)
|
|
|
|
-private class HxClosure {
|
|
|
|
|
|
+**/ @:keep @:dox(hide) private class HxClosure {
|
|
/** `this` for instance methods; php class name for static methods */
|
|
/** `this` for instance methods; php class name for static methods */
|
|
var target:Dynamic;
|
|
var target:Dynamic;
|
|
|
|
|
|
@@ -1023,4 +1028,4 @@ private class HxClosure {
|
|
public function callWith(newThis:Dynamic, args:NativeArray):Dynamic {
|
|
public function callWith(newThis:Dynamic, args:NativeArray):Dynamic {
|
|
return Global.call_user_func_array(getCallback(newThis), args);
|
|
return Global.call_user_func_array(getCallback(newThis), args);
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|