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.
This commit is contained in:
Natalie Weizenbaum 2021-01-27 15:50:02 -08:00 committed by GitHub
parent 27c899e77b
commit 934bdd556a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -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");
}

View File

@ -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