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

Core: Fix the nullish coalescing operator in _updateScalesRange #493

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

50rayn
Copy link
Contributor

@50rayn 50rayn commented Nov 27, 2024

I got this interesting warning when playing around with the project build.

src/containers/xy-container/index.ts: The "??" operator here will always return the left operand

And the compiler was right. In case config.padding.bottom will be undefined, subtraction will get NaN. The operator will be applied to the result of the subtraction but not the config.padding.bottom. So the fix was easy, just wrapping up with paratheses.

@rokotyan
Copy link
Contributor

@50rayn You're right! I wonder how did we miss it. Thanks

@50rayn
Copy link
Contributor Author

50rayn commented Nov 27, 2024

Thanks to Vite :D .
I was trying to integrate Vite in @unovis/ts.

@rokotyan
Copy link
Contributor

@50rayn Cool, it's something I wanted to do for a long time

@lee00678 lee00678 merged commit 81dd74a into f5:main Dec 4, 2024
4 checks passed
@50rayn 50rayn deleted the fix/nullish-substract branch December 4, 2024 21:48
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.

3 participants