@@ -40,10 +40,16 @@ class IntIter {
this.max = max;
}
+ /**
+ Returns true if the iterator has other items, false otherwise.
+ **/
public function hasNext() {
return min < max;
+ Moves to the next item of the iterator.
public function next() {
return min++;
@@ -72,7 +72,11 @@ class Lambda {
/**
- Tells if the element is part of an iterable
+ Tells if the element is part of an iterable. The comparison
+ is made using the [==] operator. Optionally you can pass as
+ a third parameter a function that performs the comparison.
+ That function must take as arguments the two items to
+ compare and returns a boolean value.
**/
public static function has<A>( it : Iterable<A>, elt : A, ?cmp : A -> A -> Bool ) : Bool {
if( cmp == null ) {
@@ -88,7 +92,7 @@ class Lambda {
- Tells if at least one element of the iterable if found by using the specific function.
+ Tells if at least one element of the iterable is found by using the specific function.
public static function exists<A>( it : Iterable<A>, f : A -> Bool ) {
for( x in it )
@@ -405,7 +405,7 @@ class Type {
if(untyped c.__qname__ == 'Array') return ['push', 'concat', 'join', 'pop', 'reverse', 'shift', 'slice', 'sort', 'splice', 'toString', 'copy', 'unshift', 'insert', 'remove', 'iterator', 'length'];
untyped __php__("
$rfl = $c->__rfl__();
- if($rfl === null) return array();
+ if($rfl === null) return new _hx_array(array());
$ms = $rfl->getMethods();
$ps = $rfl->getProperties();
$r = array();
@@ -454,7 +454,7 @@ class Type {
if(untyped c.__qname__ == 'Array') return [];
@@ -530,7 +530,7 @@ class _hx_type {
private $rfl = false;
public function __rfl__() {
if($this->rfl !== false) return $this->rfl;
- if(class_exists($this->__tname__))
+ if(class_exists($this->__tname__) || interface_exists($this->__tname__))
$this->rfl = new ReflectionClass($this->__tname__);
else
$this->rfl = null;
@@ -75,6 +75,7 @@ class Manager<T : Object> {
var instance_fields = Type.getInstanceFields(cls);
var scls = Type.getSuperClass(cls);
+ while (Type.getSuperClass(scls) != null) scls = Type.getSuperClass(scls);
if(scls != null) {
for(remove in Type.getInstanceFields(scls))
instance_fields.remove(remove);