scrobj: Run scripts when creating a scriptlet instance.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-09-23 17:55:40 +02:00 committed by Alexandre Julliard
parent e50eae9dc8
commit 9d92ea3b5a
2 changed files with 8 additions and 11 deletions

View File

@ -1032,8 +1032,16 @@ static HRESULT create_scriptlet_instance(struct scriptlet_factory *factory, IDis
hres = create_script_host(factory_host->language, factory_host->active_script, &obj->hosts, &host);
if (FAILED(hres)) break;
host->object = obj;
hres = IActiveScript_AddNamedItem(host->active_script, L"scriptlet",
SCRIPTITEM_ISVISIBLE | SCRIPTITEM_GLOBALMEMBERS);
if (FAILED(hres)) break;
hres = IActiveScript_AddNamedItem(host->active_script, L"globals", SCRIPTITEM_ISVISIBLE);
if (FAILED(hres)) break;
}
if (SUCCEEDED(hres)) hres = parse_scripts(factory, &obj->hosts, TRUE);
if (FAILED(hres))
{
IDispatchEx_Release(&obj->IDispatchEx_iface);

View File

@ -783,9 +783,7 @@ static void test_create_object(void)
CHECK_CALLED(QI_IActiveScriptParse);
CHECK_CALLED(InitNew);
CHECK_CALLED(SetScriptSite);
todo_wine
CHECK_CALLED(AddNamedItem_scriptlet);
todo_wine
CHECK_CALLED(AddNamedItem_globals);
todo_wine
CHECK_CALLED(GetScriptDispatch);
@ -793,9 +791,7 @@ static void test_create_object(void)
CHECK_CALLED(GetDispID_vbAddOne);
todo_wine
CHECK_CALLED(GetDispID_wtTest);
todo_wine
CHECK_CALLED(SetScriptState_STARTED);
todo_wine
CHECK_CALLED(ParseScriptText);
hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&disp);
@ -945,9 +941,7 @@ static void test_create_object(void)
CHECK_CALLED(QI_IActiveScriptParse);
CHECK_CALLED(InitNew);
CHECK_CALLED(SetScriptSite);
todo_wine
CHECK_CALLED(AddNamedItem_scriptlet);
todo_wine
CHECK_CALLED(AddNamedItem_globals);
todo_wine
CHECK_CALLED(GetScriptDispatch);
@ -955,9 +949,7 @@ static void test_create_object(void)
CHECK_CALLED(GetDispID_vbAddOne);
todo_wine
CHECK_CALLED(GetDispID_wtTest);
todo_wine
CHECK_CALLED(SetScriptState_STARTED);
todo_wine
CHECK_CALLED(ParseScriptText);
SET_EXPECT(SetScriptState_UNINITIALIZED);
@ -981,9 +973,7 @@ static void test_create_object(void)
CHECK_CALLED(Clone);
CHECK_CALLED(QI_IActiveScriptParse);
CHECK_CALLED(SetScriptSite);
todo_wine
CHECK_CALLED(AddNamedItem_scriptlet);
todo_wine
CHECK_CALLED(AddNamedItem_globals);
todo_wine
CHECK_CALLED(GetScriptDispatch);
@ -991,7 +981,6 @@ static void test_create_object(void)
CHECK_CALLED(GetDispID_vbAddOne);
todo_wine
CHECK_CALLED(GetDispID_wtTest);
todo_wine
CHECK_CALLED(SetScriptState_STARTED);
SET_EXPECT(SetScriptState_UNINITIALIZED);