Remove unneccesary UTC time conversion in the parser of the Date object.
We don't need to convert time to UTC time when the argument is suffixed with 'Z'. JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
This commit is contained in:
@@ -327,10 +327,7 @@ ecma_builtin_date_parse (ecma_value_t this_arg __attr_unused___, /**< this argum
|
|||||||
&& !ecma_number_is_nan (time))
|
&& !ecma_number_is_nan (time))
|
||||||
{
|
{
|
||||||
lit_utf8_iterator_incr (&iter);
|
lit_utf8_iterator_incr (&iter);
|
||||||
time = ecma_date_utc (ecma_date_make_time (hours,
|
time = ecma_date_make_time (hours, minutes, seconds, milliseconds);
|
||||||
minutes,
|
|
||||||
seconds,
|
|
||||||
milliseconds));
|
|
||||||
}
|
}
|
||||||
else if (!lit_utf8_iterator_is_eos (&iter)
|
else if (!lit_utf8_iterator_is_eos (&iter)
|
||||||
&& (lit_utf8_iterator_peek_next (&iter) == '+'
|
&& (lit_utf8_iterator_peek_next (&iter) == '+'
|
||||||
|
|||||||
@@ -115,3 +115,5 @@ assert (Date (Number.NaN) == Date ());
|
|||||||
// Fixme: remove these cases when TZA and DST are supported.
|
// Fixme: remove these cases when TZA and DST are supported.
|
||||||
assert (new Date ("2015-07-08T11:29:05.023-02:00").toString() == "2015-07-08T13:29:05.023");
|
assert (new Date ("2015-07-08T11:29:05.023-02:00").toString() == "2015-07-08T13:29:05.023");
|
||||||
assert (new Date ("2015-07-08T11:29:05.023-02:00").toLocaleString() == "2015-07-08T13:29:05.023");
|
assert (new Date ("2015-07-08T11:29:05.023-02:00").toLocaleString() == "2015-07-08T13:29:05.023");
|
||||||
|
|
||||||
|
assert (new Date ("2015-07-08T11:29:05.023Z").toISOString() == "2015-07-08T11:29:05.023Z");
|
||||||
|
|||||||
Reference in New Issue
Block a user