Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Commit

Permalink
Allow mod 0 (#2486)
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 authored Mar 16, 2018
1 parent ed215ad commit 00873b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc-src/SASS_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* Don't crash on custom properties that aren't followed by semicolons.

* Don't crash when normalizing numbers with complex units.

* Don't crash on `$x % 0`.

## 3.5.5 (4 January 2018)

Expand Down
1 change: 1 addition & 0 deletions lib/sass/script/value/number.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def div(other)
# @raise [Sass::UnitConversionError] if `other` has incompatible units
def mod(other)
if other.is_a?(Number)
return Number.new(Float::NAN) if other.value == 0
operate(other, :%)
else
raise NoMethodError.new(nil, :mod)
Expand Down

0 comments on commit 00873b0

Please sign in to comment.