From: Francis De Brabandere <francisdb@gmail.com> When Property Get appears at global scope (outside a Class block), Windows returns error 1048 ("must be defined inside a Class"). Detect the tGET token in parser_error() — it is only valid after tPROPERTY inside a PropertyDecl, so encountering it at statement level means a Property was used outside a class context. --- dlls/vbscript/parser.y | 10 ++++++++-- dlls/vbscript/tests/run.c | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index c1a5b944268..eed2a77a50a 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -572,8 +572,14 @@ static int parser_error(unsigned *loc, parser_ctx_t *ctx, const char *str) if(ctx->error_loc == -1) ctx->error_loc = *loc; if(ctx->hres == S_OK) { - FIXME("%s: %s\n", debugstr_w(ctx->code + *loc), debugstr_a(str)); - ctx->hres = E_FAIL; + switch(ctx->last_token) { + case tGET: + ctx->hres = MAKE_VBSERROR(VBSE_MUST_BE_INSIDE_CLASS); + break; + default: + FIXME("%s: %s\n", debugstr_w(ctx->code + *loc), debugstr_a(str)); + ctx->hres = E_FAIL; + } }else { WARN("%s: %08lx\n", debugstr_w(ctx->code + *loc), ctx->hres); } diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index d3aebff098a..5ff492df940 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -2993,7 +2993,7 @@ static void test_parse_errors(void) /* Must be defined inside a Class - error 1048 */ L"Property Get x\nEnd Property\n", 0, 9, - NULL, S_OK, -1048 + NULL, S_OK, 1048 }, { /* Expected Let or Set or Get - error 1049 */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10493