Pārlūkot izejas kodu

Lua : fix up NativeIterator so that it is callable

Justin Donaldson 9 gadi atpakaļ
vecāks
revīzija
9f19ae1ab7
1 mainītis faili ar 4 papildinājumiem un 3 dzēšanām
  1. 4 3
      std/lua/NativeIterator.hx

+ 4 - 3
std/lua/NativeIterator.hx

@@ -28,9 +28,10 @@ package lua;
 	Haxe iterators, which provide a next/hasNext interface.
 	Haxe iterators, which provide a next/hasNext interface.
 **/
 **/
 
 
-abstract NativeIterator<T>(HaxeIterator<T>) {
+@:callable
+abstract NativeIterator<T>(Void->T) {
 	public function new(f : Void->T) {
 	public function new(f : Void->T) {
-		this = new HaxeIterator(f);
+		this = f; 
 	}
 	}
 
 
 	@:from
 	@:from
@@ -40,7 +41,7 @@ abstract NativeIterator<T>(HaxeIterator<T>) {
 
 
 	@:to
 	@:to
 	public function toF() : Iterator<T> {
 	public function toF() : Iterator<T> {
-		return this;
+		return new HaxeIterator(this);
 	}
 	}
 }
 }