Browse Source

[js] use dynamic $iterator for type parameter classes (closes #2451)

Dan Korostelev 11 năm trước cách đây
mục cha
commit
f6d382e09c
1 tập tin đã thay đổi với 9 bổ sung1 xóa
  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