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

Fix assertUnit and assertNoUnits #1686

Merged
merged 1 commit into from May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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