Commit 142cffc2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Added Math.abs with no arg implementation.

parent 2e075e98
......@@ -121,8 +121,9 @@ static HRESULT Math_abs(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *d
TRACE("\n");
if(!arg_cnt(dp)) {
FIXME("arg_cnt = 0\n");
return E_NOTIMPL;
if(retv)
num_set_nan(retv);
return S_OK;
}
hres = to_number(dispex->ctx, get_arg(dp, 0), ei, &v);
......
......@@ -431,6 +431,15 @@ ok(tmp === 3, "Math.abs(-3) = " + tmp);
tmp = Math.abs(true);
ok(tmp === 1, "Math.abs(true) = " + tmp);
tmp = Math.abs();
ok(isNaN(tmp), "Math.abs() is not NaN");
tmp = Math.abs(NaN);
ok(isNaN(tmp), "Math.abs() is not NaN");
tmp = Math.abs(-Infinity);
ok(tmp === Infinity, "Math.abs(-Infinite) = " + tmp);
tmp = Math.abs(-3, 2);
ok(tmp === 3, "Math.abs(-3, 2) = " + tmp);
......
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