浏览代码

[lua] remove unused HxOverrides and _iterator feature

Justin Donaldson 7 年之前
父节点
当前提交
61eec2577f
共有 1 个文件被更改,包括 0 次插入27 次删除
  1. 0 27
      src/generators/genlua.ml

+ 0 - 27
src/generators/genlua.ml

@@ -209,23 +209,6 @@ let is_dot_access e cf =
     | _ ->
     | _ ->
         false
         false
 
 
-let is_dynamic_iterator ctx e =
-    let check x =
-        has_feature ctx "HxOverrides.iter" && (match follow x.etype with
-            | TInst ({ cl_path = [],"Array" },_)
-            | TInst ({ cl_kind = KTypeParameter _}, _)
-            | TAnon _
-            | TDynamic _
-            | TMono _ ->
-                true
-            | _ -> false
-        )
-    in
-    match e.eexpr with
-    | TField (x,f) when field_name f = "iterator" -> check x
-    | _ ->
-        false
-
 (*
 (*
 	return index of a first element in the list for which `f` returns true
 	return index of a first element in the list for which `f` returns true
 	TODO: is there some standard function to do that?
 	TODO: is there some standard function to do that?
@@ -642,11 +625,6 @@ and gen_expr ?(local=true) ctx e = begin
         spr ctx "]";
         spr ctx "]";
     | TBinop (op,e1,e2) ->
     | TBinop (op,e1,e2) ->
         gen_tbinop ctx op e1 e2;
         gen_tbinop ctx op e1 e2;
-    | TField (x,f) when field_name f = "iterator" && is_dynamic_iterator ctx e ->
-        add_feature ctx "use._iterator";
-        print ctx "_iterator(";
-        gen_value ctx x;
-        print ctx ")";
     | TField (x,FClosure (_,f)) ->
     | TField (x,FClosure (_,f)) ->
         add_feature ctx "use._hx_bind";
         add_feature ctx "use._hx_bind";
         (match x.eexpr with
         (match x.eexpr with
@@ -2088,11 +2066,6 @@ let generate com =
     println ctx "end";
     println ctx "end";
     newline ctx;
     newline ctx;
 
 
-    if has_feature ctx "use._iterator" then begin
-        add_feature ctx "use._hx_bind";
-        println ctx "function _hx_iterator(o)  if ( lua.Boot.__instanceof(o, Array) ) then return function() return HxOverrides.iter(o) end elseif (typeof(o.iterator) == 'function') then return  _hx_bind(o,o.iterator) else return  o.iterator end end";
-    end;
-
     if has_feature ctx "use._hx_bind" then begin
     if has_feature ctx "use._hx_bind" then begin
         println ctx "_hx_bind = function(o,m)";
         println ctx "_hx_bind = function(o,m)";
         println ctx "  if m == nil then return nil end;";
         println ctx "  if m == nil then return nil end;";