Browse Source

[flash] update Array proto with ArrayIterator

Aleksandr Kuzmenko 5 years ago
parent
commit
4b60ab6db4
1 changed files with 1 additions and 10 deletions
  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;
 			}
 			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) {
 				__this__.length = len;