Skip to content

Commit

Permalink
[js] handle @:selfCall in gen_expr TField case instead of gen_call (see
Browse files Browse the repository at this point in the history
  • Loading branch information
nadako committed Nov 21, 2014
1 parent bae7da5 commit 594630e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions genjs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,6 @@ let rec gen_call ctx e el in_value =
gen_value ctx e;
spr ctx ")";
end
| TField (eo, (FInstance(_,_,cf) | FStatic(_,cf) | FAnon(cf))), _ when Meta.has Meta.SelfCall cf.cf_meta ->
gen_value ctx eo;
spr ctx "(";
concat ctx "," (gen_value ctx) el;
spr ctx ")"
| _ ->
gen_value ctx e;
spr ctx "(";
Expand Down Expand Up @@ -523,6 +518,8 @@ and gen_expr ctx e =
print ctx "[%i]" (i + 2)
| TField ({ eexpr = TConst (TInt _ | TFloat _) } as x,f) ->
gen_expr ctx { e with eexpr = TField(mk (TParenthesis x) x.etype x.epos,f) }
| TField (x, (FInstance(_,_,f) | FStatic(_,f) | FAnon(f))) when Meta.has Meta.SelfCall f.cf_meta ->
gen_value ctx x;
| TField (x,f) ->
gen_value ctx x;
let name = field_name f in
Expand Down

0 comments on commit 594630e

Please sign in to comment.