Csaba Osztrogonác
32c74fff22
Fix Date.prototype.toString() and toISOString() ( #3175 )
...
The implementation was incorrect for negative years and years bigger than 9999.
-1 was 000/ because the negative (year%10) was added to '0' character, years
bigger than 9999 was truncated to 4 digits.
ES5.1 15.9.1.15.1 defines extended years format with 6 digits, but toString()
and toISOString() sections don't mention anything about extended years. ES6
20.3.4.3 already clarifies that Date.prototype.toISOString() should use this
extended year format if it is necessary.
Changes:
- Date.prototype.toString() uses 4 digits for years by default, 5 or 6 if it
is necessary and put '-' sign for negative years, no sign for positive years.
Date.prototype.toString() was implementation dependent until ES9, but ES9
already specify exactly this format.
- Date.prototype.toISOString() uses fixed 4 digits for years 0 - 9999,
otherwise sign + 6 digits (extended years).
- Tests added for corner cases.
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-10-02 10:26:20 +02:00
..
2019-09-27 16:56:24 +02:00
2019-06-24 11:18:37 +02:00
2019-04-09 10:14:46 +02:00
2019-09-12 13:05:24 +02:00
2019-06-24 11:14:06 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-08-30 14:01:30 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-16 08:26:39 +02:00
2019-04-16 08:26:39 +02:00
2019-04-16 08:26:39 +02:00
2019-04-16 08:26:39 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-10-01 15:08:16 +02:00
2019-04-09 10:14:46 +02:00
2018-05-14 09:41:26 +09:00
2017-03-23 09:36:29 +01:00
2016-12-08 06:39:11 +01:00
2017-03-23 09:36:29 +01:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-07-17 14:10:05 +02:00
2019-07-17 14:10:05 +02:00
2019-07-17 14:44:18 +02:00
2017-03-23 09:36:29 +01:00
2019-08-26 17:30:21 +02:00
2019-05-10 20:28:43 +02:00
2019-10-02 10:26:20 +02:00
2017-12-06 18:06:07 +01:00
2019-09-12 13:05:24 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2018-08-22 08:49:12 +02:00
2019-09-12 13:05:24 +02:00
2019-09-12 13:05:24 +02:00
2019-04-16 08:26:39 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-09-12 13:05:24 +02:00
2019-04-09 10:14:46 +02:00
2019-06-24 11:18:37 +02:00
2019-06-24 11:18:37 +02:00
2019-06-24 11:18:37 +02:00
2019-06-24 11:18:37 +02:00
2019-06-24 11:18:37 +02:00
2019-04-09 10:14:46 +02:00
2019-07-24 19:41:03 +02:00
2019-07-11 19:42:27 +02:00
2019-10-02 10:25:52 +02:00
2019-07-17 14:10:20 +02:00
2019-08-27 10:18:51 +02:00
2019-08-27 10:18:51 +02:00
2019-07-17 14:09:29 +02:00
2019-07-17 14:09:29 +02:00
2019-09-12 13:05:24 +02:00
2019-07-17 14:09:44 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-08-27 18:28:03 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-07-17 08:14:38 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-06-24 11:18:37 +02:00
2019-06-24 11:18:37 +02:00
2019-06-24 11:18:37 +02:00
2019-06-24 11:18:37 +02:00
2019-06-24 11:18:37 +02:00
2019-05-10 20:28:43 +02:00
2019-05-30 12:34:19 -04:00
2019-05-30 12:34:19 -04:00
2019-09-16 12:55:33 +02:00
2019-07-17 14:09:14 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-08-30 15:16:27 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2016-12-08 06:39:11 +01:00
2017-03-23 09:36:29 +01:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-04-09 10:14:46 +02:00
2019-08-27 10:18:51 +02:00
2019-09-12 13:05:24 +02:00
2019-09-12 13:05:24 +02:00
2019-06-24 11:18:37 +02:00