From 06050f86d57aa1524bd80162d35af6e48144e9b8 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 11 Dec 2008 12:28:30 +0100 Subject: [PATCH] jscript: Added Math.LOG10E implementation. --- dlls/jscript/math.c | 7 ++++--- dlls/jscript/tests/api.js | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/jscript/math.c b/dlls/jscript/math.c index 93e1ee4596c..f2a3d0c3718 100644 --- a/dlls/jscript/math.c +++ b/dlls/jscript/math.c @@ -29,7 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript); static const WCHAR EW[] = {'E',0}; static const WCHAR LOG2EW[] = {'L','O','G','2','E',0}; -static const WCHAR LOG10EW[] = {'L','O','G','1','0',0}; +static const WCHAR LOG10EW[] = {'L','O','G','1','0','E',0}; static const WCHAR LN2W[] = {'L','N','2',0}; static const WCHAR LN10W[] = {'L','N','1','0',0}; static const WCHAR PIW[] = {'P','I',0}; @@ -85,11 +85,12 @@ static HRESULT Math_LOG2E(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS return math_constant(M_LOG2E, flags, retv); } +/* ECMA-262 3rd Edition 15.8.1.4 */ static HRESULT Math_LOG10E(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return math_constant(M_LOG10E, flags, retv); } static HRESULT Math_LN2(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 71a15181251..16fba150a87 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -624,4 +624,9 @@ ok(Math.floor(Math.LOG2E*100) === 144, "Math.LOG2E = " + Math.LOG2E); Math.LOG2E = "test"; ok(Math.floor(Math.LOG2E*100) === 144, "modified Math.LOG2E = " + Math.LOG2E); +ok(typeof(Math.LOG10E) === "number", "typeof(Math.LOG10E) = " + typeof(Math.LOG10E)); +ok(Math.floor(Math.LOG10E*100) === 43, "Math.LOG10E = " + Math.LOG10E); +Math.LOG10E = "test"; +ok(Math.floor(Math.LOG10E*100) === 43, "modified Math.LOG10E = " + Math.LOG10E); + reportSuccess(); -- 2.11.4.GIT