Commit eb203a14 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

jscript: Remove NaN related FIXMEs.

parent 931554dd
...@@ -81,11 +81,8 @@ static const WCHAR setUTCFullYearW[] = {'s','e','t','U','T','C','F','u','l','l', ...@@ -81,11 +81,8 @@ static const WCHAR setUTCFullYearW[] = {'s','e','t','U','T','C','F','u','l','l',
/* ECMA-262 3rd Edition 15.9.1.14 */ /* ECMA-262 3rd Edition 15.9.1.14 */
static inline DOUBLE time_clip(DOUBLE time) static inline DOUBLE time_clip(DOUBLE time)
{ {
/* FIXME: Handle inf */
if(8.64e15 < time || time < -8.64e15) { if(8.64e15 < time || time < -8.64e15) {
FIXME("return NaN\n"); return ret_nan();
return 0.0;
} }
return floor(time); return floor(time);
......
...@@ -351,8 +351,8 @@ static HRESULT JSGlobal_parseInt(DispatchEx *dispex, LCID lcid, WORD flags, DISP ...@@ -351,8 +351,8 @@ static HRESULT JSGlobal_parseInt(DispatchEx *dispex, LCID lcid, WORD flags, DISP
HRESULT hres; HRESULT hres;
if(!arg_cnt(dp)) { if(!arg_cnt(dp)) {
FIXME("NAN\n"); if(retv) num_set_nan(retv);
return E_NOTIMPL; return S_OK;
} }
if(arg_cnt(dp) >= 2) { if(arg_cnt(dp) >= 2) {
......
...@@ -255,6 +255,13 @@ static inline void num_set_nan(VARIANT *v) ...@@ -255,6 +255,13 @@ static inline void num_set_nan(VARIANT *v)
#endif #endif
} }
static inline DOUBLE ret_nan()
{
VARIANT v;
num_set_nan(&v);
return V_R8(&v);
}
static inline void num_set_inf(VARIANT *v, BOOL positive) static inline void num_set_inf(VARIANT *v, BOOL positive)
{ {
V_VT(v) = VT_R8; V_VT(v) = VT_R8;
......
...@@ -254,8 +254,8 @@ static HRESULT String_charCodeAt(DispatchEx *dispex, LCID lcid, WORD flags, DISP ...@@ -254,8 +254,8 @@ static HRESULT String_charCodeAt(DispatchEx *dispex, LCID lcid, WORD flags, DISP
return hres; return hres;
if(V_VT(&v) != VT_I4 || V_I4(&v) < 0 || V_I4(&v) >= length) { if(V_VT(&v) != VT_I4 || V_I4(&v) < 0 || V_I4(&v) >= length) {
FIXME("NAN\n"); if(retv) num_set_nan(&v);
return E_FAIL; return S_OK;
} }
idx = V_I4(&v); idx = V_I4(&v);
......
...@@ -934,6 +934,12 @@ var date = new Date(); ...@@ -934,6 +934,12 @@ var date = new Date();
date = new Date(100); date = new Date(100);
ok(date.getTime() === 100, "date.getTime() = " + date.getTime()); ok(date.getTime() === 100, "date.getTime() = " + date.getTime());
ok(Date.prototype.getTime() === 0, "date.prototype.getTime() = " + Date.prototype.getTime()); ok(Date.prototype.getTime() === 0, "date.prototype.getTime() = " + Date.prototype.getTime());
date = new Date(8.64e15);
ok(date.getTime() === 8.64e15, "date.getTime() = " + date.getTime());
date = new Date(8.64e15+1);
ok(isNaN(0+date.getTime()), "date.getTime() is not NaN");
date = new Date(Infinity);
ok(isNaN(0+date.getTime()), "date.getTime() is not NaN");
ok(typeof(Math.PI) === "number", "typeof(Math.PI) = " + typeof(Math.PI)); ok(typeof(Math.PI) === "number", "typeof(Math.PI) = " + typeof(Math.PI));
ok(Math.floor(Math.PI*100) === 314, "Math.PI = " + Math.PI); ok(Math.floor(Math.PI*100) === 314, "Math.PI = " + Math.PI);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment