vbscript: Lookup this object in lookup_identifier only if it's an actual VBScript object.

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-05 14:08:47 +01:00 committed by Alexandre Julliard
parent 509044296d
commit 3c366be353
2 changed files with 13 additions and 7 deletions

View File

@ -139,16 +139,16 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
return S_OK;
}
}
}
hres = disp_get_id(ctx->this_obj, name, invoke_type, TRUE, &id);
hres = vbdisp_get_id(ctx->vbthis, name, invoke_type, TRUE, &id);
if(SUCCEEDED(hres)) {
ref->type = REF_DISP;
ref->u.d.disp = ctx->this_obj;
ref->u.d.disp = (IDispatch*)&ctx->vbthis->IDispatchEx_iface;
ref->u.d.id = id;
return S_OK;
}
}
}
if(ctx->func->code_ctx->context) {
hres = disp_get_id(ctx->func->code_ctx->context, name, invoke_type, TRUE, &id);

View File

@ -3025,6 +3025,12 @@ static void run_tests(void)
parse_script_a("testOptionalArg 1,,2");
CHECK_CALLED(global_testoptionalarg_i);
parse_script_a("sub x()\n"
" dim y\n"
" y = cint(3)\n"
"end sub\n"
"x\n");
strict_dispid_check = FALSE;
SET_EXPECT(testobj_value_i);