jscript: Inline add_eval implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ea9b507380
commit
0841b60b8d
|
@ -1734,21 +1734,27 @@ static HRESULT interp_in(script_ctx_t *ctx)
|
|||
}
|
||||
|
||||
/* ECMA-262 3rd Edition 11.6.1 */
|
||||
static HRESULT add_eval(script_ctx_t *ctx, jsval_t lval, jsval_t rval, jsval_t *ret)
|
||||
static HRESULT interp_add(script_ctx_t *ctx)
|
||||
{
|
||||
jsval_t r, l;
|
||||
jsval_t l, r, lval, rval, ret;
|
||||
HRESULT hres;
|
||||
|
||||
rval = stack_pop(ctx);
|
||||
lval = stack_pop(ctx);
|
||||
|
||||
TRACE("%s + %s\n", debugstr_jsval(lval), debugstr_jsval(rval));
|
||||
|
||||
hres = to_primitive(ctx, lval, &l, NO_HINT);
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = to_primitive(ctx, rval, &r, NO_HINT);
|
||||
if(FAILED(hres))
|
||||
jsval_release(l);
|
||||
}
|
||||
jsval_release(lval);
|
||||
jsval_release(rval);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = to_primitive(ctx, rval, &r, NO_HINT);
|
||||
if(FAILED(hres)) {
|
||||
jsval_release(l);
|
||||
return hres;
|
||||
}
|
||||
|
||||
if(is_string(l) || is_string(r)) {
|
||||
jsstr_t *lstr, *rstr = NULL;
|
||||
|
||||
|
@ -1761,7 +1767,7 @@ static HRESULT add_eval(script_ctx_t *ctx, jsval_t lval, jsval_t rval, jsval_t *
|
|||
|
||||
ret_str = jsstr_concat(lstr, rstr);
|
||||
if(ret_str)
|
||||
*ret = jsval_string(ret_str);
|
||||
ret = jsval_string(ret_str);
|
||||
else
|
||||
hres = E_OUTOFMEMORY;
|
||||
}
|
||||
|
@ -1776,29 +1782,12 @@ static HRESULT add_eval(script_ctx_t *ctx, jsval_t lval, jsval_t rval, jsval_t *
|
|||
if(SUCCEEDED(hres)) {
|
||||
hres = to_number(ctx, r, &nr);
|
||||
if(SUCCEEDED(hres))
|
||||
*ret = jsval_number(nl+nr);
|
||||
ret = jsval_number(nl+nr);
|
||||
}
|
||||
}
|
||||
|
||||
jsval_release(r);
|
||||
jsval_release(l);
|
||||
return hres;
|
||||
}
|
||||
|
||||
/* ECMA-262 3rd Edition 11.6.1 */
|
||||
static HRESULT interp_add(script_ctx_t *ctx)
|
||||
{
|
||||
jsval_t l, r, ret;
|
||||
HRESULT hres;
|
||||
|
||||
r = stack_pop(ctx);
|
||||
l = stack_pop(ctx);
|
||||
|
||||
TRACE("%s + %s\n", debugstr_jsval(l), debugstr_jsval(r));
|
||||
|
||||
hres = add_eval(ctx, l, r, &ret);
|
||||
jsval_release(l);
|
||||
jsval_release(r);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
|
|
Loading…
Reference in New Issue