vbscript: Support using function return value in expressions.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-11-01 17:55:31 +01:00 committed by Alexandre Julliard
parent 39e79c76c9
commit ef737598e6
2 changed files with 11 additions and 3 deletions

View File

@ -104,9 +104,8 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
DISPID id;
HRESULT hres;
if(invoke_type == VBDISP_LET
&& (ctx->func->type == FUNC_FUNCTION || ctx->func->type == FUNC_PROPGET || ctx->func->type == FUNC_DEFGET)
&& !wcsicmp(name, ctx->func->name)) {
if((ctx->func->type == FUNC_FUNCTION || ctx->func->type == FUNC_PROPGET || ctx->func->type == FUNC_DEFGET)
&& !wcsicmp(name, ctx->func->name)) {
ref->type = REF_VAR;
ref->u.v = &ctx->ret_val;
return S_OK;

View File

@ -1621,4 +1621,13 @@ with new TestPropSyntax
ok .prop = 1, ".prop = "&.prop
end with
function testsetresult(x, y)
set testsetresult = new TestPropSyntax
testsetresult.prop = x
y = testsetresult.prop + 1
end function
set x = testsetresult(1, 2)
ok x.prop = 1, "x.prop = " & x.prop
reportSuccess()