Commit 8150960f authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

jscript: Added string argument handling to Date constructor.

parent 45817bf5
......@@ -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);
hres = to_number(dispex->ctx, &prim, ei, &num);
VariantClear(&prim);
if(FAILED(hres))
return hres;
......
......@@ -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());
......
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