|
@@ -444,6 +444,11 @@ let rec gen_call ctx e el in_value =
|
|
gen_value ctx e;
|
|
gen_value ctx e;
|
|
spr ctx ")";
|
|
spr ctx ")";
|
|
end
|
|
end
|
|
|
|
+ | TField (x,f), [] when field_name f = "iterator" && is_dynamic_iterator ctx e ->
|
|
|
|
+ add_feature ctx "use.$getIterator";
|
|
|
|
+ print ctx "$getIterator(";
|
|
|
|
+ gen_value ctx x;
|
|
|
|
+ print ctx ")";
|
|
| _ ->
|
|
| _ ->
|
|
gen_value ctx e;
|
|
gen_value ctx e;
|
|
spr ctx "(";
|
|
spr ctx "(";
|
|
@@ -1527,6 +1532,10 @@ let generate com =
|
|
print ctx "function $iterator(o) { if( o instanceof Array ) return function() { return HxOverrides.iter(o); }; return typeof(o.iterator) == 'function' ? $bind(o,o.iterator) : o.iterator; }";
|
|
print ctx "function $iterator(o) { if( o instanceof Array ) return function() { return HxOverrides.iter(o); }; return typeof(o.iterator) == 'function' ? $bind(o,o.iterator) : o.iterator; }";
|
|
newline ctx;
|
|
newline ctx;
|
|
end;
|
|
end;
|
|
|
|
+ if has_feature ctx "use.$getIterator" then begin
|
|
|
|
+ print ctx "function $getIterator(o) { if( o instanceof Array ) return HxOverrides.iter(o); else return o.iterator(); }";
|
|
|
|
+ newline ctx;
|
|
|
|
+ end;
|
|
if has_feature ctx "use.$bind" then begin
|
|
if has_feature ctx "use.$bind" then begin
|
|
print ctx "var $_, $fid = 0";
|
|
print ctx "var $_, $fid = 0";
|
|
newline ctx;
|
|
newline ctx;
|