jscript: Added undefined to number conversion implementation.

This commit is contained in:
Jacek Caban 2008-10-15 18:49:59 -05:00 committed by Alexandre Julliard
parent 53ade93cd9
commit 7b41f77746
2 changed files with 7 additions and 0 deletions

View File

@ -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;

View File

@ -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();