Browse Source

[js] consider @:selfCall when generating bound method values (closes #4425)

Dan Korostelev 9 years ago
parent
commit
6d73a932ca
1 changed files with 2 additions and 2 deletions
  1. 2 2
      genjs.ml

+ 2 - 2
genjs.ml

@@ -505,11 +505,11 @@ and gen_expr ctx e =
 			gen_value ctx x;
 			gen_value ctx x;
 			print ctx ",";
 			print ctx ",";
 			gen_value ctx x;
 			gen_value ctx x;
-			print ctx "%s)" (field f.cf_name)
+			print ctx "%s)" (if Meta.has Meta.SelfCall f.cf_meta then "" else (field f.cf_name))
 		| _ ->
 		| _ ->
 			print ctx "($_=";
 			print ctx "($_=";
 			gen_value ctx x;
 			gen_value ctx x;
-			print ctx ",$bind($_,$_%s))" (field f.cf_name))
+			print ctx ",$bind($_,$_%s))" (if Meta.has Meta.SelfCall f.cf_meta then "" else (field f.cf_name)))
 	| TEnumParameter (x,_,i) ->
 	| TEnumParameter (x,_,i) ->
 		gen_value ctx x;
 		gen_value ctx x;
 		print ctx "[%i]" (i + 2)
 		print ctx "[%i]" (i + 2)