Browse Source

[cpp] Add STACK_THIS to constructor (thanks zobo)

Hugh 11 years ago
parent
commit
89c6e4aede
1 changed files with 2 additions and 1 deletions
  1. 2 1
      gencpp.ml

+ 2 - 1
gencpp.ml

@@ -3031,7 +3031,8 @@ let generate_class_files common_ctx member_types super_deps constructor_deps cla
                   if has_meta_key definition.cf_meta Meta.NoDebug then ctx.ctx_debug_level <- 0;
                   if ctx.ctx_debug_level >0 then begin
                      hx_stack_push ctx output_cpp dot_name "new" function_def.tf_expr.epos;
-                     List.iter (fun (a,(t,o)) -> output_cpp ("\nHX_STACK_ARG(" ^ (keyword_remap o) ^ ",\"" ^ a ^"\")\n") ) constructor_arg_var_list;
+                     output_cpp "HX_STACK_THIS(this)\n";
+                     List.iter (fun (a,(t,o)) -> output_cpp ("HX_STACK_ARG(" ^ (keyword_remap o) ^ ",\"" ^ a ^"\")\n") ) constructor_arg_var_list;
                   end;
 
                   if (has_default_values function_def.tf_args) then begin