@@ -92,16 +92,16 @@ ecma_date_insert_num_with_sep (ecma_string_t **str_p, /**< input/output string *
9292} /* ecma_date_insert_num_with_sep */
9393
9494/* *
95- * The Date.prototype object's 'toString ' routine
95+ * The Date.prototype object's 'toISOString ' routine
9696 *
9797 * See also:
98- * ECMA-262 v5, 15.9.5.2
98+ * ECMA-262 v5, 15.9.5.43
9999 *
100100 * @return completion value
101101 * Returned value must be freed with ecma_free_completion_value.
102102 */
103103static ecma_completion_value_t
104- ecma_builtin_date_prototype_to_string (ecma_value_t this_arg) /* *< this argument */
104+ ecma_builtin_date_prototype_to_iso_string (ecma_value_t this_arg) /* *< this argument */
105105{
106106 ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
107107
@@ -130,7 +130,12 @@ ecma_builtin_date_prototype_to_string (ecma_value_t this_arg) /**< this argument
130130 else
131131 {
132132 ecma_number_t milliseconds = ecma_date_ms_from_time (*prim_value_num_p);
133- ecma_string_t *output_str_p = ecma_new_ecma_string_from_number (milliseconds);
133+ ecma_string_t *msec_str_p = ecma_new_ecma_string_from_number (milliseconds);
134+ ecma_string_t *time_zone_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_TIME_ZONE_U);
135+
136+ ecma_string_t *output_str_p = ecma_concat_ecma_strings (msec_str_p, time_zone_str_p);
137+ ecma_deref_ecma_string (msec_str_p);
138+ ecma_deref_ecma_string (time_zone_str_p);
134139 ecma_date_insert_leading_zeros (&output_str_p, milliseconds, 3 );
135140
136141 ecma_number_t seconds = ecma_date_sec_from_time (*prim_value_num_p);
@@ -163,6 +168,21 @@ ecma_builtin_date_prototype_to_string (ecma_value_t this_arg) /**< this argument
163168 }
164169
165170 return ret_value;
171+ } /* ecma_builtin_date_prototype_to_iso_string */
172+
173+ /* *
174+ * The Date.prototype object's 'toString' routine
175+ *
176+ * See also:
177+ * ECMA-262 v5, 15.9.5.2
178+ *
179+ * @return completion value
180+ * Returned value must be freed with ecma_free_completion_value.
181+ */
182+ static ecma_completion_value_t
183+ ecma_builtin_date_prototype_to_string (ecma_value_t this_arg) /* *< this argument */
184+ {
185+ return ecma_builtin_date_prototype_to_iso_string (this_arg);
166186} /* ecma_builtin_date_prototype_to_string */
167187
168188/* *
@@ -1195,21 +1215,6 @@ ecma_builtin_date_prototype_to_utc_string (ecma_value_t this_arg) /**< this argu
11951215 ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg);
11961216} /* ecma_builtin_date_prototype_to_utc_string */
11971217
1198- /* *
1199- * The Date.prototype object's 'toISOString' routine
1200- *
1201- * See also:
1202- * ECMA-262 v5, 15.9.5.43
1203- *
1204- * @return completion value
1205- * Returned value must be freed with ecma_free_completion_value.
1206- */
1207- static ecma_completion_value_t
1208- ecma_builtin_date_prototype_to_iso_string (ecma_value_t this_arg) /* *< this argument */
1209- {
1210- ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg);
1211- } /* ecma_builtin_date_prototype_to_iso_string */
1212-
12131218/* *
12141219 * The Date.prototype object's 'toJSON' routine
12151220 *
0 commit comments