Implement date.prototype.toISOString() and date.prototype.toUTCString()
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
This commit is contained in:
committed by
Evgeny Gavrin
parent
d11dfc5703
commit
63083b3b51
@@ -58,3 +58,33 @@ catch (e)
|
||||
assert (e instanceof TypeError);
|
||||
assert (e.message === "Incompatible type");
|
||||
}
|
||||
|
||||
assert (new Date (NaN).toISOString () == "Invalid Date");
|
||||
assert (new Date ("2015-07-16").toISOString () == "2015-07-16T00:00:00.000Z");
|
||||
assert (new Date ("2015-07-16T11:29:05.023").toISOString () == "2015-07-16T11:29:05.023Z");
|
||||
|
||||
try
|
||||
{
|
||||
Date.prototype.toISOString.call(-1);
|
||||
assert (false);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
assert (e instanceof TypeError);
|
||||
assert (e.message === "Incompatible type");
|
||||
}
|
||||
|
||||
assert (new Date (NaN).toUTCString () == "Invalid Date");
|
||||
assert (new Date ("2015-07-16").toUTCString () == "2015-07-16T00:00:00.000Z");
|
||||
assert (new Date ("2015-07-16T11:29:05.023").toUTCString () == "2015-07-16T11:29:05.023Z");
|
||||
|
||||
try
|
||||
{
|
||||
Date.prototype.toUTCString.call(-1);
|
||||
assert (false);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
assert (e instanceof TypeError);
|
||||
assert (e.message === "Incompatible type");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user