mirror of
https://github.com/reactos/wine.git
synced 2024-11-24 20:30:01 +00:00
jscript: Set output to undefined in jsval_copy on failure.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9fc2863ebd
commit
e641469f9f
@ -491,10 +491,8 @@ static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val, IServi
|
||||
TRACE("%s = %s\n", debugstr_w(prop->name), debugstr_jsval(val));
|
||||
|
||||
hres = jsval_copy(val, &prop->u.val);
|
||||
if(FAILED(hres)) {
|
||||
prop->u.val = jsval_undefined();
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
}
|
||||
|
||||
if(This->builtin_info->on_put)
|
||||
This->builtin_info->on_put(This, prop->name);
|
||||
|
@ -212,13 +212,17 @@ static HRESULT jsval_variant(jsval_t *val, VARIANT *var)
|
||||
|
||||
__JSVAL_TYPE(*val) = JSV_VARIANT;
|
||||
__JSVAL_VAR(*val) = v = heap_alloc(sizeof(VARIANT));
|
||||
if(!v)
|
||||
if(!v) {
|
||||
*val = jsval_undefined();
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
V_VT(v) = VT_EMPTY;
|
||||
hres = VariantCopy(v, var);
|
||||
if(FAILED(hres))
|
||||
if(FAILED(hres)) {
|
||||
*val = jsval_undefined();
|
||||
heap_free(v);
|
||||
}
|
||||
return hres;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user