Skip to content

Commit

Permalink
Set RangeError.start and .end for color range checks (#1215)
Browse files Browse the repository at this point in the history
This is useful for sass/dart-sass-embedded#32 because it makes the
range checks easier to deconstruct and reconstruct into useful
embedded error messages.
  • Loading branch information
nex3 committed Jan 27, 2021
1 parent 27c899e commit 934bdd5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.32.6

### Dart API

* All range checks for `SassColor` constructors now throw `RangeError`s with
`start` and `end` set.

## 1.32.5

* **Potentially breaking bug fix:** When using `@for` with numbers that have
Expand Down
3 changes: 2 additions & 1 deletion lib/src/util/number.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,6 @@ num fuzzyCheckRange(num number, num min, num max) {
num fuzzyAssertRange(num number, num min, num max, [String name]) {
var result = fuzzyCheckRange(number, min, max);
if (result != null) return result;
throw RangeError.value(number, name, "must be between $min and $max.");
throw RangeError.range(
number, min, max, name, "must be between $min and $max");
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass
version: 1.32.5
version: 1.32.6-dev
description: A Sass implementation in Dart.
author: Sass Team
homepage: https://github.com/sass/dart-sass
Expand Down

0 comments on commit 934bdd5

Please sign in to comment.