Skip to content

Sprite.prototype.toNumber(value, true) - strict cast to number#203

Merged
adroitwhiz merged 1 commit intoleopard-js:masterfrom
towerofnix:strict-toNumber
Jan 15, 2026
Merged

Sprite.prototype.toNumber(value, true) - strict cast to number#203
adroitwhiz merged 1 commit intoleopard-js:masterfrom
towerofnix:strict-toNumber

Conversation

@towerofnix
Copy link
Member

Supporting PR for leopard-js/sb-edit#149 or leopard-js/sb-edit#150.

Note during code review - Number.isNaN checks if its paremeter is literally the value NaN. isNaN checks if it's NaN or it's not a number primitive at all. We've removed a usage of isNaN, though there's no effective difference for the actual predicate value of that condition, since it used to be behind a typeof value === "number" check anyway.

@towerofnix towerofnix requested review from PullJosh and adroitwhiz July 9, 2024 15:54
@adroitwhiz adroitwhiz merged commit d33dddd into leopard-js:master Jan 15, 2026
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