Skip to content

Commit

Permalink
Merge pull request #2452 from nadako/2451_js_typeparam_dynamic_iterator
Browse files Browse the repository at this point in the history
[js] use dynamic $iterator for type parameter classes (closes #2451)
  • Loading branch information
ncannasse committed Dec 10, 2013
2 parents db86fc3 + f6d382e commit 186555b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion genjs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 186555b

Please sign in to comment.