Module: wine Branch: master Commit: ef737598e6b029a1af6c61e4cf8905c48ff63d23 URL: https://source.winehq.org/git/wine.git/?a=commit;h=ef737598e6b029a1af6c61e4c...
Author: Jacek Caban jacek@codeweavers.com Date: Fri Nov 1 17:55:31 2019 +0100
vbscript: Support using function return value in expressions.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/vbscript/interp.c | 5 ++--- dlls/vbscript/tests/lang.vbs | 9 +++++++++ 2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 8568b7098c..7339f42aba 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -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; diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 5d8e02a7ab..4623a08e2b 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -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()