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

Should we really be reading {minimum,maximum}SignificantDigits twice? #131

Closed
littledan opened this issue Feb 24, 2017 · 2 comments
Closed

Comments

@littledan
Copy link
Member

It looks like, in SetNumberFormatDigitOptions, if either one returns something other than undefined for the first Get call, we do a second Get to get the real value that we use (from inside GetNumberOption). Is there a reason for this, besides that it was easier to write the spec that way? It would seem more straightforward if we just stuck with the value from the first time we read it out of the object.

@caridy
Copy link
Contributor

caridy commented Mar 17, 2017

You're correct, that code is not necessary since GetNumberOption() will return undefined for undefined values.

@littledan
Copy link
Member Author

I'm confused; won't GetNumberOption return the fallback if the value resulting from Get is undefined? It seems like this change you made will break the logic.

littledan added a commit to littledan/ecma402 that referenced this issue Mar 18, 2017
This patch refactors NumberFormat's option parsing code to avoid
redundant Get calls for {minimum,maximum}SignificantDigits .

Fixes tc39#131
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants