jscript: Properly handle NULL pvarResult in ParseScriptText.
This commit is contained in:
parent
e22458c224
commit
755eac8f0c
|
@ -783,7 +783,8 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface,
|
||||||
clear_ei(This->ctx);
|
clear_ei(This->ctx);
|
||||||
hres = exec_source(exec_ctx, code, &code->global_code, TRUE, &r);
|
hres = exec_source(exec_ctx, code, &code->global_code, TRUE, &r);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
hres = jsval_to_variant(r, pvarResult);
|
if(pvarResult)
|
||||||
|
hres = jsval_to_variant(r, pvarResult);
|
||||||
jsval_release(r);
|
jsval_release(r);
|
||||||
}
|
}
|
||||||
exec_release(exec_ctx);
|
exec_release(exec_ctx);
|
||||||
|
|
|
@ -1945,6 +1945,13 @@ static void test_script_exprs(void)
|
||||||
hres = parse_script_expr("reportSuccess(); return true", &v);
|
hres = parse_script_expr("reportSuccess(); return true", &v);
|
||||||
ok(hres == 0x800a03fa, "parse_script_expr failed: %08x\n", hres);
|
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;
|
testing_expr = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue