Skip to content

Conversation

ning-y
Copy link
Member

@ning-y ning-y commented Oct 4, 2018

Behaviour now follows ES6 except:

  • If either args str or radix is not provided, source error is thrown
  • If first arg is not str, source error is thrown
  • If second arg is not integer in [2, 36], source error is thrown

Resolves #52.

@coveralls
Copy link

coveralls commented Oct 4, 2018

Pull Request Test Coverage Report for Build 159

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.1%) to 61.502%

Totals Coverage Status
Change from base Build 153: 1.1%
Covered Lines: 798
Relevant Lines: 1231

💛 - Coveralls

@ning-y ning-y changed the title WIP: Restrict parse_int radix to [2, 36] Restrict parse_int radix to [2, 36] Oct 4, 2018
@ning-y ning-y requested review from martin-henz, remo5000 and yyc October 4, 2018 16:23
@ning-y
Copy link
Member Author

ning-y commented Oct 4, 2018

@martin-henz Are the specifications here reasonable? Instead of returning NaN for values of radix outside of [2, 36], we throw an error. This is because ES6 specifies the radix to be an argument between 2 and 36. In addition, we throw an error for non-integer radix arguments. Nonetheless, everything that passes without an error in source returns the same thing that ES6 would.

@martin-henz
Copy link
Member

Yes, that's fine.

Copy link
Member

@martin-henz martin-henz left a comment

Choose a reason for hiding this comment

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

Yes, that's fine.

@martin-henz martin-henz merged commit 462b050 into master Oct 24, 2018
@ning-y ning-y deleted the parse_int_to_return_nan branch October 25, 2018 08:46
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