jscript: Added string argument handling to Date constructor.

This commit is contained in:
Piotr Caban 2009-07-06 10:38:08 +02:00 committed by Alexandre Julliard
parent 45817bf50f
commit 8150960f8c
2 changed files with 6 additions and 5 deletions

View File

@ -2617,12 +2617,11 @@ static HRESULT DateConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPP
if(FAILED(hres))
return hres;
if(V_VT(&prim) == VT_BSTR) {
FIXME("VT_BSTR not supported\n");
return E_NOTIMPL;
}
if(V_VT(&prim) == VT_BSTR)
hres = date_parse(V_BSTR(&prim), &num);
else
hres = to_number(dispex->ctx, &prim, ei, &num);
VariantClear(&prim);
if(FAILED(hres))
return hres;

View File

@ -940,6 +940,8 @@ 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");
date = new Date("3 July 2009 22:28:00 UTC+0100");
ok(date.getTime() === 1246656480000, "date.getTime() = " + date.getTime());
date = new Date(1984, 11, 29, 13, 51, 24, 120);
ok(date.getFullYear() === 1984, "date.getFullYear() = " + date.getFullYear());
ok(date.getMonth() === 11, "date.getMonth() = " + date.getMonth());