Browse Source

Merge pull request #2452 from nadako/2451_js_typeparam_dynamic_iterator

[js] use dynamic $iterator for type parameter classes (closes #2451)
Nicolas Cannasse 11 years ago
parent
commit
186555bcea
1 changed files with 9 additions and 1 deletions
  1. 9 1
      genjs.ml

+ 9 - 1
genjs.ml

@@ -329,7 +329,15 @@ let this ctx = match ctx.in_value with None -> "this" | Some _ -> "$this"
 
 let is_dynamic_iterator ctx e =
 	let check x =
-		has_feature ctx "HxOverrides.iter" && (match follow x.etype with TInst ({ cl_path = [],"Array" },_) | TAnon _ | TDynamic _ | TMono _ -> true | _ -> false)
+		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