Skip to content

Implement Date.UTC and add a dummy implementation for Date.now #305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

LaszloLango
Copy link
Contributor

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com

@LaszloLango
Copy link
Contributor Author

depends on #297

ECMA_FINALIZE (seconds_value);
}

if (args_len == 7 && ecma_is_completion_value_empty (ret_value))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, if a user passes 8 arguments we should work in that case also, we just won't do anything with the 8th argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'l fix it.

@LaszloLango LaszloLango added ecma builtins Related to ECMA built-in routines development Feature implementation labels Jul 6, 2015
@LaszloLango LaszloLango added this to the ECMA builtins milestone Jul 6, 2015
* When the UTC function is called with fewer than two arguments,
* the behaviour is implementation-dependent, so just return NaN.
*/
ecma_number_t *nan = ecma_alloc_number ();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it should be nan_p.

@LaszloLango LaszloLango force-pushed the date_now_utc_dev branch 2 times, most recently from d48d264 to 1b22e19 Compare July 7, 2015 06:50
@kkristof
Copy link
Contributor

kkristof commented Jul 7, 2015

lgtm

ecma_number_t seconds = ECMA_NUMBER_ZERO;
ecma_number_t milliseconds = ECMA_NUMBER_ZERO;

if (args_len >= 3 && ecma_is_completion_value_empty (ret_value))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add comment for each condition corresponding to http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.3.1 bullets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@LaszloLango
Copy link
Contributor Author

@egavrin, I've updated the PR, please check.

@egavrin
Copy link
Contributor

egavrin commented Jul 7, 2015

Good to me

@egavrin egavrin assigned LaszloLango and unassigned egavrin Jul 7, 2015
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
@LaszloLango LaszloLango merged commit 4f108ab into jerryscript-project:master Jul 7, 2015
@galpeter galpeter mentioned this pull request Jul 8, 2015
50 tasks
@LaszloLango LaszloLango deleted the date_now_utc_dev branch December 14, 2015 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Feature implementation ecma builtins Related to ECMA built-in routines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants