jscript: Added plus expression implementation.

This commit is contained in:
Jacek Caban 2008-09-17 23:33:15 +02:00 committed by Alexandre Julliard
parent 20bc98d5d8
commit 7c6b6c8ca8
2 changed files with 27 additions and 3 deletions

View File

@ -1871,10 +1871,32 @@ HRESULT minus_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags,
return S_OK;
}
HRESULT plus_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret)
/* ECMA-262 3rd Edition 11.4.6 */
HRESULT plus_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret)
{
FIXME("\n");
return E_NOTIMPL;
unary_expression_t *expr = (unary_expression_t*)_expr;
exprval_t exprval;
VARIANT val, num;
HRESULT hres;
TRACE("\n");
hres = expr_eval(ctx, expr->expression, EXPR_NEWREF, ei, &exprval);
if(FAILED(hres))
return hres;
hres = exprval_to_value(ctx->parser->script, &exprval, ei, &val);
exprval_release(&exprval);
if(FAILED(hres))
return hres;
hres = to_number(ctx->parser->script, &val, ei, &num);
if(FAILED(hres))
return hres;
ret->type = EXPRVAL_VARIANT;
ret->u.var = num;
return S_OK;
}
/* ECMA-262 3rd Edition 11.3.1 */

View File

@ -307,6 +307,8 @@ ok(getVT(tmp) === "VT_I4", "getVT(~1) = " + getVT(tmp));
ok((3,4) === 4, "(3,4) !== 4");
ok(+3 === 3, "+3 !== 3");
ok(1 < 3.4, "1 < 3.4 failed");
ok(!(3.4 < 1), "3.4 < 1");
ok("abc" < "abcd", "abc < abcd failed");