From 429bac4c8657e342c13299495d2265bf7302617b Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 14 Sep 2011 13:00:23 +0200 Subject: [PATCH] vbscript: Added interp_imp implementation. --- dlls/vbscript/interp.c | 22 ++++++++++++++++++++-- dlls/vbscript/tests/lang.vbs | 5 +++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 1c019338b8f..2a50667a4fa 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -662,8 +662,26 @@ static HRESULT interp_eqv(exec_ctx_t *ctx) static HRESULT interp_imp(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 = VarImp(l.v, r.v, &v); + release_val(&l); + } + release_val(&r); + if(FAILED(hres)) + return hres; + + return stack_push(ctx, &v); } static HRESULT cmp_oper(exec_ctx_t *ctx) diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 0b24b2d7ad2..b9b5c575095 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -106,6 +106,11 @@ call ok(false eqv false, "false does not equal false?") call ok(not (false eqv true), "false equals true?") call ok(getVT(false eqv null) = "VT_NULL", "getVT(false eqv null) = " & getVT(false eqv null)) +call ok(true imp true, "true does not imp true?") +call ok(false imp false, "false does not imp false?") +call ok(not (true imp false), "true imp false?") +call ok(false imp null, "false imp null is false?") + x = 3 Call ok(2+2 = 4, "2+2 = " & (2+2)) Call ok(false + 6 + true = 5, "false + 6 + true <> 5")