From 7564b6a51a4c9727ce3c5b453da14cf2f97a5e29 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Sun, 8 Jan 2017 21:26:05 -0800 Subject: [PATCH] Include names in unit assertion errors. --- lib/src/value/number.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/value/number.dart b/lib/src/value/number.dart index 9abf5b29..cb9dba04 100644 --- a/lib/src/value/number.dart +++ b/lib/src/value/number.dart @@ -278,7 +278,7 @@ class SassNumber extends Value { /// (without the `$`). It's used for debugging. void assertUnit(String unit, [String name]) { if (hasUnit(unit)) return; - throw _exception('Expected $this to have unit "$unit".'); + throw _exception('Expected $this to have unit "$unit".', name); } /// Throws a [SassScriptException] unless [this] has no units. @@ -287,7 +287,7 @@ class SassNumber extends Value { /// (without the `$`). It's used for debugging. void assertNoUnits([String name]) { if (!hasUnits) return; - throw _exception('Expected $this to have no units.'); + throw _exception('Expected $this to have no units.', name); } /// Returns a copy of this number, converted to the units represented by