Jacek Caban : jscript: Added Math.E implementation.
Alexandre Julliard
julliard at winehq.org
Thu Dec 11 07:50:49 CST 2008
Module: wine
Branch: master
Commit: da03e6779d36e27f4bf1652db019c108e1267c80
URL: http://source.winehq.org/git/wine.git/?a=commit;h=da03e6779d36e27f4bf1652db019c108e1267c80
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Dec 11 12:27:52 2008 +0100
jscript: Added Math.E implementation.
---
dlls/jscript/math.c | 5 +++--
dlls/jscript/tests/api.js | 5 +++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/jscript/math.c b/dlls/jscript/math.c
index ceabc36..fd8bb55 100644
--- a/dlls/jscript/math.c
+++ b/dlls/jscript/math.c
@@ -69,11 +69,12 @@ static HRESULT math_constant(DOUBLE val, WORD flags, VARIANT *retv)
return E_NOTIMPL;
}
+/* ECMA-262 3rd Edition 15.8.1.1 */
static HRESULT Math_E(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_E, flags, retv);
}
static HRESULT Math_LOG2E(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js
index 7381612..169bc94 100644
--- a/dlls/jscript/tests/api.js
+++ b/dlls/jscript/tests/api.js
@@ -614,4 +614,9 @@ ok(Math.floor(Math.PI*100) === 314, "Math.PI = " + Math.PI);
Math.PI = "test";
ok(Math.floor(Math.PI*100) === 314, "modified Math.PI = " + Math.PI);
+ok(typeof(Math.E) === "number", "typeof(Math.E) = " + typeof(Math.E));
+ok(Math.floor(Math.E*100) === 271, "Math.E = " + Math.E);
+Math.E = "test";
+ok(Math.floor(Math.E*100) === 271, "modified Math.E = " + Math.E);
+
reportSuccess();
More information about the wine-cvs
mailing list