[PATCH] vbscript: support for class default sub.

Robert Wilhelm robert.wilhelm at gmx.net
Fri Oct 9 11:45:36 CDT 2020


Hi Jacek,

thanks for your suggestions.
I will try using an is_default flag, this should result in cleaner
code.

It is not allowed to have default getter and function and sub in one
class.
With native vbscript.dll I get:
"Microsoft VBScript compilation error: Cannot have multiple default
property/method in a Class"
Therefore it should be save to use index 0 for default getter or
function/sub.
Currently we assert and crash when defining two default getters. I will
add an FIXME.

Best regards,
Robert

On Thu, 2020-10-08 at 15:56 +0200, Jacek Caban wrote:
> Hi Robert,
>
> On 06.10.2020 23:14, Robert Wilhelm wrote:
> > diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h
> > index 869fb05b6ed..1f4132b1898 100644
> > --- a/dlls/vbscript/vbscript.h
> > +++ b/dlls/vbscript/vbscript.h
> > @@ -314,7 +314,9 @@ typedef enum {
> >       FUNC_PROPGET,
> >       FUNC_PROPLET,
> >       FUNC_PROPSET,
> > -    FUNC_DEFGET
> > +    FUNC_DEFGET,
> > +    FUNC_DEFFUNC,
> > +    FUNC_DEFSUB
> >   } function_type_t;
>
> With your patch, 'default' is no longer a separated function type
> but
> rather a function flag. I'd expect that if you express that in data
> types, the implementation will be more straightforward. I'd suggest
> to
> get rid of FUNC_DEFGET and store the information about 'default' in
> function_decl_t (something like a new is_default flag or change
> is_public to (public,private,default) enum; I'm not sure without
> trying).
>
>
> Is it possible to have both default getter and sub/function in the
> same
> class? Some tests around that would be interesting.
>
>
> Thanks,
>
> Jacek
>




More information about the wine-devel mailing list