Commit 6d7ec9cf authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Added interp_equal implementation.

parent eb88228b
...@@ -253,10 +253,38 @@ static HRESULT interp_not(exec_ctx_t *ctx) ...@@ -253,10 +253,38 @@ static HRESULT interp_not(exec_ctx_t *ctx)
return stack_push(ctx, &v); return stack_push(ctx, &v);
} }
static HRESULT cmp_oper(exec_ctx_t *ctx)
{
variant_val_t l, r;
HRESULT hres;
hres = stack_pop_val(ctx, &r);
if(FAILED(hres))
return hres;
hres = stack_pop_val(ctx, &l);
if(SUCCEEDED(hres))
hres = VarCmp(l.v, r.v, ctx->script->lcid, 0);
release_val(&r);
release_val(&l);
return hres;
}
static HRESULT interp_equal(exec_ctx_t *ctx) static HRESULT interp_equal(exec_ctx_t *ctx)
{ {
FIXME("\n"); VARIANT v;
return E_NOTIMPL; HRESULT hres;
TRACE("\n");
hres = cmp_oper(ctx);
if(FAILED(hres))
return hres;
V_VT(&v) = VT_BOOL;
V_BOOL(&v) = hres == VARCMP_EQ ? VARIANT_TRUE : VARIANT_FALSE;
return stack_push(ctx, &v);
} }
static const instr_func_t op_funcs[] = { static const instr_func_t op_funcs[] = {
......
...@@ -25,4 +25,9 @@ call ok((true), "true is not true?") ...@@ -25,4 +25,9 @@ call ok((true), "true is not true?")
ok not false, "not false but not true?" ok not false, "not false but not true?"
ok not not true, "not not true but not true?" ok not not true, "not not true but not true?"
Call ok(true = true, "true = true is false")
Call ok(false = false, "false = false is false")
Call ok(not (true = false), "true = false is true")
Call ok("x" = "x", """x"" = ""x"" is false")
reportSuccess() reportSuccess()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment