jscript: Properly handle NULL pvarResult in ParseScriptText.

This commit is contained in:
Jacek Caban 2014-06-09 14:02:35 +02:00 committed by Alexandre Julliard
parent e22458c224
commit 755eac8f0c
2 changed files with 9 additions and 1 deletions

View File

@ -783,7 +783,8 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface,
clear_ei(This->ctx);
hres = exec_source(exec_ctx, code, &code->global_code, TRUE, &r);
if(SUCCEEDED(hres)) {
hres = jsval_to_variant(r, pvarResult);
if(pvarResult)
hres = jsval_to_variant(r, pvarResult);
jsval_release(r);
}
exec_release(exec_ctx);

View File

@ -1945,6 +1945,13 @@ static void test_script_exprs(void)
hres = parse_script_expr("reportSuccess(); return true", &v);
ok(hres == 0x800a03fa, "parse_script_expr failed: %08x\n", hres);
SET_EXPECT(global_success_d);
SET_EXPECT(global_success_i);
hres = parse_script_expr("reportSuccess(); true", NULL);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
CHECK_CALLED(global_success_d);
CHECK_CALLED(global_success_i);
testing_expr = FALSE;
}