vbscript: Clear SCRIPTITEM_CODEONLY flag on script re-initialization.

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:
Gabriel Ivăncescu 2020-03-30 15:53:39 +03:00 committed by Alexandre Julliard
parent b2bd01dfbc
commit b9ff472e70
2 changed files with 4 additions and 4 deletions

View File

@ -2253,7 +2253,7 @@ static void test_named_items(void)
CHECK_CALLED(OnStateChange_CONNECTED); CHECK_CALLED(OnStateChange_CONNECTED);
CHECK_CALLED_MULTI(OnEnterScript, 5); CHECK_CALLED_MULTI(OnEnterScript, 5);
CHECK_CALLED_MULTI(OnLeaveScript, 5); CHECK_CALLED_MULTI(OnLeaveScript, 5);
todo_wine CHECK_CALLED(GetIDsOfNames_persistent); CHECK_CALLED(GetIDsOfNames_persistent);
test_state(script, SCRIPTSTATE_CONNECTED); test_state(script, SCRIPTSTATE_CONNECTED);
script_disp2 = get_script_dispatch(script, L"persistent"); script_disp2 = get_script_dispatch(script, L"persistent");
@ -2273,7 +2273,6 @@ static void test_named_items(void)
SET_EXPECT(OnLeaveScript); SET_EXPECT(OnLeaveScript);
hres = IActiveScriptParse_ParseScriptText(parse, L"me", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); hres = IActiveScriptParse_ParseScriptText(parse, L"me", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
todo_wine
ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == &persistent_named_item, ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == &persistent_named_item,
"Unexpected 'me': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var)); "Unexpected 'me': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var));
VariantClear(&var); VariantClear(&var);
@ -2288,7 +2287,6 @@ static void test_named_items(void)
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript); CHECK_CALLED(OnLeaveScript);
todo_wine
CHECK_CALLED(GetIDsOfNames_persistent); CHECK_CALLED(GetIDsOfNames_persistent);
SET_EXPECT(OnEnterScript); SET_EXPECT(OnEnterScript);
@ -2299,7 +2297,6 @@ static void test_named_items(void)
ok(FAILED(hres), "ParseScriptText returned: %08x\n", hres); ok(FAILED(hres), "ParseScriptText returned: %08x\n", hres);
CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript); CHECK_CALLED(OnLeaveScript);
todo_wine
CHECK_CALLED(GetIDsOfNames_persistent); CHECK_CALLED(GetIDsOfNames_persistent);
CHECK_CALLED(OnScriptError); CHECK_CALLED(OnScriptError);

View File

@ -579,6 +579,9 @@ static HRESULT WINAPI VBScript_SetScriptSite(IActiveScript *iface, IActiveScript
hres = retrieve_named_item_disp(pass, item); hres = retrieve_named_item_disp(pass, item);
if(FAILED(hres)) return hres; if(FAILED(hres)) return hres;
} }
/* For some reason, CODEONLY flag is lost in re-initialized scripts */
item->flags &= ~SCRIPTITEM_CODEONLY;
} }
hres = create_script_disp(This->ctx, &This->ctx->script_obj); hres = create_script_disp(This->ctx, &This->ctx->script_obj);