From b9ff472e702d4625d7c20e6db1f4511389b8cdcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Mon, 30 Mar 2020 15:53:39 +0300 Subject: [PATCH] vbscript: Clear SCRIPTITEM_CODEONLY flag on script re-initialization. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/vbscript/tests/vbscript.c | 5 +---- dlls/vbscript/vbscript.c | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/vbscript/tests/vbscript.c b/dlls/vbscript/tests/vbscript.c index ccf70ad2516..04e7545da2d 100644 --- a/dlls/vbscript/tests/vbscript.c +++ b/dlls/vbscript/tests/vbscript.c @@ -2253,7 +2253,7 @@ static void test_named_items(void) CHECK_CALLED(OnStateChange_CONNECTED); CHECK_CALLED_MULTI(OnEnterScript, 5); CHECK_CALLED_MULTI(OnLeaveScript, 5); - todo_wine CHECK_CALLED(GetIDsOfNames_persistent); + CHECK_CALLED(GetIDsOfNames_persistent); test_state(script, SCRIPTSTATE_CONNECTED); script_disp2 = get_script_dispatch(script, L"persistent"); @@ -2273,7 +2273,6 @@ static void test_named_items(void) SET_EXPECT(OnLeaveScript); 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); - todo_wine 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)); VariantClear(&var); @@ -2288,7 +2287,6 @@ static void test_named_items(void) ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); - todo_wine CHECK_CALLED(GetIDsOfNames_persistent); SET_EXPECT(OnEnterScript); @@ -2299,7 +2297,6 @@ static void test_named_items(void) ok(FAILED(hres), "ParseScriptText returned: %08x\n", hres); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); - todo_wine CHECK_CALLED(GetIDsOfNames_persistent); CHECK_CALLED(OnScriptError); diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c index 858cacb7c34..f31bdf2d351 100644 --- a/dlls/vbscript/vbscript.c +++ b/dlls/vbscript/vbscript.c @@ -579,6 +579,9 @@ static HRESULT WINAPI VBScript_SetScriptSite(IActiveScript *iface, IActiveScript hres = retrieve_named_item_disp(pass, item); 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);