jscript: Added implementation of Math_pow with less then 2 arguments.

oldstable
Piotr Caban 2009-05-27 18:44:00 +02:00 committed by Alexandre Julliard
parent 3327d17109
commit f77489acd5
2 changed files with 8 additions and 2 deletions

View File

@ -441,8 +441,8 @@ static HRESULT Math_pow(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *d
TRACE("\n");
if(arg_cnt(dp) < 2) {
FIXME("unimplemented arg_cnt %d\n", arg_cnt(dp));
return E_NOTIMPL;
if(retv) num_set_nan(retv);
return S_OK;
}
hres = to_number(dispex->ctx, get_arg(dp, 0), ei, &x);

View File

@ -618,6 +618,12 @@ ok(tmp === 2, "Math.pow(2, 2) = " + tmp);
tmp = Math.pow(2, 2, 3);
ok(tmp === 4, "Math.pow(2, 2, 3) = " + tmp);
tmp = Math.pow(2);
ok(isNaN(tmp), "Math.pow(2) is not NaN");
tmp = Math.pow();
ok(isNaN(tmp), "Math.pow() is not NaN");
tmp = Math.random();
ok(typeof(tmp) == "number", "typeof(tmp) = " + typeof(tmp));
ok(0 <= tmp && tmp <= 1, "Math.random() = " + tmp);