mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 08:33:37 +00:00
jscript: Don't allow starting script using state from uninitialized.
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
3eaac7211f
commit
079b14b2e9
|
@ -824,7 +824,7 @@ static HRESULT WINAPI JScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE s
|
|||
switch(ss) {
|
||||
case SCRIPTSTATE_STARTED:
|
||||
case SCRIPTSTATE_CONNECTED: /* FIXME */
|
||||
if(This->ctx->state == SCRIPTSTATE_CLOSED)
|
||||
if(This->ctx->state == SCRIPTSTATE_UNINITIALIZED || This->ctx->state == SCRIPTSTATE_CLOSED)
|
||||
return E_UNEXPECTED;
|
||||
|
||||
exec_queued_code(This);
|
||||
|
|
|
@ -863,6 +863,12 @@ static void test_jscript_uninitializing(void)
|
|||
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
|
||||
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hres);
|
||||
|
||||
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_STARTED);
|
||||
ok(hres == E_UNEXPECTED, "SetScriptState(SCRIPTSTATE_STARTED) returned: %08lx\n", hres);
|
||||
|
||||
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
|
||||
ok(hres == E_UNEXPECTED, "SetScriptState(SCRIPTSTATE_CONNECTED) returned: %08lx\n", hres);
|
||||
|
||||
SET_EXPECT(GetLCID);
|
||||
SET_EXPECT(OnStateChange_INITIALIZED);
|
||||
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
|
||||
|
|
Loading…
Reference in a new issue