Module: wine Branch: master Commit: 7bd79152a5cb27a5a4b7f49a6043cb0fcc4d11a0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7bd79152a5cb27a5a4b7f49a60...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Jan 22 13:47:13 2009 +0100
jscript: Fixed Math.round with no argument.
---
dlls/jscript/math.c | 4 ++-- dlls/jscript/tests/api.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/jscript/math.c b/dlls/jscript/math.c index 9c1a56b..4f6c049 100644 --- a/dlls/jscript/math.c +++ b/dlls/jscript/math.c @@ -381,8 +381,8 @@ static HRESULT Math_round(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS TRACE("\n");
if(!arg_cnt(dp)) { - FIXME("arg_cnt = 0\n"); - return E_NOTIMPL; + num_set_nan(retv); + return S_OK; }
hres = to_number(dispex->ctx, get_arg(dp, 0), ei, &v); diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 7fd20a6..f370098 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -519,6 +519,9 @@ ok(tmp === 1, "Math.round(true) = " + tmp); tmp = Math.round(1.1, 3, 4); ok(tmp === 1, "Math.round(1.1, 3, 4) = " + tmp);
+tmp = Math.round(); +ok(isNaN(tmp), "Math.round() is not NaN"); + tmp = Math.ceil(0.5); ok(tmp === 1, "Math.ceil(0.5) = " + tmp);