Skip to content

Commit 934bdd5

Browse files
authored
Set RangeError.start and .end for color range checks (#1215)
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.
1 parent 27c899e commit 934bdd5

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.32.6
2+
3+
### Dart API
4+
5+
* All range checks for `SassColor` constructors now throw `RangeError`s with
6+
`start` and `end` set.
7+
18
## 1.32.5
29

310
* **Potentially breaking bug fix:** When using `@for` with numbers that have

lib/src/util/number.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,6 @@ num fuzzyCheckRange(num number, num min, num max) {
8989
num fuzzyAssertRange(num number, num min, num max, [String name]) {
9090
var result = fuzzyCheckRange(number, min, max);
9191
if (result != null) return result;
92-
throw RangeError.value(number, name, "must be between $min and $max.");
92+
throw RangeError.range(
93+
number, min, max, name, "must be between $min and $max");
9394
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass
2-
version: 1.32.5
2+
version: 1.32.6-dev
33
description: A Sass implementation in Dart.
44
author: Sass Team
55
homepage: https://github.com/sass/dart-sass

0 commit comments

Comments
 (0)