Skip to content

Commit

Permalink
Fix assertUnit and assertNoUnits (#1686)
Browse files Browse the repository at this point in the history
Fixes #1685.
  • Loading branch information
jathak committed May 10, 2022
1 parent 2e7db70 commit b19b3b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,11 @@
embedding the sources, when using the command-line interface or the legacy JS
API.

### JS API

* `SassNumber.assertUnit()` and `SassNumber.assertNoUnits()` now correctly
return the number called on when it passes the assertion.

## 1.51.0

* **Potentially breaking change**: Change the order of maps returned by
Expand Down
4 changes: 2 additions & 2 deletions lib/src/node/value/number.dart
Expand Up @@ -38,9 +38,9 @@ final JSClass numberClass = () {
'assertInRange': (SassNumber self, num min, num max, [String? name]) =>
self.valueInRange(min, max, name),
'assertNoUnits': (SassNumber self, [String? name]) =>
self.assertNoUnits(name),
self..assertNoUnits(name),
'assertUnit': (SassNumber self, String unit, [String? name]) =>
self.assertUnit(unit, name),
self..assertUnit(unit, name),
'hasUnit': (SassNumber self, String unit) => self.hasUnit(unit),
'compatibleWithUnit': (SassNumber self, String unit) =>
self.hasUnits && self.compatibleWithUnit(unit),
Expand Down

0 comments on commit b19b3b1

Please sign in to comment.