Browse Source

[lua] avoid duplicate init calls, the check features routine is no longer necessary

Justin Donaldson 8 years ago
parent
commit
34d7d27ec2
1 changed files with 0 additions and 16 deletions
  1. 0 16
      src/generators/genlua.ml

+ 0 - 16
src/generators/genlua.ml

@@ -1749,10 +1749,6 @@ let generate_type ctx = function
 
 
 let generate_type_forward ctx = function
 let generate_type_forward ctx = function
 	| TClassDecl c ->
 	| TClassDecl c ->
-		(match c.cl_init with
-		| None -> ()
-		| Some e ->
-			ctx.inits <- e :: ctx.inits);
 		if not c.cl_extern then
 		if not c.cl_extern then
 		    begin
 		    begin
 			generate_package_create ctx c.cl_path;
 			generate_package_create ctx c.cl_path;
@@ -2017,18 +2013,6 @@ let generate com =
 	println ctx "end";
 	println ctx "end";
 	newline ctx;
 	newline ctx;
 
 
-	let rec chk_features e =
-		if is_dynamic_iterator ctx e then add_feature ctx "use._iterator";
-		match e.eexpr with
-		| TField (_,FClosure _) ->
-			add_feature ctx "use._hx_bind"
-		| _ ->
-			Type.iter chk_features e
-	in
-
-	List.iter chk_features ctx.inits;
-
-	List.iter (fun (_,_,e) -> chk_features e) ctx.statics;
 	if has_feature ctx "use._iterator" then begin
 	if has_feature ctx "use._iterator" then begin
 		add_feature ctx "use._hx_bind";
 		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";
 		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";