diff --git a/hscript/Interp.hx b/hscript/Interp.hx index df9d176..47515bd 100644 --- a/hscript/Interp.hx +++ b/hscript/Interp.hx @@ -556,6 +556,11 @@ class Interp { function makeIterator( v : Dynamic ) : Iterator { #if ((flash && !flash9) || (php && !php7 && haxe_ver < '4.0.0')) if ( v.iterator != null ) v = v.iterator(); + #elseif js + // don't use try/catch (very slow) + if( v is Array ) + return (v : Array).iterator(); + if( v.iterator != null ) v = v.iterator(); #else try v = v.iterator() catch( e : Dynamic ) {}; #end