Bladeren bron

[flash] update Array proto with ArrayIterator

Aleksandr Kuzmenko 5 jaren geleden
bovenliggende
commit
4b60ab6db4
1 gewijzigde bestanden met toevoegingen van 1 en 10 verwijderingen
  1. 1 10
      std/flash/Boot.hx

+ 1 - 10
std/flash/Boot.hx

@@ -311,16 +311,7 @@ class Boot extends flash.display.MovieClip {
 				return true;
 				return true;
 			}
 			}
 			aproto.iterator = function() {
 			aproto.iterator = function() {
-				var cur = 0;
-				var arr:Array<Dynamic> = __this__;
-				return {
-					hasNext: function() {
-						return cur < arr.length;
-					},
-					next: function() {
-						return arr[cur++];
-					}
-				}
+				return new haxe.iterators.ArrayIterator(cast __this__);
 			};
 			};
 			aproto.resize = function(len) {
 			aproto.resize = function(len) {
 				__this__.length = len;
 				__this__.length = len;