jscript: Added Math.abs with no arg implementation.
This commit is contained in:
parent
2e075e9862
commit
142cffc249
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue