vbscript: Support property set with parameters.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=33996
Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Robert Wilhelm 2020-11-21 10:27:32 +01:00 committed by Alexandre Julliard
parent 1b05351975
commit c39cd37383
3 changed files with 20 additions and 9 deletions

View file

@ -988,12 +988,7 @@ static HRESULT interp_set_member(exec_ctx_t *ctx)
TRACE("%s\n", debugstr_w(identifier));
if(arg_cnt) {
FIXME("arguments not supported\n");
return E_NOTIMPL;
}
hres = stack_assume_disp(ctx, 1, &obj);
hres = stack_assume_disp(ctx, arg_cnt+1, &obj);
if(FAILED(hres))
return hres;
@ -1002,7 +997,7 @@ static HRESULT interp_set_member(exec_ctx_t *ctx)
return E_FAIL;
}
hres = stack_assume_disp(ctx, 0, NULL);
hres = stack_assume_disp(ctx, arg_cnt, NULL);
if(FAILED(hres))
return hres;
@ -1014,7 +1009,7 @@ static HRESULT interp_set_member(exec_ctx_t *ctx)
if(FAILED(hres))
return hres;
stack_popn(ctx, 2);
stack_popn(ctx, arg_cnt+2);
return S_OK;
}

View file

@ -456,7 +456,7 @@ PropertyDecl
{ $$ = new_function_decl(ctx, $4, FUNC_PROPGET, $1, $5, $7); CHECK_ERROR; }
| Storage_opt tPROPERTY tLET Identifier '(' ArgumentDeclList ')' StSep BodyStatements tEND tPROPERTY
{ $$ = new_function_decl(ctx, $4, FUNC_PROPLET, $1, $6, $9); CHECK_ERROR; }
| Storage_opt tPROPERTY tSET Identifier '(' ArgumentDecl ')' StSep BodyStatements tEND tPROPERTY
| Storage_opt tPROPERTY tSET Identifier '(' ArgumentDeclList ')' StSep BodyStatements tEND tPROPERTY
{ $$ = new_function_decl(ctx, $4, FUNC_PROPSET, $1, $6, $9); CHECK_ERROR; }
FunctionDecl

View file

@ -1772,6 +1772,17 @@ end class
Class TestPropParam
Public oDict
Public gotNothing
Public m_obj
Public Property Set bar(obj)
Set m_obj = obj
End Property
Public Property Set foo(par,obj)
Set m_obj = obj
if obj is Nothing Then gotNothing = True
oDict = par
End Property
Public Property Let Key(oldKey,newKey)
oDict = oldKey & newKey
End Property
@ -1790,6 +1801,11 @@ x.three(1,2) = 3
call ok(x.oDict = "123","x.oDict = " & x.oDict & " expected 123")
x.ten(1,2,3,4,5,6,7,8,9) = 0
call ok(x.oDict = "1234567890","x.oDict = " & x.oDict & " expected 1234567890")
Set x.bar = Nothing
call ok(x.gotNothing=Empty,"x.gotNothing = " & x.gotNothing & " expected Empty")
Set x.foo("123") = Nothing
call ok(x.oDict = "123","x.oDict = " & x.oDict & " expected 123")
call ok(x.gotNothing=True,"x.gotNothing = " & x.gotNothing & " expected true")
set x = new TestPropSyntax
set x.prop = new TestPropSyntax