Fix [[Construct]] call for Date()

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
This commit is contained in:
Roland Takacs
2015-07-27 13:54:19 +02:00
parent f7781bb7bc
commit b5923ccd9d
6 changed files with 108 additions and 84 deletions
@@ -470,13 +470,20 @@ ecma_builtin_date_now (ecma_value_t this_arg __attr_unused___) /**< this argumen
* @return completion-value
*/
ecma_completion_value_t
ecma_builtin_date_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
ecma_builtin_date_dispatch_call (const ecma_value_t *arguments_list_p __attr_unused___, /**< arguments list */
ecma_length_t arguments_list_len __attr_unused___) /**< number of arguments */
{
/* FIXME:
* Fix this, after Date.prototype.toString is finished.
*/
return ecma_builtin_date_dispatch_construct (arguments_list_p, arguments_list_len);
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
ECMA_TRY_CATCH (now_val,
ecma_builtin_date_now (ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED)),
ret_value);
ret_value = ecma_date_value_to_string (*ecma_get_number_from_value (now_val), ECMA_DATE_LOCAL);
ECMA_FINALIZE (now_val);
return ret_value;
} /* ecma_builtin_date_dispatch_call */
/**