vbscript: Added interp_equal implementation.
This commit is contained in:
parent
eb88228b62
commit
6d7ec9cf71
|
@ -253,10 +253,38 @@ static HRESULT interp_not(exec_ctx_t *ctx)
|
|||
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)
|
||||
{
|
||||
FIXME("\n");
|
||||
return E_NOTIMPL;
|
||||
VARIANT v;
|
||||
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[] = {
|
||||
|
|
|
@ -25,4 +25,9 @@ call ok((true), "true is not true?")
|
|||
ok not false, "not false 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()
|
||||
|
|
Loading…
Reference in New Issue