From 594630e62dfc70ec3414ecd701ecd91084d20b57 Mon Sep 17 00:00:00 2001 From: Dan Korostelev Date: Fri, 21 Nov 2014 22:03:04 +0300 Subject: [PATCH] [js] handle @:selfCall in gen_expr TField case instead of gen_call (see https://github.com/HaxeFoundation/haxe/issues/3441#issuecomment-64015831) --- genjs.ml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/genjs.ml b/genjs.ml index 0ec088e836e..76bee313d11 100644 --- a/genjs.ml +++ b/genjs.ml @@ -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 "("; @@ -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