Browse Source

consider extern fields featured only if they are actually used (fixed issue #1487)

Simon Krajewski 12 years ago
parent
commit
c8c62ae93d
2 changed files with 2 additions and 1 deletions
  1. 1 0
      common.ml
  2. 1 1
      std/js/JQuery.hx

+ 1 - 0
common.ml

@@ -555,6 +555,7 @@ let rec has_feature com f =
 				let path = List.rev pack, cl in
 				let path = List.rev pack, cl in
 				(match List.find (fun t -> t_path t = path && not (Ast.Meta.has Ast.Meta.RealPath (t_infos t).mt_meta)) com.types with
 				(match List.find (fun t -> t_path t = path && not (Ast.Meta.has Ast.Meta.RealPath (t_infos t).mt_meta)) com.types with
 				| t when meth = "*" -> (match t with TAbstractDecl a -> Ast.Meta.has Ast.Meta.ValueUsed a.a_meta | _ -> Ast.Meta.has Ast.Meta.Used (t_infos t).mt_meta)
 				| t when meth = "*" -> (match t with TAbstractDecl a -> Ast.Meta.has Ast.Meta.ValueUsed a.a_meta | _ -> Ast.Meta.has Ast.Meta.Used (t_infos t).mt_meta)
+				| TClassDecl ({cl_extern = true} as c) -> Meta.has Meta.Used (try PMap.find meth c.cl_statics with Not_found -> PMap.find meth c.cl_fields).cf_meta
 				| TClassDecl c -> PMap.exists meth c.cl_statics || PMap.exists meth c.cl_fields
 				| TClassDecl c -> PMap.exists meth c.cl_statics || PMap.exists meth c.cl_fields
 				| _ -> false)
 				| _ -> false)
 			with Not_found ->
 			with Not_found ->

+ 1 - 1
std/js/JQuery.hx

@@ -343,7 +343,7 @@ extern class JQuery implements ArrayAccess<Element> {
 
 
 	// haXe addition
 	// haXe addition
 	@:runtime inline function iterator() : Iterator<JQuery> {
 	@:runtime inline function iterator() : Iterator<JQuery> {
-		return untyped this["iterator"]();
+		return untyped __define_feature__('js.JQuery.iterator', this["iterator"])();
 	}
 	}
 
 
 	/**
 	/**