vbscript: Added interp_add implementation.

This commit is contained in:
Jacek Caban 2011-09-12 12:32:07 +02:00 committed by Alexandre Julliard
parent 0ec9339533
commit 03c8284843
2 changed files with 25 additions and 2 deletions

View File

@ -393,8 +393,26 @@ static HRESULT interp_concat(exec_ctx_t *ctx)
static HRESULT interp_add(exec_ctx_t *ctx)
{
FIXME("\n");
return E_NOTIMPL;
variant_val_t r, l;
VARIANT v;
HRESULT hres;
TRACE("\n");
hres = stack_pop_val(ctx, &r);
if(FAILED(hres))
return hres;
hres = stack_pop_val(ctx, &l);
if(SUCCEEDED(hres)) {
hres = VarAdd(l.v, r.v, &v);
release_val(&l);
}
release_val(&r);
if(FAILED(hres))
return hres;
return stack_push(ctx, &v);
}
static HRESULT interp_sub(exec_ctx_t *ctx)

View File

@ -70,4 +70,9 @@ Call ok(1 & 100000 = "1100000", "1 & 100000 = " & (1 & 100000))
' Call ok(true & false = "TrueFalse", "true & false = " & (true & false))
'end if
Call ok(2+2 = 4, "2+2 = " & (2+2))
Call ok(false + 6 + true = 5, "false + 6 + true <> 5")
Call ok(getVT(2+null) = "VT_NULL", "getVT(2+null) = " & getVT(2+null))
Call ok(2+empty = 2, "2+empty = " & (2+empty))
reportSuccess()