Branch: Tag:

2020-05-05

2020-05-05 08:13:46 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Pike.ProxyFactory: Support create() without arguments.

Without arguments it simply makes an object of the corresponding
base class (without arguments) and uses that as the object to proxy.

1612:    struct object *o;    struct program *p;    struct program *expected; -  if (args != 1) { +  if (!args) { +  apply_svalue(&Pike_fp->context->prog->constants[1].sval, 0); +  } else if (args != 1) {    wrong_number_of_args_error("create", args, 1);    }    if (TYPEOF(Pike_sp[-1]) != PIKE_T_OBJECT) {
2035:    push_type(T_VOID);    push_type(T_VOID);    push_type(T_MANY); +  push_type(T_VOID);    push_object_type(0, p->id); -  +  push_type(T_OR);    push_type(T_FUNCTION);    fun_type = pop_unfinished_type();    ptr.c_fun = f_proxy_create;