Skip to content

Number.prototype functions should throw TypeError if 'this' is not number. #382

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

Closed

Conversation

dbatyai
Copy link
Member

@dbatyai dbatyai commented Jul 13, 2015

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

@dbatyai dbatyai added bug Undesired behaviour ecma builtins Related to ECMA built-in routines labels Jul 13, 2015
@dbatyai dbatyai added this to the ECMA builtins milestone Jul 13, 2015

try {
assert(obj.toFixed(-1));
(12).toFixed(-1);
Copy link
Contributor

Choose a reason for hiding this comment

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

@dbatyai, why do we need the change?

@ruben-ayrapetyan
Copy link
Contributor

Beginning of current ecma_builtin_number_prototype_object_to_string implementation contains code very similar to ecma_builtin_number_prototype_object_value_of function. Maybe, we could replace it with the call to valueOf too.

@ruben-ayrapetyan ruben-ayrapetyan self-assigned this Jul 13, 2015
@dbatyai dbatyai force-pushed the number_functions_this_type branch from 8c43f52 to 095c34e Compare July 14, 2015 12:28
@dbatyai
Copy link
Member Author

dbatyai commented Jul 14, 2015

@ruben-ayrapetyan, I've updated the PR.

@ruben-ayrapetyan
Copy link
Contributor

Looks good to me

@zherczeg
Copy link
Member

LGTM

@egavrin
Copy link
Contributor

egavrin commented Jul 15, 2015

make push

@egavrin egavrin assigned dbatyai and unassigned egavrin Jul 15, 2015
…mber.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
@dbatyai dbatyai force-pushed the number_functions_this_type branch from 095c34e to 5963d15 Compare July 15, 2015 12:46
@egavrin
Copy link
Contributor

egavrin commented Jul 15, 2015

Merged at e5b2e1e

@egavrin egavrin closed this Jul 15, 2015
@dbatyai dbatyai deleted the number_functions_this_type branch July 31, 2015 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behaviour ecma builtins Related to ECMA built-in routines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants