Skip to content

Commit

Permalink
warn about unsafe arithmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudxain authored Dec 1, 2024
1 parent 124ce92 commit bda6dd4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ const RGBDR_anim = (() => {
// don't do this at home, kids!
const y = this.#y += n
if (is_inf_nan(y))
// WARN: if a `try` `catch`es this,
// the invariant will be broken!
throw new RangeError(`${y}`)
return y
}
Expand Down

0 comments on commit bda6dd4

Please sign in to comment.