Skip to content

Fix Number.prototype.toFixed if argument is outside int32 range #298

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

dbatyai
Copy link
Member

@dbatyai dbatyai commented Jul 3, 2015

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com

@egavrin
Copy link
Contributor

egavrin commented Jul 3, 2015

Good to me

@@ -251,6 +248,9 @@ ecma_builtin_number_prototype_object_to_fixed (ecma_value_t this_arg, /**< this
int32_t num_digits = 0;
int32_t exponent = 1;

/* 1. */
int32_t frac_digits = ecma_number_to_int32 (arg_num);

Copy link
Member

Choose a reason for hiding this comment

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

number_to_int32 returns 0 for -0.9? I don't know, just asking.

Copy link
Member Author

Choose a reason for hiding this comment

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

It does. I'll add a test case for this.

@dbatyai dbatyai force-pushed the number_tofixed_infinity_fix branch from 4133768 to 95be3df Compare July 3, 2015 12:49
@galpeter
Copy link
Contributor

galpeter commented Jul 6, 2015

lgtm

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
@dbatyai dbatyai force-pushed the number_tofixed_infinity_fix branch from 95be3df to 47cd42e Compare July 6, 2015 13:17
@dbatyai dbatyai merged commit 47cd42e into jerryscript-project:master Jul 6, 2015
@dbatyai dbatyai deleted the number_tofixed_infinity_fix branch July 7, 2015 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants