Skip to content
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

Handle string 0 in math helper #117

Merged
merged 1 commit into from
Mar 7, 2015

Conversation

sethkinast
Copy link
Contributor

Unbitrotted #54

key = dust.helpers.tap(key, chunk, context);
operand = dust.helpers.tap(operand, chunk, context);
key = parseFloat(dust.helpers.tap(key, chunk, context));
operand = parseFloat(dust.helpers.tap(operand, chunk, context));
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need to do any error checking here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shouldn't need to. Anything icky coerces to NaN and that's the eventual math output.

@smfoote
Copy link
Contributor

smfoote commented Mar 6, 2015

Looks good. Can you add some tests?

@sethkinast
Copy link
Contributor Author

I promise to add tests, but the framework inside -helpers doesn't support testing log messages.

I'll port that part over from main, but I don't want to do it as part of this PR.

Tests already exist for div by 0 and such-- the only test that doesn't exist is that the correct message is logged.

Is OK?

@smfoote
Copy link
Contributor

smfoote commented Mar 6, 2015

Works for me.

prashn64 added a commit that referenced this pull request Mar 7, 2015
Handle string 0 in math helper and add toint to the params for @math.
@prashn64 prashn64 merged commit 75da720 into LinkedInAttic:master Mar 7, 2015
@sethkinast sethkinast deleted the math-float branch March 7, 2015 00:19
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