瀏覽代碼

[flash] update Array proto with ArrayIterator

Aleksandr Kuzmenko 5 年之前
父節點
當前提交
4b60ab6db4
共有 1 個文件被更改,包括 1 次插入10 次删除
  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;