vbscript: Look for the identifier in the named item's disp only if it doesn't have the CODEONLY flag.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b664ae8e60
commit
9ee723062a
|
@ -188,7 +188,9 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ctx->func->code_ctx->named_item && ctx->func->code_ctx->named_item->disp) {
|
if(ctx->func->code_ctx->named_item && ctx->func->code_ctx->named_item->disp &&
|
||||||
|
!(ctx->func->code_ctx->named_item->flags & SCRIPTITEM_CODEONLY))
|
||||||
|
{
|
||||||
hres = disp_get_id(ctx->func->code_ctx->named_item->disp, name, invoke_type, TRUE, &id);
|
hres = disp_get_id(ctx->func->code_ctx->named_item->disp, name, invoke_type, TRUE, &id);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
ref->type = REF_DISP;
|
ref->type = REF_DISP;
|
||||||
|
|
|
@ -2038,6 +2038,13 @@ static void test_named_items(void)
|
||||||
CHECK_CALLED(GetIDsOfNames_visible);
|
CHECK_CALLED(GetIDsOfNames_visible);
|
||||||
CHECK_CALLED(OnLeaveScript);
|
CHECK_CALLED(OnLeaveScript);
|
||||||
|
|
||||||
|
SET_EXPECT(OnEnterScript);
|
||||||
|
SET_EXPECT(OnLeaveScript);
|
||||||
|
hres = IActiveScriptParse_ParseScriptText(parse, L"dim abc\ntestVar_global = 5\n", L"visibleCodeItem", NULL, NULL, 0, 0, 0, NULL, NULL);
|
||||||
|
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
|
||||||
|
CHECK_CALLED(OnEnterScript);
|
||||||
|
CHECK_CALLED(OnLeaveScript);
|
||||||
|
|
||||||
SET_EXPECT(OnEnterScript);
|
SET_EXPECT(OnEnterScript);
|
||||||
SET_EXPECT(OnLeaveScript);
|
SET_EXPECT(OnLeaveScript);
|
||||||
hres = IActiveScriptParse_ParseScriptText(parse, L"set global_me = me\n", L"globalItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL);
|
hres = IActiveScriptParse_ParseScriptText(parse, L"set global_me = me\n", L"globalItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL);
|
||||||
|
|
Loading…
Reference in New Issue