Jacek Caban : jscript: Added undefined to number conversion implementation.
Alexandre Julliard
julliard at winehq.org
Thu Oct 16 06:07:09 CDT 2008
Module: wine
Branch: master
Commit: 7b41f777463441e9cc09a9576653c766c28df622
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7b41f777463441e9cc09a9576653c766c28df622
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Oct 15 18:49:59 2008 -0500
jscript: Added undefined to number conversion implementation.
---
dlls/jscript/jsutils.c | 6 ++++++
dlls/jscript/tests/lang.js | 1 +
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c
index c6f4b9c..2adfcb7 100644
--- a/dlls/jscript/jsutils.c
+++ b/dlls/jscript/jsutils.c
@@ -16,6 +16,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "config.h"
+#include "wine/port.h"
+
#include <math.h>
#include "jscript.h"
@@ -325,6 +328,9 @@ static HRESULT str_to_number(BSTR str, VARIANT *ret)
HRESULT to_number(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret)
{
switch(V_VT(v)) {
+ case VT_EMPTY:
+ num_set_nan(ret);
+ break;
case VT_NULL:
V_VT(ret) = VT_I4;
V_I4(ret) = 0;
diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js
index 5f14eb1..5d53320 100644
--- a/dlls/jscript/tests/lang.js
+++ b/dlls/jscript/tests/lang.js
@@ -790,5 +790,6 @@ ok(isNaN(0.5) === false, "isNaN(0.5) !== false");
ok(isNaN() === true, "isNaN() !== true");
ok(isNaN(NaN, 0) === true, "isNaN(NaN, 0) !== true");
ok(isNaN(0.5, NaN) === false, "isNaN(0.5, NaN) !== false");
+ok(isNaN(+undefined) === true, "isNaN(+undefined) !== true");
reportSuccess();
More information about the wine-cvs
mailing list