Skip to content

throw an error when argument to percentage is not a number #2579

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
wants to merge 1 commit into from
Closed

throw an error when argument to percentage is not a number #2579

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 30, 2015

This is a bugfix to Issue #2553 . Added an error thrown if the arguments do not equal a number.

if (typeof n !== "number") {
throw { type: "Argument", message: "argument must be a number" };
}

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, but there are a number of problems.
First, it fails jscs - the line I'm commenting on has trailing whitespace. You can verify this with grunt jscs
Second, if you look below, we expect n to be of type Dimension, so n.value will be type number
Third, ideally it would be good to get a unit test for this - in the errors sub directory (run tests with grunt test)

@lukeapage lukeapage closed this May 21, 2015
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.

1 participant